From WikiChip
Difference between revisions of "risc-v/registers"
< risc-v

(Created page with "{{risc-v title|Standard Extensions}}{{risc-v isa main}} RISC-V defines a set of '''registers''' that are part of the core ISA. ==Overview == RISC-V base ISA consists of 32 ge...")
 
Line 3: Line 3:
  
 
==Overview ==
 
==Overview ==
RISC-V base ISA consists of 32 general-purpose registers <code>x1-x31</code> which hold integer values.
+
RISC-V base ISA consists of 32 general-purpose registers <code>x1-x31</code> which hold integer values. The register <code>x0</code> is hardwired to the constant <code>0</code>. RISC-V does not define a specific subroutine return address link register, but it does suggest that the standard software calling convention should use register <code>x1</code> to store the return address on a call.
 +
 
 +
The width of those registers are defined by the RISC-V base variant used. That is, for RV32, the registers are 32 [[bits]] wide, for RV64, they are 64 bits, and for RV128, those registers are 128 bit wide.
 +
 
 +
Note that RISC-V defines a special ISA ''E'' for resource-constrained embedded applications which only defines 16 registers.

Revision as of 02:05, 12 December 2017

RISC-V
Instruction Set Architecture
General
Base Variants(base)
Standard Extensions(all)
Topics

v · d · e

RISC-V defines a set of registers that are part of the core ISA.

Overview

RISC-V base ISA consists of 32 general-purpose registers x1-x31 which hold integer values. The register x0 is hardwired to the constant 0. RISC-V does not define a specific subroutine return address link register, but it does suggest that the standard software calling convention should use register x1 to store the return address on a call.

The width of those registers are defined by the RISC-V base variant used. That is, for RV32, the registers are 32 bits wide, for RV64, they are 64 bits, and for RV128, those registers are 128 bit wide.

Note that RISC-V defines a special ISA E for resource-constrained embedded applications which only defines 16 registers.