PIC16: verifying PAGE local CALLs

I have this need to remove some redundant PAGESELs(for reasons) I want to check if the calls are in range, however. There is a macro for that on PICList. But it doesn't seem to work in gputils. maybe also broken on others.. unsure. This is what I've tried:

;+++++ ; PCALL page call, code for calling on same page ; outputs messages if LONG/SHORT call could/must be used n0_call MACRO LABEL LOCAL DEST_HIGH, SOURCE_HIGH, DIFF_HIGH DEST_HIGH SET (HIGH(LABEL)&0x78) ; save bit's 4:5 of dest address SOURCE_HIGH SET (HIGH($)&0x78) ; --- || --- source address DIFF_HIGH SET DEST_HIGH ^ SOURCE_HIGH ; get difference ( XOR )

IF (DIFF_HIGH == 0) ; same page, call ok CALL LABEL ELSE ERROR " Error ! Replace PCALL with LONG_CALL " ENDIF ENDM

But I can not get it to print that error message. I believe it is because of the labels being unresolved(it's relocatable mode). The assembler might just put zeros in there. Am I right, or is there a way to work around this.

Reply to
Johann Klammer
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.