LDR {condition}
Function: Transfer 4 consecutive bytes (1 word) of data at the address pointed to by the memory address to the destination register.
The addressing mode of the LDR instruction is relatively flexible, as shown below:
LDR R0, [R1]
; read the word data at memory address R1 into register R0. LDR R0, [R1, R2]
; read the word data at memory address R1+R2 into register R0. LDR R0, [R1, #8]
; read the word data at memory address R1+8 into register R0. LDR R0, [R1], R2
; read the word data at memory address R1 into register R0, and store the value of R1+R2 into R1. LDR R0, [R1], #8
; read the word data at memory address R1 into register R0, and store the value of R1 + 8 into R1. LDR R0, [R1, R2]!;
Read the word data at memory address R1+R2 into register R0, and store the value of R1+R2 into R1. LDR R0, [R1, LSL #3]
; read the word data at memory address R1*8 into register R0. LDR R0, [R1, R2, LSL #2]
; read the word data at memory address R1+R2*4 into register R0. LDR R0, [R1,,R2, LSL #2]!
; Read the word data at memory address R1+R2*4 into register R0, and store the value of R1+R2*4 into R1. LDR R0, [R1], R2, LSL #2
; read the word data at memory address R1 into register R0, and store the value of R1+R2*4 into R1. LDR R0, Label
; Label is the program label, and Label must be within the range of -4~4KB of the current instruction.
To be careful of
LDR Rd, [Rn], #0x04
; here Rd is not allowed to be R15.
In addition, the instruction format of LDRB is similar to that of LDR, except that it reads 8 bits (1 byte) in the memory address into the destination register.
The instruction format of LDRH is also similar to that of LDR, which reads 16 bits (half word) from the memory into the destination register.
LDR R0, = 0xff
Here LDR is not an ARM instruction, but a pseudo-instruction. This is very similar to MOVE, except that the immediate value after the MOV instruction is limited. This immediate value must be a number in the range of 0X00-OXFF that is shifted right an even number of times, so MOV is more difficult to use because some numbers are not so easy to see whether they are legal.
Previous article:arm assembly instruction--STR
Next article:Parameter passing method for calling C function in ARM assembly
Recommended ReadingLatest update time:2024-11-16 15:02
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
- Ultrasonic Flow Transmitter Reference Design
- Ended: The 2nd Infineon Silicon Carbide Application Technology Development Forum
- 5728 Bare metal code running, the system crashes when executing memcoy
- DSP---C674x Framework Overview
- [Repost] Popular Science of Components: Semiconductor Thyristors
- Detailed explanation of ZigBee networking principle
- [CY8CKIT-149 PSoC 4100S Review] + PWM Analysis and Use (Part 1)
- EEWORLD University Hall----Tektronix MSO5 Oscilloscope Disassembly Video
- An article explains the essential difference between op amps and comparators
- AD8226 amplifies signal into square wave, please help