本文介绍了编码ADC EAX,ECX - 2不同的方式连接code? (拱86)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待通过英特尔指令集手动,它看起来像有2个不同形式的 ADC的将匹配/ EN code ADC EAX,ECX 如下:

I'm looking through an Intel Instruction Set manual, and it looks like there are 2 different forms of ADC that would match/encode ADC EAX, ECX as follows:

ADC r/m32, r32  (11 /r , which encodes to 11C8)

ADC r32, r/m32  (13 /r, which encodes to 13C1)

我的问题是(因为我做了正确的数学),是 11C8 13C1 相同呢?什么是一个汇编程序将在对另一选择一个编码考虑的因素?现在的问题是从执行一个汇编的透视,因此,问题是在一般情况下,不是关于这个特定假想指令

My question is (given I did the math correctly), are 11C8 and 13C1 equivalent? What are the factors that an assembler would consider in selecting one encoding over another? The question is from a perspective of implementing an assembler, so the question is in general, not about this particular hypothetical instruction.

如果这是一个漫长的回答,请点我在正确的方向我企图Google上搜寻它失败了。

If it's a lengthy answer, please point me in a right direction as my attempts at googling it failed.

推荐答案

这是。在指令中使用多个参数的任何架构有这一点。

This is redundancy of instruction encoding. Any architecture that use multiple parameters in the instruction has this.

想想一个RISC架构已添加RX,RY,RZ 来分配的RY和RZ到RX的总和,那么你就可以连接code <$ C的$ C>添加RX,RY,RZ 或添加RX,RZ,R​​Y ,他们都会是相同的。

Think of a RISC architecture that have add rx, ry, rz that assigns the sum of ry and rz into rx then you can encode add rx, ry, rz or add rx, rz, ry, they'll all be equivalent.

在我们的x86(通常)只有2每条指令参数,但你可以选择它们之间的方向,因为你可以存储或从存储器。如果你不使用的内存,那么你可以选择2个寄存器之间的方向,所以有2编码方式

In x86 we (normally) have only 2 parameters for each instruction but you can select the direction between them since you can store to or from memory. If you don't use memory then you can choose the direction between the 2 registers, so there are 2 encoding ways

您可以使用它来识别一些编译器/汇编器。对于一些装配,您可以选择要使用的编码。气体可以使用<$c$c>.s后缀,以迫使它发出备用编码

You can use this to identify some compilers/assemblers. For some assemblers you can choose which encoding to use. In GAS you can use .s suffix to force it to emit the alternate encoding

10 de   adcb   %bl,%dh
12 f3   adcb.s %bl,%dh

这篇关于编码ADC EAX,ECX - 2不同的方式连接code? (拱86)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 07:13