Re: Dumb question - 'code' words and register banks
Samuel Tardieu <[email protected]> 14 Nov 2004 20:20:01 +0100
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Organization | Avian Carrier & Friends |
| Message-ID | <[email protected]> |
>>>>> "David" == David McNab <[email protected]> writes: David> Hi, When writing 'code' words, what's the best/quickest way to David> insert the appropriate bank-selection (rp0 b[s|c]f, rp1 David> b[s|c]f) instructions before accessing a variable? You can use "adjust-cbank" between the variable name and the operation. I don't want it to be automatically adjusted as in assembly I don't want to generate code that has not been explicitely asked for. Do not forget to restore the bank after returning, with "0 adjust-cbank drop". Example: code foo porta adjust-bank clrf eedata adjust-bank clrf 0 adjust-bank drop return end-code It is equivalent to: : foo 0 porta ! 0 eedata ! ; Maybe I should issue a warning when the right bank is not selected and if the bank is not restored at return. What do you think about it? Sam -- Samuel Tardieu -- [email protected] -- http://www.rfc1149.net/sam