HPlogo HP Assembler Reference Manual: HP 9000 Computers > Chapter 4 Assembler Directives and Pseudo-Operations

.SUBSPA Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .SUBSPA directive declares a new subspace or switches back to an old subspace. In 64-bit assembly programs subspaces map directly to the ELF concept of sections, so the .SUBSPA directive switches to or creates a new section. For more information, see “Sections in 64-bit Mode”.

Syntax

.SUBSPA name [,ACCESS=value][,ALIGN=value][,CODE_ONLY][,COMMON]
[,DUP_COMM][,FIRST][,FROZEN][,LOCK][,QUAD=value]
[,SORT=value][,TSPECIFIC][,UNLOADABLE][,ZERO]...

Parameters

name

An identifier that names the current subspace.

ACCESS=value

Specifies the 7-bit value for the access rights field in the PDIR (Physical Page Directory for virtual address mapping). Must be 0X2C for code, and 0X1F for data subspaces.

ALIGN=value

Specifies a value (which must be a power of 2) on which the Assembler should align the beginning of the subspace. The default value is the largest alignment requested within that subspace, or one if no alignment requests exist.

CODE_ONLY

Specifies that this subspace contains only code.

COMMON

Specifies that this subspace is a common block.

DUP_COMM

Specifies that the initialized data symbols within this subspace can have duplicate names. When you include this parameter, multiple occurrences of a universal data symbol can exist and the linker does not report a "Duplicate Definition" error.

FIRST

Specifies that the subspace must be allocated exactly at the beginning of the specified space.

FROZEN

If set, the subspace is locked into physical memory when the subspace goes into execution.

LOCK

If set, the subspace is locked into physical memory when the operating system is booted.

QUAD=value

Specifies the quadrant (0 through 3) in which the Assembler should place this subspace. The default value is zero.

SORT=value

Provides an integer value for the primary sort key. The linker orders the subspaces in the output object module according to this primary key. If several subspaces share the same primary key value, the linker lists these subspaces in the order in which it processes them. It is suggested that 24 be used for both code and data subspaces.

TSPECIFIC

Indicates that this space contains thread local storage data.

UNLOADABLE

Specifies that this subspace is not loadable into memory. Loadable subspaces must reside in loadable spaces, and unloadable subspaces must reside in unloadable spaces.

ZERO

Specifies that this subspace contains all zeros and no data appears in the output file.

Discussion

The first time the Assembler encounters a .SUBSPA directive with a new name, it uses that name to declare a new subspace. As this is the defining occurrence of that subspace, optional keywords describe attributes of that subspace.

When the Assembler encounters additional .SUBSPA directives with that name, it continues that subspace. In this case, the .SUBSPA directive can only contain the subspace name; other keywords to describe the subspace are illegal.

Example

This example shows some of the standard "subspace" definitions in a typical assembly language program.

.SUBSPA $CODE$,    QUAD=0,ALIGN=8,ACCESS=0x2c,SORT=24,CODE_ONLY

.SUBSPA $DATA$, QUAD=1,ALIGN=8,ACCESS=0x1f,SORT=16 .SUBSPA $TBSS$, QUAD=1,ALIGN=8,ACCESS=0x1f,ZERO, TSPECIFIC, SORT=40
© 1998 Hewlett-Packard Development Company, L.P.