nc db 5,?,5 dup(?)
cr db 0Dh,0Ah,'1','$'
crr db 0Dh,0Ah,'0','$'
data ends
code segment
assume ds:data,cs:code
start:mov ax,data
mov ds,ax
lea dx,nc
mov ah,0ah
int 21h
call inputc
call jsyx
jmp short ok1
mov ah,0ah
int 21h
mov dl,[nc+2]
cmp dl,'y'
je begin
cmp dl,'n'
jne eorr
mov ax,4c00h
int 21h
ok1:lea dx,cr
mov ah,09h
int 21h
jmp short s11
ok2:lea dx,crr
mov ah,09h
int 21h
jmp short s11
inputc proc near
mov cl,[nc+1]
mov ch,0
mov si,0
mov ax,0
s1:
mov di,cx
mov cl,[nc+2+si]
sub cl,30h
cmp cl,0
jb eorr
cmp cl,9
ja eorr
mov ch,0
mov bx,10
mul bx
add ax,cx
inc si
mov cx,di
loop s1
ret
inputc endp
jsyx proc near
;push dx
;push ax
;push bx
mov cx,ax
mov bx,4
div bx
cmp dx,0
jne ok2
mov ax,cx
mov bx,100
div bx
cmp dx,0
jne ok1
mov ax,cx
mov bx,400
div bx
cmp dx,0
jne ok2
;pop bx
;pop ax
;pop dx
ret
jsyx endp
code ends
end start