upd70f3402 Renesas Electronics Corporation., upd70f3402 Datasheet - Page 63

no-image

upd70f3402

Manufacturer Part Number
upd70f3402
Description
32-/16-bit Single-chip Microcontroller With Can Interface
Manufacturer
Renesas Electronics Corporation.
Datasheet
3.2.1 Program register set
The program registers include general-purpose registers and a program counter.
(1)
(2)
r0
r1
r2
r3
r4
r5
r6 to r29 Register for address/data variable
r30
r31
PC
Name
PC
General-purpose registers (r0 to r31)
Thirty-two general-purpose registers, r0 to r31, are available. Any of these registers can be used
to store a data variable or an address variable.
However, r0 and r30 are implicitly used by instructions and care must be exercised when these
registers are used. r0 always holds 0 and is used for an operation that uses 0 or addressing of off-
set 0. r30 is used by the SLD and SST instructions as a base pointer when these instructions
access the memory. r1, r3 to r5, and r31 are implicitly used by the assembler and C compiler.
When using these registers, save their contents for protection, and then restore the contents after
using the registers. r2 is sometimes used by the real-time OS. If the real-time OS does not use r2,
it can be used as a register for variables.
Program counter (PC)
The program counter holds the instruction address during program execution. The lower 32 bits of
this register are valid. Bits 31 to 26 are fixed to 0. A carry from bit 25 to 26 is ignored even if it
occurs.
Bit 0 is fixed to 0. This means that execution cannot branch to an odd address.
Zero register
Assembler-reserved register
Register for address/data variable (if real-time OS does not use r2)
Stack pointer
Global pointer
Text pointer
Element pointer
Link pointer
Program counter
31
Fixed to 0
26 25
Usage
Figure 3-2: Program Counter (PC) Format
User’s Manual U16702EE3V2UD00
Table 3-1: Program Registers
Chapter 3 CPU Function
Instruction address under execution
Always holds 0.
Used as working register to create 32-bit immediate data
Used to create a stack frame when a function is called
Used to access a global variable in the data area
Used as register that indicates the beginning of a text area
(area where program codes are located)
Used as base pointer to access memory
Used when the compiler calls a function
Holds the instruction address during program execution
Operation
1 0
0
00000000H
After reset
63

Related parts for upd70f3402