Sherlock: annotated disassembly

Routines

Prev: CEFE Up: Map Next: CF80
CF43: Erase a spent one-shot plan instruction
Overwrites the instruction at IX, including its success and failure addresses, with zeros, so the fetch loop skips it from now on.
Input
IX A spent one-shot instruction
Output
The instruction and its addresses overwritten with zeros
CF43 LD A,(IX+$00) Read the first byte of the record at IX into A - Bit 7: two more bytes (an address) to clear
CF46 BIT 7,A Test bit 7 of A
CF48 CALL NZ,$CF73 If bit 7 of A is set, call CF73 (inside "Erase a spent one-shot plan instruction")
CF4B BIT 4,A Test bit 4 of A - Bit 4: two more
CF4D CALL NZ,$CF73 If bit 4 of A is set, call CF73 (inside "Erase a spent one-shot plan instruction")
CF50 AND $0F Then by the instruction's code (bits 0-3):
CF52 CP $01 Compare A with $01 - code 1: two bytes in all
CF54 JR Z,$CF73 If A equals $01, skip ahead to CF73
CF56 CP $02 Compare A with $02 - codes 2 and 5: four
CF58 JR Z,$CF6B If A equals $02, skip ahead to CF6B
CF5A CP $05 Compare A with $05
CF5C JR Z,$CF6B If A equals $05, skip ahead to CF6B
CF5E CP $07 Compare A with $07 - code 7: five
CF60 JR Z,$CF68 If A equals $07, skip ahead to CF68
CF62 CP $06 Compare A with $06 - code 6: three
CF64 JR Z,$CF70 If A equals $06, skip ahead to CF70
CF66 CP $04 Compare A with $04 - code 4: five
CF68 CALL Z,$CF79 If A equals $04, call CF79 (inside "Erase a spent one-shot plan instruction")
CF6B CALL Z,$CF73 If the zero flag is set, call CF73 (inside "Erase a spent one-shot plan instruction")
CF6E CP $03 Compare A with $03 - code 3: three; any other: two
CF70 CALL Z,$CF79 If A equals $03, call CF79 (inside "Erase a spent one-shot plan instruction")
CF73 LD (IX+$00),$00 Set the first byte of the record at IX to $00 - Clear two bytes
CF77 INC IX Step IX on to the next byte
CF79 LD (IX+$00),$00 Set the first byte of the record at IX to $00 - Clear one byte
CF7D INC IX Step IX on to the next byte
CF7F RET Return to the caller
Prev: CEFE Up: Map Next: CF80