Specifications

Table Of Contents
Altera Corporation 7–3
October 2007 Nios II Processor Reference Handbook
Application Binary Interface
The endianness of values greater than 8-bits is little endian. The upper
8 bits of a value are stored at the higher byte address.
Stacks
The stack grows downward (i.e. towards lower addresses). The Stack
Pointer points to the last used slot. The frame grows upwards, which
means that the Frame Pointer points to the bottom of the frame.
Figure 7–1 shows an example of the structure of a current frame. In this
case, function a() calls function b(), and the stack is shown before the
call and after the prolog in the called function has completed.
r16
vvCallee-Saved General-Purpose Registers
r17
vv
r18
vv
r19
vv
r20
vv
r21
vv
r22
vv
r23
vv
r24 et
Exception Temporary
r25 bt
Break Temporary
r26 gp
v Global Pointer
r27 sp
v Stack Pointer
r28 fp
v
Frame Pointer (2)
r29 ea
Exception Return Address
r30 ba
Break Return Address
r31 ra
v Return Address
Notes to Ta b le 7 – 2 :
(1) A function may use one of these registers if it saves it first. The function must restore the register's original value
before exiting.
(2) If the frame pointer is not used, the register is available as a temporary. See “Frame Pointer Elimination” on
page 7–4.
Table 7–2. Nios II ABI Register Usage (Part 2 of 2)
Register Name
Used by
Compiler
Callee Saved
(1)
Normal Usage