View Full Version : writing 64 cycle protected locs
MLCarter
08-13-00, 08:34 PM
I would like to change the timer pre-scaler.<br>Is this possible from Forth ?
The MaxForth reset code looks like this:<p>RESET: LDS #RPINIT ;USE ZERO PAGE ONLY FOR NOW<br> LDD $B7FE ;CHECK FOR IMMEDIATE AUTOSTART SUB<br> CPD #BOOTME<br> BNE RES1<br> JSR $B7FB ;LEAVE FOR QUICK START<br>RES1: LDAA #REGCTL ;RAĠ A 0 REG A $B000<p> Where BOOTME is A55A. So if you want to do anything in the first 64<br> cycles, you'd tie in to this point by putting the following pattern<br> in EEPROM memory:<p> B7FB JMP ; jump to the next location<br> B7FC ; upper byte of asmcode address<br> B7FD ; lower byte of asmcode address<br> B7FE A5 ; bootme pattern<br> B7FF 5A<br> <br> asmcode:<br> ; whatever you need to do like setting prescaler<br> RTS<p> Where asmcode is the address of your routine. Make sure it is in <br> non-volatile memory or you will hang after a power cycle. Since<br> you have three bytes (B7FB-D), if your code can be done in two<br> bytes leaving 1 byte for RTS, then you could put it right there.
vBulletin v3.0.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.