What's the difference between that instructions? By example in the ARM9 processor, it shouldn't be:
ASM: mov r0, 0
C: r0 = 0;
ASM: ld r0, 0
C: r0 = 0;
?
I don't know why to use one or other :S
What's the difference between that instructions? By example in the ARM9 processor, it shouldn't be:
ASM: mov r0, 0
C: r0 = 0;
ASM: ld r0, 0
C: r0 = 0;
?
I don't know why to use one or other :S
It must be:
ASM: mov r0, 0
C: r0 = 0;
ASM: ld r0, 0
C: r0 = *(pc + 0);
Check out this reference card, must have if you're developing for ARM on ASM.
Usually the LoaD instructions are used to load data from memory (directly or indirectly) into a register, while the MOVe instruction "moves" (copies) data from an operand to a register. In the ARM case, the source operand is a value (a constant) or a register (and both can be shifted/rotated before copying into the destination register).
So the first (mov r0, #0
?), set to 0 the register r0; the second (a pseudo-op for ldr
?) should load the data pointed by pc (r15) plus offset 0, and so be equivalent to r0 = *(pc + 0)
)
Whether it is called MOV or LD depends on the particular assembly language. For example, the Z80 assembly language uses LD for everything, including assignment between registers and assignment of immediate values to registers.
In general you should always look up the meaning of mnemoics in the particular assembly language you are using.