Prev: 9344 Up: Map Next: 9392
936E: EMPTY
The barrel's EMPTY handler. It must be open ('the barrel is closed') and have something in it ('the barrel is empty'). Its contents are tipped out where it stands (9CA5) and it is no longer full.
936E LD IX,($B5F8) IX = the target's own record
9372 CALL $A4C3 Is it open?
9375 JP Z,$A09C No: "the X is closed."
9378 LD A,($B5D9) A = the target
937B CALL $9CEC Does it hold anything visible?
937E CP $00
9380 JR Z,$938D No: it is already empty, below
9382 CALL $9C99 Dry run? Then stop here: it would work
9385 CALL $9CA5 Tip everything it holds out, into its own place
9388 RES 2,(IX+$07) It is no longer full
938C RET
938D LD A,$02 A = the state code for FULL/EMPTY
938F JP $A09C "the X is empty."
Prev: 9344 Up: Map Next: 9392