Prev: 359C Up: Map Next: 35C9
35BF: THE 'STK-PNTRS' SUBROUTINE
Used by the routines at CALCULATE, strs_add, val and read_in.
This subroutine resets the HL register pair to point to the first byte of the 'last value', i.e. STKEND-5, and the DE register pair to point one past the 'last value', i.e. STKEND.
Input
Output
DE STKEND
HL STKEND-5
STK_PNTRS 35BF LD HL,($5C65) Fetch the current value of STKEND.
35C2 LD DE,$FFFB Set DE to -5, two's complement.
35C5 PUSH HL Stack the value for STKEND.
35C6 ADD HL,DE Calculate STKEND-5.
35C7 POP DE DE now holds STKEND and HL holds STKEND-5.
35C8 RET
Prev: 359C Up: Map Next: 35C9