这些不同的方法就称为寻址模式。
本文后面讨论其他寻址模式的使用方法。
The use of other addressing modes is covered later in this article.
清单2中的第18行演示内存直接寻址模式。
Line 18 in Listing 2 illustrates the memory indirect addressing mode.
有两种寻址模式实际上根本就不会访问内存。
There are actually two addressing modes that don't access memory at all.
访问主存最显而易见的寻址模式称为直接寻址模式。
The most obvious addressing mode for accessing main memory is called direct addressing mode.
GAS中基索引寻址模式的一般形式如下。
The general form of base indexed addressing in GAS is as follows.
在基指针寻址模式中,寄存器中保存的是基址,数字是偏移量。
In base-pointer addressing mode, the register has the base address and the literal number has the offset.
这就像是直接寻址模式的最终地址在汇编或链接时就知道了一样。
It is similar to direct addressing mode in that the final address is known at either assemble or link time.
寄存器间接寻址模式使用一个寄存器来指定内存访问的整个地址。
The register indirect addressing mode uses a register to specify the whole address for the memory access. This is used for numerous situations, including, but not limited to
最后,在索引寄存器间接寻址模式中,基址和索引都保存在寄存器中。
Finally, in indexed register indirect addressing mode, both the base and the index are stored in registers.
在寄存器寻址模式中,我们也不会访问主存的内容,而是访问寄存器。
In register mode, rather than accessing the contents of main memory, you access registers.
在开始讨论寻址模式之前,让我们首先来回顾一下计算机内存的概念。
Before getting into addressing modes, let's review computer memory concepts.
索引寻址模式对于全局变量访问数组元素来说是最为有效的一种方式。
The indexed addressing mode makes the most sense as a way to access array elements for global variables.
稍微简单的一种模式是相对寻址模式,它会根据当前程序计数器来计算地址。
A similar mode is relative addressing mode, which calculates the address based on the current program counter.
所有实际的处理都发生在寄存器之间(或寄存器和立即寻址模式操作数之间)。
All of the actual processing takes place between registers (or between registers and immediate-mode operands).
它们之所以被视为不同的寻址模式,原因在于它们可能根据处理器采用了不同的实现。
They are considered different addressing modes because they may be implemented differently based on the processor.
因此,使用基指针寻址模式,我们可以指定寄存器x作为基指针,8作为偏移量。
So, using base-pointer addressing, you would specify register X as the base pointer and 8 as the offset.
在这两种汇编器中,寄存器的名称是一样的,但是因为寻址模式不同,使用它们的语法是不同的。
In both the assemblers, the names of registers remain the same, but the syntax for using them is different as is the syntax for addressing modes.
这里使用内存间接寻址模式(第31行)访问命令表,还使用了ESI(和EDI)中的偏移量和一个乘数。
Here, memory indirect addressing mode (line 33) is used to access the command table along with an offset in ESI (and EDI) and a multiplier.
清单4演示了基间接寻址模式(第64行),也就是首先取得一个基地址,然后在它上面加一个偏移量,从而到达最终的地址。
Listing 4 illustrates the base indirect addressing mode (line 64), so called because you start with a base address and add an offset to it to arrive at a final address.
为了解寻址模式对于PowerPC处理器上的加载和存储指令是如何工作的,我们必须先要对PowerPC指令格式有点了解。
To learn how addressing modes work for load and store instructions on PowerPC processors, you must first understand a little bit about the PowerPC instruction format.
在立即寻址模式中,要使用的数据是指令的一部分(例如li指令就表示“立即加载”,这是因为要加载的数字就是这条指令本身的一部分)。
In immediate mode, the data to be used is part of the instruction (for example, the li instruction stands for "load immediate," because the number to be loaded is part of the instruction itself).
因此,如果使用两个传输,则支持对模块寻址,如下面两个模式所示。
So addressing the module needs to be enabled when using dual transport, as shown in the two patterns below.
在实践中,这经常通过使用XML模式并结合服务身份确认、寻址以及业务数据来实现。
In practice, this is often implemented using an XML schema combining service identification, addressing, and business data.
在保护模式下的寻址范围是什么?
在保护模式下的寻址范围是什么?
应用推荐