Documente Academic
Documente Profesional
Documente Cultură
8085
Instruction
Page 1
Flowchart
Arrow: Indicates the direction of the
program execution
Rectangle: Represents a process of
an operation
Page 2
Flowchart
Page 3
Flowchart
Page 4
A Register (Accumulator)
8085
CPU
Registers
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 5
Page 6
B 8
MVI A,B8H
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 7
5 F
MVI B,5FH
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 8
Page 9
Page 10
Page 11
Example
MVI A 33H
INR A
STA 12C3H
HLT
Free Powerpoint Templates
Page 12
3 3
MVI A, 33H
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 13
3 4
INR A
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 14
12C3H
STA 12C3H
HLT
3 4
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 15
Example
LDA 55C1H
SUI 10H
STA 55C1H
HLT
- for this example, let's suppose
55C1H starts with the value 6AH
Free Powerpoint Templates
Page 16
55C1H
6 A
LDA 55C1H
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 17
5 A
SUI 10H
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 18
55C1H
STA 55C1H
HLT
5 A
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 19
Page 20
Page 21
LXI D 3f67H
A Register (Accumulator)
3 F
6 7
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 22
Page 23
Page 24
Page 25
Page 26
An Indirect Command:
Load Accumulator Extended
LDAX Loads into register A the data
stored at RAM address specified by pair of
registers
e.g. LDAX D
Byte from register D and byte from
register E are put together to make a RAM
address. Value stored at that RAM address
Powerpoint
Templates
is loadedFree
into
register
A.
Page 27
Example
MVI A,33H
MVI B,89H
MVI C,87H
STAX B
HLT
Page 29
MVI A,33H
3 3
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 30
MVI B,89H
3 3
8 9
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 31
MVI C,87H
3 3
8 9
8 7
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 32
8987H
STAX B
3 3
8 9
8 7
A Register (Accumulator)
B
Register
C
Register
D
Register
E
Register
H
Register
L
Register
PC (Program
Counter)
SP (Stack Pointer)
SR (Status
Free Powerpoint Templates
Register)
Page 33
Page 34
Page 35
Conditional Loops
By comparing two values, we cause
flags to be set in the status register.
Based on the result of this comparison
we can decide to loop or not.
1.
Page 36
Conditional Loops
Sets the flags in the status
register as if we were subtracting
contents of C from A. (Does not
actually subtract)
Page 37
Conditional Loops
2.Compare an immediate value to
register A.
e.g. CPI FFH
Sets the flags in the status register as
if we were subtracting the value FF
from A. (Does not actually subtract)
Free Powerpoint Templates
Page 38
Conditional Loops
Now, looking at the flags in the status register,
we can tell our program to loop under certain
conditions. (Each command is followed by the
memory location to jump to)
JZ - Jump if Zero
JNZ - Jump if Not Zero
JP - Jump if Plus
JM - Jump if Minus
Free Powerpoint Templates
Page 39
Example
MVI A,07H
INR A
CPI 0BH
JNZ ??
STA 4400H
HLT
Free Powerpoint Templates
Page 40
0100
MVI A,07H
0102
INR A
0103
CPI 0BH
0105
JNZ ??
0108
STA 4400H
010A
HLT
Page 41
0100
MVI A,07H
0102
INR A
0103
CPI 0BH
0105
JNZ 0102H
0108
STA 4400H
010A
HLT
Page 42