Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: 8085 Instruction Set By Er. Swapnil V. Kaware
Description: 8085 Instruction Set By Er. Swapnil V. Kaware
Description: 8085 Instruction Set By Er. Swapnil V. Kaware
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
Instruction Set of 8085
Microprocessor
For More Contents, do subscribe to
my channel on you tube as,
”Tech_Guru Swapnil Kaware”
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
Instruction Set of 8085
Microprocessor
Presented By,
Er
...
Kaware,
svkaware@yahoo
...
in,
B
...
(Electronics), M
...
(Electronics)
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
What is Instruction ?????
• An instruction is a binary pattern designed
inside a microprocessor to perform a specific
function
...
• Each instruction is represented by an 8-bit
binary value
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The contents of the source register are not altered
...
Swapnil V
...
co
...
• Example: MVI B, 60H or MVI M, 40H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
A
F
A
B
C
B
D
E
H
L
MVI B,60H
BEFORE EXECUTION
60
C
D
E
H
L
AFTER EXECUTION
204FH
204FH
HL=2050H
2051H
F
MVI M,40H
HL=2050H
40
2051H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(3) Data Transfer Instructions
• 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)
...
• Example: LDA 2000H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
A
A
30
2000H
30
LDA 2000H
30
2000H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(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
...
• Example: LDAX D
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
A
F
B
C
AFTER EXECUTION
A
2030H
80
B
80
F
C
2030H
LDAX D
D
20
E
30
D
20
E
30
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
80
(5) Data Transfer Instructions
• STA 16-bit address
• The contents of accumulator are copied into
the memory location i
...
address specified by
the operand in the instruction
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Example: STAX B
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
A
50
F
B
10
C
20
1020H
D
E
AFTER EXECUTION
STAX B
A
50
F
B
10
C
20
50
1020H
D
E
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(7) Data Transfer Instructions
• SHLD 16-bit address
• Store H-L register pair in memory
...
• The contents of register H are stored into the
next memory location
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The contents of register L are exchanged with
the contents of register E
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Example: SPHL
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
SP
H
25
L
00
SPHL
AFTER EXECUTION
SP
H
2500
25
L
00
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(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
...
• Example: XTHL
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
L=SP
H=(SP+1)
BEFORE EXECUTION
SP
2700
H
2700H
AFTER EXECUTION
50
SP
H
40
2701H
2702H
40
2700H
L
30
2700
60
L
60
50
30
2701H
XTHL
2702H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(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)
...
• Example: PCHL
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
PC
PC
6000
H
L
H
L
60
00
PCHL
60
00
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(12) Data Transfer Instructions
• IN 8-bit port address
• Copy data to accumulator from a port with 8bit address
...
• Example: IN 80 H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
PORT 80H
10
A
IN 80H
AFTER EXECUTION
PORT 80H
10
A
10
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(13) Data Transfer Instructions
• OUT 8-bit port address
• Copy data from accumulator to a port with 8bit address
• The contents of accumulator are copied into
the I/O port
...
Swapnil V
...
co
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The result is stored in accumulator
...
• Example: ADD C or ADD M
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
A
A
20
B
C
D
E
H
L
30
ADD C
A=A+R
BEFORE EXECUTION
A
C
D
E
H
20
L
ADD M
A=A+M
50
B
C
D
E
H
L
30
AFTER EXECUTION
20
B
50
10
2050
A
30
B
C
D
E
H
20
L
50
10
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
...
• If the operand is memory location, its address is
specified by H-L pair
...
• Example: ADC C or ADC M
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
CY
1
CY
0
A
50
A
71
B
C
D
E
H
L
20
ADC C
A=A+R+CY
BEFORE EXECUTION
H
CY
1
A
20
20
L
2050H 30
50
B
C
D
E
H
L
20
AFTER EXECUTION
ADC M
A=A+M+CY
H
CY
0
A
51
20
2050H 30
L
50
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(3) Arithematic Instructions
• ADI 8-bit data
• The 8-bit data is added to the contents of
accumulator
...
• Example: ADI 10 H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
A
AFTER EXECUTION
A
50
60
ADI 10H
A=A+DATA(8)
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(4) Arithematic Instructions
• ACI 8-bit data
• The 8-bit data and the Carry Flag (CY) are
added to the contents of accumulator
...
• Example: ACI 20 H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
CY
1
A
30
AFTER EXECUTION
ACI 20H
A=A+DATA
(8)+CY
CY
0
A
51
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(5) Arithematic Instructions
• DAD Register pair
• The 16-bit contents of the register pair are
added to the contents of H-L pair
...
• If the result is larger than 16 bits, then CY is
set
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The result is stored in accumulator
...
• Example: SUB B or SUB M
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
AFTER EXECUTION
BEFORE EXECUTION
A
50
B
30
C
D
E
H
L
SUB B
A=A-R
1020H
50
H
L
10
20
20
B
30
C
D
E
H
L
AFTER EXECUTION
BEFORE EXECUTION
A
A
10
SUB M
A=A-M
A
1020H
40
H
L
10
20
10
(7) Arithematic Instructions
• SBB R
• SBB M
• The contents of the register or memory location and
Borrow Flag (i
...
CY) are subtracted from the contents of the
accumulator
...
• If the operand is memory location, its address is specified
by H-L pair
...
Swapnil V
...
co
...
• The result is stored in accumulator
...
Swapnil V
...
co
...
e
...
• The result is stored in accumulator
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The result is stored in the same place
...
• Example: INR B or INR M
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
A
B
10
INR B
R=R+1
C
D
E
H
L
A
B
BEFORE EXECUTION
H
L
20
50
2050H
11
C
D
E
H
L
AFTER EXECUTION
30
INR M
M=M+1
H
31
L
20
50
2050H
(11) Arithematic Instructions
• INX Rp
• The contents of register pair are incremented
by 1
...
• Example: INX H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
SP
SP
B
C
D
E
H
10
L
20
INX H
RP=RP+1
B
C
D
E
H
11
L
21
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(12) Arithematic Instructions
• DCR R
• DCR M
• The contents of register or memory location are
decremented by 1
...
• If the operand is a memory location, its address
is specified by the contents of H-L pair
...
• The result is stored in the same place
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Store the result in accumulator (A)
...
• Store the result in accumulator (A)
• Example: ANI 3FH
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
AFTER EXECUTION
1011 0011=B3H
0011 1111=3FH
0011 0011=33H
CY
A
AC
B3
ANI 3FH
A=A and DATA(8)
CY
A
0 AC
1
33
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(3) Logical Instructions
• XRA Register (8-bit)
• XOR specified register with accumulator
...
• Example: XRA C
BEFORE EXECUTION
1010 1010=AAH
0010 1101=2DH
AFTER EXECUTION
1000 0111=87H
CY
AC
A
AA
B
10
C
D
E
H
L
2D
XRA C
A=A xor R
CY
0
A
87
AC
B
C
D
E
H
L
0
2D
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(4) Logical Instructions
• XRA M
• XOR data in memory (memory location
pointed by H-L pair) with Accumulator
...
• Example: XRA M
BEFORE EXECUTION
0101 0101=55H
1011 0011=B3H
AFTER EXECUTION
1110 0110=E6H
CY
AC
A
55
H
20
2050H
L
50
B3
XRA M
A=A xor M
CY
0
A
E6
H
20
AC
0
2050H
L
50
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
B3
(5) Logical Instructions
• XRI 8-bit data
• XOR 8-bit immediate data with accumulator (A)
...
• Example: XRI 39H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
1011 0011=B3H
0011 1001=39H
BEFORE EXECUTION
CY
A
AC
B3
1000 1010=8AH
XRI 39H
A=A xor DATA(8)
AFTER EXECUTION
CY
A
0 AC
0
8A
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(6) Logical Instructions
• ORA Register
• OR specified register with accumulator (A)
...
• Example: ORA B
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
1010 1010=AAH
0001 0010=12H
BEFORE EXECUTION
AFTER EXECUTION
1011 1010=BAH
CY
0
A
BA
C
B
12
D
E
D
E
H
L
H
L
CY
AC
AC
ORA B
A=A or R
A
AA
B
12
C
0
(7) Logical Instructions
• ORA M
• OR specified register with accumulator (A)
...
• Example: ORA M
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
0101 0101=55H
1011 0011=B3H
BEFORE EXECUTION
CY
CY
AC
A
55
H
20
2050H
L
AFTER EXECUTION
1111 0111=F7H
50
B3
0 AC
0
ORA M
A=A or M
A
F7
H
20
2050H
L
50
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
B3
(8) Logical Instructions
• ORI 8-bit data
• OR 8-bit data with accumulator (A)
...
• Example: ORI 08H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
1011 0011=B3H
0000 1000=08H
BEFORE EXECUTION
CY
A
AC
B3
1011 1011=BBH
ORI 08H
A=A or DATA(8)
AFTER EXECUTION
CY
A
0 AC
0
BB
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(9) Logical Instructions
• CMP Register
• CMP M
• Compare specified data in register or memory
with accumulator (A)
...
• Example: CMP D or CMP M
BEFORE EXECUTION
CY
Z
A
B8
B
10
C
D
B9
E
H
B8
H
20
2050H
L
50
CY
0
A
B8
Z
B
D
L
A>M: CY=0,Z=0
A=M: CY=0,Z=1
A
CMP M
A-M
0
C
B9
E
H
Z
A
AFTER EXECUTION
CMP D
A-R
BEFORE EXECUTION
CY
A>R: CY=0,Z=0
A=R: CY=0,Z=1
A
L
AFTER EXECUTION
CY
0
A
B8
H
20
Z
1
2050H
L
50
B8
(10) Logical Instructions
• CPI 8-bit data
• Compare 8-bit immediate data with
accumulator (A)
...
• Example: CPI 30H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
CY
A
Z
BA
A>DATA: CY=0,Z=0
A=DATA: CY=0,Z=1
A
CPI 30H
A-DATA
AFTER EXECUTION
CY
A
0 AC
0
BA
1011 1010=BAH
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(11) Logical Instructions
• STC
• It sets the carry flag to 1
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Example: CMC
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
CY
1
AFTER EXECUTION
CMC
CY
0
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(13) Logical Instructions
• CMA
• It complements each bit of the accumulator
...
Swapnil V
...
co
...
• Bit D7 is placed in the position of D0 as well as
in the Carry flag
...
• Example: RLC
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Bit D0 is placed in the position of D7 as well as in the
Carry flag
...
• Example: RRC
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• Bit D7 is placed in the Carry flag, and the Carry
flag is placed in the least significant position D0
...
• Example: RAL
...
Swapnil V
...
co
...
• Bit D7 is placed in the Carry flag, and the Carry
flag is placed in the least significant position D0
...
• Example: RAR
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
BEFORE EXECUTION
B7
B6
B5
B4
B3
B2
B1
B0
CY
AFTER EXECUTION
CY
B7
B6
B5
B4
B3
B2
B1
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
B0
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
...
after the subroutine is
executed the subroutine hands over the
program to main program using RET instruction
...
Swapnil V
...
co
...
The group includes,
• (1) Jump instructions,
• (2) Call and Return instructions,
• (3) Restart instructions,
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
(1) Branching Instructions
• JUMP ADDRESS
• BEFORE EXECUTION
PC
AFTER EXECUTION
JMP 2000H
PC
2000
• Jump unconditionally to the address
...
• Example: JMP 200H
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
Conditional Jumps
Instruction Code Decription
Condition For Jump
JC
Jump on carry
CY=1
JNC
Jump on not carry
CY=0
JP
Jump on positive
S=0
JM
Jump on minus
S=1
JPE
Jump on parity even
P=1
JPO
Jump on parity odd
P=0
JZ
Jump on zero
Z=1
JNZ
Jump on not zero
Z=0
(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
...
Swapnil V
...
co
...
• This instruction takes return address from the
stack and loads the program counter with
this address
...
Swapnil V
...
co
...
Swapnil V
...
co
...
The processor
multiplies the RST number by 8 to calculate
the vector address
...
Swapnil V
...
co
...
Swapnil V
...
co
...
• The instruction is fetched and decoded but no
operation is executed
...
Swapnil V
...
co
...
• An interrupt or reset is necessary to exit from
the halt state
...
Swapnil V
...
co
...
5, 6
...
5 and read serial data
input bit
...
• Example: RIM
Microprocessor Notes by Er
...
Kaware (svkaware@yahoo
...
in)
RIM INSTRUCTION
• SIM
• Set Interrupt Mask
• This is a multipurpose instruction and used to
implement the 8085 interrupts 7
...
5, 5
...
• The instruction interprets the accumulator
contents as follows
...
Swapnil V
...
co
...
Swapnil V
...
co
Title: 8085 Instruction Set By Er. Swapnil V. Kaware
Description: 8085 Instruction Set By Er. Swapnil V. Kaware
Description: 8085 Instruction Set By Er. Swapnil V. Kaware