[cc65] bug?

From: Groepaz <groepaz1gmx.net>
Date: 2009-08-26 19:22:04
(someone asked here: 
http://www.lemon64.com/forum/viewtopic.php?p=382331#382331 )

static void __fastcall__ waitraster(void) 
{ 
   if (VIC.ctrl1 & 0x80 == 0x0)  // test bit 7 of $d011 
   { 
     while (VIC.rasterline < 0xfb); 
   } 
}

gives:

 lda     #$00 
L0479: beq     L045D 
 lda     $D012 
 cmp     #$FB 
 jsr     boolult 
 jmp     L0479 
L045D: rts

whereas:

static void __fastcall__ waitraster(void) 
{ 
   if ((VIC.ctrl1 & 0x80) == 0x0)  // test bit 7 of $d011 
   { 
     while (VIC.rasterline < 0xfb); 
   } 
}

gives:

        lda     $D011
        and     #$80
        cmp     #$00
L000C:  bne     L0009
        lda     $D012
        cmp     #$FB
        jsr     boolult
        jmp     L000C
L0009:  rts


i have to admit that i didnt check what exactly the VIC macro expands into and 
what exactly it means and wether the first is actually right .... if it is, 
then it would atleast be very nice to get a warning from the compiler (gcc 
does it on similar ambiguous expressions) if that is possible at all :)

(still on 2.12.9 ... may i suggest that the tools print their revision/date or 
whatever is needed for you to identify what *exactly* i am using, too? =))

-- 

http://www.hitmen-console.org    http://magicdisk.untergrund.net
http://www.pokefinder.org        http://ftp.pokefinder.org

PROGRAM n. A magic spell cast over a computer allowing it to turn one's input 
into error messages. tr.v. To engage in a pastime similar to banging one's 
head against a wall, but with fewer opportunities for reward.

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Aug 26 19:22:05 2009

This archive was generated by hypermail 2.1.8 : 2009-08-26 19:22:07 CEST