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

2 minutes ago
5 minutes ago
Honey Bun updated their profile
6 minutes ago
17 minutes ago
18 minutes ago
23 minutes ago
25 minutes ago
26 minutes ago

### Assignment 1

27 minutes ago
Humaira Khadim joined +M.Tariq Malik's group

28 minutes ago

28 minutes ago

1

2

3