[Assembly 8086] How To Check Odd And Even Number in Assembly 8086

The Following Program will take a single digit or character from user and if digit it will print odd or even else it will convert Case

.model small
.stack 100h
msg db 10,13,'Enter number=$'
msg1 db 10,13,'Number is even$'
msg2 db 10,13,'Number is odd$'
msg3 db 10,13, 'Case Convertion=$'


   mov ax,@data
   mov ds,ax
   lea dx,msg
   mov ah,9
   int 21h
   mov ah,1
   int 21h
   mov bl,al
   cmp bl,'9'
   ja cc 
   sar bl,1  
   jc odd
   lea dx,msg1
   mov ah,9
   int 21h
   jmp exit
   lea dx,msg2
   mov ah,9
   int 21h
   jmp exit
   lea dx,msg3
     mov ah,9
     int 21h  
   cmp bl,'A'
   jnle next
    cmp bl,'Z'
    jnge con
    jmp lower
     add bl,32d
     mov dl,bl
     mov ah,2
     int 21h
     jmp exit 
      cmp bl,'a'
      jnle ln
       cmp bl,'z'
       jnge conl
      sub bl,32d
     mov dl,bl
     mov ah,2
     int 21h
     jmp exit 


Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment


Post a Comment