X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_literal_string.adoc;h=ba94b0f3f7abadf97db4013aaba77123e5909f6a;hb=9b8fcf87eaed58b6dfabcf885f8eef5484643de6;hp=5eaaec5345809a36b6df3c5c9aa0ee0b64e3e57c;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_literal_string.adoc b/adoc/p_literal_string.adoc index 5eaaec5..ba94b0f 100644 --- a/adoc/p_literal_string.adoc +++ b/adoc/p_literal_string.adoc @@ -1,15 +1,21 @@ -Word: S" ----------- +//compile.asm: WORD p_literal_string,'S"',fasm ;; " (fool emacs) anchor:p_literal_string[] ----- -compile.asm: WORD p_literal_string,'S"',fasm ;; " (fool emacs) ----- -"S"" is a function word for, in compaling mode, creating a string -literal whose pname ( char* n ) gets pushed in interpreting mode. +=== Word: S" -Similar to "LIT", "S"" will insert the string into the containing -definition, and use it from there. +.... +Data stack: ( -- chars* n ) +.... +"S"" is a function word that pushes the [n:char] pointer for a string +inlined subsequently to it in the containing definition. This is +similar to <> but for a string literal. + +==== +.Definition concept for LIT +**** +: LIT R> DUP @ 2DUP + 8 + >R SWAP 8 + SWAP ; +**** +====