SlideShare a Scribd company logo
1 of 115
Instruction Set
ā€¢ Prof. Rajesh R.K.
ā€¢ Assistant Professor,
ā€¢ Department of MCA
ā€¢ Mohandas College of Engineering &
Technology, Thiruvananthapuram, Kerala
Instruction
ā€¢ An instruction is a binary pattern designed
inside a microprocessor to perform a specific
function.
ā€¢ 8085 has 246 instructions.
ā€¢ Each instruction is represented by an 8-bit
binary value.
1. Introduction
ā€¢ A microprocessor executes instructions given by the
user
ā€¢ Instructions should be in a language known to the
microprocessor
ā€¢ Microprocessor understands the language of 0ā€™s and
1ā€™s only
ā€¢ This language is called Machine Language
Assembly language program to add two
numbers
MVI A, 2H ;Copy value 2H in register A
MVI B, 4H ;Copy value 4H in register B
ADD B ;A = A + B
Note:
ā€¢ Assembly language is specific to a given processor
ā€¢ For e.g. assembly language of 8085 is different than
that of Motorola 6800 microprocessor
Microprocessor understands Machine Language only!
ā€¢ Microprocessor cannot understand a program
written in Assembly language
ā€¢ A program known as Assembler is used to convert a
Assembly language program to machine language
Assembly
Language
Program
Assembler
Program
Machine
Language
Code
8085 Instruction Types
8085 Instruction Types
8085 Instruction Types
Classification Of Instruction Set
ā€¢ There are 5 Types,
ā€¢ (1) Data Transfer Instruction,
ā€¢ (2) Arithmetic Instructions,
ā€¢ (3) Logical Instructions,
ā€¢ (4) Branching Instructions,
ā€¢ (5) Control Instructions,
(1) Data Transfer Instructions
ā€¢ MOV Rd, Rs
ā€¢ MOV M, Rs
ā€¢ MOV Rd, M
ā€¢ This instruction copies the contents of the
source register into the destination register.
ā€¢ The contents of the source register are not
altered.
ā€¢ Example: MOV B,A or MOV M,B or MOV C,M
A 20 B 20
A F
B 30 C
D E
H 20 L 50
A 20 B
BEFORE EXECUTION AFTER EXECUTION
MOV B,A
A F
B 30 C
D E
H 20 L 50
A F
B C
D E
H 20 L 50
A F
B C 40
D E
H 20 L 50
MOV M,B
MOV C,M
40 40
30
ā€¢ MVI R, Data(8-bit)
ā€¢ MVI M, Data(8-bit)
ā€¢ The 8-bit immediate data is stored in the
destination register (R) or memory (M), R is
general purpose 8 bit register such as
A,B,C,D,E,H and L.
ā€¢ Example: MVI B, 60H or MVI M, 40H
(2) Data Transfer Instructions
A F
B C
D E
H L
A F
B 60 C
D E
H L
AFTER EXECUTIONBEFORE EXECUTION
MVI B,60H
40
HL=2050H
2051H
204FH 204FH
HL=2050H
2051H
MVI M,40H
BEFORE EXECUTION AFTER EXECUTION
ā€¢ LDA 16-bit address
ā€¢ The contents of a memory location, specified
by a 16-bit address in the operand, are
copied to the accumulator (A).
ā€¢ The contents of the source are not altered.
ā€¢ Example: LDA 2000H
(3) Data Transfer Instructions
A
30
A 30
30
AFTER EXECUTIONBEFORE EXECUTION
LDA 2000H
2000H 2000H
(4) Data Transfer Instructions
ā€¢ LDAX Register Pair
ā€¢ Load accumulator (A) with the contents of
memory location whose address is specified
by BC or DE or register pair.
ā€¢ The contents of either the register pair or the
memory location are not altered.
ā€¢ Example: LDAX D
A F
B C
D 20 E 30
A 80 F
B C
D 20 E 30
80 80
AFTER EXECUTIONBEFORE EXECUTION
LDAX D
2030H 2030H
(5) Data Transfer Instructions
ā€¢ STA 16-bit address
ā€¢ The contents of accumulator are copied into
the memory location i.e. address specified by
the operand in the instruction.
ā€¢ Example: STA 2000 H
A 50 A 50
50
AFTER EXECUTIONBEFORE EXECUTION
STA 2000H2000H 2000H
(6) Data Transfer Instructions
ā€¢ STAX Register Pair
ā€¢ Store the contents of accumulator (A) into
the memory location whose address is
specified by BC Or DE register pair.
ā€¢ Example: STAX B
A 50 F
B 10 C 20
D E
A 50 F
B 10 C 20
D E
50
AFTER EXECUTIONBEFORE EXECUTION
STAX B
1020H 1020H
ā€¢ LHLD 2050 Means..copy content of 2050 and 2051 to
HL pair
if
2050 -> 90H
2051->5AH
LHLD 2050 implies..
L -> 90H
H -> 5AH
ā€¢
LXI means..Load Register Pair with Immediate data.. 16bit data
LXI B ,2050H
Loads BC pair with value 2050H
B-> 20H
C-> 50H
Its similar to 2 MVI instruction
ie
MVI B,20H
MVI C,50H
(7) Data Transfer Instructions
ā€¢ SHLD 16-bit address
ā€¢ Store H-L register pair in memory.
ā€¢ The contents of register L are stored into
memory location specified by the 16-bit
address.
ā€¢ The contents of register H are stored into the
next memory location.
ā€¢ Example: SHLD 2500 H
H 30 L 60
BEFORE EXECUTION AFTER EXECUTION
60
30
H 30 L 60
SHLD 2500H2500H 2500H
204FH
2502H
204FH
2502H
(8) Data Transfer Instructions
ā€¢ XCHG
ā€¢ The contents of register H are exchanged
with the contents of register D.
ā€¢ The contents of register L are exchanged with
the contents of register E.
ā€¢ Example: XCHG
D 20 E 40
H 70 L 80
D 70 E 80
H 20 L 40
BEFORE EXECUTION AFTER EXECUTION
XCHG
(9) Data Transfer Instructions
ā€¢ SPHL
ā€¢ Move data from H-L pair to the Stack Pointer
(SP)
ā€¢ This instruction loads the contents of H-L pair
into SP.
ā€¢ Example: SPHL
H 25 L 00
SP
BEFORE EXECUTION
AFTER EXECUTION
H 25 L 00
SP 2500
SPHL
(10) Data Transfer Instructions
ā€¢ XTHL
ā€¢ Exchange Hā€“L with top of stack
ā€¢ The contents of L register are exchanged with
the location pointed out by the contents of
the SP.
ā€¢ The contents of H register are exchanged
with the next location (SP + 1).
ā€¢ Example: XTHL
H
30
L
40
SP 2700
BEFORE EXECUTION
50
60
H
60
L
50
SP 2700 40
30
AFTER EXECUTION
XTHL
2700H
2701H
2702H
2700H
2701H
2702H
L=SP
H=(SP+1)
(11) Data Transfer Instructions
ā€¢ PCHL
ā€¢ Load program counter with H-L contents
ā€¢ The contents of registers H and L are copied into
the program counter (PC).
ā€¢ The contents of H are placed as the high-order
byte and the contents of L as the low-order
byte.
ā€¢
H
60
L
00
PC
BEFORE EXECUTION AFTER EXECUTION
H
60
L
00
PC 6000
PCHL
(12) Data Transfer Instructions
ā€¢ IN 8-bit port address
ā€¢ Copy data to accumulator from a port with 8-
bit address.
ā€¢ The contents of I/O port are copied into
accumulator.
ā€¢ Example: IN 80 H
10 A
10 A 10
BEFORE EXECUTION
AFTER EXECUTION
IN 80H
PORT 80H
PORT 80H
(13) Data Transfer Instructions
ā€¢ OUT 8-bit port address
ā€¢ Copy data from accumulator to a port with 8-
bit address
ā€¢ The contents of accumulator are copied into
the I/O port.
ā€¢ Example: OUT 50 H
10 A 40
40 A 40
BEFORE EXECUTION
AFTER EXECUTION
OUT 50H
PORT 50H
PORT 50H
Arithmetic Instructions
ā€¢ These instructions perform the operations
like:
ā€¢ Addition
ā€¢ Subtraction
ā€¢ Increment
ā€¢ Decrement
(1) Arithematic Instructions
ā€¢ ADD R
ā€¢ ADD M
ā€¢ The contents of register or memory are added
to the contents of accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ If the operand is memory location, its address is
specified by H-L pair.
ā€¢ Example: ADD C or ADD M
B C 30
D E
H L
B C 30
D E
H L
AFTER EXECUTIONBEFORE EXECUTION
B C
D E
H 20 L 50
B C
D E
H 20 L 50
AFTER EXECUTIONBEFORE EXECUTION
A 20
A 50A 20
A 30
ADD C
A=A+R
ADD M
A=A+M
10 10
2050 2050
(2) Arithematic Instructions
ā€¢ ADC R
ā€¢ ADC M
ā€¢ The contents of register or memory and Carry Flag
(CY) are added to the contents of accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ If the operand is memory location, its address is
specified by H-L pair. All flags are modified to reflect
the result of the addition.
ā€¢ Example: ADC C or ADC M
B C 20
D E
H L
A 50
B C 20
D E
H L
A 71
AFTER EXECUTIONBEFORE EXECUTION
ADC C
A=A+R+CY
CY 1 CY 0
CY 1 CY 0
A 20 A 51
H 20 L 50 H 20 L 50
ADC M
A=A+M+CY
AFTER EXECUTIONBEFORE EXECUTION
30 302050H 2050H
(3) Arithematic Instructions
ā€¢ ADI 8-bit data
ā€¢ The 8-bit data is added to the contents of
accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ Example: ADI 10 H
A 50 A 60
AFTER EXECUTIONBEFORE EXECUTION
ADI 10H
A=A+DATA(8)
(4) Arithematic Instructions
ā€¢ ACI 8-bit data
ā€¢ The 8-bit data and the Carry Flag (CY) are
added to the contents of accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ Example: ACI 20 H
CY 1 CY 0
A 30 A 51
AFTER EXECUTIONBEFORE EXECUTION
ACI 20H
A=A+DATA
(8)+CY
(5) Arithematic Instructions
ā€¢ DAD Register pair
ā€¢ The 16-bit contents of the register pair are
added to the contents of H-L pair.
ā€¢ The result is stored in H-L pair.
ā€¢ If the result is larger than 16 bits, then CY is
set.
ā€¢ Example: DAD D
AFTER EXECUTIONBEFORE EXECUTION
B C
D 10 E 20
H 20 L 50
SP
B C
D 10 E 20
H 30 L 70
SP
CY 0 CY 0
DAD D
HL=HL+R
(6) Arithematic Instructions
ā€¢ SUB R
ā€¢ SUB M
ā€¢ The contents of the register or memory location are
subtracted from the contents of the accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ If the operand is memory location, its address is
specified by H-L pair.
ā€¢ Example: SUB B or SUB M
B 30 C
D E
H L
A 50
B 30 C
D E
H L
A 20
AFTER EXECUTIONBEFORE EXECUTION
SUB B
A=A-R
AFTER EXECUTIONBEFORE EXECUTION
A 50 A 40
H
10
L
20
H
10
L
20
SUB M
A=A-M
10 10
1020H1020H
(7) Arithematic Instructions
ā€¢ SBB R
ā€¢ SBB M
ā€¢ The contents of the register or memory location and
Borrow Flag (i.e.CY) are subtracted from the contents of
the accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ If the operand is memory location, its address is specified
by H-L pair.
ā€¢ Example: SBB C or SBB M
B C 20
D E
H L
A 40
CY 1
B C 20
D E
H L
A 19
CY 0
SBB C
A=A-R-CY
AFTER EXECUTIONBEFORE EXECUTION
CY 1
A 50
H
20
L
50
CY 0
A 39
H
20
L
50
AFTER EXECUTIONBEFORE EXECUTION
SBB M
A=A-M-CY
10 10
2050H 2050H
(8) Arithematic Instructions
ā€¢ SUI 8-bit data
ā€¢ OPERATION: A=A-DATA(8)
ā€¢ The 8-bit immediate data is subtracted from
the contents of the accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ Example: SUI 45 H
(9) Arithematic Instructions
ā€¢ SBI 8-bit data
ā€¢ The 8-bit data and the Borrow Flag (i.e. CY) is
subtracted from the contents of the
accumulator.
ā€¢ The result is stored in accumulator.
ā€¢ Example: SBI 20 H
CY 1
A 50
AFTER EXECUTIONBEFORE EXECUTION
CY 0
A 29SBI 20H
A=A-DATA(8)-CY
(10) Arithematic Instructions
ā€¢ INR R
ā€¢ INR M
ā€¢ The contents of register or memory location are
incremented by 1.
ā€¢ The result is stored in the same place.
ā€¢ If the operand is a memory location, its address
is specified by the contents of H-L pair.
ā€¢ Example: INR B or INR M
B 10 C
D E
H L
A
B 11 C
D E
H L
A
AFTER EXECUTIONBEFORE EXECUTION
H
20
L
50
H
20
L
50
30 31
2050H 2050H
AFTER EXECUTIONBEFORE EXECUTION
INR M
M=M+1
B 10 C
D E
H L
A
BEFORE EXECUTION
INR B
R=R+1
(11) Arithematic Instructions
ā€¢ INX Rp
ā€¢ The contents of register pair are incremented
by 1.
ā€¢ The result is stored in the same place.
ā€¢ Example: INX H
B C
D E
H 10 L 20
B C
D E
H 11 L 21
AFTER EXECUTIONBEFORE EXECUTION
SPSP
INX H
RP=RP+1
(12) Arithematic Instructions
ā€¢ DCR R
ā€¢ DCR M
ā€¢ The contents of register or memory location are
decremented by 1.
ā€¢ The result is stored in the same place.
ā€¢ If the operand is a memory location, its address
is specified by the contents of H-L pair.
ā€¢ Example: DCR E or DCR M
B C
D E 19
H L
A
AFTER EXECUTION
B C
D E 20
H L
A
BEFORE EXECUTION
DCR E
R=R-1
H
20
L
50
H
20
L
5021 20
2050H
AFTER EXECUTIONBEFORE EXECUTION
DCR M
M=M-1
2050H
(13) Arithematic Instructions
ā€¢ DCX Rp
ā€¢ The contents of register pair are decremented
by 1.
ā€¢ The result is stored in the same place.
ā€¢ Example: DCX D
B C
D 10 E 20
H L
B C
D 10 E 19
H L
AFTER EXECUTIONBEFORE EXECUTION
SPSP
DCX D
RP=RP-1
(1) Logical Instructions
ā€¢ ANA R
ā€¢ ANA M
ā€¢ AND specified data in register or memory with
accumulator.
ā€¢ Store the result in accumulator (A).
ā€¢ Example: ANA B, ANA M
B 10 C
D E
H L
A
B 0F C
D E
H L
A 0A
AFTER EXECUTION
ANA B
A=A and R
B 0F C
D E
H L
A AA
BEFORE EXECUTION
CY AC CY 0 AC 1
AFTER EXECUTIONBEFORE EXECUTION
CY AC CY 0 AC 1
A 11A 55
H 20 L 50 H 20 L 50
B3 B3
2050H
ANA M
A=A and M
2050H
1010 1010=AAH
0000 1111=0FH
0000 1010=0AH
0101 0101=55H
1011 0011=B3H
0001 0001=11H
(2) Logical Instructions
ā€¢ ANI 8-bit data
ā€¢ AND 8-bit data with accumulator (A).
ā€¢ Store the result in accumulator (A)
ā€¢ Example: ANI 3FH
CY AC
A B3
AFTER EXECUTIONBEFORE EXECUTION
CY 0 AC 1
A 33
ANI 3FH
A=A and DATA(8)
1011 0011=B3H
0011 1111=3FH
0011 0011=33H
(3) Logical Instructions
ā€¢ XRA Register (8-bit)
ā€¢ XOR specified register with accumulator.
ā€¢ Store the result in accumulator.
ā€¢ Example: XRA C
B 10 C
D E
H L
A
B C 2D
D E
H L
A 87
AFTER EXECUTION
XRA C
A=A xor R
B C 2D
D E
H L
A AA
BEFORE EXECUTION
CY AC CY 0 AC 0
1010 1010=AAH
0010 1101=2DH
1000 0111=87H
(4) Logical Instructions
ā€¢ XRA M
ā€¢ XOR data in memory (memory location
pointed by H-L pair) with Accumulator.
ā€¢ Store the result in Accumulator.
ā€¢ Example: XRA M
H 20 L 50
A 55
AFTER EXECUTION
XRA M
A=A xor M
BEFORE EXECUTION
CY AC CY 0 AC 0
0101 0101=55H
1011 0011=B3H
1110 0110=E6H
H 20 L 50
A E6
B3 B3
2050H 2050H
(5) Logical Instructions
ā€¢ XRI 8-bit data
ā€¢ XOR 8-bit immediate data with accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: XRI 39H
CY AC
A B3
AFTER EXECUTIONBEFORE EXECUTION
CY 0 AC 0
A 8A
XRI 39H
A=A xor DATA(8)
1011 0011=B3H
0011 1001=39H
1000 1010=8AH
(6) Logical Instructions
ā€¢ ORA Register
ā€¢ OR specified register with accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: ORA B
AFTER EXECUTIONBEFORE EXECUTION
CY AC
ORA B
A=A or R
1010 1010=AAH
0001 0010=12H
1011 1010=BAH
B 12 C
D E
H L
A AA
B 12 C
D E
H L
A BA
CY 0 AC 0
(7) Logical Instructions
ā€¢ ORA M
ā€¢ OR specified register with accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: ORA M
AFTER EXECUTIONBEFORE EXECUTION
CY AC
ORA M
A=A or M
0101 0101=55H
1011 0011=B3H
1111 0111=F7H
H 20 L 50
A 55 A F7
CY 0 AC 0
H 20 L 50
B3 B3
2050H 2050H
(8) Logical Instructions
ā€¢ ORI 8-bit data
ā€¢ OR 8-bit data with accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: ORI 08H
CY AC
A B3
AFTER EXECUTIONBEFORE EXECUTION
CY 0 AC 0
A BB
ORI 08H
A=A or DATA(8)
1011 0011=B3H
0000 1000=08H
1011 1011=BBH
(9) Logical Instructions
ā€¢ CMP Register
ā€¢ CMP M
ā€¢ Compare specified data in register or memory
with accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: CMP D or CMP M
B 10 C
D E
H L
A
B C
D B9 E
H L
A B8
AFTER EXECUTION
CMP D
A-R
B C
D B9 E
H L
A B8
BEFORE EXECUTION
CY Z CY 0 Z 0
AFTER EXECUTIONBEFORE EXECUTION
CY Z CY 0 Z 1
A B8A B8
H 20 L 50 H 20 L 50
B8 B8
2050H
CMP M
A-M
2050H
A>R: CY=0,Z=0
A=R: CY=0,Z=1
A<R: CY=1,Z=0
A>M: CY=0,Z=0
A=M: CY=0,Z=1
A<M: CY=1,Z=0
(10) Logical Instructions
ā€¢ CPI 8-bit data
ā€¢ Compare 8-bit immediate data with
accumulator (A).
ā€¢ Store the result in accumulator.
ā€¢ Example: CPI 30H
CY Z
A BA
AFTER EXECUTIONBEFORE EXECUTION
CY 0 AC 0
A BA
CPI 30H
A-DATA
A>DATA: CY=0,Z=0
A=DATA: CY=0,Z=1
A<DATA: CY=1,Z=0
1011 1010=BAH
(11) Logical Instructions
ā€¢ STC
ā€¢ It sets the carry flag to 1.
ā€¢ Example: STC
CY 0
AFTER EXECUTIONBEFORE EXECUTION
CY 1
STC
CY=1
(12) Logical Instructions
ā€¢ CMC
ā€¢ It complements the carry flag.
ā€¢ Example: CMC
CY 1
AFTER EXECUTIONBEFORE EXECUTION
CY 0
CMC
(13) Logical Instructions
ā€¢ CMA
ā€¢ It complements each bit of the accumulator.
ā€¢ Example: CMA
(14) Logical Instructions
ā€¢ RLC
ā€¢ Rotate accumulator left
ā€¢ Each binary bit of the accumulator is rotated left
by one position.
ā€¢ Bit D7 is placed in the position of D0 as well as
in the Carry flag.
ā€¢ CY is modified according to bit D7.
ā€¢ Example: RLC.
B7 B6 B5 B4 B3 B2 B1 B0CY
B6 B5 B4 B3 B2 B1 B0 B7B7
AFTER EXECUTION
BEFORE EXECUTION
(15) Logical Instructions
ā€¢ RRC
ā€¢ Rotate accumulator right
ā€¢ Each binary bit of the accumulator is rotated right by
one
ā€¢ position.
ā€¢ Bit D0 is placed in the position of D7 as well as in the
Carry flag.
ā€¢ CY is modified according to bit D0.
ā€¢ Example: RRC.
B7 B6 B5 B4 B3 B2 B1 B0 CY
B0 B7 B6 B5 B4 B3 B2 B1 B0
AFTER EXECUTION
BEFORE EXECUTION
(16) Logical Instructions
ā€¢ RAL
ā€¢ Rotate accumulator left through carry
ā€¢ Each binary bit of the accumulator is rotated left
by one position through the Carry flag.
ā€¢ Bit D7 is placed in the Carry flag, and the Carry
flag is placed in the least significant position D0.
ā€¢ CY is modified according to bit D7.
ā€¢ Example: RAL.
B7 B6 B5 B4 B3 B2 B1 B0CY
B6 B5 B4 B3 B2 B1 B0 CYB7
AFTER EXECUTION
BEFORE EXECUTION
(17) Logical Instructions
ā€¢ RAR
ā€¢ Rotate accumulator right through carry
ā€¢ Each binary bit of the accumulator is rotated left
by one position through the Carry flag.
ā€¢ Bit D7 is placed in the Carry flag, and the Carry
flag is placed in the least significant position D0.
ā€¢ CY is modified according to bit D7.
ā€¢ Example: RAR
B7 B6 B5 B4 B3 B2 B1 B0 CY
CY B7 B6 B5 B4 B3 B2 B1 B0
AFTER EXECUTION
BEFORE EXECUTION
Concept of Subroutine
ā€¢ In 8085 microprocessor a subroutine is a
separate program written aside from main
program ,this program is basically the
program which requires to be executed
several times in the main program.
ā€¢ The microprocessor can call subroutine any
time using CALL instruction. after the
subroutine is executed the subroutine hands
over the program to main program using RET
instruction.
Branching Instructions
ā€¢ The branch group instructions allows the
microprocessor to change the sequence of
program either conditionally or under certain
test conditions. The group includes,
ā€¢ (1) Jump instructions,
ā€¢ (2) Call and Return instructions,
ā€¢ (3) Restart instructions,
(1) Branching Instructions
ā€¢ JUMP ADDRESS
ā€¢ BEFORE EXECUTION AFTER EXECUTION
ā€¢ Jump unconditionally to the address.
ā€¢ The instruction loads the PC with the address
given within the instruction and resumes the
program execution from specified location.
ā€¢ Example: JMP 200H
PC PC 2000JMP 2000H
Conditional Jumps
(2) Branching Instructions
ā€¢ CALL address
ā€¢ Call unconditionally a subroutine whose
starting address given within the
instruction and used to transfer
program control to a subprogram or
subroutine.
ā€¢ Example: CALL 2000H
Conditional Calls
Instruction Code Description Condition for CALL
CC Call on carry CY=1
CNC Call on not carry CY=0
CP Call on positive S=0
CM Call on minus S=1
CPE Call on parity even P=1
CPO Call on parity odd P=0
CZ Call on zero Z=1
CNZ Call on not zero Z=0
(3) Branching Instructions
ā€¢ RET
ā€¢ Return from the subroutine unconditionally.
ā€¢ This instruction takes return address from
the stack and loads the program counter
with this address.
ā€¢ Example: RET
SP 27FD
PC
00
62
SP 27FF
PC 6200
00
62
AFTER EXECUTIONBEFORE EXECUTION
RET
27FFH
27FEH
27FDH
27FFH
27FEH
27FDH
(4) Branching Instructions
ā€¢ RST n
ā€¢ Restart n (0 to 7)
ā€¢ This instruction transfers the program
control to a specific memory address. The
processor multiplies the RST number by 8 to
calculate the vector address.
ā€¢ Example: RST 6
SP 3000
PC 2000
SP 2999
PC 0030
01
20
AFTER EXECUTIONBEFORE EXECUTION
RST 6
3000H
2FFFH
2FFEH
SP-1
ADDRESS OF THE NEXT INSTRUCTION IS 2001H
3000H
2FFFH
2FFEH
Vector Address For Return
Instructions
Instruction Code Vector Address
RST 0 0*8=0000H
RST 1 0*8=0008H
RST 2 0*8=0010H
RST 3 0*8=0018H
RST 4 0*8=0020H
RST 5 0*8=0028H
RST 6 0*8=0030H
Rst 7 0*8=0038H
(1) Control Instructions
ā€¢ NOP
ā€¢ No operation
ā€¢ No operation is performed.
ā€¢ The instruction is fetched and decoded but no
operation is executed.
ā€¢ Example: NOP
(2) Control Instructions
ā€¢ HLT
ā€¢ Halt
ā€¢ The CPU finishes executing the current
instruction and halts any further execution.
ā€¢ An interrupt or reset is necessary to exit from
the halt state.
ā€¢ Example: HLT
(3) Control Instructions
ā€¢ RIM
ā€¢ Read Interrupt Mask
ā€¢ This is a multipurpose instruction used to read the
status of interrupts 7.5, 6.5, 5.5 and read serial data
input bit.
ā€¢ The instruction loads eight bits in the accumulator
with the following interpretations.
ā€¢ Example: RIM
RIM INSTRUCTIONRIM INSTRUCTION
ā€¢ SIM
ā€¢ Set Interrupt Mask
ā€¢ This is a multipurpose instruction and used to
implement the 8085 interrupts 7.5, 6.5, 5.5, and
serial data output.
ā€¢ The instruction interprets the accumulator
contents as follows.
ā€¢ Example: SIM
SIM Instruction
END OF
INSTRUCTION SET
Instruction set  of 8085

