1个回答
展开全部
dseg segment
msg0 db 0dh,0ah,'Input char is not digital number.$'
msg1 db 0dh,0ah,'Input char is digital number.$'
dseg ends
cseg segment
assume cs:cseg, ds:dseg
start:
mov ax, dseg
mov ds, ax
mov ah,1
int 21h ;读入一个字符(al)
cmp al,'0' ;判断读入的字符<'0'
jb m0
cmp al,'9' ;判断读入的字符>'9'
ja m0
lea dx, msg1 ;显示msg1
mov ah,9
int 21h
jmp exit
m0:
lea dx, msg0 ;显示msg0
mov ah,9
int 21h
exit:
mov ah,4ch ;退出到dos
int 21h
cseg ends
end start
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询