Re: [cc65] How to force a read from a memory mapped register w/o volatile

From: Groepaz <groepaz1gmx.net>
Date: 2010-12-07 17:59:03
On Dienstag 07 Dezember 2010, Ullrich von Bassewitz wrote:
> On Tue, Dec 07, 2010 at 03:33:53PM +0100, Groepaz wrote:
> > what about using an external symbol, the optimizer wont touch it then,
> > right? ie define HWREG=$2000 in the linker config, then import that
> > symbol and use it in the code ? shouldnt this work? :)
> 
> No. Using an external symbol won't prevent the optimizer to remove a load
> from this location if it finds that the value is never used later (given
> that volatile has no effect). Why should it?

mmh now you say it.... good question =)

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

I can make it crash!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Dec 7 17:59:49 2010

This archive was generated by hypermail 2.1.8 : 2010-12-07 17:59:52 CET