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

Niciun comentariu încă. Fii primul care își împărtășește părerea.
Nivel mediu
10,0 (1)

Autor

Software engineer and the creator of the Bytestark learning platform