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

.SPACE Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

The .SPACE directive starts a new space or switches back to an old space. The Assembler ignores the .SPACE directive for 64-bit assembly programs. For more information, see “Sections in 64-bit Mode”.

Syntax

.SPACE name [,NOTDEFINED][,PRIVATE][,SORT=value][,SPNUM=value]
[,TSPECIFIC][,UNLOADABLE]...

Parameters

name

An identifier that names the new space.

NOTDEFINED

Specifies that the definition for this space occurs in another object module.

PRIVATE

Specifies that other programs cannot share the data in this space. The enforcement of this directive depends on the operating system.

SORT=value

Provides an integer value for the sort key. The linker orders the spaces in the output object module according to this key. It is suggested that the number "8" be used for space $TEXT$ and the number "16" be used for $PRIVATE$.

SPNUM=value

A space number constant that provides a specific number for the current space. Its use is currently optional and is ignored by the linker. If the first parameter of the .SPACE directive is an integer, it will be interpreted as the space number and any remaining parameters will be ignored.

TSPECIFIC

Indicates that this space contains thread local storage data.

UNLOADABLE

Specifies that the space resides on disk and is not loadable into main memory. Debugger data is a typical example of an unloadable space.

Discussion

The first time the Assembler encounters a .SPACE directive with a new name, it uses that name to declare a new space. As this is the defining occurrence of that space, additional keywords can describe attributes for that space.

If the Assembler encounters subsequent .SPACE directives with that name, it continues that space. In this case, where the program is re-entering a previously defined space, the .SPACE directive can only contain the space name; other keywords to describe the space are illegal.

A space can contain from one to four discrete quadrants (See the QUAD parameter of the .SUBSPA directive.) When you divide a space into multiple quadrants, you must define all the subspaces within each quadrant as a group. If subspaces for a quadrant are defined individually, program operation is unpredictable. The Assembler, however, does not check for this condition.

Example

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

.SPACE  $TEXT$,    SPNUM=0,SORT=8

.SPACE $PRIVATE$, SPNUM=1,PRIVATE,SORT=16

.SPACE $myspace$, SPNUM=7,UNLOADABLE .SPACE $THREAD_SPECIFIC$, PRIVATE, TSPECIFIC, SORT=32
© 1998 Hewlett-Packard Development Company, L.P.