_196D_OUT_CH_3: call 0010 PRINT A 1 to output the code. Exit: RET. Output parameters: none. Called from: 18A1 OUT LINE5 Exit from: 1925 OUT SP 2 (192A OUT SP NO) OUT CH 1 195A (1937 OUT CHAR) Jumps from: 1937 OUT CHAR OUT CH 2 1968 (1937 OUT CHAR) Jumps from: 1937 OUT CHAR (twice) 195A OUT CH 1 OUT CH 3 196D (1937 OUT CHAR) Jumps from: 1937 OUT CHAR (4 times) OUT CODE subroutine 15EF Alternative entry point to routines which output a data byte by the channel/stream system: see channels and streams. It differs from the more frequently used restart 0010 PRINT A 1 in adding 30h/48d to the value of the data byte beforeoutputting it. This converts a decimal digit value to the corresponding character code, but it is also used with report codes: the error number is incremented in 1303 MAIN 4, then output immediately as a digit if it is less than 0Ah or increased by 7 first in 1313 MAIN G to give the correct letter. Input parameters: A holds the byte to be output. Action: add 30h/48d to A. Exit: into 15F2 PRINT A 2. Output parameters: A holds the code to be output. Called from: 133C MAIN 5 1A42 OUT NUM 4 2F46 PF NOT E 2F59 PF OUT DT Exit from: 192B OUT SP 1 (192A OUT SP NO) OUT COMMAND ROUTINE see 1E7A OUT OUT CURS subroutine 18E1 Prints a flashing cursor, C, E, G, K or L depending on the current mode; ie outputs it through the current channel. Input parameters: DE is an input pointer to the address in the input or editing area of the next character to be printed - 5C5B K CUR holds a cursor pointer to the address in the input at which the cursor is to be printed. Action: if the input pointer isn't on the cursor pointer,return at once - double the value in 5C41 MODE; making zero for K/L/C mode, 2 for E mode, 4 for G mode - if the result is zero jump on to OUT C 1; K/L/C modes - add 43h; making 43 + 2 = 45h, the code for "E", or 43 + 4 = 47h, the code for "G" - jump on to OUT C 2. _18F3_OUT_C_1 (K/L/C modes): zero bit 3 of FLAGS; "last character was in K mode" - load 4Bh "K" for the cursor - if bit 2 of FLAGS is zero jump on to OUT C 2; "next character in K mode", see entry on FLAGS bit 2 - (L/C mode) set bit 3 of FLAGS - increment 4Bh "K" to 4Ch "L" - if bit 3 of FLAGS2 is zero jump on to OUT C 2; CAPS LOCK is off - (CAPS LOCK is on) load 43h "C" for the cursor. _1909_OUT_C_2: call 18C1 OUT FLASH to print the selected letter as a flashing cursor. Exit: RET, from OUT CURS or OUT C 2. Output parameters: DE is saved unchanged - svs unchanged except for bit 3 of FLAGS, which is madeto correspond with bit 2. Called from: 111D ED COPY 18A1 OUT LINE5 OUT C 1 18F3 (18E1 OUT CURS) Jumps from: 18E1 OUT CURS OUT C 2 1909 (18E1 OUT CURS) Exit from: 18E1 OUT CURS through 18F3 OUT C 1 (twice) OUT FLASH subroutine 18C1 Prints a flashing cursor in the BASIC line; ie outputs abyte through the current channel. This may be either a "?" to mark a syntax error, or the "mode cursor", letter C, E, G, K or L signalling where input is currently being placed. Input parameters: A holds the character code of the cursor. Action: use the alternate registers; apparently only to save DE in the call from 1894 OUT LINE4. - stack the values of 5C8F ATTR T and 5C90 MASK T - zero bit 7 of MASK T and set bit 7 of ATTR T; this makes FLASH - stack the value of 5C91 P FLAG - zero its byte; this cancels any OVER, PAPER 9 or INK 9signals. INVERSE is irrelevant. - call 09F4 PRINT OUT, which outputs the character code through the current channel - restore the system variables to their former state - restore the main registers. Exit: RET. Output parameters: HL, BC and DE are preserved by EXX, but HL', DE' and BC' are corrupted. Called from: 1894 OUT LINE4 1909 OUT C 2 OUT LINE subroutine 1855 Prints a complete BASIC line, with line number and the current line marker ">" if appropriate; ie outputs it byte by byte through the current channel. Returns with a flag showing whether this line is before/equal to the current line or after it. The handling of this current line flag isn't well explained in the notes: - OUT LINE sets the flag to 00 "this is beyond the current line" or 01 "this is before the current line"_if_the _present_line_is_not_the_current_line, but if it is the current line the flag isn't changed - the only ROM call to LIST ALL, in 17ED AUTO L 4, is actually a call of the address 1833, two bytes before the heading shown in the listing; but looping back within LIST ALL is to 1835 as shown. The command LD E,01 at 1833 is therefore part of the subroutine, but isn't looped back to - 5C67 BREG, in which the current line flag is saved in OUT LINE, is read by 0C55 PO SCR in automatic listings; if the flag is one, and the screen is full, it will be scrolled till the current line is printed. The entry point at 187D OUT LINE2 is also used during input or editing of BASIC; the whole line, as it exists so far, is copied from the input/editing area into the lower part of thescreen each time a key is pressed. This version of the BASIC line doesn't have the inserted FP forms of the numbers, and its line number is just a string of decimal digits: these things arechanged when the line is added to the program by 155D MAIN ADD. Printing the line from editing is therefore simpler than printing a line out of the program area, as the line number can be printed as it stands and there is no question of a current line marker. Input parameters: HL is a BASIC pointer to the address inthe editing or program area of the start of the line; this is the hi byte of the hi-lo line number - E holds the current line flag. Action: get a value from 5C49 E PPC; this is the number of the line which is to be marked as current - call 1980 CP LINES; it returns with Z if this is the current line and with C if it is before the current line - make the "cursor byte" code 3E > - if this is the current line jump on to OUT LINE1 - (not current line) zero the cursor byte and the current line flag - move the carry into bit zero of the flag; now it is one if this line is before the current line, zero if after. _1865_OUT_LINE1 (misprinted as OUT LINE): save the current line flag in 5C67 BREG - if the hi byte of the line number is more than 40h make a "double return" by dropping the return address and then returning; the line start is beyond the end of the program - call 1A28 OUT NUM 2 to print the line number, with leading spaces - advance the BASIC pointer three times; over the lo byte of the number and the length bytes - zero bit zero of FLAGS; "leading space allowed" - if the cursor byte is zero jump on to OUT LINE3; no current line cursor is to be printed - call 0010 PRINT A 1 to print the > _187D_OUT_LINE2 (entry point from 111D ED COPY when inputor editing is in progress): set bit zero of FLAGS; "no leading space". The current line cursor replaces the leading space, if it was printed, and for input this is the start of the line. _1881_OUT_LINE3: zero bit 2 of FLAGS2; "not in quotes" - zero bit 2 of FLAGS; "K mode" - if bit 5 of FLAGX is zero jump on to OUT LINE4; not ininput mode - (input mode) set bit 2 of FLAGS; "L mode". _1894_OUT_LINE4 (loop back to here after each character has been output): get the syntax error pointer from 5C5F X PTR - if it doesn't match the BASIC pointer jump on to OUT LINE5 - (error position) make a byte 3F ? - call 18C1 OUT FLASH to print it as a flashing cursor. _18A1_OUT_LINE5: call 18E1 OUT CURS, which does its own check and prints the mode cursor if the BASIC pointer matches 5C5D K CUR - read the next code - call 18B6 NUMBER; if it is a number marker it and the FP number form which follows it are skipped - move on the BASIC pointer; but don't read its code yet - if the code read last was a newline jump on to OUT LINE6; a newline will be printed anyway after this subroutine returns - call 1937 OUT CHAR to output the character - loop back to OUT LINE4. _18B4_OUT_LINE6: clear the machine stack and return. Exit: RET from OUT LINE6, or double RET from OUT LINE1; this makes a complete return from the 17F9 LIST command routine if the call was from 1835 LIST ALL. It cannot arise in the callsfrom the EDITOR loop. Output parameters: E holds zero for "current line has been displayed" or one "for current line not yet displayed"; after the calls from the EDITOR loop it may hold any value. Called from: 0FA9 ED EDIT 1835 LIST ALL OUT LINE1 1865 (1855 OUT LINE) Exit from: 1855 OUT LINE OUT LINE2 subroutine 187D (1855 OUT LINE) An alternative entry point, see above. Called from: 111D ED COPY OUT LINE3 1881 (1855 OUT LINE) Jumps from: 1865 OUT LINE1 OUT LINE4 1894 (1855 OUT LINE) Jumps from: 1881 OUT LINE3 18A1 OUT LINE5 OUT LINE5 18A1 (1855 OUT LINE) Jumps from: 1894 OUT LINE4 OUT LINE6 18B4 (1855 OUT LINE) Exit from: 1B55 OUT LINE through 18A1 OUT LINE5 OUT NUM 1 subroutine 1A1B Prints a decimal integer of up to four digits, without leading spaces; ie outputs it byte by byte through the current channel. Used to print line numbers in error reports, and the exponents of numbers in E format. The entry point OUT NUM 2 is used in printing out BASIC lines, and in this case leading spaces are printed. Either entry point can also be called from m/c. They make no check on the size of the number: numbers above 8000h/ 32768d will print as zero from OUT NUM 1, but other numbers above 9999d will print as wrong digits, as will any above 9999d from OUT NUM 2. You can write your own "Chinese copy" of the OUTNUM 3 routine with an extra call to 192A OUT SP NO for a fifth digit; BC should hold D8F0h/-10000d for the first call. See OUT SP NO for the mechanism of digit calculation. Input parameters: BC holds the integer. Action: make a zero digit byte - if the hi bit of the integer is set jump on to OUT NUM4; BC >= 8000h/32768d, and is assumed to be -2, the line number of a direct command, which is printed as zero - make a signal FF for "no leading spaces" - jump on to OUT NUM 3. _1A28_OUT_NUM_2 (entry point for printing line numbers with leading spaces; HL holds a pointer to the hi-lo line number): read the hi-lo number - make the signal 20h for "leading spaces". _1A30_OUT_NUM_3: make three successive calls to 192A OUT SP NO to output the three first digits, with BC successively FC18h/-1000d, FF9Ch/-100d and FFF6h/-10d; what is left of HL is brought round again with the next BC when the subroutine is called again - load the digit byte with L; this is now the fourth digit. _1A42_OUT_NUM_4: call 15EF OUT CODE to output the fourth digit. Exit: RET. Output parameters: HL and DE are saved and restored unchanged. Called from: 133C MAIN 5 (misprinted) Exit from: 2F85 PF E SIGN (again misprinted, differently!) OUT NUM 2 subroutine 1A28 An alternative entry to OUT NUM 1, see above. Called from: 1865 OUT LINE1 Rems: 1A1B OUT NUM 1 prints numbers up to 9999d OUT NUM 3 1A30 (1A1B OUT NUM 1) Jumps from: 1A1B OUT NUM 1 OUT NUM 4 1A42 (1A1B OUT NUM 1) Jumps from: 1A1B OUT NUM 1 'Out of memory' message (13C6) see REPORT 4 out of range error see 2ACC INT EXP1 'Out of screen' message (13D2) see REPORT 5 output, see printing output address of channel, output routine of streams see channels and streams output routines see printing