NASM Coding: Basics

Here are the General-Purpose CPU registers that we'll work with and their descriptions:

Register Size Typical Purpose (Convention)
rax
64-bit Accumulator; return value; syscall number
rbx
64-bit General-purpose
rcx
64-bit Counter (loops, shifts)
rdx
64-bit Data register; I/O length; syscall arguments
rsi
64-bit Source index; pointer to input data
rdi
64-bit Destination index; pointer to output data
rbp
64-bit Base pointer (stack frame reference)
rsp
64-bit Stack pointer (top of stack)
r8
64-bit General-purpose; syscall arguments
r9
to
r15
64-bit General-purpose