+// compile.asm: WORD p_create,'CREATE',fasm
+
anchor:p_create[]
-Word: CREATE
-------------
+=== Word: CREATE
-----
-compile.asm: WORD p_create,'CREATE',fasm
-----
+....
Data stack: ( char* n -- tfa )
+....
"CREATE" is a function word that allocates a "word header" with the
indicated [n:char*] print name, and returns the "TFA" (Token Field
Address) of the word. The header memory layout is as follows:
====
+.rrqforth word structure
+[caption='Layout {counter:layout}: ']
----
struct WORD
TFA 8 link ; tfa of previous word
function words initiated by ":" (aka "COLON") or changed to "dovalue"
for RRQFORTH constants created by "CONSTANT".
-See "<<p_execute,EXECUTE>>" about range of +doer+ assignments and
-their meanings.
-
-.Execution semantics expressed in RRQFORTH
====
+.Definition concept for CREATE
+****
HERE @ R> ( save tfa on RS )
R@ CURRENT-WORD @ DUP @ , ! ( link in a new word )
DUP 49 + R@ + , ( pCFA )
DUP , ( length )
HERE @ ROT ROT MEMCPY 0 C, ( pname + NUL )
R@ , ( pTFA )
- 0, ( OFF )
+ 0 , ( OFF )
doVARIABLE ( CFA, default semantics )
+****
====
-.Usage example
====
-\ A possible definition of the word CONSTANT
-: CONSTANT
- READ-WORD CREATE TFA>DFA doVALUE OVER 8 - ! !
-;
+.a possible definition of CONSTANT
+[caption='Usage example {counter:example}: ']
+----
+: CONSTANT READ-WORD CREATE TFA>DFA doVALUE OVER 8 - ! ! ;
+----
====
+See also <<p_put,!>>, <<p_plus,+>>, <<p_comma>>, <<p_get,@>>,
+<<p_Ccomma>>, <<p_current_word,CURRENT-WORD>>, <<p_dup,DUP>>,
+<<p_here,HERE>>, <<p_herememcpy,HERE>>, <<p_Rget,R@>>, <<p_rot,ROT>>,
+and <<p_dovariable,doVARIABLE>>,
+as well as <<p_execute,EXECUTE>>
+about the range of "doer" assignments and their meanings.