Prev: 19E5 Up: Map Next: 1A1B
19FB: 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.
Input
Output
BC Number of the line in the editing area (or +0000 if none)
E_LINE_NO 19FB LD HL,($5C59) Pick up the pointer to the edit-line (E-LINE).
19FE DEC HL Set CH-ADD to point to the location before any number.
19FF LD ($5C5D),HL
1A02 RST $20 Pass the first code to the A register.
1A03 LD HL,$5C92 However before considering the code make the calculator's memory area a temporary calculator stack area (by setting STKEND equal to MEMBOT).
1A06 LD ($5C65),HL
1A09 CALL INT_TO_FP Now read the digits of the line number. Return zero if no number exists.
1A0C CALL FP_TO_BC Compress the line number into the BC register pair.
1A0F JR C,E_L_1 Jump forward if the number exceeds 65,536.
1A11 LD HL,$D8F0 Otherwise test it against 10,000.
1A14 ADD HL,BC
E_L_1 1A15 JP C,REPORT_C Give report C if over 9,999.
1A18 JP SET_STK Return via SET_STK that restores the calculator stack to its rightful place.
Prev: 19E5 Up: Map Next: 1A1B