![]() |
Routines |
| Prev: 28464 | Up: Map | Next: 28602 |
|
Used by the routine at Input_TakeTheNextWord.
Copies one typed word into the dictionary buffer and looks it up.
|
||||
| Input_CopyADictionaryWord | 28487 | LD DE,28794 | Point DE at the typed word. | |
| 28490 | LD B,0 | Start the pass count at zero. | ||
| Input_CopyADictionaryWord_CopyTheNextLetter | 28492 | LD A,(HL) | Jump to Input_CopyADictionaryWord_CopyTheCount if this character is below 64. | |
| 28493 | CP 64 | |||
| 28495 | JR C,Input_CopyADictionaryWord_CopyTheCount | |||
| 28497 | AND 31 | Store the low five bits of this character in the typed word and step on. | ||
| 28499 | LD (DE),A | |||
| 28500 | INC DE | |||
| 28501 | INC HL | Step to the next byte of the input buffer. | ||
| 28502 | INC B | Count one more letter of the typed word. | ||
| 28503 | JR Input_CopyADictionaryWord_CopyTheNextLetter | Jump back to Input_CopyADictionaryWord_CopyTheNextLetter to copy the next letter. | ||
| Input_CopyADictionaryWord_CopyTheCount | 28505 | LD A,B | Copy the count in B into A. | |
| 28506 | LD (28810),A | Update *28810. | ||
| 28509 | PUSH HL | Read *28794. | ||
| 28510 | LD HL,(28794) | |||
| 28513 | LD H,0 | The dictionary offset's high byte is zero before the index is doubled. | ||
| 28515 | LD DE,24576 | Add the token index to the pointer. | ||
| 28518 | ADD HL,HL | |||
| 28519 | ADD HL,DE | Add the token index to the typed word. | ||
| 28520 | LD E,(HL) | Read the low byte of the typed word. | ||
| 28521 | INC HL | Step to the next byte of the typed word. | ||
| 28522 | LD D,(HL) | Read the high byte of the typed word. | ||
| 28523 | LD IX,24576 | Point IX at the dictionary word and restore the input pointer from the stack. | ||
| 28527 | ADD IX,DE | |||
| 28529 | POP HL | |||
|
This entry point is used by the routine at Input_TakeTheNextWord.
|
||||
| Input_CopyADictionaryWord_0 | 28530 | LD (46871),IX | Update *46871. | |
|
This entry point is used by the routine at Input_TakeTheNextWord.
|
||||
| Input_CopyADictionaryWord_1 | 28534 | LD A,(IX+0) | Read the first byte of the dictionary word. | |
| 28537 | AND 31 | Keep the first letter (bits 0-4). | ||
| 28539 | LD B,A | |||
| 28540 | LD A,(28794) | Read the typed word's first letter at 28794. | ||
| 28543 | CP B | Return when this dictionary word does not start with the typed word's first letter. | ||
| 28544 | RET NZ | |||
| 28545 | PUSH HL | Point HL at the buffer that receives the dictionary word. | ||
| 28546 | LD HL,28811 | |||
| 28549 | LD BC,0 | Start from a clear pointer. | ||
| Input_CopyADictionaryWord_TestTheLetter | 28552 | LD A,(IX+0) | Jump to Input_CopyADictionaryWord_StepTheDictionary if the low five bits of this dictionary byte are zero. | |
| 28555 | AND 31 | |||
| 28557 | JR Z,Input_CopyADictionaryWord_StepTheDictionary | |||
| 28559 | LD (HL),A | Store it in the dictionary word and step on. | ||
| 28560 | INC HL | |||
| 28561 | INC B | Count one more letter of the dictionary word. | ||
| Input_CopyADictionaryWord_StepTheDictionary | 28562 | INC IX | Step to the next dictionary byte and loop back to Input_CopyADictionaryWord_TestTheLetter while bit 7 of that byte is clear. | |
| 28564 | INC C | |||
| 28565 | BIT 7,(IX-1) | |||
| 28569 | JR Z,Input_CopyADictionaryWord_TestTheLetter | |||
| 28571 | LD A,C | Jump back to Input_CopyADictionaryWord_TestTheLetter if the letter count in C is 2. | ||
| 28572 | CP 2 | |||
| 28574 | JR Z,Input_CopyADictionaryWord_TestTheLetter | |||
| 28576 | CP 3 | Jump to Input_CopyADictionaryWord_RestoreThePointer if the letter count is not 3. | ||
| 28578 | JR NZ,Input_CopyADictionaryWord_RestoreThePointer | |||
| 28580 | BIT 7,(IX-2) | Jump back to Input_CopyADictionaryWord_TestTheLetter if bit 7 of the earlier dictionary byte is set. | ||
| 28584 | JR NZ,Input_CopyADictionaryWord_TestTheLetter | |||
| Input_CopyADictionaryWord_RestoreThePointer | 28586 | POP HL | Restore the saved pointer from the stack and keep the letter count. | |
| 28587 | LD A,B | |||
| 28588 | LD (28827),A | Update *28827. | ||
| 28591 | BIT 6,(IX-1) | Return if bit 6 of this dictionary byte is clear. | ||
| 28595 | RET Z | |||
| 28596 | INC IX | Step IX past the two flag bytes of this dictionary entry. | ||
| 28598 | INC IX | |||
| 28600 | XOR A | Return zero. | ||
| 28601 | RET | Return. | ||
| Prev: 28464 | Up: Map | Next: 28602 |