![]() |
Routines |
Prev: 31244 | Up: Map | Next: 31284 |
Used by the routine at 30675. Returns with the zero flag set if Sam has dialled a valid telephone number, and with the telephone identifier in A.
|
||
31255 | LD HL,27466 | Point HL at the end of the phone number and location table at 27392 |
31258 | LD C,15 | There are 15 entries to check |
31260 | LD DE,32661 | Point DE at the last digit of the phone number dialled by Sam (stored at 32658) |
31263 | LD B,4 | There are 4 digits in a phone number |
31265 | LD A,(DE) | A=digit of the phone number dialled by Sam |
31266 | CP (HL) | Compare it with that of a phone number in the table |
31267 | DEC HL | Point HL at the previous digit of the phone number |
31268 | DEC DE | Point DE at the previous digit dialled by Sam |
31269 | JR NZ,31276 | Jump if there's no match |
31271 | DJNZ 31265 | Jump back until all 4 digits have been compared |
31273 | LD A,(HL) | A=identifier of the matching telephone |
31274 | RET | Return with the zero flag set |
31275 | DEC HL | Point HL at the first byte of the phone number entry (the telephone identifier) |
31276 | DJNZ 31275 | |
31278 | DEC HL | Point HL at the last digit of the previous phone number in the table |
31279 | DEC C | Are there any more phone numbers to check? |
31280 | JR NZ,31260 | Jump back if so |
31282 | AND A | Reset the zero flag |
31283 | RET |
Prev: 31244 | Up: Map | Next: 31284 |