This chapter provides a brief overview of the Solaris x86 assembler as. This chapter discusses the following topics:
The Solaris x86 assembler as translates Solaris x86 assembly language into Executable and Linking Format (ELF) relocatable object files that can be linked with other object files to create an executable file or a shared object file. (See Chapter 7, Object File Format, in Linker and Libraries Guide, for a complete discussion of ELF object file format.) The assembler supports macro processing by the C preprocessor (cpp) or the m4 macro processor. The assembler supports the instruction sets of the following CPUs:
Intel 8086/8088 processors |
Intel 286 processor |
Intel386 processor |
Intel486 processor |
Intel Pentium processor |
Intel Pentium Pro processor |
Intel Pentium II processor |
Pentium II Xeon processor |
Intel Celeron processor |
Intel Pentium III processor |
Pentium III Xeon processor |
Advanced Micro Devices Athlon processor |
Advanced Micro Devices Opteron processor |
There is no standard assembly language for the x86 architecture. Vendor implementations of assemblers for the x86 architecture instruction sets differ in syntax and functionality. The syntax of the Solaris x86 assembler is compatible with the syntax of the assembler distributed with earlier releases of the UNIX operating system (this syntax is sometimes termed “AT&T syntax”). Developers familiar with other assemblers derived from the original UNIX assemblers, such as the Free Software Foundation's gas, will find the syntax of the Solaris x86 assembler very straightforward.
However, the syntax of x86 assemblers distributed by Intel and Microsoft (sometimes termed “Intel syntax”) differs significantly from the syntax of the Solaris x86 assembler. These differences are most pronounced in the handling of instruction operands:
The Solaris and Intel assemblers use the opposite order for source and destination operands.
The Solaris assembler specifies the size of memory operands by adding a suffix to the instruction mnemonic, while the Intel assembler prefixes the memory operands.
The Solaris assembler prefixes immediate operands with a dollar sign ($) (ASCII 0x24), while the Intel assembler does not delimit immediate operands.
See Chapter 2, Solaris x86 Assembly Language Syntax for additional differences between x86 assemblers.
During the translation of higher-level languages such as C and Fortran, the compilers might invoke as using the alias fbe (“Fortran back end”). You can invoke the assembler manually from the shell command line with either name, as or fbe. See the as(1) man page for the definitive discussion of command syntax and command line options.