X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=reference.html;h=7da9aa85489a9ae3834c2a452e98f543ff1622cd;hb=1d70aaa57d842f422ea856d4cdc5bfc26860a488;hp=04da3738999684d452c0701a1335e93ede9ccd18;hpb=04f2de0478f8924fecee363057c208434f32a119;p=rrq%2Frrqforth.git diff --git a/reference.html b/reference.html index 04da373..7da9aa8 100644 --- a/reference.html +++ b/reference.html @@ -770,17 +770,24 @@ asciidoc.install(); !   C@   C!   +W@   +W!   +D@   +D!   2@   2!   !+   @n++   @n--   C,   +W,   +D,   S"   >R   R@   R>   -R[n]  

+R[n]   +D[n]  

DATA-STACK   RETURN-STACK     @@ -858,6 +865,7 @@ asciidoc.install(); PROGRAM_VERSION  

QUIT  

READ-STREAM-CHAR   +READ-STREAM-LINE   READ-WORD   REALLOC   RETURN   @@ -1142,6 +1150,65 @@ at the current free head address, which also is incremented.

_______________________________________________________
+

+ +
+

Word: W,

+
+
+
Data stack: ( v -- )
+
+

"W," (W-comma) is a function word that puts a "word" (double-byte) on +the HERE heap. The two least significant bytes of the value +are put at the current free head address, which also is incremented +accordingly.

+
+
+
+
+
Definition concept for W,
+

: W, HERE @ 2 ALLOT W! ;

+
+
+
+_______________________________________________________ +
+

+
+
+

Word: D,

+
+
+
Data stack: ( v -- )
+
+

"D," (D-comma) is a function word that puts a "double word" +(double-byte) on the HERE heap. The four least significant +bytes of the value are put at the current free head address, which +also is incremented accordingly.

+
+
+
+
+
Definition concept for D,
+

: D, HERE @ 4 ALLOT D! ;

+
+
+
+_______________________________________________________ +
+

+
+
+

Word: D[n]

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

"D[n]" is a function word that pushes the address for the n:th cell of +the data stack onto the data stack.

+
+_______________________________________________________ +

@@ -1174,6 +1241,32 @@ _______________________________________________________
_______________________________________________________
+

+
+
+

Word: W@

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

"W@" is a function word that pushes the "word" (double-byte) value v +from the address a.

+
+_______________________________________________________ +
+

+
+
+

Word: R@

+
+
+
Data stack: ( -- v )   Return stack: ( v -- v )
+
+

"R@" is a function word that "copies" the top return stack value onto +the data stack.

+
+_______________________________________________________ +

@@ -1187,10 +1280,36 @@ significant byte of the cell) at the address a.

_______________________________________________________
+

+ +
+

Word: W!

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

"W!" is a function word that stores the "word" (2-byte) value v (the +two least significant bytes of the cell) at the address a.

+
+_______________________________________________________ +
+

+
+
+

Word: D!

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

"D!" is a function word that stores the "doublw word" (4-byte) value v +(the four least significant bytes of the cell) at the address a.

+
+_______________________________________________________ +

-

Word: R@

+

Word: R@

Data stack: ( -- v )   Return stack: ( v -- v )
@@ -1292,7 +1411,8 @@ _______________________________________________________

"ARGS" is a value word that holds a pointer to the command line data block which consists of a count cell followed by that many asciiz -pointers and then a 0 cell.

+pointers and then a 0 cell. That is next followed by the environment +as a number of asciiz pointers and a 0 cell.

@@ -1300,9 +1420,10 @@ pointers and then a 0 cell.

ARGS -> 8 bytes: count of non-zero asciiz pointers following
         8 bytes: command name string
-        8 bytes: first argument string
-        8* ...
-        8 zero
+ 8* bytes: argument strings + 8 bytes: zero cell + 8* bytes: envirnment strings + 8 bytes: zero cell
@@ -2934,8 +3055,8 @@ _______________________________________________________
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.

+

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

@@ -2965,6 +3086,22 @@ instead.

_______________________________________________________
+

+
+
+

Word: READ-STREAM-LINE

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

"READ-STREAM-LINE" is a function word that gets the next line from the +given stream buffer into PAD and returns number of characters. If the +stream is backed by a file descriptor, the stream buffer is refilled +from there as needed, by a SYS_READ call when more characters are +needed.

+
+_______________________________________________________ +

@@ -3726,7 +3863,7 @@ is deepest.