X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_create.adoc;h=5fdfe27d3caa6536bededd5473358779baf49ec0;hb=9b8fcf87eaed58b6dfabcf885f8eef5484643de6;hp=cf8914e7b9afb27f0315a414e8f36a50e693aade;hpb=c8819ee75b180664d649f542f4448122f6c4cdce;p=rrq%2Frrqforth.git diff --git a/adoc/p_create.adoc b/adoc/p_create.adoc index cf8914e..5fdfe27 100644 --- a/adoc/p_create.adoc +++ b/adoc/p_create.adoc @@ -14,6 +14,8 @@ 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 @@ -42,9 +44,8 @@ function words initiated by ":" (aka "COLON") or changed to "dovalue" for RRQFORTH constants created by "CONSTANT". ==== -.Word: CREATE -[caption='Definition concept {counter:exec}: '] ----- +.Definition concept for CREATE +**** HERE @ R> ( save tfa on RS ) R@ CURRENT-WORD @ DUP @ , ! ( link in a new word ) DUP 49 + R@ + , ( pCFA ) @@ -54,13 +55,16 @@ HERE @ R> ( save tfa on RS ) R@ , ( pTFA ) 0 , ( OFF ) doVARIABLE ( CFA, default semantics ) ----- +**** ==== -.Usage example: a possible definition of CONSTANT -**** +==== +.a possible definition of CONSTANT +[caption='Usage example {counter:example}: '] +---- : CONSTANT READ-WORD CREATE TFA>DFA doVALUE OVER 8 - ! ! ; -**** +---- +==== See also <>, <>, <>, <>, <>, <>, <>,