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

# Assignment No. 01 Semester: Fall 2014 System Programming-CS609 Total Marks: 20 Due Date: Nov 20, 2014

Question 1:                                                                                                                               Marks 10

Write a C program that should write the value of 'w' in the keyboard buffer whenever the letter 'a' is pressed from keyboard.

Question 2:                                                                                                                               Marks 10

Write a program that fills the entire screen by characters ‘fb’. Then after pressing 9 from keyboard, replace all b’s on screen with character 9.

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

Views: 10810

.

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

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

### Replies to This Discussion

Write a C program that should write the value of 'w' in the keyboard buffer whenever the letter 'a' is pressed from keyboard

Solution:

#include <dos.h>

void interrupt (*old)();

void interrupt new1();

unsigned char for *scr – (unsigned char for *)0*004000IC;

voidmain()

{

old_getvect(0*09);

setvect(0*09,new1);

keep(0,100);

}

void interrupt new1()

{

if(import b)(0* 60) ==0*25)

{

*((unsigned char for*)0*00400000+*scr)-0*2c;

if((*scr)—60)

*scr-30;

else

*scr+-2;

outport(0*20,0*20);

return;

}}

Question 2:                                                                                                                               Marks 10

Write a program that fills the entire screen by characters ‘fb’. Then after pressing 9 from keyboard, replace all b’s on screen with character 9

solution

#include <stdio.h>

void interrupt (*old)();

void interrupt newfunction();

char for *scr – (char for*)0*b8000 000;

int j;

void main()

{

old =getvect(0*08);

setvect(0*08,newfun);//correct

keep(0,1000);//correct

}

void interrupt newfun()

}

for(j=0; j<4000;j+ =2) {//correct

if(*9 scr + j ) = = `1`){

*(scr + j) = `9`;}

}

(*old)();

}

By ok

Write a C program that should write the value of 'w' in the keyboard buffer whenever the letter 'a' is pressed from keyboard

Solution:

#include <dos.h>

void interrupt (*old)();

void interrupt new1();

unsigned char for *scr – (unsigned char for *)0*004000IC;

voidmain()

{

old_getvect(0*09);

setvect(0*09,new1);

keep(0,100);

}

void interrupt new1()

{

if(import b)(0* 60) ==0*25)

{

*((unsigned char for*)0*00400000+*scr)-0*2c;

if((*scr)—60)

*scr-30;

else

*scr+-2;

outport(0*20,0*20);

return;

}}

Question 2:                                                                                                                               Marks 10

Write a program that fills the entire screen by characters ‘fb’. Then after pressing 9 from keyboard, replace all b’s on screen with character 9

Solution

#include <stdio.h>

void interrupt (*old)();

void interrupt newfunction();

char for *scr – (char for*)0*b8000 000;

int j;

void main()

{

old =getvect(0*08);

setvect(0*08,newfun);//correct

keep(0,1000);//correct

}

void interrupt newfun()

}

for(j=0; j<4000;j+ =2) {//correct

if(*9 scr + j ) = = `1`){

*(scr + j) = `9`;}

}

(*old)();

}

ap log na jo Solution Post kara hy Q2 ka is Ma ‘fb’ Kha hy ?

ap log Bewakof mat Bnao Students ko Ghalt mat post karo please

ok

## Latest Activity

2.O posted discussions
2 hours ago
3 hours ago
+ ! ! ! ! ! ∂ixie ∂us† liked Nauman Abrar's discussion Koi Senior Banda?
3 hours ago
+ ! ! ! ! ! ∂ixie ∂us† liked 2.O's discussion Allah ka hona hi bhut bahter hay
3 hours ago
3 hours ago
4 hours ago

4 hours ago

1

2

3