Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Assembly 在64位模式下,只有REX前缀的指令有什么意义?_Assembly_X86 64_Cpu Registers_Instruction Set - Fatal编程技术网

Assembly 在64位模式下,只有REX前缀的指令有什么意义?

Assembly 在64位模式下,只有REX前缀的指令有什么意义?,assembly,x86-64,cpu-registers,instruction-set,Assembly,X86 64,Cpu Registers,Instruction Set,例如,其中一个MOV有两个版本,一个带有REX,另一个没有来自Intel文档的版本: 88 /r MOV r/m8, r8 REX + 88 /r MOV r/m8***, r8*** ***In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH. 据我所知,这两条指令是相同的,只是第二条指令使用了一个额外的字节

例如,其中一个MOV有两个版本,一个带有REX,另一个没有来自Intel文档的版本:

88 /r MOV r/m8, r8
REX + 88 /r MOV r/m8***, r8***

***In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH.
据我所知,这两条指令是相同的,只是第二条指令使用了一个额外的字节,并且提供了较少的选项。。。所以基本上是没用的


我遗漏了什么?

它不是无用的,但也不是绝对有用的


REX前缀将ah、ch、dh和bh分别更改为spl、bpl、sil和dil。因此,虽然不能使用第一个集合,但可以使用第二个集合。

这与指令中寄存器的编码有关。r/m部分中可用的位从一组寄存器中选择-这些寄存器根据REX前缀的不同而变化:

不带REX前缀的可用8位寄存器:

AL、CL、DL、BL、AH、CH、DH、BH

设置REX前缀的可用8位寄存器:

AL、CL、DL、BL、SPL、BPL、SIL、DIL、R8B、R9B、R10B、R11B、R12B、R13B、R14B、R15B


这就是为什么“英特尔文档”会提请注意这样一个事实,即您无法选择设置了REX前缀的某些寄存器。

如果没有REX前缀,您只能访问8个寄存器AL、CL、DL、BL、AH、CH、DH、BH,因为寄存器字段只有3位。如果没有REX前缀,则您的列表是错误的。见表3-2。我选择了另一个作为答案的可寻址通用寄存器,因为还有更多的信息,但无论如何,谢谢您REX前缀也可以用于不需要REX前缀的指令