[PicForth] Re: Dumb question - 'code' words and register banks

David McNab david at rebirthing.co.nz
Mon Nov 15 01:49:14 CET 2004


Samuel Tardieu wrote:
> 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

This fails to compile on PicForth 1.2:

Error Text:
----------------
*** Warning: wrong bank may be selected

in file included from *the terminal*:0
in file included from *evaluated string*:-1
pfctemp.fs:482: Aborting
         eedata adjust-bank clrf
                            ^^^^

> 
> 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

-- 
Cheers
David


More information about the PicForth mailing list