Lukas' Notes

programming-languages

Definition

Assembly

Assembly language is a human-readable mnemonic abstraction of machine code: each line denotes one instruction the CPU executes, written as an operation and its operands rather than as the raw byte sequence the CPU actually fetches. An assembler (or a compiler’s back end) translates each mnemonic into the corresponding opcodes.

Architecture- and Syntax-Specific

Obs

Unlike a high-level language, assembly has no single grammar — the exact mnemonic names, available registers, and operand conventions depend on the target architecture (e.g. x86-64 vs ARM) and on the assembler’s syntax flavour. On x86-64 the two commonly met flavours are Intel (mov rax, 5, destination first) and AT&T (mov $5, %rax, source first, register names prefixed with %); AT&T is the default of GNU tools such as objdump unless -M intel is requested. Eight-bit, 16-bit, 32-bit and 64-bit variants of the same architecture family also expose different register files, so assembly written for one width does not run on another without translation.