X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=reference.html;h=988e55177cc3476fd286dc94d7b0324a2893bef9;hb=12f5c95467140afef0635e1b0d3f283684db028d;hp=f57f5c8805811feb0fa67dcb88aee1b7a7ee5d6d;hpb=c8819ee75b180664d649f542f4448122f6c4cdce;p=rrq%2Frrqforth.git diff --git a/reference.html b/reference.html index f57f5c8..988e551 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
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, @, @@ -1108,6 +1138,26 @@ at the current free head address, which also is incremented.
Data stack: ( cfa -- tfa )
+"CFA>TFA" is a function word that pushes word tfa of the given cfa.
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 +1517,10 @@ _______________________________________________________ HERE heap.
See also :, [p_Ccomma]. HERE, @, @@ -1422,6 +1542,7 @@ Address) of the word. The header memory layout is as follows:
struct WORD
TFA 8 link ; tfa of previous word
@@ -1448,10 +1569,10 @@ function words initiated by ":" (aka "COLON") or changed to "dovalue"
for RRQFORTH constants created by "CONSTANT".