data segment string1 db ‘Please input a number:‘,0dh,0ah,‘$‘ string2 db 0dh,0ah,‘It is a number!‘,0dh,0ah,‘$‘ string3 db 0dh,0ah,‘It is not a number!‘,0dh,0ah,‘$‘ data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax TIP: lea dx,string1 mov ah,09h int 21h mov ah,01h int 21h cmp al,30h jnc GOON lea dx,string3 mov ah,09h int 21h jmp TIP GOON: cmp al,3ah jnc DONE lea dx,string2 mov ah,09h int 21h jmp EXIT DONE: lea dx,string3 mov ah,09h int 21h jmp TIP EXIT: mov ah,4ch int 21h code ends end start
原文地址:http://blog.csdn.net/techzero/article/details/24692451