Referring to Integer Registers in Alpha Inline Assembly Code

Alpha systems have 32 integer registers, each of which is 64 bits wide. Integer registers are sometimes referred to as general registers in other system architectures. Integer registers have the names r0 to r31. Integer register r31 always contains the value 0. All other integer registers can be used interchangeably, except for integer register r30, which is assumed to be the stack pointer by certain PAL code.

Note that, for historical reasons, it is possible to use several alias names for the integer registers on Alpha and the compiler will accept any of the forms listed in the following table. When creating the optional machine code listing (.COD) file, the compiler will display all integer register references using the following preferred names: v0, t0..t12, s0..s5, a0..a5, ra, at, gp, sp, or zero.

The following table describes the Alpha integer register naming conventions for Windows NT. For additional information, please see the Windows NT for Alpha Systems Calling Standard, Revision 1.11, which is included in Books Online with Visual C++ for Alpha.


Register
name
Alternate names
(for compatibility across DIGITAL operating systems)


Usage
r0 v0, $0, $v0, %v0, $r0, or %r0 Function value register. In a standard call that returns a non-floating-point function result in a register, the result must be returned in this register. In a standard call, this register may be modified by the called procedure without being saved and restored.
r1..r8 t0..t7, $1..$8, $t0..$t7, %t0..%t7, $r1..$r8, or %r1..%r8 Conventional scratch registers. In a standard call, these registers may be modified by the called procedure without being saved and restored.
r9..r14 s0..s5, $9..$14, $s0..$s5, %s0..%s5, $r9..$r14, or %r9..%r14 Conventional saved registers. If a standard-conforming procedure modifies one of these registers, it must save and restore it.
r15 s6, fp, $15, $s6, $fp, %s6, %fp, $r15, or %r15 Stack Frame Base register. For procedures with a run-time variable amount of stack, this register is used to point at the base of the stack frame (fixed part of the stack). For all other procedures, this register has no special significance. If a standard-conforming procedure modifies this register, it must save and restore it.
r16..r21 a0..a5, $16..$21, $a0..$a5, %a0..%a5, %0..%5, $r16..$r21, or %r16..%r21 Argument registers. In a standard call, up to six non-floating-point items of the argument list are passed in these registers. In a standard call, these registers may be modified by the called procedure without being saved and restored.
r22..r25 t8..t11, $22..$25, $t8..$t11, %t8..%t11, $r22..$r25, or %r22..%r25 Conventional scratch registers. In a standard call, this register may be modified by the called procedure without being saved and restored.
r26 ra, $ra, %ra, $26, $r26, or %r26 Return Address register. In a standard call, the return address must be passed and returned in this register.
r27 t12, $t12, %t12, $27, $r27, or %r27 Conventional scratch register. In a standard call, this register may be modified by the called procedure without being saved and restored.
r28 at, $at, %at, $28, $r28, or %r28 Volatile scratch register. The contents of this register are always unpredictable after any external transfer of control either to or from a procedure. This applies to both standard and nonstandard calls. This register may be used by the operating system for external call fixup, autoloading, and exit sequences.
r29 gp, $gp, %gp, $29, $r29, or %r29 Global pointer or saved register. In a main (static) image, this register contains a pointer to a region of global storage (addresses and variable) constructed by the linker. In a dynamic-link library (DLL), this register must not be used in any way.
r30 sp, $sp, %sp, $30, $r30, or %r30 Stack Pointer. This register contains a pointer to the top of the current operating stack. Aspects of its usage and alignment are defined by the hardware architecture. Various software aspects of its usage and alignment are defined in the Windows NT for Alpha Systems Calling Standard, Section 3.2.1, Call Conventions.
r31 zero, $31, $zero, %zero, $r31, %r31 ReadAsZero/Sink. Hardware defined: binary zero as a source operand, sink (no effect) as a result operand.

Note    Because Windows NT does not have a notion of pv (procedure value), the $pv and %pv forms of register specifiers used on DEC™ C for DIGITAL UNIX are not available on Windows NT.