SlideShare a Scribd company logo
1 of 121
1
Instruction Set of 8085
2
 An instruction is a binary pattern designed insidea
microprocessor to performa specific function.
 Theentiregroupof instructions thata microprocessor
supports is called InstructionSet.
 8085 has 246 instructions.
 Each instruction is represented byan 8-bit binaryvalue.
 These 8-bits of binary value is calledOp-Code or
Instruction Byte.
Classification of Instruction Set
3
 Data TransferInstruction
 Arithmetic Instructions
 Logical Instructions
 Branching Instructions
 Control Instructions
Data Transfer Instructions
4
 These instructions movedata between registers, or
between memory andregisters.
 These instructionscopydata from source to
destination.
 Whilecopying, thecontentsof sourceare not
modified.
Data Transfer Instructions
5
Opcode Operand Description
MOV Rd, Rs
M, Rs
Rd, M
Copy from source todestination.
 This instruction copies thecontents of the source register
into the destinationregister.
 Thecontents of thesource registerare not altered.
 If one of theoperands is a memory location, its location is
specified by the contents of the HLregisters.
 Example: MOV B, C or MOV B, M
Data Transfer Instructions
6
Opcode Operand Description
MVI Rd, Data
M, Data
Move immediate 8-bit
 The 8-bitdata is stored in thedestination registeror
memory.
 If the operand is a memory location, its locationis
specified by thecontentsof the H-L registers.
 Example: MVI B, 57H or MVI M, 57H
Data Transfer Instructions
7
Opcode Operand Description
LDA 16-bit address Load Accumulator
 Thecontentsof a memory location, specified bya 16-
bit address in the operand, are copied to the
accumulator.
 Thecontentsof thesourceare notaltered.
 Example: LDA 2034H
Example: LDA Instruction
8
02
04
0A
06
0F
0D
05
03
A
B C
D E
H L
Memory
Registers
LDA 2050H
2000
…
..
.
2049
2050
2051
2052
0D
Data Transfer Instructions
9
Opcode Operand Description
LDAX B/D Register
Pair
Load accumulator indirect
 Thecontentsof thedesignated registerpairpoint toa memory
location.
 This instructioncopies thecontentsof that memory location
into theaccumulator.
 Thecontentsof eitherthe registerpairor the memory location
are notaltered.
 Example: LDAX B
Example: LDAX Instruction
10
02
04
0A
06
0F
0D
05
03
00 06
A
B C
D E
H L
Memory
Registers
LDAX B ; AM[BC]
0001
0002
0003
0004
0005
0006
0007
0008
0D
Data Transfer Instructions
11
Opcode Operand Description
LXI Reg. pair, 16-bit
data
Load register pairimmediate
 This instruction loads 16-bit data in the registerpair.
 Example: LXI H, 2034 H
LXI: Load the immediate register pair
Instruction Description Example
Opcode Operand
12
LXI Rp, 16-bit
Data
The instruction loads immediate
16-bit data into register pair.
34
A
B
D
H L
Registers
LXI H, 2034H
20
Data Transfer Instructions
13
Opcode Operand Description
LHLD 16-bit address Load H-L registersdirect
 This instruction copies the contents of memory
location pointed out by 16-bitaddress into register L.
 Itcopies thecontentsof next memory location into
register H.
 Example: LHLD 2040 H
Example: LHLD Instruction
14
02
04
0A
06
0F
0D
05
03
A
B C
D E
H L
Memory
Registers
LHLD 0006H
0001
0002
0003
0004
0005
0006
0007
0008
0D
05
Data Transfer Instructions
15
Opcode Operand Description
STA 16-bit address Store accumulatordirect
 Thecontentsof accumulatorare copied into the
memory location specified by theoperand.
 Example: STA 2500 H
Example: STA Instruction
16
02
04
0A
06
0F
05
03
A
B C
D E
H L
Memory
Registers
STA 2050H
2000
…
..
.
2049
2050
2051
2052
0D
0D
Data Transfer Instructions
17
Opcode Operand Description
STAX Reg. pair Store accumulator indirect
 The contents of accumulator are copied into the
memory location specified by thecontentsof the
registerpair.
 Example: STAX B
STAX: Store Accumulator Indirect
Instruction Description Example
Opcode Operand
18
STAX Rp The contents of accumulator is copied
into memory location specified by the
contents of the operand (register pair).
The contents of the accumulator is not
altered.
STAX B;M[BC]A
00 06
0D
A
B C
D E
H L
Registers 02
04
0A
06
0F
05
03
Memory
0001
0002
0003
0004
0005
0006
0007
0008
0D
04
Data Transfer Instructions
19
Opcode Operand Description
SHLD 16-bit address Store H-L registersdirect
 Thecontentsof register L are stored into memory
location specified by the 16-bitaddress.
 Thecontentsof register H are stored into the next
memory location.
 Example: SHLD 2550 H
SHLD: Store H and L registers direct
Instruction Description Example
Opcode Operand
20
SHLD 16-bit
address
The contents of register L is stored in
memory location specified by the 16-bit
address in the operand and the contents
of H register is stored into the next
memory location by incrementing the
operand.
SHLD 0002H
H L
A2 D3
A2 D3
A2 D3
0001
0002
0003
0004
Memory
Data Transfer Instructions
21
Opcode Operand Description
XCHG None Exchange H-L with D-E
 Thecontentsof register H areexchanged with the
contents of registerD.
 Thecontentsof register L areexchanged with the
contents of registerE.
 Example: XCHG
XCHG: Exchange H and L with D and E
Instruction Description Example
Opcode Operand
22
XCHG None The contents of register H are
exchanged with the contents of register
D, and the contents of register L are
exchanged with the contents of register
E.
XCHG
A2 03
D3 08
D E
H L
D3 08
A2 03
D E
H L
Data Transfer Instructions
23
Opcode Operand Description
SPHL None Copy H-L pair to the Stack Pointer (SP)
 This instruction loads thecontentsof H-L pair into SP.
 Example: SPHL
SPHL: Copy H and L registers to stack pointer
Instruction Description Example
Opcode Operand
24
SPHL None The instruction loads the contents of the
H and L registers into the stack pointer
register, the contents of H register
provide the high-order address and the
contents of L register provide the low-
order address. The contents of the H
and L registers are not altered.
SPHL
H L
SP (16)
A2 D3
A2 D3
Data Transfer Instructions
25
Opcode Operand Description
XTHL None Exchange H–L with top ofstack
 Thecontentsof L registerareexchanged with the
location pointed out by thecontentsof the SP.
 Thecontentsof H registerareexchanged with the next
location (SP + 1).
 Example: XTHL
XTHL: Exchange H and L with top of stack
Instruction Description Example
Opcode Operand
26
XTHL None The contents of L register is exchanged
with stack location pointed out by
contents SP. The contents of the H
register are exchanged with the next
stack location (SP+1).
XTHL
H L
A2 D3
0001
0002
0003
0004
Memory
SP
SP
3F
2C
Registers
Data Transfer Instructions
27
Opcode Operand Description
PCHL None Load program counter with H-Lcontents
 Thecontentsof registers H and L are copied into the
program counter(PC).
 Thecontentsof H are placed as the high-order byte
and thecontentsof L as the low-order byte.
 Example: PCHL
Data Transfer Instructions
28
Opcode Operand Description
PUSH Reg. pair Push register pair ontostack
 Thecontents of registerpairarecopied onto stack.
 SP isdecremented and thecontents of high-orderregisters
(B, D, H, A) are copied intostack.
 SP is again decremented and thecontents of low-order
registers (C, E, L, Flags) are copied intostack.
 Example: PUSH B
Example: PUSH Instruction
29
23
06
40
06 40
A
B C
D E
H L
SP
Memory
Registers
PUSH B
SP <- SP-1
M[SP] <- B ;transfer high order bit to TOS
SP <- SP-1
M[SP] <- C ;transfer low order bit to TOS
0008
0007
0006
0005
0004
0003
0002
0001
SP
SP
Data Transfer Instructions
30
Opcode Operand Description
POP Reg. pair Pop stack to registerpair
 Thecontents of topof stack arecopied into registerpair.
 Thecontents of location pointed out by SP arecopied to
the low-order register (C, E, L,Flags).
 SP is incremented and thecontents of location arecopied
to the high-order register (B, D, H,A).
 Example: POP H
Example: POP Instruction
31
03
06
40
06 40
A
B C
D E
H L
SP
Memory
Registers
POP B
C <- M[SP] ; transfer to low order bit from TOS
SP <- SP+1
B <- M[SP] ; transfer to high order bit from TOS
SP <- SP+1
0008
0007
0006
0005
0004
0003
0002
0001
SP
SP
Data Transfer Instructions
32
Opcode Operand Description
OUT 8-bitport
address
Copy data from accumulator to a port with 8-
bit address
 Thecontentsof accumulatorarecopied into the I/O
port.
 Example: OUT 78 H
Data Transfer Instructions
33
Opcode Operand Description
IN 8-bitport
address
Copy data to accumulator from a port with 8-
bit address
 Thecontentsof I/O portare copied intoaccumulator.
 Example: IN 8C H