More Related Content

What's hot

8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1techbed
Ā 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 completeShubham Singh
Ā 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instructionprashant1271
Ā 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085saleForce
Ā 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor pptRJ Aniket
Ā 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 80869840596838
Ā 
Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085Syed Zaid Irshad
Ā 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
Ā 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chipsSrikrishna Thota
Ā 
programming techniques
programming techniquesprogramming techniques
programming techniquesRamaPrabha24
Ā 
Computer instructions
Computer instructionsComputer instructions
Computer instructionsAnuj Modi
Ā 
Data transfer instruction set of 8085 micro processor
Data transfer instruction set of 8085 micro processorData transfer instruction set of 8085 micro processor
Data transfer instruction set of 8085 micro processorvishalgohel12195
Ā 
8085 arithmetic instructions
8085 arithmetic instructions8085 arithmetic instructions
8085 arithmetic instructionsprashant1271
Ā 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutineSuchismita Paul
Ā 

What's hot (20)

Programming with 8085
Programming with 8085Programming with 8085
Programming with 8085
Ā 
8085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing18085 Architecture & Memory Interfacing1
8085 Architecture & Memory Interfacing1
Ā 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
Ā 
8085 branching instruction
8085 branching instruction8085 branching instruction
8085 branching instruction
Ā 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
Ā 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor ppt
Ā 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
Ā 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
Ā 
8086 micro processor
8086 micro processor8086 micro processor
8086 micro processor
Ā 
Pin diagram 8085
Pin diagram 8085 Pin diagram 8085
Pin diagram 8085
Ā 
LCD Interacing with 8051
LCD Interacing with 8051LCD Interacing with 8051
LCD Interacing with 8051
Ā 
Addressing modes of 8085
Addressing modes of 8085Addressing modes of 8085
Addressing modes of 8085
Ā 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
Ā 
8085 interfacing with memory chips
8085 interfacing with memory chips8085 interfacing with memory chips
8085 interfacing with memory chips
Ā 
programming techniques
programming techniquesprogramming techniques
programming techniques
Ā 
Computer instructions
Computer instructionsComputer instructions
Computer instructions
Ā 
Data transfer instruction set of 8085 micro processor
Data transfer instruction set of 8085 micro processorData transfer instruction set of 8085 micro processor
Data transfer instruction set of 8085 micro processor
Ā 
Architecture of 8085
Architecture of  8085Architecture of  8085
Architecture of 8085
Ā 
8085 arithmetic instructions
8085 arithmetic instructions8085 arithmetic instructions
8085 arithmetic instructions
Ā 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
Ā 

