【发布时间】:2021-07-31 17:25:19
【问题描述】:
我的教授开始自相矛盾,所以我需要你的帮助。
在指令编码中,我们有一个可选字段 REX 前缀,其拆分如下:
Field contains
0100 – fixed constant value
W – 1 when using 64-bit data
R – expands the Reg field to 4 bit
X – expands Index field to 4 bit
B – expands the R/M field or Base to 4 bit
我问我的教授“使用 64 位数据时”的真正含义,每次我得到不同的答案:
-
使用添加到 x64 的新寄存器时,如 r9、r10、r9d 等...
-
当使用 64 位大小的寄存器时,如 rax、rbx、r9 等...
-
当指令使用(读/写)内存中的 64 位数据时。
我真的很困惑,正确答案是什么(可能都不是,因为我不再信任我的教授了)。
【问题讨论】:
-
查阅指令集参考。但是,是的,对于新添加的寄存器,您需要 RXB 位,而对于 64 位数据,您需要 W 位。
标签: assembly x86-64 att machine-code instruction-encoding