data segment
str1 db 0ah,0dh,"Are tou really want to exit!$"
str2 db 0ah,0dh, "Tank you for your using!$"
str3 db 0ah,0dh,"Let's continue!$"
str4 db 0ah,0dh,"you press an error key!$"
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
lea dx,str1
mov ah,09h
int 21h
mov ah,01h
int 21h
and al,0dfh//这章文章难点就这一点,就是将小写字母转换为大写字母
cmp al,'N'
jz let
cmp al,'Y'
jz thank
jmp you
let:
lea dx,str3
mov ah,09h
int 21h
jmp pend
thank:
lea dx,str2
mov ah,09h
int 21h
jmp pend
you:
lea dx,str4
mov ah,09h
int 21h
jmp pend
pend: mov ah,4ch
int 21h
code ends
end start