作者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