Nios® II Processor Reference Guide

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

7.4.3.2. Stack Frame for a Function with Variable Arguments

Functions that take variable arguments (varargs) still have their first 16 bytes of arguments arriving in registers r4 through r7, just like other functions.

In order for varargs to work, functions that take variable arguments allocate 16 extra bytes of storage on the stack. They copy to the stack the first 16 bytes of their arguments from registers r4 through r7 as shown below.

Figure 15. Stack Frame Using Variable Arguments