Sherlock: annotated disassembly

Routines

Prev: B36B Up: Map Next: B39C
B387: Test the verb record's flags against the indirect-object slot
Z if bit 2 of $A01D is clear; otherwise NZ if the indirect-object slot has words (bit 0 of $B16E) or bit 1 of $A01D is clear, Z if not.
Input
$A01D The verb's flags
Output
F Z if nothing is needed or none is missing; NZ if the slot has words or one is missing
B387 LD A,($A01D) Read $A01D in "Game variables" into A - Does the verb take an indirect object ($A01D bit 2)? If not: Z, nothing to check
B38A BIT 2,A Test bit 2 of A
B38C RET Z If bit 2 of A is clear, return
B38D LD HL,$B16E Point HL at $B16E in "Parser variables" - The slot has a noun phrase ($B16E bit 0): NZ
B390 BIT 0,(HL) Test bit 0 of the byte at $B16E in "Parser variables"
B392 RET NZ If bit 0 of the byte at $B16E in "Parser variables" is set, return
B393 BIT 1,A Test bit 1 of A - None typed: the verb can do without ($A01D bit 1)? Z, fine
B395 JR NZ,$B39A If bit 1 of A is set, skip ahead to B39A
B397 OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller - Otherwise NZ: one is missing
B399 RET Return to the caller
B39A XOR A Set A to zero, which sets the zero flag for the caller
B39B RET Return to the caller
Prev: B36B Up: Map Next: B39C