From: ian Date: Sun, 25 Dec 2005 23:13:40 +0000 (+0000) Subject: new load_tblptr macro X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=6ac1506664212b4a974112fa21538121db120f0d;p=trains.git new load_tblptr macro --- diff --git a/detpic/common.inc b/detpic/common.inc index 2bf36e3..a589da6 100644 --- a/detpic/common.inc +++ b/detpic/common.inc @@ -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 ;