Sorry, previous postingS "took off" !!!
I might have found a bug in the compiler. I'm using the 16F819 CHIP and I think there is a bug when swithcing banks.
Compiler version is the newest 5.2 (registered).
I have declared "global" variable FLAGS at top without giving the exact location.
** CLIP from C-source **
porta = 0;
portb = 0;
trisb = 0;
trisa = 0;
FLAGS = 0xff;
FLAGS = 0x00;
** CLIP END **
** Resulting ASM-Code **
*Definition part *
## The flag goes to address 0x51, which is in BANK0