|For more, see:||SPARC at Enchanted Learning|
There are 32 integer registers available in the SPARC architecture. Each of these registers holds one word (32 bits) of data. All integer calculations are carried out on these 32-bit quantities.
The 32 registers are divided into four groups, with eight registers in each group. Each of the registers has two or three different names that you can call it by; the names are synonymous, so code for clarity. The name that is usually preferred is in boldface in the table below.
|Global registers||%g0, %r0||Always contains the value 0. (It is legal to use an instruction which ostensibly stores a value in %g0; it just won't actually change %g0's value.)|
|%g1, %r1||Registers %g1 through %g7 are accessible globally, throughout your entire program, in all its routines.|
|Output registers||%o0, %r8||Output registers are used to communicate with a called routine. Parameters are passed by placing them in registers %o0 through %o5 before jumping to the routine. If a called function returns a value, that value will be found in %o0 after the function returns.|
|%o6, %r14, %sp||Stack pointer. Do not use for data.|
|%o7, %r15||Address for a called routine to return to. Do not use for data.|
|Local registers||%l0, %r16||Local registers are used to store data local to a routine. Normally when a routine is called, the current local registers are saved, and a new set of local registers is allocated for the routine. When the routine returns, the old set of local registers is restored.|
|Input registers||%i0, %r24||Input registers are used for communication with the calling routine (the routine that called the current routine). Parameters that are passed in can be read from registers %i0 through %i5. If a value is to be returned, that value should be stored in %i0 before returning.|
|%i6, %r30, %fp||Frame pointer. Do not use for data.|
|%i7, %r31||Return address. Do not use for data.|
Copyright 1998-1999 Enchanted Learning Software.
|Search the Enchanted Learning website for:|