projects
/
rrq
/
rrqforth.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
another example
[rrq/rrqforth.git]
/
adoc
/
p_literal_string.adoc
diff --git
a/adoc/p_literal_string.adoc
b/adoc/p_literal_string.adoc
index 5eaaec5345809a36b6df3c5c9aa0ee0b64e3e57c..1d9ffdb50d5ef343ce1bab5ecb0a51b7466e71d4 100644
(file)
--- a/
adoc/p_literal_string.adoc
+++ b/
adoc/p_literal_string.adoc
@@
-1,15
+1,22
@@
-Word: S"
-----------
+//compile.asm: WORD p_literal_string,'LIT-STRING',fasm
anchor:p_literal_string[]
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: LIT-STRING
-Similar to "LIT", "S"" will insert the string into the containing
-definition, and use it from there.
+....
+Data stack: ( -- chars* n )
+....
+"LIT-STRING" is a function word that pushes the char* and length n of
+a subsequent inline string, then advances execution to continue after
+the string. This is similar to <<p_lit,LIT>> but for a block literal.
+Note that the inlined byte count includes the terminating NUL byte.
+
+====
+.Definition concept for LIT-STRING
+****
+: LIT-STRING R@ DUP @ 8 + R@ @ 2DUP + R> + >R 1 - ;
+****
+====