8
32000D–04/2011
AVR32
anisms are in place to make sure the nonsecure software can not read or modify instruction or
data belonging to the secure software. The secure state is described in
chapter 4.2.5
Entry and Exit Mechanism
2.6
Register File
page 7 has a dedicated context. Note that the Stack Pointer (SP), Program Counter (PC) and
the Link Register (LR) are mapped into the register file, making the effective register count for
each context 13 general purpose registers. The mapping of SP, PC and LR allows ordinary
instructions, like additions or subtractions, to use these registers. This results in efficient
addressing of memory.
Register R12 is designed to hold return values from function calls, and the conditional return
with move and test instruction use this register as an implicit return value operand. The load mul-
tiple and pop multiple instructions have the same functionality, which enables them to be used
as return instructions.
The AVR32 core’s orthogonal instruction set allows all registers in the register file to be used as
pointers.
2.6.1
Register file in AVR32A
The AVR32A is targeted for cost-sensitive applications. Therefore, no hardware-shadowing of
states are placed on the system stack, not in dedicated registers as done in AVR32B. A shad-
owed stack pointer is still provided for the privileged modes, facilitating a dedicated system
stack.
When an exception occurs in an AVR32A-compliant implementation, the status register and
return address are pushed by hardware onto the system stack. When an INT0, INT1, INT2 or
INT3 occurs, the status register, return address, R8-R12 and LR are pushed on the system
stack. The corresponding registers are popped from stack by the rete instruction. The scall and
rets instructions also use the system stack to store the return address and status register.
Table 2-4.
Entry and exit from states, modes and functions
Entry method
Exit method
Non-maskable Interrupt
Signal on NMI line
rete
Exception Mode
Internal error signal generated
rete
Interrupt3
Signal on INT3 line
rete
Interrupt2
Signal on INT2 line
rete
Interrupt1
Signal on INT1 line
rete
Interrupt0
Signal on INT0 line
rete
Supervisor Mode
scall instruction
rets
Application Mode
Returned to from any of the above modes
Can not be exited from
Subprogram
Function call
ret{cond}, ldm, popm,
mov PC, LR
Secure state
sscall
retss