Back to Skool Routines
Prev: 25492 Up: Map Next: 25520
25503: Redirect control of character to another routine temporarily
Used by the routines at 27904, 31952, 31969, 32497, 61440, 61533, 61555, 61631, 61696, 62032 and 62815. Drops the return address from the stack and copies it into bytes 3 and 4 of the character's buffer (where the address of the current instruction from the command list is usually held), and copies the routine address from BC into bytes 9 and 10 of the character's buffer and then jumps to it. For the significance of the addresses held in bytes 3/4 or 9/10, see the routine at 25296.
BC Routine address
H Character number (183-214)
25503 LD L,9 Copy the routine address from BC into bytes 9 and 10 of the character's buffer
25505 LD (HL),C
25506 INC L
25507 LD (HL),B
25508 LD A,H A=character number
25509 POP HL Drop the return address from the stack into HL
25510 PUSH BC Push the routine address in BC onto the stack
25511 LD C,L
25512 LD L,3
This entry point is used by the (unused) routine at 25525 with L=9:
25514 LD B,H Now BC=address of the instruction after CALL 25503/25525
25515 LD H,A H=character number
This entry point is used by the routine at 25520 with L=9 and BC=25581, 25656, 25677 or 62794:
25516 LD (HL),C Copy the address in BC (the return address to the caller of this routine) into bytes 3 and 4 (9 and 10) of the character's buffer
25517 INC L
25518 LD (HL),B
25519 RET Make an indirect jump to the routine whose address was in BC on entering this routine
Prev: 25492 Up: Map Next: 25520