Nios® II Processor Reference Guide

ID 683836
Date 8/28/2023
Public
Document Table of Contents

7.4. Stacks

The stack grows downward (i.e. towards lower addresses). The stack pointer points to the last used slot. The frame pointer points to the saved frame pointer near the top of the stack frame.

The figure below 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 prologue in the called function has completed.

Figure 13. Stack Pointer, Frame Pointer and the Current Frame

Each section of the current frame is aligned to a 32-bit boundary. The ABI requires the stack pointer be 32-bit aligned at all times.