- (not a comma, ie the last DATA statement has been r eadright through) load the token code E4 DATA - call 1D86 LOOK PROG to find the next DATA statement - if none is found report "Out of DATA". _1E0A_READ_1: call 0077 TEMP PTR1 to move the pointer on past the DATA token or comma and store it in 5C5D CH ADD - call 1C56 VAL FET 1 to evaluate the DATA expression and assign it to the variable - store the pointer in 5C57 DATADD - zero 5C5F X PTR; "no error yet" - call 0078 TEMP PTR2 to put the BASIC pointer to the READ command back in 5C5D CH ADD; LD (CH ADD),HL would have donejust as well. _1E1E_READ_2 (also entered from READ in syntax checking, which skips the variable assignment): if the next code in READ is 2C comma jump back to 1DEC READ 3 for another variable - (not a comma) call 1BEE CHECK END; in syntax checking it reports "Nonsense in BASIC" if this isn't the end of the statement and makes a double return to 1B76 STMT RET if it is - (run time) return. _1DEC_READ_3 (there is another variable to be assigned): read the next variable letter in the READ statement - re-enter READ. Exit: RET, from 1E1E READ 2; this will go back to 1B76 STMT RET. Output parameters: none. Rems: 1C1F CLASS 01 called by 1DED READ 2AFF LET called by READ 1 via 1C59 VAL FET 2 for assignment to the variable read-in subroutine 3645 Called only from 0028 FP CALC with literal 1A to executethe function INKEY$ (hatch) as in PRINT INKEY$ (hatch) 4 when channel 4 has been opened to read data from Microdrives etc; it reads a single character from the input channel and puts it in the work space labelled as a string expression. The routine assumes that whatever input system is being used, it will eitherreturn a character code in the A register and set the carry flag, or return with no carry if nothing was read. Not used in the standard Spectrum, without peripherals. Input parameters: none - the stream number on the calculator stack. Action: call 1E94 FIND INT1 to get the stream number - if it is more than 0Fh/15d report "Integer out of range" - save the current channel address - call 1601 CHAN OPEN to open the specified channel - call 15E6 INPUT AD to read one character. - make a string length zero - if carry isn't set jump on to R I STORE; no byte was received - (byte received) make the length one - call 0030 BC SPACES to make a space in the work space - put the byte in it. _365F_R_I_STORE: call 2AB2 STK STO $ to put the address and the unit or zero length of the code on the calculator stack as string parameters - call 1615 CHAN FLAG with the old channel address to set the channel information back as it was. Exit: into 35BF STK PNTRS; HL and DE have been changed byCHAN FLAG, and must be set back as stack pointers to the string parameters on the calculator stack. Output parameters: HL and DE point to the last value on the stack and to the stack end - the last value is a pair of string parameters definingthe code obtained, which is in the work space. Rems: 2634 S INKEY$ puts op code 5A (later changed to 1A) on the stack for INKEY$ followed by (hatch) READ statement see READ key READ 1 1E0A (1DED READ) Jumps from: 1DED READ (twice) READ 2 1E1E (1DED READ) Exit from: 1DED READ READ 3 1DEC (1DED READ) Jumps from: 1E1E READ 2 real numbers see also precision A real number, in mathematical jargon, means roughly a number which can be used to express a physical quantity or ratio: zero and all whole numbers and fractions, positive or negative, are real numbers, but so are non-terminating decimals like square roots, pi, the constant e, and so on. These last arereal numbers but not rational numbers, ie they can't be expressed as a/b with a and b both integers. Imaginary numbers like i, the square root of minus one, and complex numbers Ai + B, aren't real numbers, and mathematicians have invented many other kinds of numbers: vectors and tensors are other examples. 37E2 atn the angle in radians whose tan is X 3833 asn the angle in radians whose sin is X 3843 acs the angle in radians whose cos is X real time see 5C78 FRAMES REC EDIT subroutine 16D4 This is a subroutine to reduce the edit line to a singlecarriage return, as in 1219 RAM SET; it would do this if called with HL holding one less than the value in 5C61 WORKSP. However,it isn't used by the ROM; the same operation is performed at 0FA9 ED EDIT by a call to 1097 CLEAR SP, twice. reclaiming see 1664 POINTERS, 19E5 RECLAIM 1 RECLAIM 1 subroutine 19E5 Whenever anything from the top of the system variables to the top of the calculator stack is_removed or_deleted or reduced in size, the ROM immediately moves down all the bytes above the reduction, and adjusts the fourteen system pointers asnecessary, those which mark the boundaries between various sections of the working memory. See 1664 POINTERS. Examples are the deletion of a line in BASIC, or a DIM command reducing the size of an array. This_reclaiming or scavenging operation is done by the routines starting at 19E5 RECLAIM 1; 19B8 NEXT ONE and RECLAIM 2together delete a BASIC line or variable starting at HL. Input parameters: DE points to the first byte to be deleted - HL to the first to be left alone above the block deleted. Action: call 19DD DIFFER to get the length and reverse the start and end pointers to the RECLAIM 2 values. _19E8_RECLAIM_2 (an alternative entry point; HL points tothe first byte to be deleted and BC holds the number of bytes tobe deleted): save the length - reverse the bits in the hi byte - reverse the bits in the lo byte - increment it as a whole; these operations negate the two-byte length, ie subtract it from 10000h/65536d - call 1664 POINTERS; it "adds" this negative length to any of the fourteen pointers which are above the reclaim location, and returns with pointers to the start and end addresses and the length of the block from the top of the deletion to the top of the calculator stack, ready for the "moveblock up" LDDR instruction used in 1655 MAKE ROOM - exchange the end pointer and the start pointer - recover the length of the block for deletion - add it to the old start pointer; the parameters are now correct for the "move block down" LDIR instruction - save the start pointer, make the move and recover it. Exit: RET, from RECLAIM 2. Output parameters: HL holds the address at which the deletion was made. Called from: 0873 LD PROG 1097 CLEAR SP 1EB7 CLEAR 1 Exit from: 16D4 REC EDIT Rems: Introduction redundant strings are reclaimed 0819 LD CONT 1 assumes program reclaimed on LOAD 082E LD DATA array reclaimed when new one LOADed 092C ME ENTER line/variable reclaimed if overwritten 0958 ME ENT 3 line/variable removed from work space 1015 ED DELETE reclaims deleted character 155D MAIN ADD line of BASIC reclaimed if overwritten 1664 POINTERS corrects 14 pointers after reclaim 2AB1 STK STO 0 flag from 2AFF LET signals to reclaim old string 2B72 L DELETE$ no deletion unless assigning to complete string 2BAF L ADD$ new string entered before old reclaimed 2C02 DIM old array reclaimed before new with same name entered 2C15 D RUN existing array reclaimed RECLAIM 2 subroutine 19E8 Alternative entry point to RECLAIM 1, see above. Called from: 082E LD DATA 092C ME ENTER 0958 ME ENT 3 11A7 REMOVE FP 155D MAIN ADD 2C15 D RUN Exit from: 1015 ED DELETE 2BAF L ADD$ Rems: 19E5 RECLAIM 1 merely different input parameters recursive printing see 0C3B PO SAVE REDUCE ARGUMENT SUBROUTINE, reduced argument see 3783 get- argt RE ENTRY 3365 (0028 FP CALC) Jumps from: 338E ENT TABLE (indirect through all subroutines) Rems: 33A2 fp-calc-2 drops return address to RE ENTRY; it is almost immediately put back again 369B end-calc drops return address to RE ENTRY REM key (EA) see also commands, functions and operators, KEYBOARD SCANNING The E key in K mode produces the command REM. The "REM statement" may include anything at all. Keystrokes after a REM command won't be interpreted in K mode, except after THEN or a colon; the latter is a mistake, see 196D OUT CHAR 3. The command is read by 1B29 STMT L 1 referring through the syntax offset table 1A48 to the syntax parameter table 1A7A.1AA5 P REM causes a jump via 1C11 CLASS 05 and 1C16 JUMP C R to the executive routine 1BB2 REM. 196D OUT CH 3 K mode left on after colon REM subroutine 1BB2 Called only from 1AA5 P REM in the syntax parameter table; the "executive routine" of the REM command - not that much is actually executed! The effect of the command is to make the computer ignore the rest of the current line. Action: drop the return address to 1B76 STMT RET. Exit: into 1BB3 LINE END, so that execution treats the REM line as already completed. The 1B52 SCAN LOOP address was dropped in 1C11 CLASS O5, so the next return address on the stack is the one set up by the call to 1B8A LINE RUN (misprintedPROG RUN) in 12CF MAIN 3, and return will be to there, unless 1BBF LINE USE and 1BD1 NEXT LINE loop on to the next program line. REMOVE FP subroutine 11A7 see also number in BASIC line. Removes the markers and FP number forms from the BASIC whenever it is copied back to the editing or input areas. Input parameters: HL is a BASIC pointer to the start of the line being edited from 5C59 E LINE, or 5C61 WORKSP when the subroutine is called from 2148 IN VAR 2. Action: if the pointer holds a number marker 0E, delete 6bytes using 19E8 RECLAIM 2 - read the byte at the pointer again - step on the pointer - if it isn't a newline loop back to REMOVE FP. Exit: RET. Output parameters: none. Called from: 12AC MAIN 2 2148 IN VAR 2 Jumps from: auto removing variable/line from workspace see reclaiming REPDEL system variable 5C09 Bytes: 1. The time in 50ths of a second before a pressed key will repeat the first time; 60ths of a second in USA. It is set at 35d on start-up and not changed thereafter. If a different valueis POKEd, it will be reset to 35d by a NEW command. For the use of REPDEL, see NB 2 under KEYBOARD SCANNING. Written by: 1219 RAM SET Read by: 02F1 K NEW Rems: 0310 K REPEAT decrement copy of REPDEL/REPPER repeated key see KEYBOARD SCANNING REPEATING KEY SUBROUTINE see 0310 K REPEAT repeat status see KEYBOARD SCANNING replacement of line or variable see 08B6 ME CONTROL in 0605 SAVE ETC REPORT A 34E7, 371A "Invalid argument" (141A) This error message is printed if the BASIC calls for an impossible evaluation, eg SQR -1. Exit from: 34BC usr$ (3 times) 34D3 USR RANGE 3713 ln 384A sqr REPORT AND LINE NUMBER PRINTING SUBROUTINE see 1A1B OUT NUM 1 REPORT B 046C, 1E9F, 24F9, 35DC "Integer out of range" (142A) This error message is printed if an integer value is toobig or too small for the calculation specified, eg PRINT AT 30,7or CHR$ -1. Exit from: 03FB BEEP (4 times) 0427 BE OCTAVE 0AAC PO AT ERR 1E67 GOTO 1E85 TWO PARAM 1E9C FIND I 1 (twice) 22AA PIXEL ADD 2314 STK TO A 24DF D L STEP 35C9 chrs (twice) 3645 read-in REPORT C 1C8A, 21CE "Nonsense in BASIC" (143E) This catch-all error message is printed if an error occurs which doesn't fall into any of the categories covered by the other error messages: eg MERGE "" DATA. Unhelpful! Exit from: 0652 SA DATA 0672 SA V OLD 0692 SA DATA 1 (indirect, through SA V OLD)