CS II Chapter 2
CS II Chapter 2
Example : INR B
This instruction will increment the content of register B by 1
Example : ADD C
This instruction will add the content of register C to accumulator
without modifying the contentof C
REGISTER INDIRECT ADDRESSING :
Example : ADD M
This instruction will add the content of memory location whose address
is placed in HL register pair to accumulator without modifying the
content of memory location
IMMEDIATE ADDRESSING :
• Data (8 or 16-bit) appears immediately after opcode of instruction.
• In these instructions actual data is specified within the instruction.
• These may be 2 to 3 byteinstructions.
Example : CMA
This instruction complements the content of accumulator. Result is
placed in accumulator.
Example : RLC
This instruction rotates the content of accumulator to left by 1-bit
position without modifying the content of memory location
GROUPING OF INSTRUCTIONS OF 8085
ACCORDING TO LENGTH
• Machine Cycle: The time required to complete any operation which is a sub part
of an instruction.
The machine cycle consist of number of T-state.
Machine cycle operation like Opcode fetch, MR, MW, Acknowledge
Instruction: MVI M, 88 H
Instruction: STAX D
Instruction: SBB B
Example:
Instruction: SBI 21 H
When executed it will subtract 21 H from accumulator contents and store the
result in accumulator.
II] ARITHMETIC GROUP
11) INR –INCREMENT CONTENTS OF REGISTER/MEMORY BY 1
Format: INR r / INR m
Addressing : Register
Group: Arithmetic
Bytes: 1 Byte
Flags: All flags except Carry flags are modified. The contents of operand are
incremented by one.
e.g. let E reg content be 2F H
INR E
After execution 0010 1111+1 = 0011 0000
so E= 30 H
II] ARITHMETIC GROUP
12) DCR –DECREMENT CONTENTS OF REGISTER/MEMORY BY 1
Format: DCR r / DCR m
Addressing : Register
Group: Arithmetic
Bytes: 1 Byte
Flags: All flags except Carry flags are modified. The contents of operand are
drecremented by one.
e.g. let E reg content be 2F H
DCR E
After execution 0010 1111 -1 = 0010 1110
so E= 2E H
II] ARITHMETIC GROUP
4B 0100 1011
06 0000 0110
51 0101 0001
5 1
III] LOGICAL GROUP INSTRUCTION
1. ANA r (Logical AND reg. with Accumulator)
ANA M ( Logical AND memory with Accumulator)
Addressing: Register
Group: logical
Byte: 1 Flags :S, Z, P
e.g. The instruction ANI 3F H when executed will store result of ANDing 3F H with
Accumulator.
III] LOGICAL GROUP INSTRUCTION
1. ORA r (Logical OR reg. with Accumulator)
ORA M ( Logical OR memory with Accumulator)
Addressing: Register
Group: Logical
Byte: 1 Flags :S, Z, P
e.g. The instruction ORI 4C H when executed will store result of ORing 4CH with
Accumulator.
The result is stored in accumulator.
III] LOGICAL GROUP INSTRUCTION
1. XRA r (Logical EX-OR reg. with Accumulator)
XRA M ( Logical EX-OR memory with Accumulator)
Addressing: Register
Group: Logical
Byte: 1 Flags :S, Z, P
e.g. The instruction XRI FF H when executed will store result of EX-ORing FF H with
Accumulator.
III] LOGICAL GROUP INSTRUCTION
• CMA – (COMPLEMENT THE ACCUMULATOR)
Format ҧ A
Addressing – Implicit
group – logical
byte- 1 Flag- No flags are affected.
This instruction complements the accumulator contents. The result is stored in
accumulator.
e.g. Let A= 57 H 0101 0111
CMA
After execution 1010 1000
so A=A8 H
III] LOGICAL GROUP INSTRUCTION
III] LOGICAL GROUP INSTRUCTION
III] LOGICAL GROUP INSTRUCTION
III] LOGICAL GROUP INSTRUCTION
III] LOGICAL GROUP INSTRUCTION
III] LOGICAL GROUP INSTRUCTION