gpt4 book ai didi

assembly - MOV r/m8,r8 和 MOV r8,r/m8 的区别

转载 作者:行者123 更新时间:2023-12-02 22:12:06 27 4
gpt4 key购买 nike

通过查看英特尔指令卷,我发现了这一点:

1) 88/r ​​MOV r/m8,r8
2) 8A/r MOV r8,r/m8

当我在 NASM 中写下这样的一行,并使用列表选项将其组装时:

mov al, bl

我在列表中得到了这个:

88D8 mov al, bl

很明显 NASM 选择了上面两条指令中的第一条指令,但第二条指令不是选项二吗?如果是,NASM 基于什么理由选择第一个?

最佳答案

不同编码的有趣副作用:来自 A86 手册。

  1. A86 takes advantage of situations in which more than one set of opcodes can be generated for the same instruction. (For example, MOV AX,BX can be generated using either an 89 or 8B opcode, by reversing fields in the following effective address byte. Both forms are absolutely identical in functionality and execution speed.) A86 adopts an unusual mix of choices in such situations. This creates a code-generation "footprint" that occupies no space in your program file, but will enable me to tell, and to demonstrate in a court of law, if a non-trivial object file has been produced by A86. The specification for this "footprint" is sufficiently obscure and complicated that it would be impossible to duplicate by accident. I claim exclusive rights to the particular "footprint" I have chosen, and prohibit anyone from duplicating it. This has at least two specific implications:

    a. Any assembler that duplicates the "footprint" is mine. If it is not identified as mine and issued under these terms, then those who sell or distribute the assembler will be subject to prosecution.

    b. Any program marked with the "footprint" has been produced by my assembler. It is subject to condition 5 above.

关于assembly - MOV r/m8,r8 和 MOV r8,r/m8 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44335265/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com