简体   繁体   English

为什么nasm和yasm为mov r16,单词[r64-3]指令生成67个操作码?

[英]Why nasm and yasm yield 67 opcode for mov r16, word [r64 - 3] instruction?

In x86-64 assembly I have following instruction x86-64汇编中,我有以下说明

mov        dx, word [esi-5]

Nasm 2.13.03 generates: Nasm 2.13.03生成:

66 67 8B 56 FB 

yasm 1.3.0 generates: yasm 1.3.0生成:

67 66 8B 56 FB 

The 66 67 opcodes are modifiers so 8B 56 FB on its own is: 66 67操作码是修饰符,因此8B 56 FB本身是:

 mov        edx, dword [rsi-5]

I noticed that: 我注意到:

66 8B 56 FB 

also evaluates to: 还评估为:

mov        dx, word [rsi-5]

I have two questions: 我有两个问题:
1) Why nasm & yasm emit this 67 opcode byte padding? 1)为什么nasmyasm发出这67操作码字节填充? ( 67 on it's own is not enough to reduce edx to dx , it needs to include 66 ) 67本身不足以将edx缩减为dx ,它需要包含66
2) Is there a way to emit a shorter 4 byte instruction without 67 in nasm / yasm? 2)有没有办法在nasm / yasm中发出没有 67的较短的4字节指令?

The question made false assumption 66 8B 56 FB 问题做出了错误的假设66 8B 56 FB

mov        dx, word [rsi-5] 

is equivalent to 相当于

`66 67 8B 56 FB` or `67 66 8B 56 FB` 

mov        dx, word [esi-5] 

66 reduces edx to dx 66edxdx
67 reduces [rsi-5] to [esi-5] 67[rsi-5]降低为[esi-5]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AVR汇编为什么LDI指令只能使用R16-R31寄存器 - AVR Assembly why does LDI instruction can only use R16 - R31 registers mov r64, m64 是一个周期还是两个周期的延迟? - Is mov r64, m64 one cycle or two cycle latency? 为什么不允许使用 THUMB 指令“mov r0,#0”? - Why is the THUMB instruction “mov r0, #0” not allowed? MOVZX r32, r/m16 和 MOVZX r64, r/m16 在 64 位 x86 之间的区别 - Difference between MOVZX r32, r/m16 and MOVZX r64, r/m16 in 64-bit x86 NASM mov指令语法 - NASM mov instruction syntax YASM mov 指令给出错误:操作数 1 的大小无效 - YASM mov instruction gives error: invalid size for operand 1 为什么nasm在寄存器之间组装MOV指令时使用0x89? - Why does nasm use 0x89 when it assembles a MOV instruction between registers? 错误:A1163E 未知操作码 R0,在左列中需要操作码或带有指令的宏 - Error: A1163E Unknown Opcode R0, expecting opcode or Macro with instruction in the left column mov ah上的“无效指令操作数”,word_variable,在16位数字上使用imul - “invalid instruction operands” on mov ah, word_variable, and using imul on 16-bit numbers nasm / ld“重定位被截断以适合:R_386_16” - nasm/ld “relocation truncated to fit: R_386_16”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM