Sherlock: annotated disassembly

Routines

Prev: E36A Up: Map Next: E38F
E370: Action record: RUN at $E510; default for verb 37 (PAY TO)
Addresses named in the title: E510.
PAY 10D TO CABBIE takes 10d from the purse (thing 27) and the cabbie pays the change back ('You pay 10d. To the cabbie. The cabbie pays 8d. To you.'); a paid cab then leaves, an unpaid one waits. The default GIVE TO (DF02) moves the whole purse instead.
Input
$A036 The payer
$A035 The payee
Output
F NZ; the payer's money reduced and the payee's increased by the sum
E370 DEFB $66,$1D,$45,$E3 Action record header: flags $66; bit 5: test D078 first; bit 6: pre-check at E345; byte 1 $1D
E374 CALL $E34F Can the actor afford it? (E34F; if not, message 683F and fail) HL = what is left
E377 CALL $E38F Store it as the actor's money (E38F)
E37A LD A,($A035) The indirect object ($A035), the payee...
E37D CALL $E619 Call E619 (inside "Action record: RUN at E08F; RUN at E46B;...") - ...does it hold money? (E619, IX = its purse; Z: no, nothing to add)
E380 JR Z,$E38C If the zero flag is set, skip ahead to E38C
E382 CALL $E39C Call the routine "HL = the money a thing holds (+9/+10)" (E39C) - HL = its money (E39C), DE = the sum (E3A9)
E385 CALL $E3A9 Call the routine "DE = the sum of money in the command ($A02F)" (E3A9)
E388 ADD HL,DE Add DE to HL - Add and store (E38F)
E389 CALL $E38F Call the routine "Store HL as the money a thing holds (+9/+10)" (E38F)
E38C OR $01 Make A non-zero, which clears the zero flag, and hand that back to the caller
E38E RET Return to the caller
Prev: E36A Up: Map Next: E38F