3.9.2 Software Stack Frame Pointer
A stack frame is a user-defined section of memory residing in the software stack. It is used to allocate memory for temporary variables, which a function uses, and one stack frame may be created for each function. W14 is the default Stack Frame Pointer (FP) and it is initialized to 0x0000 on any reset. If the Stack Frame Pointer is not used, W14 may be used like any other Working register.
The Link (LNK) and Unlink (ULNK)
instructions provide stack frame functionality. The LNK instruction is
used to create a stack frame. It is used during a call sequence to adjust the SP, such that
the stack may be used to store temporary variables utilized by the called function. After
the function completes execution, the ULNK instruction is used to remove
the stack frame created by the LNK instruction. The LNK
and ULNK instructions must always be used together to avoid stack
overflow.
