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.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

Total Marks: 20

 

Due Date:

May 29, 2018

 

Instructions:

 

Please read the following instructions carefully before submitting assignment. It should be clear that your assignment will not get any credit if:

 

§  The assignment is submitted after due date.

§  The submitted assignment does not open or file is corrupt.

§  You have not followed steps described in Detailed Instructions of the problem statement.

§  Assignment is copied(partial or full) from any source (websites, forums, students, etc.) Strict action will be taken in this regard.

 

Note:You have to upload only .doc or .docx file. Assignment in any other format (extension) will not be accepted and will be awarded with zero marks.

 

Objectives:

 

The objective of this assignment is to provide hands-on experience ofSystem Programming concepts including:

 

·         Interval Timer

·         Accessing PC Speaker

·         Loading divisor values in Interval Timer

 

 

   

For any assignment related query, contact at CS609@vu.edu.pk

 

 

Problem Statement:

 

Write a C program that will turn on PC speaker (for variable-pitched sound) by using port 61H of Interval Timer. The divisor value for Interval Timer will be last eight digits of your Student ID.

 

Detailed Instructions:

1)      In this program,you will access internal PC speaker by using port 61H. Least two significant bits of port 61H are used for connecting PC speaker to Interval Timer.

2)      In order to program Interval Timer, you have to first load the Command Byte into the Command Register. Calculate Command Byte according to following criteria:

a.       Channel: 2

b.      Interval Timer Mode: 2

c.       Counter: Binary

d.      Divisor bytes to be loaded: All (For calculating divisor value, read instruction 4)

3)      You will first load last four digits of your Student ID as a divisor value (see the purple color digits in below example ID), and then after a delay of 2 seconds, you will again load new divisor value which will be next four digits of your Student ID (see the orange color digits in below example ID).

BC123456789

4)      For producing delay, use Timer Count, a double word variable in the BIOS data area which is placed at the location 0040:006C

5)      After loading each divisor value, turn on the PC speaker

6)      You can check the output of the program by booting your system in DOS mode and then running the exe file. But does not worry if PC speaker does not produce sound; the host operating system may restrict you to directly access PC speaker. Just focus on the concepts.

7)      Your assignment file should be a single Word file (.doc or .docx) containing complete code.

8)      You can use Consolas font for enhancing readability of the code in Word file.

 

 

Best of Luck!

 

 


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

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

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)


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

RSS

Latest Activity

Ꮆㄩフフ卂尺 liked Hafiza Tehreem Fatima's discussion BIRTHDAY CELEBRATION OUR BELOVED <MEMBER SARAH ABDUL
5 minutes ago
+M.Tariq Malik replied to Muhammad Faizan Alam's discussion STA301 Assignment No.1 | FALL 2020 | Due Date: 8th December, 2020 in the group STA301 Statistics and Probability
5 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MGT301 Principles of Marketing Assignment 01 Fall 2020 Solution / Discussion in the group MGT301 Principles of Marketing
11 minutes ago
Blessings liked Blessings's profile
12 minutes ago
+M.Tariq Malik replied to shifa arshad's discussion MGT501 GDB Fall 2020 Solution / Discussion Due Date: 09-dec-2020 in the group MGT501 Human Resource Management
20 minutes ago
Mani Siddiqui Ex posted a status
"جینے والوں نے خود کشی کر لی.. رہ گئے جو، اداس رہتے ہیں.."
21 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion MTH633 Group Theory Assignment 01 Fall 2020 Solution / Discussion in the group MTH633 Group Theory
25 minutes ago
+M.Tariq Malik replied to Fragrance of Islam's discussion ENG301 Business Communication GDB No 01 Fall 2020 Solution / Discussion in the group ENG301 Business Communication
29 minutes ago
+M.Tariq Malik replied to +M.Tariq Malik's discussion PSY407 Assignment 01 Fall 2020 Solution / Discussion Due Date: 07-12-2020 in the group PSY407 Sport Psychology
31 minutes ago
Ellen Shades posted blog posts
33 minutes ago
Profile IconAyesha, Rabi Rajput, Nabila and 18 more joined Virtual University of Pakistan
35 minutes ago
Ayesha liked +M.Tariq Malik's discussion PSY401 Clinical Psychology Assignment 01 Fall 2020 Solution / Discussion
41 minutes ago
Saba liked +M.Tariq Malik's discussion VU New Grading Scheme For Semester Fall 2020
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
+M.Tariq Malik replied to +M.Tariq Malik's discussion PSY402 Experimental Psychology Assignment 01 Fall 2020 Solution / Discussion Due Date: 07-12-2020 in the group PSY402 Experimental Psychology
3 hours ago
+M.Tariq Malik liked ・༓☾ Shayna ☽༓・'s blog post ✿ Money Can't Buy ✿
3 hours ago
+M.Tariq Malik replied to Muhammad Faizan Alam's discussion STA301 Assignment No.1 | FALL 2020 | Due Date: 8th December, 2020 in the group STA301 Statistics and Probability
3 hours ago
Ali Fahad joined +M.Tariq Malik's group
4 hours ago
Ali Fahad joined +M.Tariq Malik's group
4 hours ago
Ali Fahad joined +M.Tariq Malik's group
4 hours ago

© 2020   Created by +M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.