Dumb question - 'code' words and register banks

David McNab <[email protected]> Mon, 15 Nov 2004 05:21:57 +1300
Newsgroups gmane.comp.lang.forth.picforth
Message-ID <[email protected]>
Hi,

When writing 'code' words, what's the best/quickest way to insert the 
appropriate bank-selection (rp0 b[s|c]f, rp1 b[s|c]f) instructions
before accessing a variable?

For example:

variable fred
...
code someword
     ... magic word here to set RP0 and RP1 correctly...
     someword ,w   movf
     $3f           xorlw
     ...
end-code

I know that for pure-target-forth words, PicForth's aggressive 
heuristics take care of generating these instructions automatically, but 
this doesn't extend into PicForth's parsing of assembler.

Or should I just manually keep track of which banks which vars live in, 
and write in the rp0/1 bsf/bcf instructions by hand?

-- 
Cheers
David