Re: Problems with TIB again, I think
- From: "Ed" <nospam@xxxxxxxxxxx>
- Date: Wed, 28 Jun 2006 13:16:45 +1000
"Christoph" <christoph.lange@xxxxxxxxx> wrote in message news:1151323564.921635.103090@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dear Forthers!
Just a couple of weeks ago I asked a question about why some of my code
worked for some Forths but not for others. Now I'm at a similar point,
I think. I tried to write some words to easily put together simple
menus (as attached to the text).
This works fine for gforth, but with SwiftForth str, crashes. I assume
I made (implicitly, not on purpose of course) some assumptions that are
not necessarily valid for ANS Forths. But what?
Two problems.
ALIGN and ALIGNED are no-ops on some systems (even 32bit
ones). On these, your menu item strings won't be cell-aligned.
But to traverse the strings you use CHARS>CELLS etc which
always aligns. Hence the incompatibility.
Fix: replace "CHARS>CELLS CELLS" with ALIGNED.
Secondly it's illegal to put data at HERE and then ALLOT over it.
That's because in ANS, the contents after ALLOT ing are unspecified.
While many forths are insensitive to this illegal use of ALLOT
not all are (e.g. DX-Forth)
Fix: use Alex's redefinition of STR,
Ed
.
- Follow-Ups:
- Re: Problems with TIB again, I think
- From: Christoph
- Re: Problems with TIB again, I think
- References:
- Problems with TIB again, I think
- From: Christoph
- Problems with TIB again, I think
- Prev by Date: Re: Header structure for intelligent COMPILE,
- Next by Date: Re: 2nd RfD: Separate FP Stack
- Previous by thread: Re: Problems with TIB again, I think
- Next by thread: Re: Problems with TIB again, I think
- Index(es):