Prev: 06629 Up: Map Next: 06683
06651: THE 'E-LINE-NO' SUBROUTINE
Used by the routines at MAIN_EXEC and LINE_SCAN.
This subroutine is used to read the line number of the line in the editing area. If there is no line number, i.e. a direct BASIC line, then the line number is considered to be zero.
Output
BC Number of the line in the editing area (or 0 if none)
E_LINE_NO 06651 LD HL,(23641) Pick up the pointer to the edit-line (E-LINE).
06654 DEC HL Set CH-ADD to point to the location before any number.
06655 LD (23645),HL
06658 RST 32 Pass the first code to the A register.
06659 LD HL,23698 However before considering the code make the calculator's memory area a temporary calculator stack area (by setting STKEND equal to MEMBOT).
06662 LD (23653),HL
06665 CALL INT_TO_FP Now read the digits of the line number. Return zero if no number exists.
06668 CALL FP_TO_BC Compress the line number into the BC register pair.
06671 JR C,E_L_1 Jump forward if the number exceeds 65,536.
06673 LD HL,55536 Otherwise test it against 10,000.
06676 ADD HL,BC
E_L_1 06677 JP C,REPORT_C Give report C if over 9,999.
06680 JP SET_STK Return via SET_STK that restores the calculator stack to its rightful place.
Prev: 06629 Up: Map Next: 06683