ARM is a RISC structure, the movement of data from memory to CPU can only be done by l/s instruction, that is, ldr/str instruction.
For example, if you want to read data from somewhere in memory to a register, you can only use LDR
Like what:
Ldr R0, 0x12345678
is to store the value of the 0x12345678 address in the r0.
And MOV can not do this job, MOV can only move data between registers, or to move the number of immediate to register, this and x86 this CISC architecture chip difference is the biggest place.
There is no such instruction in x86 because x86 's MOV instruction can move data from memory to registers.
Another is the LDR pseudo-directive, although the LDR pseudo-directive and arm's LDR directive are very similar, but the function is not quite the same. LDR Pseudo-directives can be preceded by an immediate number = to indicate that an address is written to a register, such as:
Ldr R0, =0x12345678
In this way, the 0x12345678 address is written to the r0. Therefore, LDR Pseudo-instructions and MOV are more similar. Only the MOV instruction limits the immediate number of the length to 8 bits, that is, not more than 512. The LDR pseudo-directive does not have this limitation. If the LDR pseudo-directive is used and the immediate number followed is not more than 8 bits, then the LDR pseudo-directive is converted to the MOV instruction at the time of the actual assembly.
LDR Pseudo-directives and LDR directives are not the same thing.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
The difference between MOV and LDR in arm instructions