esto lo saque del foro oficial..pero no se si este bien no tengo orita el compilador ni el programador a la mano..
Device 18F452
XTAL 40
DelayMS 500
#disable Print
#disable Cursor
#enable DelayUS
Dim BPF As Byte SYSTEM
Dim BPFH As Byte SYSTEM
Dim GEN As Byte SYSTEM
Dim PP0 As Byte SYSTEM
Dim PP0H As Byte SYSTEM
Dim PP3 As Byte SYSTEM
Dim PP3H As Byte SYSTEM
Dim PP4 As Byte SYSTEM
Dim PP5 As Byte SYSTEM
Dim LCD#ENPINSELECT1 As Bit
Dim LCD#ENPINSELECT2 As Bit
Symbol LCD#DATAUS = 50
Symbol LCD#COMMANDUS = 2000
Symbol LCD_ENPORT2 = PORTB
Symbol LCD_ENPIN2= 2
LCD_DTPIN = PORTB.4
LCD_RSPIN = PORTB.3
LCD_ENPIN = PORTB.0
LCD_INTERFACE = 4 ' 4-bit Interface
LCD_LINES = 2
LCD_TYPE = 0
LCDCURSOR_12 MACRO
LCD#ENPINSELECT1 = 1
LCD#ENPINSELECT2 = 0
ENDM
LCDCURSOR_34 MACRO
LCD#ENPINSELECT1 = 0
LCD#ENPINSELECT2 = 1
ENDM
LCDCURSOR_1234 MACRO
LCD#ENPINSELECT1 = 1
LCD#ENPINSELECT2 = 1
ENDM
GoTo over#lcdcode
ASM
lcd@crs clrf BPFH
bsf BPFH,7
curs@ movwf PP5
movlw 254
Call ch@snd2
movfw PP5
GoTo ch@snd2
Print movwf PP3H
bcf LCD#ENPORT,LCD#ENPIN
bcf LCD_ENPORT2,LCD_ENPIN2
bcf LCD#RSPORT,LCD#RSPIN
bcf (LCD#ENPORT + 18),LCD#ENPIN
bcf (LCD_ENPORT2 + 18),LCD_ENPIN2
bcf (LCD#ENPORT + 18),LCD#RSPIN
movlw 15
andwf (LCD#DTPORT + 18),f
movfw PP3H
btfsc BPF,1
GoTo prt@1
movlw 58
movwf PP0H
movlw 152
Call dlus@w
movlw 51
movwf PP3
Call pr@lp
movlw 19
movwf PP0H
movlw 136
Call dlus@w
Call pr@lp
movlw 100
Call dl@us
Call pr@lp
movlw 100
Call dl@us
movlw 34
movwf PP3
Call pr@lp
movlw 40
Call pr@c
movlw 12
Call pr@c
movlw 6
Call pr@c
bsf BPF,1
movfw PP3H
bra prt@1
pr@c bsf BPF,0
prt@1 movwf PP3
btfss BPF,0
bra pr@cc
bcf LCD#RSPORT,LCD#RSPIN
sublw 3
bnc pr@sd
Call pr@sd
movlw High LCD#COMMANDUS
movwf PP0H
movlw Low LCD#COMMANDUS
Call dlus@w
bsf STATUS,0
Return
pr@cc bsf BPF,0
sublw 254
btfsc STATUS,2
GoTo pr@ex
bsf LCD#RSPORT,LCD#RSPIN
pr@sd
btfss BPF,0
pr@lp bcf BPF,0
btfsc LCD#ENPINSELECT1
bsf LCD#ENPORT,LCD#ENPIN
btfsc LCD#ENPINSELECT2
bsf LCD_ENPORT2,LCD_ENPIN2
movlw 15
andwf LCD#DTPORT,f
movfw PP3
andlw 240
iorwf LCD#DTPORT,f
nop
bra $ + 2
nop
bcf LCD#ENPORT,LCD#ENPIN
bcf LCD_ENPORT2,LCD_ENPIN2
swapf PP3,f
nop
bra $ + 2
nop
btfsc BPF,0
bra pr@lp
movlw Low LCD#DATAUS
Call dl@us
pr@ex movfw PP3H
Return
ch@snd2
btfsc BPFH,7
GoTo Print
GoTo dl@us
ENDASM
over#lcdcode:
ALL_DIGITAL = TRUE ' Set PORTA and PORTE to all digital
LCDCURSOR_1234
Cls
Print At 1,1,"hello"
Print At 2,1,"hello"
DelayMS 500
LCDCURSOR_12
Cls
LOOP:
LCDCURSOR_12
Cls
DelayUS 500
Print At 1,1,"hello"
Print At 2,1,"hello"
DelayUS 1000
LCDCURSOR_34
Cls
DelayUS 500
Print At 1,1,"hello"
Print At 2,1,"hello"
DelayUS 1000
GoTo LOOP
Stop