Include "Modedefs.bas"

i con 254 ' Control command byte
clr con 1 ' Clear the display

rcvbyte var byte ' First byte received

trisa = 0 ' Set porta to output
trisb = 0 ' Set portb to output

pause 500 ' Wait for LCD to start

lcdout i,clr ' Issue LCD command + clear screen

start:
serin2 portb.1,16780,[rcvbyte]
if rcvbyte = 254 then lcdcmd
lcdout rcvbyte
goto start

lcdcmd:
serin2 portb.1,16780,[rcvbyte]
lcdout i,rcvbyte
goto start
end