Assignment No. 01|Semester: Fall 2017 CS609|System Programing

Problem Statement
Write a TSR(Terminate and Stay Resident)program that
will show your VUID whenever “R” key is pressed and
clear the screen whenever “C” key is pressed.

 

#include<bios.h>

#include<dos.h>

void interrupt my09( );

void interrupt (*old)();

unsigned char far *screen = (unsigned char far*) 0xb8000000;

void main() {

old = getvect(0x09);

setvect(0x09 , my09);

keep (0 , 1000);

getch();

}

void interrupt my09( ) {

if(inportb(0x60) == 0x13)

{

*screen    = 0x4D;     //M

*(screen+1) = 0xF0;

*(screen+2) = 0x43; //C

*(screen+3) = 0xF0;

*(screen+4) = 0x31; //1

*(screen+5) = 0xF0;

*(screen+6) = 0x36; //6

*(screen+7) = 0xF0;

*(screen+8) = 0x30; //0

*(screen+9) = 0xF0;

*(screen+10) = 0x32;//2

*(screen+11) = 0xF0;

*(screen+12) = 0x30; //0

*(screen+13) = 0xF0;

*(screen+14) = 0x30; //0

*(screen+15) = 0xF0;

*(screen+16) = 0x37; //7

*(screen+17) = 0xF0;

*(screen+18) = 0x32;//2

*(screen+19) = 0xF0;

*(screen+20) = 0x37; //7

*(screen+21) = 0xF0;

}

if (inportb (0x60) == 0x2E)

{

int i;

for (i=0; i<2000; ++i)

{

* screen = 0x20;

*( screen +1) = 0x70;

screen = screen + 2;

}

}

(*old)( );

}

 

Just Change code of charetes

 

Leave a Reply

Your email address will not be published. Required fields are marked *