Re: [cc65] const/volatile

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-02-01 22:00:52


On Sat, Feb 01, 2003 at 05:06:37PM +0100, Christian Krüger wrote:
> >const" means that the value passed to the function is not modified by
> >the function.
>
> ...so when the value passed to the function is given in accu/x
> it means that accu/x will not change...

Maybe I'm too dumb for this. Can you please give me the section number of the
C standard where this is specified? I've not found any place in the ISO
standard where it talks about CPU registers or "accu/x". Please enlighten me.

> >There is no way to write any decent 6502 code without using the
> >accumulator.
>
> I disagree. Because I program 'a little bit object oriented' even
> in 'C' I have many 'getters' & 'setters'. So the function bodies of
> approx. 20% of my functions looks like this:

And what does this prove? To save a/x over a function call without additional
overhead, it would be necessary to write 100% of all code by just using the Y
register.

> But maybe I should use my energy for writing an enhanced optimizer
> which will support this feature... ;-)

Good idea. Please go ahead and do 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 : 2003-02-01 22:03:42 CET