as_300(1) — Series 300/400 Implementation
NAME
as − assembler for MC68000, MC68010, MC68020, MC68030 and MC68040
SYNOPSIS
as [options] [file]
as20 [options] [file]
DESCRIPTION
as assembles the named file (which usually has a .s suffix as in my_prog.s). If file is not specified or if - is given, standard input is used instead.
The assembler can be invoked as as (/bin/as) or as20 (/bin/as20).
By default as produces object code for the MC68020, MC68030 and MC68040 processors. The -d option can be used to produce object code for use with the MC68000 and MC68010 processors.
All undefined symbols in the assembly are treated as global.
Options
as recognizes the following options:
-L Generate entries in the linker symbol table for local as well as global symbols. Normally, only global and undefined symbols are entered into the table. This option is useful when using adb to debug assembly language programs (see adb(1)).
-l Generate entries in the linker symbol table for all global and undefined symbols, and for all local symbols except those with . or L as the first character. This option is useful when using tools such as prof on files generated by cc(1) or f77(1) (see prof(1)). Linker symbol table entries are generated for user-defined local names, but not for compiler-generated local names.
-m Process the input file using the m4 macro preprocessor before assembling it (see m4(1)).
-d Cause as to generate short-displacement forms for MC68010-compatible syntaxes, including forward references.
-o objfile Cause output object code to be placed in file objfile. If -o is not specified and the source file is read from the standard input and the object file is written to a.out. If -o is not specified and the source file is not the standard input, the object file is written to a file whose name is created by removing the .s suffix (if present) from the basename of filename file, then adding a .o suffix to the base filename. The object .o file is placed in the current directory. To prevent improper interpretation of other options, the name of objfile cannot begin with the character - or +. To prevent accidental overwriting of source files, objfile cannot end with .s or .c.
-w Suppress warning messages (errors are not suppressed).
-A Generate an assembly listing with offsets, a hexadecimal dump of the generated code, and the source text. The assembly listing goes to standard output (stdout). This option cannot be used when input is stdin.
-a listfile Generate an assembly listing in file listfile. The listing option cannot be used when input is stdin. The name of listfile cannot end with .c or .s and cannot start with the character - or +.
-O Enable span-dependent optimization. Optimization is disabled by default.
-V number Set the a_stamp field in the a.out header to be number. The -V option overrides any version pseudo-op in the assembly source. By default the a_stamp field is set to zero (see the HP Assembler Reference Manual).
+z Generate an object file for use in a shared library. Instructions with a 16-bit offset are used to access globals.
+Z Generate an object file for use in a shared library. Instructions with a 32-bit offset are used to access globals. This option results in slower code for global variable access than the +z option, and should only be used if necessary (ld gives an error if +z is insufficient — see ld(1)).
+s Generate an object file for use in a dynamic load library.
-i For external subroutine calls in position-independent code, generate a PC-relative fixup rather than procedure linkage table fixup. This option is only meaningful when used with either the +z or +Z option.
Wherever possible, the assembler should be accessed through a compilation system interface program such as cc(1).
The MC68010 instruction set is a superset of that of the MC68000. The MC68020 and MC68030 instruction sets are identical and are a superset of the MC68010. The MC68040 supports all non-privileged instructions of the MC68030 (see the HP-UX Assembler Reference Manual for details).
The as assembler supports the complete MC68000, MC68010, MC68020, MC68030 and MC68040 instruction sets. However, if you are writing code for an MC68000 or MC68010 processor, you must limit instructions and program structures to those supported by the microprocessor. Executing an unsupported instruction on an MC68000 or MC68010 processor causes an illegal instruction trap during program execution, but might not produce an error during program assembly and loading. In addition, the following instructions are not fully supported by Series 300/400 hardware, and should not be used in assembly code written for Series 300/400 HP-UX machines: tas, cas, cas2, and bkpt.
The +z, +Z, and -i options are used to assemble code for inclusion in a shared library. However, use of these options is not sufficient; the code must be PIC (position independent code). For details on shared libraries and PIC refer to the manual Programming on HP-UX.
EXTERNAL INFLUENCES
International Code Set Support
Single- and multi-byte character code sets are supported.
DIAGNOSTICS
If the name chosen for the output file ends with .c or .s or starts with the character + or -, the assembler issues an appropriate complaint and quits. When a syntactic or semantic error occurs, a single-line diagnostic is produced that includes the line number and file name where the error occurred.
WARNINGS
If the -m option is used, keywords for m4 cannot be used as symbols in the input file because m4 cannot determine which are assembler symbols and which are real m4 macros.
The displacement value for the movp instruction must be a first-pass absolute 16-bit value.
Expressions cannot have more than one forward-referenced symbol, except for the special form <symbol>-<symbol>.
AUTHOR
as was developed by HP.
FILES
/usr/tmp/* temporary files, which can be changed by using TMPDIR (see tmpnam(3S)).
file.o object file
SEE ALSO
as_800(1) (Series 800 Implementation), adb(1), astrn(1), atime(1), atrans(1), cc(1), f77(1), ld(1), m4(1), nm_300(1), nm_800(1), prof(1), crt0(3), tmpnam(3s), a.out_300(4), a.out_800(4).
HP-UX Assembler Reference Manual and ADB Tutorial for Series 300/400 Computers,
Programming on HP-UX.
Hewlett-Packard Company — HP-UX Release 9.0: August 1992