X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=adoc%2Fp_find.adoc;h=01c4579148af95865c8ddb054c56188defadefa7;hb=4738ba3eabef30343223098bd81ee6ff80fbbafc;hp=c8f355c2d1c8528e689a396be8c448ed2e407063;hpb=b7da3f7bbd1cb10241163abdb950472e539e796d;p=rrq%2Frrqforth.git diff --git a/adoc/p_find.adoc b/adoc/p_find.adoc index c8f355c..01c4579 100644 --- a/adoc/p_find.adoc +++ b/adoc/p_find.adoc @@ -1,9 +1,22 @@ +// wordlists.asm: WORD p_find,'FIND',fasm + anchor:p_find[] -Word: FIND ----------- +=== Word: FIND +.... +Data stack: ( char* n -- [ char* n 0 ]/[ tfa ] ) +.... + +"FIND" is a function word that searches the current word list search +path for the given [n:char*] word, and returns the TFA of the matching +word if any. Otherwise FIND preserves the initial data stack but adds +0 to it. ----- -wordlists.asm: WORD p_find,'FIND',fasm ----- +The word is sought starting with the +<> word list, for the first +occurence of a match. If not found, the search continues with the +subsequent word list, and so on. +When a word is found, then the data stack is changed by discarding the +[n:char*] double cell string pointer and pushing (only) the TFA of the +matching word instead.