Hey you crazy coders. Great to see lots of buzz about user developed apps around here at the moment ![]()
I hope someone might know a trick for me… if I use a bitshift in C with the >> or << operators, then the ASM generated is a RRCF or RLCF. These both use the Carry bit (statusbits.C aka STATUS.0). The carry bit is cleared before the shift even if I don’t specify it ![]()
Is there a way to have C generate a RRNCF or RLNCF instead? There are certain cases where I’d be better off without it…
Is there a way to NOT clear the carry bit before a bitshift?
While I’m on the subject of bitfields, I wonder if anyone has tried this and might be able to save me a few hours experimenting…Which is faster in a FOR loop:
Declare your bitfield in a union as normal
Test bit ‘n’ in the loop
or…
Declare the bitfield as a normal char, bitshift, and test the carry bit
Once upon a time I remember TK saying that bitfields could slow things down, but looking at the generated code, I suspect that the newer versions of SDCC may have fixed that problem. For example, ‘statusbits.C = 0’ becomes ‘BCF STATUS.0’… And I think I remember AC saying that bitfields are limited to 8 bit?
Lootts of questions…