stack segment
stack ends
data segment
string db 'please input your grades: $'
result_1 db 0ah,0dh,'bu ji ge ! $'
result_2 db 0ah,0dh,'liang hao ! $'
result_3 db 0ah,0dh,'you xiu ! $'
grades db 0,0,0
data ends
code segment
assume cs:code,ds:data,ss:stack
start:
mov ax,data
mov ds,ax
lea dx,string
mov ah,09h
int 21h
mov cx,3
mov bx,offset grades
input:
mov ah,01h
int 21h
mov [bx],al
inc bx
loop input
mov bx,offset grades
cmp [bx], byte ptr '1'
je youxiu
inc bx
cmp [bx], byte ptr '8'
jae youxiu
cmp [bx],byte ptr '6'
jae lianghao
bujiege:
mov dx,offset result_1
mov ah,09h
int 21h
jmp jieshu
youxiu:
mov dx,offset result_3
mov ah,09h
int 21h
jmp jieshu
lianghao:
mov dx,offset result_2
mov ah,09h
int 21h
jmp jieshu
jieshu:
mov ax,4c00h
int 21h
code ends
end start