dF=EInX;x%X;Vocabulary searching routine, to!X;be used as part of a naturalX;language parser programX;X;by Karl E. WiegersX;%X;This machine language subroutine$X;is designed to be called from a!X;BASIC program. It takes two#X;arguments: the address of the$X;vocabulary data string, and the!X;address of the variable that%X;contains the word being searchedX;for, like this:X;%X;X=USR(loc,ADR(VOCAB$),ADR(WORD$)X;"X;, VOCAB6 WORD@LENGTHJRESULTTX;^%X;routine is orged at $600, but ishX;relocatablerX;|X;$X;-------------------------------!X;set up arguments passed from!X;BASIC, into page 0 variables$X;-------------------------------X;77;;pointer to startPVOCAB;;of vocabulary7;;character string PVOCAB7;;pointer to startPWORD;;of word being7;;searched for inPWORD;;vocabulary listX;&$X;-------------------------------0$X;search routine starts here with:"X;next word being pointed to byD$X;VOCAB variable; branch to labelN"X;ANALYZE to look for match; ifX#X;no match, return to here; lastb#X;'entry' in VOCAB$ has token ofl#X;0, so store that in RESULT andvX;return to BASIC program$X;-------------------------------X;- BEGIN%> Q@VOCAB7 HANALYZE PRESULT:X;$X;-------------------------------"X;see if length matches that ofX;next word in vocabulary$X;------------------------------- X; ANALYZE RLENGTH;;lengths match?*HNEXTWORD;;no, go on4%LENGTH;;yes,check chars>X;H$X;-------------------------------R!X;compare characters in target\$X;word with those in current wordfX;in vocabularyp$X;-------------------------------zX; CYCLEQ@VOCAB7;;get next char1;;and compare toR@WORD7;;target wordHNEXTWORD;;no match,go onC;;matches, checkHCYCLE;;next char%LENGTH;;found! point to3;;token value, getQ@VOCAB7;;it, and storePRESULT;;in RESULT byte:;;all done, so exitX;$X;------------------------------- X;skip to next word by addingX;length of current word to$X;pointer to vocabulary list.$X;-------------------------------8X;B NEXTWORDL,V%>` QVOCABj O@VOCAB7t PVOCAB~ DNOINC1 #VOCAB NOINC1, QVOCABO> PVOCAB DNOINC2 #VOCAB NOINC2X;#X;------------------------------#X;continue search with next wordX;in the vocabulary #X;------------------------------X;,( DBEGIN