We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

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

Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

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

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?

Views: 10152

.

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

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

Attachments:

### Replies to This Discussion

galat ha ya dono

@Engr Emh
but there is also one error "undefined symbol divisor "
#include
#include
unsigned int divisors [4]={0x21ff,0x1d45,0x1b8a,0x1e4c};
unsigned long int far *time =(unsigned long int far *)0x0040006C;
void main()
{ unsigned long int tx;
int i=0;
while (!kbhit ())
{
while (i<4)
{ outport(0x43,0xB4); outport(0x42,*((char*)(&divisor[i]))); outport(0x42,*(((char*)(&divisor[i]))+1)); outport(0x61, inport(0x61)|3);
tx=*time;
tx=tx+4;
while (tx >= (*time));
i++;
}
i=0;
}
outport(0x61,inport(0x61)&0xFC);
}

This program generates a tune with 4 different pitches. This program is quite similar to the one discussed earlier. The only major difference is that in that program the pitch was gradually altered from low to high in this the pitches change periodically until a key is pressed to terminate the outer loop. Four various pitches are maintained and their divisor values are placed in the divisors[] array. All these divisor values are loaded one by one after a delay of approximately quarter of a second and this continues until a key is pressed.

hm na apna id khn khn likhna hy

bhai divisor ka error isliye arha hy k apne variable divisors initialize kiya hy or usko bad me divisor likh diya hy s nhi lgaya end pr...check kro code ko edit b krdo

confirm thk knsa hy?

i'm also just figuring it out

what is while (!kbhit ()) ??? what kbhit stands for?its giving an error

@faqi rao ,thats right,
now compile successfully but now stuck in Linking i m using the turbo c++ with dosbox in windows 10.
any of u tried in windows xp or windows 98 ?
Here is my final code

#include
#include
unsigned int divisor [4]={0x21ff,0x1d45,0x1b8a,0x1e4c};
unsigned long int far *time =(unsigned long int far *)0x0040006C;
void main()
{ unsigned long int tx;
int i=0;
while (!kbhit ())
{
while (i<4)
{ outport(0x43,0xB4); outport(0x42,*((char*)(&divisor[i]))); outport(0x42,*(((char*)(&divisor[i]))+1)); outport(0x61, inport(0x61)|3);
tx=*time;
tx=tx+4;
while (tx >= (*time));
i++;
}
i=0;
}
outport(0x61,inport(0x61)&0xFC);
}

#include <dos.h>

#include <bios.h>

unsigned int divisor [4]={0x21ff,0x1d45,0x1b8a,0x1e4c};

unsigned long int far *time =(unsigned long int far *)0x0040006C;

void main()

{             unsigned long int tx;

int i=0;

while (!kbhit ())

{

while (i<4)

{ outport(0x43,0xB4); outport(0x42,*((char*)(&divisor[i]))); outport(0x42,*(((char*)(&divisor[i]))+1)); outport(0x61, inport(0x61)|3);

tx=*time;

tx=tx+4;

while (tx >= (*time));

i++;

}

i=0;

}

outport(0x61,inport(0x61)&0xFC);

}

try krta hn

bro try ki?

kindly bhai bta dn  is m id kahan dalna hy.

## Latest Activity

ATIQ UR REHMAN liked Ayesha Sarfraz's profile
33 minutes ago
ATIQ UR REHMAN left a comment for Ayesha Sarfraz
34 minutes ago
35 minutes ago
+ ! ! ! Ayesha ! + liked Alone Struggler's discussion A meaningful life...
36 minutes ago
+ ! ! ! Ayesha ! + updated their profile
39 minutes ago
55 minutes ago
imran and + ! ! Şĩɳℊℯℛ ⋆⭐️⋆ joined + M.Tariq Malik's group

### ISL201 Islamic Studies

56 minutes ago
M@nZi B@jw@ posted a status
"MID TERM KA RESULT KAB AAAANA HAI"
56 minutes ago
1 hour ago
1 hour ago
1 hour ago
Naser Javed (BBIT-6) liked ♦_"Tooba"_♦'s discussion ""Izzat nafas ka byaan""
1 hour ago

1

2

3