作者b98901056 (岳岳)
看板ASM
标题[问题] 关於x64 rbp定址方法
时间Thu Dec 27 04:03:33 2012
小弟以前用x86写过组语一阵子
最近有需要用x64写一些东西
现在在看x64架构,发现好像一些暂存器消失了(?)
主要是想问在x86下
mov ax,ss:[bp] 中的ss若省略时,则会取ds段的资料
不过x64好像没有ds了
请问 mov rax,[rbp+offset]
会从哪一个暂存器开始算rbp+offset呢?
谢谢
///
後来去挖intel 的processor mannual,写到
3.4.2.1 Segment Registers in 64-Bit Mode
In 64-bit mode: CS, DS, ES, SS are treated as if each segment base is 0,
regardless of the value of the associated
segment descriptor base. This creates a flat address space for code, data,
and stack. FS and GS are exceptions.
Both segment registers may be used as additional base registers in linear
address calculations (in the addressing
of local data and certain operating system data structures).
Even though segmentation is generally disabled, segment register loads may
cause the processor to perform
segment access assists. During these activities, enabled processors will
still perform most of the legacy checks on
loaded values (even if the checks are not applicable in 64-bit mode). Such
checks are needed because a segment
register loaded in 64-bit mode may be used by an application running in
compatibility mode.
Limit checks for CS, DS, ES, SS, FS, and GS are disabled in 64-bit mode
以解决 ORZ||
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.243.202
1F:推 POWERPC:BP基本是与SS配的,若不以SS为主,要自行加段名,如DS:[BP].. 12/27 10:52
2F:→ POWERPC:在线性模式下段暂存器被叫选择器类似数位IC中的解多工器 12/27 10:55
3F:→ POWERPC:有关这个64的东西,我很早已洗手了,因此给熟的人解释了 XD 12/27 10:57
4F:→ b98901056:现在关於x64介绍的很少啊 Q^Q 12/27 14:32
※ 编辑: b98901056 来自: 140.112.4.199 (12/27 15:41)
5F:推 garyzyg:先搞清楚 CPU 在哪种 mode 下工作吧. 01/03 00:29