Skip to content

Instantly share code, notes, and snippets.

@neuro-sys
Created November 19, 2011 21:52
Show Gist options
  • Save neuro-sys/1379411 to your computer and use it in GitHub Desktop.
Save neuro-sys/1379411 to your computer and use it in GitHub Desktop.
passing function pointer in PIC
temp EQU 0x20
movlw HIGH Text1
movwf PCLATH
movlw LOW Text1
movwf temp
call LCD_String
movlw HIGH Text2
movwf PCLATH
movlw LOW Text2
movwf temp
call LCD_String
LCD_String:
clrf i
L: movf temp,w
call $+2
goto $+2
movwf PCL
iorlw 0
btfsc STATUS,Z
return
call LCD_Putc
incf i,F
LCD_Wait
goto L
Text1:
movf i,w
addwf PCL,F
dt "neurosys",0
Text2:
movf i,w
addwf PCL,F
dt "Hello",0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment