Find the C Z and H flags for each of the followinga LDI R20

Find the C, Z, and H flags for each of the following:(a) LDI R20, 0 times 3F LDI R21, 0 times 45 LDI R21, 0 times 58 (b) LDI R20, 0 times 99 LDI R21, 0 times 58 ADD R20, R21 (c) LDI R20, 0 times FF CLP R21 SEC ADD R20, R21 (d) LDI R20, C times FF LDI R21, 0 times 1 ADD R20, R21

Solution

1 Ans)

a) 0x3F-------0x0011 1111

0x45-------0x0100 0101

---------------------------------------------

0x1000 0100 H=1 C=0 Z=0

---------------------------------------------------------------------------------------------------------

b) 0x99-------0x1001 1001

0x58-------0x0101 1000

---------------------------------------------

0x1111 0001 H=1 C=0 Z=0

----------------------------------------------------------------------------------------------------

c) 0xFF-------0x1111 1111

0x00-------0x0000 0000

carry-------------- 1

---------------------------------------------

0x0000 0000 H=1 C=1 Z=1

------------------------------------------------------------------------------------------------

(d) 0xFF-------0x1111 1111

0x01-------0x0000 0001

---------------------------------------------

0x0000 0000 H=1 C=1 Z=1

 Find the C, Z, and H flags for each of the following:(a) LDI R20, 0 times 3F LDI R21, 0 times 45 LDI R21, 0 times 58 (b) LDI R20, 0 times 99 LDI R21, 0 times 5

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site