answersLogoWhite

0

every odd no. has "1" in its last bit and every even no has "0" (in binary)

eg-

2=0010 ,3=0011

4=0100 ,5=0101....and so on

so just logically "AND" the no with "01H" using instruction [HAVING THAT NO. IN ACCUMULATOR (A)]

ANI 01H

so if the no. is even =>

A=0 (and zero flag is set i.e. "1"

but if the no is odd then => A=1

means zero flag is reset i.e. "0"

so using instruction "JZ"

you can find if the no. if even or odd. :)

User Avatar

Wiki User

12y ago

Still curious? Ask our experts.

Chat with our AI personalities

BlakeBlake
As your older brother, I've been where you are—maybe not exactly, but close enough.
Chat with Blake
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine

Add your answer:

Earn +20 pts
Q: How To find a number is odd or even in 8085?
Write your answer...
Submit
Still have questions?
magnify glass
imp