X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=reference.html;h=609c422d1f31238ff88134fad393ef226287787e;hb=ea06ac29b3258dd6b91801a5175066e81275667d;hp=f57f5c8805811feb0fa67dcb88aee1b7a7ee5d6d;hpb=c8819ee75b180664d649f542f4448122f6c4cdce;p=rrq%2Frrqforth.git diff --git a/reference.html b/reference.html index f57f5c8..609c422 100644 --- a/reference.html +++ b/reference.html @@ -793,6 +793,7 @@ asciidoc.install(); 2OVER 2SWAP
@@ -832,7 +833,8 @@ asciidoc.install(); +IMMEDIATE +INPUTMAIN-ARGS @@ -905,6 +907,8 @@ RRQFORTH executon by means of the following instruction sequence:
Note that the FORTH compiler does not invoke an assembler so any +inline assembly code must be provided in its binary form.
Note that the branch offset is a byte count and each FORTH word of a +definition take up a cell of 8 bytes. The offset is relative to the +cell address immediately subsequent to the offset cell. In other +words, offset 0 is not branching anywhere and an offset of -16 would +make a tight loop back to the branch instruction itself. The latter +would pull data stack values until and including the first non-zero +value.
"0=" is a function word that replaces a value with its logical complement; the result is zero if the value non-zero, and the result is non-zero if the value is zero.
Compare with NOT.
This is the same function as NOT.
Note that the branch offset is a byte count and each FORTH word of a +definition take up a cell of 8 bytes. The offset is relative to the +cell address immediately subsequent to the offset cell. In other +words, offset 0 is not branching anywhere and an offset of -16 would +make a tight loop back to the branch instruction itself. The latter +would pull data stack values until and including the first zero value.
See also :, [p_comma]. HERE, @, @@ -1172,6 +1192,23 @@ value. To that end, the values are 64-bit signed integers.
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.
See also DIGITS, which holds the mapping table from digits to text.
CREATE FOO BASE
: WTELL ( tfa -- ; Print word pname )
+ 24 + DUP 8 + SWAP @ TELL SP EMIT
+;
+
+: WORDS ( wordlist -- ; Print all words of word list )
+ BEGIN
+ @ DUP 0= IFBREAK
+ DUP WTELL
+ END
+ DROP
+ NL EMIT
+;
+"[']" is an immediate function word that reads the next word on the input stream and pushes its cfa.
"BRANCH" is a function word that implements execution transfer by means of adding the subsequent branch offset to the point of execution.
Note that the branch offset is a byte count and each FORTH word of a +definition take up a cell of 8 bytes. The offset is relative to the +cell address immediately subsequent to the offset cell. In other +words, offset 0 is not branching anywhere and an offset of -16 would +make a tight loop back to the branch instruction itself. The latter +would pull data stack values until and including the first zero value.
: WTELL ( tfa -- ; Print word pname )
+ 24 + DUP 8 + SWAP @ TELL SP EMIT
+;
+
+: WORDS ( wordlist -- ; Print all words of word list )
+ BEGIN
+ @ DUP IF DUP WTELL ELSE BREAK THEN
+ 1 IFAGAIN
+ END
+ DROP
+ NL EMIT
+;
+See also doFORTH, READ-WORD, @@ -1397,10 +1487,10 @@ _______________________________________________________ HERE heap.
See also :, [p_Ccomma]. HERE, @, @@ -1422,6 +1512,7 @@ Address) of the word. The header memory layout is as follows:
struct WORD
TFA 8 link ; tfa of previous word
@@ -1448,10 +1539,10 @@ function words initiated by ":" (aka "COLON") or changed to "dovalue"
for RRQFORTH constants created by "CONSTANT".