[PicForth] Large amounts of text seem to cause PicForth to generate bad code

David McNab david at rebirthing.co.nz
Thu Dec 2 13:53:53 CET 2004


There's several things that could be causing this. No idea which, unless 
you can post some code.

One thing I could suggest is to create one word for each line, something 
like:

: line1 c" this is the first line" type ;
: line2 c" this is the second line" type ;
...

That's relatively inexpensive, and might give you a way to narrow down 
the problem area.

Also, generate the disassembly file and have a look inside to see if 
there's anything suspicious, such as banks or pclath not being set right.

Cheers
David

BTW - I notice that with more recent PicForth versions, the bootloader 
is using 512 words of prog mem, so instead of [1]e30, sermon.fs needs to 
  org to [1]e00.

Alex Holden wrote:
> I just added a 'help' word to my program which sends about ten lines of 
> text to 'type' (defined one at a time with c" - each line is less than 
> 80 characters). I didn't think there would be a problem because I have 
> more than enough program memory spare, but the resulting program went 
> completely doolally- printing garbage, killing the interrupt handler, 
> randomly jumping to the bootloader, etc. I cut the help text down to a 
> single line and everything worked fine again. Then I tried to do a 
> binary search to find out just how much text I could use before it went 
> mad, and I ended up with the compilation dying with the error message 
> 'Bank switch over test'. I think the amount of code has just gone over 
> 2Kwords (pfd.py says 2216 bytes but I think it means 2216 words), but 
> I'm using an 8K PIC and I've adjusted the location of sermon.fs 
> appropriately. Does Picforth have any known problems with including 
> relatively large amounts of text program?
> 


More information about the PicForth mailing list