HPlogo HP Assembler Reference Manual: HP 9000 Computers > Chapter 6 Assembling Your Program

Using the cc Command

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

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.

NOTE: 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 -Wa command-line option

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

as-argument names 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 -Wp and -Wl, respectively.

cpp Preprocessor

You can use the C preprocessor (cpp) with assembly language programs to include C-type macros, including directives. You can use an exclamation point (!) as a statement terminator to include multiple statements in the body of one macro definition. Furthermore, you can use the .LABEL directive to declare labels within a macro definition.

NOTE: If you use cpp, C-style comments should only be used on separate lines.
© 1998 Hewlett-Packard Development Company, L.P.