NonStop S-Series Server Description Manual (G06.24+)

TNS Execution Modes
HP NonStop S-Series Server Description Manual520331-003
6-28
SG Addressing Mode
SG Addressing Mode
For memory-reference instructions, an additional addressing mode is provided, called
the SG-relative mode. This mode is provided to permit access, from the user
environment, to system global data in the system data segment. This mode directly
addresses the first 64 locations of the system data segment (SG[0:63]), and indirectly
can address the entire 64K-word segment. Refer to Figure 6-17.
The SG-relative mode is indicated when bits 7 through 9 of a memory reference
instruction are equal to 110 (binary). Bits 10 through 15 are a positive word
displacement from SG[0]. The specification of SG-relative addressing by the
instruction overrides the DS bit setting in the Environment register; that is, the system
data segment will be accessed even if the DS bit indicates user data.
Use of the SG-relative addressing mode is restricted to privileged mode only, and thus
can be used only by callable and privileged procedures. Such procedures, when they
operate on the user’s data stack, are able to load, store, move, compare, and scan
data, using both the user data segment and the system data segment.
Indirect addressing and indexing are both permitted with the SG-relative addressing
mode.
SG-relative addressing mode is specified by 110 in the mode field of the memory
reference instruction. The first example shows a direct reference to SG[4], as
indicated by the value in the displacement field. The second example shows an
indirect reference to SG[42176], through the direct location SG[13]. (Addresses are in
decimal.) The X field specifies an index register, if used.