DEC BASIC
   HOME

TheInfoList



OR:

VSI BASIC for OpenVMS is the latest name for a dialect of the
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
created by
Digital Equipment Corporation Digital Equipment Corporation (DEC ), using the trademark Digital, was a major American company in the computer industry from the 1960s to the 1990s. The company was co-founded by Ken Olsen and Harlan Anderson in 1957. Olsen was president until ...
(DEC) and now owned by VMS Software Incorporated (VSI). It was originally developed as
BASIC-PLUS BASIC-PLUS is an extended dialect of the BASIC programming language that was developed by Digital Equipment Corporation (DEC) for use on its RSTS/E time-sharing operating system for the PDP-11 series of 16-bit minicomputers in the early 1970s thro ...
in the 1970s for the RSTS-11 operating system on the
PDP-11 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
minicomputer. It was later ported to
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Op ...
, first on
VAX VAX (an acronym for virtual address extension) is a series of computers featuring a 32-bit instruction set architecture (ISA) and virtual memory that was developed and sold by Digital Equipment Corporation (DEC) in the late 20th century. The V ...
, then
Alpha Alpha (uppercase , lowercase ) is the first letter of the Greek alphabet. In the system of Greek numerals, it has a value of one. Alpha is derived from the Phoenician letter ''aleph'' , whose name comes from the West Semitic word for ' ...
,
Integrity Integrity is the quality of being honest and having a consistent and uncompromising adherence to strong moral and ethical principles and values. In ethics, integrity is regarded as the honesty and Honesty, truthfulness or of one's actions. Integr ...
, and most recently
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit extension of the x86 instruction set architecture, instruction set. It was announced in 1999 and first available in the AMD Opteron family in 2003. It introduces two new ope ...
. Past names for the product include: BASIC-PLUS, Basic Plus 2 (BP2 or BASIC-Plus-2), VAX BASIC, DEC BASIC, Compaq BASIC for OpenVMS and HP BASIC for OpenVMS. Multiple variations of the titles noting the hardware platform (VAX, AlphaServer, etc.) also exist.


Notable features

VSI BASIC has many FORTRAN-like extensions, as well as supporting the original
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
matrix Matrix (: matrices or matrixes) or MATRIX may refer to: Science and mathematics * Matrix (mathematics), a rectangular array of numbers, symbols or expressions * Matrix (logic), part of a formula in prenex normal form * Matrix (biology), the m ...
operators Operator may refer to: Mathematics * A symbol indicating a mathematical operation * Logical operator or logical connective in mathematical logic * Operator (mathematics), mapping that acts on elements of a space to produce elements of another ...
.
Line number In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
s are optional, unless the "ERL" function is present. It allows you to write "WHEN ERROR" error handlers around protected
statements Statement or statements may refer to: Common uses *Statement (computer science), the smallest standalone element of an imperative programming language * Statement (logic and semantics), declarative sentence that is either true or false *Statement, ...
. The more traditional but less elegant "ON ERROR" statement lacks such context or scope. One of VSI BASIC's more noteworthy features is built-in support for
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Op ...
's powerful
Record Management Services Record Management Services (RMS) are procedures in the VMS, RSTS/E, RT-11 and RSX-11M operating systems that programs may call to process files and records within files. Its file formats and procedures are similar to of those in some IBM acc ...
(RMS). Before the release VAX BASIC, native RMS support was only available in DEC's
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily ...
compiler.


History

The VSI BASIC for OpenVMS product history spans a period of more than 30 years, and it has gone through many name and ownership changes in that time. It has also been
ported In software engineering, porting is the process of adapting software for the purpose of achieving some form of execution in a computing environment that is different from the one that a given program (meant for such execution) was originally desig ...
to a succession of new platforms as they were developed by DEC, Compaq, HP and VSI. The company and/or platform name has often been included in the product name, contributing to the proliferation of names.


BASIC-PLUS

