Sunteți pe pagina 1din 16

8085

Addressing
Modes

Dayanand K
Addressing Modes
 The number & Different kind of ways the
programmer can refer to data stored in the
memory
 The different ways that a microprocessor
can access data are referred to as
Addressing modes
1. Immediate Addressing mode
2. Register Addressing mode
3. Direct Addressing mode
4. Indirect Addressing mode
5. Implied/Implicit Addressing mode
1. Immediate Addressing Mode
8 or 16 bit data can be specified as a part of
Instruction
The instruction having ‘I’ (Immediate) letter
fall under this category
Examples :
MVI C,25H
MVI M,7CH
LXI D,245EH
ADI 87H
1. Immediate Addressing Mode
Example 1:
General Format :
1. MVI <Reg>,<8 bit data>
<8-bit data> is immediately Copied into Register < Reg>

Specific Instruction:
1. MVI C,25H
Here Register is ‘C’. Data is 25 H

BEFORE EXECUTION AFTER EXECUTION


C 8-bit Data C 8-bit Data

XX 25 25 25
1. Immediate Addressing Mode
Example 2:
General Format :
LXI <Reg_Pair>,<16-Bit Data>
<16-bit data> is immediately Copied into Register Pair
<Reg_Pair>

Specific Instruction:
2. LXI H,245EH
Here Register Pair is ‘HL’. Data is ‘245E’ H

BEFORE EXECUTION AFTER EXECUTION


H L 16-bit Data H L 16-bit Data

XX XX 245E 24 5E 245E
2. Register Addressing Mode
 Data transfer between Registers
 Specifies the Source ,Destination or Both
Operand in an 8085 registers
 Faster Execution (it is not necessary to access
memory locations )
Examples :
MOV A,B
ADD E
SPHL
XCHG
INR L
2. Register Addressing Mode
Example 1:
General Format :
1. MOV <Reg_dest>,<Reg_Src>
The 8-bit DATA Content in Source Register<Reg_Src-8> is
immediately Copied into Destination Register <Reg_Dest-8>

Specific Instruction:
1. MOV A,B
Here Source Register is ‘B’ and Destination Register is ‘A’
if Register ‘B’ holds a content of 25H before Execution then.
BEFORE EXECUTION AFTER EXECUTION
A B A B

XX 25 25 25
2. Register Addressing Mode
Example 2:
General Format :
ADD <Reg-src>
<8-bit data> Content in Register <Reg_Src> is Added to <8-bit Data>
content of Accumulator (Reg A>
[A] <= [A] + [Reg_Src]
CARRY IS GENERATED THROUGH CARRY FLAG=0/1

Specific Instruction:
2. ADD E
<8-bit data> Content in Register <E> is Added to <8-bit Data> content of
Accumulator (Reg A>
[A] <= [A] + [E]
BEFORE EXECUTION AFTER EXECUTION
A E A A E A

24 35 24 59 35 59

CARRY FLAG 0/1 CARRY FLAG 0


3. Direct Addressing Mode

Specifies 16 bit address of the operand within


instruction itself
Second & third bytes of instruction contain 16 bit
 Note : In interface IO port address is only 8 bit

Examples :
LDA 4100H
LHLD 1111H
IN 75H
3. Direct Addressing Mode
Example 1:
General Format :
LDA <16_Bit_Mem_Addr>
<8-bit data> Content in Memory Location in specified address
<16_Bit_Mem_Addr> is Loaded into content of Accumulator
<Reg A>

Specific Instruction:
1. LDA 4100H
<8-bit data> Content in Memory Location in specified address
<4100H> is Loaded into content of Accumulator <Reg A>

BEFORE EXECUTION AFTER EXECUTION


A 4100 A 4100

XX 5E 5E 5E
3. Direct Addressing Mode
Example 2:
General Format :
IN <8_Bit_IO_Addr>
<8-bit data> Content in Input Device whose address
<8_Bit_IO_Addr> is Loaded into content of Accumulator (Reg
A>

Specific Instruction:
2. IN 75H
<8-bit data> Content in Input Device whose address <75H> is
Loaded into content of Accumulator (Reg A>

BEFORE EXECUTION AFTER EXECUTION


A 75 A 75

XX 59 59 59
4. Indirect Addressing Mode
The memory address where the operand
located is specified by the contents of a
register pair
Example Program:
LDAX B
MOV M,D
Immediate Indirect MVI M,55H
Register Indirect ADC M [A A +Cy+(M)]
DCR M [(HL)(HL)+1]
PUSH PSW
4. Indirect Addressing Mode
Example 1:
General Format :
LDAX <Reg_Pair>
<Reg_Pair> points the memory location <16_bit_Address>
where the required content of<8-bit data> is present and is
Loaded into content of Accumulator <Reg A>

Specific Instruction:
1. LDAX B
<Reg_Pair> ‘BC’ points the memory location
<16_bit_Address> where the required content of<8-bit data> is
present and is Loaded into content of Accumulator <Reg A
BEFORE EXECUTION AFTER EXECUTION
B C B C
41 00 41 00
A 4100 4100
A
XX
5E 5E 5E
4. Indirect Addressing Mode
Example 2:
General Format :
MVI M, <8-Bit_data>
<HL Pair> points the memory location <16_bit_Address> which is
Represented as Virtual REG ‘M’. The immediate <8-bit data> present in
the instruction is loaded into the Virtual Memory Pointer M <16_bit_
Memory_Address> Pointed by HL pair.
Note: Reg ‘M’ always Points HL pair only. Changes in HL pair content can
affect the address of Memory Pointe ‘M”

Specific Instruction:
2. MVI M,75H
If <Reg_Pair> ‘HL’ points the memory location <4150> where the
required content of<8-bit data> is present. The Location is pointed by M.
BEFORE EXECUTION AFTER EXECUTION
H L H L
41 50 41 50
4150 4150
M 8-bit data 8-bit data
M
XX 5E 5E 75 75
75
5. Implied/Implicit Addressing Mode
Opcode implicitly specifies the address of
the operands or registers
Examples : Examples :
CMA -Complement A
CMC - Complement Carry Flag
STC -Set Carry Flag
X. Null Addressing Mode
Opcode specifies the address of the
operands
Examples : Examples :
EI DI
NOP HLT
SIM RIM

S-ar putea să vă placă și