Prev: 50906 Up: Map Next: 50956
50946: Dispatch Handler Pointer From HL
Chained trampoline: pushes resume address DispatchWordFromHL, loads a 22-bit routine pointer from HL, advances HL by 2 then jumps to that pointer via the stack. When the handler RETs, execution continues at DispatchWordFromHL for the next table entry, so handlers should leave HL valid for the following word unless the chain ends. Used from 52319, 52927, 53061, 53884 with tables such as Entity_List_Base.
DispatchWordFromHL 50946 LD DE,50946 DE=DispatchWordFromHL (resume address after each nested RET).
50949 PUSH DE Save the resume address on the stack.
50950 LD E,(HL) E=*HL (handler pointer, low byte).
50951 INC HL Advance HL.
50952 LD D,(HL) D=*HL (handler pointer, high byte).
50953 INC HL Advance HL past the pointer.
50954 PUSH DE Stack the handler address.
50955 RET RET to the handler (next RET pops back to DispatchWordFromHL).
Prev: 50906 Up: Map Next: 50956