#
macrosSee https://nasm.us/doc/nasmdoc4.html for the chapter on NASM preprocessor.
#
singleline macros%define calc(a,b) a+b
#
multiline macros%macro [name] [number of arguments]
; %0 is the number of arguments passed
; %1 is first argument
; %2 is second argument
; ... etc
%endmacro
#
custom bytecodeNASM supports overriding existing instructions with macros.
The mov
instruction will now emit 0xee 0xcc
instead of the normal instruction bytes.