X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_does.adoc;h=b31b42b274f0f803ef9e8ec7c7a33fe12769d85b;hb=d7958ae7b474ef357864237fc40412139e43b117;hp=6517157c5b91501c46b67bd937056767d12dc751;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_does.adoc b/adoc/p_does.adoc index 6517157..b31b42b 100644 --- a/adoc/p_does.adoc +++ b/adoc/p_does.adoc @@ -1,26 +1,49 @@ -WORD: DOES> ------------ +// compile.asm: WORD p_does,'DOES>',fasm,IMMEDIATE + anchor:p_does[] ----- -compile.asm: WORD p_does,'DOES>',fasm,IMMEDIATE ----- +=== WORD: DOES> + +.... Data stack: ( -- ) +.... "DOES>" is a function that in execution mode does nothing but in compilation mode it changes the execution semantics assignments for -the most recent word to use the "dodoes" sematics with adjustment +the most recent word to use the +dodoes+ sematics with adjustment offset to the current heap address. I.e., the word being defined will have its execution start at whatever comes after "DOES>". -.Execution semantics expressed in RRQFORTH ==== +.Defintion concept for DOES> +**** : DOES> IMMEDIATE STATE @ != IF ( only for compilation mode ) CURRENT-WORDLIST @ @ TFA>CFA ( cfa of current word ) doDOES OVER ! ( set up doer ) HERE @ OVER 8 + - SWAP 8 - ! ( set up offset -THEN + THEN ; +**** ==== +See also +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<>, +<CFA>>, +<>, +<>, +as well as <> +about the range of "doer" assignments and their meanings. +