OS Manuals

/usr/bin/nasm

80x86 assembler designed for portability and modularity

From nasm 3.02-r3 (os), captured 2026-11-05 by running nasm --help (exit 0). permalink

Usage: /usr/bin/nasm [-@ response_file] [options...] [--] filename
  Options:
    -v (or --v)    print the NASM version number and exit
    -@ file        response file; one command line option per line
    -h             list command line options and exit (also --help)
    -h -opt        show additional help for option "-opt"
    -h all         show all available command line help
    -h topics      show list of help topics (also -h list)
    -o outfile     write output to outfile
    --keep-all     output files will not be removed even if an error happens
    -Xformat       specify error reporting format (see -h -X)
    -s             redirect messages to stdout
    -Zfile         redirect messages to file
    --info[=lvl]   display optional informational messages
    --debug[=lvl]  display NASM internal debugging messages
    -M...          generate Makefile dependencies (see -h -M)
    -f format      select output file format (see -h -f)
    -g             generate debugging information
    -F format      select a debugging format (see -h -F)
    -gformat       same as -g -F format
    -l listfile    write listing to a list file
    -Lflags...     add information to the list file (see -h -L)
    -Oflags...     select optimization (see -h -O)
    -t             assemble in limited SciTech TASM compatible mode
    -E (or -e)     preprocess only (writes output to stdout by default)
    -a             don't preprocess (assemble only)
    -Ipath         add a pathname to the include file path
    -Pfile         pre-include a file (also --include)
    -Dmacro[=str]  pre-define a macro
    -Umacro        undefine a macro
    -w+x           enable warning x  (see -h -w)(also -Wx)
    -w-x           disable warning x (also -Wno-x)
    -w[+-]error    promote all warnings to errors (also -Werror)
    -w[+-]error=x  promote warning x to errors (also -Werror=x)
    --pragma str   pre-executes a specific %pragma
    --before str   add line (usually a preprocessor statement) before the input
    --bits nn      set bits to nn (equivalent to --before "BITS nn")
    --no-line      ignore %line directives in input
    --gprefix str  prepend the given string to the names of all extern,
                   common and global symbols (also --prefix)
    --gpostfix str append the given string to the names of all extern,
                   common and global symbols (also --postfix)
    --lprefix str  prepend the given string to local symbols
    --lpostfix str append the given string to local symbols
    --reproducible attempt to produce run-to-run identical output
    --limit-* val  set execution limit (see -h --limit)
Options (47)
OptionDescriptionSource
-v (orCauses nasm to exit immediately, after displaying its version number.help + man
-@ fileCauses nasm to process options from filename as if they were included on the command line.help + man
-hCauses nasm to exit immediately, after giving a summary of its invocation options.help + man
-o outfileSpecifies a precise name for the output file, overriding nasm's default means of determining it.help + man
--keep-alloutput files will not be removed even if an error happenshelp
-Xformatspecify error reporting format (see -h -X)help
-sCauses nasm to send its error messages and/or help text to stdout instead of stderr.help + man
-Zfileredirect messages to filehelp
--info lvldisplay optional informational messageshelp
--debug lvldisplay NASM internal debugging messageshelp
-MCauses nasm to output Makefile-style dependencies to stdout;help + man
-f formatselect output file format (see -h -f)help + man
-gCauses nasm to generate debug information.help + man
-F formatSpecifies the debug information format.help + man
-gformatEquivalent to -g -F format.help + man
-l listfileCauses an assembly listing to be directed to the given file, in which the original source is displayed on the right hand side (plus the source for included files and the expansions of multi-line…help + man
-Lflagsadd information to the list file (see -h -L)help
-Oflagsselect optimization (see -h -O)help
-tCauses nasm to assemble in SciTech TASM compatible mode.help + man
-E (orpreprocess only (writes output to stdout by default)help
-aCauses nasm to assemble the given input file without first applying the macro preprocessor.help + man
-Ipathadd a pathname to the include file pathhelp
-Pfilepre-include a file (also --include)help
-Dmacro strpre-define a macrohelp
-Umacroundefine a macrohelp
-w+xenable warning x (see -h -w)(also -Wx)help
-w-xdisable warning x (also -Wno-x)help
-w +-]errorCauses nasm to enable or disable certain classes of warning messages, for example -w+label-orphan or -w-macro-params.help + man
--pragma strpre-executes a specific %pragmahelp
--before stradd line (usually a preprocessor statement) before the inputhelp
--bits nnset bits to nn (equivalent to --before "BITS nn")help
--no-lineignore %line directives in inputhelp
--gprefix strprepend the given string to the names of all extern, common and global symbols (also --prefix)help
--lprefix strprepend the given string to local symbolshelp
-hfSame as -h , but also lists all valid output formats. (in the manual page but not in --help)man
-MG fileSame as -M but assumes that missing Makefile dependencies are generated and added to dependency list without a prefix. (in the manual page but not in --help)man
-MF fileOutput Makefile-style dependencies to the specified file. (in the manual page but not in --help)man
-MD fileSame as a combination of -M and -MF options. (in the manual page but not in --help)man
-MT fileOverride the default name of the dependency target dependency target name. (in the manual page but not in --help)man
-MQ fileThe same as -MT except it tries to quote characters that have special meaning in Makefile syntax. (in the manual page but not in --help)man
-MPEmit phony target. (in the manual page but not in --help)man
-O numberOptimize branch offsets. (in the manual page but not in --help)man
-W no-]foo'Causes nasm to enable or disable certain classes of warning messages, in gcc-like style, for example -Wlabel-orphan or -Wno-orphan-labels. (in the manual page but not in --help)man
-X formatSpecifies error reporting format (gnu or vc). (in the manual page but not in --help)man
-yCauses nasm to list supported debug formats. (in the manual page but not in --help)man
-Z filenameCauses nasm to redirect error messages to filename. (in the manual page but not in --help)man
--prefix, --postfixPrepend or append (respectively) the given argument to all global or extern variables. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.