[集会] 进入 1 的是否存在是装配性试验

问题检查输入字符的数目或不.

校验字符是零

.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

代码