The driver, ccmcore, may be used to invoke the assembler and linker. This has several advantages over direct use of the assembler, including the invocation of the preprocessor on the assembly file, if it ends in .mco. This allows you take advantage of preprocessor facilities, such as #include and #define, which are not normally available to the assembly language programmer. Assembly language files generally have one of two suffixes, either .s or .mco. The preprocessor will only be invoked on the files ending in .mco. The general format to use the driver with an assembly file is:
% ccmcore options foo.mco
To pass options to the macro assembler, you must use one of two special driver options. Otherwise, the driver interprets the information, and it is not passed to the assembler:
-asm=assembler_option
-Wa, assembler_options
Only one option is used with each -asm. Multiple -asm options can be used on one line. Multiple options can be listed after -Wa. They must be separated by commas.
% ccmcore -g -Wa,-ref,-r calc.mco -o calc
In this example, the options -ref and -r are sent to the macro assembler. The preprocessor is invoked on the assembly file calc.mco. An executable, calc, is produced.
% ccmcore -asm=-ref -asm=-r stack.s -o stack
In this example, the preprocessor is not called because the assembly file ends in .s instead of .mco. The options -ref and -r are passed to the macro assembler. An executable file, stack, is produced.
At times, the assembly language output of a high-level language is required, often for perusal, and so that alterations can be made before assembly. To do this, use the driver command with the -S option:
% ccmcore -S main.c
This causes the C compiler to compile main.c and place the assembly language output in the file main.s.