NOTE

Assembling Your Program

Using the cc Command

Using the cc Command

You can also use the cc command to run the Assembler on files that have a .s suffix. See cc(1) man page for the HP C/HP-UX ANSI C compiler, if installed. The cc command inserts the system file

/usr/lib/pcc_prefix.s

in front of the .s file and pipes the file through the C preprocessor (see cpp(1) in HP-UX Reference) before passing the file to the Assembler. pcc_prefix.s is a concatenation of the following header files in the directory /usr/include:

hard_reg.h Set of .REGs for hardware registers.

soft_reg.h Set of register definitions that follows the Procedure Calling Convention.

std_space.h Set of space and subspace definitions that most Assembler programs use.

If you are using the HP C/HP-UX ANSI C compiler, you can suppress the pcc_prefix.s file with the cc option +a.

Passing Arguments to the Assembler

The cc command normally strips all as command options from the command line, writing a warning to standard error. Therefore, when you want to retain one of these options, you must include the -Wacommand-line option

-Wa, ,as-argument [ as-argument] ...

as-argumentnames an Assembler argument you want to preserve. For example, to specify a cross-reference file, you could use:

-Wa,-v,myxreffile

Similarly, you can pass options to the C preprocessor (cpp) or the linker (ld) with -Wpand -Wl, respectively.

Chapter 6

127