OK, I know what I said, but look at this.
RC0 = (PORTB | 0x0F) ? 1 : 0;
Produces this code:
BCF 0x3, 0x5
BCF 0x3, 0x6
MOVF 0x6, W
IORLW 0xf
BTFSC 0x3, 0x2
GOTO 0x7fc
BCF 0x3, 0x5
BCF 0x3, 0x6
BSF 0x7, 0
GOTO 0x7de
BCF 0x3, 0x5
BCF 0x3, 0x6
BCF 0x7, 0
Basically what you'd expect - it doesn't do what I need, of course, because I need a 'COMF' somehow after the IORLW. So lets stick in a bitwise operator to do that:
RC0 = ~(PORTB | 0x0F) ? 1 : 0;
Produces this:
BCF 0x3, 0x5
BCF 0x3, 0x6
BSF 0x7, 0
That's it! Just complete bollocks. No testing, no nothing, just sets RC0 to 0, thank you very much. No wonder the sodding code doesn't work.
(~PORTB & 0xF0) also (obviously) produces a working version of code.
Thanks for listening.
John