Cs609 Assignment solution

Started by admin

threads Cs609 Assignment solution (0 Replies)

admin

Avatar

Joined: 1 year ago

Site Admin

12 months ago

  
Cs609 Assignment solution

// Implementing interrupt 65H
#include<BIOS.H>
#include<DOS.H>

unsigned int far *scr = (unsigned int far *) 0xb8000000;
void interrupt (*oldint65)();
void interrupt newint65();

void main() {

oldint65 = getvect(0x65);
setvect(0x65, newint65);
keep(0, 1000);
}
void interrupt newint65()
{

if((_AH) == 0)

{ // Printing Course code CS609 Byte is 01110000 or 70H

(*scr) = 0x7043; // C
(*(scr + 1)) = 0x7059; // S
(*(scr + 2)) = 0x7036; // 6
(*(scr + 3)) = 0x7030; // 0
(*(scr + 4)) = 0x7039; // 9

outportb(0x20, 0x20); // sending EOI to PIC
return;
}
else if{
if((_AH) == 1)
{ // Printing System Programing

(*scr) = 0x7059; // S
(*(scr + 1)) = 0x7065; // y
(*(scr + 2)) = 0x7059; // S
(*(scr + 3)) = 0x7060; // T
(*(scr + 4)) = 0x7045; // E
(*(scr + 5)) = 0x7053; // M


(*(scr + 6)) = 0x7056; // P
(*(scr + 7)) = 0x7058; // R
(*(scr + 8)) = 0x7055; // O
(*(scr + 9)) = 0x7047; // G
(*(scr + 10)) = 0x7058; // R
(*(scr + 5)) = 0x7041; // A
(*(scr + 11)) = 0x7053; // M
(*(scr + 12)) = 0x7049; // I
(*(scr + 13)) = 0x7054; // N
(*(scr + 14)) = 0x7047; // G




outportb(0x20, 0x20); // sending EOI to PIC
return;
}
else if{
if((_AH) == 2)
{ // Printing Virtual University

// follow the above code and then print the virtual university…..


outportb(0x20, 0x20); // sending EOI to PIC
return;
}

}
}

// Test function to take user input and generate interrupt
#include<BIOS.H>
#include<DOS.H>
#include<stdio.h>

void main() {

int i;

printf( "Enter 0 for printing course code or 1 for printing name :");
scanf ("%d", &i);

switch(i) {

case 0:
_AH = 0;
geninterrupt(0x65);
break;

case 1:
_AH = 1;
geninterrupt(0x65);
break;

follow the above code solved the 3rd problem

default:
printf("You have entered an invalid number. Exiting the program...");
}
}