Prev: 49390 Up: Map Next: 49484
49412: Keep Token
Used by the routine at LookupWord.
The first word below id 85 is the verb. IT and THEM substitute the previous noun. POLISH, SKIN and BRIDGE are rewritten to internal verbs 44, 43 and 49. Later words are the noun, then extra words.
Input
A Token id
HL Line pointer
Count this word. A third word is stored as an extra, not as the noun.
KeepToken 49412 PUSH AF Stash the id on the stack.
49413 LD A,(23435) Increment *WordCount.
49416 INC A
49417 LD (23435),A
49420 CP 3 Jump to StoreExtra if this is a third word.
49422 JR NC,StoreExtra
49424 CP 32 Jump to StoreExtra_Overflow if *WordCount is 32.
49426 JR Z,StoreExtra_Overflow
49428 POP AF Restore the id from the stack.
49429 CP 85 Jump to KeepToken_It if the id is not below 85.
49431 JR NC,KeepToken_It
Store this id as the verb.
KeepToken_Verb 49433 LD (23423),A Write the id to *Verb.
49436 JP ParseWord Jump to ParseWord to take the next word.
IT and THEM reuse the previous noun.
KeepToken_It 49439 CP 128 Jump to KeepToken_Held if the token is not IT or THEM (128).
49441 JR NZ,KeepToken_Held
49443 LD A,(23453) Fetch *PreviousNoun.
A verb already stored means this id is the noun.
KeepToken_Held 49446 LD B,A Stash the token in B.
49447 LD A,(23423) Test *Verb.
49450 OR A
49451 LD A,B Restore the token from B.
49452 JR NZ,KeepToken_Noun Jump to KeepToken_Noun if a verb is already stored.
POLISH, SKIN and BRIDGE become internal verbs.
KeepToken_Rewrite 49454 CP 175 Test for POLISH (175).
49456 LD A,44 Jump to KeepToken_Verb with 44 if it matched.
49458 JR Z,KeepToken_Verb
49460 LD A,B Restore the token from B.
49461 CP 249 Test for SKIN (249).
49463 LD A,43 Jump to KeepToken_Verb with 43 if it matched.
49465 JR Z,KeepToken_Verb
49467 LD A,B Restore the token from B.
49468 CP 134 Test for BRIDGE (134).
49470 LD A,49 Jump to KeepToken_Verb with 49 if it matched.
49472 JR Z,KeepToken_Verb
49474 LD A,B Restore the id when none of those matched.
Store this id as the noun.
KeepToken_Noun 49475 LD (23424),A Write the id to *Noun and *PreviousNoun.
49478 LD (23453),A
49481 JP ParseWord Jump to ParseWord to take the next word.
Prev: 49390 Up: Map Next: 49484