Prev: 06584 Up: Map Next: 06629
06621: 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 06621 AND A Prepare for a true subtraction.
06622 SBC HL,DE Find the length from one 'start' to the next and pass it to the BC register pair.
06624 LD B,H
06625 LD C,L
06626 ADD HL,DE Reform the address and exchange them before returning.
06627 EX DE,HL
06628 RET
Prev: 06584 Up: Map Next: 06629