MIPS Stack Frame Layout (Windows CE 5.0)
The stack frame consists of four areas; the parameter or argument area, the local variable area, the register save area, and the argument build area.
The calling function allocates space on the stack for all arguments, even though it may pass some of the arguments in registers.
The calling function should reserve enough space on the stack for the maximum argument list required by calls from the calling function.
The function must allocate space for at least four words, even if it passes fewer parameters.
Functions should allocate space for all arguments, regardless of whether the function passes the arguments in registers. This provides a save area for the called function for saving argument registers if these registers need to be preserved.
The function allocates argument registers for the first argument. It allocates any argument registers remaining to the second argument, and so on until it uses all the argument registers or exhausts the argument list. All remaining parts of an argument and remaining arguments go on the stack.
When thinking about argument register allocation, imagine the argument list as an unpacked structure in memory — the argument call area on the stack — where each argument is an appropriately aligned member of the structure.
The argument register allocation preserves that same alignment as if in memory. When mapping some argument lists some argument registers may not contain anything relevant the same as padding space in memory.
See Also
MIPS Calling Sequence Specification
Send Feedback on this topic to the authors