Prev: 9392 Up: Map Next: 93ED
93CD: LOCK
The target must be closed and not already locked (A129). The instrument must not be broken (bit 3 of its flags) or 'the key is broken'. Then bit 0 (locked) of the target's flags is set.
LOCK and UNLOCK share their last instructions: this routine writes $C6 into $93EB, turning the instruction at 93E8 into SET 0,(IX+$07); 93ED writes $86 there, turning it into RES 0,(IX+$07).
93CD CALL $A129 Is the target already locked, or not even closed?
93D0 JP NZ,$A09C If either, say why it cannot be locked
93D3 LD A,$C6 A = $C6, the machine-code for a SET instruction
This entry point is used by the routine at 93ED.
93D5 LD ($93EB),A Poke that into the instruction at $93EB below, so that from now on it locks rather than unlocks - this and 93ED share their final steps by rewriting each other
93D8 LD IY,($B5FA) IY = the instrument's (the key's) own record
93DC BIT 3,(IY+$07) Is the key broken?
93E0 LD A,$83 A = the state code for BROKEN
93E2 JP NZ,$A094 If it is broken, say so and stop
93E5 CALL $9C99 Dry run? Then stop here: it would work
93E8 SET 0,(IX+$07) Lock the target (this very byte is what 93ED rewrites to RES, to unlock instead)
93EC RET
Prev: 9392 Up: Map Next: 93ED