Re: [Flashforth-devel] Assembler Loops
Brought to you by:
oh2aun
From: Mikael N. <mik...@pp...> - 2014-07-11 09:23:53
|
Hello Thomas, The Forth variables are in banked ram. Not in access ram. Below I tried to fix your code. I have not tested it. Below it I put another variant that uses the top of the return stack as temporary varibles in access ram. I hope this clarifies things for you. BR Mike |: banksel ( addr -- ) #8 rshift $f and movlb, ; variable seqz \ forth variable in banked ram variable counter \ forth variable in banked ram [ seqz banksel #32 movlw seqz b, movwf, begin, latb0 a, bsf, counter banksel #13 movlw, counter b, movwf, begin, counterf, b, decfsz, again, latb0 a, bcf, #20 movlw, counter b, movwf, begin, counterf, b, decfsz, again, seqz banksel seqzf, b, decfsz, again, ] \ ****************************************** $fffd constant seqz \ tosl register in acccess ram $fffe constant counter \ tosh register in access ram [ push, ||#32 movlw seqz a, movwf, begin, latb0 a, bsf, #13 movlw, counter a, movwf, begin, counterf, a, decfsz, again, latb0 a, bcf, #20 movlw, counter a, movwf, begin, counterf, a, decfsz, again, seqzf, a, decfsz, again, pop, ]| |