![](/images/backgrounds/286207/hp-hp-ux-developer-tools-reference-guide-66968743x1.png)
Subspaces
DirectivesThe .SUBSPA directive is used to declare a subspace and its attributes. As with spaces, the assembly language programmer can switch from one subspace to another, and the Assembler will fill each subspace independently as if the source code had been presented one complete subspace at a time. When the .SPACE directive is used to switch spaces, the Assembler remembers the current subspace in each space.
Several additional Assembler directives are provided as shorthand to declare and switch to some standard spaces and subspaces. For example, the .CODE directive switches to the $TEXT$ space and the $CODE$ subspace, and the .DATA directive switches to the $PRIVATE$ space and the $DATA$ subspace.
You can declare as many subspaces as you can use, but the sort key attribute should be used carefully, because the stack unwind mechanism reserves a range of sort keys 56 through 255 for the $TEXT$ space. Refer to “Compiler Conventions” on page 47 in this chapter. Some of the standard subspaces and sort keys used by the compilers are shown in Table
Table | Standard Subspaces and Sort Keys | |||
|
|
|
|
|
Space |
| Subspace | Sort Key | Use |
|
|
|
|
|
$TEXT$ |
|
| 8 |
|
|
|
|
|
|
|
| $CODE$ | 24 | Normal code. |
|
|
|
|
|
|
| $LIT$ | 16 | Literals. |
|
|
|
|
|
|
| $MILLICODE$ | 8 | Millicode library routines. |
|
|
|
|
|
|
| $SHLIB_INFO$ | 0 | Shared library information. |
|
|
|
|
|
|
| $UNWIND$ | 64 | Unwind information. |
|
|
|
|
|
$PRIVATE$ |
|
| 16 |
|
|
|
|
|
|
|
| $BSS$ | 82 | Uninitialized data and common. |
|
|
|
|
|
|
| $DATA$ | 16 | Global arrays and structures. |
|
|
|
|
|
|
| $DLT$ | 39 | Data linkage table. |
|
|
|
|
|
Chapter 3 | 43 |