Similar to Instruction set of 8085

8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)Ravi Anand
Ā 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
Ā 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
Ā 
Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Satsang Yadav
Ā 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptxssuser47c811
Ā 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction setJLoknathDora
Ā 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSSwapnil Mishra
Ā 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Shubham Singh
Ā 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3Sajan Agrawal
Ā 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).pptKanikaJindal9
Ā 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :PJathin Kanumuri
Ā 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction setSaumitra Rukmangad
Ā 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2Jathin Kanumuri
Ā 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085Shifali Sharma
Ā 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructionscmkandemir
Ā 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdfSaurabhPorwal14
Ā 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptssuserb448e2
Ā 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.pptsteffydean
Ā 
8085-paper-presentation.ppt
8085-paper-presentation.ppt8085-paper-presentation.ppt
8085-paper-presentation.pptKalaiSelvan911913
Ā 

Similar to Instruction set of 8085 (20)

8085 instruction set (detailed)
8085 instruction set (detailed)8085 instruction set (detailed)
8085 instruction set (detailed)
Ā 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Ā 
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil KawareInstruction set of 8085 Microprocessor By Er. Swapnil Kaware
Instruction set of 8085 Microprocessor By Er. Swapnil Kaware
Ā 
Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02Instructionsetof8085 120415220437-phpapp02
Instructionsetof8085 120415220437-phpapp02
Ā 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
Ā 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
Ā 
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONSINTEL 8085 DATA FORMAT AND INSTRUCTIONS
INTEL 8085 DATA FORMAT AND INSTRUCTIONS
Ā 
Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085Chapter 3 instruction set-of-8085
Chapter 3 instruction set-of-8085
Ā 
Microprocessor Part 3
Microprocessor    Part  3Microprocessor    Part  3
Microprocessor Part 3
Ā 
8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt8085_Microprocessor(simar).ppt
8085_Microprocessor(simar).ppt
Ā 
microp-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :Pmicrop-8085 74 instructions for mct-A :P
microp-8085 74 instructions for mct-A :P
Ā 
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
8085 Paper Presentation slides,ppt,microprocessor 8085 ,guide, instruction set
Ā 
microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2microp-8085 74 instructions for mct-A :P-2
microp-8085 74 instructions for mct-A :P-2
Ā 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
Ā 
Chapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional InstructionsChapter 7 - Programming Techniques with Additional Instructions
Chapter 7 - Programming Techniques with Additional Instructions
Ā 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
Ā 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
Ā 
Microcontroller 8051- soft.ppt
Microcontroller 8051- soft.pptMicrocontroller 8051- soft.ppt
Microcontroller 8051- soft.ppt
Ā 
Instruction set
Instruction setInstruction set
Instruction set
Ā 
8085-paper-presentation.ppt
8085-paper-presentation.ppt8085-paper-presentation.ppt
8085-paper-presentation.ppt
Ā 

