OS Manuals

/usr/bin/yasm

A rewrite of NASM to allow for multiple syntax supported (NASM, TASM, GAS, etc.)

From yasm 1.3.0-r12 (os), captured 2026-11-05 by running yasm --help (exit 0). permalink

usage: yasm [option]* file
Options:
    --version               show version text
    --license               show license text
    -h, --help              show help text
    --arch=<arch>           select architecture (list with -a help)
     -a <arch>
    --parser=<parser>       select parser (list with -p help)
     -p <parser>
    --preproc=<preproc>     select preprocessor (list with -r help)
     -r <preproc>
    --oformat=<format>      select object format (list with -f help)
     -f <format>
    --dformat=<debug>       select debugging format (list with -g help)
     -g <debug>
    --lformat=<list>        select list format (list with -L help)
     -L <list>
    --list=<listfile>       name of list-file output
     -l <listfile>
    --objfile=<filename>    name of object-file output
     -o <filename>
    --mapfile=<filename>    name of map-file output
    --machine=<machine>     select machine (list with -m help)
     -m <machine>
    --force-strict          treat all sized operands as if `strict' was used
    -w                      inhibits warning messages
    -W                      enables/disables warning
    -M                      generate Makefile dependencies on stdout
    -E <file>               redirect error messages to file
    -s                      redirect error messages to stdout
    -e, --preproc-only      preprocess only (writes output to stdout by default)
    -i <path>               add include path
    -I <path>               add include path
    -P <filename>           pre-include file
    -d <macro[=value]>      pre-define a macro, optionally to value
    -D <macro[=value]>      pre-define a macro, optionally to value
    -u <macro>              undefine a macro
    -U <macro>              undefine a macro
    -X <style>              select error/warning message style (`gnu' or `vc')
    --prefix=<prefix>       prepend argument to name of all external symbols
    --suffix=<suffix>       append argument to name of all external symbols
    --postfix=<suffix>      append argument to name of all external symbols

Files are asm sources to be assembled.

Sample invocation:
   yasm -f elf -o object.o source.asm

Report bugs to bug-yasm@tortall.net
Options (43)
OptionDescriptionSource
--version GetThis option causes Yasm to prints the version number of Yasm as well as a license summary to standard output.help + man
--licenseshow license texthelp
-h, --help PrintPrints a summary of invocation options.help + man
--arch archselect architecture (list with -a help)help
-a archSelects the target architecture.help + man
--parser parserselect parser (list with -p help)help
-p parserSelects the parser (the assembler syntax).help + man
--preproc preprocselect preprocessor (list with -r help)help
-r preprocSelects the preprocessor to use on the input file before passing it to the parser.help + man
--oformat formatselect object format (list with -f help)help
-f formatSelects the output object format.help + man
--dformat debugselect debugging format (list with -g help)help
-g debugSelects the debugging format for debug information.help + man
--lformat listselect list format (list with -L help)help
-L listSelects the format/style of the output list file.help + man
--list listfilename of list-file outputhelp
-l listfileSpecifies the name of the output list file.help + man
--objfile filenamename of object-file outputhelp
-o filenameSpecifies the name of the output file, overriding any default name generated by Yasm.help + man
--mapfile filenamename of map-file outputhelp
--machine machineselect machine (list with -m help)help
-m machineSelects the target machine architecture.help + man
--force-stricttreat all sized operands as if `strict' was usedhelp
-w InhibitThis option causes Yasm to inhibit all warning messages.help + man
-W optionsThe warning options are handled in the order given on the command line, so if -w is followed by -Worphan-labels, all warnings are turned off except for orphan-labels.help + man
-Mgenerate Makefile dependencies on stdouthelp
-E fileredirect error messages to filehelp
-sredirect error messages to stdouthelp
-e, --preproc-only Onlypreprocess only (writes output to stdout by default)help + man
-i pathadd include pathhelp
-I pathAdds directory path to the search path for include files.help + man
-P filenamePre-includes file filename, making it look as though filename was prepended to the input.help + man
-d macro[=valuepre-define a macro, optionally to valuehelp
-D macro[=valuepre-define a macro, optionally to valuehelp + man
-u macroundefine a macrohelp
-U macroUndefines a single-line macro (may be either a built-in macro or one defined earlier in the command line with -D.help + man
-X styleSelects a specific output style for error and warning messages.help + man
--prefix prefixprepend argument to name of all external symbolshelp
--suffix suffixappend argument to name of all external symbolshelp
--postfix suffixappend argument to name of all external symbolshelp
-Werror TreatThis option causes Yasm to treat all warnings as errors. (in the manual page but not in --help)man
-Wno-unrecognized-char DoCauses Yasm to not warn on unrecognized characters found in the input. (in the manual page but not in --help)man
-Worphan-labels WarnWhen using the NASM-compatible parser, causes Yasm to warn about labels found alone on a line without a trailing colon. (in the manual page but not in --help)man
Exit status (1) from the manual page
0success
Examples (3) from the manual page, untested

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