VSI BASIC began as BASIC-PLUS, created by DEC for their RSTS-11
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
and
PDP-11 The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
minicomputer A minicomputer, or colloquially mini, is a type of general-purpose computer mostly developed from the mid-1960s, built significantly smaller and sold at a much lower price than mainframe computers . By 21st century-standards however, a mini is ...
. Programming language statements could either be typed into the command interpreter directly, or entered into a
text editor A text editor is a type of computer program that edits plain text. An example of such program is "notepad" software (e.g. Windows Notepad). Text editors are provided with operating systems and software development packages, and can be used to c ...
, saved to a file, and then loaded into the command interpreter from the file. Errors in source code were reported to the user immediately after the line was entered. Programs were stored as a
source Source may refer to: Research * Historical document * Historical source * Source (intelligence) or sub source, typically a confidential provider of non open-source intelligence * Source (journalism), a person, publication, publishing institute ...
file, using the "SAVE" command. It could be "compiled" into a non-editable binary file, using the "COMPILE" command. This command did not produce true
machine language In computer programming, machine code is computer code consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). For conventional binary computers, machine code is the binaryOn nonb ...
programs, but rather a
byte code Bytecode (also called portable code or p-code) is a form of instruction set designed for efficient execution by a software interpreter. Unlike human-readable source code, bytecodes are compact numeric codes, constants, and references (normally ...
called "tokens". The tokens were interpreted upon execution, in a manner similar to the more modern
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
. Programs were entered into the command interpreter starting with
line number In computing, a line number is a method used to specify a particular sequence of characters in a text file. The most common method of assigning numbers to lines is to assign every line a unique number, starting at 1 for the first line, and increm ...
s, integers from 1 to 32767. Lines could be continued onto multiple lines by using a
line feed A newline (frequently called line ending, end of line (EOL), next line (NEL) or line break) is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character, or ...
character. 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 as the statement separator. For PDP-11 systems with virtual memory (
RSTS/E RSTS () is a multi-user time-sharing operating system developed by Digital Equipment Corporation (DEC, now part of Hewlett-Packard) for the PDP-11 series of 16-bit minicomputers. The first version of RSTS (RSTS-11, #Versions, Version 1) was implem ...
), address space was limited to about 64 KB. With BASIC-PLUS, about half of this was used by the combined command interpreter and run-time library. This limited user programs to about 32 KB of memory. Older RSTS-11 systems lacked virtual memory, so the user program had to fit into whatever was left of physical memory after RSTS and BASIC-PLUS took up their share. For example, on a PDP-11/35 with 32K of physical memory, running RSTS-11 V04B-17, user programs were limited to 7 KB. Large programs could be broken up into various pieces by use of the "CHAIN" instruction. Programs could
chain A chain is a serial assembly of connected pieces, called links, typically made of metal, with an overall character similar to that of a rope in that it is flexible and curved in compression but linear, rigid, and load-bearing in tension. A ...
to specific line numbers in a secondary 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. 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. The language also supported the use of conditional modifiers on a single line. For example, the line "" would print the value of "I" unless I was less than 10.


BASIC Plus 2

Basic Plus 2 (BP2 or BASIC-Plus-2) was later developed by DEC to add additional features and increase performance. It used true compilation into
threaded code In computer science, threaded code is a programming technique where the code has a form that essentially consists entirely of calls to subroutines. It is often used in compilers, which may generate code in that form or be implemented in that form ...
, and wrote its output to
machine language In computer programming, machine code is computer code consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). For conventional binary computers, machine code is the binaryOn nonb ...
object file An object file is a file that contains machine code or bytecode, as well as other data and metadata, generated by a compiler or assembler from source code during the compilation or assembly process. The machine code that is generated is kno ...
s. These were compatible with other object files on the system, and could be assembled into libraries. A linker (the TKB taskbuilder) then created
executable file In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instructions", as opposed to a da ...
s from them. TKB also supported overlays; this allowed individual routines to be swapped into the main memory space as needed. BP2 programs ran under
RSX-11 RSX-11 is a discontinued family of multi-user real-time operating systems for PDP-11 computers created by Digital Equipment Corporation. In widespread use through the late 1970s and early 1980s, RSX-11 was influential in the development of later ...
or RSTS/E's RSX Run Time System. This RTS only occupied 8KB (later, 2KB) of the user's address space, leaving 56KB for the user's program. These two factors allowed individual BP2 programs to be much larger than BASIC-PLUS programs, often eliminating the need for CHAINing. Unlike BASIC-PLUS (which was only available on RSTS-11), BP2 allowed use on the RSX-11 operating system as well.


VAX BASIC and DEC BASIC

With the creation of the
VAX VAX (an acronym for virtual address extension) is a series of computers featuring a 32-bit instruction set architecture (ISA) and virtual memory that was developed and sold by Digital Equipment Corporation (DEC) in the late 20th century. The V ...
minicomputer A minicomputer, or colloquially mini, is a type of general-purpose computer mostly developed from the mid-1960s, built significantly smaller and sold at a much lower price than mainframe computers . By 21st century-standards however, a mini is ...
, DEC ported BASIC-PLUS-2 to the new VMS operating system, and called it VAX BASIC. VAX BASIC used the standard VMS calling standards, so object code produced by VAX BASIC could be linked with object code produced by any of the other VMS languages. Source code for BASIC Plus 2 would usually run without major changes on VAX BASIC. When DEC created their
Alpha Alpha (uppercase , lowercase ) is the first letter of the Greek alphabet. In the system of Greek numerals, it has a value of one. Alpha is derived from the Phoenician letter ''aleph'' , whose name comes from the West Semitic word for ' ...
microprocessor A microprocessor is a computer processor (computing), processor for which the data processing logic and control is included on a single integrated circuit (IC), or a small number of ICs. The microprocessor contains the arithmetic, logic, a ...
, VMS was ported to it and renamed
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Op ...
. VAX BASIC was likewise ported to Alpha and renamed DEC BASIC. The BASIC
interpreter Interpreting is translation from a spoken or signed language into another language, usually in real time to facilitate live communication. It is distinguished from the translation of a written text, which can be more deliberative and make use o ...
was permanently dropped at this point, which meant that DEC BASIC programs could only be run as OpenVMS
executable In computer science, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), in ...
s, produced by a compile followed by a link.


