Sherlock: annotated disassembly

Routines

Prev: BE5A Up: Map Next: BE91
BE72: Step IX over a whole group of case records
Used by the routines at BB67, BC9C and BE91.
Input
IX The first record of a group
Output
IX The first record after the group
AF Kept
BE72 PUSH AF Save AF on the stack - B counts the nesting depth of the group
BE73 LD B,$00 Load B with $00
BE75 LD C,(IX+$03) Read byte +3 of the record at IX into C - C = this case record's byte 3; step IX on (BE5A)
BE78 CALL $BE5A Call the routine "Step IX over one case record (4 bytes, or 6 with a..." (BE5A)
BE7B BIT 3,C Test bit 3 of C - Bit 3 closes a level (not below zero)
BE7D JR Z,$BE84 If bit 3 of C is clear, skip ahead to BE84
BE7F LD A,B Copy B into A
BE80 AND A Test A for zero (this leaves A as it was and clears carry)
BE81 JR Z,$BE84 If A is zero, skip ahead to BE84
BE83 DEC B Subtract one from B
BE84 BIT 2,C Test bit 2 of C - Bit 2 opens one
BE86 JR Z,$BE8B If bit 2 of C is clear, skip ahead to BE8B
BE88 INC B Add one to B
BE89 JR $BE75 Go back to BE75
BE8B LD A,B Copy B into A - Until the depth is back to zero
BE8C AND A Test A for zero (this leaves A as it was and clears carry)
BE8D JR NZ,$BE75 If A is not zero, go back to BE75
BE8F POP AF Restore AF from the stack
BE90 RET Return to the caller
Prev: BE5A Up: Map Next: BE91