在64位模式下仅使用REX前缀的指令有什么意义? [英] What's the point of instructions with only the REX prefix in 64bit mode?

查看:57
本文介绍了在64位模式下仅使用REX前缀的指令有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,MOV之一具有2个版本,一个具有REX,一个不具有(来自Intel的文档):

For example one of the MOV has 2 versions, one with REX, one without (from Intel's doc) :

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.

据我了解,这2条指令是相同的,除了第二条指令使用一个额外的字节并提供较少的选项...所以基本上它是没有用的.

From what I understand, the 2 instructions are identical except the second one uses an additional byte and provides less options ... So basically it is useless.

我想念什么?

推荐答案

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

It's to do with the encoding of the registers in the instruction. The bits available in the r/m part select from a set of registers - those registers change, depending upon the REX prefix:

没有REX前缀的可用8位寄存器:

Available 8-bit registers without REX prefix:

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

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

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

Available 8-bit registers with REX prefix set:

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

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

这就是为什么英特尔文档引起您注意不能选择带有REX前缀集的某些寄存器这一事实的原因.

This is why Intel docs draw attention to the fact that you cannot select certain registers with the REX prefix set.

这篇关于在64位模式下仅使用REX前缀的指令有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