assemblyarmarm7

How load a 64 bit number in a 32 bit arm processor?


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?


Solution

  • 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