
Move Data Between Registers and Memory With MOV, MOVZX and MOVSX
Load and store bytes, words, dwords and qwords on x86-64 with MOV, and widen small values correctly with MOVZX, MOVSX and MOVSXD. Worked examples included.
Tag
5 posts

Load and store bytes, words, dwords and qwords on x86-64 with MOV, and widen small values correctly with MOVZX, MOVSX and MOVSXD. Worked examples included.

Learn the x86-64 memory operand form [base + index*scale + displacement], what each part may be, which combinations are illegal, and how arrays map onto it.

How the x86-64 carry, zero, sign and overflow flags are set by add, sub and cmp, with worked 8-bit examples and the conditional jumps that read them.

The sixteen x86-64 general-purpose registers, their 32, 16 and 8-bit names, what each is conventionally for, and the write rules that trip up beginners.

A complete guide to x86-64 assembly on Linux: registers, flags, addressing, branches, the stack, calling C, atomics, encoding and a full worked program.