习题2.36(80x86版)
.model small
.data
displayPutin DB "Input Number:0~9:$"
displayError DB "Error!",0dh,0ah,'$'
.code
main PROC
mov ax,@data
mov ds,ax
AGAIN:
mov ah,09h
mov dx,OFFSET displayPutin
int 21h
mov ah,00h
int 21h
cmp al,30h
js ERRORLEABE
cmp al,3ah
jns ERRORLEABE
mov dl,0dh
mov ah,01h
int 21h
mov dl,0ah
int 21h
mov dl,al
int 21h
jmp QUIT
ERRORLEABE:
mov ah,09h
mov dx,OFFSET displayError
int 21h
jmp AGAIN
QUIT:
mov ah,4ch
int 21h
main ENDP
END main