Confuses ARM instruction

I can't figure out what this ARM instruction does:

strd.w r0, r1, [r2] 

I know that this is a store instruction that stores something in *r2 , but I'm not quite sure what. Why are there two source registers ( r0 and r1 ) and what does the suffix dw mean?

+4
source share
1 answer

This function stores the 64-bit contents of two 32-bit registers in memory. An 8-byte block is stored starting at the address stored in r2 . The first four bytes are taken from r0 , and the second is four bytes from r1 .

Approximate equivalent of C:

 int32 *ptr=(int32 *) r2; *(ptr) = r0; *(ptr+1) = r1; // 'ptr+1' adds four bytes to the memory position 
+8
source

Source: https://habr.com/ru/post/1382557/


All Articles