You can use label in macro and multiple call to that macro.
Just need to define your labels as local.
Here is local used in my example:
But way your done use less FLASHCode:TFTSTR?B macro Bin MOVE?CB high (Bin), FSR2H ;load highbyte MOVE?CB low (Bin), FSR2L ;load low byte local tftstrloop local tftStrDone tftstrloop movf POSTINC2, W ; Get a character, then increment pointer BZ tftStrDone ;All strings must end with 0 ;Not Null char L?CALL tftWoutput; CALL print char in W to TFT BRA tftstrloop ;Get next chr tftStrDone: ;Null char endm ;end of macro
And you can make bfill little smaller
To save few bytes in FLASH.Code:bfill Next_Char movf POSTINC2, W ; Get a character bz exstr2 ; Null char MOVWF _g_chr L?CALL _gcga bra Next_Char exstr2 return
And I'll suggest you to put TFT_ in front all labels and variable names so there is minimal chance for user to duplicate label/variable or unintentional use one of tft variables.





Bookmarks