Professional Documents
Culture Documents
Prepared by:
Dr. Ahmed Hassan M. Hassan
Associate Professor
dr.ahmed@mashreq.edu.sd
www.mashreq.edu.sd
Main Contents
Architecture
Internal Register Organization and Pin Configuration
Instruction Set of 8085
addressing modes
instruction machine cycles with states and timing
diagram.
8085 assembly language programming
Examples
Introduction
Microprocessor-based system
Based on the design of the ALU and decoding unit, the
microprocessor manufacturer provides instruction set for
every microprocessor.
A 20 B MOV B,A A 20 B 20
A F A F
B 30 C MOV M,B B 30 C
D E D E
H 20 L 50 H 20 L 50 30
A F A F
B C B C 40
MOV C,M
D E D E
H 20 L 50 40 H 20 L 50 40
MVI-Move immediate 8-bit
Opcode Operand
MVI Rd,
Data
M, Data
The 8-bit data is stored in the destination register or
memory.
If the operand is a memory location, its location is
specified by the contents of the H-L registers.
A F A F
B C MVI B,60H B 60 C
D E D E
H L H L
204FH 204F
HL=2050 HL=2050 40
MVI M,40H
2051H 2051H
LDA-Load accumulator
Opcode Operand
A A 30
LDA
2000H 30 2000H 2000H 30
LDAX-Load accumulator indirect
Opcode Operand
LD A X B/D Register Pair
A F A 80 F
B C 2030H 80 LDAX D B C 2030H 80
D 20 E 30 D 20 E 30
LXI-Load register pair immediate
O pcode O perand
A F A 80 F
B C 2030H 30 LXI H, B C 9030H 50
2030
H L
2031H 90 H 90 L 30
Assignment (1):
Subtract
Decrement
Addition
Any 8-bit number, or the contents of register, or the contents
of memory location can be added to the contents of
accumulator. The result (sum) is stored in the accumulator.
A 04
A 09
B C
ADD C B C 05
05
A=A+C D E
D E
H L
H L
04+05=09
Before Execution After Execution
A 04 ADD M A 14
B C A=A+M B C
D E D E
H 20 L 50 10
10 H 20 L 50
CY 01
A
A 56
50
ADCC B C 20
B C 05 A=A+C+CY D E
D E H L
H L
50+05+01=56
Before Execution After Execution
CY 1
ADCM A 37 2050H 30
A 06 2050H 30
A=A+M+CY
H 20 L 50 H 20 L 50
06+1+30=37
AD I
Opcode Operand Description
ADI 8-bit data Add immediate to accumulator
Example: ADI 45 H
Before Execution After Execution
A 03 ADI 05H A 08
A=A+DATA(8)
03+05=08
AC I
Opcode Operand Description
ACI 8-bit data Add immediate to
accumulator with carry
The 8-bit data and the Carry Flag (CY) are added to the
contents of accumulator.
Example: ACI 45 H
Before Execution After Execution
CY 1 A 26
ACI 20H
A 05 A=A+DATA (8)+CY
05+20+1=26
DAD
Opcode Operand Description
DAD Reg. pair Add register pair to H-L pair
Example: D A D B or DAD D
Before Execution After Execution
D 12 E 34 D 12 E 34
H 23 L 45 DAD D H 35 L 79
1234
2345 +
DAD D HL=HL+DE
-------
3579 or
DAD B HL=HL+BC
Increment / Decrement
A A
B 10 C INR B B 11 C
D E D E
R=R+1 H L
H L
10+1=11
Before Execution After Execution
INR M
H
20
L
50 2050H 10 H
20
L
50
11 2050H
M=M+1
10+1=11
IN X
Opcode Operand Description
INX R Increment register pair by 1
SP SP
B C B C
INX H D E
D E
RP=RP+1
H 10 L 20 H 10 L 21
1020+1=1021
3.Logical Instructions
These instructions perform logical operations on data
stored in registers, memory and status flags.
A AA A 0A
B 10
0F C ANAB B 0F C
D E A=Aand R D E
H L H L
0101 0101=55H
CY AC 1011 0011=B3H CY 0 AC 1
0001 0001=11H
A 55 2050H A 11 2050H B3
B3
H 20 L 50 ANAM H 20 L 50
A=Aand M
Opcode Operand Description
ANI 8-bit data Logical A N D immediate with
accumulator
0011 0011=33H
CY AC ANI 3FH CY 0 AC 1