GARTHWILSON wrote:
From my "shadow screen" (really just a description text file):
Code:
\ PAD is an area of RAM that floats above HERE , leaving enough room for WORD
\ to put a whole line at HERE from the input stream as when commented-out by ( .
\ PAD is used for building pictured numeric output with <# # #> etc., and for
\ temporary storage of strings. In a sense, it can hold both a pictured numeric
\ output string and a text string at the same time. This is because the pictured
\ numeric output string starts at PAD-1, and grows downward toward HERE as a
\ number string gets built, while the text string starts right at PAD and goes
\ up. If a string comes in the input stream (using " ) and STATE is off, the
\ string will get put where PAD points.
Thanks.
I still am confused by WORD putting a whole line at HERE, as that would require a delimiter other than a space, and words are limited to 31 characters in Forth when finding them.
And I haven't come across enough numeric output to really study "those" words in depth, and didn't realize they built down. But there it is, <# starts at PAD, and #> builds down from PAD. The most common numeric output examples I have seen are with dates. But even they only take a dozen characters at the most.
I feel 68 bytes is overkill. 32 max would probably be enough.
Everyday use in Forth probably would never see that much space used, but maybe in a SEARCH/REPLACE function of a word processor. I know I have never done a SEARCH/REPLACE with over 12 characters, let alone 32 or 68.
I also don't think I have see both HERE and numeric output used at the same time. Couldn't they share the same space?
Maybe the space between HERE and PAD could have been made into an adjustable variable and used like virtual memory is used. If you need more space, then increase the variable.
I am basically speaking from a user with limited memory, like on a 64 kb machine. Users with larger memory access probably would not care one way or another as an extra 30 or so bytes is peanuts to them.