Function call Process

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.