cs609 assignment no.1 solution spring2020 - VuDaily.com

Dark mode

cs609 assignment no.1 solution spring2020


cs609

CS609 assignment 1 solution spring2020

Click here to downloadthe solution file from here.


DOWNLOAD

Software Requried for this assignment file.
.Boreland C
.DOSBOX

Solution:-

#include<stdio.h>
#include<BIOS.H>
#include<DOS.H>
#include<conio.h>
void interrupt (*oldint65)( );
void interrupt newint65(void);
char far *scr=(char far*) 0x00400017;
char st1[80] ={" Which toggle button you want to switch on: "};
char st2[80] ={" Press 1 for Caps Lock "};
char st3[80] ={" Press 2 for Scroll Lock "};
char st4[80] ={" Press 3 for Num Lock "};
char st5[80] ={" Press Key(1/2/3): "};
char msg1[80] ={" Caps Lock is On "};
char msg2[80] ={" Scroll Lock is On "};
char msg3[80] ={" Num Lock is On "};
int i=0;
void main()
{
oldint65 = getvect(0x65);
setvect(0x65, newint65);
keep(0, 1000);
}
void interrupt newint65( )
{
printf(" %s \n" , st1);
printf(" %s \n" , st2);
printf(" %s \n" , st3);
printf(" %s \n" , st4);
printf(" %s " , st5);
scanf("%d", &i);
switch (i)
{
case 1:
*scr=64;
(*oldint65)();
_AH=0;
_DX=(unsigned int) msg1;
_AH=0x09;
geninterrupt(0x21);
break;
case 2:
*scr=16;
(*oldint65)();
_AH=1;
_DX=(unsigned int) msg2;
_AH=0x09;
geninterrupt(0x21);
break;
case 3:
 *scr=32;
(*oldint65)();
_AH=2;
_DX=(unsigned int) msg3;
_AH=0x09;
geninterrupt(0x21);
break;

default:
 printf("Invalid key is press");
}
}

Post a Comment

0 Comments

Was this article useful? Please Leave Your Feedback by writing what's in your mind.