Re: [cc65] const/volatile

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2003-01-27 20:36:17


Hi!

On Wed, Jan 22, 2003 at 02:18:38PM +0100, Christian Krüger wrote:
> When 'const' mean, that no change to the given value
> is allowed, and the given value is in accu/x, then
> cc65 can rely on, that accu/x won't change inside the
> function!

"const" does not mean that register values do not change. The only thing that
"const" means that the value passed to the function is not modified by the
function. In other words, the parameter is never used as an lvalue. However,
the a and x registers are definitely modified by the function. There is no way
to write any decent 6502 code without using the accumulator.

> But to come back to the floor ;^), when somebody ask
> me what I like to see first, I would grab my old wish
> out of the box: inline functions (even when I have worse
> assumptions, which problems are tied to that feature...)

Yes, that's one of my favourites, too:-)

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-01-27 20:36:21 CET