X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=reference.html;h=0fc06e19112a3d6eea43df52850d7670d96558cd;hb=8a2d8dc0e8ff7f3e6b402d2d496169d19d032db5;hp=f57f5c8805811feb0fa67dcb88aee1b7a7ee5d6d;hpb=c8819ee75b180664d649f542f4448122f6c4cdce;p=rrq%2Frrqforth.git diff --git a/reference.html b/reference.html index f57f5c8..0fc06e1 100644 --- a/reference.html +++ b/reference.html @@ -832,7 +832,8 @@ asciidoc.install();
+IMMEDIATE +INPUTMAIN-ARGS @@ -905,6 +906,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, @, @@ -1253,10 +1272,6 @@ numerical base is set to 10 or 16 by DECIMAL and supported.
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 +1469,10 @@ _______________________________________________________ HERE heap.
See also :, [p_Ccomma]. HERE, @, @@ -1422,6 +1494,7 @@ Address) of the word. The header memory layout is as follows:
struct WORD
TFA 8 link ; tfa of previous word
@@ -1448,10 +1521,10 @@ function words initiated by ":" (aka "COLON") or changed to "dovalue"
for RRQFORTH constants created by "CONSTANT".