you_me_on
you_me_on

Reputation: 61

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]

Upvotes: 5

Views: 8747

Answers (1)

Notlikethat
Notlikethat

Reputation: 20924

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.

Upvotes: 12

Related Questions