[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

Pseudo-ops Overview

A pseudo-operation, commonly called a pseudo-op, is an instruction to the assembler that does not generate any machine code. The assembler resolves pseudo-ops during assembly, unlike machine instructions, which are resolved only at runtime. Pseudo-ops are sometimes called assembler instructions, assembler operators, or assembler directives.

In general, pseudo-ops give the assembler information about data alignment, block and segment definition, and base register assignment. The assembler also supports pseudo-ops that give the assembler information about floating point constants and symbolic debugger information (dbx).

While they do not generate machine code, the following pseudo-ops can change the contents of the assembler's location counter:

Pseudo-ops Grouped by Function

Pseudo-ops can be related according to functionality into the following groups:

Data Alignment

The following pseudo-op is used in the data or text section of a program:

Data Definition

The following pseudo-ops are used for data definition:

In most instances, use these pseudo-ops to create data areas to be used by a program, as shown by this example.

        .csect data[rw]
greeting:       .long 'H,'O,'W,'D,'Y
        .
        .
        .csect text[pr]
                # Assume GPR 5 contains the address of 
                # csect data[rw].
        lm 11, greeting(5)

Storage Definition

The following pseudo-ops define or map storage:

Addressing

The following pseudo-ops assign or dismiss a register as a base register:

Assembler Section Definition

The following pseudo-ops define the sections of an assembly language program:

External Symbol Definition

The following pseudo-ops define a variable as a global variable or an external variable (variables defined in external modules):

Static Symbol Definition

The following pseudo-op defines a static symbol:

Support for Calling Conventions

The following pseudo-op defines a debug traceback tag for performing tracebacks when debugging programs:

Miscellaneous

The following pseudo-ops perform miscellaneous functions:

.hash Provides type-checking information.
.org Sets the value of the current location counter.
.ref
                          Creates a special type entry in the relocation table.
.rename Creates a synonym or alias for an illegal or undesirable name.
.set Assigns a value and type to a symbol.
.source
                          Identifies the source language type.
.tocof Defines a symbol as the table of contents (TOC) of another module.
.xline Provides file and line number information.

Symbol Table Entries for Debuggers

The following pseudo-ops provide additional information which is required by the symbolic debugger (dbx):

Target Environment Indication

The following pseudo-op defines the intended target environment:

Notational Conventions

White space is required unless otherwise specified. A space may optionally occur after a comma. White space may consist of one or more white spaces.

Some pseudo-ops may not use labels. However, with the exception of the .csect pseudo-op, you can put a label in front of a pseudo-op statement just as you would for a machine instruction statement.

The following notational conventions are used to describe pseudo-ops:

Name Any valid label.
Register A general-purpose register. Register is an expression that evaluates to an integer between 0 and 31, inclusive.
Number An expression that evaluates to an integer.
Expression Unless otherwise noted, the Expression variable signifies a relocatable constant or absolute expression.
FloatingConstant A floating-point constant.
StringConstant A string constant.
[ ] Brackets enclose optional operands except in the .csect and .tc pseudo-ops, which require brackets in syntax.

Related Information

See Chapter 9. Pseudo-ops for a listing of all pseudo-ops supported by the assembler.


[ Previous | Next | Contents | Home | Search ]