8086 寻址方式
Addressing modes are the one which the where the operand (source or destination) are stored, i.e. any memory location or any internal register.
寻址模式是存储操作数(源或目标)的模式,即任何存储位置或任何内部寄存器。
There are a few categories of addressing modes which are as follows:
寻址模式分为以下几类:
Immediate Addressing mode
立即寻址模式
Register Addressing mode
寄存器寻址模式
Data Memory Addressing Modes
数据存储器寻址模式
Program memory Addressing modes and
程序存储器的寻址模式和
Stack memory addressing mode
堆栈存储器寻址模式
1)立即寻址模式 (1) Immediate Addressing Mode)
In this addressing mode, the operands are specified within the instructions. What this means is that the instruction will either contain the values itself or will contain the operands whose values are required.
在这种寻址模式下,操作数在指令中指定。 这意味着指令要么包含值本身,要么包含其值是必需的操作数。
Example:
例:
MOV AL, 28H
ADD AX, 2314H
2)寄存器寻址模式 (2) Register Addressing Mode)
In this type of addressing mode, the operands (or the values) are stored within any of the internal registers itself. So, the processing on these operands is done either in those registers itself or by shifting their values to some other registers.
在这种寻址模式下,操作数(或值)存储在任何内部寄存器本身中。 因此,对这些操作数的处理既可以在这些寄存器本身中完成,也可以通过将它们的值转移到其他寄存器中来完成。
Some examples of Register Addressing mode are:
寄存器寻址模式的一些示例包括:
ADD AX, BX
MOV AL, BL
SUB BL, AL
3)数据存储器寻址模式 (3) Data memory addressing modes)
In these types of addressing modes, the offset address of the operands is mentioned in the instructions. So, in the Data Memory Addressing mode, first the offset address is calculated after that memory location is calculated, and then the data stored at that location is fetched.
在这些类型的寻址模式中,指令中提到了操作数的偏移地址。 因此,在数据存储器寻址模式下,首先在计算出该存储器位置之后计算偏移地址,然后取出该位置存储的数据。
Some examples of the Data memory Addressing modes are:
数据存储器寻址模式的一些示例如下:
MOV AL, [2000H]
MOV AL, [BX]
The Data memory addressing mode is further categorized into various types about which we will discuss in the upcoming articles.
数据存储器寻址模式进一步分为各种类型,我们将在后续文章中讨论这些类型。
4)程序存储器寻址模式 (4) Program Memory Addressing Mode)
These types of addressing modes are used in branch instructions like JMP or CALL instruction.
这些类型的寻址模式用于JMP或CALL指令等分支指令中。
Example:
例:
JMP 0006H
Note: The Data memory addressing mode and the Program Memory Addressing mode are further categorized into various types about which we will discuss in the upcoming articles.
注意:数据存储器寻址模式和程序存储器寻址模式进一步分为各种类型,我们将在后续文章中讨论这些类型。
5)堆栈存储器寻址模式 (5) Stack Memory Addressing Mode)
The stack memory addressing mode is used whenever you perform a push or pop operation. Always a word will be entered or popped from the stack in this addressing mode, and the value of the Stack Pointer (SP) will be incremented or decremented accordingly. The higher byte of data will be stored at SP-1 location and the lower byte of data will be stored at the SP-2 memory location.
每当执行推入或弹出操作时,都会使用堆栈存储器寻址模式。 在此寻址模式下,始终会在堆栈中输入或弹出一个字,并且堆栈指针(SP)的值将相应增加或减少。 数据的高字节将存储在SP-1位置,数据的低字节将存储在SP-2存储器位置。
Example:
例:
PUSH BX
Here, suppose BX=1234H and SP=2000H
So, the byte 34H will be stored at 1999H and byte 12H will be stored at 1998H location.
因此,字节34H将存储在1999H中,而字节12H将存储在1998H中。
8086 寻址方式