| The Hobbit (v1.0) | Routines |
| Prev: 8614 | Up: Map | Next: 86BA |
|
Copies the word at offset E of the frame to (HL) and moves HL on, unless it is empty or B (the number of words wanted) has reached 0.
|
||||
| 869D | XOR A | Does the caller still want any more prepositions from this phrase? | ||
| 869E | CP B | |||
| 869F | RET Z | No: nothing more to do | ||
| 86A0 | LD D,$00 | |||
| 86A2 | PUSH IY | Save the caller's IY, the current frame | ||
| 86A4 | ADD IY,DE | IY = the frame, plus the offset of the preposition slot asked for | ||
| 86A6 | LD A,(IY+$00) | Copy its low byte to where HL points... | ||
| 86A9 | LD (HL),A | |||
| 86AA | INC HL | |||
| 86AB | LD A,(IY+$01) | ...then its high byte | ||
| 86AE | LD (HL),A | |||
| 86AF | DEC HL | Step back to the low byte | ||
| 86B0 | OR (IY+$00) | Was that slot actually empty (both bytes zero)? | ||
| 86B3 | POP IY | Restore the caller's IY | ||
| 86B5 | RET Z | Empty: leave HL where it is, so the next candidate can use the same two bytes | ||
| 86B6 | DEC B | A real preposition was found: one fewer still wanted | ||
| 86B7 | INC HL | Move on past the two bytes just filled | ||
| 86B8 | INC HL | |||
| 86B9 | RET | |||
| Prev: 8614 | Up: Map | Next: 86BA |