When the thumb instruction is executed, directly filling in the address always generates a SIGSYS signal (illegal instruction execution).
The reason is that the function is a thumb instruction, so the lowest bit of the instruction address must be set to 1 when jumping (bx uses this bit to distinguish the instruction set), so the function address is increased by one.
Switching between thumb instruction set and arm instruction set
rice R0,#5 ;Argument to function is in R0 add R1,PC,#1 ;Load address of SUB_BRANCH, Set for THUMB by adding 1 BX R1 ;R1 contains address of SUB_BRANCH+1 ;Assembler-specific instruction to switch to Thumb SUB_BRANCH: BL thumb_sub ;Must be in a space of +/- 4 MB add R1,#7 ;Point to SUB_RETURN with bit 0 clear BX R1 ;Assembler-specific instruction to switch to ARM SUB_RETURN:
The last two digits of the address of the instruction in arm state are 0,
while the last two digits of the address of the instruction in thumb state are 0.
Thumb1+1 indicates that you are about to jump into thumb state, and the system will automatically adjust the address.
Previous article:ARM assembly learning
Next article:Android ARM Assembly Learning (I)
Recommended ReadingLatest update time:2024-11-16 20:37
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How to embed OS in MSP430 series MCU
- BKP backup register
- msp430 to tft
- [A-Current Signal Detection Device] Shaanxi Province First Prize_Topic A
- Log-Periodic Antenna
- [TI Recommended Course] #TI Robot System Learning Kit (TI-RSLK) Upgraded Version#
- Why does the bandpass filter output such a waveform?
- Understanding mobile phone fast charging technology in one article
- Temperature and humidity program based on msp430f5529
- Discussion on interoperability issues of IoT devices