BASIC-PLUS
Encyclopedia
BASIC-PLUS was an extended dialect of the BASIC
programming language
developed by Digital Equipment Corporation
(DEC) for use on its RSTS/E
time-sharing operating system for the PDP-11
series of 16-bit minicomputer
s in the early 1970s through the 1980s.
Users would sit at a terminal and type in programming language statements. The statements could either be entered into the system's command interpreter directly, or entered into a text editor
, saved to a file, and loaded into the command interpreter from the file. Errors in source code were reported to the user immediately after the line was typed.
The language system provided two modes of storage:
Source programs could be edited and run, similar to the BASIC interpreter which years later was included with the IBM PC
in ROM.
While the command interpreter had a "COMPILE" command, it was not a true native machine language compiler. The language was a semi-compiled language, in which a source program was "compiled" into byte code called "PPCODE" (Push-Pop Code), for a virtual stack machine, and the tokens interpretively executed, in a manner similar today to the execution of programs using the Java language
.
Programs were entered into the command interpreter starting with line numbers, integers from 1 to 32767, and were continued on multiple lines by using a line feed at the end of a line instead of the return (enter) key. For ease of external editing of the source file, later versions of BASIC-PLUS also allowed the & character as a line-continuation character. Multiple statements could be placed on a single line using \ or : as the statement separator.
Variable names in the early versions of BASIC-PLUS could be a single letter or a single letter followed by a single digit. With the inclusion of "Extend mode" in later versions, variable names could be up to 29 characters long, and dot (.) was added as a permitted character, but every variable name still had to begin with a letter. (Before the introduction of Extend mode, white space was not required between variables and other language elements: "FOR I=STOP" would be interpreted as "FOR I = S TO P".) Integer variables (16-bit, range -32768 to +32767) were indicated with a % suffix; string variables (variable length) were indicated with a $ suffix. Variables with no suffix were floating point (8 bytes, range .29 x 10E-38 to 1.7 x 10E38, up to 16 digits of precision). Arrays could have one or two dimensions. Virtual arrays (stored in disk files) allowed storage of far more data elements than could fit in program memory, and could be saved permanently on disk.
The virtual address space of a RSTS/E user was limited to a little less than 64KB of space. Using BASIC-PLUS, about half of this virtual address space was used by the combined command interpreter and run-time library (named the Run Time System
on RSTS/E). This limited user programs to about 32KB of memory. Large programs were broken up into various pieces by use of the "CHAIN" statement, and programs could chain
to specific line numbers in a secondary program to indicate that program should begin execution at a different point than its first line. This feature of chaining to a certain line number allowed programs to signal to each other that they were being called from another program. The use of a shared memory section called core common
also allowed programs to pass data among each other as needed. Disk
files could also be used but were slower.
To conserve memory, the interpreter included a garbage collecting memory manager, used for both string data and byte-code.
A running program could be interrupted, have variables examined and modified, and then be resumed.
Many of the control structures used in other high-level languages existed in BASIC-PLUS, including WHILE and UNTIL, and the language also supported the use of modifiers on a line to control execution such as
PRINT I UNLESS I < 10
and wrote its output to object files compatible with the machine code object files produced by the assember and other language systems. These object files could be kept in libraries. A linker (the TKB taskbuilder) then created executable files from object files and the libraries. TKB also supported overlays; this allowed individual routines to be swapped into the virtual address space as needed, overlaying routines not currently being used. Additionally, BP2 programs ran under the RSX Run Time System; this RTS only occupied 8KB of the user's virtual address space, leaving 56KB for the user's program. (RSTS/E version 9 introduced separate Instruction and Data space, and the "disappearing" RSX Run Time System, permitting up to 64KB of each of instruction code and data.) These two factors allowed individual BP2 programs to be much larger than BASIC-PLUS programs, often reducing the need for CHAINing among multiple programs.
Unlike BASIC-PLUS (which was only available on RSTS/E), BP2 was also available for the RSX-11
operating system. BP2 programs were also more compatible with the later VAX BASIC.
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....
programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....
developed by Digital Equipment Corporation
Digital Equipment Corporation
Digital Equipment Corporation was a major American company in the computer industry and a leading vendor of computer systems, software and peripherals from the 1960s to the 1990s...
(DEC) for use on its RSTS/E
RSTS/E
RSTS is a multi-user time-sharing operating system, developed by Digital Equipment Corporation , for the PDP-11 series of 16-bit minicomputers. The first version of RSTS was implemented in 1970 by DEC software engineers that developed the TSS-8 time-sharing operating system for the PDP-8...
time-sharing operating system for the PDP-11
PDP-11
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years...
series of 16-bit minicomputer
Minicomputer
A minicomputer is a class of multi-user computers that lies in the middle range of the computing spectrum, in between the largest multi-user systems and the smallest single-user systems...
s in the early 1970s through the 1980s.
Users would sit at a terminal and type in programming language statements. The statements could either be entered into the system's command interpreter directly, or entered into a text editor
Text editor
A text editor is a type of program used for editing plain text files.Text editors are often provided with operating systems or software development packages, and can be used to change configuration files and programming language source code....
, saved to a file, and loaded into the command interpreter from the file. Errors in source code were reported to the user immediately after the line was typed.
The language system provided two modes of storage:
- A program could be stored on the system in an editable source file (a .BAS file) using the "SAVE" command, or
- Semi-compiled into a non-editable binary .BAC file by the "COMPILE" command.
Source programs could be edited and run, similar to the BASIC interpreter which years later was included with the IBM PC
IBM PC
The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform. It is IBM model number 5150, and was introduced on August 12, 1981...
in ROM.
While the command interpreter had a "COMPILE" command, it was not a true native machine language compiler. The language was a semi-compiled language, in which a source program was "compiled" into byte code called "PPCODE" (Push-Pop Code), for a virtual stack machine, and the tokens interpretively executed, in a manner similar today to the execution of programs using the Java language
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...
.
Programs were entered into the command interpreter starting with line numbers, integers from 1 to 32767, and were continued on multiple lines by using a line feed at the end of a line instead of the return (enter) key. For ease of external editing of the source file, later versions of BASIC-PLUS also allowed the & character as a line-continuation character. Multiple statements could be placed on a single line using \ or : as the statement separator.
Variable names in the early versions of BASIC-PLUS could be a single letter or a single letter followed by a single digit. With the inclusion of "Extend mode" in later versions, variable names could be up to 29 characters long, and dot (.) was added as a permitted character, but every variable name still had to begin with a letter. (Before the introduction of Extend mode, white space was not required between variables and other language elements: "FOR I=STOP" would be interpreted as "FOR I = S TO P".) Integer variables (16-bit, range -32768 to +32767) were indicated with a % suffix; string variables (variable length) were indicated with a $ suffix. Variables with no suffix were floating point (8 bytes, range .29 x 10E-38 to 1.7 x 10E38, up to 16 digits of precision). Arrays could have one or two dimensions. Virtual arrays (stored in disk files) allowed storage of far more data elements than could fit in program memory, and could be saved permanently on disk.
The virtual address space of a RSTS/E user was limited to a little less than 64KB of space. Using BASIC-PLUS, about half of this virtual address space was used by the combined command interpreter and run-time library (named the Run Time System
Run-time system
A run-time system is a software component designed to support the execution of computer programs written in some computer language...
on RSTS/E). This limited user programs to about 32KB of memory. Large programs were broken up into various pieces by use of the "CHAIN" statement, and programs could chain
Chain loading
Chain loading is a method used by computer programs to replace the currently executing program with a new program, using a common data area to pass information from the current program to the new program. It occurs in several areas of computing.Chain loading is similar to the use of overlays...
to specific line numbers in a secondary program to indicate that program should begin execution at a different point than its first line. This feature of chaining to a certain line number allowed programs to signal to each other that they were being called from another program. The use of a shared memory section called core common
Core common area
The core common area is that area of a computer program wherein data can remain between the end of execution of one program and the start of execution of a subsequent program in a pipeline....
also allowed programs to pass data among each other as needed. Disk
Hard disk
A hard disk drive is a non-volatile, random access digital magnetic data storage device. It features rotating rigid platters on a motor-driven spindle within a protective enclosure. Data is magnetically read from and written to the platter by read/write heads that float on a film of air above the...
files could also be used but were slower.
To conserve memory, the interpreter included a garbage collecting memory manager, used for both string data and byte-code.
A running program could be interrupted, have variables examined and modified, and then be resumed.
Many of the control structures used in other high-level languages existed in BASIC-PLUS, including WHILE and UNTIL, and the language also supported the use of modifiers on a line to control execution such as
PRINT I UNLESS I < 10
BASIC Plus 2
A related product called Basic Plus 2 ("BP2" or BASIC-Plus-2), was later developed by DEC to add additional features and increased performance. It used true compilation into threaded codeThreaded code
In computer science, the term threaded code refers to a compiler implementation technique where the generated code has a form that essentially consists entirely of calls to subroutines...
and wrote its output to object files compatible with the machine code object files produced by the assember and other language systems. These object files could be kept in libraries. A linker (the TKB taskbuilder) then created executable files from object files and the libraries. TKB also supported overlays; this allowed individual routines to be swapped into the virtual address space as needed, overlaying routines not currently being used. Additionally, BP2 programs ran under the RSX Run Time System; this RTS only occupied 8KB of the user's virtual address space, leaving 56KB for the user's program. (RSTS/E version 9 introduced separate Instruction and Data space, and the "disappearing" RSX Run Time System, permitting up to 64KB of each of instruction code and data.) These two factors allowed individual BP2 programs to be much larger than BASIC-PLUS programs, often reducing the need for CHAINing among multiple programs.
Unlike BASIC-PLUS (which was only available on RSTS/E), BP2 was also available for the RSX-11
RSX-11
RSX-11 is a family of real-time operating systems mainly for PDP-11 computers created by Digital Equipment Corporation , common in the late 1970s and early 1980s. RSX-11D first appeared on the PDP-11/40 in 1972...
operating system. BP2 programs were also more compatible with the later VAX BASIC.