Prev: 06621 Up: Map Next: 06651
06629: THE 'RECLAIMING' SUBROUTINE
Used by the routines at LD_CONTRL, CLEAR_SP, REC_EDIT and CLEAR.
The main entry point is used when the address of the first location to be reclaimed is in the DE register pair and the address of the first location to be left alone is in the HL register pair. The entry point RECLAIM_2 is used when the HL register pair points to the first location to be reclaimed and the BC register pair holds the number of bytes that are to be reclaimed.
Input
DE Start address of the area to reclaim
HL One past the end address of the area to reclaim
Output
HL Start address of the area reclaimed (as DE on entry)
RECLAIM_1 06629 CALL DIFFER Use the 'difference' subroutine to develop the appropriate values.
This entry point is used by the routines at LD_CONTRL, ME_ENTER, ED_DELETE, REMOVE_FP, MAIN_ADD, LET and DIM.
RECLAIM_2 06632 PUSH BC Save the number of bytes to be reclaimed.
06633 LD A,B All the system variable pointers above the area have to be reduced by BC, so this number is 2's complemented before the pointers are altered.
06634 CPL
06635 LD B,A
06636 LD A,C
06637 CPL
06638 LD C,A
06639 INC BC
06640 CALL POINTERS
06643 EX DE,HL Return the 'first location' address to the DE register pair and form the address of the first location to the left.
06644 POP HL
06645 ADD HL,DE
06646 PUSH DE Save the 'first location' whilst the actual reclamation occurs.
06647 LDIR
06649 POP HL
06650 RET Now return.
Prev: 06621 Up: Map Next: 06651