[已解決] 關於x64 rbp定址方法

看板ASM (組合語言)作者 (岳岳)時間12年前 (2012/12/27 04:03), 編輯推噓2(203)
留言5則, 3人參與, 最新討論串1/1
小弟以前用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
BP基本是與SS配的,若不以SS為主,要自行加段名,如DS:[BP]..
12/27 10:52, 1F

12/27 10:55, , 2F
在線性模式下段暫存器被叫選擇器類似數位IC中的解多工器
12/27 10:55, 2F

12/27 10:57, , 3F
有關這個64的東西,我很早已洗手了,因此給熟的人解釋了 XD
12/27 10:57, 3F

12/27 14:32, , 4F
現在關於x64介紹的很少啊 Q^Q
12/27 14:32, 4F
※ 編輯: b98901056 來自: 140.112.4.199 (12/27 15:41)

01/03 00:29, , 5F
先搞清楚 CPU 在哪種 mode 下工作吧.
01/03 00:29, 5F
文章代碼(AID): #1GsrWQS_ (ASM)
文章代碼(AID): #1GsrWQS_ (ASM)