Re: [cc65] Problem with 16/32-bit variables and conditions

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-03-11 13:52:03
Hi!

On Fri, Mar 11, 2005 at 01:04:36PM +0100, Carlos Sánchez de La Lama wrote:
> I have a problem with this piece of code, I think the compiler is
> generating wrong assembler.
[...]
> Am I right?

Yes, it's a bug. The code generator does not honor the CF_TEST flag when the
data type is long and the addressing mode is auto.

Here's the necessary patch for the snapshot version:

--------------------------------------------------------------------------
diff -c -b -r1.97 codegen.c
*** codegen.c   30 Jun 2004 19:18:56 -0000      1.97
--- codegen.c   11 Mar 2005 12:50:14 -0000
***************
*** 840,845 ****
--- 840,848 ----
          case CF_LONG:
              ldyconst (offs+3);
              AddCodeLine ("jsr ldeaxysp");
+             if (flags & CF_TEST) {
+               AddCodeLine ("jsr tsteax");
+             }
              break;

          default:
--------------------------------------------------------------------------

Thanks a lot for the report!

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 Fri Mar 11 13:52:06 2005

This archive was generated by hypermail 2.1.8 : 2005-03-11 13:52:12 CET