Sherlock: annotated disassembly

Routines

Prev: A73B Up: Map Next: A75B
A745: Name room or thing A
Entered with carry from $A3DF/$A412: carry clear names a room (A4AB, A7BA), carry set - and A751, used by codes $07 and $09 - a thing (A4BC, A7C5).
Input
A The room or thing number
F Carry set for a room, clear for a thing
Output
A 0
HL Kept
A745 JR NC,$A751 No carry (from the caller's compare): a thing - go to A751
A747 PUSH HL Save HL on the stack - Carry: a room: HL = its name words (A4AB), print them (A7BA)
A748 CALL $A4AB Call the routine "HL = room A's record + 1" (A4AB)
A74B CALL $A7BA Call the routine "Print the name of the thing at HL (as D405)" (A7BA)
A74E POP HL Restore HL from the stack
A74F XOR A Set A to zero, which sets the zero flag for the caller
A750 RET Return to the caller
This entry point is used by the routines at A72C, A73B and A82F.
A751 PUSH HL Save HL on the stack - A thing: HL = its name words (A4BC), print them (A7C5)
A752 CALL $A4BC Call the routine "HL = thing A's record + 7" (A4BC)
A755 CALL $A7C5 Call the routine "Print the name of the thing at HL (as D3E8)" (A7C5)
A758 POP HL Restore HL from the stack
A759 XOR A Set A to zero, which sets the zero flag for the caller - Return A = 0
A75A RET Return to the caller
Prev: A73B Up: Map Next: A75B