什么是x86指令&QUOT的含义,请与DWORD PTR DS:[00923030h] QUOT ;? [英] What is the meaning of x86 instruction "call dword ptr ds:[00923030h]"?

查看:568
本文介绍了什么是x86指令&QUOT的含义,请与DWORD PTR DS:[00923030h] QUOT ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是下面的x86汇编指令呢?

What does the following x86 assembler instruction do?

call dword ptr ds:[00923030h]

这是一个间接调用我怀疑,但究竟它是如何计算的地址电话?

It's an indirect call I suspect, but exactly how does it compute the address to the call?

推荐答案

更新

每当你看到一个内存操作数,看起来像 DS:0x00923030 ,这是一个的段相对的寻址模式。实际的地址被称为TP是相对于 DS的基地址段寄存器。

Whenever you see a memory operand that looks something like ds:0x00923030, that's a segment-relative addressing mode. The actual address being referred tp is at linear address 0x00923030 relative to the base address of the ds segment register.

内存分割在x86架构中是有点混乱,我觉得维基百科地解释它的一个好工作。

Memory segmentation in the x86 architecture is somewhat confusing, and I think Wikipedia does a good job of explaining it.

基本上,X86有一些特殊的的寄存器: CS code 的段), DS 数据的段), ES FS GS SS 的段)。每存储器访问具有一定段寄存器相关联。通常情况下,你不指定段寄存器,并根据记忆是如何存取,使用默认段寄存器。例如, CS 寄存器用于读取指令。

Basically, x86 has a number of special segment registers: cs (code segment), ds (data segment), es, fs, gs, and ss (stack segment). Every memory access is associated with a certain segment register. Normally, you don't specify the segment register, and depending on how the memory is accessed, a default segment register is used. For example, the cs register is used for reading instructions.

每个段寄存器有一定的基址的和的限制的。基地址确定线性地址00000000对应的物理地址,并且限制确定的最大允许线性地址为该段。例如,如果基地址为0x00040000和限为0x0000FFFF,那么唯一的有效线性地址将是00000000至0x0000FFFF,和相应的物理地址将是0x00040000到0x0004FFFF

Each segment register has a certain base address and a limit. The base address determines the physical address that linear address 0x00000000 corresponds to, and the limit determines the maximum allowable linear address for that segment. For example, if the base address were 0x00040000 and the limit was 0x0000FFFF, then the only valid linear addresses would be 0x00000000 to 0x0000FFFF, and the corresponding physical addresses would be 0x00040000 to 0x0004FFFF.

因此​​,在该子程序被调用所在的物理地址被存储在 DS 段寄存器,加上0x00923030的基地址给出。但我们没有这样做,但 - 指令中有字 PTR 。这增加了额外的间接水平,所以子程序的实际目标是地址的存储的在位置 DS:0x00923030

Thus, the physical address at which the subroutine being called resides is given by the base address stored in the ds segment register, plus 0x00923030. But we're not done yet -- the instruction has the word ptr in it. This adds an extra level of indirection, so the actual target of the subroutine is the address stored at the location ds:0x00923030.

在AT& T公司的语法(由GNU汇编接受),该指令将被写成如下:

In AT&T syntax (accepted by the GNU assembler), the instruction would be written as follows:

lcall *ds:0x00923030

有关什么样的指令呢,请参见 80386参考手册的全部血淋淋的细节。该指令的这个变体是CALL R / M16(调用附近寄存器间接/内存间接)。

For the full gory details of what the instruction does, see the 80386 reference manual. This particular variant of the instruction is "CALL r/m16" (call near register indirect/memory indirect).

这篇关于什么是x86指令&QUOT的含义,请与DWORD PTR DS:[00923030h] QUOT ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