0

plz write newfunc() .
A TSR program that changes the background color of the screen to red whenever ‘Ctrl’ is pressed and white whenever ‘Left Shift’ is pressed. It should not modify the text displayed on the screen.


Hint:

Intercept Keyboard interrupt (0x09H)
Use video text memory address 0xB000000H

#include <dos.h>
void interrupt (*old)();
void interrupt newfunc();
char far *keybord=(char far* ) 0x00400017; //keyboard status
 
char far *scr=(char far* ) 0x0xB000000; //address of text area 
void main()
{
     old=getvect(0x09);
     setvect(0x09,newfunc);
     keep(0,1000);
}
     void interrupt newfunc ()
     {

Write code here that changes the background color of the screen to red whenever ‘Ctrl’ is pressed and white whenever ‘Left Shift’ is pressed. It should not modify the text displayed on the screen.


(*old)();

}

2
Contributors
1
Reply
2
Views
9 Years
Discussion Span
Last Post by WaltP
0

Are we talking about doing something that back in 1995 the computer industry left behind? Are you running DOS or a command line from XP?

And is this homework from a school teaching obsolete practices or from your Dad's (or Granddad's?) old textbook?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.