mov rax, 10
mov rbx, 0xA
mov rcx, 'A'
Explanation: This is probably the most straightforward way to work with constants, as any number or character literal is considered a constant: just write the literal(s) directly in the code (=
.text section) inside the instructions you call.
Quick summary for NASM x86_64 constants:
equ defines fixed values, such as a string's length (in bytes/chars).%define can be used as a macro: code substitution.oah or 'z' can be directly embedded in the code.