Prev: 19B8 Up: Map Next: 19E5
19DD: THE 'DIFFERENCE' SUBROUTINE
Used by the routine at RECLAIM_1.
The routine at NEXT_ONE continues here.
The 'length' between two 'starts' is formed in the BC register pair. The pointers are reformed but returned exchanged.
Input
DE First address
HL Second address
Output
BC HL-DE
DE Second address (as in HL on entry)
HL First address (as in DE on entry)
DIFFER 19DD AND A Prepare for a true subtraction.
19DE SBC HL,DE Find the length from one 'start' to the next and pass it to the BC register pair.
19E0 LD B,H
19E1 LD C,L
19E2 ADD HL,DE Reform the address and exchange them before returning.
19E3 EX DE,HL
19E4 RET
Prev: 19B8 Up: Map Next: 19E5