Prev: 1BBF Up: Map Next: 1BEE
1BD1: THE 'NEXT-LINE' ROUTINE
Used by the routine at LINE_RUN.
The routine at LINE_USE continues here.
On entry the HL register pair points to the location after the end of the 'next' line to be handled and the DE register pair to the location before the first character of the line. This applies to lines in the program area and also to a line in the editing area - where the next line will be the same line again whilst there are still statements to be interpreted.
Input
DE One before the address of the first character in the line
HL Start address of the following line
NEXT_LINE 1BD1 LD ($5C55),HL Set NXTLIN for use once the current line has been completed.
1BD4 EX DE,HL As usual CH-ADD points to the location before the first character to be considered.
1BD5 LD ($5C5D),HL
1BD8 LD D,A The statement number is fetched.
1BD9 LD E,$00 The E register is cleared in case EACH_STMT is used.
1BDB LD (IY+$0A),$FF Signal 'no jump' by setting NSPPC to +FF.
1BDF DEC D The statement number minus one goes into SUBPPC.
1BE0 LD (IY+$0D),D
1BE3 JP Z,STMT_LOOP A first statement can now be considered.
1BE6 INC D However for later statements the 'starting address' has to be found.
1BE7 CALL EACH_STMT
1BEA JR Z,STMT_NEXT Jump forward unless the statement does not exist.
This entry point is used by the routine at LINE_NEW.
Report N - Statement lost.
REPORT_N 1BEC RST $08 Call the error handling routine.
1BED DEFB $16
Prev: 1BBF Up: Map Next: 1BEE