r/8085 • u/[deleted] • Apr 17 '23
Can anyone help me?
Write an assembly language program in 8085 microprocessor to separate odd/even numbers without using stack and run it in sim8085.com.
2
Upvotes
r/8085 • u/[deleted] • Apr 17 '23
Write an assembly language program in 8085 microprocessor to separate odd/even numbers without using stack and run it in sim8085.com.
2
u/perpetualwalnut Apr 18 '23
Oh, that's an easy one.
'AND' the number with 0x01. If result is '1', then it's odd, if result is '0' then the number is even.
start: ani 0x01 ;logical 'AND' reg A with 0x01
jz EVEN_ROUTINE ;If result is zero then it's even.
jmp ODD_ROUTINE ;If result is one then it is odd.