| Routines

13303: THE 'SKIP CONSTANTS' SUBROUTINE

Used by the routine at stk_con. This subroutine is entered with the HL' register pair holding the base address of the calculator's table of constants and the A register holding a parameter that shows which of the five constants is being requested. The subroutine performs the null operations of loading the five bytes of each unwanted constant into the locations 0000, 0001, 0002, 0003 and 0004 at the beginning of the ROM until the requested constant is reached. The subroutine returns with the HL' register pair holding the base address of the requested constant within the table of constants.
Input
A | Index of the required constant (0 to 4)
HL' | CONSTANTS
Output
HL' | Address of the required constant
SKIP_CONS | 13303 | AND A | The subroutine returns if the parameter is zero, or when the requested constant has been reached.
SKIP_NEXT | 13304 | RET Z
| 13305 | PUSH AF | Save the parameter.
| 13306 | PUSH DE | Save the result pointer.
| 13307 | LD DE,0 | The dummy address.
| 13310 | CALL STK_CONST | Perform imaginary stacking of an expanded constant.
| 13313 | POP DE | Restore the result pointer.
| 13314 | POP AF | Restore the parameter.
| 13315 | DEC A | Count the loops.
| 13316 | JR SKIP_NEXT | Jump back to consider the value of the counter.