Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 1
Instruction Set of 8085 microprocessor
a) Data Transfer Group
b) Arithmetic Group
c) Logical Group
d) Branching/Loop Group
e) Stack and Machine Control Group
Notation used in Instruction and opcode
Notations Meaning
M Memory location pointed by HL register pair
R 8-bit register
RP 16-bit register pair
RS Source register
RD Destination register
Addr 16-bit address
X 8-bit data
c) Logical Group
1. ANA R 2. ANA M 3. ANI data 4. ORA R
5. ORA M 6. ORI data 7. XRA R 8. XRA M
9. XRI data 10. CMA 11. CMC 12. STC
13. CMP R 14. CMP M 15. CPI data 16. RLC
17. RRC 18. RAL 19. RAR
1. ANA R
Description - Logical AND content of register R with accumulator A and store
the result in accumulator A.
Operation - A AND R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 2
Example - ANA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 01H
E = 41H 0100 0001
A = 35H 0011 0101
0000 0001
2. ANA M
Description - Logical AND content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A AND M ----> A OR A AND (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ANA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 01H
Note: - AND operation is performed same as ANA R.
3. ANI data
Description - Logical AND immediate data with accumulator A and store the
result in accumulator A.
Operation - A AND data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ANI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 01H
Note: - AND operation is performed same as ANA R.
AND Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 3
4. ORA R
Description - Logical OR content of register R with accumulator A and store the
result in accumulator A.
Operation - A OR R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 75H
E = 41H 0100 0001
A = 35H 0011 0101
0111 0101
5. ORA M
Description - Logical OR content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A OR M ----> A OR A OR (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 75H
Note: - OR operation is performed same as ORA R.
OR Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 4
6. ORI data
Description - Logical OR immediate data with accumulator A and store the
result in accumulator A.
Operation - A OR data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - ORI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 75H
Note: - OR operation is performed same as ORA R.
7. XRA R
Description - Logical X-OR content of register R with accumulator A and store
the result in accumulator A.
Operation - A X-OR R ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRA E
Before Execution After Execution
R= E = 41H R= E = 41H
A = 35H A = 74H
E = 41H 0100 0001
A = 35H 0011 0101
0111 0100
X-OR Operation
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 5
8. XRA M
Description - Logical X-OR content of memory location M with accumulator A
and store the result in accumulator A.
Operation - A X-OR M ----> A OR A X-OR (HL) ----> A
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRA M
Before Execution After Execution
M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H
A = 35H A = 74H
Note: - X-OR operation is performed same as XRA R.
9. XRI data
Description - Logical X-OR immediate data with accumulator A and store the
result in accumulator A.
Operation - A X-OR data ----> A
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation. Carry is
reset and AC is set.
Example - XRI 41H
Before Execution After Execution
data = 41H data = 41H
A = 35H A = 74H
Note: - X-OR operation is performed same as XRA R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 6
10. CMA
Description - Complement accumulator A and store the result in accumulator
A.
Operation - A̅ ----> A
No. of Bytes- 1
Flags - No flags are modified.
Example - CMA
Before Execution After Execution
A = 35H A = CA H
A = 35H = 0011 0101
A̅ = CA H = 1100 1010
11.CMC
Description - Complement the carry flag.
Operation - CY̅̅̅̅----> CY
No. of Bytes- 1
Flags - Only carry flag is complemented. No other flags are modified.
Example - CMC
Before Execution After Execution
(i) CY = Set CY = Reset
(ii) CY = Reset CY = Set
12.STC
Description - Set the carry flag.
Operation - CY = Set
No. of Bytes- 1
Flags - Only carry flag is complemented. No other flags are modified.
Example - STC
Before Execution After Execution
(i) CY = Set CY = Set
(ii) CY = Reset CY = Set
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 7
13.CMP R
Description - Compare content of register R with accumulator A. The contents
of register R and accumulator A are not altered.
Operation - A compare R----> Flag Register
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > R: CY is Reset and Zero flag is Reset.
(ii) A = R: Zero flag is set.
(iii) A < R: CY flag is set.
Example - CMP D
Before Execution After Execution
(i) A = 35H A > D
D = 25H
A = 35H = 0011 0101
D = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than D.
(ii) A = 35H A = D
D = 35H
A = 35H = 0011 0101
D = 35H = 0011 0101
2’s complement of 35H -----> 1100 1011
A = 35H = 0011 0101
2’s complement of 35H -----> + 1100 1011
1 0000 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and zero flag is set, which represent that the A is equal to D.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 8
(iii) A = 25H A < D
D = 35H
A = 25H = 0010 0101
D = 35H = 0011 0101
2’s complement of 35H -----> 1100 1011
A = 25H = 0010 0101
2’s complement of 35H -----> + 1100 1011
1111 0000
No carry generated so CY = reset, microprocessor complement this carry so CY = set,
which represent that the A is less than D.
14.CMP M
Description - Compare content of memory location M with accumulator A. The
contents of memory location M and accumulator A are not altered.
Operation - A compare M----> Flag Register
OR
A compare (HL)----> Flag Register
No. of Bytes- 1
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > M: CY is Reset and Zero flag is Reset.
(ii) A = M: Zero flag is set.
(iii) A < M: CY flag is set.
Example - CMP M
Before Execution After Execution
A = 35H A > M
M = (HL) = (1000) = 25H
A = 35H = 0011 0101
M = (HL) = (1000) = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 9
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than M.
Note: - Other comparison examples (A=M & A<M) are same as CMP R.
15.CPI data
Description - Compare immediate data with accumulator A. The immediate
and accumulator A are not altered.
Operation - A compare data----> Flag Register
No. of Bytes- 2
Flags - S, Z and P are modified to reflect the result of operation and Z, CY
are used to indicate the result of comparison.
(i) A > data: CY is Reset and Zero flag is Reset.
(ii) A = data: Zero flag is set.
(iii) A < data: CY flag is set.
Example - CPI 25H
Before Execution After Execution
A = 35H A > data
data = 25H
A = 35H = 0011 0101
data = 25H = 0010 0101
2’s complement of 25H -----> 1101 1011
A = 35H = 0011 0101
2’s complement of 25H -----> + 1101 1011
1 0001 0000
Carry is generated so CY = set, microprocessor complement this carry so CY = reset
and also zero flag is reset, which represent that the A is greater than immediate
data.
Note: - Other comparison examples (A=data & A<data) are same as CMP R.
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 10
16. RLC
Description - Rotate accumulator A left by 1 bit.
Operation - Accumulator: Dn Dn+1 (n=0 to 6)
D7 D0
D7 CY
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RLC
Before Execution After Execution
A = 48H A = 90H
CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 48H 0 1 0 0 1 0 0 0
A = 91H 1 0 0 1 0 0 0 0
17. RRC
Description - Rotate accumulator A right by 1 bit.
Operation - Accumulator: Dn+1 Dn (n=0 to 6)
D0 D7
D0 CY
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RRC
D7 D6 D5 D4 D3 D2 D1 D0
D7 D6 D5 D4 D3 D2 D1 D0
CY
CY = 0
CY
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 11
Before Execution After Execution
A = 48H A = 24H
CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 48H 0 1 0 0 1 0 0 0
A = 24H 0 0 1 0 0 1 0 0
18. RAL
Description - Rotate accumulator A left through carry by 1 bit.
Operation - Accumulator: Dn Dn+1 (n=0 to 6)
D7 CY
CY D0
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RAL
Before Execution After Execution
A = 58H A = B1H
CY = 1 CY = 0
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 58H 0 1 0 1 1 0 0 0
A = B1H 1 0 1 1 0 0 0 1
CY=1
New Value Previous Value
D7 D6 D5 D4 D3 D2 D1 D0
CY = 0
CY
CY = 0
Prashant Sharma, Lecturer, ET&T, MMGGP, Rajnandgaon (C.G.) Page 12
19. RAR
Description - Rotate accumulator A right through carry by 1 bit.
Operation - Accumulator: Dn+1 Dn (n=0 to 6)
D0 CY
CY D7
No. of Bytes- 1
Flags - Only carry flag is modified. No other flags are modified.
Example - RAR
Before Execution After Execution
A = 59H A = 2C H
CY = 0 CY = 1
Value D7 D6 D5 D4 D3 D2 D1 D0
A = 59H 0 1 0 1 1 0 0 1
A = 2C H 0 0 1 0 1 1 0 0
CY=0
Previous Value New Value
D7 D6 D5 D4 D3 D2 D1 D0
CY
CY = 1

8085 logical instruction

  • 1.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 1 Instruction Set of 8085 microprocessor a) Data Transfer Group b) Arithmetic Group c) Logical Group d) Branching/Loop Group e) Stack and Machine Control Group Notation used in Instruction and opcode Notations Meaning M Memory location pointed by HL register pair R 8-bit register RP 16-bit register pair RS Source register RD Destination register Addr 16-bit address X 8-bit data c) Logical Group 1. ANA R 2. ANA M 3. ANI data 4. ORA R 5. ORA M 6. ORI data 7. XRA R 8. XRA M 9. XRI data 10. CMA 11. CMC 12. STC 13. CMP R 14. CMP M 15. CPI data 16. RLC 17. RRC 18. RAL 19. RAR 1. ANA R Description - Logical AND content of register R with accumulator A and store the result in accumulator A. Operation - A AND R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set.
  • 2.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 2 Example - ANA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 01H E = 41H 0100 0001 A = 35H 0011 0101 0000 0001 2. ANA M Description - Logical AND content of memory location M with accumulator A and store the result in accumulator A. Operation - A AND M ----> A OR A AND (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ANA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 01H Note: - AND operation is performed same as ANA R. 3. ANI data Description - Logical AND immediate data with accumulator A and store the result in accumulator A. Operation - A AND data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ANI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 01H Note: - AND operation is performed same as ANA R. AND Operation
  • 3.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 3 4. ORA R Description - Logical OR content of register R with accumulator A and store the result in accumulator A. Operation - A OR R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 75H E = 41H 0100 0001 A = 35H 0011 0101 0111 0101 5. ORA M Description - Logical OR content of memory location M with accumulator A and store the result in accumulator A. Operation - A OR M ----> A OR A OR (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 75H Note: - OR operation is performed same as ORA R. OR Operation
  • 4.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 4 6. ORI data Description - Logical OR immediate data with accumulator A and store the result in accumulator A. Operation - A OR data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - ORI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 75H Note: - OR operation is performed same as ORA R. 7. XRA R Description - Logical X-OR content of register R with accumulator A and store the result in accumulator A. Operation - A X-OR R ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRA E Before Execution After Execution R= E = 41H R= E = 41H A = 35H A = 74H E = 41H 0100 0001 A = 35H 0011 0101 0111 0100 X-OR Operation
  • 5.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 5 8. XRA M Description - Logical X-OR content of memory location M with accumulator A and store the result in accumulator A. Operation - A X-OR M ----> A OR A X-OR (HL) ----> A No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRA M Before Execution After Execution M= (HL) = (1200) = 41H M= (HL) = (1200) = 41H A = 35H A = 74H Note: - X-OR operation is performed same as XRA R. 9. XRI data Description - Logical X-OR immediate data with accumulator A and store the result in accumulator A. Operation - A X-OR data ----> A No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation. Carry is reset and AC is set. Example - XRI 41H Before Execution After Execution data = 41H data = 41H A = 35H A = 74H Note: - X-OR operation is performed same as XRA R.
  • 6.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 6 10. CMA Description - Complement accumulator A and store the result in accumulator A. Operation - A̅ ----> A No. of Bytes- 1 Flags - No flags are modified. Example - CMA Before Execution After Execution A = 35H A = CA H A = 35H = 0011 0101 A̅ = CA H = 1100 1010 11.CMC Description - Complement the carry flag. Operation - CY̅̅̅̅----> CY No. of Bytes- 1 Flags - Only carry flag is complemented. No other flags are modified. Example - CMC Before Execution After Execution (i) CY = Set CY = Reset (ii) CY = Reset CY = Set 12.STC Description - Set the carry flag. Operation - CY = Set No. of Bytes- 1 Flags - Only carry flag is complemented. No other flags are modified. Example - STC Before Execution After Execution (i) CY = Set CY = Set (ii) CY = Reset CY = Set
  • 7.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 7 13.CMP R Description - Compare content of register R with accumulator A. The contents of register R and accumulator A are not altered. Operation - A compare R----> Flag Register No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > R: CY is Reset and Zero flag is Reset. (ii) A = R: Zero flag is set. (iii) A < R: CY flag is set. Example - CMP D Before Execution After Execution (i) A = 35H A > D D = 25H A = 35H = 0011 0101 D = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than D. (ii) A = 35H A = D D = 35H A = 35H = 0011 0101 D = 35H = 0011 0101 2’s complement of 35H -----> 1100 1011 A = 35H = 0011 0101 2’s complement of 35H -----> + 1100 1011 1 0000 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and zero flag is set, which represent that the A is equal to D.
  • 8.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 8 (iii) A = 25H A < D D = 35H A = 25H = 0010 0101 D = 35H = 0011 0101 2’s complement of 35H -----> 1100 1011 A = 25H = 0010 0101 2’s complement of 35H -----> + 1100 1011 1111 0000 No carry generated so CY = reset, microprocessor complement this carry so CY = set, which represent that the A is less than D. 14.CMP M Description - Compare content of memory location M with accumulator A. The contents of memory location M and accumulator A are not altered. Operation - A compare M----> Flag Register OR A compare (HL)----> Flag Register No. of Bytes- 1 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > M: CY is Reset and Zero flag is Reset. (ii) A = M: Zero flag is set. (iii) A < M: CY flag is set. Example - CMP M Before Execution After Execution A = 35H A > M M = (HL) = (1000) = 25H A = 35H = 0011 0101 M = (HL) = (1000) = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011
  • 9.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 9 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than M. Note: - Other comparison examples (A=M & A<M) are same as CMP R. 15.CPI data Description - Compare immediate data with accumulator A. The immediate and accumulator A are not altered. Operation - A compare data----> Flag Register No. of Bytes- 2 Flags - S, Z and P are modified to reflect the result of operation and Z, CY are used to indicate the result of comparison. (i) A > data: CY is Reset and Zero flag is Reset. (ii) A = data: Zero flag is set. (iii) A < data: CY flag is set. Example - CPI 25H Before Execution After Execution A = 35H A > data data = 25H A = 35H = 0011 0101 data = 25H = 0010 0101 2’s complement of 25H -----> 1101 1011 A = 35H = 0011 0101 2’s complement of 25H -----> + 1101 1011 1 0001 0000 Carry is generated so CY = set, microprocessor complement this carry so CY = reset and also zero flag is reset, which represent that the A is greater than immediate data. Note: - Other comparison examples (A=data & A<data) are same as CMP R.
  • 10.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 10 16. RLC Description - Rotate accumulator A left by 1 bit. Operation - Accumulator: Dn Dn+1 (n=0 to 6) D7 D0 D7 CY No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RLC Before Execution After Execution A = 48H A = 90H CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 48H 0 1 0 0 1 0 0 0 A = 91H 1 0 0 1 0 0 0 0 17. RRC Description - Rotate accumulator A right by 1 bit. Operation - Accumulator: Dn+1 Dn (n=0 to 6) D0 D7 D0 CY No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RRC D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 CY CY = 0 CY
  • 11.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 11 Before Execution After Execution A = 48H A = 24H CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 48H 0 1 0 0 1 0 0 0 A = 24H 0 0 1 0 0 1 0 0 18. RAL Description - Rotate accumulator A left through carry by 1 bit. Operation - Accumulator: Dn Dn+1 (n=0 to 6) D7 CY CY D0 No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RAL Before Execution After Execution A = 58H A = B1H CY = 1 CY = 0 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 58H 0 1 0 1 1 0 0 0 A = B1H 1 0 1 1 0 0 0 1 CY=1 New Value Previous Value D7 D6 D5 D4 D3 D2 D1 D0 CY = 0 CY CY = 0
  • 12.
    Prashant Sharma, Lecturer,ET&T, MMGGP, Rajnandgaon (C.G.) Page 12 19. RAR Description - Rotate accumulator A right through carry by 1 bit. Operation - Accumulator: Dn+1 Dn (n=0 to 6) D0 CY CY D7 No. of Bytes- 1 Flags - Only carry flag is modified. No other flags are modified. Example - RAR Before Execution After Execution A = 59H A = 2C H CY = 0 CY = 1 Value D7 D6 D5 D4 D3 D2 D1 D0 A = 59H 0 1 0 1 1 0 0 1 A = 2C H 0 0 1 0 1 1 0 0 CY=0 Previous Value New Value D7 D6 D5 D4 D3 D2 D1 D0 CY CY = 1