We have been working very hard since 2009 to facilitate in your learning Read More. We can't keep up without your support. Donate Now.

www.vustudents.ning.com

 www.bit.ly/vucodes + Link For Assignments, GDBs & Online Quizzes Solution www.bit.ly/papersvu + Link For Past Papers, Solved MCQs, Short Notes & More

Looking For Something at Site? Search Below

# Assignment No. 02 Graded Semester: Spring 2018 CS609: System Programming

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

Views: 10261

Attachments:

### Replies to This Discussion

jahan divisors likha wahan black color code ko replace kerdo.

Lekin pta nhi kiun yeh coding wese nhi hui jesi required hai assign 2 mein.

lekin is program mein 4 divisor hain aur interval bhi correct hona chaiye

online decimal to hexa

koi Allah ka nak bandamari b kar day idbc140402080

time kam rah gya ha

Bro koe complete solution send kr do please

#define ON
#define OFF
(1)
(0)
/*------------------------------------------------
ChangeSpeaker - Turn speaker on or off.
*/
void ChangeSpeaker( int status )
{
int portval;
portval = inportb( 0x61 );
if ( status==ON )
portval |= 0x03;

else
portval &=~ 0x03;
outportb( 0x61, portval );
} /*--ChangeSpeaker( )----------*/
void Sound( int hertz )
{
unsigned divisor = 1193180L / hertz;

ChangeSpeaker( ON );
outportb(
outportb(
outportb(
} /*--Sound(
0x43, 0xB6 );
0x42, divisor & 0xFF ) ;
0x42, divisor >> 8 ) ;
)-----*/
void NoSound( void )
{
ChangeSpeaker( OFF );
} /*--NoSound( )------*/

int main( void )
{
Sound( 355 );
delay( 1000 );
Sound( 733 );
delay( 1000 );
NoSound( );
return(0);
} /*--main( )-------*/

is dis correct?

ab yeh new story agai samne

page 74 and 75 just nothing more

If we connect a timer with PC speaker, it will produce sound. We can connect PIT with
PC speakers to get the required sound. The output port of speaker is 61h. bit0 of port 61h is used
to enable timer to supply clock signal to speaker i.e. connects PIT with speaker.
Now let’s write our own sound( ) and nosound( ) function to produce sound.
#define ON
#define OFF
(1)
(0)
/*------------------------------------------------
ChangeSpeaker - Turn speaker on or off.
*/
void ChangeSpeaker( int status )
{
int portval;
portval = inportb( 0x61 );
if ( status==ON )
portval |= 0x03;

else
portval &=~ 0x03;
outportb( 0x61, portval );
} /*--ChangeSpeaker( )----------*/
void Sound( int hertz )
{
unsigned divisor = 1193180L / hertz;

ChangeSpeaker( ON );
outportb(
outportb(
outportb(
} /*--Sound(
0x43, 0xB6 );
0x42, divisor & 0xFF ) ;
0x42, divisor >> 8 ) ;
)-----*/
void NoSound( void )
{
ChangeSpeaker( OFF );
} /*--NoSound( )------*/

int main( void )
{
Sound( 355 );
delay( 1000 );
Sound( 733 );
delay( 1000 );
NoSound( );
return(0);
}
just an idea not solution

bro solution he bta dn k exact kn sa hy

## Latest Activity

EsT@TiC M@nO posted a status
"anyone have solution file of cs420?"
2 hours ago
Ehtisham Ashfaq posted a status
"salam"
2 hours ago
2 hours ago
2 hours ago
2 hours ago
Tasmia Ittba joined +M.Tariq Malik's group

### MTH301 Calculus II

3 hours ago
3 hours ago
3 hours ago
+M.Tariq Malik added a discussion to the group MGT401 Financial Accounting II

### MGT401 Financial Accounting II Online Quiz No 01 Fall 2020 Solution / Discussion

3 hours ago
3 hours ago
Muhammad Azeem joined +M.Tariq Malik's group

### MGT601 SME Management

3 hours ago
3 hours ago
3 hours ago
+M.Tariq Malik added a discussion to the group CS420 Web Development for Portable Devices

3 hours ago

3 hours ago

3 hours ago