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

Looking For Something at vustudents.ning.com? Click Here to Search


+ Link For Assignments, GDBs & Online Quizzes Solution


+ 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

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

CS609 Example Code & in seek of INT

+ How to Follow the New Added Discussions at Your Mail Address?

+ 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?

See Your Saved Posts Timeline

Views: 469


+ 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)

Replies to This Discussion


First example at page 16 of handout has no error:

And output is:


First example 2 at page 17 of handout has 4 errors:

& correct code is given by:


struct full
unsigned int ax;
unsigned int bx;
unsigned int cx;
unsigned int dx;
struct half
unsigned char al;
unsigned char ah;
unsigned char bl;
unsigned char bh;
unsigned char cl;
unsigned char ch;
unsigned char dl;
unsigned char dh;
union tagREGS
struct full x;
struct half h;

union REGS regs;

void main (void )
regs.h.al = 0x55;
regs.h.ah = 0x99;
printf ("%X",regs.x.ax);

its output is correct:



First example 3 at page 19 of handout has 3 errors:


& correct code is:


unsigned int handle;
void main()
union REGS regs;
unsigned long int size;
handle = open("D:/TC/abc.txt",O_RDONLY);
regs.x.bx = handle;
regs.h.ah = 0x42;
regs.h.al = 0x02; //correction
regs.x.cx = 0;
regs.x.dx = 0;
*((int*)(&size)) = regs.x.ax;
*(((int*)(&size))+1) =regs.x.dx;
printf ("Size is %d" ,size);

If you text file is at path:


then output will be correct otherwise wrong:


Thanks for sharing Zakki

No, dear its right.

You just need to run it in 16 bit environment (means MS DOS). In Windows , being a protected mode OS, you will not be able to get the exact output.

The better way is to make DOS Bootable USB & install turbo c on it & run all c programs.


Latest Activity

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

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