In the ARM architecture, the movement of data from memory to CPU can only be done by LDR/STR instructions. And MOV can only move data between registers, or move the number of immediate to register, and the length of the data can not exceed 8 bits
The following are examples of specific applications:
1. LDR R0,=label is used to load an immediate number or an address value into the specified register
1.1 If the label is an immediate number: LDR r0,=0x123; deposit 0X123 in R0
1.2 If name is an identifier: LDR r0,=label_1; The address value pointed to by Label_1 is stored in r0
2. LDR R0,[R1]; Save the value in R1 to R0
3. LDR r1,[r2, #16]; to save (r2+16) The contents of the address in R1
4. LDR R1,[R2], #4; Save the contents of the R2 address in R1, while R2=r2+4
A. STR R1,[R2]; Save the value in R1 to the address specified by R2
B. STR r1,[r2, #4]; Save the value in R1 to the address specified by r2+4
c. STR R1,[R2], #4; Save the value in R1 to the address specified by R2, and R2=r2+4
The role of IO port