CHAPTER 3 CPU FUNCTION
User’s Manual U12688EJ4V0UM00
71
3.2.1 Program register set
The program register set includes general-purpose registers and a program counter.
(1) General-purpose registers
Thirty-two general-purpose registers, r0 to r31, are available. Any of these registers can be used as a data
variable or address variable.
However, r0 and r30 are implicitly used by instructions, and care must be exercised when using these
registers. Also, r1 to r5 and r31 are implicitly used by the assembler and C compiler. Therefore, before using
these registers, their contents must be saved so that they are not lost. The contents must be restored to the
registers after the registers have been used.
Table 3-1. Program Registers
Name
Usage
Operation
r0
Zero register
Always holds 0
r1
Assembler-reserved register
Working register for generating 32-bit immediate data
r2
Interrupt stack pointer
Stack pointer for interrupt handler
r3
Stack pointer
Used to generate stack frame when function is called
r4
Global pointer
Used to access global variable in data area
r5
Text pointer
Register to indicate the start of the text area (where program
code is located)
r6 to r29
Address/data variable registers
r30
Element pointer
Base pointer when memory is accessed
r31
Link pointer
Used by compiler when calling function
PC
Program counter
Holds instruction address during program execution
(2) Program counter
This register holds the instruction address during program execution. The lower 26 bits of this register are
valid, and bits 31 to 26 are fixed to 0. If a carry occurs from bit 25 to 26, it is ignored.
Bit 0 is fixed to 0, and branching to an odd address cannot be performed.
Figure 3-1. Program Counter (PC)
31
26 25
1 0
PC
Fixed to 0
Instruction address during execution
0
After reset
00000000H
Summary of Contents for V850E/MS1 UPD703100
Page 2: ...User s Manual U12688EJ4V0UM00 2 MEMO ...
Page 6: ...User s Manual U12688EJ4V0UM00 6 MEMO ...
Page 8: ...User s Manual U12688EJ4V0UM00 8 MEMO ...
Page 12: ...User s Manual U12688EJ4V0UM00 12 MEMO ...
Page 26: ...User s Manual U12688EJ4V0UM00 26 MEMO ...
Page 68: ...User s Manual U12688EJ4V0UM00 68 MEMO ...
Page 124: ...User s Manual U12688EJ4V0UM00 124 MEMO ...
Page 198: ...User s Manual U12688EJ4V0UM00 198 MEMO ...
Page 230: ...User s Manual U12688EJ4V0UM00 230 MEMO ...