Title: ELE413
1ELE413
- 8085 Instruction Set
- Prepared by Kenan BOZDAS
- 28.10.2008
2Contents
- Registers
- Addressing Modes
- Instruction Set Classification
- Deeper look at instructions
3Registers
- Accumulator(A) Processor Status Word (PSW,Flag
Register) - B C (BC)
- D E (DE)
- H L (HL, M)
- Stack Pointer (SP)
- Program Counter (PC)
4Registers
Accumulator
- Destination for all Arithmetic Logical
operations - Dest Source for IN OUT instructions
5Registers
Flag Register (PSW)
- Flow control
- Status control
- Cannot access bits
6Registers
B, C, D, E
- Can be used as an 8-bit register
- Or in pairs
- B C (BC)
- D E (DE)
7Registers
H, L
- Can be used as an 8-bit register
- Or in pairs
- H L (HL)
- Or as a memory pointer (M)
8Registers
SP, PC
- Stack pointer is used in stack operations.
- Program counter contains the address of the
instruction to be executed.
9Addressing Modes
- Immediate Addressing
- Register Addressing
- Direct Addressing
- Indirect Addressing
10Addressing Modes
Immediate Addressing
- Data is present in the instruction.
- MVI R,data (8-bit)
- LXI R-R,data (16-bit)
11Addressing Modes
Register Addressing
- Data is provided through the registers.
- MOV Rd,Rs
12Addressing Modes
Direct Addressing
- I/O instructions
- IN 01H
- OUT 21H
- Address is given in the instruction
- CALL 2000H
- STA 0FF00H
13Addressing Modes
Indirect Addressing
- Effective address is calculated by the processor
- DCR M HLHL-1
- LDAX B ABC
14Instruction Set Classification
- Data Transfer (Copy) Operations
- Arithmetic Operations
- Logical Operations
- Branching Operations
- Machine Control Operations
15Instruction Set Classification
Data Transfer(Copy) Operations
- Between Registers
- MOV D,L
- Specific data byte to a register or a memory
location - MVI C,0FAH
- MVI M,00H
- Between a memory location and a register
- MOV M,L
- Between an I/O device and the accumulator
- IN 21H
16Instruction Set Classification
Arithmetic Operations
- Addition
- ADD R AAR
- ADI 03H AA3H
- Subtraction
- SUB R AA-R
- SUI 15H AA-15H
- Increment/Decrement
- INR A
- DECX H
17Instruction Set Classification
Logical Operations
- AND, OR, XOR
- ANA R AAR
- XRA M AA M
- Rotate
- RAL
- RRC
- Compare
- CMP R
- Complement
- CMA
18Instruction Set Classification
Branching Operations
- Jump
- JMP addr unconditional
- JNZ addr conditional
- CALL
- CALL addr unconditional
- CC addr conditional
- Return
- Restart
19Instruction Set Classification
Machine Control Operations
- Halt, Interrupt, Do nothing
- HLT
- EI
- NOP
20Deeper look at instructions
- MOV R,R
- MOV R,M
- MOV M,R
- MOV M,M (Single Memory Pointer)
- MVI R,imm
- MVI M,imm
- MVI addr,imm (Only via memory pointer)
21Deeper look at instructions
- LXI B, 16-bit imm. BC16-bit imm.
- LXI D, 16-bit imm. DE16-bit imm.
- LXI H, 16-bit imm. HL16-bit imm.
- LXI SP,16-bit imm. SP16-bit imm.
- LHLD 16-bit imm. HL16-bit imm.
- SHLD 16-bit imm. 16-bit imm.HL
22Deeper look at instructions
- LDA 16-bit addr
- LDAX B (BC)
- LDAX D (DE)
- LDAX H (HL) (Already have MOV A,M)
- STA 16-bit addr
- ..
- STAX H (Already have MOV M,A)
23Deeper look at instructions
- INR/DCR R RR1, CY not altered
- INR/DCR M HLHL 1, H nor L altered
- INX/DCX Rp RpRp 1, no flags altered
- DAD Rp HLHLRp only CY affected
- DAA Decimal Adjust not Conversion
24Deeper look at instructions
- ADD R AAR
- ADC R AARCY
- ADD M AAHL
- ADC M AAHLCY
- ADI imm. AA 8-bit imm.
- ACI imm AAimm.CY
- SUB R AA-R
- SBB R AA-R-CY
- SUB M AA-HL
- SBB M AA-HL-CY
- SUI imm. AA- 8-bit imm.
- SBI imm AA-imm.-CY
25Deeper look at instructions
- ANA R AAR
- ANA M AAHLAM
- ANI imm. AA 8-bit imm.
- ORA R AAR
- ORA M AAHLAM
- ORI imm. AA 8-bit imm.
- XRA R AA R
- XRA M AA HLAM
- XRI imm. AA 8-bit imm.
26Deeper look at instructions
- CMA complement accumulator (B,C,D,E..)
- CMC complement carry
- STC set carry
- RLC rotate A left, CY not included
- RRC rotate A rigth, CY not included
- RAL rotate A left through CY
- RAR rotate A right through CY
27Deeper look at instructions
28Deeper look at instructions
- JMP 16-bit addr. PC16-bit addr
- JC/JNC 16-bit addr.
- JZ/JNZ 16-bit addr.
- JM/JP 16-bit addr.
- JPE/JPO 16-bit addr.
- PCHL PCHL
- XCHG DEHL, HLDE not
- XTHL TOSHL, HLTOS
29Deeper look at instructions
- CALL 16-bit addr. PC16-bit addr,push stack
- CC/CNC 16-bit addr.
- CZ/CNZ 16-bit addr.
- CM/CP 16-bit addr.
- CPE/CPO 16-bit addr.
30Deeper look at instructions
- RET PC16-bit addr, pop stack
- RC/RNC
- RZ/RNZ
- RM/RP
- RPE/RPO
31Deeper look at instructions
- Addr
- FF01H 21 LXI H,0100H
- FF02H 00
- FF03H 01
- FF04H 3E MVI A,0C9H
- FF05H C9
- FF06H 2B LOOP DCX H
- FF07H C2 JNZ LOOP
- FF08H 06
- FF09H FF
- FF0AH 76 HLT (RST 7)