X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=reference.html;h=a1de89cbf7de1fde99526c0439f3bba94bdd8a81;hb=d578692bf8e65d9448c48ea8dae7dd6642e03622;hp=f49869a4eb7329644a6d974173b691fbe9fb4fd5;hpb=bdc1081de477cd5230b7762d479b140cbbcf842f;p=rrq%2Frrqforth.git diff --git a/reference.html b/reference.html index f49869a..a1de89c 100644 --- a/reference.html +++ b/reference.html @@ -780,7 +780,7 @@ asciidoc.install(); >R   R@   R>   -R[n]  

+R[n]  

DATA-STACK   RETURN-STACK     @@ -793,6 +793,7 @@ asciidoc.install(); 2OVER   2SWAP  

ABS   +AGAIN   ALLOT   AND   [ASM]  

@@ -800,6 +801,7 @@ asciidoc.install(); BEGIN   BREAK  

CFA>FLAGS@   +CFA>TFA   CLEAR-STREAM   CREATE   CURRENT-WORDLIST  

@@ -825,6 +827,8 @@ asciidoc.install(); EXECUTE   EXIT  

FALSE   +FDEMIT   +FDTELL   FIND   FORTH  

HERE   @@ -832,9 +836,11 @@ asciidoc.install();

IF   IFAGAIN   IFBREAK   -IMMEDIATE  

+IMMEDIATE   +INPUT  

LIT   -LOAD-FILE"  

+LOAD-BUFFER-SIZE   +LOAD-FILE  

MAIN-ARGS   MALLOC  

NEGATE   @@ -842,7 +848,7 @@ asciidoc.install(); NL   NOT   NUMBER  

-

OPEN-FILE"   +

OPEN-FILE   OR   OVER  

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

+ROT   +RSP  

SP   STATE   STDIN   @@ -865,6 +872,7 @@ asciidoc.install(); SWAP   SYSTEM  

TELL   +.TEMP   TERMINATE0   TFA>CFA   TFA>DFA   @@ -874,6 +882,7 @@ asciidoc.install(); THIS-WORD   TRUE   TUCK  

+

UNSTREAM  

VERBOSE?  

WITHIN   WORDS  

@@ -1126,6 +1135,26 @@ at the current free head address, which also is incremented.

_______________________________________________________
+

+ +
+

Word: CFA>TFA

+
+
+
Data stack: ( cfa -- tfa )
+
+

"CFA>TFA" is a function word that pushes word tfa of the given cfa.

+
+
+
+
+
Definition concept for CFA>TFA
+

: CFA>TFA 14 - @ ;

+
+
+
+_______________________________________________________ +

@@ -1190,6 +1219,23 @@ value. To that end, the values are 64-bit signed integers.

_______________________________________________________
+

+ +
+

Word: AGAIN

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

"AGAIN" is an immediate function word that is used together with +BEGIN and instead of END to implement structured +execution control. AGAIN scans the datastack for the nearest preceding +BEGIN marker and lays out an unconditional branch from this point the +beginning of the block during execution. It thereafter performs the +END compile action to end the block.

+
+_______________________________________________________ +

@@ -1824,6 +1870,23 @@ the current BASE (either DECIMAL
_______________________________________________________
+

+
+
+

Word: .TEMP

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

".TEMP" is a function word that renders a cell value as an integer +using the current BASE, which is either +DECIMAL or HEX. In DECIMAL +BASE, a negative value is rendered as such with a leading +minus sign, whereas HEX BASE rendering is +unsigned.

+
+_______________________________________________________ +

@@ -2090,6 +2153,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.

+
+_______________________________________________________ +

@@ -2338,6 +2428,19 @@ the most recent word to 1, thereby making that word an immediate word.

_______________________________________________________
+

+ +
+

Word: INPUT

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

"INPUT" is a variable word for the input stream buffer used by +EVALUATE-STREAM.

+
+_______________________________________________________ +

@@ -2435,19 +2538,35 @@ similar to LIT but for a string literal.

_______________________________________________________
-

+

-

Word: LOAD-FILE"

+

Word: LOAD-BUFFER-SIZE

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

"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-BUFFER-SIZE" is a variable word telling the buffer size in bytes +that LOAD-FILE should use.

+
+_______________________________________________________ +
+

+
+
+

Word: LOAD-FILE

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

"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.

_______________________________________________________
@@ -2594,17 +2713,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.

_______________________________________________________
@@ -2749,6 +2868,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 + ;

+
+
+
+_______________________________________________________ +

@@ -2780,6 +2933,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.

+
_______________________________________________________
@@ -2860,19 +3025,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.

-
-_______________________________________________________ -

@@ -3306,8 +3458,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?

@@ -3397,7 +3575,7 @@ is deepest.