程序调试好了,输一串小于30位的数字,输出1表示奇数,输出0偶数。
data segment
num db 30,?,30 dup(?)
data ends
code segment
assume cs:code,ds:data
start: mov ax,data
mov ds,ax
mov ah,0ah
int 21h
mov bl,num+1
and bh,00h
mov ah,02h
mov dl,0ah
int 21h
mov dl,0dh
int 21h
mov al,[bx+num+1]
and al,01h
cmp al,00h
jz next
mov dl,31h
int 21h
jmp exit
next: mov dl,30h
int 21h
exit: mov ax,4c00h
int 21h
code ends
end start