Sorry for my earlier muddled post. I've done some more work on the problem and have pinned down my difficulty.

I am compiling using PBPL and using a graphic LCD with 4 driver chips.
The GLCD is 240 pixels wide and I need to activate the Chip Selects as the display sweeps along:

0 to 63 CS1
64 to 127 CS2
128 to 191 CS3
192 to 239 CS4

The chip selects are connected to PORTB and my code is:

Code:
clear
DEFINE OSC 40	' Run on PIC18F8722, HSPPL
ADCON1	= $0F	' Set PortA to digital

TRISB=0               ' Make Port B outputs
PORTB=0	             ' clear the port

X	var	byte

Loop:
PORTB=$0		
for X = 0 to 239
	if X<64 then PORTB=$01
	if X>63 and X<128 then PORTB=$02
	if X>127 and X<192 then PORTB=$04
	if X>191 then PORTB=$08		
	pause 5
next X
goto Loop
If I compile using PBP it works properly and the chip selects turn on/off as X goes from 0 to 239.

If I compile using PBPL it does not work.

I need to use the LONG compilation. Any idea what is going wrong?

Regards Bill Legge