SP stack pointer, each exception mode has its own independent r13, which usually points to the stack dedicated to the exception mode, that is to say, the five exception modes and non-exception modes (user mode and system mode) have their own independent stacks, indexed by different stack pointers. In this way, when ARM enters the exception mode, the program can push general registers into the stack and pop them when returning, ensuring the integrity of the program status in various modes
LR Link register, generally used to store the return address; when executing instructions such as BL or BLX, it automatically stores the address of the next instruction, that is, the return address
PC Program Counter, stores the instruction to be executed
2. Program jump
B
BL
BX Rm; switch instruction set, jump to the label of another instruction set;
BLX Rm; Store the address of the next instruction of the current instruction in LR, and then jump to the address of another instruction set label
--
Seeing this, we need to note that not all function calls follow the AAPCS calling method. On the contrary, some ARM C compilers may force the return address to be stored on the stack, and then use forced jump instructions such as B or BX to jump.
Note that, in practice, not all function calls follow the AAPCS calling conventions: Instead of transferring the return address to lr register, the ARM C compiler may enforce the return address to be push onto the stack and afterwards performs a direct branch to the function through a B or BX instruction.
Previous article:Summary of memory access instructions in ARM instructions
Next article:The impact of instruction +s on the flag bit in cpsr
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- 【Silicon Labs development kit review】+SPI flash (MX25R8035F)
- Low-cost Wemos W600-PICO development board
- EEWORLD University Hall----American DIY players comprehensively test Keithley 2280S high measurement accuracy power supply
- Today at 10:00 AM, live broadcast with prizes: Melexis explains the implementation and technical support of semiconductor R&D functional safety
- Writing and running Python in the browser
- Technology Classroom | Cortex-M Architecture MCU Relocation Vector Table
- The voltage comparator outputs a negative value, why?
- Book a live broadcast to get a gift: How to solve the coexistence problem in IoT medical devices
- CCS7.2 soft C28x chip software breakpoint setting method
- I learned C language from teacher Tan Haoqiang when I was in school, but I feel that the explanation is not comprehensive enough. Please recommend some tips for microcontroller programming.