2.1 DESCRIPTION OF COMMANDS
After RUN(cr) is typed all variables are set equal to zero, all BASIC evoked interrupts are cleared and program execution begins with the first line number of the selected program. The RUN command and the GOTO statement are the only way the user can place the MCS BASIC-52 interpreter into the RUN mode from the COMMAND mode. Program execution may be terminated at any time by typing a control-C on the console device.
Unlike some Basic interpreters that allow a line number to follow the RUN command (i.e., RUN 100), MCS BASIC-52 does not permit such a variation on the RUN command. Execution always begins with the first line number. To obtain the same functionality as the RUN[ln num] command, use the GOTO[ln num] statement in the direct mode. SEE STATEMENT GOTO.
>10 FOR I=1 TO 3 >20 PRINT >30 NEXT >RUN 1 2 3 READY >
2.2 DESCRIPTION OF COMMANDS:
If a program is stopped by typing a control-C on the console device or by execution of a STOP statement, you can resume execution of the program by typing CONT(cr). Between the stopping and the re-starting of the program you may display the values of variables or change the values of variables. However, you may NOT CONTinue if the program is modified during the STOP or after an error.
>10 FOR I=1 TO 10000 >2O PRINT I >30 NEXT I >RUN 1 2 3 4 5 - (TYPE CONTROL-C ON CONSOLE) STOP - IN LINE 20 READY >PRINT I 6 I=10 >CONT 10 11 12
2.3 DESCRIPTION OF COMMANDS:
The LlST(cr) command prints the program to the console device. Note that the list command "formats" the program in an easy to read manner. Spaces are inserted after the line number and before and after statements. This feature is designed to aid in the debugging of MCS BASIC-52 programs. The "listing" of a program may be terminated at anytime by typing a control-C on the console device.
Two variations of the LIST COMMAND are possible with MCS BASIC-52. They are:
LIST [ln num] (cr) and
LIST [ln num]--[ln num] (cr)
The first variation causes the program to be printed from the designated line number (integer) to the end of the program. The second variation causes the program to be printed from the first line number (integer) to the second line number (integer). NOTE--the two line numbers MUST BE SEPARATED BY A DASH -.
READY >LIST 10 PRINT "LOOP PROGRAM" 20 FOR I=1 TO 3 30 PRINT I 40 NEXT I 50 END READY >LIST 30 30 PRINT I 40 NEXT I 50 END READY >LIST 20-40 20 FOR I=1 TO 3 30 PRINT I 40 NEXT I
2.4 DESCRIPTION OF COMMANDS
The LlST#(cr) command prints the program to the LIST device. The BAUD rate to this device must be initialized by the STATEMENT--BAUD[expr]. All comments that apply to the LIST command apply to the LIST# command. The LlST#(cr) command is included to permit the user to make "hard copies" of a program. The output to the list device is on P1.7 of the MCS BASIC-52 device.
2.5 DESCRIPTION OF COMMANDS
COMMAND: LlST@(cr) (VERSION 1.1 ONLY)
The LIST@ command does the same thing as the LIST command except that the output is directed to a user defined output driver. This command assumes that the user has placed an assembly language output routine in extemal code memory location 403CH. To enable the @ driver routine the user must SET BIT 27H (39D) in the intemal memory of the MCS BASIC-52 device. BIT 27H (39D) is BIT 7 of internal memory location 24H (36D). This BIT can be set by the BASIC statement DBY(24H)=DBY(24H). OR.80H or by a user supplied assembly language routine. If the user evokes the @ driver routine and this bit is not set, the output will be directed to the console driver. The only reason this BIT must be set to enable the @ driver is that it adds a certain degree of protection from accidently typing LIST@ when no assembly language routine exist. The philosophy here is that if the user sets the bit, the user provides the driver or else!!!
When MCS BASIC-52 calls the user output driver routine at location 403CH, the byte to output is in the accumulator and R5 of register bank 0 (RB0). The user may modify the accumulator (A) and the data pointer (DPTR) in the assembly language output routine, but cannot modify any of the registers in RB0. This is intended to make it real easy for the user to implement a parallel or serial output driver without having to do a PUSH or a POP.
2.6 DESCRIPTION OF COMMANDS
When NEW(cr) is entered, MCS BASIC-52 deletes the program that is currently stored in RAM memory. In addition, all variables are set equal to ZERO, all strings and all BASIC evoked interrupts are cleared. The REAL TIME CLOCK, string allocation, and the internal stack pointer value (location 3EH) are NOT effected. In general, NEW (cr) is used simply to erase a program and all variables.
2.7 DESCRIPTION OF COMMANDS
COMMAND: NULL [integer](cr)
The NULL[integer] (cr) command determines how many NULL characters (00H) MCS BASIC-52 will output after a carriage return. After initialization NULL = 0. The NULL command was more important back in the days when a "pure" mechanical printer was the most common I/0 device. Most modern printers contain some kind of RAM buffer that virtually eliminates the need to output NULL characters after a carriage return. NOTE--the NULL count used by MCS BASIC-52 is stored in internal RAM location 21 ( 15H). The NULL value can be changed dynamically in a program by using a DBY(21) = [expr] statement. The [expr] can be any value between 0 and 255 (0FFH) inclusive.
Copyright © Madis Kaal 2000-