[comp.sys.mac.programmer] Argument passing in MPW 3.0 C

pettinati_f@apollo.HP.COM (Fabio Pettinati) (08/16/89)

Organization: Hewlett-Packard - Apollo Division

Somewhere in the MPW 3.0 C lang. manual, it is stated that (some) arguments
to functions may be passed in registers, as a means to optimize the
generated code. Some questions that came to mind are:

    1. When does this really happen?
    2. What happens when a function accepts a variable-number of
       arguments? I'm using stdargs/varargs mechanism.
    3. It's been a long time since I took a compiler writing class during my
       college days (12yrs), so bear with me :-),but how does the called function find
       out that some arguments are not in the stack, and still manage to get
       them correctly?

So far I haven't been bitten by any of these problems, but it never hurts to
know what is lurking behind the next stack frame ready to ambush. Thanks in
advance.

Fabio Pettinati
pettinati_f@apollo.com