Syllabus
8085 Architecture
Dr. Ashok Kherodia
IIIT Kota
1
8/13/2019
2
8/13/2019
Flags Sign Flag (S): After execution of any arithmetic and logical
operation, if D7 of the result is 1, the sign flag is set. Otherwise it is
The ALU includes five flip-flops that are set or reset according to reset. D7 is reserved for indicating the sign; the remaining is the
the result of an operation in the accumulator and registers. magnitude of number. If D7 is 1, the number will be viewed as
The microprocessor uses the flags for testing the data conditions for negative number. If D7 is 0, the number will be viewed as positive
decision making. number.
They are Zero (Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Zero Flag (z): If the result of arithmetic and logical operation is
Carry (AC) flags. The most commonly used flags are Sign, Zero, and zero, then zero flag is set otherwise it is reset.
Carry. Auxiliary Carry Flag (AC): If D3 generates any carry when doing
any arithmetic and logical operation, this flag is set. Otherwise it is
reset.
Parity Flag (P): If the result of arithmetic and logical operation
D7 D6 D5 D4 D3 D2 D1 D0 contains even number of 1's then this flag will be set and if it is odd
S Z X AC X P X CY
number of 1's it will be reset.
Carry Flag (CY): If any arithmetic and logical operation result any
carry then carry flag is set otherwise it is reset.
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
3
8/13/2019
4
8/13/2019
De-multiplexing AD7-AD0 8085 Demultiplexed Address and Data bus with Control signals
5
8/13/2019
Some Definitions
The Overall Picture
Microprocessor performs task in following manner:
Fetch
A15- A10 Chip Selection
Circuit
Decode
Execute
8085
A15-A8 CS
IC = FC + EC
6
8/13/2019
7
8/13/2019
Step I: In T1 state, the 8085 places the contents of program counter (PC)
on the address bus. The higher order byte of the PC is placed on the A8-
A15 lines. The lower order byte of the PC is placed on the AD0-AD7
lines which stays on only during T1. The ALE signal is activated in this
T1 state and latch the lower order of address byte before it disappears
from AD0-AD7 lines.
In T1, IO/M = 0, S1= 1 and S0=1 indicates that this is memory read
operation.
8
8/13/2019
9
8/13/2019
10
8/13/2019
8085 Instructions
Dr. Ashok Kherodia
IIIT Kota
11
8/13/2019
12
8/13/2019
Instructions that include immediate data use two bytes: one for
opcode and another for the 8 bit data.
13
8/13/2019
Data TransferInstructions
Classification of InstructionSet
Data TransferInstructions
14
8/13/2019
Data TransferInstructions
15
8/13/2019
Data TransferInstructions
Data TransferInstructions
16
8/13/2019
Data TransferInstructions
Data TransferInstructions
17
8/13/2019
Data TransferInstructions
18
8/13/2019
Data TransferInstructions
19
8/13/2019
Data TransferInstructions
Data TransferInstructions
20
8/13/2019
ArithmeticInstructions Addition
These instructions perform the operations like: Any 8-bit number, or the contents of register, or the
contents of memory location can be added to the
Addition contents of accumulator.
Any 8-bit number, or the contents of register, or the The 8-bit contents of a register or a memory location can
contents of memory location can be subtracted from the be incremented or decremented by 1.
contents of accumulator.
The 16-bit contents of a register pair can be
The result is stored in the accumulator. incremented or decremented by 1.
Subtraction is performed in 2’s complement form. Increment or decrement can be performed on any
register or a memory location.
If the result is negative, it is stored in 2’s complement form.
21
8/13/2019
ArithmeticInstructions
ArithmeticInstructions
22
8/13/2019
ArithmeticInstructions
ArithmeticInstructions
23
8/13/2019
ArithmeticInstructions
ArithmeticInstructions
24
8/13/2019
ArithmeticInstructions
ArithmeticInstructions
25
8/13/2019
ArithmeticInstructions
ArithmeticInstructions
26
8/13/2019
ArithmeticInstructions ArithmeticInstructions
27
8/13/2019
ArithmeticInstructions
28
8/13/2019
ArithmeticInstructions
LogicalInstructions
These instructions perform logical operations on data
stored in registers, memory and status flags.
The logical operations are:
AND
OR
XOR
Rotate
Compare
Complement
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
29
8/13/2019
AND,OR,XOR Rotate
Any 8-bit data, or the contents of register, or memory
location can logically have Each bit in the accumulator can be shifted either left or
right to the next position.
AND operation
OR operation
XOR operation
Compare Complement
Any 8-bit data, or the contents of register, or memory The contents of accumulator can be complemented.
location can be compares for:
Each 0 is replaced by 1and each 1is replaced by 0.
Equality
Greater Than
Less Than
The result
Dr. Ashok is reflected in status flags.
Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
30
8/13/2019
LogicalInstructions
LogicalInstructions
31
8/13/2019
LogicalInstructions
LogicalInstructions
32
8/13/2019
LogicalInstructions
LogicalInstructions
33
8/13/2019
LogicalInstructions
LogicalInstructions
34
8/13/2019
LogicalInstructions
LogicalInstructions
35
8/13/2019
LogicalInstructions
LogicalInstructions
36
8/13/2019
LogicalInstructions
BranchingInstructions
BranchingInstructions
Jump Unconditionally
JMP 16 bit address The program sequence is transferred to
The branching instruction alter the normal sequential
the memory location specified by the
flow. 16-bit address given in the operand.
37
8/13/2019
BranchingInstructions
Jump Conditionally
Jx 16 bit address The program sequence is transferred to
the memory location specified by the
16-bit address given in the operand if
condition is fulfilled otherwise
continue to next instruction based on
the specified flag of the PSW.
Example: JZ 2050 H.
Opcode Bytes M-cycle T-states Flags Example
Jx 3 3 7/10 None JZ 2050H
F R (If condition
not true)/F R R
(If condition is
true)
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
JumpConditionally
Opcode Description Status Flags
JC Jump if Carry CY = 1
JP Jump if Positive S= 0
JM Jump if Minus S= 1
JZ Jump if Zero Z= 1
38
8/13/2019
BranchingInstructions
BranchingInstructions
Conditional Call to Subroutine
CALL 16 bit address The program sequence is transferred to
the memory location specified by the 16-
bit address given in the operand based
on the specified flag of the PSW.
Before the transfer, the address of the next
instruction after the call (the contents of
the program counter) is pushed onto the
stack.
Example: CALL 2050 H.
Opcode Bytes M-cycle T-states Flags Example
Cx 3 2 (If condition 9/18 None CZ 2050H
not true)/5 (If
condition is true)
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
SRRWW
39
8/13/2019
CallConditionally BranchingInstructions
Opcode Description Status Flags Return from Subroutine Unconditionally
CC Call if Carry CY = 1 RET None The program sequence is transferred from the
subroutine to the calling program.
CNC Call if No Carry CY = 0
The two bytes from the top of the stack are copied
CP Call if Positive S= 0 into the program counter, and program execution
begins at the new address. The instruction is
CM Call if Minus S= 1 equivalent to POP program counter
CZ Call if Zero Z= 1
Example: RET.
CNZ Call if No Zero Z= 0
CPE Call if Parity Even P =1 Opcode Bytes M-cycle T-states Flags Example
CPO Call if Parity Odd P =0 RET 1 3 10 None RET
FRR
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
BranchingInstructions
Return Conditionally
Rx None The program sequence is transferred from the
subroutine to the calling program based on the
specified flag of the PSW..
The two bytes from the top of the stack are copied
into the program counter, and program execution
begins at the new address.
Example: RZ
40
8/13/2019
BranchingInstructions
ReturnConditionally Restart (Software Interrupt)
Opcode Description Status Flags RST N (0-7) The RST instruction jumps the control to one of
eight memory locations depending upon the
RC Return if Carry CY = 1
number.
RNC Return if No Carry CY = 0 These are used as software instructions in a program
to transfer program execution to one of the eight
RP Return if Positive S= 0
locations.
RM Return if Minus S= 1 Example: RST 0
RZ Return if Zero Z= 1
Restart AddressTable
Instructions Restart Address
RST 0 0000 H
RST 1 0008 H
RST 2 0010 H
RST 3 0018 H
RST 4 0020 H
RST 5 0028 H
RST 6 0030 H
RST 7 0038 H
Dr. Ashok Kherodia (ECT-201) Dr. Ashok Kherodia (ECT-201)
41
8/13/2019
ControlInstructions
ControlInstructions
ControlInstructions
42
8/13/2019
DI: ControlInstructions
ControlInstructions
43
8/13/2019
Opcode Table
44