Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.csd.uwm.edu!cs.utexas.edu!usc!bbn!mit-eddie!apollo!pettinati_f From: pettinati_f@apollo.HP.COM (Fabio Pettinati) Newsgroups: comp.sys.mac.programmer Subject: Argument passing in MPW 3.0 C Message-ID: <4510a657.b8de@apollo.HP.COM> Date: 16 Aug 89 15:21:00 GMT Organization: Apollo Computer, Chelmsford, Mass. Lines: 20 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