.model small
.stack 100h
.data
.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
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 ax,@data
mov ds,ax
mov ah,09h
mov dx,offset num
int 21h
mov dx,offset num
int 21h
mov ah,01h
int 21h
mov bl,al
mov al,bl
ror al,1
jnc dn
int 21h
mov bl,al
mov al,bl
ror al,1
jnc dn
rol al,1
mov odd,al
mov odd,al
mov ah,09h
mov dx,offset out1
int 21h
jmp exit
mov dx,offset out1
int 21h
jmp exit
dn:
rol al,1
mov even1,al
mov ah,09h
rol al,1
mov even1,al
mov ah,09h
mov dx,offset out2
int 21h
int 21h
exit:
mov ah,4ch
int 21h
ends
end
mov ah,4ch
int 21h
ends
end
Output:
Comments
Post a Comment