How are function arguments passed in C?

The only thing I know about the mechanism for passing C values ​​is that this is done either through a register or onto the stack.

Register or stack? Exactly how?

+5
source share
2 answers

I. And agreements will vary by platform.

In x86, values ​​are usually passed by the stack. On x64, preference is given to case.

In all cases, if you have too many parameters, some of them must be passed in the stack.

Refer to x86 calling conventions

+5
source

( -, ) , . push-, .

, , . , , , .

, RISC 64- .

+3

All Articles