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

# 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: 10262

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

5 minutes ago
5 minutes ago
11 minutes ago
Blessings liked Blessings's profile
12 minutes ago
20 minutes ago
Mani Siddiqui Ex posted a status
"جینے والوں نے خود کشی کر لی.. رہ گئے جو، اداس رہتے ہیں.."
21 minutes ago
25 minutes ago
29 minutes ago
31 minutes ago
33 minutes ago
Ayesha, Rabi Rajput, Nabila and 18 more joined Virtual University of Pakistan
35 minutes ago
41 minutes ago
2 hours ago
Blessings posted a status
"Mn is qabil tu na tha .....................jis qabil mjhe RUB ne bna diya JUMMA MUBBARAK"
2 hours ago
3 hours ago
+M.Tariq Malik liked ･༓☾ Shayna ☽༓･'s blog post ✿ Money Can't Buy ✿
3 hours ago
3 hours ago
Ali Fahad joined +M.Tariq Malik's group

### CS101 Introduction to Computing

4 hours ago
Ali Fahad joined +M.Tariq Malik's group

### MGT503 Principles of Management

4 hours ago
Ali Fahad joined +M.Tariq Malik's group