From 426857d112aab766d577f58982141963952e49c8 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sat, 5 Jun 2021 18:26:41 +1000 Subject: [PATCH] update --- reference.html | 171 ++++++++++++++++++++++++++++++++++++++++--------- rrqforth | Bin 2149290 -> 2150128 bytes 2 files changed, 139 insertions(+), 32 deletions(-) diff --git a/reference.html b/reference.html index 609c422..9900bbd 100644 --- a/reference.html +++ b/reference.html @@ -780,7 +780,7 @@ asciidoc.install(); >R   R@   R>   -R[n]  

+R[n]  

DATA-STACK   RETURN-STACK     @@ -826,6 +826,8 @@ asciidoc.install(); EXECUTE   EXIT  

FALSE   +FDEMIT   +FDTELL   FIND   FORTH  

HERE   @@ -836,7 +838,8 @@ asciidoc.install(); IMMEDIATE   INPUT  

LIT   -LOAD-FILE"  

+LOAD-BUFFER-SIZE   +LOAD-FILE  

MAIN-ARGS   MALLOC  

NEGATE   @@ -844,7 +847,7 @@ asciidoc.install(); NL   NOT   NUMBER  

-

OPEN-FILE"   +

OPEN-FILE   OR   OVER  

PAD   @@ -855,7 +858,8 @@ asciidoc.install(); READ-WORD   REALLOC   ROLL   -ROT  

+ROT   +RSP  

SP   STATE   STDIN   @@ -876,6 +880,7 @@ asciidoc.install(); THIS-WORD   TRUE   TUCK  

+

UNSTREAM  

VERBOSE?  

WITHIN   WORDS  

@@ -2109,6 +2114,33 @@ _______________________________________________________
_______________________________________________________
+

+ +
+

Word: FDEMIT

+
+
+
Data stack: ( c fd -- )
+
+

"FDEMIT" is a function word that puts the given character code to the +given file descriptor. The character is the least significant byte of +the data stack cell.

+
+_______________________________________________________ +
+

+
+
+

Word: FDTELL

+
+
+
Data stack: ( char* n fd -- )
+
+

"FDTELL" is a function word that prints a string to the given file +descriptor.

+
+_______________________________________________________ +

@@ -2467,19 +2499,35 @@ similar to LIT but for a string literal.

_______________________________________________________
-

+

+ +
+

Word: LOAD-BUFFER-SIZE

+
+
+
data stack: ( -- a )
+
+

"LOAD-BUFFER-SIZE" is a variable word telling the buffer size in bytes +that LOAD-FILE should use.

+
+_______________________________________________________ +
+

-

Word: LOAD-FILE"

+

Word: LOAD-FILE

-
data stack: ( "name" -- )
+
data stack: ( chaz* -- * 0/1 )
-

"LOAD-FILE"" is a function word that opens a file via -OPEN-FILE", allocates a stream buffer of 15000 -bytes for reading it, saves the stream pointer as value for the newly -created filename variable, and then it invokes -EVALUATE-STREAM for processing the file.

+

"LOAD-FILE" is a function word that evaluates a text file. It opens a +file via OPEN-FILE and sets up a stream with a +buffer of LOAD-BUFFER-SIZE bytes for +reading it. The stream is passed to +EVALUATE-STREAM for processing its words. Upon +its return the file is closed and the stream memory is reclaimed, and +then the function returns whatever +EVALUATE-STREAM returns.

_______________________________________________________
@@ -2626,17 +2674,17 @@ integers.

_______________________________________________________
-

+

-

Word: OPEN-FILE"

+

Word: OPEN-FILE

-
Data stack: ( "name" -- fd )
+
Data stack: ( chaz* -- fd )
-

"OPEN-FILE"" is a function word that reads the intputstream for a -filename, adds that to the dictionary as a no-content variable, opens -that file and returns the input file descriptor.

+

"OPEN-FILE" is a function word that opens the file named by the zero +terminated character string and returns the file descriptor, or if +less than 0, the system call error code.

_______________________________________________________
@@ -2781,6 +2829,40 @@ word on the input stream and pushes its cfa.

_______________________________________________________
+

+ +
+

Word: RSP

+
+
+
Data stack: ( -- a )
+
+

"RSP" is a function word that pushes the return stack pointer value +onto the data stack.

+
+_______________________________________________________ +
+

+
+
+

Word: R[n]

+
+
+
Data stack: ( n -- a )
+
+

"R[n]" is a function word that pushes the address for the n:th cell on +the top return stack value onto the data stack.

+
+
+
+
+
Defintion concept for R[n]
+

( n — a ) : R[n] 8 * RSP + ;

+
+
+
+_______________________________________________________ +

@@ -2812,6 +2894,18 @@ separated word from the given stream and returns the [n:char*] duoble cell pointer for it. The characters of the word are copied to PAD, and there is a limit of 1024 characters.

At the end of the stream READ-WORD returns 0 length.

+
+
Special syntax 1: Whitespace
+
+

All character codes less or equal to 32 are regarded as "whitespace".

+
+
+
Special syntax 2: Rest-of-line comment
+
+

The "#" character following whitespace starts a line comment and the +rest of the line is ignored. Note that this is also recognised with +parethesis commenting.

+
_______________________________________________________
@@ -2892,19 +2986,6 @@ and the first becomes the second.

_______________________________________________________
-

- -
-

Word: R[n]

-
-
-
Data stack: ( n -- a )
-
-

"R[n]" is a function word that pushes the address for the n:th cell on -the top return stack value onto the data stack.

-
-_______________________________________________________ -

@@ -3338,8 +3419,34 @@ values are unequal, and 0 otherwise.

_______________________________________________________
+

+ +
+

Word: UNSTREAM

+
+
+
Data stack: ( stream* -- )
+
+

"UNSTREAM" is a function word that releases the memory allocated for a +stream, and closes the associated file if it’s a file stream.

+
+

File descriptor backed stream

+

This kind of stream has the stream header as a prefix within the +allocated memory. Thus, stream* is the base address for the memory to +reclaim, and the size of this is determined from the cell at (stream* ++ 16) plus the 32 bytes head itself.

+
+
+

Memory block backed STREAM

+

This kind of stream has a separate header which points at the memory +area to reclaim. The cell at stream* is the base address, and the cell +at (stream* + 16) is its size.

+
+_______________________________________________________ +

+

Word: VERBOSE?

@@ -3429,7 +3536,7 @@ is deepest.

diff --git a/rrqforth b/rrqforth index 8c3fc39aa6bb367e89d836a8087b234aa7885bea..e3085861b8c6286da854bac80b728994aa1d9c5d 100755 GIT binary patch delta 6578 zcma)A3v`r4mahJjbefKkkVmKUAQTvZpqT)Q%V5GJBpvVl@CZqokS93fGKcXn2X$DEJt{7Phe2hSo?BJ7(8(Tm zx6bMR@2dLlcW>RQd#mbiVU?z9?^K$0+byYQ-Gmo5I7B0B9=I>$+Bqs3uAM7qyLN>| zy<&I_lgH3JMu5i%^cX=N!|XAFJ%+_&O!F94j}hWA?(!JZJ;n@=5$Z9*JjP6q5$-V} zJVvC)i1HXVj}h%L>>eY=W5jxlIFAwUF=ly;1dlQMh(XWq(w)J!@*4iXOTzd7a>Lg~_LyNQr zlUUgvTA*ECAo{hj1#El|T@`OE5X|HMllh4SEcs2kIsU8p--oy~pB;IVzN|eupDnGU zYc=zH$^H2}cDRmi(0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