Recently uploaded

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
Ā 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
Ā 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
Ā 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
Ā 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
Ā 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
Ā 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
Ā 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
Ā 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Nguyen Thanh Tu Collection
Ā 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
Ā 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
Ā 
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
Ā 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
Ā 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
Ā 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
Ā 

Recently uploaded (20)

Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
Ā 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
Ā 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
Ā 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
Ā 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
Ā 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
Ā 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
Ā 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
Ā 
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Model Call Girl in Tilak Nagar Delhi reach out to us at šŸ”9953056974šŸ”
Ā 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
Ā 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
Ā 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
Ā 
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Hį»ŒC Tį»T TIįŗ¾NG ANH 11 THEO CHĘÆĘ NG TRƌNH GLOBAL SUCCESS ĐƁP ƁN CHI TIįŗ¾T - Cįŗ¢ NĂ...
Ā 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
Ā 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
Ā 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Ā 
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPSĀ® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
Ā 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
Ā 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
Ā 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
Ā 

Instruction set of 8085

  • 1. Instruction Set ā€¢ Prof. Rajesh R.K. ā€¢ Assistant Professor, ā€¢ Department of MCA ā€¢ Mohandas College of Engineering & Technology, Thiruvananthapuram, Kerala
  • 2. Instruction ā€¢ An instruction is a binary pattern designed inside a microprocessor to perform a specific function. ā€¢ 8085 has 246 instructions. ā€¢ Each instruction is represented by an 8-bit binary value.
  • 3. 1. Introduction ā€¢ A microprocessor executes instructions given by the user ā€¢ Instructions should be in a language known to the microprocessor ā€¢ Microprocessor understands the language of 0ā€™s and 1ā€™s only ā€¢ This language is called Machine Language
  • 4. Assembly language program to add two numbers MVI A, 2H ;Copy value 2H in register A MVI B, 4H ;Copy value 4H in register B ADD B ;A = A + B Note: ā€¢ Assembly language is specific to a given processor ā€¢ For e.g. assembly language of 8085 is different than that of Motorola 6800 microprocessor
  • 5. Microprocessor understands Machine Language only! ā€¢ Microprocessor cannot understand a program written in Assembly language ā€¢ A program known as Assembler is used to convert a Assembly language program to machine language Assembly Language Program Assembler Program Machine Language Code
  • 9. Classification Of Instruction Set ā€¢ There are 5 Types, ā€¢ (1) Data Transfer Instruction, ā€¢ (2) Arithmetic Instructions, ā€¢ (3) Logical Instructions, ā€¢ (4) Branching Instructions, ā€¢ (5) Control Instructions,
  • 10. (1) Data Transfer Instructions ā€¢ MOV Rd, Rs ā€¢ MOV M, Rs ā€¢ MOV Rd, M ā€¢ This instruction copies the contents of the source register into the destination register. ā€¢ The contents of the source register are not altered. ā€¢ Example: MOV B,A or MOV M,B or MOV C,M
  • 11. A 20 B 20 A F B 30 C D E H 20 L 50 A 20 B BEFORE EXECUTION AFTER EXECUTION MOV B,A A F B 30 C D E H 20 L 50 A F B C D E H 20 L 50 A F B C 40 D E H 20 L 50 MOV M,B MOV C,M 40 40 30
  • 12. ā€¢ MVI R, Data(8-bit) ā€¢ MVI M, Data(8-bit) ā€¢ The 8-bit immediate data is stored in the destination register (R) or memory (M), R is general purpose 8 bit register such as A,B,C,D,E,H and L. ā€¢ Example: MVI B, 60H or MVI M, 40H (2) Data Transfer Instructions
  • 13. A F B C D E H L A F B 60 C D E H L AFTER EXECUTIONBEFORE EXECUTION MVI B,60H 40 HL=2050H 2051H 204FH 204FH HL=2050H 2051H MVI M,40H BEFORE EXECUTION AFTER EXECUTION
  • 14. ā€¢ LDA 16-bit address ā€¢ The contents of a memory location, specified by a 16-bit address in the operand, are copied to the accumulator (A). ā€¢ The contents of the source are not altered. ā€¢ Example: LDA 2000H (3) Data Transfer Instructions
  • 15. A 30 A 30 30 AFTER EXECUTIONBEFORE EXECUTION LDA 2000H 2000H 2000H
  • 16. (4) Data Transfer Instructions ā€¢ LDAX Register Pair ā€¢ Load accumulator (A) with the contents of memory location whose address is specified by BC or DE or register pair. ā€¢ The contents of either the register pair or the memory location are not altered. ā€¢ Example: LDAX D
  • 17. A F B C D 20 E 30 A 80 F B C D 20 E 30 80 80 AFTER EXECUTIONBEFORE EXECUTION LDAX D 2030H 2030H
  • 18. (5) Data Transfer Instructions ā€¢ STA 16-bit address ā€¢ The contents of accumulator are copied into the memory location i.e. address specified by the operand in the instruction. ā€¢ Example: STA 2000 H
  • 19. A 50 A 50 50 AFTER EXECUTIONBEFORE EXECUTION STA 2000H2000H 2000H
  • 20. (6) Data Transfer Instructions ā€¢ STAX Register Pair ā€¢ Store the contents of accumulator (A) into the memory location whose address is specified by BC Or DE register pair. ā€¢ Example: STAX B
  • 21. A 50 F B 10 C 20 D E A 50 F B 10 C 20 D E 50 AFTER EXECUTIONBEFORE EXECUTION STAX B 1020H 1020H
  • 22. ā€¢ LHLD 2050 Means..copy content of 2050 and 2051 to HL pair if 2050 -> 90H 2051->5AH LHLD 2050 implies.. L -> 90H H -> 5AH
  • 23. ā€¢ LXI means..Load Register Pair with Immediate data.. 16bit data LXI B ,2050H Loads BC pair with value 2050H B-> 20H C-> 50H Its similar to 2 MVI instruction ie MVI B,20H MVI C,50H
  • 24. (7) Data Transfer Instructions ā€¢ SHLD 16-bit address ā€¢ Store H-L register pair in memory. ā€¢ The contents of register L are stored into memory location specified by the 16-bit address. ā€¢ The contents of register H are stored into the next memory location. ā€¢ Example: SHLD 2500 H
  • 25. H 30 L 60 BEFORE EXECUTION AFTER EXECUTION 60 30 H 30 L 60 SHLD 2500H2500H 2500H 204FH 2502H 204FH 2502H
  • 26. (8) Data Transfer Instructions ā€¢ XCHG ā€¢ The contents of register H are exchanged with the contents of register D. ā€¢ The contents of register L are exchanged with the contents of register E. ā€¢ Example: XCHG
  • 27. D 20 E 40 H 70 L 80 D 70 E 80 H 20 L 40 BEFORE EXECUTION AFTER EXECUTION XCHG
  • 28. (9) Data Transfer Instructions ā€¢ SPHL ā€¢ Move data from H-L pair to the Stack Pointer (SP) ā€¢ This instruction loads the contents of H-L pair into SP. ā€¢ Example: SPHL
  • 29. H 25 L 00 SP BEFORE EXECUTION AFTER EXECUTION H 25 L 00 SP 2500 SPHL
  • 30. (10) Data Transfer Instructions ā€¢ XTHL ā€¢ Exchange Hā€“L with top of stack ā€¢ The contents of L register are exchanged with the location pointed out by the contents of the SP. ā€¢ The contents of H register are exchanged with the next location (SP + 1). ā€¢ Example: XTHL
  • 31. H 30 L 40 SP 2700 BEFORE EXECUTION 50 60 H 60 L 50 SP 2700 40 30 AFTER EXECUTION XTHL 2700H 2701H 2702H 2700H 2701H 2702H L=SP H=(SP+1)
  • 32. (11) Data Transfer Instructions ā€¢ PCHL ā€¢ Load program counter with H-L contents ā€¢ The contents of registers H and L are copied into the program counter (PC). ā€¢ The contents of H are placed as the high-order byte and the contents of L as the low-order byte. ā€¢
  • 33. H 60 L 00 PC BEFORE EXECUTION AFTER EXECUTION H 60 L 00 PC 6000 PCHL
  • 34. (12) Data Transfer Instructions ā€¢ IN 8-bit port address ā€¢ Copy data to accumulator from a port with 8- bit address. ā€¢ The contents of I/O port are copied into accumulator. ā€¢ Example: IN 80 H
  • 35. 10 A 10 A 10 BEFORE EXECUTION AFTER EXECUTION IN 80H PORT 80H PORT 80H
  • 36. (13) Data Transfer Instructions ā€¢ OUT 8-bit port address ā€¢ Copy data from accumulator to a port with 8- bit address ā€¢ The contents of accumulator are copied into the I/O port. ā€¢ Example: OUT 50 H
  • 37. 10 A 40 40 A 40 BEFORE EXECUTION AFTER EXECUTION OUT 50H PORT 50H PORT 50H
  • 38. Arithmetic Instructions ā€¢ These instructions perform the operations like: ā€¢ Addition ā€¢ Subtraction ā€¢ Increment ā€¢ Decrement
  • 39. (1) Arithematic Instructions ā€¢ ADD R ā€¢ ADD M ā€¢ The contents of register or memory are added to the contents of accumulator. ā€¢ The result is stored in accumulator. ā€¢ If the operand is memory location, its address is specified by H-L pair. ā€¢ Example: ADD C or ADD M
  • 40. B C 30 D E H L B C 30 D E H L AFTER EXECUTIONBEFORE EXECUTION B C D E H 20 L 50 B C D E H 20 L 50 AFTER EXECUTIONBEFORE EXECUTION A 20 A 50A 20 A 30 ADD C A=A+R ADD M A=A+M 10 10 2050 2050
  • 41. (2) Arithematic Instructions ā€¢ ADC R ā€¢ ADC M ā€¢ The contents of register or memory and Carry Flag (CY) are added to the contents of accumulator. ā€¢ The result is stored in accumulator. ā€¢ If the operand is memory location, its address is specified by H-L pair. All flags are modified to reflect the result of the addition. ā€¢ Example: ADC C or ADC M
  • 42. B C 20 D E H L A 50 B C 20 D E H L A 71 AFTER EXECUTIONBEFORE EXECUTION ADC C A=A+R+CY CY 1 CY 0 CY 1 CY 0 A 20 A 51 H 20 L 50 H 20 L 50 ADC M A=A+M+CY AFTER EXECUTIONBEFORE EXECUTION 30 302050H 2050H
  • 43. (3) Arithematic Instructions ā€¢ ADI 8-bit data ā€¢ The 8-bit data is added to the contents of accumulator. ā€¢ The result is stored in accumulator. ā€¢ Example: ADI 10 H
  • 44. A 50 A 60 AFTER EXECUTIONBEFORE EXECUTION ADI 10H A=A+DATA(8)
  • 45. (4) Arithematic Instructions ā€¢ ACI 8-bit data ā€¢ The 8-bit data and the Carry Flag (CY) are added to the contents of accumulator. ā€¢ The result is stored in accumulator. ā€¢ Example: ACI 20 H
  • 46. CY 1 CY 0 A 30 A 51 AFTER EXECUTIONBEFORE EXECUTION ACI 20H A=A+DATA (8)+CY
  • 47. (5) Arithematic Instructions ā€¢ DAD Register pair ā€¢ The 16-bit contents of the register pair are added to the contents of H-L pair. ā€¢ The result is stored in H-L pair. ā€¢ If the result is larger than 16 bits, then CY is set. ā€¢ Example: DAD D
  • 48. AFTER EXECUTIONBEFORE EXECUTION B C D 10 E 20 H 20 L 50 SP B C D 10 E 20 H 30 L 70 SP CY 0 CY 0 DAD D HL=HL+R
  • 49. (6) Arithematic Instructions ā€¢ SUB R ā€¢ SUB M ā€¢ The contents of the register or memory location are subtracted from the contents of the accumulator. ā€¢ The result is stored in accumulator. ā€¢ If the operand is memory location, its address is specified by H-L pair. ā€¢ Example: SUB B or SUB M
  • 50. B 30 C D E H L A 50 B 30 C D E H L A 20 AFTER EXECUTIONBEFORE EXECUTION SUB B A=A-R AFTER EXECUTIONBEFORE EXECUTION A 50 A 40 H 10 L 20 H 10 L 20 SUB M A=A-M 10 10 1020H1020H
  • 51. (7) Arithematic Instructions ā€¢ SBB R ā€¢ SBB M ā€¢ The contents of the register or memory location and Borrow Flag (i.e.CY) are subtracted from the contents of the accumulator. ā€¢ The result is stored in accumulator. ā€¢ If the operand is memory location, its address is specified by H-L pair. ā€¢ Example: SBB C or SBB M
  • 52. B C 20 D E H L A 40 CY 1 B C 20 D E H L A 19 CY 0 SBB C A=A-R-CY AFTER EXECUTIONBEFORE EXECUTION CY 1 A 50 H 20 L 50 CY 0 A 39 H 20 L 50 AFTER EXECUTIONBEFORE EXECUTION SBB M A=A-M-CY 10 10 2050H 2050H
  • 53. (8) Arithematic Instructions ā€¢ SUI 8-bit data ā€¢ OPERATION: A=A-DATA(8) ā€¢ The 8-bit immediate data is subtracted from the contents of the accumulator. ā€¢ The result is stored in accumulator. ā€¢ Example: SUI 45 H
  • 54. (9) Arithematic Instructions ā€¢ SBI 8-bit data ā€¢ The 8-bit data and the Borrow Flag (i.e. CY) is subtracted from the contents of the accumulator. ā€¢ The result is stored in accumulator. ā€¢ Example: SBI 20 H
  • 55. CY 1 A 50 AFTER EXECUTIONBEFORE EXECUTION CY 0 A 29SBI 20H A=A-DATA(8)-CY
  • 56. (10) Arithematic Instructions ā€¢ INR R ā€¢ INR M ā€¢ The contents of register or memory location are incremented by 1. ā€¢ The result is stored in the same place. ā€¢ If the operand is a memory location, its address is specified by the contents of H-L pair. ā€¢ Example: INR B or INR M
  • 57. B 10 C D E H L A B 11 C D E H L A AFTER EXECUTIONBEFORE EXECUTION H 20 L 50 H 20 L 50 30 31 2050H 2050H AFTER EXECUTIONBEFORE EXECUTION INR M M=M+1 B 10 C D E H L A BEFORE EXECUTION INR B R=R+1
  • 58. (11) Arithematic Instructions ā€¢ INX Rp ā€¢ The contents of register pair are incremented by 1. ā€¢ The result is stored in the same place. ā€¢ Example: INX H
  • 59. B C D E H 10 L 20 B C D E H 11 L 21 AFTER EXECUTIONBEFORE EXECUTION SPSP INX H RP=RP+1
  • 60. (12) Arithematic Instructions ā€¢ DCR R ā€¢ DCR M ā€¢ The contents of register or memory location are decremented by 1. ā€¢ The result is stored in the same place. ā€¢ If the operand is a memory location, its address is specified by the contents of H-L pair. ā€¢ Example: DCR E or DCR M
  • 61. B C D E 19 H L A AFTER EXECUTION B C D E 20 H L A BEFORE EXECUTION DCR E R=R-1 H 20 L 50 H 20 L 5021 20 2050H AFTER EXECUTIONBEFORE EXECUTION DCR M M=M-1 2050H
  • 62. (13) Arithematic Instructions ā€¢ DCX Rp ā€¢ The contents of register pair are decremented by 1. ā€¢ The result is stored in the same place. ā€¢ Example: DCX D
  • 63. B C D 10 E 20 H L B C D 10 E 19 H L AFTER EXECUTIONBEFORE EXECUTION SPSP DCX D RP=RP-1
  • 64. (1) Logical Instructions ā€¢ ANA R ā€¢ ANA M ā€¢ AND specified data in register or memory with accumulator. ā€¢ Store the result in accumulator (A). ā€¢ Example: ANA B, ANA M
  • 65. B 10 C D E H L A B 0F C D E H L A 0A AFTER EXECUTION ANA B A=A and R B 0F C D E H L A AA BEFORE EXECUTION CY AC CY 0 AC 1 AFTER EXECUTIONBEFORE EXECUTION CY AC CY 0 AC 1 A 11A 55 H 20 L 50 H 20 L 50 B3 B3 2050H ANA M A=A and M 2050H 1010 1010=AAH 0000 1111=0FH 0000 1010=0AH 0101 0101=55H 1011 0011=B3H 0001 0001=11H
  • 66. (2) Logical Instructions ā€¢ ANI 8-bit data ā€¢ AND 8-bit data with accumulator (A). ā€¢ Store the result in accumulator (A) ā€¢ Example: ANI 3FH
  • 67. CY AC A B3 AFTER EXECUTIONBEFORE EXECUTION CY 0 AC 1 A 33 ANI 3FH A=A and DATA(8) 1011 0011=B3H 0011 1111=3FH 0011 0011=33H
  • 68. (3) Logical Instructions ā€¢ XRA Register (8-bit) ā€¢ XOR specified register with accumulator. ā€¢ Store the result in accumulator. ā€¢ Example: XRA C
  • 69. B 10 C D E H L A B C 2D D E H L A 87 AFTER EXECUTION XRA C A=A xor R B C 2D D E H L A AA BEFORE EXECUTION CY AC CY 0 AC 0 1010 1010=AAH 0010 1101=2DH 1000 0111=87H
  • 70. (4) Logical Instructions ā€¢ XRA M ā€¢ XOR data in memory (memory location pointed by H-L pair) with Accumulator. ā€¢ Store the result in Accumulator. ā€¢ Example: XRA M
  • 71. H 20 L 50 A 55 AFTER EXECUTION XRA M A=A xor M BEFORE EXECUTION CY AC CY 0 AC 0 0101 0101=55H 1011 0011=B3H 1110 0110=E6H H 20 L 50 A E6 B3 B3 2050H 2050H
  • 72. (5) Logical Instructions ā€¢ XRI 8-bit data ā€¢ XOR 8-bit immediate data with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: XRI 39H
  • 73. CY AC A B3 AFTER EXECUTIONBEFORE EXECUTION CY 0 AC 0 A 8A XRI 39H A=A xor DATA(8) 1011 0011=B3H 0011 1001=39H 1000 1010=8AH
  • 74. (6) Logical Instructions ā€¢ ORA Register ā€¢ OR specified register with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: ORA B
  • 75. AFTER EXECUTIONBEFORE EXECUTION CY AC ORA B A=A or R 1010 1010=AAH 0001 0010=12H 1011 1010=BAH B 12 C D E H L A AA B 12 C D E H L A BA CY 0 AC 0
  • 76. (7) Logical Instructions ā€¢ ORA M ā€¢ OR specified register with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: ORA M
  • 77. AFTER EXECUTIONBEFORE EXECUTION CY AC ORA M A=A or M 0101 0101=55H 1011 0011=B3H 1111 0111=F7H H 20 L 50 A 55 A F7 CY 0 AC 0 H 20 L 50 B3 B3 2050H 2050H
  • 78. (8) Logical Instructions ā€¢ ORI 8-bit data ā€¢ OR 8-bit data with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: ORI 08H
  • 79. CY AC A B3 AFTER EXECUTIONBEFORE EXECUTION CY 0 AC 0 A BB ORI 08H A=A or DATA(8) 1011 0011=B3H 0000 1000=08H 1011 1011=BBH
  • 80. (9) Logical Instructions ā€¢ CMP Register ā€¢ CMP M ā€¢ Compare specified data in register or memory with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: CMP D or CMP M
  • 81. B 10 C D E H L A B C D B9 E H L A B8 AFTER EXECUTION CMP D A-R B C D B9 E H L A B8 BEFORE EXECUTION CY Z CY 0 Z 0 AFTER EXECUTIONBEFORE EXECUTION CY Z CY 0 Z 1 A B8A B8 H 20 L 50 H 20 L 50 B8 B8 2050H CMP M A-M 2050H A>R: CY=0,Z=0 A=R: CY=0,Z=1 A<R: CY=1,Z=0 A>M: CY=0,Z=0 A=M: CY=0,Z=1 A<M: CY=1,Z=0
  • 82. (10) Logical Instructions ā€¢ CPI 8-bit data ā€¢ Compare 8-bit immediate data with accumulator (A). ā€¢ Store the result in accumulator. ā€¢ Example: CPI 30H
  • 83. CY Z A BA AFTER EXECUTIONBEFORE EXECUTION CY 0 AC 0 A BA CPI 30H A-DATA A>DATA: CY=0,Z=0 A=DATA: CY=0,Z=1 A<DATA: CY=1,Z=0 1011 1010=BAH
  • 84. (11) Logical Instructions ā€¢ STC ā€¢ It sets the carry flag to 1. ā€¢ Example: STC
  • 85. CY 0 AFTER EXECUTIONBEFORE EXECUTION CY 1 STC CY=1
  • 86. (12) Logical Instructions ā€¢ CMC ā€¢ It complements the carry flag. ā€¢ Example: CMC
  • 87. CY 1 AFTER EXECUTIONBEFORE EXECUTION CY 0 CMC
  • 88. (13) Logical Instructions ā€¢ CMA ā€¢ It complements each bit of the accumulator. ā€¢ Example: CMA
  • 89. (14) Logical Instructions ā€¢ RLC ā€¢ Rotate accumulator left ā€¢ Each binary bit of the accumulator is rotated left by one position. ā€¢ Bit D7 is placed in the position of D0 as well as in the Carry flag. ā€¢ CY is modified according to bit D7. ā€¢ Example: RLC.
  • 90. B7 B6 B5 B4 B3 B2 B1 B0CY B6 B5 B4 B3 B2 B1 B0 B7B7 AFTER EXECUTION BEFORE EXECUTION
  • 91. (15) Logical Instructions ā€¢ RRC ā€¢ Rotate accumulator right ā€¢ Each binary bit of the accumulator is rotated right by one ā€¢ position. ā€¢ Bit D0 is placed in the position of D7 as well as in the Carry flag. ā€¢ CY is modified according to bit D0. ā€¢ Example: RRC.
  • 92. B7 B6 B5 B4 B3 B2 B1 B0 CY B0 B7 B6 B5 B4 B3 B2 B1 B0 AFTER EXECUTION BEFORE EXECUTION
  • 93. (16) Logical Instructions ā€¢ RAL ā€¢ Rotate accumulator left through carry ā€¢ Each binary bit of the accumulator is rotated left by one position through the Carry flag. ā€¢ Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. ā€¢ CY is modified according to bit D7. ā€¢ Example: RAL.
  • 94. B7 B6 B5 B4 B3 B2 B1 B0CY B6 B5 B4 B3 B2 B1 B0 CYB7 AFTER EXECUTION BEFORE EXECUTION
  • 95. (17) Logical Instructions ā€¢ RAR ā€¢ Rotate accumulator right through carry ā€¢ Each binary bit of the accumulator is rotated left by one position through the Carry flag. ā€¢ Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant position D0. ā€¢ CY is modified according to bit D7. ā€¢ Example: RAR
  • 96. B7 B6 B5 B4 B3 B2 B1 B0 CY CY B7 B6 B5 B4 B3 B2 B1 B0 AFTER EXECUTION BEFORE EXECUTION
  • 97. Concept of Subroutine ā€¢ In 8085 microprocessor a subroutine is a separate program written aside from main program ,this program is basically the program which requires to be executed several times in the main program. ā€¢ The microprocessor can call subroutine any time using CALL instruction. after the subroutine is executed the subroutine hands over the program to main program using RET instruction.
  • 98. Branching Instructions ā€¢ The branch group instructions allows the microprocessor to change the sequence of program either conditionally or under certain test conditions. The group includes, ā€¢ (1) Jump instructions, ā€¢ (2) Call and Return instructions, ā€¢ (3) Restart instructions,
  • 99. (1) Branching Instructions ā€¢ JUMP ADDRESS ā€¢ BEFORE EXECUTION AFTER EXECUTION ā€¢ Jump unconditionally to the address. ā€¢ The instruction loads the PC with the address given within the instruction and resumes the program execution from specified location. ā€¢ Example: JMP 200H PC PC 2000JMP 2000H
  • 101. (2) Branching Instructions ā€¢ CALL address ā€¢ Call unconditionally a subroutine whose starting address given within the instruction and used to transfer program control to a subprogram or subroutine. ā€¢ Example: CALL 2000H
  • 102. Conditional Calls Instruction Code Description Condition for CALL CC Call on carry CY=1 CNC Call on not carry CY=0 CP Call on positive S=0 CM Call on minus S=1 CPE Call on parity even P=1 CPO Call on parity odd P=0 CZ Call on zero Z=1 CNZ Call on not zero Z=0
  • 103. (3) Branching Instructions ā€¢ RET ā€¢ Return from the subroutine unconditionally. ā€¢ This instruction takes return address from the stack and loads the program counter with this address. ā€¢ Example: RET
  • 104. SP 27FD PC 00 62 SP 27FF PC 6200 00 62 AFTER EXECUTIONBEFORE EXECUTION RET 27FFH 27FEH 27FDH 27FFH 27FEH 27FDH
  • 105. (4) Branching Instructions ā€¢ RST n ā€¢ Restart n (0 to 7) ā€¢ This instruction transfers the program control to a specific memory address. The processor multiplies the RST number by 8 to calculate the vector address. ā€¢ Example: RST 6
  • 106. SP 3000 PC 2000 SP 2999 PC 0030 01 20 AFTER EXECUTIONBEFORE EXECUTION RST 6 3000H 2FFFH 2FFEH SP-1 ADDRESS OF THE NEXT INSTRUCTION IS 2001H 3000H 2FFFH 2FFEH
  • 107. Vector Address For Return Instructions Instruction Code Vector Address RST 0 0*8=0000H RST 1 0*8=0008H RST 2 0*8=0010H RST 3 0*8=0018H RST 4 0*8=0020H RST 5 0*8=0028H RST 6 0*8=0030H Rst 7 0*8=0038H
  • 108. (1) Control Instructions ā€¢ NOP ā€¢ No operation ā€¢ No operation is performed. ā€¢ The instruction is fetched and decoded but no operation is executed. ā€¢ Example: NOP
  • 109. (2) Control Instructions ā€¢ HLT ā€¢ Halt ā€¢ The CPU finishes executing the current instruction and halts any further execution. ā€¢ An interrupt or reset is necessary to exit from the halt state. ā€¢ Example: HLT
  • 110. (3) Control Instructions ā€¢ RIM ā€¢ Read Interrupt Mask ā€¢ This is a multipurpose instruction used to read the status of interrupts 7.5, 6.5, 5.5 and read serial data input bit. ā€¢ The instruction loads eight bits in the accumulator with the following interpretations. ā€¢ Example: RIM
  • 112. ā€¢ SIM ā€¢ Set Interrupt Mask ā€¢ This is a multipurpose instruction and used to implement the 8085 interrupts 7.5, 6.5, 5.5, and serial data output. ā€¢ The instruction interprets the accumulator contents as follows. ā€¢ Example: SIM