You are on page 1of 3

1.

ANA R

a: 1100 0011
R: 0101 0011

ANS: 0100 0011 - 43H

2. ANA M

a: 0011 0101
H: 0011 1000
L: 1011 1100
data: 0010 0001
ans: 0010 0001 - 21H

3. ORA M

a: 0010 1101
H: 0001 1101
L: 0010 1101
data: 0011 0001
ans : 0011 1101 - 3DH

4. XRA M

05 - 0101
07 - 0111

0101 0111
1000 1010

1101 1101
Ans - DDH

5. CMP R

a : 1010 0011
r1: 0010 1100

A : 0111 0111 - 1+2+4+16+32+64 = 119


A : 77H
sign bit: 0
z bit : 0
carry : 1

6. CMP M
a : 1101 1100 - 4+8+16+64+128 = 220
r1: 0010 0111 - 1+2+4+32 = 39
2s: 1101 1001
A : 1011 0101 - B5H = 181
sign = 0
zero = 0
carry = 1

7. CMP 8 bit
a : 1101 1100 - 4+8+16+64+128 = 220
8: 0111 0101 - 64+32+16+4+1 = 117

103 = 64+32+4+2+1 = 0110 0111 = 67H


sign = 0
carry = 1
zero = 0

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

ROTATE INSTRUCTIONS

1. RLC - C for carry - we do not consider carry - LSB will move to the left i.e.
to the MSB and the MSB will now become the LSB
2. RRC - same as RLC but with rotate to the right - rotate right without carry

1. RLC

NIB 1 NIB2 CARRY


R1 - 1 1 0 1 0 0 0 1
after - 1 0 1 0 0 0 1 1
1

2. RRC

NIB 1 NIB2 CARRY


R1 - 1 1 0 1 0 0 0 1
after - 1 1 1 0 1 0 0 0
1

3. RAL - we consider carry - LSB will move to the left i.e.


to the MSB and the MSB will now become the LSB
4. RAR - same as RLC but with rotate to the right - rotate right with carry

3. RAL

NIB 1 NIB2 CARRY


R1 - 0 1 0 1 0 0 0 1
1
after - 1 0 1 0 0 0 1 1
0

4. RAR

NIB 1 NIB2 CARRY


R1 - 0 1 0 1 0 0 0 1
1
after - 1 0 1 0 1 0 0 0
1

You might also like