1.1.5 Executing compiler from command line



To perform compilation from the command line you need to execute the fasm.exe executable, providing two parameters – first should be name of source file, second should be name of destination file. If no second parameter is given, the name for output file will be guessed automatically. After displaying short information about the program name and version, compiler will read the data from source file and compile it. When the compilation is successful, compiler will write the generated code to the destination file and display the summary of compilation process; otherwise it will display the information

about error that occurred.


The source file should be a text file, and can be created in any text editor. Line

breaks are accepted in both DOS and Unix standards, tabulators are treated as spaces.


In the command line you can also include -m option followed by a number, which specifies how many kilobytes of memory flat assembler should maximally use. In case of DOS version this options limits only the usage of extended memory.


 The -p option followed by a number can be used to specify the limit for number of passes the assembler performs. If code cannot be generated within specified amount of passes, the assembly will be terminated with an error message. The maximum value of this setting is 65536, while the default limit, used when no such option is included in command line, is 100.


It is also possible to limit the number of passes the assembler performs, with the -p option followed by a number specifying the maximum number of passes.


There are no command line options that would affect the output of compiler, flat

assembler requires only the source code to include the information it really needs. 


For example, to specify output format you specify it by using the format directive at the beginning of source.