| The Hobbit (v1.0) | Routines |
| Prev: 9ADC | Up: Map | Next: 9B04 |
|
Moves IX on to the next 3-byte entry of a table such as the object index (BF53), returning the key in A and the address it holds in IY. Returns with Z set at the end of the table ($FF). The alternate registers are used so that BC, DE and HL are preserved.
|
||||
| 9AEE | EXX | Switch to the alternate registers, so this does not disturb the caller's own BC, DE and HL | ||
| 9AEF | LD DE,$0003 | DE = 3, the size of one entry | ||
| 9AF2 | ADD IX,DE | Move IX on to the next entry | ||
| 9AF4 | LD D,(IX+$02) | DE = the 16-bit value stored in this entry (e.g. a record address)... | ||
| 9AF7 | LD E,(IX+$01) | |||
| 9AFA | PUSH DE | ...moved into IY for the caller to use | ||
| 9AFB | POP IY | |||
| 9AFD | LD A,(IX+$00) | A = this entry's own key | ||
| 9B00 | CP $FF | Is it the table's $FF terminator? | ||
| 9B02 | EXX | Switch back to the caller's own registers | ||
| 9B03 | RET | Z set means the terminator was reached; NZ means a genuine entry was found | ||
| Prev: 9ADC | Up: Map | Next: 9B04 |