Re: [cc65] volatile

Date view Thread view Subject view

From: Ullrich von Bassewitz (uz_at_musoftware.de)
Date: 2002-04-12 19:37:26


Hi!

On Fri, Apr 12, 2002 at 07:02:42PM +0200, Stephan Lesch wrote:
> and sorry if the following is an RTFM question... 

No, it is not :-)

> since the compiler ignores
> volatile variables, can I assume that it will generate a load/store from/to
> the address of a variable every time I access it? I'm thinking about zero
> page locations that get changed by a Rom routine I call, or memory locations
> I use as an interface with an external interrupt handler...

Yes, you can assume that. There are not many registers to keep the value
anyway...

But as groepaz said, you should nevertheless use volatile in your sources, so
your code is compatible with standard C (and future versions of the compiler).

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 : 2002-04-12 19:37:25 CEST