:care حل شدہ اسائنمنٹس ڈانلوڈ کرنے کے لئے پہلے رجسڑ کریں شکریہ :care

How to write TSR Program By Using Interrupt 65 H

This Section is For Vu Old Solved Programing Assignments From Instructors which will be help full for you finding your Solutions.
Forum rules
Post Only Old Assignments Which are Solved By Instructors Thanks
User avatar
Ali Raza Tawary
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
Posts: 302
Joined: Fri Dec 22, 2017 8:10 am
Location: Kamalia
Contact:
Status: Offline

Achievements

How to write TSR Program By Using Interrupt 65 H

Post by Ali Raza Tawary »

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
Ali Raza Tawary
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
Posts: 302
Joined: Fri Dec 22, 2017 8:10 am
Location: Kamalia
Contact:
Status: Offline

Achievements

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

Post by Ali Raza Tawary »

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
Image

Post Reply

Last 10 Members Who Visited This Topic

User avatar Ali Raza Tawary (13)

Return to “Vu Old Programing Assignments Solutions”

Who is online

Users browsing this forum: No registered users and 1 guest