odd even in assembly language
.model small
.stack 100h
.data
msg db "Enter your number:$"
mdg db 13,10,"Even$"
mdg1 db 13,10,"Odd$"
.code
start:
mov ax,@data
mov ds,ax
lea dx,msg
mov ah,9h
int 21h
mov ah,1h
int 21h
mov bl,2
div bl
cmp ah,0
jne odd
lea dx,mdg
mov ah,9h
int 21h
jmp endd
odd:
lea dx,mdg1
mov ah,9h
int 21h
endd:
mov ah,4ch
int 21h
end start
Comments
Post a Comment