How to write TSR Program By Using Interrupt 65 H

Vu Old Solved Programming Based Assignments Codes are Available in this Section .
Post Reply
User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 174
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

How to write TSR Program By Using Interrupt 65 H

Post by ALI RAZA » Tue Oct 02, 2018 10:18 am

Problem Statement:

Write a TSR (Terminate and Stay Resident) program, by using interrupt 65H, that will print Student ID when 0 is pressed by the user, and full Name when 1 is pressed by the user.

Detailed Instructions:
1) In this program, you will implement interrupt 65H which is currently not used by operating system.
2) Interrupt 65H function must check for Service Number – if service number is 0, your Student ID will be printed and if service number is 1, your full Name will be displayed. In order to implement this, place service number in AH register. Interrupt 65H will check its value and will perform relevant function.
3) Student ID or full Name must be printed at the beginning of monitor text memory area, 0xb8000000
4) Calculate Attribute Byte for both Student ID and Name according to the following criteria:
a. Text blinking: No
b. Background color: White
c. Foreground color: Black
d. Bold text: No
5) Visit this link: https://ascii.cl/ for complete ASCII table. This table is also available in the Downloads section of LMS.
6) Use keep() function to make this program TSR.
7) After writing interrupt 65H, write a test function which will take input from user (for example: Enter 0 for printing Student ID and 1 for printing Name), place relevant service number in AH register, and generate interrupt function. You may use switch statement for this.
8) Your assignment file should be a single Word file (.doc or .docx) containing:
a. Complete interrupt function (both services must be implemented)
b. Test function to generate interrupt as given in instruction # 7
9) You can use Consolas font for enhancing readability of the code in Word file.

Answer :

Implementation 65 H

Code: Select all

// 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 Student ID. Attribute Byte is 01110000 or 70H
		(*scr) = 0x7042;         // B
        	(*(scr + 1)) = 0x7043;   // C
        	(*(scr + 2)) = 0x7031;   // 1
        	(*(scr + 3)) = 0x7032;   // 2
        	(*(scr + 4)) = 0x7033;   // 3
        	(*(scr + 5)) = 0x7034;   // 4
        	(*(scr + 6)) = 0x7035;   // 5
        	(*(scr + 7)) = 0x7036;   // 6
        	(*(scr + 8)) = 0x7037;   // 7
        	(*(scr + 9)) = 0x7038;   // 8
        	(*(scr + 10)) = 0x7039;  // 9

	  	outportb(0x20, 0x20); // sending EOI to PIC
	  	return;
	}
	else {
		if((_AH) == 1) { // Printing Student Name
			(*scr) = 0x7041;         // A
        		(*(scr + 1)) = 0x7042;   // B
        		(*(scr + 2)) = 0x7043;   // C
        		(*(scr + 3)) = 0x7044;   // D
        		(*(scr + 4)) = 0x7045;   // E
        		(*(scr + 5)) = 0x7046;   // F
        		(*(scr + 6)) = 0x7047;   // G
		
			outportb(0x20, 0x20); // sending EOI to PIC
	  		return;
		}
	}
}
Test program 65 H

Code: Select all

// 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 Student ID or 1 for printing Student name :");
   	scanf ("%d", &i);

	switch(i) {
		
		case 0:
		_AH = 0;
		geninterrupt(0x65);
		break;

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

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



User avatar
Syeda
***New Member***
***New Member***
Posts: 4
Joined: Thu Nov 29, 2018 12:34 am
Status: Offline

Re: How to write TSR Program By Using Interrupt 65 H

Post by Syeda » Thu Nov 29, 2018 12:48 pm

AOA
Mr Mr_LonEly
ye jo program baya hai ye aik hi hai ya dono alag alag hn
is k kis software main kar hn gn window 7/10 main

Thankx

User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 174
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

Re: How to write TSR Program By Using Interrupt 65 H

Post by ALI RAZA » Fri Nov 30, 2018 8:53 am

Syeda wrote:
Thu Nov 29, 2018 12:48 pm
AOA
Mr Mr_LonEly
ye jo program baya hai ye aik hi hai ya dono alag alag hn
is k kis software main kar hn gn window 7/10 main

Thankx
yeh dono alg program hain pehle ik o chalna hota hae phir dosra os chaley howe program ka result check krney k liye chalna hota hae or yeh dono borlanc main chalney hain Downloads k section main se Borlanc download kr loo .. ok yeh system programming subject k releated program hae

User avatar
Syeda
***New Member***
***New Member***
Posts: 4
Joined: Thu Nov 29, 2018 12:34 am
Status: Offline

Re: How to write TSR Program By Using Interrupt 65 H

Post by Syeda » Fri Nov 30, 2018 12:25 pm

Borlandc main chalya hai dono alag
matlb dono sy aik hi code use karna hai koi b aik
aesa hi hai


thankx

User avatar
ALI RAZA
★★★★★★★★★★★★★
★★★★★★★★★★★★★
Posts: 174
Joined: Fri Dec 22, 2017 8:10 am
Location: Lahore
Has thanked: 6 times
Been thanked: 7 times
Contact:
Status: Offline

Re: How to write TSR Program By Using Interrupt 65 H

Post by ALI RAZA » Sat Dec 01, 2018 9:45 am

Syeda wrote:
Fri Nov 30, 2018 12:25 pm
Borlandc main chalya hai dono alag
matlb dono sy aik hi code use karna hai koi b aik
aesa hi hai


thankx
sis TSR program ka mtlab hae Terminate Stay Resident . yani ik dafa program chal para to memory main resident ho jata hae ap dosra program chalain gi to pela allready os main chal rha ho ga jo changes first program ki waja se ho gi un ko second program se check kr sakian gi .. agr nhn samjh aai to skyp par Alirazatawry search krin or os pe msag krin screen share k samjha don ga ok

User avatar
MO_106
***New Member***
***New Member***
Posts: 1
Joined: Fri May 10, 2019 3:18 pm
Status: Offline

Re: How to write TSR Program By Using Interrupt 65 H

Post by MO_106 » Fri May 10, 2019 4:02 pm

Ali Raza
Salams
Very elegant codes , And in specific while working with an obsolete system which no longer exists , Shows that you have mastered the assembly language , was in complete darkness till i read your code now I can walk in the dark , when ever you felt a need to spread your knowledge about assembly and c do inform me I will be your cheela
thanks
Regards
Ahmed

Post Reply

Last 10 Members Who Visited This Topic

User avatar MO_106 (2), User avatar ALI RAZA (10), User avatar Syeda (6)

  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest