Write a TSR program in C that will clear all the contents of the screen and print your VU ID and Name (BC0000000-Name) at the center of the video text memory available at 0xB8000000 whenever Alt+Ctrl+D combination is pressed from keyboard.
Note that you have to take the backup of the contents of video text memory before clearing the screen. And, whenever Alt+Ctrl+R combination is pressed from the keyboard, all the contents of video text memory should be restored.
I Am trying this code but still need to check keys.
Code:#include<DOS.H> #include<stdio.h> void interrupt (*oldint)(); void interrupt getContents(); unsigned char far *scr = (unsigned char far*)0xb8000680; unsigned char far *src = (unsigned char far*)0xb8000000; unsigned char far *sch = (unsigned char far*)0x00400017; int i; char charsrc[4000]; void interrupt getContents(){ //saving contents for(i=0; i < 4000; i++) charsrc[i] = *(src+i); //getContentsing Screen for(i=0; i < 4000; i+=2) { *(src + i) = 0x20; *(src + i + 1) = 0x07; } echoChar(); } //Prints RollNo and Name at Center of Graphics Text Memory void echoChar(){ *scr = 0x6D; *(scr+1) = 0x70; *(scr+2) = 0x63; *(scr+3) = 0x07; *(scr+4) = 0x31; *(scr+5) = 0x07; *(scr+6) = 0x34; *(scr+7) = 0x07; *(scr+8) = 0x30; *(scr+9) = 0x07; *(scr+10) = 0x34; *(scr+11) = 0x07; *(scr+12) = 0x30; *(scr+13) = 0x07; *(scr+14) = 0x32; *(scr+15) = 0x07; *(scr+16) = 0x32; *(scr+17) = 0x07; *(scr+18) = 0x39; *(scr+19) = 0x07; *(scr+20) = 0x37; *(scr+159) = 0x07; *(scr+160) = 0x53; *(scr+161) = 0x07; *(scr+162) = 0x61; *(scr+163) = 0x07; *(scr+164) = 0x6C; *(scr+165) = 0x07; *(scr+166) = 0x6D; *(scr+167) = 0x07; *(scr+168) = 0x61; *(scr+169) = 0x07; *(scr+170) = 0x6E; *(scr+171) = 0x07; *(scr+172) = 0x20; *(scr+173) = 0x07; *(scr+174) = 0x48; *(scr+175) = 0x07; *(scr+176) = 0x61; *(scr+177) = 0x07; *(scr+178) = 0x69; *(scr+179) = 0x07; *(scr+180) = 0x64; *(scr+181) = 0x07; *(scr+182) = 0x65; *(scr+183) = 0x07; *(scr+184) = 0x72; } void restoreContents(){ for(i=0; i < 4000; i++) *(src + i) = charsrc[i]; } void main(){ oldint = getvect(0x09); setvect(0x09,getContents); keep(0,1000); restoreContents(); }