Re: [cc65] Compiling fake6502 with cc65

From: Greg King <greg.king51verizon.net>
Date: 2014-08-17 11:16:29
On 2014-08-14 7:56 PM, Emanuele Fornara wrote:
>
> I know, I know, it doesn't make any sense; but, since I'm already
> targeting an 8-bit microcontroller, I figured I might as well test my
> program with cc65. It works; but, I've got two small issues. One is a
> forward declaration of a couple of static arrays. The other is a
> couple of casts.
> To be honest, I don't know if it's the compiler or the code; it looks
> like a corner case; and, I've got a workaround anyway; but, I reckon I
> should probably report it here nevertheless, in case anyone wants to
> have a look. Here is the diff:
>
> https://github.com/efornara/jbit/commit/678883ab4ef9375d6c78a170c00af4d5bfc537fd

         if (pgm_read_word(&addrtable[opcode]) == &acc)

also works.

If the terms are swapped:

         if (acc == pgm_read_word(&addrtable[opcode]))

then cc65 accepts that C code; but, it compiles a 32-bit comparison -- 
while acc()'s address stays at 16 bits!
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Aug 17 13:19:58 2014

This archive was generated by hypermail 2.1.8 : 2014-08-17 13:19:59 CEST