I have the following assembly code for moving immediates into an 8,16,32,64-bit register:
.globl _start
_start:
mov $1, %rax
mov $2, %eax
mov $3, %ax
mov $4, %ah
mov $5, %al
And when debugging in gdb:
0x0000000000401000 48 c7 c0 01 00 00 00 ? mov $0x1,%rax
0x0000000000401007 b8 02 00 00 00 ? mov $0x2,%eax
0x000000000040100c 66 b8 03 00 ? mov $0x3,%ax
0x0000000000401010 b4 04 ? mov $0x4,%ah
0x0000000000401012 b0 05 ? mov $0x5,%al
And on the intel page it shows:
Some questions on the Opcode column:
- What does the
+rbor+rwor+rdmean? - I'm guessing the
ib,iw,id, means immediate-byte, -word, -double- is that correct? What does theioin the last row mean? - What is the
REXprefix on theahinstruction that increments the op code fromb0tob4? - Why does the
mov imm, r16require the66prefix? It doesn't list any prefix in the row forimm16. It seems the66just flags this at a 16bit register? - Finally, why the three-byte code,
48 c7 c0formov imm, r64? I don't see
