ARM instruction ldr and str analysis

Publisher:CyborgDreamerLatest update time:2015-09-30 Source: eefocusKeywords:ldr  str Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The description of these two instructions on the S3C2440A datasheet is as follows:
 SINGLE DATA TRANSFER (LDR, STR), The single data transfer instructions are used to load or store single bytes or words of data.
 
 Simply put, it is a data transfer/storage instruction.
 
 
 
The following is the description of the two instruction formats on the datasheet:
 
{cond}{B}{T} Rd,
 
 
where:
LDR --- Load from memory into a register
STR --- Store from a register into memory
 
In the ARM architecture, data movement from memory to CPU can only be done through LDR/STR instructions. MOV can only move data between registers, or move immediate data to registers, and the length of the data cannot exceed 8 bits.
 
The following are specific application examples:
 
        1. LDR r0,=label is used to load an immediate value or an address value into a specified register
 
      1.1 If label is an immediate value: LDR r0,=0X123; store 0X123 in r0
 
     1.2 If name is an identifier: LDR r0,=label_1; store the address pointed to by label_1 into r0
 
2. LDR r0,[r1] ; store the value in R1 into r0
 
3. LDR r1,[r2,#16] ; store the contents at address (r2+16) into r1
 
4. LDR r1,[r2],#4; store the content in address r2 into r1, and r2=r2+4
 
 
 
a. STR r1,[r2] ; Store the value in r1 to the address specified by r2
 
b. STR r1,[r2,#4] ; store the value in r1 to the address specified by r2+4
 
c. STR r1,[r2],#4; store the value in r1 to the address specified by r2, and r2=r2+4
Keywords:ldr  str Reference address:ARM instruction ldr and str analysis

Previous article:Program Status Register and Operation Instructions
Next article:ADS Integrated Development Environment

Recommended ReadingLatest update time:2024-11-16 15:28

The origin and development of LDR instructions and LDR pseudo-instructions in the ARM exception vector table
1. Problem elicitation In ARM development, the exception vector table (or interrupt vector table) is in a key position because it controls the jump address when the ARM chip is reset, that is, where to call to execute the startup code. Generally speaking, the form of the exception vector table is as follows   p Ve
[Microcontroller]
The origin and development of LDR instructions and LDR pseudo-instructions in the ARM exception vector table
ARM assembly instructions ADR and LDR usage
Introduction Both of them are pseudo instructions: ADR is a pseudo instruction for reading addresses in a small range, and LDR is a pseudo instruction for reading addresses in a large range. The practical difference is: ADR is a pseudo instruction for reading an address value based on a PC relative offset or a registe
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号