NonStop S-Series Server Description Manual (G06.27+)
TNS Execution Modes
HP NonStop S-Series Server Description Manual—520331-004
6-50
Accessing Parameters in the Called Procedure
Accessing Parameters in the Called Procedure
Procedure parameters are accessed by using the L-minus-relative addressing mode.
This mode provides access to the 32 locations just below and including the current L
register setting (L[–31:0]). Subtracting the three words used for the stack marker, this
leaves 29 words that can be directly addressed as parameters.
If value parameters are passed, the parameter location is addressed directly (indirect
bit of a memory reference instruction = 0); if reference parameters are passed, the
parameter location is used as an indirect address (indirect bit = 1). Indexing is
permitted in either mode.
Figure 6-28 shows examples of both value and reference parameter access. In both
cases, the L-minus mode is specified by a binary 1110 in bits 7 through 10 of the
instruction word. The five-bit displacement field provides for a 32-word offset (negative
direction only).
The example assumes, in both cases, that the L register currently is pointing at G[163].
That means that the data beginning at G[164] belongs to the called procedure (B). The
data preceding the stack marker (G[160] and lower) is the area for passing parameters
and can be accessed both by the calling procedure (A) and by the called procedure
(B). Any data within the L-minus addressing range (29 words) is directly accessible to
the called procedure for passed parameters.
In the first example (direct addressing), the displacement is –4 from L, and so the
content of G[159] is a value parameter that the called procedure can access and use.
In the second example (indirect addressing), the displacement is –3 from L, and so the
content of G[160] is a reference parameter pointing to location G[124]. That location
(farther back into the calling procedure’s data) contains the value that the called
procedure can use as the passed parameter.
In the first example, the displacement of –4 from L addresses a location two words
prior to the stack marker; direct addressing makes the content a value parameter. In
the second example, the displacement of –3 from L addresses the location
immediately preceding the stack marker; indirect addressing makes the content a
reference value that points further back for the parameter, to G[124] .