CompuServe Thread

Forum unknown · SoftwareDevelopment

#Lattice C Bug?

1 messages in this thread
#6731From: GARY SARFFJan 30, 1986 1:48 PM
I need a second opinion about something, When lattice C, (I've got vers. 3.02) compiles the statement: if(i & (1<<30)) …. the assembly code generated is: move.l -8(a6),d0 btst #6,d0 bne <somewhere> Also if I used the following: if(i & 0x40000000) … Which should be equivalent. Where in the #*&^%$#^% is it getting 6! It will work for (1<<31) except that it generates an andi.l #$80000000,d0 but that is alright, it wont work for (1<<30) or (1<<29) or (1<<28) , it does work for smaller values though. My program uses a lot of bit masking and has some masks constructed out of multiple bits ANDed and ORed together, but the code produced is nowhere near correct. Am I missing something in the manual somewhere? Any comments appreciated. Gary, (At the end of his rope) Or as Arthur Dent would say, "Would it save time if I just went mad now?"