PBP always inserts a goto INIT at location 0. Normally this is all PBP will
insert from locations 0 - 3 if you use DEFINE LOADER_USED 1 to force the ORG 4.
Here's an example of what happens with DEFINE LOADER_USED 1
ORG 0 ; Reset vector at 0
goto INIT ; Finish initialization <-- a PBP thing for initialization
ORG 4 ; Make sure no library code in first 4 loc
When you use the LCDOUT command with PBP, it inserts clrf FLAGS before goto INIT.
Here's what it looks like.
ORG 0 ; Reset vector at 0
clrf FLAGS ; Clear all flags on reset
goto INIT ; Finish initialization
ORG 4 ; Make sure no library code in first 4 loc
FLAGS is a system variable used by PBP, and it only gets inserted before goto INIT when using the LCDOUT command.
Here's what you can do to fix it to work with the Bloader software.
Open the PBPPIC14.LIB file and look for this section. Comment out clrf FLAGS as shown below. Save the library file.
Code:
;******************************************
;* Startup Code *
;* *
;* Input : None *
;* Output : None *
;* *
;* Notes : Must be first library routine. *
;******************************************
; <<other stuff snipped out here>>
LIST
ORG 0 ; Reset vector at 0
NOLIST
ifdef ICD_USED
LIST
nop ; Skip first location for ICD
NOLIST
endif
ifdef FLAGS_USED
LIST
; clrf FLAGS ; Clear all flags on reset <----- COMMENT OUT
NOLIST
endif
If you use the LCDOUT command then clear FLAGS in the begining of your PBP code. This instruction should be the first code executed.
FLAGS=0
That's it. The clrf FLAGS will not be automatically inserted at location 0, and your PBP programs will work with the Bloader software as-is.
Bookmarks