endm
;----------------------------------------
-; For setting up TBLPTR according to the picno
+; For setting up TBLPTR
+
+load_tblptr macro value
+;
+; Before After
+; TBLPTR* any set
+; W, STATUS any undefined
+;
+ mov_lw value & 0xff
+ mov_wf TBLPTRL
+
+ mov_lw value >> 8
+ mov_wf TBLPTRH
+
+ if value > 0xffff
+ mov_lw value >> 16
+ mov_wf TBLPTRU
+ else
+ clr_f TBLPTRU
+ endif
+ endm
load_perpic_tblptr macro flash_map_base, perpic_entry_size
;