【问题标题】:Question regarding assembly language关于汇编语言的问题
【发布时间】:2010-10-18 16:49:39
【问题描述】:

我正在阅读《汇编语言的艺术》一书。我遇到了这两行。

the three byte encoding for mov ax, [1000] would be 0C6h, 00h,
10h and the three byte encoding for mov ax, [2000] would be 0C6h, 00h, 20h.

谁能告诉我 mov ax, [1000] 如何转换为 oc6h, ooh, 10h 和 mov ax, [2000] 转换为 0C6h, 00h, 20h。谁能告诉我计算结果?提前致谢。

编辑:我是汇编编程的初学者,请用描述解释。

【问题讨论】:

    标签: assembly x86 x86-16


    【解决方案1】:

    只是猜测,但在我看来:

    0C6h - This is the opcode for "mov ax,"
    00h 10h - This is the address 1000h, Little Endian
    00h 20h - This is the address 2000h, Little Endian
    

    【讨论】:

    • 谢谢 Marc - 不敢相信我真的打字了 :)
    • 啧,那应该是小美洲原住民。
    【解决方案2】:

    我假设您的困惑在于 1000 被编码为 10h。

    ax 是 32 位 eax 寄存器的低 16 位的别名。所以 mov ax, 1000 知道这是一个 16 位的操作。 1000 在内存中被编码为 00 10,因为它是使用 little-endianness 编码的,这基本上意味着最高有效字节在物理顺序中位于最后。

    【讨论】:

    • 谢谢哥们。这就是我想要的。再次非常感谢。
    【解决方案3】:

    00h是内存地址的LoByte

    20h 是内存地址的高字节

    OC6h 是mov, ax 的操作码指令

    【讨论】:

      【解决方案4】:

      所有 x86 指令的操作码都可以在 http://download.intel.com/design/intarch/manuals/24319101.pdf 找到(mov 在第 442 页)。第 2 章介绍了如何使用寄存器参数对操作码进行编码。

      其他答案已经解释了编码:-)

      【讨论】:

        猜你喜欢
        • 2012-11-27
        • 1970-01-01
        • 2020-10-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-11-17
        • 2010-10-09
        • 1970-01-01
        相关资源
        最近更新 更多