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 17:41:50
Hi!

On Mon, Dec 06, 2010 at 09:49:08AM -0600, Dave Dribin wrote:
> I tried using inline assembler, and it still got optimized out:

This is why I didn't write "inline assembler". You may want to use a separate
assembler module.

> > 2. Disable optimizations for the function that contains the statement.
>
> Hrm... that's not ideal. It generates extraneous code with ldx #$00:

This is why I wrote that neither of the workarounds is really great.

> Any other ideas?  As a future work around, perhaps we could be able to
> disable optimizations on a block level:

At least with the current structure, this is not possible, otherwise I would
have added this already. The optimizer traces uses of registers, loads and
stores. And if these information is lost, because parts of a function isn't
optimized, it is not possible to use optimization for the remainder.

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 17:41:59 2010

This archive was generated by hypermail 2.1.8 : 2010-12-06 17:42:03 CET