HP-UX Architecture Conventions

Spaces

code is placed into space register 7 (%sr7). System code is placed into quadrant three of the system space (offsets 0xC0000000 through 0xFFFFFFFF). Table 3-1 on page 41 shows the memory layout on HP-UX.

Table 3-1

Memory Layout on HP-UX

 

 

 

 

 

 

 

 

 

 

%sr4

%sr5

%sr6

%sr7

 

 

 

 

 

 

 

0x00000000

Program

 

 

 

 

 

code

 

 

 

 

 

 

 

 

 

 

0x40000000

 

Program

 

 

 

 

 

data stack

 

 

 

 

 

Shared

 

 

 

 

 

library data

 

 

 

 

 

 

 

 

 

0x80000000

 

 

Shared

 

 

 

 

 

memory

 

 

 

 

 

Shared

 

 

 

 

 

library text

 

 

 

 

 

 

 

 

0xC0000000

 

 

 

System code

 

 

 

 

 

 

You can define spaces other than $TEXT$ and $PRIVATE$ in a program file by declaring a special kind of space called an unloadable space. Unloadable spaces are treated as normal spaces by the linker, but as the name implies, are not actually loaded when a program is executed. Unloadable spaces are typically used by compilers to store extra information within a program file. The most common example of an unloadable space is $DEBUG$, which is used to hold symbolic debugging information.

The sort key attribute allows the programmer to control the placement of a space relative to the other spaces. The linker places spaces with lower sort keys in front of spaces with higher sort keys.

The .SPACE directive is used to declare spaces. The assembly language programmer is not required to fill one space before beginning another. When a space is first declared, the Assembler begins filling that space. The .SPACE directive can also be used to return to a previously declared space, and the Assembler continues to fill it as if there had been no intervening spaces.

Chapter 3

41