Copyright (C) 2000-2012 |
GNU Info (nasm.info)Section 2.1.12.1.1. The `-o' Option: Specifying the Output File Name ------------------------------------------------------- NASM will normally choose the name of your output file for you; precisely how it does this is dependent on the object file format. For Microsoft object file formats (`obj' and `win32'), it will remove the `.asm' extension (or whatever extension you like to use - NASM doesn't care) from your source file name and substitute `.obj'. For Unix object file formats (`aout', `coff', `elf' and `as86') it will substitute `.o'. For `rdf', it will use `.rdf', and for the `bin' format it will simply remove the extension, so that `myfile.asm' produces the output file `myfile'. If the output file already exists, NASM will overwrite it, unless it has the same name as the input file, in which case it will give a warning and use `nasm.out' as the output file name instead. For situations in which this behaviour is unacceptable, NASM provides the `-o' command-line option, which allows you to specify your desired output file name. You invoke `-o' by following it with the name you wish for the output file, either with or without an intervening space. For example: nasm -f bin program.asm -o program.com nasm -f bin driver.asm -odriver.sys Note that this is a small o, and is different from a capital O , which is used to specify the number of optimisation passes required. See *Note Section 2.1.16::. automatically generated by info2www version 1.2.2.9 |