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

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-12-06 16:09:20
Hi!

On Sun, Dec 05, 2010 at 11:57:28PM -0600, Dave Dribin wrote:
> Typically the 'volatile' keyword tells the compiler not to perform
> this optimization.  Since the 'volatile' keyword is parsed, but has no
> effect, how do I go about doing this with C in cc65?

There are workarounds, but none of them is really great:

1. Write the function in assembler

2. Disable optimizations for the function that contains the statement.

3. Use the value in some way to trick the compiler.


I'm sorry, but that's one of the limitations that cannot be easily fixed.

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Dec 6 16:09:30 2010

This archive was generated by hypermail 2.1.8 : 2010-12-06 16:09:32 CET