program to find number is even or odd.

 .model small
.stack 100h
.data

num db "Enter any number:$"
out1 db 10d,"number is odd$"
out2 db 10d,"number is even$"
odd db 0
even1 db 0

.code
mov ax,@data
mov ds,ax

mov ah,09h
mov dx,offset num
int 21h

mov ah,01h
int 21h
mov bl,al
mov al,bl
ror al,1
jnc dn

rol al,1
mov odd,al

mov ah,09h
mov dx,offset out1
int 21h
jmp exit

dn:
rol al,1
mov even1,al
mov ah,09h

mov dx,offset out2
int 21h

exit:
mov ah,4ch
int 21h
ends
end

Output:



Comments