Академический Документы
Профессиональный Документы
Культура Документы
Topics to cover
Relatively Simple Instruction Set Architecture
8085 Microprocessor Instruction Set Architecture
Analyzing the 8085 Instruction Set Architecture
Summary
Memory Model
Registers
Instruction Set
Instruction
Operation
NOP
No operation
LDAC
AC = M[]
STAC
MVAC
M[] = AC
R = AC
MOVR
AC = R
AC accumulator register
R general purpose register
Instruction
Operation
ADD
SUB
INAC
CLAC
AC = 0, Z = 1
AND
OR
XOR
NOT
AC accumulator register
Z zero flag
Instruction
Operation
JUMP
GOTO
JMPZ
If (Z = 1) Then GOTO
JPNZ
If (Z = 0) Then GOTO
Z zero flag
Note:
Instruction code
Low-order 8 bits of
byte 3
Example:
25:
JUMP 1234 H
(JUMP)
(34H)
(12H)
total = 0, i = 0
2:
i=i+1
3:
total = total + i
4:
IF i n THEN GOTO 2
total = 0, i = 0
i = i +1
total = total +1
Memory Model
Register Set
Instruction Set
Operation
MOV r1, r2
r1 = r2
LDA
A = M[]
STA
PUSH rp
M[] = A
PUSH PSW
POP PSW
IN n
A = input port n
OUT n
Output port n =A
POP rp
Operation
Flags
ADD r
A= A+ r
All
ADD M
A = A + M[HL]
All
INR r
r=r+1
Not CY
IN M
M[HL] = M[HL] + 1
Not CY
DCR n
r=r-1
Not CY
DCR M
M[HL] = M[HL] - 1
Not CY
XRA M
All
CMP r
A = A M[HL]
Compare A and r
CMA
A = A
None
CY carry flag
All
GOTO
Jcond
CALL
Call subroutine at
Ccond
RET
Rcond
Note:
Two-byte
byte 2
Instruction code
value
Example:
25:
MVI
r, n
Specifies r
(MVI r)
(low-order memory)
byte 1
Three-byte byte 2
byte 3
Instruction code
Low-order 8 bits
High-order 8 bits
Example:
Example:
25:
25:
LXI
MOV rp,
r1,r2
Specifies rp
instructionstored
storedininmemory:
memory:
instruction
25th
25thbyte
byte 25:
25: 00rp
00000001
0001 (LXI
(MOV)
rp)
26th
26thbyte
byte 26:
26: xxxx
xxxxxxxx
xxxx (low-order
(specifies memory)
r1)
27thbyte
byte 27:
27: yyyy
yyyyyyyy
yyyy (high-order
(specifies r2)
27th
memory)
i=n
sum = A A = 0
sum = sum + i
i=i-1
IF i 0 THEN GOTO Loop
total = sum
as
Summary of ISA
The ISA specifies
a.
an instruction set that the CPU can process
b.
its user accessible registers
c.
how it interacts with memory
2.
The ISA does not specify how the CPU is designed, but
it specifies what it must be able to do.
3.
6.
7.
THE END