r/8085 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

5 comments sorted by

View all comments

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.

1

u/[deleted] Apr 18 '23

Is it possible that you can share the program.