Re: Large amounts of text seem to cause PicForth to generate bad code - updated
David McNab <[email protected]> Fri, 03 Dec 2004 11:06:55 +1300
| Newsgroups | gmane.comp.lang.forth.picforth |
|---|---|
| Message-ID | <[email protected]> |
Alex Holden wrote:
> I've made some progress in narrowing this bug down. The problem seems to
> be that the yield word in multitasker.fs generates bad code once the
> amount of program memory in use gets above 2K. I think it's probably
> just missing out the bank selects but I really don't understand how
> multitasker.fs works so I'm not sure how to fix it.
Seems that Samuel has made some significant changes to the PicForth
compiler kernel without checking impacts on multitasker.fs and
priotasker.fs.
You probably saw an earlier message, where I flagged the fact that
programs using priotasker.fs won't even compile with latest PicForth.
Something you might like to try is compiling your prog with earlier
versions of PicForth, to see if 'yield' generates different (and
possibly more correct) code.
That would help Samuel (if/when he next shows up on this list) to narrow
down the problem.
I'm more of a forth power-user rather than hacker. Once forth code gets
really esoteric, I get badly lost.
One thing that has sometimes worked around compiler bugs is to try
putting in a 'forth> no-cbank' before any words that don't compile
correctly.
For instance, with your code:
task : alarm
begin
[char] a emit
forth> no-cbank
yield
again
;
This causes the forth compiler to forget its codebank status, and often
forces it to explicitly generate correct PCLATH set instructions.
--
Cheers
David