;
; _Print macro
;
_Print MACRO str ; print in-line string macro
call PutString ;
db str,0
ENDM
;
; usage examples
;
_Print "Satellite AOS:\n\r"
_Print "Satellite LOS:\n\r"
;
;******************************************************************
;
; PutString subroutine - print in-line string via Stack and TBLPTR
;
; string must be terminated with a 00 byte and does not need
; to be word aligned
;
PutString
movff TOSL,TBLPTRL ; copy return address into TBLPTR
movff TOSH,TBLPTRH ;
clrf TBLPTRU ; assume PIC with < 64-KB
PutNext
tblrd *+ ; get in-line string character
movf TABLAT,W ; last character (00)?
bz PutExit ; yes, exit, else
rcall Put232 ; print character
bra PutNext ; and do another
PutExit
btfsc TBLPTRL,0 ; odd address?
tblrd *+ ; yes, make it even (fix PC)
movf TBLPTRH,W ; setup new return address
movwf TOSH ;
movf TBLPTRL,W ;
movwf TOSL ;
return ;
;
;******************************************************************