An Assembly line often has this shape:
label: instruction operand1, operand2 ; commentParts:
label: a name for the current address.instruction: a CPU instruction or assembler directive.operand: register, memory, immediate value, or label.comment: text after;, ignored by the assembler.
NASM Linux x86-64 example:
bits 64
section .text
global _start
_start:
mov rax, 60 ; syscall exit
mov rdi, 0 ; exit code 0
syscallCommon sections:
.text: machine code..data: initialized data..bss: uninitialized data..rodata: read-only data, when supported by the linker/script.
Labels:
loop_start:
dec rcx
jnz loop_startA label does not generate instruction bytes. It only names an address.
Intel syntax:
mov rax, rbx ; rax = rbx
add rax, 5 ; rax = rax + 5Destination is on the left, source is on the right.