Nios II Classic Processor Reference Guide

ID 683620
Date 10/28/2016
Document Table of Contents 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 8. Stack Frame Using Variable Arguments