Splitting the Atom back exit forward page 17
CC1F to CC80 Subroutine, called by GOTO and GOSUB. It searches for an inputted line number or matching label. A successful search results in the line number being copied to location 1,2. If the label address is already known this is copied to 58,59. Otherwise the label is searched for and then stored in the label store as well as being copied to 58,59.
CC81 to CCD1 Execute INPUT.
CC8E is the entry point for a numeric variable INPUT, and CCB6 for a string variable. Both entries call the BASIC input routine at CD09 (q.v.); the inputted data is then copied or read from the string input buffer at 140 onwards (see example program at back).
CCD2 to CCEF Execute UNTIL.
CCD2 calls the routine at C70C (the truth tester).
CCD5 - checks for a zero value of the DO/UNTIL stack pointer as 13. If zero, this is an UNTIL with no DO error.
CCE5 - pull the corresponding return address from data.
CCF0 to CD08 Execute DO.
CCF0 checks the value of the DO/UNTIL stack pointer at 13 for range, and causes an error if out of range (too many DO/UNTIL loops).
CCFA - saves the DO/UNTIL return address.
CD09 to CD58 A very useful subroutine, to execute inputs. Entry at CD09 prints a '?' on the screen and then waits for keypresses. Entries are stored in the string input buffer at 140 onwards, and full editing is allowed. The routine returns when <CR> key is pressed, with the Y register pointing at the last character inputted. Entry at CD0F prints the contents of the accumulator as an ASCII character (normally the > prompt sign), and then stores keypresses in the direct-mode input buffer at 100 onwards. The value of COUNT (?7) is set to 0 on return (see example program at back).
CD98 to CDBB Execute END. This effectively sets TOP (?0D) and jumps to direct mode.
CD9B - set TOP=?12 (start of text area).
CDA5 - using TOP as a vector, find a carriage return followed by a negative number, indicating end of program.
CDBC to CDC8 A subroutine called by END which executes:
TOP=TOP+Y register; Y register=1.
CDC9 to CE82 Routine to enter a BASIC program line into the text area. On entry 16 and 25 contain the line number being entered.
CE3E - A RAM test to see if there is enough to enter it.
CE83 to CEA0 A subroutine called by the command at C406.
CEA1 to CEAD A subroutine which executes:
(58)=(58)+Y register; Y register=1.

back exit forward