| quill | Routines |
| Prev: 26726 | Up: Map | Next: 26845 |
|
Used by the routines at ACTION_AUTOW and ACTION_AUTOR.
|
||||
| FIND_OBJECT | 26798 | LD A,(23330) | A=current noun | |
| 26801 | CP 200 | Is it less than 200? | ||
| 26803 | JR C,FIND_OBJECT_2 | Jump to "I can't" | ||
|
This entry point is used by the routines at ACTION_AUTOG and ACTION_AUTOD.
|
||||
| FIND_OBJECT_0 | 26805 | LD A,(23330) | A=current noun | |
| 26808 | CP 255 | Is it 255? | ||
| 26810 | JR Z,FIND_OBJECT_2 | Jump to "I can't" | ||
| 26812 | LD DE,(27538) | D=total number of objects | ||
| 26816 | LD E,0 | E=current object number | ||
| 26818 | LD HL,(27561) | HL = Address of Object Words table | ||
| FIND_OBJECT_1 | 26821 | CP (HL) | Does current noun match object word entry? | |
| 26822 | JR Z,FIND_OBJECT_3 | If so, we have a match | ||
| 26824 | INC E | E=next object number | ||
| 26825 | INC HL | Move to next entry in object words table | ||
| 26826 | DEC D | Have we considered every object? | ||
| 26827 | JR NZ,FIND_OBJECT_1 | If not, loop around to the next | ||
| FIND_OBJECT_2 | 26829 | LD HL,8 | "I can't" | |
| 26832 | XOR A | A=0 | ||
| 26833 | RET | Return as object could not be found | ||
| FIND_OBJECT_3 | 26834 | LD D,0 | ||
| 26836 | LD A,E | A=number of matching object | ||
| 26837 | LD HL,23333 | HL=Object location table | ||
| 26840 | ADD HL,DE | |||
| 26841 | EX DE,HL | DE now points to object's location. H=0. L=number of matching object | ||
| 26842 | INC H | H=1 | ||
| 26843 | DEC BC | |||
| 26844 | RET | |||
| Prev: 26726 | Up: Map | Next: 26845 |