chiark / gitweb /
new load_tblptr macro
authorian <ian>
Sun, 25 Dec 2005 23:13:40 +0000 (23:13 +0000)
committerian <ian>
Sun, 25 Dec 2005 23:13:40 +0000 (23:13 +0000)
detpic/common.inc

index 2bf36e386d4a292e3bd84ab2631dd843ec9301dd..a589da6aa78e2be6160a07aa2698464407e28a82 100644 (file)
@@ -182,7 +182,27 @@ tblrd_postdec_fixup macro
        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
 ;