Registers, Arithmetic, and Control Flow in x86-64 Assembly
This tutorial covers x86-64 registers, arithmetic, and control flow by building an integer statistics calculator in assembly that computes sum, average, minimum, and maximum over an array declared in .data. It covers the 64/32/16/8-bit register aliases, all three forms of mov, add and sub with loop-based array traversal, signed multiplication with imul, signed division with idiv and the mandatory cqo sign-extension step, the flags register (ZF, SF, CF, OF), and conditional branching with cmp, jl, jg, jge, jle, jz, jne, and unconditional jmp.
Comentarii