-1
\$\begingroup\$

What happens to the parity flag of an Intel 8085 microprocessor when there is no '1' bit in the accumulator?

For example, if the following instruction executes,

MVI A, 05H

MVI B, 05H

SUB B

the result will be A= 00H, in which there is no '1' bit. In this case what will be the state of the parity flag?

\$\endgroup\$
3
\$\begingroup\$

The documentation for the 8085 says that after any arithmetic operation, for instance your SUB B, the parity flag is set if there are an even number of '1' bits in the accumulator.

Perhaps you're not sure whether zero, the number of '1' bits in the 00H result, is odd or even.

Zero is even. Odd numbers leave a remainder of 1 when divided by 2. Even numbers divide by 2 exactly.

As 0 is even, the parity flag will be set.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.