Re: [cc65] The "Mixed-Up Toy" and other "Incredible Toys" - An Apple II DHGR Programming Adventure for the C Language Programmer

From: Greg King <greg.king51verizon.net>
Date: 2015-01-24 08:05:49
On 2015-01-23 7:35 PM, Alan Cox wrote:
>
> You probably can avoid the inline assembler by doing:
> volatile unsigned char *dhrmain = (volatile unsigned char *)0xC054;
>
> Then, you can just write:
> *dhrmain=0;
>
> or similar.

He can go even further.  That soft switch can be defined as:

#define dhrmain() (*(char *)0xC054 = __AX__)

Then,

     dhrmain();

compiles into the single assembly line:

         sta     $C054

And, the optimizer doesn't remove it!

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jan 24 09:07:30 2015

This archive was generated by hypermail 2.1.8 : 2015-01-24 09:07:32 CET