[已解決] 關於x64 rbp定址方法
小弟以前用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
推
12/27 10:52, , 1F
12/27 10:52, 1F
→
12/27 10:55, , 2F
12/27 10:55, 2F
→
12/27 10:57, , 3F
12/27 10:57, 3F
→
12/27 14:32, , 4F
12/27 14:32, 4F
※ 編輯: b98901056 來自: 140.112.4.199 (12/27 15:41)
推
01/03 00:29, , 5F
01/03 00:29, 5F
ASM 近期熱門文章
PTT數位生活區 即時熱門文章