Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can someone explain how LDRD arm instruction works?

I just can't find any reasonable explanation about ldrd. What will end up in r2, what in r3? ldrd r2, r3, [r1]

like image 624
you_me_on Avatar asked Sep 28 '16 14:09

you_me_on


1 Answers

In simple terms, assuming the base address is correctly aligned, ldrd r2, r3, [r1] is equivalent to:

ldr r2, [r1]
ldr r3, [r1, #4]

There are various considerations around alignment and atomicity which depend on the exact architecture version and implementation details, but note that endianness is not one of them; the lower-addressed word always goes into the even-numbered register regardless.

like image 157
Notlikethat Avatar answered Nov 15 '22 12:11

Notlikethat