34
34
1 MOV Dst,Src Copy content 1 Byte
2 MVI (R/M), 8-bit Data Load 8-bit to Register/Memory 2 Byte
3 LDA 16-bit address Load Accumulator 3 Byte
4 LDAX Rp(B/D) Load the accumulator indirect 1 Byte
13 PUSH Rp Push the register pair onto the stack 1 Byte
5 LXI Rp, 16-bit Data Load the register pair immediate 3 Byte
6 STA 16-bit address Store Accumulator 3 Byte
7 STAX Rp Store Accumulator Indirect 1 Byte
8 LHLD 16-bit address Load H and L registers direct 3 Byte
9 SHLD 16-bit address Store H and L registers direct 3 Byte
10 XCHG None Exchange H and L with D and E 1 Byte
11 SPHL None Copy H and L registers to the stack pointer 1 Byte
12 XTHL None Exchange H and L with top of stack 1 Byte
14 POP Rp Pop off stack to the register pair 1 Byte
15 OUT 8-bit port address Output from Accumulator to 8-bit port
address
2 Byte
16 IN 8-bit port address Input data to accumulator from a port with
8-bit address
2 Byte
Data
Transfer
Instructions
Arithmetic Instructions
35
 These instructions perform the operationslike:
 Addition
 Subtract
 Increment
 Decrement
Addition
36
 Any 8-bit number, or thecontentsof register, or the
contents of memory location can be added to the
contents of accumulator.
 The result (sum) is stored in theaccumulator.
 No twoother 8-bit registers can be added directly.
 Example: The contents of registerB cannot beadded
directly to thecontentsof register C.
Subtraction
37
 Any 8-bit number, or the contents of register, or the
contents of memory location can be subtractedfrom
the contents ofaccumulator.
 The result is stored in theaccumulator.
 Subtraction is performed in 2’s complementform.
 If the result is negative, it is stored in 2’scomplement
form.
 No twoother 8-bit registers can be subtracted directly.
Increment / Decrement
38
 The 8-bitcontentsof a registerora memory location
can be incremented or decremented by1.
 The 16-bitcontentsof a register paircan be
incremented or decremented by1.
 Incrementordecrementcan be performed on any
register or a memorylocation.
Arithmetic Instructions
39
Opcode Operand Description
ADD R
M
Add register or memory to accumulator
 Thecontentsof registeror memoryareadded tothecontentsof
accumulator.
 The result is stored inaccumulator.
 If theoperand is memory location, itsaddress is specified by H-L pair.
 All flags are modified toreflect the resultof theaddition.
 Example: ADD B or ADDM
ADD: Add register/memory to accumulator
40
Instruction Description Example
Opcode Operand
ADD R/M • The contents of the operand
(register or memory) are added to
the contents of the accumulator and
the result is stored in the
accumulator.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
• Flags are modified to reflect the
result of the addition.
ADD B; A = A + B
ADD M; A = A + M[HL]
Arithmetic Instructions
41
Opcode Operand Description
ADC R
M
Add register or memory to accumulator with
carry
 Thecontentsof registeror memoryand Carry Flag (CY) areadded to
the contents ofaccumulator.
 The result is stored inaccumulator.
 If theoperand is memory location, itsaddress is specified by H-L pair.
 All flags are modified toreflect the resultof theaddition.
 Example: ADC B or ADCM
ADC: Add register to accumulator with carry
42
Instruction Description Example
Opcode Operand
ADC R/M • The contents of the operand
(register or memory) and the Carry
flag are added to the contents of the
accumulator and the result is stored
in the accumulator.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
• Flags are modified to reflect the
result of the addition.
ADC B; A = A + B + CY
ADC M; A = A + M[HL]+CY
Arithmetic Instructions
43
Opcode Operand Description
ADI 8-bit data Add immediate to accumulator
 The 8-bitdata is added to thecontentsof accumulator.
 The result is stored inaccumulator.
 All flags are modified toreflect the resultof the
addition.
 Example: ADI 45 H
ADI: Add immediate 8-bit with accumulator
44
Instruction Description Example
Opcode Operand
ADI 8-bit
data
• The 8-bit data (operand) is added to
the contents of the accumulator and
the result is stored in the
accumulator.
• Flags are modified to reflect the
result of the addition.
ADI 03; A = A + 03h
Arithmetic Instructions
45
Opcode Operand Description
ACI 8-bit data Add immediate to accumulator withcarry
 The 8-bitdataand the Carry Flag (CY) areadded to the
contents of accumulator.
 The result is stored inaccumulator.
 All flags are modified to reflect the result of theaddition.
 Example: ACI 45 H
ACI: Add immediate 8-bit to accumulator with carry
46
Instruction Description Example
Opcode Operand
ACI 8-bit
data
• The 8-bit data (operand) and the
Carry flag are added to the contents
of the accumulator and the result is
stored in the accumulator.
• Flags are modified to reflect the
result of the addition.
ACI 03; A = A + 03h + CY
Arithmetic Instructions
47
Opcode Operand Description
DAD Reg. pair Add register pair to H-Lpair
 The 16-bitcontents of the registerpairareadded to the
contents of H-L pair.
 The result is stored in H-Lpair.
 If the result is larger than 16 bits, then CY is set.
 No other flagsare changed.
 Example: DAD B
DAD Instruction
48
02 08
02 03
A
B C
D E
H L
Registers
02 08
02 03
+
04 0B
04 0B 02 03
DAD B
Arithmetic Instructions
49
Opcode Operand Description
SUB R
M
Subtract register or memory from accumulator
 Thecontentsof the registeror memory locationare subtracted from
the contents of theaccumulator.
 The result is stored inaccumulator.
 If theoperand is memory location, itsaddress is specified by H-L pair.
 All flags are modified toreflect the resultof subtraction.
 Example: SUB B or SUB M
SUB : Subtract register/memory from accumulator
50
Instruction Description Example
Opcode Operand
SUB R/M • The contents of the operand
(register or memory) is subtracted
from the contents of the
accumulator, and the result is stored
in the accumulator.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
• Flags are modified to reflect the
result of the subtraction.
SUB B ; A=A-B
SUB M ; A=A-M[HL]
Arithmetic Instructions
51
Opcode Operand Description
SBB R
M
Subtract register or memory from accumulator
with borrow
 Thecontentsof the registeror memory locationand Borrow Flag (i.e.
CY) are subtracted from thecontentsof theaccumulator.
 The result is stored inaccumulator.
 If theoperand is memory location, itsaddress is specified by H-L pair.
 All flags are modified toreflect the resultof subtraction.
 Example: SBB B or SBB M
SBB: Subtract source & borrow from accumulator
52
Instruction Description Example
Opcode Operand
SBB R/M • The contents of the operand
(register or memory) and the Borrow
flag are subtracted from the contents
of the accumulator and the result is
placed in the accumulator.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
• Flags are modified to reflect the
result of the subtraction.
SBB B; A=A - (B+CY)
SBB M; A=A-(M[HL]+CY)
Arithmetic Instructions
53
Opcode Operand Description
SUI 8-bit data Subtract immediate from accumulator
 The 8-bitdata is subtracted from thecontents of the
accumulator.
 The result is stored inaccumulator.
 All flags are modified to reflect the result of subtraction.
 Example: SUI 45 H
SUI : Subtract immediate 8-bit from accumulator
54
Instruction Description Example
Opcode Operand
SUI 8-bit
data
• The 8-bit data (operand) is
subtracted from the contents of the
accumulator and the result is stored
in the accumulator.
SUI 08h; A = A - 08h
Arithmetic Instructions
55
Opcode Operand Description
SBI 8-bit data Subtract immediate from accumulatorwith
borrow
 The 8-bitdata and the Borrow Flag (i.e. CY) is subtracted
from the contents of theaccumulator.
 The result is stored inaccumulator.
 All flags are modified to reflect the result of subtraction.
 Example: SBI 45 H
SBI : Subtract immediate from accumulator with borrow
56
Instruction Description Example
Opcode Operand
SBI 8-bit
data
• The 8-bit data (operand) and the
borrow (CY) are subtracted from the
contents of the accumulator and the
result is stored in the accumulator.
SBI 08h; A=A - (08h+CY)
Arithmetic Instructions
57
Opcode Operand Description
INR R
M
Increment register or memory by 1
 Thecontents of registeror memory location are
incremented by 1.
 The result is stored in the same place.
 If theoperand is a memory location, itsaddress is specified
by the contents of H-Lpair.
 Example: INR B or INR M
INR: Increment register/memory by 1
58
Instruction Description Example
Opcode Operand
INR R/M • The contents of the designated
register or memory is incremented
by 1 and the result is stored at the
same place.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
INR B;B=B+01
INR M;M[HL]=M[HL]+01
Arithmetic Instructions
59
Opcode Operand Description
INX R Increment register pair by1
 Thecontentsof register pairare incremented by 1.
 The result is stored in the same place.
 Example: INX H
INX : Increment register pair by 1
60
Instruction Description Example
Opcode Operand
INX Rp The contents of the designated register
pair is incremented by 1 and the result is
stored at the same place.
INX D; DE=DE+0001
Arithmetic Instructions
61
Opcode Operand Description
DCR R
M
Decrement register or memory by 1
 Thecontents of registeror memory location are
decremented by 1.
 The result is stored in the same place.
 If theoperand is a memory location, itsaddress is specified
by the contents of H-Lpair.
 Example: DCR B or DCR M
DCR: Decrement register/ memory by 1
62
Instruction Description Example
Opcode Operand
DCR R/M • The contents of the designated
register or memory is decremented
by 1 and the result is stored in the
same place.
• If the operand is a memory location,
its location is specified by the
contents of the HL registers.
DCR B;B=B-01
DCR M;M[HL]=M[HL]-01
Arithmetic Instructions
63
Opcode Operand Description
DCX R Decrement register pair by1
 Thecontentsof register pairaredecremented by 1.
 The result is stored in the same place.
 Example: DCX H
