Re: [cc65] Solution for Variable-argument-list Problem

Date view Thread view Subject view

From: Greg King (gngking_at_erols.com)
Date: 2000-12-01 02:16:13


-----Original Message-----
From: Ullrich von Bassewitz <uz_at_musoftware.de>
Date: Wednesday, November 29, 2000 06:10 PM

> On Wed, Nov 29, 2000 at 05:32:12PM -0500, Greg King wrote:
> > The library's "enter" subroutine can compute that length.  It gets the size
> > of the entire argument-list from the caller.  Cc65 can give, to "enter,"
> > the size of the fixxed part of that list.  The subroutine can subtract one
> > size from the other, and put the difference on the stack.  After that, the
> > compiler can include code to add it to offsets whenever cc65 wants a named
> > argument.
>
> Yes, that's a good idea.  It is not even needed to change the enter
subroutine,
> since it does already store the size of all arguments into a stack location,
so
> that the correct number of parameters can be dropped on function exit. When
> generating code, the compiler can account for the known size of fixxed
parameters.

I had become so "locked" into the way my va_par() macro works
that it did not occur to me that cc65 can do one of the arithmetic
operations during compilation.

>
> I don't think this will go into the next release, since there is not enough
> time left to implement and test it, but I will have a look at it once the new
> release is out.

That is why I included my "stdarg.h" -- it lets us go halfway toward
portable source code, until you fix cc65.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2001-12-14 22:05:37 CET