data segment
msg0 db 'Are you a boy?',13,10,'please input a char(Y/y/N/n)!$'
msg1 db 13,10,'I am a boy!$'
msg2 db 13,10,'No I am a gial$'
msgerror db 13,10,'Input error repeat$'
data ends
code segment
main proc far
assume cs:code,ds:data
begin:
mov ax,data
mov ds,ax
mov ah,09H
lea dx,msg0
int 21H
mov ah,01H
int 21H
mov ah,09H
cmp al,'Y'
jnz s1
lea dx,msg1
int 21H
jmp exit
s1:
cmp al,'y'
jnz s2
lea dx,msg1
int 21H
jmp exit
s2:
cmp al,'N'
jnz s3
lea dx,msg2
int 21H
jmp exit
s3:
cmp al,'n'
jnz error
lea dx,msg2
int 21H
jmp exit
error:
lea dx,msgerror
int 21H
jmp begin
exit:
mov ah,4cH
int 21H
main endp
code ends
end begin
masm 5.0调试通过