Addressing Modes (Part 1)
Addressing Modes (Part 1)
Addressing Modes (Part 1)
The term addressing mode refers to the way in which the operand of an instruction is specified.
Information contained in the instruction code is the value of the operand or the address of the
result/operand.
1. Immediate mode
2. Direct addressing
3. Indirect addressing
4. Register instructions
5. Register specific
6. Indexed addressing
1. IMMEDIATE ADDRESSING :
A ‘#’ character is put before the data, to identify it as a data value and not as an address.
The destination register to which the constant data must be copied should be the same size as the
operand mentioned in the instruction.
Immediate Addressing is very fast as the data to be loaded is given in the instruction
itself.
MOV A, #35H :- Move the immediate data 35H given in the instruction to A-register.
MOV DPTR, #3000H :- Load the immediate 16-bit constant given in the instruction in
DPTR (Data pointer).
2. DIRECT ADDRESSING :
In direct addressing mode, the address of the data is directly specified in the instruction. The
direct address can be the address of an internal data RAM location (00H to 7FH) or address of
special function register (80H to FFH).
E.g.
MOV A, 35 H :- This instruction will move the RAM location 35H to A-register
MOV R0,89H : Here 89H is the address of a special function register TMOD
MOV A,80H or MOV A,P0: Move contents of Port 0 (SFR at address 80H) to A