1. PRINCIPLES OF 8085 MICROPROCESSOR
Dr.S.Barani
School of Electrical and Electronics Engineering
Sathyabama Institute of Science and Technology
Week 2 – Instruction sets
A certified Moodle Course on
3. ADDITION
ADD Add immediate to acc
ADC Add reg/M to acc with carry
ADI Add immediate to acc
ACI Add immediate to acc with carry
SUBTRACTION
SUB Subtract reg/M from acc
SBB Subtract reg/M and borroe from acc
SUI Subtract immediate data from acc
SBI Subtract immediate data and borrow from acc
3
A certified Moodle Course on Principles of 8085 Microprocessor
4. INCREMENT / DECREMENT
INR increment reg
INX increment reg.pair
DCR decrement reg
DCX decremenr reg.pair
ADDITION OF 16 BIT
DAD add reg.pair with HL
4
A certified Moodle Course on Principles of 8085 Microprocessor
5. Addition of 8 and
16 bit
5
A certified Moodle Course on Principles of 8085 Microprocessor
6. ADD M
Register Contents Before execution
Register Contents After execution
Syntax ADD reg / M – 1 byte Add reg / M to acc
6
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(reg/M)
M 51
A 47
M 51
A 98
S Z XX AC XX P XX C
1 0 0 0 0
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
M = 0 1 0 1 0 0 0 1
A(A+M) = 1 0 0 1 1 0 0 0
7. ADI 51
Register Contents Before execution
Register Contents After execution
Syntax ADI 8 bit data – 2 byte Add immediate to acc
7
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(data)
data 51
A 47
M 51
A 98
S Z XX AC XX P XX C
1 0 0 0 0
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
data = 0 1 0 1 0 0 0 1
A(A+M) = 1 0 0 1 1 0 0 0
8. ADD M
Register Contents Before execution
Register Contents After execution
Syntax ADC reg / M – 1 byte Add reg/M and carry to acc
8
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(reg/M)
M 51
A 47
C 1
M 51
A 99
C 1
S Z XX AC XX P XX C
1 0 0 0 1
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
M = 0 1 0 1 0 0 0 1
C 1
A(A+M) = 1 0 0 1 1 0 0 1
9. ADI 51
Register Contents Before execution
Register Contents After execution
Syntax ADI 8 bit data – 2 byte Add immediate to acc
9
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
Acc =
acc +
(data)
data 51
A 47
M 51
A 99
S Z XX AC XX P XX C
1 0 0 0 1
S Z XX AC XX P XX C
A = 0 1 0 0 0 1 1 1
data = 0 1 0 1 0 0 0 1
C 1
A(A+M) = 1 0 0 1 1 0 0 1
10. DAD D
Register Contents Before execution
If the result is greater than 16 bits then C bit is set. All
other flags remain unaltered.
Register Contents After execution
Syntax DAD reg.pair – 1 byte Add reg.pair to HL reg. pair
10
A certified Moodle Course on Principles of 8085 Microprocessor
Hint
HL =
HL +
(reg.pair
)
H L
22 21
D E
02 20
2221 (HL)
0220 (DE)
2441 (HL- Ans)
H L
24 41
D E
02 20
11. TRY - OUT
TASK 1
Execute the
instruction DAD SP
and update the
contents of registers
and status of Flag
register.
Before execution
The content of HL -
6231
The content of SP –
9901
TASK 2
Execute the instruction
ADI F0 and update the
contents of registers
and status of Flag
register.
Before execution
The content of A - 40
TASK 3
Execute the instruction
ADC M and update the
contents of registers
and status of Flag
register.
Before execution
The content of A - 40
The content of M -30
11
A certified Moodle Course on Principles of 8085 Microprocessor
12. SOLUTION - TASK 1
Before execution
After execution
12
A certified Moodle Course on Principles of 8085 Microprocessor
H L
72 31
99 01
0B 32
H L
TASK 1
Execute the
instruction DAD SP
and update the
contents of registers
and status of Flag
register.
Before execution
The content of HL -
6231
The content of SP –
9901
SP
7231
9901
1 0B32
S Z XX AC XX P XX C
No Change 1
13. SOLUTION - TASK 2
Before execution
Carry =1 After execution
13
A certified Moodle Course on Principles of 8085 Microprocessor
A DATA
40 F0
30 F0
A DATA
TASK 2
Execute the
instruction ADI F0
and update the
contents of
registers and
status of Flag
register.
Before execution
The content of A -
40S Z XX AC XX P XX C
0 0 0 1 1
A 0 1 0 0 0 0 0 0
DATA 1 1 1 1 0 0 0 0
A 10 0 1 1 0 0 0 0
14. SOLUTION - TASK 3
Before execution
After execution
14
A certified Moodle Course on Principles of 8085 Microprocessor
A M
40 30
70
A
TASK 3
Execute the
instruction ADC M
and update the
contents of
registers and
status of Flag
register.
Before execution
The content of A -
40
The content of M -
30
A 0 1 0 0 0 0 0 0
M 0 0 1 1 0 0 0 0
A 0 1 1 1 0 0 0 0
S Z XX AC XX P XX C
0 0 0 0 0