intel MCS BASIC-52 — Intel MCS BASIC-52 Versions 1 & 1.1 Operating and Reference Manual PDF (EN)

int e l 4.13 DESCRIPTION OF STATEMENTS STATEMENT: GOTO [ln num] MODE: COMMAND AND/OR RUN TYPE: CONTROL The GOTO [ln num] STATEMENT will cause BASIC to transfer control directly to the line number ([ln num]) following the GOTO STATEMENT. EXAMPLE: 50 GOTO 100 Will, if line 100 exists, cause execution of the program to resume at line 100. If line number 100 does not exist the message ERROR: INVALID LINE NUMBER will be printed to the console device. Unlike the RUN COMMAND the GOTO STATEMENT, if executed in the COMMAND MODE, does not CLEAR the variable storage space or interrupts.

However, if the GOTO STATEMENT is executed in the COMMAND MODE after a line has been edited, MCS BASIC-52 will CLEAR the variable storage space and all BASIC evoked interrupts. This is a necessity because the variable storage and the BASIC program reside in the same RAM memory. So editing a program can destroy variables. NOTE -- (Version 1.0 only) Because of the way MCS BASlC-52's text interpreter processes a line, when an INVALID LINE NUMBER ERROR occurs on the GOTO, GOSUB, ON GOTO, and ON GOSUB STATEMENTS the line AFTER the GOTO or GOSUB STATEMENT will be printed out in the error message. This may be confusing, but it was a trade-off between execution speed, code size, and error handling.

Error handling lost. EXAMPLE: >10 GOTO l00 >20 PRINT X >RUN ERROR INVALID LINE NUMER - IN LINE 20 20 PRINT X ----------x Version 1.1 does not exhibit this particular anomaly. - 43 -