ldr 中的相同源和目标寄存器

tan*_*grs 3 assembly arm

ldr r0,[r0]在 ARM 汇编中这样做合法吗?

Var*_*der 5

如有疑问,请务必参阅 ARM 架构参考手册,该手册可在 arm.com 上找到。它说:

The destination register. The SP can be used. The PC can be used, provided the
instruction is either outside an IT block or the last instruction of an IT block.
If the PC is used, the instruction branches to the address (data) loaded to the PC.
In ARMv5T and above, this branch is an interworking branch, see Pseudocode details of
operations on ARM core registers on page A2-12.
Run Code Online (Sandbox Code Playgroud)

它并没有说目标寄存器不能与基址寄存器相同。即,答案是YES,它们可以是相同的。