TSK3000A General Purpose Registers

Frozen Content

The TSK3000A has a bank of 32 x 32-bit general purpose registers (GPRs). These registers can be accessed by the R-Type instructions.

The register bank can perform two simultaneous reads and one write, from three different addresses within the bank.

The first register in the bank, R0 at index zero, can be used as the destination register in assembly instructions but will always return a zero value (even after a write).

The last register in the bank, R31 at index 31, is used by hardware as the Return Address register. This is the register in which the various "Branch and Link" and "Jump and Link" instructions store their return address. The return is accomplished using a jr $31 instruction.

On power-on, the GPR bank of registers are all initialized to 0000_0000h. After a subsequent reset, the values in the registers do not change.

Conventional Usage of General Purpose Registers

In addition to the registers that are used directly by the hardware (R0 and R31), there are a number of registers that are used for special purpose by convention.

For assembler code, R1 is used by the Assembler to implement macro instructions when it needs to create an intermediate result. Assignment to this register using generic assembly instructions will result in warnings being generated by the Assembler, only if it uses this register during one or more machine instructions required to implement the generic instruction.

For C-code, there are also a number of registers in the GPR bank that have conventional usage. Table 1 lists the General Purpose Registers for the processor, identifying and summarizing the conventional usage of each.

Table 1. Conventional usage of General Purpose Registers.
Register
Name
Description
$0

 

Always returns a zero value

$1
at

Assembler Temporary register – used for intermediate macro instruction results

$2 - $3
$v0 - $v1

Used for expression evaluations and to hold the integer and pointer type function return values

$4 - $7
$a0 - $a3

Used for passing arguments to functions; values are not preserved across function calls. Additional arguments are passed on the stack

$8 - $15
$t0 - $t7

Temporary registers used for expression evaluation; values are not preserved across function calls

$16 - $23
$s0 - $s7

Saved registers; values are preserved across function calls

$24 - $25
$t8 - $t9

Temporary registers used for expression evaluation; values are not preserved across function calls

$26 - $27
$kt0 - $kt1
($k0 - $k1)

Used by the operating system. $kt0 is also used by the Compiler in interrupt handling routines

$28
$gp

Global pointer and context pointer

$29
$sp

Stack pointer

$30
$s8
(or $fp)

Saved register (like $s0 - $s7) (or frame pointer)

$31
$ra

Return Address register – used by Branch and Link and Jump and Link instructions to store their return address

You are reporting an issue with the following selected text and/or image within the active document: