NonStop S-Series Server Description Manual (G06.27+)
Native Execution Mode
HP NonStop S-Series Server Description Manual—520331-004
7-2
Native Mode Uses RISC Register Conventions
Native Mode Uses RISC Register Conventions
The NonStop S-series architecture uses the RISC registers in the way that they are
defined for the RISC internal architecture. All 32 general-purpose registers,
designated GPR[0..31] or $0..$31, are used as assigned in the RISC documentation.
The following table summarizes these usages.
The native RISC interprocedure register convention is that the called procedure
preserves values in the registers shown in the “Preservation” column. Ordinarily, the
s0 through s8 registers and ra are saved (if used by the procedure) and restored, sp is
symmetrically decremented and incremented, and gp is unchanged. At a procedure
call or return, there is no live information in the registers marked temporary, except for
parameters in and values out. (Some millicode interfaces use different conventions.)
The temporary registers k0 and k1 are reserved. An interrupt preserves all the
registers except k0 and k1.
Two of the registers (sp and ra) are dedicated to the procedure call mechanism.
Figure 7-1 shows where these registers (and the global pointer) point within the user
space. The sp register designates the tip of the main stack, which is also the low-order
byte of the current procedure’s activation record. (See next topic for additional details.)
Call-out parameters are stored relative to sp, and call-in parameters and locals are
referenced relative to a frame pointer, which is usually sp. The ra register holds the
return address for returning to the calling procedure or subprocedure.
The load and store instructions apply a signed 16-bit offset to the base address in a
register, allowing access within one instruction of up to 64 kilobytes of data. Native
process global data starts at %h 08000000, so native programs typically set gp to
Names Registers Usage Preservation
$0 Constant zero
at $1 Assembler temporary Temporary
v0, v1 $2, $3 Function values Temporary
a0 through
a3
$4 through $7 Parameters passed Temporary
t0 through t9 $8 through $15,
$24, $25
Temporary registers Temporary
s0 through
s8
$16 through $23,
$30
Saved registers Preserved by called
procedure
k0, k1 $26, $27 Reserved for kernel
gp $28 Global pointer Preserved by called
procedure
sp $29 Stack pointer Preserved by called
procedure
ra $31 Return address Preserved by called
procedure