BruceRMcF wrote:
IamRob wrote:
BruceRMcF wrote:
It doesn't ... if you have a 16bit forth, than a double number in binary has 32bits, which can be 32 characters.
Yep, gotcha. You were talking printable double binary numbers.
And WORD can be used in command line utility words as well as being used by the interpreter (as long as it's done with the text by the time the next word is interpreted), so the WORD buffer shouldn't overlap the PNO buffer. So allow two characters to be added to the pictured numeric buffer ( , $ . - etc.), the chars that WORD needs, there's the required space.
Thanks for bringing some new light to how Forth can be used. This is in uncharted territory for me.
But still looking from the perspective of creating a numeric string. The only words in FigForth that use the PNO buffer are (. D. D.R and ?), which use the
<# #> constructs to form a numeric output in the PNO buffer. This is a closed command loop which means the numeric output is formed, closed and printed before moving on to interpreting the next word. And since the PNO buffer is no longer needed after the numeric print out, it should be available for use again even when the next word comes along for interpreting, whether by the interpreter or by a command line utility. Therefore, it still shouldn't be necessary to reserve that space for a WORD that is copied to HERE, since it would not harm anything if it over-lapped into the PNO buffer.
From what I can see, the only time that the PNO buffer would be used at the same time as any type of word interpretation is if something was being created between the
<# #> constructs.
D.R uses the
TYPE command to immediately print the contents of the buffer, and like I have said before, I haven't done much with the numeric constructs to know if something might be created in the buffer, but held there for a later printing or handling of it, and then might possibly interfere with a word being interpreted.
I am still convinced, for the most part, that words being copied to
HERE have nothing to do with the gap space between
HERE and
[b]PAD[/b], mostly because I have not seen any examples showing both areas used at the same time, where they might interfere with each other.
And I am still wondering if anyone came across any use case that might require a larger PNO buffer. Printing a double binary number is the largest use-case I have been shown so far at 34 bytes for a 16-bit printed double word (66 bytes for 32-bit dbl words and 130 bytes for 64-bit dbl words). FigForth is based on 16-bit, so all calculations are done with that in mind. I also mentioned one earlier where a newspaper prints the date line in long format, could be pretty long. I don't think I have ever seen any real-world examples where numeric output would need to span a full line of 64 characters, like a newspaper or book.
Are there any others?