NASM Coding: Common Instructions

Instruction Description Operands
not x
x = !x;
Register or variable; bitwise NOT
or x, y
x = x | y;
Registers or variables (
y
can be a literal); bitwise OR
pop x
x = stack.pop();
Register or variable; pop the top value from the stack
push x
stack.push(y);
Register, variable, or literal; push
y
to stack
sub x, y
x -= y;
Numbers as registers or variables (
y
can also be a literal)
syscall
Run a syscall The arguments are in
rax
,
rdi
,
rsi
,
rdx
,
r10
,
r8
, and
r9
test x, y
Compute
x && y
Registers, variables, or literals; the OS sets the sign, zero, carry, and overflow flags
xor x, y
x = x ^ y;
Registers or variables (
y
can be a literal); bitwise XOR

The full list of all the supported NASM instructions (in the x86_64 architecture and others) can be found in Appendix F of the NASM manual.