Re: [cc65] c64 question

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2001-03-19 21:16:08


On Mon, Mar 19, 2001 at 01:25:43PM -0600, Mike McCarty wrote:
> > But that's another 4 cycles for each and every stack operation. C is
> > quite stack intensive.
>
> Depends on how it is implemented.

I remember having discussed this some time ago. Anyway...

4 cycles is the time needed to execute a cli/sei pair. So it would be really
interesting to see an implementation needing less than this. And a "perfect"
implementation would not assume that interrupts are enabled on entry, so the
flags register has to be saved and restored later, which makes it 9 cycles
instead of just 4.

> Also, one could use a pragma to turn on/off the extra code.

Since the code is buried in the library, a #pragma would not work. One would
have to generate and maintain two different libraries to link against. Each
platform would need an additional library file.

Maybe I would give it a second thought if there weren't a better solution.
I've already suggested to use a wrapper function, and there's already an
implementation of it. Ok, it's for the BRK stuff instead of IRQ, but this is
really similar. The wrapper solution has none of the disadvantages mentioned,
and it is easy to use and to maintain. So why not use it?

Regards


	Uz


--
Ullrich von Bassewitz                                  uz_at_musoftware.de
----------------------------------------------------------------------
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:39 CET