Reputation: 386
I am trying to load a 64-bit number on a 32-bit ARM7TDMI-S microprocessor however, I am not understanding how to do so. I know that MOV and LDR all store only 32bit numbers so is there any way I can use 2 32bit registers as one 64-bit register?
Upvotes: 1
Views: 3309
Reputation: 71546
Just ask the compiler it will tell you. Obviously you cannot fit 64 bits into 32, it takes two registers.
unsigned long long fun ( unsigned long long a, unsigned long long b )
{
return(a+b);
}
00000000 <fun>:
0: e0900002 adds r0, r0, r2
4: e0a11003 adc r1, r1, r3
8: e12fff1e bx lr
Upvotes: 5
Reputation: 386
Okay, I got the answer to my own question. I have to load the lower half of the number in one register and the upper half in another. If we want to add the two numbers then we add the lower half by using ADDS
and the upper half using ADC
.
Upvotes: 0