Addressing Modes of 8051 Microcontroller YASH PAL, April 15, 2026April 15, 2026 Addressing Modes of 8051 Microcontroller – Before learning the Addressing modes of 8051, we need to study the instruction set of the 8051 microcontroller. Like the microprocessors, the 8051 microcontroller has its own instruction set.All the Assembly language programs are written as a sequence of text lines. Each line is an instruction to the microprocessor or the microcontroller, a directive to the assembler, or a combination of the two. The syntax of a line of 8051 microcontroller program code is shown in the figure below.Syntax of a program code lineAs shown in the figure above, the syntax of an 8051 line contains a label, an instruction, and comments. A label is a name given to a memory location. A label is a name given to the memory location. Comments are included by the programmer to explain the instruction’s operation. Instruction is the coded set containing the opcode and the operand.Instruction Syntax – An 8051 microcontroller has its own instruction set. The instruction is the coded information. This contains the opcode and operand. It is defined by the manufacturers of the 8051 microcontroller. When a program is executed by an 8051 microcontroller, every instruction is converted into a unique machine language binary code. This code operates the 8051 internal circuitry. There are two distinct parts of the 8051 microcontroller instructions: Opcode and Operand. Operand field is again classified into two parts: source and destination. An 8051 Microcontroller instruction syntax is shown in the figure below.8051 instruction syntaxAddressing Modes of the 8051 MicrocontrollerThe way the data source of destination addresses is given in an instruction determines the addressing mode. There are four addressing modes of the 8051 microcontroller.Immediate Addressing ModeRegister Addressing ModeDirect Addressing ModeIndirect Addressing ModeImmediate Addressing ModeIn this addressing mode, the 8-bit or 16-bit data is specified in the instruction itself as its one operand (source). Examples of this addressing mode are as follows:MOVA, #02H; Copy the immediate data 02H to register A.MOVDPTR, 03050H; copy the immediate data 3050H to the DPTR register.Register Addressing ModeCertain register names may be used as part of the opcode as the source or destination of data. Examples of this addressing mode are as follows:MOVA, R5; copy data from register R5 to register A.MOVR0, A; copy data from register A to register R0.Direct Addressing ModeDirect addressing mode is so named because the value to be stored in memory is obtained by directly retrieving it from another memory location. The SFRs and all 128 bytes of internal RAM may be addressed directly using a single byte address. Examples are as follows:MOVA, 30H; copy data from RAM address 30H to register A.MOVR0, 12H; copy data from RAM address 12H to register R0.MOV8CH, R7; copy data from register R7 to Timer 0 high byteIndirect Addressing ModeIndirect addressing mode is a very powerful addressing mode. It provides an exceptional level of flexibility. It uses a register to hold the final address, known as the pointing register. The instruction for indirect addressing mode is the ‘at’ sign @. Examples are as follows.MOVA, @ R0; copy the data of the address in R0 to register A.MOV@ R1, 35H; copy the data 35H to the address in register R1. engineering subjects Microprocessor microprocessor