Due to the occasional opportunity, my colleague workshop talked about the scheduling process of Ti chip DSP functions from the perspective of compilation, mainly the use of registers in the function scheduling process, the common process of function scheduling is summarized here.
The caller starts to call the function. the caller presses the stack of function parameters from right to left. 2. the caller pushes the return address to the stack. 3. apply the register EBP to the stack (record the bottom pointer of the current caller stack); 4. assign ESP to EBP (use the top pointer of the current caller stack as the bottom pointer of the function); 5. the compiler will push the local variables in the function to the stack in sequence; 6. After the invocation is completed, the local variables are output to the stack and EBP is restored. 7. The return value address is output to the stack. The program counter (PC) points to the address, returns to the caller's call location, and continues the execution.
The stack diagram is as follows:
Function call Process