ARM Overview: Difference between revisions

[unchecked revision][unchecked revision]
m (Reverted edits by Pancakes (talk) to last revision by Solar)
Line 109:
internally the processor maps R13 (SP) to a different address in it's register file. And, all can be represented by the value 0xD in hexadecimal or 1101 in binary.
 
=== Calling Convention Cheat Sheets ==
 
Here is a quick overview of common calling conventions. Note that the calling conventions are usually more complex than represented here (for instance, how is a large struct returned? How about a struct that fits in two registers? How about va_list's?). Look up the specifications if you want to be certain. It may be useful to write a test function and use gcc -S to see how the compiler generates code, which may give a hint of how the calling convention specification should be interpreted.
 
{| {{wikitable}}
! Platform
! Return Value
! Parameter Registers
! Additional Parameters
! Stack Alignment
! Scratch Registers
! Preserved Registers
! Call List
|-
| ARM || r0, r1 || r0, r1, r2, r3 || stack || 8 byte<sup>[[#Note1|1]]</sup> || r0, r1, r2, r3, r12 || r4, r5, r6, r7, r8, r9, r10, r11, r13, r14 ||
|}
 
<small id="Note1">Note 1: Stack is 8 byte aligned at all times outside of prologue/epilogue of function.</small>
 
==Instructions==
Anonymous user