8051 Addressing Modes:

The 8051 Addressing Modes architecture supports several distinct physical address spaces.

  1. On – chip program memory
  2. On – chip data memory
  3. External program memory
  4. External data memory
  5. On-chip special function registers

The most of the instructions can operate with variables from these physical address spaces.. Now we will see how to access variables from different physical and logical address spaces with the help of different Addressing modes.

Register Addressing :

The 8051 can access eight “working registers” (R0—R7). Three bit code within the instruction selects one of the eight registers from the selected register The programmer can select a register bank by modifying bits 4 and 3 in the PSW.

8051 Addressing Modes

Direct Byte Addressing :

Direct addressing can access any on chip variable or hardware register. i.e. on chip RAM and special function register. The most significant bit of the address decides whether it is a location within on chip RAM (MSB = 0) or in special function register (MSB = 1).

8051 Addressing Modes

Register Indirect Addressing :

In this addressing mode R0 and R1 of each register bank can be used as an index or pointer register. R0 and R1 point to the contents in the.

8051 Addressing Modes

Immediate Addressing :

In this addressing mode source operand is a constant rather than a variable. So the constant can be incorporated in the instruction. Sign “#” indicates it is a immediate addressing mode.

8051 Addressing Modes

Register Specific :

Inherent in the instruction, these refer to a specific register such as accumulator or DPTR.

8051 Addressing Modes

Index :

Only program memory can be accessed in the index addressing. Either the DPTR or PC can be used as an index register.

8051 Addressing Modes