GATE 2023 EE – Question 57
In a given 8-bit general purpose micro-controller there are following flags.
C-Carry, A-Auxiliary Carry, O-Overflow flag, P-Parity (0 for even, 1 for odd)
R0 and R1 are the two general purpose registers of the micro-controller.
After execution of the following instructions, the decimal equivalent of the binary sequence of the flag pattern [CAOP] will be __________.
MOV R0, +0x60
MOV R1, +0x46
ADD R0, R1
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 2
Explanation
$0x60+0x46=0xA6=1010\,0110_2$. Carry out of bit 7: none, so $C=0$. Carry out of bit 3: $0+6=6$, none, so $A=0$. Overflow: $96+70=166>127$ as signed 8-bit, so $O=1$. Parity: $10100110$ has four 1s (even), so $P=0$. The pattern $[CAOP]=0010_2=2$.