AnatomyOf

Anatomy of an Assembly file

example.asm
1; A minimal x86 program. No garbage collector is coming to save you.
2section .data
3 reply db '42', 0xA
4
5section .text
6 global _start
7
8_start:
9 mov eax, 4 ; sys_write -- four whole registers just to say hi
10 mov ebx, 1
11 mov ecx, reply
12 mov edx, 2
13 int 0x80 ; ask the kernel nicely
Assembly is a low-level language that translates directly to machine code, specific to a CPU architecture (e.g., x86, ARM).