From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Cross Message-Id: <200106211413.KAA16146@augusta.math.psu.edu> To: 9fans@cse.psu.edu Subject: Re: [9fans] calling function with (variable number of) parameters In-Reply-To: <20010620155421.A1669@gmx.net> References: <20010620194218.96D3D199DD@mail.cse.psu.edu> Cc: Date: Thu, 21 Jun 2001 10:13:57 -0400 Topicbox-Message-UUID: be93d45c-eac9-11e9-9e20-41e7f4b1d025 In article <20010620155421.A1669@gmx.net> you write: >I've already tried to write it in assembler. The problem is that after the >function returns, I don't know how many args I have to pop from the stack. >And I can't get the number from a local variable, because I don't know the >frame pointer anymore (I modified SP pushing the args before I called the >function). So save space for n + 1 parameters on the stack; the last won't be used by your called function, and you could store the number of parameters in it. When you return, pop the last item off the stack, and use that to recalculate the frame pointer. - Dan C.