RE: [cc65] Using the hardware stack

From: Dan <opendtv1yahoo.com>
Date: 2007-06-28 13:54:22
--- Christian Krüger <Christian.Krueger@pace.de>
wrote:

> an optimization I was thinking about some time ago,
> was an
> alternative C stack model were the additional stack
> is limited
> to 256 bytes and Y is the stack pointer.
> 
> The 256 bytes would be enough for many projects and
> this
> feature could also reduce the size of the code and
> increase
> speed.

It wouldn't be faster than an all-static approach. It
would probably be a bit slower, because there's no STX
absolute,Y instruction, plus you lose the use of the Y
register.

It might be more compact than all-static due to not
having to allocate static memory for
locals/parameters. But you would have to be very
careful to avoid stack overflow - 256 bytes is
abnormally small for a C stack. In fact, you would
probably want to make the stack word-aligned and use
512 bytes. Or longword-aligned and 1024, or...

It has some merit, but overall I prefer the static
approach for speed and simplicity.

Dan



       
____________________________________________________________________________________
Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
http://answers.yahoo.com/dir/?link=list&sid=396545469
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Jun 28 13:54:30 2007

This archive was generated by hypermail 2.1.8 : 2007-06-28 13:54:32 CEST