Machine-translated by Google. Questions are authored in English.
Top

Discussion

What is the status of the carry, auxiliary carry and parity flags after executing following instructions ?

MOV A,#9C
ADD A.#64H

  • A.CY = 0, AC = 0, P = 0
  • B.CY = 1, AC = l, P = 0
  • C.CY = 0, AC = 1, P = 0
  • D.CY = l, AC = l, P = 1

Answer: B

After the addition CY = 1, AC = 1 and P = 0; the paper prints the digit 1 as a letter l in this option.

The instructions load 9CH into A and add 64H:

\[ \begin{aligned} 9C_{H} &= 1001\,1100 \\ 64_{H} &= 0110\,0100 \\ \text{sum} &= 1\;0000\,0000 \end{aligned} \]

The result is 100H, so A = 00H and the carry out of bit 7 sets CY = 1. The low nibbles C + 4 = 10H, which carries out of bit 3 and sets AC = 1. The parity flag is set when A holds an odd number of 1s; 00H has none, an even count, so P = 0.

Options A and C miss the carry out of bit 7, and option D gets the parity wrong.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.