Exp8
Exp8
08
Objective: Students will learn how to write program using the interrupts. INT 21H
and INT 10H are used in this program.
Lab Work:
The following programme firstly it clears the screen then set cursor position (in this
example row=5 column=8). After setting cursor, it displays some message.
; ----------------------------------------------------------------------------------
CLEAR MACRO
MOV AX,0600H
MOV BH,07
MOV CX,0000
MOV DX,184FH
INT 10H
ENDM
; ---------------------------- ------------------------------------------------------
CURSOR MACRO Col, Row
MOV AH,02
MOV BH,00
MOV DL,Col
MOV DH,Row
INT 10H
ENDM
; ----------------------------------------------------------------------------------
DISP MACRO MES
MOV AH,09
MOV DX,OFFSET MES
INT 21H
ENDM
; ----------------------------------------------------------------------------------
.MODEL SMALL
.STACK 64H
.DATA
MES1 DB 'There is a message for yo u'
DB ' To read it enter R','$'
MES2 DB 'Hi! This lab is about '
DB ' BIOS and DOS Interrupts ' ,'$'
MES3 DB ' No more message for you','$'
.CODE
MAIN: MOV AX,@DATA
MOV DS, AX
CLEAR
CURSOR 05,08
DISP MES1
MOV AH, 07
INT 21H
CMP AL,'R'
JZ NEXT
CMP AL, 'r'
JZ NEXT
CURSOR 05,09
DISP MES3
JMP EXIT
NEXT: CURSOR 05,09
DISP MES2
EXIT: MOV AH, 4CH
INT 21H
END MAIN
H.W. 5
1. Write a programme that it will read some numbers from the keyboard, if we input a random number
then corresponding message should be the output from the following messages:
If the number <50 ‘fail’
If the number >50 and <60 ‘satisfactory’
If the number >60 and <70 ‘good’
If the number >70 and <80 ‘ very good’
If the number >80 and < 99 ‘ excellent’
When the input is a letter then the program must be terminated, all the messages will be Output at the
center of the screen. When a new number has been entered the screen should be cleared before
displaying the new message.
2. Develop an assembly language program to read the following test message from the data segment
‘Vertical Text Test’ and display the message from up to down. The display device is assumed to be in
the text mode with 25 x 80 resolution.
Hint: INT 10H AH=02 sets cursor location and assumes row in DH and column in DL.
INT 21H AH=02 outputs a character to the monitor. Assumes the character in DL (ASCII).
Function
Function Parameters Return
code