-//compile.asm: WORD p_literal_string,'S"',fasm ;; " (fool emacs)
+//compile.asm: WORD p_literal_string,'LIT-STRING',fasm
anchor:p_literal_string[]
-=== Word: S"
+=== Word: LIT-STRING
....
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 <<p_lit,LIT>> but for a string literal.
+"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
+.Definition concept for LIT-STRING
****
-: LIT R> DUP @ 2DUP + 8 + >R SWAP 8 + SWAP ;
+: LIT-STRING R@ DUP @ 8 + R@ @ 2DUP + R> + >R 1 - ;
****
====
-