Volatile and Non-Volatile Registers

Values in non-volatile registers can be saved across functions calls. Another term for such registers is saved over a call registers (SOCs).

Values in volatile registers cannot be saved across functions calls. Another term for such registers is non-SOC registers.

The following table lists both the volatile and non-volatile registers.

Table 1. Volatile and Non-Volatile Registers
Unit Register Size Type Comments
Arithmetic Logic Unit (ALU) Y1 16 Volatile (non-SOC)  
  Y0 16 Volatile (non-SOC)  
  Y 32 Volatile (non-SOC)  
  X0 16 Volatile (non-SOC)  
  A2 4 Volatile (non-SOC)  
  A1 16 Volatile (non-SOC)  
  A0 16 Volatile (non-SOC)  
Arithmetic Logic Unit (ALU) A10 32 Volatile (non-SOC)  
  A 36 Volatile (non-SOC)  
  B2 4 Volatile (non-SOC)  
  B1 16 Volatile (non-SOC)  
  B0 16 Volatile (non-SOC)  
  B10 32 Volatile (non-SOC)  
  B 36 Volatile (non-SOC)  
  C2 4 Volatile (non-SOC)  
  C1 16 Non-Volatile (SOC)  
  C0 16 Non-Volatile (SOC)  
  C10 32 Non-Volatile (SOC)  
  C 36 Volatile (non-SOC) Includes volatile register C2.
  D2 4 Volatile (non-SOC)  
  D1 16 Non-Volatile (SOC)  
  D0 16 Non-Volatile (SOC)  
  D10 32 Non-Volatile (SOC)  
  D 36 Volatile (non-SOC) Includes volatile register D2.
Address Generation Unit (AGU) R0 24 Volatile (non-SOC)  
Address Generation Unit (AGU) (continued) R1 24 Volatile (non-SOC)  
  R2 24 Volatile (non-SOC)  
  R3 24 Volatile (non-SOC)  
  R4 24 Volatile (non-SOC)  
  R5 24 Non-volatile (SOC) If the compiler uses R5 as a pointer, it becomes a non-volatile register — its value can not be saved over called functions.
  N 24 Volatile (non-SOC)  
  SP 24 Volatile (non-SOC)  
  N3 16 Volatile (non-SOC)  
  M01 16 Volatile (non-SOC) Certain registers must keep specific values for proper C execution — set this register to 0xFFFF.
Program Controller PC 21 Volatile (non-SOC)  
  LA 24 Volatile (non-SOC)  
  LA2 24 Volatile (non-SOC)  
  HWS 24 Volatile (non-SOC)  
  FIRA 21 Volatile (non-SOC)  
  FISR 13 Volatile (non-SOC)  
Program Controller (continued) OMR 16 Volatile (non-SOC) Certain registers must keep specific values for proper C execution — in this register, set the CM bit.
  SR 16 Volatile (non-SOC)  
  LC 16 Volatile (non-SOC)  
  LC2 16 Volatile (non-SOC)