Professional Documents
Culture Documents
To Display A Message, Use Lea (Load Effective Address)
To Display A Message, Use Lea (Load Effective Address)
0011 1101
0011 1101
0000 0000 – ZF = 1
Label – procedures/sub-procedures or functions that can be jumped into when a certain
condition was met.
morn:
lea dx, mornmsg
mov ah,09h
int 21h
jmp exit
exit:
mov ah,4ch
int 21h
Program 1:
.model small
.stack 100h
.data
.code
mov ax,@data
mov ds,ax
mov ah,09h
lea dx, Timeprompt
int 21h
mov ah,01h
int 21h
cmp al,'Y'
je after
cmp al,'y'
je after
cmp al,'N'
je morn
cmp al,'n'
je morn
jmp error
after:
lea dx, aftermsg
mov ah,09h
int 21h
jmp exit
morn:
lea dx, mornmsg
mov ah,09h
int 21h
jmp exit
exit:
mov ah,4ch
int 21h
end
Program 2:
.model small
.stack 100h
.data
.code
mov ax,@data
mov ds,ax
mov ah,09h
lea dx, Timeprompt
int 21h
mov ah,01h
int 21h
cmp al,'Y'
je after
cmp al,'y'
je after
cmp al,'N'
je morn
cmp al,'n'
je morn
jmp error
after:
lea dx,aftermsg
mov ah,09h
int 21h
jmp exit
morn:
lea dx,mornmsg
mov ah,09h
int 21h
jmp exit
error:
lea dx,errormsg
mov ah,09h
int 21h
exit:
mov ah,4ch
int 21h
end
Program 3:
.model small
.stack 100h
.data
.code
mov ax,@data
mov ds,ax
start:
mov ah,09h
lea dx, Timeprompt
int 21h
mov ah,01h
int 21h
cmp al,'Y'
je after
cmp al,'y'
je after
cmp al,'N'
je morn
cmp al,'n'
je morn
jmp error
after:
lea dx,aftermsg
mov ah,09h
int 21h
jmp exit
morn:
lea dx,mornmsg
mov ah,09h
int 21h
jmp exit
error:
lea dx,errormsg
mov ah,09h
int 21h
jmp start
exit:
mov ah,4ch
int 21h
end