AsAssembly · Lesson 3 of 10
Registers & Data Movement
`mov` is the most common instruction. It moves data between registers, and between registers and memory. 'Move' is a misnomer — it copies. The source is unchanged.
✦ Tip
`lea` (Load Effective Address) is useful for pointer arithmetic without touching memory. `lea rax, [rbx + rcx*4 + 8]` is a single instruction that computes rbx + rcx*4 + 8 and puts the result in rax — no load, no side effects. Compilers use it for fast multiplication by small constants.
`lea` (Load Effective Address) is useful for pointer arithmetic without touching memory. `lea rax, [rbx + rcx*4 + 8]` is a single instruction that computes rbx + rcx*4 + 8 and puts the result in rax — no load, no side effects. Compilers use it for fast multiplication by small constants.