DCX: Decrement register pair by 1
64
Instruction Description Example
Opcode Operand
DCX Rp The contents of the designated register
pair is decremented by 1 and their result
is stored at the same place.
DCX B; BC=BC- 0001
DCX D; DE=DE- 0001
DAA: Decimal Adjust Accumulator
65
Instruction Description Example
Opcode Operand
DAA None • The contents of the accumulator is
changed from a binary value to two
4-bit BCD digits.
• If the value of the low-order 4-bits in
the accumulator is greater than 9 or
if AC flag is set, the instruction adds
6 to the low-order four bits.
• If the value of the high-order 4-bits
in the accumulator is greater than 9
or if the Carry flag is set, the
instruction adds 6 to the high-order
four bits.
DAA
DAA Instruction
66
A
B C
D E
H L
Registers
2A 0 0 1 0 1 0 1 0
+ 0 0 0 0 0 1 1 0
0 0 1 0 0 0 0
1
1
1
1
Valid BCD number
3 0
67
67
1 ADD R/M Add register or memory, to the accumulator 1 Byte
13 DCX Rp
Decrement register pair by 1 1 Byte
2 ADC R/M Add register to the accumulator with carry 1 Byte
3 ADI 8-bit data Add the immediate to the accumulator 2 Byte
4 ACI 8-bit data Add the immediate to the accumulator with carry 2 Byte
5 DAD Rp
Add the register pair to H and L registers 1 Byte
6 SUB R/M Subtract the register/memory from accumulator 1 Byte
7 SBB R/M Subtract the source and borrow from accumulator 1 Byte
8 SUI 8-bit data Subtract the immediate from the accumulator 2 Byte
9 SBI 8-bit data Subtract immediate from accumulator with borrow 2 Byte
10 INR R/M Increment the register or the memory by 1 1 Byte
11 INX Rp
Increment register pair by 1 1 Byte
12 DCR R/M Decrement the register or the memory by 1 1 Byte
14 DAA Decimal adjust accumulator 1 Byte
Arithmetic
Instructions
Logical Instructions
68
 These instructions perform logical operationson data
stored in registers, memory and statusflags.
 The logical operationsare:
 AND
 OR
 XOR
 Rotate
 Compare
 Complement
AND, OR, XOR
69
 Any 8-bitdata, or thecontentsof register, or memory
location can logicallyhave
 AND operation
 OR operation
 XOR operation
with the contents ofaccumulator.
 The result is stored inaccumulator.
Rotate
70
 Each bit in theaccumulatorcan be shifted either leftor
right to the nextposition.
Compare
71
 Any 8-bitdata, or thecontentsof register, or memory
location can be comparesfor:
 Equality
 GreaterThan
 Less Than
with the contents ofaccumulator.
 The result is reflected in status flags.
Complement
72
 Thecontentsof accumulatorcan becomplemented.
 Each 0 is replaced by 1 and each 1 is replaced by 0.
Logical Instructions
73
Opcode Operand Description
CMP R
M
Compare register or memory with
accumulator
 Thecontentsof theoperand (registeror memory) are
compared with thecontentsof the accumulator.
 Both contents are preserved.
 The resultof thecomparison is shown by setting the
flags of the PSW asfollows:
Logical Instructions
74
Opcode Operand Description
CMP R
M
Compare register or memory with
accumulator
 if (A) < (reg/mem): carry flag isset
 if (A) = (reg/mem): zero flag isset
 if (A) > (reg/mem): carry and zero flags are reset.
 Example: CMP B or CMPM
Logical Instructions
75
Opcode Operand Description
CPI 8-bit data Compare immediate withaccumulator
 The 8-bitdata is compared with the contentsof
accumulator.
 The values being compared remainunchanged.
 The resultof thecomparison is shown by setting the
flags of the PSW asfollows:
Logical Instructions
76
Opcode Operand Description
CPI 8-bit data Compare immediate withaccumulator
 if (A) < data: carry flag isset
 if (A) = data: zero flag isset
 if (A) > data: carry and zero flags are reset
 Example: CPI 89H
Logical Instructions
77
Opcode Operand Description
ANA R
M
Logical AND register or memory with
accumulator
 Thecontentsof theaccumulatorare logicallyANDed with thecontents
of register ormemory.
 The result is placed in theaccumulator.
 If theoperand is a memory location, itsaddress is specified by the
contents of H-Lpair.
 S, Z, P are modified toreflect theresultof theoperation.
 CY is resetand AC is set.
 Example: ANA B or ANAM.
Logical Instructions
 Example: ANI 86H.
78
Opcode Operand Description
ANI 8-bit data Logical AND immediate withaccumulator
 Thecontents of theaccumulatorare logically ANDed with
the 8-bitdata.
 The result is placed in theaccumulator.
 S, Z, P are modified to reflect the result.
 CY is reset, AC isset.
Logical Instructions
 Example: ORA B or ORA M.
79
Opcode Operand Description
ORA R
M
Logical OR register or memorywith
accumulator
 Thecontents of the accumulatorare logically ORed with the contents of the registeror
memory.
 The result is placed in theaccumulator.
 If theoperand is a memory location, its address is specified by thecontents of H-L pair.
 S, Z, P are modified to reflect theresult.
 CY and AC arereset.
Logical Instructions
 Example: ORI 86H.
8
0
Opcode Operand Description
ORI 8-bit data Logical OR immediate with accumulator
 Thecontents of theaccumulatorare logically ORed with
the 8-bitdata.
 The result is placed in theaccumulator.
 S, Z, P are modified to reflect the result.
 CY and AC arereset.
Logical Instructions
 Example: XRA B or XRAM.
81
Opcode Operand Description
XRA R
M
Logical XOR register or memorywith
accumulator
 Thecontentsof theaccumulatorare XORed with thecontentsof
the register ormemory.
 The result is placed in theaccumulator.
 If theoperand is a memory location, its address is specified by
the contents of H-Lpair.
 S, Z, P are modified to reflect the resultof theoperation.
 CY and AC arereset.
Logical Instructions
 Example: XRI 86H.
82
Opcode Operand Description
XRI 8-bit data XOR immediate with accumulator
 Thecontentsof theaccumulatorare XORed with the
8-bitdata.
 The result is placed in theaccumulator.
 S, Z, P are modified to reflect the result.
 CY and AC arereset.
Logical Instructions
 Example:RLC.
83
Opcode Operand Description
RLC None Rotate accumulator left
 Each binary bitof theaccumulator is rotated left byone
position.
 Bit D7 is placed in the positionof D0 as well as in the Carry
flag.
 CY is modified according to bitD7.
 S, Z, P,AC are notaffected.
Logical Instruction
84
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 0 0
RLC
0 1 0 1 0 0 0
1
CY
1
A:Accumulator
Rotate the accumulator left
Logical Instructions
 Example:RRC.
85
Opcode Operand Description
RRC None Rotate accumulatorright
 Each binary bitof theaccumulator is rotated right by one
position.
 Bit D0 is placed in the positionof D7 as well as in the Carry
flag.
 CY is modified according to bitD0.
 S, Z, P,AC are notaffected.
RRC: Example
86
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 0 0
CY
A:Accumulator
1 0 1 0 1 0 0
0
0
Rotate the accumulator right
Logical Instructions
56
Opcode Operand Description
RAL None Rotate accumulator left throughcarry
 Each binary bitof theaccumulator is rotated left byone
position through the Carryflag.
 Bit D7 is placed in the Carry flag, and the Carry flag is
placed in the least significant positionD0.
 CY is modified according to bitD7.
 S, Z, P,AC are notaffected.
 Example: RAL.
RAL: Example
88
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 0 0
0 1 0 1 0 0 0
1
CY
A:Accumulator
Rotate the accumulator left through carry
0
Logical Instructions
89
Opcode Operand Description
RAR None Rotate accumulator right throughcarry
 Each binary bitof theaccumulator is rotated right by one
position through the Carryflag.
 Bit D0 is placed in the Carry flag, and the Carry flag is
placed in the most significant positionD7.
 CY is modified according to bitD0.
 S, Z, P,AC are notaffected.
 Example: RAR.
RAR: Example
90
D7 D6 D5 D4 D3 D2 D1 D0
1 0 1 0 1 0 0 0
CY
A:Accumulator
1 0 1 0 1 0 0
0
0
Rotate the accumulator right through carry
1
Logical Instructions
91
Opcode Operand Description
CMA None Complement accumulator
 Thecontentsof theaccumulatorare complemented.
 No flags areaffected.
 Example: CMA.
CMA: Complement accumulator
92
Instruction Description Example
Opcode Operand
CMA None The contents of the accumulator are
complemented. No flags are affected.
CMA
A CMA
2A
0 0 1 0 1 0 1 0
1 1 0 1 0 1 0 1
D 5
Logical Instructions
93
Opcode Operand Description
CMC None Complement carry
 The Carry flag iscomplemented.
 Noother flags areaffected.
 Example: CMC.
Logical Instructions
94
Opcode Operand Description
STC None Set carry
 The Carry flagis set to 1.
 Noother flags areaffected.
 Example: STC.
Branching Instructions
95
 The branching instruction alter the normalsequential
flow.
 These instructionsaltereither unconditionallyor
conditionally.
Branching Instructions
96
Opcode Operand Description
JMP 16-bit address Jump unconditionally
 The program sequence is transferred to the memory
location specified by the 16-bit address given in the
operand.
 Example: JMP 2034 H.
JMP: Jump unconditionally
97
Memory
Address
Instructions
0000H MVI A,05
0002H MOV B,A
0003H MOV C,B
0004H JMP 0009
0007H ADI 02
0009H SUB B
000AH HLT
Memory
Label
Instructions
MVI A,05
MOV B,A
MOV C,B
JMP L1
ADI 02
L1: SUB B
HLT
Branching Instructions
98
Opcode Operand Description
Jx 16-bit address Jump conditionally
 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 thePSW.
 Example: JZ 2034 H.
