What are the states of the Sign Carry (S) and Parity Flag (P) after executing…

2017

What are the states of the Sign Carry (S) and Parity Flag (P) after executing the following 8085 program?

MVI A, 00H MVI B, 01H SUB B

  1. A.

    S=0andP=0

  2. B.

    S=0andP=1

  3. C.

    S=1andP=0

  4. D.

    S=1andP=1

Attempted by 17 students.

Show answer & explanation

Correct answer: D

The program subtracts 01H from 00H, producing FFH. FFH has the sign bit set, so S = 1, and it has eight 1-bits, so parity is even and P = 1.

Explore the full course: Niacl Ao It Specialist