Prev: 7F6F Up: Map Next: 7FC5
7F81: Parser: give a frame the previous frame's verb
Copies the verb from the frame at IX into the frame at IY (keeping IY's flag bits). This is how the verb is shared when AND joins objects: 'take the key and the sword' produces two TAKE frames.
If the new frame has a second noun phrase, and bit 7 of E is set, the second noun phrase and the particle of the previous frame are copied too (7FC9), so that 'put the key and the sword in the chest' puts both in the chest.
7F81 EXX Switch to the alternate registers for a moment
7F82 LD A,(IX+$01) A = the previous frame's own verb flags...
7F85 AND $7F ...with the ALL bit (bit 7) stripped out, since that should not be copied along
7F87 OR (IY+$01) Combine that with whatever flags this frame already carries (such as its own EXCEPT bit)
7F8A LD (IY+$01),A
7F8D LD A,(IX+$00) Copy the verb itself too
7F90 LD (IY+$00),A
7F93 EXX Back to the ordinary registers
7F94 LD A,(IY+$1C) Does the new frame have a second noun phrase of its own?
7F97 OR (IY+$1D)
7F9A RET Z No noun there at all: nothing more to copy
7F9B BIT 7,E Is the "second phrase still empty" state flag set?
7F9D RET Z It is not empty: leave it as it is
7F9E EXX Switch to the alternate registers again
7F9F PUSH IY HL = the new frame's own address
7FA1 POP HL
7FA2 LD DE,$0012 Move on to its particle...
7FA5 ADD HL,DE
7FA6 PUSH HL Save that address
7FA7 LD DE,$FFF6 Move back instead to the PREVIOUS frame's own particle
7FAA ADD HL,DE
7FAB POP DE DE = the new frame's particle address, HL = the previous frame's
7FAC LD BC,$0006 Copy 6 bytes: the particle, and the start of the noun that follows it
7FAF LDIR
7FB1 LD DE,$0004 Offset to the second noun phrase
This entry point is used by the routine at 7CC0.
7FB4 CALL $7FC9 Copy that whole phrase too, from the previous frame
7FB7 LD A,(IY+$02) Does the new frame's OWN particle turn out to be still empty?
7FBA OR (IY+$03)
7FBD LD DE,$0002 If so, copy just the particle word on its own as well
7FC0 CALL Z,$7FCD
7FC3 EXX Back to the ordinary registers
7FC4 RET
Prev: 7F6F Up: Map Next: 7FC5