Question: I have a C function witch looks like:

```
int foo(int a, long long b);

```

I'm trying to call it from arm assembly, but I don't know how to deal with the second parameter(`long long`).

Answer: 
The [ARM EABI/AAPCS](http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf) specifies that 64bit types should be passed in 2 registers which are next to each other and the first register must be even numbered. In little endian mode the high part resides in the higher numbered register, while the low part is put in the lowered numbered one. In big endian mode it's vice versa.

Both requirements are there to accomodate the strd/ldrd instructions, which can save two registers in a single instructions.

So, to pass 0x0123456789abcdef for your example in little endian mode you have to load the registers in the following way:

```
mov r0, a
// R1 is unused
ldr r2, =0x89abcdef
ldr r3, =0x01234567

```
(Beware: wrong answer; cannot delete it because the comments contain info)

According to the ARM ABI, the second parameter is passed in registers `r1` and `r2`. If your machine is little-endian, pass the low part in `r1` and the high one in `r2` (i don't know if this is opposite for big-endian machines). So to call the function with a parameter e.g. 0x123456789abcd:

```
MOV r0, ... (the value of "a")
MOV r1, #0x6789abcd
MOV r2, #0x12345
... (call the function)

```