. model small
. stack 100
.data
input db 'Nhap vao mot ky tu: $'
no db ' Khong phai so$'
yes db ' La so$'
CLRF db 13 , 10 , '$'
. code
main proc
mov ax , @data
mov ds , ax
nhap:
mov ah , 9
lea dx , input
int 21h
mov ah , 1 ; nhap ky tu
tiep:
int 21h
cmp al , 30h ; so sanh ky tu vua nhap vao voi 30h
je thoat ; neu la so 0 thi thoat
cmp al , 30h
jb sai ; neu nho hon thi nhay den nhan sai
cmp al , 39h
jg sai ; neu lon hon thi nhay den sai
jmp dung ; nhay vo dieu kien den tiep
sai:
mov ah , 9
lea dx , no
int 21h
mov AH , 9
lea DX , CLRF
int 21H
jmp nhap
dung:
mov ah , 9
lea dx , yes
int 21h
mov AH , 9
lea DX , CLRF
int 21H
jmp nhap
thoat:
mov ah , 9
lea dx , yes
int 21h
mov ah , 4ch
int 21h
main endp
end main
Lm1vZGVsIHNtYWxsCi5zdGFjayAxMDAKLmRhdGEKICAgIGlucHV0IGRiICdOaGFwIHZhbyBtb3Qga3kgdHU6ICQnICAgICAgICAgICAgICAKICAgIG5vIGRiICcgS2hvbmcgcGhhaSBzbyQnICAKICAgIHllcyBkYiAnIExhIHNvJCcgICAgICAKICAgIENMUkYgZGIgMTMsMTAsJyQnCiAgICAKLmNvZGUKICAgIG1haW4gcHJvYwogICAgICAgIG1vdiBheCwgQGRhdGEKICAgICAgICBtb3YgZHMsIGF4CiAgICAgICAgCiAgICAgICAgbmhhcDoKICAgICAgICAgICAgbW92IGFoLCA5CiAgICAgICAgICAgIGxlYSBkeCwgaW5wdXQKICAgICAgICAgICAgaW50IDIxaCAgCiAgICAgICAgICAgIG1vdiBhaCwgMSAgIDsgbmhhcCBreSB0dQogICAgICAgIHRpZXA6CiAgICAgICAgICAgIGludCAyMWggICAgICAgICAgICAgICAgIAogICAgICAgICAgICBjbXAgYWwsIDMwaCA7IHNvIHNhbmgga3kgdHUgdnVhIG5oYXAgdmFvIHZvaSAzMGgKICAgICAgICAgICAgamUgdGhvYXQgICAgICAgOyBuZXUgbGEgc28gMCB0aGkgdGhvYXQKICAgICAgICAgICAgY21wIGFsLCAzMGggCiAgICAgICAgICAgIGpiIHNhaSAgICAgIDsgbmV1IG5obyBob24gdGhpIG5oYXkgZGVuIG5oYW4gc2FpCiAgICAgICAgICAgIGNtcCBhbCwgMzloCiAgICAgICAgICAgIGpnIHNhaSAgICAgIDsgbmV1IGxvbiBob24gdGhpIG5oYXkgZGVuIHNhaQogICAgICAgICAgICBqbXAgZHVuZyAgICA7IG5oYXkgdm8gZGlldSBraWVuIGRlbiB0aWVwCiAgICAgICAgc2FpOiAgICAgICAgICAgIAogICAgICAgICAgICBtb3YgYWgsIDkKICAgICAgICAgICAgbGVhIGR4LCBubyAKICAgICAgICAgICAgaW50IDIxaAogICAgICAgICAgICBtb3YgQUgsOQogICAgICAgICAgICBsZWEgRFgsQ0xSRgogICAgICAgICAgICBpbnQgMjFIICAKICAgICAgICAgICAgam1wIG5oYXAgICAKICAgICAgICBkdW5nOgogICAgICAgICAgICBtb3YgYWgsIDkKICAgICAgICAgICAgbGVhIGR4LCB5ZXMKICAgICAgICAgICAgaW50IDIxaAogICAgICAgICAgICBtb3YgQUgsOQogICAgICAgICAgICBsZWEgRFgsQ0xSRgogICAgICAgICAgICBpbnQgMjFICiAgICAgICAgICAgIGptcCBuaGFwCiAgICAgICAgdGhvYXQ6ICAgICAgCiAgICAgICAgICAgIG1vdiBhaCwgOQogICAgICAgICAgICBsZWEgZHgsIHllcwogICAgICAgICAgICBpbnQgMjFoCiAgICAgICAgICAgIG1vdiBhaCwgNGNoCiAgICAgICAgICAgIGludCAyMWgKICAgIG1haW4gZW5kcAplbmQgbWFpbg==