Detailed Explanation of Calling Conventions in C/C++

Detailed Explanation of Calling Conventions in C/C++

In C/C++, a calling convention is a set of rules that defines how function parameters are passed, how the stack is maintained, and how return values are passed. This ensures that both the caller and the callee have a consistent understanding of the function call. Different calling conventions are suitable for different scenarios and primarily … Read more

Detailed Explanation of Recursion in Assembly Language

Concept of Recursion Recursion is an important technique in programming, referring to a process or function that calls itself directly or indirectly in its definition. Implementing recursion in assembly language requires a deep understanding of stack operations and the function calling mechanism. Types of Recursion 1. Direct Recursion The process calls itself directly 2. Indirect … Read more

Key Considerations When Designing Subroutines for Microcontrollers

Key Considerations When Designing Subroutines for Microcontrollers

In microcontroller programming, writing subroutines is very important as it not only enhances code reusability but also makes the main program structure clearer and easier to maintain. However, writing efficient subroutines is not an easy task and requires consideration of multiple aspects. So let’s take a look at what areas need attention. 1. Subroutine Naming … Read more

Understanding FreeRTOS Stack Management: A Comprehensive Guide

Understanding FreeRTOS Stack Management: A Comprehensive Guide

Previous Article: Understanding FreeRTOS Application Scenarios In this article, the term “stack” refers to the memory area accessed by the computer (including MCU) processor through the stack pointer register. Common access methods include Push/Pop, as well as indirect addressing based on the stack pointer register. Let’s first review how local variables are stored in C … Read more