Question 6.9: Examine the following code and analyze the result. MOV A,#+9...

Examine the following code and analyze the result.

MOV         A,#+96            ;A=0110 0000 (A=60H)
MOV         R1,#+70           ;R1=0100 0110(R1=46H)
ADD         A,R1                  ;A=1010 0110

;A=A6H=-90,INVALID

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.

\begin{array}{r c}\begin{matrix} \\ + \\ + \end{matrix} \begin{matrix} +96 \\ +70 \\ \hline 166 \end{matrix} & \begin{matrix} 0110 & 0000 \\ 0100 & 0110 \\ \hline 1010 & 0110 \end{matrix} \begin{matrix}  \\  \\ \text{ and } OV =1 \end{matrix} \end{array}

According to the CPU, the result is -90, which is wrong. The CPU sets OV=1 to indicate the overflow

Related Answered Questions

Question: 6.8

Verified Answer:

1.     0011 0100        34H given in binary 2.    ...
Question: 6.10

Verified Answer:

MOV    P2,#00        ;clear P2 MOV    P1,#0FFH   ;...
Question: 6.15

Verified Answer:

MOV   R1,#0             ;R1 keeps number of 1s MOV...
Question: 6.13

Verified Answer:

MOV    R5,#8 AGAIN:         MOV   C,P2.7         ;...