There are four types of addressing modes: immediate, register, direct, and indirect. Immediate mode embeds the operand in the instruction itself, requiring no memory reference. Register mode uses CPU registers to hold operands, allowing for very short instructions but limiting the number of registers. Direct mode specifies the exact memory address of the operand, requiring a single memory reference. Indirect mode specifies the memory address where the effective address of the operand is stored, requiring multiple memory references to fetch the operand. Register mode is the fastest as it only requires a small address field and no memory references. Addressing modes allow for program relocation, use of pointers in memory, and reduction in instruction size.
2. Addressing modes
The different ways in which location of an
operand is specified in an instruction are
referred to as “Addressing Modes”.
Types:
Immediate addressing mode
Direct addressing mode
Register addressing mode
indirect addressing mode
3. IMMEDIATE ADDRESSING
In this mode the operand is specified in
instruction itself.
Operand itself is provided in the instruction
rather than its address.
The immediate data may be 8-bit or 16-bit in
size.
The source operand is a constant.
4. Contd...
One of the operand is mentioned directly.
Data is available as a part of instruction.
Data is 8 0r 16 bit long.
No memory reference is needed to fetch data
instruction
opcode operand
6. Register Addressing Mode
Both the operands are in registers
No memory access
Limited number of registers
Very small address field is needed to address
registers.
Shorter instructions
In the register mode the operands are in
registers that resides inside the CPU.
7. Contd...
Register addressing mode involves the use of
registers to hold the data to be manipulated.
Source/Destination Can Be One OfThe 8086
Registers
Operand is held in register named in address
field
9. Example
Mov ah,1 mov ah,2
Int 21h int 21h
Mov bx,ax
Mov ah,1
Int 21h
Add ax,bx register address.....
Mov dx,ax
10. DIRECT ADDRESSING
Direct addressing mode, the data is in a ram
memory location whose address is known,
and this address is given as a part of the
instruction.
Address field contains address of operand
Effective address(EA)=address field(A)
e.g.ADD A
Add contents of cell A to accumulator
11. Contd...
The memory address is specified where the
actual operand is.
Look in memory at address A for operand
Single memory reference to access data
No additional calculations to work out effective
address
Limited address space
14. Indirect addressing mode
The instruction specifies the indirect address
where the effective address of the operand is
placed.
In this mode address field of an instruction give
the address where the E.A is stored in
memory . Control fetch the instruction from
memory and uses its address part to access
memory again to read the E.A.
15. Contd...
The memory address is specified where the
actual address of operand is placed.
Large address
space 2n where n=word length May be nested,
multilevel, case added e.g EA =(((A)))
Multiple memory accesses to find operand
Hence slower.
17. Which Mode is fastest? Why?
Register addressing mode
Direct addressing modes require more bits to
represent address of operand
Memory reference require 20 bits
Limited number of registers
Very small address field needed
Shorter instructions
Faster instruction fetch
Register reference require only 2 or 3 bits .
18. Why Addressing Modes are used
Program relocation
as pointer to memory
to reduce the number of bits in the
addressing field of the instruction