The instruction system of MCS-51 microcontroller has seven addressing modes, which are:
I. Immediate Addressing
Immediate addressing is to put the operand immediately after the operand, and the operand together with the operand in the instruction code segment, and at the time of the program, the program will directly call the operand without going to the other address units to get the corresponding operand, and the operand written in the instruction is also called immediate address, which is also called immediate address. The operands written in the instruction are also called immediate numbers.
Two, direct addressing
Direct addressing in the instruction format of the address of the field directly points to the address of the operand in memory. Since the address of the operand is given directly without some kind of transformation, this addressing method is called direct addressing. The operands involved in the operation and the address of the main memory where the result of the operation is stored are given directly in the instruction, i.e., the effective address is given directly in the instruction.
Three, register addressing
Register addressing refers to the operand in the register, by the value of the rrr three bits in the instruction opcode and the state of RS1 and RS0 in the PSW, select a register in the working register area, and then carry out the corresponding instruction operation.
Four, register indirect addressing
Register indirect addressing is to specify the contents of the register for the address, by the address of the specified cell content as the operand.MCS-51 provides R0 or R1 for indirect addressing register, it can address the internal RAM low address of the 128-byte cell content. The data pointer (DPTR) can also be used as an indirect addressing register to address the 64K bytes of external data memory, but this addressing method cannot be used to address special function registers.
V. Relative Addressing
Relative addressing takes the current value of the program counter PC (the value in R15) as the base address, and the address marker in the instruction as the offset, and adds the two together to get the effective address of the operand.
VI. Variable Addressing
The sum of the contents of the variable address register (usually a displacement) and the address given in the address code part of the instruction (usually the first address) is used as the address of the operand to obtain the desired operand is called variable addressing.
Seven, bit addressing
The addressing method of bit operation on the contents of the bit address is called bit addressing. Since only the internal RAM and some of the special function registers in the microcontroller have bit addresses, bit addressing can only address the two spaces with bit addresses.
Expanded Information:
MCS-51 Microcontroller: The MCS-51 Microcontroller is the world's first microcontroller to be able to address a specific function. p>MCS-51 microcontroller is an integrated circuit chip, is the use of ultra-large-scale integrated circuit technology with data processing capabilities of the central processor CPU, random memory RAM, read-only memory ROM, a variety of I/O ports and interrupt system, timer/timer and other functions (pulse-width modulation circuits, analog multiplexers, A/D converters, and other circuits) is integrated into a single piece of silicon constitutes a small and complete computer system. A small but complete computer system.
Baidu Encyclopedia - MCS-51 Microcontroller