Compaq, HP and VSI

When DEC was purchased by
Compaq Compaq Computer Corporation was an American information technology, information technology company founded in 1982 that developed, sold, and supported computers and related products and services. Compaq produced some of the first IBM PC compati ...
in 1997/98, the products were renamed Compaq BASIC for OpenVMS VAX and Compaq BASIC for OpenVMS Alpha. Likewise, when
Compaq Compaq Computer Corporation was an American information technology, information technology company founded in 1982 that developed, sold, and supported computers and related products and services. Compaq produced some of the first IBM PC compati ...
merged with HP in 2001/02, the products were renamed HP BASIC for OpenVMS on VAX and HP BASIC for OpenVMS on AlphaServer. HP later released HP BASIC for OpenVMS on Integrity for their Integrity
server Server may refer to: Computing *Server (computing), a computer program or a device that provides requested information for other programs or devices, called clients. Role * Waiting staff, those who work at a restaurant or a bar attending custome ...
platforms based upon
Intel Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California, and Delaware General Corporation Law, incorporated in Delaware. Intel designs, manufactures, and sells computer compo ...
's
Itanium Itanium (; ) is a discontinued family of 64-bit computing, 64-bit Intel microprocessors that implement the Intel Itanium architecture (formerly called IA-64). The Itanium architecture originated at Hewlett-Packard (HP), and was later jointly dev ...
processors. In mid 2014, HP sold the whole OpenVMS ecosystem to VSI who renamed the product VSI BASIC for OpenVMS.


Sample code

VSI BASIC is a structured variant of BASIC in which line numbers are optional, and the language supports both SUBs and FUNCTIONs.


Hello, world

print "Hello, world!"


Celsius to Fahrenheit conversion

function real to_fahrenheit(real celsius) to_fahrenheit = (celsius * 1.8) + 32 end function external real function to_fahrenheit(real) declare real temp_celsius when error in print "Enter a temperature in celsius"; input x temp_celsius = real(x) use print "Error: enter a valid numeric value, please." end when print "Temperature in degrees fahrenheit is "; to_fahrenheit(temp_celsius) end


References


External links


Official BASIC documentation at HP


{{BASIC Articles with example BASIC code OpenVMS software BASIC compilers BASIC programming language family