0% found this document useful (0 votes)
38 views3 pages

Exp 2

The document provides instructions for a laboratory experiment involving programming with DOS and BIOS interrupts in 8086 assembly language. Students are asked to examine common interrupts like INT 10H and INT 21H, run provided code samples, analyze the code to identify the purpose of different interrupt functions, and write short programs to demonstrate tasks like displaying text, clearing the screen, and reading/writing files using interrupt calls.

Uploaded by

Rami Sahoori
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

Exp 2

The document provides instructions for a laboratory experiment involving programming with DOS and BIOS interrupts in 8086 assembly language. Students are asked to examine common interrupts like INT 10H and INT 21H, run provided code samples, analyze the code to identify the purpose of different interrupt functions, and write short programs to demonstrate tasks like displaying text, clearing the screen, and reading/writing files using interrupt calls.

Uploaded by

Rami Sahoori
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

University of Jordan Faculty of Engineering and Technology Computer Engineering Department Microprocessors Laboratory

Experiment 2: DOS and BIOS Interrupts Programming NAME: ___________________________ STUDENT ID: ____________
Objective To examine and become familiar with the DOS and BIOS Interrupts for the 8086 processor

BIOS interrupts programming


Step 1 Use the debug utility to assemble and run the following instructions MOV AX, 600H MOV BH, 7 MOV CX, 0 MOV DX, 184FH INT 10H Step 2 What is the function of the instructions in step1? _______________________________________ Step 3 Assemble and link the file video.asm (from the path D:\asm lab files\exp6), then run the generated exe file. Step 4 Analyze the code in video.asm and write down the purpose of each interrupt function used: Func1:______________________________________________________ Func2:______________________________________________________ Func3:______________________________________________________ Func4:______________________________________________________ Step 5 What are the monochrome monitors? _____________________________________________ In text mode there is one attribute byte associated with each ___________ on the screen. Write the attribute byte to display background blue, foreground red blinking. _______________________

Step 6 State the purpose of the following program, which is for a monochrome monitor. MOV AH,2 MOV BH,0 MOV DX,0 __________________________________ INT 10H __________________________________ MOV AH,9 __________________________________ MOV BH,0 __________________________________ MOV AL,23H MOV CX,14 MOV BL,0F0H INT 10H

DOS interrupts programming


Step 1 Use the debug utility to assemble and run the following instructions MOV AH,2 MOV DL,43H INT 21H MOV DL,50H INT 21H MOV DL,45H INT 21H Step 2 What is the function of the instructions in step1? ____________________________________ Step 3 Assemble and link the file Hello.asm (from the path D:\asm lab files\exp6), then run the generated exe file. Step 4 Analyze the code in hello.asm and write down the purpose of each interrupt function used: Func 1:___________________________________________________ Func 2:___________________________________________________ Step 5 The following prompt needs to be displayed. What will happen if this string is output using INT 21H function 09? PROMPT1 DB Enter (round to nearest $) your annual salary ___________________________________________________________________________ Step 6 Use function 40h to display a message on the screen. Write your code below ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________ ___________________________________

Exercises
Use DOS and BIOS interrupts function calls to carry out the following tasks: 1. Write a program that displays the current time on the screen. (Time Format: HH : MM : SS) Ignore the fractions of seconds. 2. Write a program that define and call three subroutines: clear the screen, center the position of the cursor on the display, and display a text on the monitor. 3. Write a program to create a new writable file called File1, and then ask the user to enter a string of characters, save the string into the file and then close it. 4. Write a program to: Clear the screen. Set the mode CGA of 640 X 200 resolution, and lastly draw a red horizontal line starts at point 50,100 and ends at point 50,200

BIOS and DOS interrupts


There are some extremely useful subroutines within BIOS and DOS that are available to the user through the INT instruction. The INT instruction is somewhat like a FAR call. When it is invoked, it saves CS:IP and then flags on the stack and goes to the subroutine associated with that interrupt. The INT instruction has the following format: INT xx ; the interrupt number xx can be 00 FF

Since interrupts are numbered 00 to FF, this gives a total of 256interrupts in 80x86 microprocessors. Of these 256 interrupts, two are the most widely used: INT10 and INT 21. each one can perform many functions. You can find a list of these interrupts in textbooks or on the web. Before the service of INT 10H or INT 21H is requested, certain registers must have specific values in them, depending the function being requested. Various functions of INT 21H and INT 10H are selected by the value put in the AH register. BIOS interrupt: INT 10H subroutines are burned into the ROM BIOS of the 8086 based and compatibles and are used to communicate with the computer user screen video. Much of the manipulation of screen text or graphics is done through INT 10H. Among them are changing the color of characters or background, clearing screen, and changing the locations of cursor. Below are two examples that use BIOS interrupts. 1. Clearing the screen: MOV AX, 0600H ;scroll entire screen MOV BH, 07 ;normal attribute ;start at 00,00 MOV CX, 0000 MOV DX, 184FH ;end at 18, 4F INT 10H ;invoke the interrupt 2. Setting the cursor position: MOV AH,02 ;set cursor option MOV BH, 00 ;page 0 MOV DL, 25 ;column position MOV DH,15 ;row position INT 10H DOS interrupts: INT 21h is provided by DOS. When MS-DOS is loaded into the computer, INT 21H can be invoked to perform some extremely useful functions. These functions are commonly referred to as DOS INT 21H function calls. Data input and output through the keyboard and monitor are the most commonly used functions. Below are two examples that use DOS interrupts. 1. display the message defined with variable DATA_ASC DB the earth is but one country,$ MOV AH,09 ;option 9 to display string of data MOV DX, OFFSET DATA_ASC ;DX= offset address of data INT 21H ; invoke the interrupt 2. Inputting a single character, with echo. MOV AH, 01 ;option 01 to input one character INT 21H ;invoke the interrupt

You might also like