3 ms·
Regarding 5, no, it's five bytes (b8 01 00 00 00) for movl $1,%eax. If you actually have a 64-bit immediate, just the immediate itself would be 8 bytes, and the
by kccqzy 9y ago
Regarding 5, no, it's five bytes (b8 01 00 00 00) for movl $1,%eax. If you actually have a 64-bit immediate, just the immediate itself would be 8 bytes, and the actual instruction is 10 bytes.
- besselheim 9y agoMOV RAX, 1 is seven bytes: 48 C7 C0 01 00 00 00
- pcwalton 9y agoThe parent has a good point actually, because "mov eax,1" automatically zero-extends in 64-bit mode. It's still one byte longer than the equivalent AArch64 instruction, though.