Jump Conditionally
99
Opcode Description Status Flags
JC Jump if Carry CY = 1
JNC Jump if No Carry CY = 0
JP Jump if Positive S = 0
JM Jump if Minus S = 1
JZ Jump if Zero Z = 1
JNZ Jump if No Zero Z = 0
JPE Jump if Parity Even P = 1
JPO Jump if Parity Odd P = 0
Branching Instructions
10
0
Opcode Operand Description
CALL 16-bit address Call unconditionally
 The program sequence is transferred to the memory
location specified by the 16-bit address given in the
operand.
 Before the transfer, the address of the next instruction after
CALL (the contents of the program counter) is pushed onto
thestack.
 Example: CALL 2034 H.
CALL: Call Unconditionally
Line Instruction Address PC
1 LXI H,1002 [0000] [0003]
2 LXI D,3002 [0003] [0006]
3 CALL ADD1 [0006] [0009]
4 LXI B,4002 [0009] [000C]
5 ADD1:MOV A,D [000C] [000D]
6 ADD H [000D] [000E]
7 RET [000E]
05 [2008]
[2007]
[2006]
[2005]
09
00
SP
SP 00
09
SP
SP
CALL: Call Unconditionally
Line Instruction Address PC
1 LXI H,1002 [0000] [0003]
2 LXI D,3002 [0003] [0006]
3 CALL ADD1 [0006] [0009]
4 LXI B,4002 [0009] [000C]
5 ADD1:MOV A,D [000C] [000D]
6 ADD H [000D] [000E]
7 RET [000E]
05 [2008]
[2007]
[2006]
[2005]
09
00
SP
SP 00
09
SP
SP
Branching Instructions
103
Opcode Operand Description
Cx 16-bit address Call conditionally
 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 thePSW.
 Before the transfer, theaddressof the next instruction
after the call (the contents of the program counter) is
pushed onto thestack.
 Example: CZ 2034 H.
Call Conditionally
10
4
Opcode Description Status Flags
CC Call if Carry CY = 1
CNC Call if No Carry CY = 0
CP Call if Positive S = 0
CM Call if Minus S = 1
CZ Call if Zero Z = 1
CNZ Call if No Zero Z = 0
CPE Call if Parity Even P = 1
CPO Call if Parity Odd P = 0
Branching Instructions
105
Opcode Operand Description
RET None Return unconditionally
 The program sequence is transferred fromthe
subroutine to the callingprogram.
 The two bytes from the top of the stack are copied into
the program counter, and program execution begins at
the newaddress.
 Example: RET.
Branching Instructions
10
6
Opcode Operand Description
Rx None Call conditionally
 The program sequence is transferred from the
subroutineto thecalling program based on the
specified flag of thePSW.
 The two bytes from the top of the stack are copied into
the program counter, and program execution begins at
the newaddress.
 Example: RZ.
Return Conditionally
107
Opcode Description Status Flags
RC Return if Carry CY = 1
RNC Return if No Carry CY = 0
RP Return if Positive S = 0
RM Return if Minus S = 1
RZ Return if Zero Z = 1
RNZ Return if No Zero Z = 0
RPE Return if Parity Even P = 1
RPO Return if Parity Odd P = 0
Branching Instructions
10
8
Opcode Operand Description
RST 0 – 7 Restart (Software Interrupts)
 The RST instruction jumps thecontrol tooneof eight
memory locations depending upon thenumber.
 Theseare used as software instructions in a program to
transfer program execution to one of the eight
locations.
 Example: RST 3.
Restart Address Table
10
9
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
Control Instructions
110
 Thecontrol instructionscontrol theoperation of
microprocessor.
Control Instructions
111
Opcode Operand Description
NOP None No operation
 No operation isperformed.
 The instruction is fetched and decoded butno
operation isexecuted.
 Example: NOP
Control Instructions
112
Opcode Operand Description
HLT None Halt
 The CPU finishes executing the currentinstruction
and halts any furtherexecution.
 An interruptor reset is necessary toexit from the halt
state.
 Example: HLT
Control Instructions
113
Opcode Operand Description
DI None Disable interrupt
 The interruptenable flip-flop is resetand all the
interruptsexcept the TRAP aredisabled.
 No flags areaffected.
 Example: DI
Control Instructions
114
Opcode Operand Description
EI None Enable interrupt
 The interruptenable flip-flop is setand all interrupts
areenabled.
 No flags areaffected.
 This instruction is necessary to re-enablethe
interrupts (exceptTRAP).
 Example: EI
Control Instructions
115
Opcode Operand Description
RIM None 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 Instruction
116
RIM: Read Interrupt Mask
117
Instruction Description Example
Opcode Operand
RIM None This is a multipurpose instruction used to
1. Read the status of interrupts 7.5, 6.5, 5.5
2. Read serial data input bit.
It reads eight bits from accumulator with
following interpretations.
RIM
D7 D6 D5 D4 D3 D2 D1 D0
A:Accumulator
5.5
6.5
7.5
IE
I5
I6
I7
SID
To read interrupt mask
Interrupt Masked if bit=1
Interrupt Enable Flag: 1=enable; 0=disable
To identify pending interrupts
1=pending interrupt
0=no pending interrupt
To receive
serial data
Control Instructions
118
Opcode Operand Description
SIM None Set Interrupt Mask
 This is a multipurpose instruction and used to
implement the 8085 interrupts 7.5, 6.5, 5.5, andserial
dataoutput.
 The instruction interprets theaccumulatorcontentsas
follows.
 Example: SIM
SIM Instruction
119
SIM Instruction
120
D7 D6 D5 D4 D3 D2 D1 D0
A:Accumulator
M5.5
M6.5
M7.5
MSE
R7.5
X
SDE
SOD
To set mask for RST7.5,RST 6.5, RST5.5
Interrupt Masked if bit=1
Mask Set Enable: if 0, bits 0-2 are ignored
if 1, mask is set
Serial Output Data
It is used to
transmit o/p bits.
Ignored if D6=0
Reset
RST 7.5 if D4=1
Serial Data Enable
If D6=1; bit D7 is
output to SOD Latch
SIM Instruction
121
D7 D6 D5 D4 D3 D2 D1 D0
Accumulator M5.5
M6.5
M7.5
MSE
R7.5
X
SDE
SOD
Example 1: MVI A,08H
SIM
D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 1 0 0 0

More Related Content

What's hot

Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer ArchitectureVolodymyr Ushenko
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor pptRJ Aniket
 
Asynchronous sequential circuit analysis
Asynchronous sequential circuit analysisAsynchronous sequential circuit analysis
Asynchronous sequential circuit analysisDr Naim R Kidwai
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architectureprasadpawaskar
 
Computer architecture input output organization
Computer architecture input output organizationComputer architecture input output organization
Computer architecture input output organizationMazin Alwaaly
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controllerabhikalmegh
 
Unit 3 basic processing unit
Unit 3   basic processing unitUnit 3   basic processing unit
Unit 3 basic processing unitchidabdu
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorVikas Gupta
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction SetDr. Pankaj Zope
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessorAMAN SRIVASTAVA
 
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmPolygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmMani Kanth
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing ModesMayank Garg
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-SystemsVenkata Sreeram
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Urvashi Singh
 

What's hot (20)

FPGA
FPGAFPGA
FPGA
 
Lecture1 - Computer Architecture
Lecture1 - Computer ArchitectureLecture1 - Computer Architecture
Lecture1 - Computer Architecture
 
8085 microproceesor ppt
8085 microproceesor ppt8085 microproceesor ppt
8085 microproceesor ppt
 
Asynchronous sequential circuit analysis
Asynchronous sequential circuit analysisAsynchronous sequential circuit analysis
Asynchronous sequential circuit analysis
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
Semiconductor memories
Semiconductor memoriesSemiconductor memories
Semiconductor memories
 
Computer architecture input output organization
Computer architecture input output organizationComputer architecture input output organization
Computer architecture input output organization
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
Unit 3 basic processing unit
Unit 3   basic processing unitUnit 3   basic processing unit
Unit 3 basic processing unit
 
Interfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessorInterfacing memory with 8086 microprocessor
Interfacing memory with 8086 microprocessor
 
Unit II arm 7 Instruction Set
Unit II arm 7 Instruction SetUnit II arm 7 Instruction Set
Unit II arm 7 Instruction Set
 
Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32 Interfacing using ِAtmega16/32
Interfacing using ِAtmega16/32
 
Architecture of 8085 microprocessor
Architecture of 8085 microprocessorArchitecture of 8085 microprocessor
Architecture of 8085 microprocessor
 
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithmPolygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
Polygon clipping with sutherland hodgeman algorithm and scan line fill algorithm
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Cpu registers
Cpu registersCpu registers
Cpu registers
 
Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086Assembler directives and basic steps ALP of 8086
Assembler directives and basic steps ALP of 8086
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Flags registers
Flags registersFlags registers
Flags registers
 

Similar to 4. Instruction Set Of MP 8085.pptx

Similar to 4. Instruction Set Of MP 8085.pptx (20)

8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS8085 DATA TRANSFER INSTRUCTIONS
8085 DATA TRANSFER INSTRUCTIONS
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Instruction set of 8085
Instruction set of 8085Instruction set of 8085
Instruction set of 8085
 
instruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).pptinstruction-set-of-8085 (1).ppt
instruction-set-of-8085 (1).ppt
 
Instruction set-of-8085
Instruction set-of-8085Instruction set-of-8085
Instruction set-of-8085
 
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
 
Microprocessor Basics CH-3
Microprocessor Basics CH-3Microprocessor Basics CH-3
Microprocessor Basics CH-3
 
8085 instructions details
8085 instructions details8085 instructions details
8085 instructions details
 
8085 instructions
8085 instructions8085 instructions
8085 instructions
 
Instructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIRInstructionset8085 by NCIT SAROZ BISTA SIR
Instructionset8085 by NCIT SAROZ BISTA SIR
 
8085 instruction set
8085 instruction set8085 instruction set
8085 instruction set
 
itft-Instruction set-of-8085
itft-Instruction set-of-8085itft-Instruction set-of-8085
itft-Instruction set-of-8085
 
8085 Instructions.pdf
8085 Instructions.pdf8085 Instructions.pdf
8085 Instructions.pdf
 
Instructionset8085
Instructionset8085Instructionset8085
Instructionset8085
 
8085 is details
8085 is details8085 is details
8085 is details
 
Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085Addressing mode & data transfer instruction of 8085
Addressing mode & data transfer instruction of 8085
 
Unit 2 Instruction set.pdf
Unit 2 Instruction set.pdfUnit 2 Instruction set.pdf
Unit 2 Instruction set.pdf
 
03 addr mode &amp; instructions
03 addr mode &amp; instructions03 addr mode &amp; instructions
03 addr mode &amp; instructions
 
Lecture 02 Data Group of Instructions
Lecture 02 Data Group of InstructionsLecture 02 Data Group of Instructions
Lecture 02 Data Group of Instructions
 

More from ISMT College

Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.pptISMT College
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptxISMT College
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptxISMT College
 
2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptxISMT College
 
1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptxISMT College
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2ISMT College
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicISMT College
 
Access Control List (ACL)
Access Control List (ACL)Access Control List (ACL)
Access Control List (ACL)ISMT College
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to CountersISMT College
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemISMT College
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicISMT College
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devicesISMT College
 
Basic Gates in Digital Logic
Basic Gates in Digital LogicBasic Gates in Digital Logic
Basic Gates in Digital LogicISMT College
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)ISMT College
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital LogicISMT College
 

More from ISMT College (18)

Attack.pptx
Attack.pptxAttack.pptx
Attack.pptx
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
 
Timing Diagram.pptx
Timing Diagram.pptxTiming Diagram.pptx
Timing Diagram.pptx
 
Instruction.pdf
Instruction.pdfInstruction.pdf
Instruction.pdf
 
3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx3. Addressing Modes in 8085 microprocessor.pptx
3. Addressing Modes in 8085 microprocessor.pptx
 
2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx2. 8085-Microprocessor.pptx
2. 8085-Microprocessor.pptx
 
1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx1. Introduction to Microprocessor.pptx
1. Introduction to Microprocessor.pptx
 
Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2Digital Logic BCA TU Chapter 2.2
Digital Logic BCA TU Chapter 2.2
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
 
VLAN
VLANVLAN
VLAN
 
Access Control List (ACL)
Access Control List (ACL)Access Control List (ACL)
Access Control List (ACL)
 
Introduction to Counters
Introduction to CountersIntroduction to Counters
Introduction to Counters
 
Chapter 2.1 introduction to number system
Chapter 2.1 introduction to number systemChapter 2.1 introduction to number system
Chapter 2.1 introduction to number system
 
Chapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital LogicChapter 1 Introduction to Digital Logic
Chapter 1 Introduction to Digital Logic
 
Programmable logic devices
Programmable logic devicesProgrammable logic devices
Programmable logic devices
 
Basic Gates in Digital Logic
Basic Gates in Digital LogicBasic Gates in Digital Logic
Basic Gates in Digital Logic
 
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
Adder & subtractor (Half adder, Full adder, Half subtractor, Full subtractor)
 
Register in Digital Logic
Register in Digital LogicRegister in Digital Logic
Register in Digital Logic
 

Recently uploaded

Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...Call girls in Ahmedabad High profile
 

Recently uploaded (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
High Profile Call Girls Dahisar Arpita 9907093804 Independent Escort Service ...
 

4. Instruction Set Of MP 8085.pptx

  • 1. 1
  • 2. Instruction Set of 8085 2  An instruction is a binary pattern designed insidea microprocessor to performa specific function.  Theentiregroupof instructions thata microprocessor supports is called InstructionSet.  8085 has 246 instructions.  Each instruction is represented byan 8-bit binaryvalue.  These 8-bits of binary value is calledOp-Code or Instruction Byte.
  • 3. Classification of Instruction Set 3  Data TransferInstruction  Arithmetic Instructions  Logical Instructions  Branching Instructions  Control Instructions
  • 4. Data Transfer Instructions 4  These instructions movedata between registers, or between memory andregisters.  These instructionscopydata from source to destination.  Whilecopying, thecontentsof sourceare not modified.
  • 5. Data Transfer Instructions 5 Opcode Operand Description MOV Rd, Rs M, Rs Rd, M Copy from source todestination.  This instruction copies thecontents of the source register into the destinationregister.  Thecontents of thesource registerare not altered.  If one of theoperands is a memory location, its location is specified by the contents of the HLregisters.  Example: MOV B, C or MOV B, M
  • 6. Data Transfer Instructions 6 Opcode Operand Description MVI Rd, Data M, Data Move immediate 8-bit  The 8-bitdata is stored in thedestination registeror memory.  If the operand is a memory location, its locationis specified by thecontentsof the H-L registers.  Example: MVI B, 57H or MVI M, 57H
  • 7. Data Transfer Instructions 7 Opcode Operand Description LDA 16-bit address Load Accumulator  Thecontentsof a memory location, specified bya 16- bit address in the operand, are copied to the accumulator.  Thecontentsof thesourceare notaltered.  Example: LDA 2034H
  • 8. Example: LDA Instruction 8 02 04 0A 06 0F 0D 05 03 A B C D E H L Memory Registers LDA 2050H 2000 … .. . 2049 2050 2051 2052 0D
  • 9. Data Transfer Instructions 9 Opcode Operand Description LDAX B/D Register Pair Load accumulator indirect  Thecontentsof thedesignated registerpairpoint toa memory location.  This instructioncopies thecontentsof that memory location into theaccumulator.  Thecontentsof eitherthe registerpairor the memory location are notaltered.  Example: LDAX B
  • 10. Example: LDAX Instruction 10 02 04 0A 06 0F 0D 05 03 00 06 A B C D E H L Memory Registers LDAX B ; AM[BC] 0001 0002 0003 0004 0005 0006 0007 0008 0D
  • 11. Data Transfer Instructions 11 Opcode Operand Description LXI Reg. pair, 16-bit data Load register pairimmediate  This instruction loads 16-bit data in the registerpair.  Example: LXI H, 2034 H
  • 12. LXI: Load the immediate register pair Instruction Description Example Opcode Operand 12 LXI Rp, 16-bit Data The instruction loads immediate 16-bit data into register pair. 34 A B D H L Registers LXI H, 2034H 20
  • 13. Data Transfer Instructions 13 Opcode Operand Description LHLD 16-bit address Load H-L registersdirect  This instruction copies the contents of memory location pointed out by 16-bitaddress into register L.  Itcopies thecontentsof next memory location into register H.  Example: LHLD 2040 H
  • 14. Example: LHLD Instruction 14 02 04 0A 06 0F 0D 05 03 A B C D E H L Memory Registers LHLD 0006H 0001 0002 0003 0004 0005 0006 0007 0008 0D 05
  • 15. Data Transfer Instructions 15 Opcode Operand Description STA 16-bit address Store accumulatordirect  Thecontentsof accumulatorare copied into the memory location specified by theoperand.  Example: STA 2500 H
  • 16. Example: STA Instruction 16 02 04 0A 06 0F 05 03 A B C D E H L Memory Registers STA 2050H 2000 … .. . 2049 2050 2051 2052 0D 0D
  • 17. Data Transfer Instructions 17 Opcode Operand Description STAX Reg. pair Store accumulator indirect  The contents of accumulator are copied into the memory location specified by thecontentsof the registerpair.  Example: STAX B
  • 18. STAX: Store Accumulator Indirect Instruction Description Example Opcode Operand 18 STAX Rp The contents of accumulator is copied into memory location specified by the contents of the operand (register pair). The contents of the accumulator is not altered. STAX B;M[BC]A 00 06 0D A B C D E H L Registers 02 04 0A 06 0F 05 03 Memory 0001 0002 0003 0004 0005 0006 0007 0008 0D 04
  • 19. Data Transfer Instructions 19 Opcode Operand Description SHLD 16-bit address Store H-L registersdirect  Thecontentsof register L are stored into memory location specified by the 16-bitaddress.  Thecontentsof register H are stored into the next memory location.  Example: SHLD 2550 H
  • 20. SHLD: Store H and L registers direct Instruction Description Example Opcode Operand 20 SHLD 16-bit address The contents of register L is stored in memory location specified by the 16-bit address in the operand and the contents of H register is stored into the next memory location by incrementing the operand. SHLD 0002H H L A2 D3 A2 D3 A2 D3 0001 0002 0003 0004 Memory
  • 21. Data Transfer Instructions 21 Opcode Operand Description XCHG None Exchange H-L with D-E  Thecontentsof register H areexchanged with the contents of registerD.  Thecontentsof register L areexchanged with the contents of registerE.  Example: XCHG
  • 22. XCHG: Exchange H and L with D and E Instruction Description Example Opcode Operand 22 XCHG None The contents of register H are exchanged with the contents of register D, and the contents of register L are exchanged with the contents of register E. XCHG A2 03 D3 08 D E H L D3 08 A2 03 D E H L
  • 23. Data Transfer Instructions 23 Opcode Operand Description SPHL None Copy H-L pair to the Stack Pointer (SP)  This instruction loads thecontentsof H-L pair into SP.  Example: SPHL
  • 24. SPHL: Copy H and L registers to stack pointer Instruction Description Example Opcode Operand 24 SPHL None The instruction loads the contents of the H and L registers into the stack pointer register, the contents of H register provide the high-order address and the contents of L register provide the low- order address. The contents of the H and L registers are not altered. SPHL H L SP (16) A2 D3 A2 D3
  • 25. Data Transfer Instructions 25 Opcode Operand Description XTHL None Exchange H–L with top ofstack  Thecontentsof L registerareexchanged with the location pointed out by thecontentsof the SP.  Thecontentsof H registerareexchanged with the next location (SP + 1).  Example: XTHL
  • 26. XTHL: Exchange H and L with top of stack Instruction Description Example Opcode Operand 26 XTHL None The contents of L register is exchanged with stack location pointed out by contents SP. The contents of the H register are exchanged with the next stack location (SP+1). XTHL H L A2 D3 0001 0002 0003 0004 Memory SP SP 3F 2C Registers
  • 27. Data Transfer Instructions 27 Opcode Operand Description PCHL None Load program counter with H-Lcontents  Thecontentsof registers H and L are copied into the program counter(PC).  Thecontentsof H are placed as the high-order byte and thecontentsof L as the low-order byte.  Example: PCHL
  • 28. Data Transfer Instructions 28 Opcode Operand Description PUSH Reg. pair Push register pair ontostack  Thecontents of registerpairarecopied onto stack.  SP isdecremented and thecontents of high-orderregisters (B, D, H, A) are copied intostack.  SP is again decremented and thecontents of low-order registers (C, E, L, Flags) are copied intostack.  Example: PUSH B
  • 29. Example: PUSH Instruction 29 23 06 40 06 40 A B C D E H L SP Memory Registers PUSH B SP <- SP-1 M[SP] <- B ;transfer high order bit to TOS SP <- SP-1 M[SP] <- C ;transfer low order bit to TOS 0008 0007 0006 0005 0004 0003 0002 0001 SP SP
  • 30. Data Transfer Instructions 30 Opcode Operand Description POP Reg. pair Pop stack to registerpair  Thecontents of topof stack arecopied into registerpair.  Thecontents of location pointed out by SP arecopied to the low-order register (C, E, L,Flags).  SP is incremented and thecontents of location arecopied to the high-order register (B, D, H,A).  Example: POP H
  • 31. Example: POP Instruction 31 03 06 40 06 40 A B C D E H L SP Memory Registers POP B C <- M[SP] ; transfer to low order bit from TOS SP <- SP+1 B <- M[SP] ; transfer to high order bit from TOS SP <- SP+1 0008 0007 0006 0005 0004 0003 0002 0001 SP SP
  • 32. Data Transfer Instructions 32 Opcode Operand Description OUT 8-bitport address Copy data from accumulator to a port with 8- bit address  Thecontentsof accumulatorarecopied into the I/O port.  Example: OUT 78 H
  • 33. Data Transfer Instructions 33 Opcode Operand Description IN 8-bitport address Copy data to accumulator from a port with 8- bit address  Thecontentsof I/O portare copied intoaccumulator.  Example: IN 8C H
  • 34. 34 34 1 MOV Dst,Src Copy content 1 Byte 2 MVI (R/M), 8-bit Data Load 8-bit to Register/Memory 2 Byte 3 LDA 16-bit address Load Accumulator 3 Byte 4 LDAX Rp(B/D) Load the accumulator indirect 1 Byte 13 PUSH Rp Push the register pair onto the stack 1 Byte 5 LXI Rp, 16-bit Data Load the register pair immediate 3 Byte 6 STA 16-bit address Store Accumulator 3 Byte 7 STAX Rp Store Accumulator Indirect 1 Byte 8 LHLD 16-bit address Load H and L registers direct 3 Byte 9 SHLD 16-bit address Store H and L registers direct 3 Byte 10 XCHG None Exchange H and L with D and E 1 Byte 11 SPHL None Copy H and L registers to the stack pointer 1 Byte 12 XTHL None Exchange H and L with top of stack 1 Byte 14 POP Rp Pop off stack to the register pair 1 Byte 15 OUT 8-bit port address Output from Accumulator to 8-bit port address 2 Byte 16 IN 8-bit port address Input data to accumulator from a port with 8-bit address 2 Byte Data Transfer Instructions
  • 35. Arithmetic Instructions 35  These instructions perform the operationslike:  Addition  Subtract  Increment  Decrement
  • 36. Addition 36  Any 8-bit number, or thecontentsof register, or the contents of memory location can be added to the contents of accumulator.  The result (sum) is stored in theaccumulator.  No twoother 8-bit registers can be added directly.  Example: The contents of registerB cannot beadded directly to thecontentsof register C.
  • 37. Subtraction 37  Any 8-bit number, or the contents of register, or the contents of memory location can be subtractedfrom the contents ofaccumulator.  The result is stored in theaccumulator.  Subtraction is performed in 2’s complementform.  If the result is negative, it is stored in 2’scomplement form.  No twoother 8-bit registers can be subtracted directly.
  • 38. Increment / Decrement 38  The 8-bitcontentsof a registerora memory location can be incremented or decremented by1.  The 16-bitcontentsof a register paircan be incremented or decremented by1.  Incrementordecrementcan be performed on any register or a memorylocation.
  • 39. Arithmetic Instructions 39 Opcode Operand Description ADD R M Add register or memory to accumulator  Thecontentsof registeror memoryareadded tothecontentsof accumulator.  The result is stored inaccumulator.  If theoperand is memory location, itsaddress is specified by H-L pair.  All flags are modified toreflect the resultof theaddition.  Example: ADD B or ADDM
  • 40. ADD: Add register/memory to accumulator 40 Instruction Description Example Opcode Operand ADD R/M • The contents of the operand (register or memory) are added to the contents of the accumulator and the result is stored in the accumulator. • If the operand is a memory location, its location is specified by the contents of the HL registers. • Flags are modified to reflect the result of the addition. ADD B; A = A + B ADD M; A = A + M[HL]
  • 41. Arithmetic Instructions 41 Opcode Operand Description ADC R M Add register or memory to accumulator with carry  Thecontentsof registeror memoryand Carry Flag (CY) areadded to the contents ofaccumulator.  The result is stored inaccumulator.  If theoperand is memory location, itsaddress is specified by H-L pair.  All flags are modified toreflect the resultof theaddition.  Example: ADC B or ADCM
  • 42. ADC: Add register to accumulator with carry 42 Instruction Description Example Opcode Operand ADC R/M • The contents of the operand (register or memory) and the Carry flag are added to the contents of the accumulator and the result is stored in the accumulator. • If the operand is a memory location, its location is specified by the contents of the HL registers. • Flags are modified to reflect the result of the addition. ADC B; A = A + B + CY ADC M; A = A + M[HL]+CY
  • 43. Arithmetic Instructions 43 Opcode Operand Description ADI 8-bit data Add immediate to accumulator  The 8-bitdata is added to thecontentsof accumulator.  The result is stored inaccumulator.  All flags are modified toreflect the resultof the addition.  Example: ADI 45 H
  • 44. ADI: Add immediate 8-bit with accumulator 44 Instruction Description Example Opcode Operand ADI 8-bit data • The 8-bit data (operand) is added to the contents of the accumulator and the result is stored in the accumulator. • Flags are modified to reflect the result of the addition. ADI 03; A = A + 03h
  • 45. Arithmetic Instructions 45 Opcode Operand Description ACI 8-bit data Add immediate to accumulator withcarry  The 8-bitdataand the Carry Flag (CY) areadded to the contents of accumulator.  The result is stored inaccumulator.  All flags are modified to reflect the result of theaddition.  Example: ACI 45 H
  • 46. ACI: Add immediate 8-bit to accumulator with carry 46 Instruction Description Example Opcode Operand ACI 8-bit data • The 8-bit data (operand) and the Carry flag are added to the contents of the accumulator and the result is stored in the accumulator. • Flags are modified to reflect the result of the addition. ACI 03; A = A + 03h + CY
  • 47. Arithmetic Instructions 47 Opcode Operand Description DAD Reg. pair Add register pair to H-Lpair  The 16-bitcontents of the registerpairareadded to the contents of H-L pair.  The result is stored in H-Lpair.  If the result is larger than 16 bits, then CY is set.  No other flagsare changed.  Example: DAD B
  • 48. DAD Instruction 48 02 08 02 03 A B C D E H L Registers 02 08 02 03 + 04 0B 04 0B 02 03 DAD B
  • 49. Arithmetic Instructions 49 Opcode Operand Description SUB R M Subtract register or memory from accumulator  Thecontentsof the registeror memory locationare subtracted from the contents of theaccumulator.  The result is stored inaccumulator.  If theoperand is memory location, itsaddress is specified by H-L pair.  All flags are modified toreflect the resultof subtraction.  Example: SUB B or SUB M
  • 50. SUB : Subtract register/memory from accumulator 50 Instruction Description Example Opcode Operand SUB R/M • The contents of the operand (register or memory) is subtracted from the contents of the accumulator, and the result is stored in the accumulator. • If the operand is a memory location, its location is specified by the contents of the HL registers. • Flags are modified to reflect the result of the subtraction. SUB B ; A=A-B SUB M ; A=A-M[HL]
  • 51. Arithmetic Instructions 51 Opcode Operand Description SBB R M Subtract register or memory from accumulator with borrow  Thecontentsof the registeror memory locationand Borrow Flag (i.e. CY) are subtracted from thecontentsof theaccumulator.  The result is stored inaccumulator.  If theoperand is memory location, itsaddress is specified by H-L pair.  All flags are modified toreflect the resultof subtraction.  Example: SBB B or SBB M
  • 52. SBB: Subtract source & borrow from accumulator 52 Instruction Description Example Opcode Operand SBB R/M • The contents of the operand (register or memory) and the Borrow flag are subtracted from the contents of the accumulator and the result is placed in the accumulator. • If the operand is a memory location, its location is specified by the contents of the HL registers. • Flags are modified to reflect the result of the subtraction. SBB B; A=A - (B+CY) SBB M; A=A-(M[HL]+CY)
  • 53. Arithmetic Instructions 53 Opcode Operand Description SUI 8-bit data Subtract immediate from accumulator  The 8-bitdata is subtracted from thecontents of the accumulator.  The result is stored inaccumulator.  All flags are modified to reflect the result of subtraction.  Example: SUI 45 H
  • 54. SUI : Subtract immediate 8-bit from accumulator 54 Instruction Description Example Opcode Operand SUI 8-bit data • The 8-bit data (operand) is subtracted from the contents of the accumulator and the result is stored in the accumulator. SUI 08h; A = A - 08h
  • 55. Arithmetic Instructions 55 Opcode Operand Description SBI 8-bit data Subtract immediate from accumulatorwith borrow  The 8-bitdata and the Borrow Flag (i.e. CY) is subtracted from the contents of theaccumulator.  The result is stored inaccumulator.  All flags are modified to reflect the result of subtraction.  Example: SBI 45 H
  • 56. SBI : Subtract immediate from accumulator with borrow 56 Instruction Description Example Opcode Operand SBI 8-bit data • The 8-bit data (operand) and the borrow (CY) are subtracted from the contents of the accumulator and the result is stored in the accumulator. SBI 08h; A=A - (08h+CY)
  • 57. Arithmetic Instructions 57 Opcode Operand Description INR R M Increment register or memory by 1  Thecontents of registeror memory location are incremented by 1.  The result is stored in the same place.  If theoperand is a memory location, itsaddress is specified by the contents of H-Lpair.  Example: INR B or INR M
  • 58. INR: Increment register/memory by 1 58 Instruction Description Example Opcode Operand INR R/M • The contents of the designated register or memory is incremented by 1 and the result is stored at the same place. • If the operand is a memory location, its location is specified by the contents of the HL registers. INR B;B=B+01 INR M;M[HL]=M[HL]+01
  • 59. Arithmetic Instructions 59 Opcode Operand Description INX R Increment register pair by1  Thecontentsof register pairare incremented by 1.  The result is stored in the same place.  Example: INX H
  • 60. INX : Increment register pair by 1 60 Instruction Description Example Opcode Operand INX Rp The contents of the designated register pair is incremented by 1 and the result is stored at the same place. INX D; DE=DE+0001
  • 61. Arithmetic Instructions 61 Opcode Operand Description DCR R M Decrement register or memory by 1  Thecontents of registeror memory location are decremented by 1.  The result is stored in the same place.  If theoperand is a memory location, itsaddress is specified by the contents of H-Lpair.  Example: DCR B or DCR M
  • 62. DCR: Decrement register/ memory by 1 62 Instruction Description Example Opcode Operand DCR R/M • The contents of the designated register or memory is decremented by 1 and the result is stored in the same place. • If the operand is a memory location, its location is specified by the contents of the HL registers. DCR B;B=B-01 DCR M;M[HL]=M[HL]-01
  • 63. Arithmetic Instructions 63 Opcode Operand Description DCX R Decrement register pair by1  Thecontentsof register pairaredecremented by 1.  The result is stored in the same place.  Example: DCX H
  • 64. DCX: Decrement register pair by 1 64 Instruction Description Example Opcode Operand DCX Rp The contents of the designated register pair is decremented by 1 and their result is stored at the same place. DCX B; BC=BC- 0001 DCX D; DE=DE- 0001
  • 65. DAA: Decimal Adjust Accumulator 65 Instruction Description Example Opcode Operand DAA None • The contents of the accumulator is changed from a binary value to two 4-bit BCD digits. • If the value of the low-order 4-bits in the accumulator is greater than 9 or if AC flag is set, the instruction adds 6 to the low-order four bits. • If the value of the high-order 4-bits in the accumulator is greater than 9 or if the Carry flag is set, the instruction adds 6 to the high-order four bits. DAA
  • 66. DAA Instruction 66 A B C D E H L Registers 2A 0 0 1 0 1 0 1 0 + 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1 1 Valid BCD number 3 0
  • 67. 67 67 1 ADD R/M Add register or memory, to the accumulator 1 Byte 13 DCX Rp Decrement register pair by 1 1 Byte 2 ADC R/M Add register to the accumulator with carry 1 Byte 3 ADI 8-bit data Add the immediate to the accumulator 2 Byte 4 ACI 8-bit data Add the immediate to the accumulator with carry 2 Byte 5 DAD Rp Add the register pair to H and L registers 1 Byte 6 SUB R/M Subtract the register/memory from accumulator 1 Byte 7 SBB R/M Subtract the source and borrow from accumulator 1 Byte 8 SUI 8-bit data Subtract the immediate from the accumulator 2 Byte 9 SBI 8-bit data Subtract immediate from accumulator with borrow 2 Byte 10 INR R/M Increment the register or the memory by 1 1 Byte 11 INX Rp Increment register pair by 1 1 Byte 12 DCR R/M Decrement the register or the memory by 1 1 Byte 14 DAA Decimal adjust accumulator 1 Byte Arithmetic Instructions
  • 68. Logical Instructions 68  These instructions perform logical operationson data stored in registers, memory and statusflags.  The logical operationsare:  AND  OR  XOR  Rotate  Compare  Complement
  • 69. AND, OR, XOR 69  Any 8-bitdata, or thecontentsof register, or memory location can logicallyhave  AND operation  OR operation  XOR operation with the contents ofaccumulator.  The result is stored inaccumulator.
  • 70. Rotate 70  Each bit in theaccumulatorcan be shifted either leftor right to the nextposition.
  • 71. Compare 71  Any 8-bitdata, or thecontentsof register, or memory location can be comparesfor:  Equality  GreaterThan  Less Than with the contents ofaccumulator.  The result is reflected in status flags.
  • 72. Complement 72  Thecontentsof accumulatorcan becomplemented.  Each 0 is replaced by 1 and each 1 is replaced by 0.
  • 73. Logical Instructions 73 Opcode Operand Description CMP R M Compare register or memory with accumulator  Thecontentsof theoperand (registeror memory) are compared with thecontentsof the accumulator.  Both contents are preserved.  The resultof thecomparison is shown by setting the flags of the PSW asfollows:
  • 74. Logical Instructions 74 Opcode Operand Description CMP R M Compare register or memory with accumulator  if (A) < (reg/mem): carry flag isset  if (A) = (reg/mem): zero flag isset  if (A) > (reg/mem): carry and zero flags are reset.  Example: CMP B or CMPM
  • 75. Logical Instructions 75 Opcode Operand Description CPI 8-bit data Compare immediate withaccumulator  The 8-bitdata is compared with the contentsof accumulator.  The values being compared remainunchanged.  The resultof thecomparison is shown by setting the flags of the PSW asfollows:
  • 76. Logical Instructions 76 Opcode Operand Description CPI 8-bit data Compare immediate withaccumulator  if (A) < data: carry flag isset  if (A) = data: zero flag isset  if (A) > data: carry and zero flags are reset  Example: CPI 89H
  • 77. Logical Instructions 77 Opcode Operand Description ANA R M Logical AND register or memory with accumulator  Thecontentsof theaccumulatorare logicallyANDed with thecontents of register ormemory.  The result is placed in theaccumulator.  If theoperand is a memory location, itsaddress is specified by the contents of H-Lpair.  S, Z, P are modified toreflect theresultof theoperation.  CY is resetand AC is set.  Example: ANA B or ANAM.
  • 78. Logical Instructions  Example: ANI 86H. 78 Opcode Operand Description ANI 8-bit data Logical AND immediate withaccumulator  Thecontents of theaccumulatorare logically ANDed with the 8-bitdata.  The result is placed in theaccumulator.  S, Z, P are modified to reflect the result.  CY is reset, AC isset.
  • 79. Logical Instructions  Example: ORA B or ORA M. 79 Opcode Operand Description ORA R M Logical OR register or memorywith accumulator  Thecontents of the accumulatorare logically ORed with the contents of the registeror memory.  The result is placed in theaccumulator.  If theoperand is a memory location, its address is specified by thecontents of H-L pair.  S, Z, P are modified to reflect theresult.  CY and AC arereset.
  • 80. Logical Instructions  Example: ORI 86H. 8 0 Opcode Operand Description ORI 8-bit data Logical OR immediate with accumulator  Thecontents of theaccumulatorare logically ORed with the 8-bitdata.  The result is placed in theaccumulator.  S, Z, P are modified to reflect the result.  CY and AC arereset.
  • 81. Logical Instructions  Example: XRA B or XRAM. 81 Opcode Operand Description XRA R M Logical XOR register or memorywith accumulator  Thecontentsof theaccumulatorare XORed with thecontentsof the register ormemory.  The result is placed in theaccumulator.  If theoperand is a memory location, its address is specified by the contents of H-Lpair.  S, Z, P are modified to reflect the resultof theoperation.  CY and AC arereset.
  • 82. Logical Instructions  Example: XRI 86H. 82 Opcode Operand Description XRI 8-bit data XOR immediate with accumulator  Thecontentsof theaccumulatorare XORed with the 8-bitdata.  The result is placed in theaccumulator.  S, Z, P are modified to reflect the result.  CY and AC arereset.
  • 83. Logical Instructions  Example:RLC. 83 Opcode Operand Description RLC None Rotate accumulator left  Each binary bitof theaccumulator is rotated left byone position.  Bit D7 is placed in the positionof D0 as well as in the Carry flag.  CY is modified according to bitD7.  S, Z, P,AC are notaffected.
  • 84. Logical Instruction 84 D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 0 1 0 0 0 RLC 0 1 0 1 0 0 0 1 CY 1 A:Accumulator Rotate the accumulator left
  • 85. Logical Instructions  Example:RRC. 85 Opcode Operand Description RRC None Rotate accumulatorright  Each binary bitof theaccumulator is rotated right by one position.  Bit D0 is placed in the positionof D7 as well as in the Carry flag.  CY is modified according to bitD0.  S, Z, P,AC are notaffected.
  • 86. RRC: Example 86 D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 0 1 0 0 0 CY A:Accumulator 1 0 1 0 1 0 0 0 0 Rotate the accumulator right
  • 87. Logical Instructions 56 Opcode Operand Description RAL None Rotate accumulator left throughcarry  Each binary bitof theaccumulator is rotated left byone position through the Carryflag.  Bit D7 is placed in the Carry flag, and the Carry flag is placed in the least significant positionD0.  CY is modified according to bitD7.  S, Z, P,AC are notaffected.  Example: RAL.
  • 88. RAL: Example 88 D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 1 CY A:Accumulator Rotate the accumulator left through carry 0
  • 89. Logical Instructions 89 Opcode Operand Description RAR None Rotate accumulator right throughcarry  Each binary bitof theaccumulator is rotated right by one position through the Carryflag.  Bit D0 is placed in the Carry flag, and the Carry flag is placed in the most significant positionD7.  CY is modified according to bitD0.  S, Z, P,AC are notaffected.  Example: RAR.
  • 90. RAR: Example 90 D7 D6 D5 D4 D3 D2 D1 D0 1 0 1 0 1 0 0 0 CY A:Accumulator 1 0 1 0 1 0 0 0 0 Rotate the accumulator right through carry 1
  • 91. Logical Instructions 91 Opcode Operand Description CMA None Complement accumulator  Thecontentsof theaccumulatorare complemented.  No flags areaffected.  Example: CMA.
  • 92. CMA: Complement accumulator 92 Instruction Description Example Opcode Operand CMA None The contents of the accumulator are complemented. No flags are affected. CMA A CMA 2A 0 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 D 5
  • 93. Logical Instructions 93 Opcode Operand Description CMC None Complement carry  The Carry flag iscomplemented.  Noother flags areaffected.  Example: CMC.
  • 94. Logical Instructions 94 Opcode Operand Description STC None Set carry  The Carry flagis set to 1.  Noother flags areaffected.  Example: STC.
  • 95. Branching Instructions 95  The branching instruction alter the normalsequential flow.  These instructionsaltereither unconditionallyor conditionally.
  • 96. Branching Instructions 96 Opcode Operand Description JMP 16-bit address Jump unconditionally  The program sequence is transferred to the memory location specified by the 16-bit address given in the operand.  Example: JMP 2034 H.
  • 97. JMP: Jump unconditionally 97 Memory Address Instructions 0000H MVI A,05 0002H MOV B,A 0003H MOV C,B 0004H JMP 0009 0007H ADI 02 0009H SUB B 000AH HLT Memory Label Instructions MVI A,05 MOV B,A MOV C,B JMP L1 ADI 02 L1: SUB B HLT
  • 98. Branching Instructions 98 Opcode Operand Description Jx 16-bit address Jump conditionally  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 thePSW.  Example: JZ 2034 H.
  • 99. Jump Conditionally 99 Opcode Description Status Flags JC Jump if Carry CY = 1 JNC Jump if No Carry CY = 0 JP Jump if Positive S = 0 JM Jump if Minus S = 1 JZ Jump if Zero Z = 1 JNZ Jump if No Zero Z = 0 JPE Jump if Parity Even P = 1 JPO Jump if Parity Odd P = 0
  • 100. Branching Instructions 10 0 Opcode Operand Description CALL 16-bit address Call unconditionally  The program sequence is transferred to the memory location specified by the 16-bit address given in the operand.  Before the transfer, the address of the next instruction after CALL (the contents of the program counter) is pushed onto thestack.  Example: CALL 2034 H.
  • 101. CALL: Call Unconditionally Line Instruction Address PC 1 LXI H,1002 [0000] [0003] 2 LXI D,3002 [0003] [0006] 3 CALL ADD1 [0006] [0009] 4 LXI B,4002 [0009] [000C] 5 ADD1:MOV A,D [000C] [000D] 6 ADD H [000D] [000E] 7 RET [000E] 05 [2008] [2007] [2006] [2005] 09 00 SP SP 00 09 SP SP
  • 102. CALL: Call Unconditionally Line Instruction Address PC 1 LXI H,1002 [0000] [0003] 2 LXI D,3002 [0003] [0006] 3 CALL ADD1 [0006] [0009] 4 LXI B,4002 [0009] [000C] 5 ADD1:MOV A,D [000C] [000D] 6 ADD H [000D] [000E] 7 RET [000E] 05 [2008] [2007] [2006] [2005] 09 00 SP SP 00 09 SP SP
  • 103. Branching Instructions 103 Opcode Operand Description Cx 16-bit address Call conditionally  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 thePSW.  Before the transfer, theaddressof the next instruction after the call (the contents of the program counter) is pushed onto thestack.  Example: CZ 2034 H.
  • 104. Call Conditionally 10 4 Opcode Description Status Flags CC Call if Carry CY = 1 CNC Call if No Carry CY = 0 CP Call if Positive S = 0 CM Call if Minus S = 1 CZ Call if Zero Z = 1 CNZ Call if No Zero Z = 0 CPE Call if Parity Even P = 1 CPO Call if Parity Odd P = 0
  • 105. Branching Instructions 105 Opcode Operand Description RET None Return unconditionally  The program sequence is transferred fromthe subroutine to the callingprogram.  The two bytes from the top of the stack are copied into the program counter, and program execution begins at the newaddress.  Example: RET.
  • 106. Branching Instructions 10 6 Opcode Operand Description Rx None Call conditionally  The program sequence is transferred from the subroutineto thecalling program based on the specified flag of thePSW.  The two bytes from the top of the stack are copied into the program counter, and program execution begins at the newaddress.  Example: RZ.
  • 107. Return Conditionally 107 Opcode Description Status Flags RC Return if Carry CY = 1 RNC Return if No Carry CY = 0 RP Return if Positive S = 0 RM Return if Minus S = 1 RZ Return if Zero Z = 1 RNZ Return if No Zero Z = 0 RPE Return if Parity Even P = 1 RPO Return if Parity Odd P = 0
  • 108. Branching Instructions 10 8 Opcode Operand Description RST 0 – 7 Restart (Software Interrupts)  The RST instruction jumps thecontrol tooneof eight memory locations depending upon thenumber.  Theseare used as software instructions in a program to transfer program execution to one of the eight locations.  Example: RST 3.
  • 109. Restart Address Table 10 9 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
  • 110. Control Instructions 110  Thecontrol instructionscontrol theoperation of microprocessor.
  • 111. Control Instructions 111 Opcode Operand Description NOP None No operation  No operation isperformed.  The instruction is fetched and decoded butno operation isexecuted.  Example: NOP
  • 112. Control Instructions 112 Opcode Operand Description HLT None Halt  The CPU finishes executing the currentinstruction and halts any furtherexecution.  An interruptor reset is necessary toexit from the halt state.  Example: HLT
  • 113. Control Instructions 113 Opcode Operand Description DI None Disable interrupt  The interruptenable flip-flop is resetand all the interruptsexcept the TRAP aredisabled.  No flags areaffected.  Example: DI
  • 114. Control Instructions 114 Opcode Operand Description EI None Enable interrupt  The interruptenable flip-flop is setand all interrupts areenabled.  No flags areaffected.  This instruction is necessary to re-enablethe interrupts (exceptTRAP).  Example: EI
  • 115. Control Instructions 115 Opcode Operand Description RIM None 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
  • 117. RIM: Read Interrupt Mask 117 Instruction Description Example Opcode Operand RIM None This is a multipurpose instruction used to 1. Read the status of interrupts 7.5, 6.5, 5.5 2. Read serial data input bit. It reads eight bits from accumulator with following interpretations. RIM D7 D6 D5 D4 D3 D2 D1 D0 A:Accumulator 5.5 6.5 7.5 IE I5 I6 I7 SID To read interrupt mask Interrupt Masked if bit=1 Interrupt Enable Flag: 1=enable; 0=disable To identify pending interrupts 1=pending interrupt 0=no pending interrupt To receive serial data
  • 118. Control Instructions 118 Opcode Operand Description SIM None Set Interrupt Mask  This is a multipurpose instruction and used to implement the 8085 interrupts 7.5, 6.5, 5.5, andserial dataoutput.  The instruction interprets theaccumulatorcontentsas follows.  Example: SIM
  • 120. SIM Instruction 120 D7 D6 D5 D4 D3 D2 D1 D0 A:Accumulator M5.5 M6.5 M7.5 MSE R7.5 X SDE SOD To set mask for RST7.5,RST 6.5, RST5.5 Interrupt Masked if bit=1 Mask Set Enable: if 0, bits 0-2 are ignored if 1, mask is set Serial Output Data It is used to transmit o/p bits. Ignored if D6=0 Reset RST 7.5 if D4=1 Serial Data Enable If D6=1; bit D7 is output to SOD Latch
  • 121. SIM Instruction 121 D7 D6 D5 D4 D3 D2 D1 D0 Accumulator M5.5 M6.5 M7.5 MSE R7.5 X SDE SOD Example 1: MVI A,08H SIM D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0 1 0 0 0

Editor's Notes

  1. This is a 3-byte instruction, the second byte specifies the low-order address and the third byte specifies the high-order address.
  2. This is a 3-byte instruction, the second byte specifies the low-order address and the third byte specifies the high-order address.