Xilinx MicroBlaze Reference Manual page 187

Hide thumbs Also See for MicroBlaze:
Table of Contents

Advertisement

The architecture for MicroBlaze defines 32 general purpose registers (GPRs). These registers
are classified as volatile, non-volatile, and dedicated.
The volatile registers (also known as caller-save) are used as temporaries and do not
retain values across the function calls. Registers R3 through R12 are volatile, of which
R3 and R4 are used for returning values to the caller function, if any. Registers R5
through R10 are used for passing parameters between subroutines.
Registers R19 through R31 retain their contents across function calls and are hence
termed as non-volatile registers (a.k.a callee-save). The callee function is expected to
save those non-volatile registers, which are being used. These are typically saved to the
stack during the prologue and then reloaded during the epilogue.
Certain registers are used as dedicated registers and programmers are not expected to
use them for any other purpose.
Registers R14 through R17 are used for storing the return address from interrupts,
-
sub-routines, traps, and exceptions in that order. Subroutines are called using the
branch and link instruction, which saves the current Program Counter (PC) onto
register R15.
Small data area pointers are used for accessing certain memory locations with 16-
-
bit immediate value. These areas are discussed in the memory model section of this
document. The read only small data area (SDA) anchor R2 (Read-Only) is used to
access the constants such as literals. The other SDA anchor R13 (Read-Write) is used
for accessing the values in the small data read-write section.
Register R1 stores the value of the stack pointer and is updated on entry and exit
-
from functions.
Register R18 is used as a temporary register for assembler operations.
-
MicroBlaze includes special purpose registers such as:
program counter (rpc)
-
machine status register (rmsr)
-
exception status register (resr)
-
exception address register (rear)
-
floating-point status register (rfsr), branch target register (rbtr)
-
exception data register (redr)
-
memory management registers (rpid, rzpr, rtlblo, rtlbhi, rtlbx, rtlbsx)
-
processor version registers (0-12)
-
These registers are not mapped directly to the register file; and hence, the usage of these
registers is different from the general purpose registers. The value of a special purpose
registers can be transferred to or from a general purpose register by using mts and mfs
instructions respectively.
MicroBlaze Processor Reference Guide
UG984 (v2018.2) June 21, 2018
Chapter 4: MicroBlaze Application Binary Interface
www.xilinx.com
188
Send Feedback

Advertisement

Table of Contents
loading

Table of Contents