Sherlock: annotated disassembly

Routines

Prev: C4D1 Up: Map Next: C55A
C542: Should the indirect object be guessed?
NZ when the action record wants an indirect object ($A010, its header byte 1's low nibble, is not 0), none was typed ($A035 = $FF) and bit 1 of $A01D is clear.
Input
$A010, $A035, $A01D
Output
F NZ when an indirect object should be guessed; Z when not
C542 LD A,($A010) Read $A010 in "Game variables" into A - No indirect object wanted ($A010 = 0): no guessing - Z
C545 AND A Clear the carry flag for the caller (A is unchanged)
C546 RET Z If A is zero, return
C547 LD A,($A035) Read $A035 in "Game variables" into A - One was typed ($A035 is not $FF): no guessing - Z
C54A CP $FF Compare A with $FF
C54C JR NZ,$C558 If A differs from $FF, skip ahead to C558
C54E LD A,($A01D) Read $A01D in "Game variables" into A - None typed: $A01D bit 1 set means the verb can do without
C551 AND $02 Isolate bit 1 of A (mask $02)
C553 JR NZ,$C558 If bit 1 of A was set, skip ahead to C558
C555 OR $01
C557 RET Return to the caller
C558 XOR A Set A to zero, which sets the zero flag for the caller - Return Z
C559 RET Return to the caller
Prev: C4D1 Up: Map Next: C55A