COAL Lab 5
COAL Lab 5
guage
Lab Manual (Lab 5)
Course Instructor:
Lab Instructor:
Interrupt Handler:
A callback subroutine called when an interrupt is received. Also known as Interrupt
Service Routine.
The INT instruction in x8086 instruction invokes the respective ISR to perform the task
assigned. Number of interrupts supported by instruction set are 256 but every interrupt can have
up to 256 sub interrupts. So the total number of interrupts are (256 * 256) = 65,536.
For example 21H interrupt number has 108 sub interrupts like 01H for character input, 02H for
character output etc.
How to Use
Like 21H it has many subroutines. So the steps involved in using this routine are
1- Load AH with the number of required subroutine.
2- Load other desired parameters
3- Call INT 10H
Some 80x25 screen position
Position Decimal Hex
Column Row Column Row
Upper left corner 0 0 0 0
Lower left corner 0 24 0 18
Upper right corner 79 0 4f 0
Lower right corner 79 24 4f 18
Center of the screen 39 12 27 C
Example :
o Mov dh,10
o Mov dl,20
o Mov ah, 2
o Int 10h
Looping instruction
A loop is a sequence of instruction that is repeated the number of times to repeat may be known
in advance, or it may depend on condition.
Use the following lines to loop
MOV CX, Number Of iterations
Again: start loop here
; Instructions
LOOP Again
Lab Tasks
Task # 1
Clear the command screen clrscr command (scroll up/down window)
Prompt a user to enter an alphabet
Go to the Screen Position to x=12 and y=40 by setting dh(row) and dl(column)
Make a loop of 10 by initializing Cx=10
Display the input character and the 9 upcoming characters in a loop defined above
Example
Enter a character: g
ghijklmnop
Task # 2:
Clear the command prompt screen by using clrscr
Prompt a user to enter an alphabet
Go to the Screen Position to x=6 and y=20 by setting dh(row) and dl(column)
Make a loop of 7 by initializing Cx=7
Keeping the value of ‘y’ constant, increment in the value of ‘x’ and display the in-
put character as well as its upcoming characters in corresponding rows.
Example:
Enter a character: A
A
B
C
D
Task # 3:
Clear the command prompt screen by using clrscr
Prompt a user to enter an alphabet
Go to the Screen Position to x=6 and y=20 by setting dh(row) and dl(column)
Make a loop of 7 by initializing Cx=7
Increment the value of ‘y’, increment in the value of ‘x’ and display the input
character as well as its upcoming characters in corresponding rows and columns.
Example:
Enter a character: A
A
B
C
D
Task # 4
1. Prompt User to Enter 1st (1-digit) number
2. Prompt User to Enter 2nd (1-digit) number
3. Add two numbers
4. Display result in the following format:
+4
==========