CO TEMP E 2287 (09F4 PRINT OUT) Jumps from: 227D CO TEMP D CO TEMP 1 21E1 (21E2 CO TEMP 2) Jumps from: 21E2 CO TEMP 2 (twice) CO TEMP 2 subroutine 21E2 see also colours, control codes Executes a series of INK to OVER colour control items when they follow a PLOT, DRAW or CIRCLE command; not after PRINTor INPUT commands, which call CO TEMP 3 directly for each such item from 2024 PR ITEM 3. Input parameters: 5C5D CH ADD holds the current address in the BASIC line - A holds the token code at this address. Action: call 21F2 CO TEMP 3 and return if it returns withcarry; A wasn't in the range INK to OVER - (CO TEMP 3 found a control item and executed it; the next character is the one following the parameter of the last control item) get the next character - if it is 2C comma or 3B semicolon jump back to 21E1 COTEMP 1 - (every such control must be followed by comma or semicolon) report "Nonsense in BASIC". _21E1_CO_TEMP_1 (after a comma or semicolon) get the nextcode in the BASIC - re-enter CO TEMP 2. Exit: RET, after all successive colour items have been executed. Output parameters: 5C5D CH ADD points to the next byte ofthe BASIC statement after all INK to OVER commands have been dealt with - A holds the byte. Called from: 1CD6 CL 09 1 (misprinted CO TEMP) Rems: 21E1 CO TEMP 1 main entry for COLOUR ITEM routines CO TEMP 3 subroutine 21F2 see also colours, control codes Outputs to the current channel a single colour control item, ie INK to OVER, when they follow a PRINT, INPUT, PLOT, DRAW or CIRCLE command; not when they are used as free-standing BASIC commands. The token codes and the resulting control code output tothe channel are as follows: Token Token code Control code INK D9 10 PAPER DA 11 FLASH DB 12 BRIGHT DC 13 INVERSE DD 14 OVER DE 15 ie in each case the control code is the token code less C9. Input parameters: A holds the token code at the address in 5C5D CH ADD, the BASIC pointer. Action: return with carry unless the token is in the range D9 INK -> DE OVER - (INK to OVER) move the BASIC pointer on to the parameter. _21FC_CO_TEMP_4 (entry here from 1C96 CLASS 09 (PERMS), which makes its own arrangements for getting the op code and parameter pointer): subtract C9 to get the control code - call 1C82 EXPT 1NUM to get the parameter from the BASIC line to the calculator stack - call 1E94 FIND INT1 to get it from the stack - call 0010 PRINT A 1 to output control code and parameter in succession. Exit: RET. Output parameters: none. Called from: 1C96 PERMS (entry at 21FC CO TEMP 4) 2024 PR ITEM 3 21E2 CO TEMP 2 CO TEMP 4 subroutine 21FC (21F2 CO TEMP 3) The entry point to CO TEMP 3 from 1C96 PERMS. Exit from: 21F2 CO TEMP 3 CO TEMP 5 2211 (09F4 PRINT OUT) Exit from: 0A87 PO TEMP (in PRINT OUT, misprinted CO TEMPS) CO TEMP 6 2228 (09F4 PRINT OUT) Jumps from: 2211 CO TEMP 5 CO TEMP 7 2234 (09F4 PRINT OUT) Jumps from: 2211 CO TEMP 5 CO TEMP 8 223E (09F4 PRINT OUT) Jumps from: 2234 CO TEMP 7 CO TEMP 9 2246 (09F4 PRINT OUT) Jumps from: 223E CO TEMP 8 counter (length of save/load block) see program/data blocks counter of variable name see variables counter (screen line) see 5C8C SCR CT COUNT ONE 31FA (31AF division) Jumps from: 31E2 DIV START CP LINES subroutine 1980 Checks a BASIC line to see if it has a given line number. Can be used in conjunction with 19B8 NEXT ONE to search through the program area for a given line number or the next oneafter it, as in 1974 LINE AD 1. Input parameters: HL points to the first byte of a hi-lo line number - BC holds a number for comparison. Action: if B doesn't match the hi byte return with NZ - now match C with the lo byte and return. Exit: RET. Output parameters: all registers except A unchanged - Z if the number matches. Called from: 1974 LINE AD 1 1855 OUT LINE C R GRE 1 233B (2320 CIRCLE) Jumps from: 2320 CIRCLE CURCHL system variable 5C51 Bytes: 2 Holds a pointer to the output address of the current channel; see channels and streams. It is changed whenever the channel is changed. One of the "fourteen pointers" which must be adjusted each time space is made or reclaimed in the RAM, see 1664 POINTERS. Written by: 1615 CHAN FLAG 166B PTR NEXT Read by: 0D94 CL CHAN 0DAF CL ALL 0A80 PO CHANGE 0FA9 ED EDIT 15E6 INPUT AD 15F2 PRINT A 2 21D6 IN CHAN K 361F str$ 3645 read-in Rems: 1601 CHAN OPEN makes selected channel the current one 365F R I STORE restores channel after reading data current channel see channels and streams, 5C51 CURCHL current line cursor, current line marker see TV FLAG bit 4, 1795 AUTO LIST, and ">" (code 3E, after end of alphabet) current line number see TV FLAG bit 4, 1795 AUTO LIST cursor, cursor address see current line cursor, editing cursor under 5C5B K CUR, error cursor under "?" (code 3F) after end of alphabet cursor down key (0A) see also control characters, KEYBOARD SCANNING, 0260 control code table The 6 key with caps shift in K, L or C mode effects the "cursor down" control in editing mode. The current line number is increased and a new automatic listing is made. It has no effect otherwise, eg in normal INPUT mode, except that it is used as a makeshift STOP key in INPUT ... LINE inputs, see 0FF3 ED DOWN. If code 0A is encountered in outputting by 09F4 PRINT OUT it is printed as a "?" by 0A69 PO QUEST. Later models of the Spectrum mostly have a special "downarrow" key, but caps shift 6 still works. 0260 control code table (d) 0A15 control character table 0F92 ED KEYS jumps to executive routine 0FA0 editing keys table 0FF3 ED DOWN executive routine CURSOR DOWN EDITING see 0FF3 ED DOWN cursor left key (08) see also control characters The 5 key with caps shift in K, L or C mode effects the "cursor left" or "backspace" control in editing or INPUT mode. The cursor moves left. If code 08 is encountered in outputting by 09F4 PRINT OUT it produces a backspace by 0A23 PO BACK 1 on screen or printer. This is the only one of the cursor shift keys whose control code can occasionally be useful for concatenation in BASIC strings, or in m/c screen printing. Later models of the Spectrum mostly have a special "leftarrow" key, but caps shift 5 still works. 0260 control code table (d) 0A13 control character table 0A23 PO BACK executive routine, output to screen 0F92 ED KEYS jumps to executive routine (channel) 0FA0 editing keys table 1007 ED LEFT executive routine, output to channel CURSOR LEFT EDITING see 1007 ED LEFT CURSOR LEFT SUBROUTINE see 0A23 PO BACK 1 cursor position see system variable 5C5B K CUR cursor right key (09) see also control characters, KEYBOARD SCANNING, 0260 control code table The 8 key with caps shift in K, L or C mode effects the "cursor right" control in editing or INPUT mode. The cursor moves right. If code 09 is encountered in outputting by 09F4 PRINT OUT it produces an "invisible space", see 0A3D PO RIGHT; but this facility, of questionable usefulness anyway, is spoiledby an error, see under 09F4 PRINT OUT. Later models of the Spectrum mostly have a special "right arrow" key, but caps shift 8 still works. 0260 control code table (d) 0A14 control character table 0A3D PO RIGHT executive routine, output to screen 0F92 ED KEYS jumps to executive routine 0FA0 editing keys table 100C ED RIGHT executive routine, output to channel CURSOR RIGHT EDITING see 100C ED RIGHT CURSOR RIGHT SUBROUTINE see 0A3D PO RIGHT cursor up key (0B) see also control characters, KEYBOARD SCANNING, 0260 control code table The 7 key with caps shift in K, L or C mode effects the "cursor up" control in editing mode - it has no effect otherwise, eg in INPUT mode. The previous line number is made current and a new automatic listing is made. If code 0B is encountered in outputting by 09F4 PRINT OUT it is printed as a "?" by 0A69 PO QUEST. Later models of the Spectrum mostly have a special "up arrow" key, but caps shift 7 still works. 0260 control code table (d) 0A16 control character table 0F92 ED KEYS jumps to executive routine 0FA0 editing keys table 1059 ED UP executive routine CURSOR UP EDITING see 1059 ED UP ----- DAA (decimal adjust instruction) see 2EBA FP BYTES under 2DE3 PRINT FP DATA key (E4) see also commands, functions and operators, KEYBOARD SCANNING, 022C extended mode key table (b) The D key in E mode without shift produces the token DATA. It has two unrelated uses, as a command or as an "adverb" in SAVE/LOAD commands. In commands, the_DATA_statement must include a_DATA _list, one or more string or numeric expressions, separated by commas. They will be skipped in BASIC execution unless a READ statement is encountered, when they will be allocated in sequence to the variable names in the READ statement: the string/numeric status of the variable must match for every item. The command is read by 1B29 STMT L 1 referring through the syntax offset table 1A48 to the syntax parameter table 1A7A.1ACC P DATA causes a jump via 1C11 CLASS 05 and 1C16 JUMP C R tothe executive routine 1E27 DATA. If DATA is used as part of a SAVE/LOAD/VERIFY statement,it isn't a command and isn't read by the statement loop; this use of DATA is handled by the 0605 SAVE ETC subroutine at 0652 SA DATA. The "search" routine of 1D86 LOOK PROG performed duringexecution of a READ command doesn't notice these occurrences of E4 DATA, because 1990 EACH S 1 is programmed to look only at thefirst token of a BASIC statement. 0652 SA DATA 'SAVE/LOAD &c fname DATA' 1D86 LOOK PROG finds occurrences of DATA 1DEC READ 3 reading of DATA list 1DED READ search program for DATA list 1E08 REPORT E "Out of DATA" message 1E0A READ 1 value from DATA list assigned to variable 1E39 PASS BY skips over any statement with DATA 294B V END mistake: simple string can be saved as DATA (cannot be LOADed) DATA subroutine 1E27 Called only by the statement loop, 1C16 JUMP C R, from 1ACC P DATA in the syntax parameter table. "Executes" a DATA statement, though it does nothing. In syntax checking, the statement is checked for expressions and correct separators; in run time, it just jumps forward to the next statement. For the significance of DATA statements in run-time, see 1DED READ. Input parameters: none - the BASIC pointer in 5C5D CH ADD is on the byte after the DATA command. Action: in run-time, jump on to DATA 2. _1E2C_DATA_1: (syntax checking) call 24FB SCANNING to read the expression; it will produce error reports if it finds an incorrect expression - check that the next character is a comma - if it isn't, call 1BEE CHECK END which reports "Nonsense in BASIC" if this isn't the end of the statement and makes a double return if it is - (a comma was found) get the next code from BASIC - loop back to DATA 1 for the next DATA item. _1E37_DATA_2: make a byte E4 DATA; the token to be passedby. Exit: in syntax checking, into CHECK END, which will return into 1876 STMT RET - in run-time, into 1E39 PASS BY, which moves the BASIC pointer on to the next statement.