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

DevinDevin
I've poured enough drinks to know that people don't always want advice—they just want to talk.
Chat with Devin
TaigaTaiga
Every great hero faces trials, and you—yes, YOU—are no exception!
Chat with Taiga
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

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