
void foo(SInt32 i, float f, double d, SInt16 s, UInt8 c);
Figure 2 Argument assignment with arguments of the fundamental data types

typedef struct { |
float ary[8]; |
} big_struct; |
void callee(big_struct *p, int a, float b) |
{ |
big_struct callee_struct; |
... |
*p = callee_struct; |
return; |
} |
caller() { |
big_struct caller_struct; |
callee(&caller_struct, 3, 42.0); |
} |
Type | Name | Preserved | Notes |
---|---|---|---|
General-purpose register | EAX | No | Used to return integral and pointer values. The caller may also place the address to storage where the callee places its return value in this register. |
EDX | No | Dividend register (divide operation). Available for general use for all other operations. | |
ECX | No | Count register (shift and string operations). Available for general use for all other operations. | |
EBX | Yes | Position-independent code base register. Available for general use in non–position-independent code. | |
EBP | Yes | Stack frame pointer. Optionally holds the base address of the current stack frame. A routine’s parameters reside in the previous frame as positive offsets of this register’s value. Local variables reside at negative offsets. | |
ESI | Yes | Available for general use. | |
EDI | Yes | Available for general use. | |
Stack-pointer register | ESP | Yes | Holds the address of the bottom of the stack. |