This is how I do it for my seven segment displays.
Code:
msg_LoBatt:
PokeCode Cblank,$13,$15,$1b,$0B,$0a,$18,$18
msg_Func:
PokeCode Cblank,Cblank,Cblank,Cblank,$0f,$19,$14,$0c
'- thanks to Darrell Taylor @ picbasic forum -- Hi Darell ;)
ASM
GetAddress macro Label, Wout ; Returns the Address of a Label as a Word
CHK?RP Wout
movlw low Label
movwf Wout
movlw High Label
movwf Wout + 1
endm
ENDASM
ShowMsgLoBatt:
@ GetAddress _msg_LoBatt, _Address
goto Disp_msg
ShowMsgFunc:
@ GetAddress _msg_Func, _Address
goto Disp_msg
' Display a message from the Address specified
Disp_msg:
for gR[1] = 0 to 7
peekcode Address, gr[0]
DispBuf[gR[1]] = gR[0]
Address = Address+1
next
return
What it does is to load the starting address of the string, and Disp_msg displays the string.
Gr[0] and Gr[1] are general use registers byte wide
DispBuf is a buffer for the seven segment codes that go to the display
This will not directly work like you want it to, but it is close
Bookmarks