Английская Википедия:BASIC-8
Шаблон:Short description Шаблон:Infobox programming language BASIC-8, is a BASIC programming language for the Digital Equipment (DEC) PDP-8 series minicomputers. It was the first BASIC dialect released by the company, and its success led DEC to produce new BASICs for its future machines, notably BASIC-PLUS for the PDP-11 series. DEC's adoption of BASIC cemented the use of the language as the standard educational and utility programming language of its era, which combined with its small system requirements, made BASIC the major language during the launch of microcomputers in the mid-1970s.
History
David Ahl joined Digital Equipment's (DEC's) expanding educational sales division in 1969. The division was mostly tasked with selling the PDP-8 minicomputer to high schools and colleges.Шаблон:Sfn These were not yet widespread; a typical single-user machine of the late 1960s cost in the order of $10,000 (Шаблон:Inflation), not including mass storage and other peripherals.Шаблон:Sfn Around this time, both Hewlett-Packard (HP) and Honeywell had introduced new 16-bit minicomputers with time sharing that were becoming popular in the educational markets. In particular, HP's 16-bit HP 2100 with HP Time-Shared BASIC was very popular leading HP to package it as the HP2000 for sales into the programming and educational markets.[1] Although the HP2000 was even more expensive than the PDP-8, by sharing access among many users, typically up to 16 at a time, the effective cost was much lower than single-user machines.
At the time, DEC was heavily promoting their own language for educational uses, FOCAL, a cut-down version of JOSS. The language had a number of features that allowed it to run in extremely limited memory, including the PDP-8's 4 KB of core memory. It was conceptually similar to BASIC, especially in the interactive method of typing in programs and the general layout of programs. Ahl collected FOCAL programs submitted from users and published them in the department's EDU newsletter.Шаблон:Sfn
Ahl found that prospective customers were not interested in FOCAL, at least outside the Boston-area where DEC was located. BASIC was already widely used by this time, and a growing library of educational programs and games in BASIC were becoming available. These were being published in newsletter format, almost always in HP2000 dialect, and the sheer volume of BASIC programs was overwhelming FOCAL. Ahl found no interest on the part DEC management or software development department to produce a BASIC,Шаблон:Sfn nor any interest in supporting FOCAL on the other machines in their lineup. He also noted an increasing hostility to the idea of allowing any other company to produce a version of the language.Шаблон:Sfn
Concluding a BASIC was required for the PDP-8 to allow it to compete in the educational market, he hired a Brooklyn area programmer to develop one.Шаблон:Sfn This became BASIC-8. To aid its uptake, Ahl personally ported over several popular FOCAL programs, notably the games Lunar Lander and The Sumerian Game, which he renamed Hamurabi.[2] BASIC-8 was an immediate best-seller, and by the early 1970s the company was once again a popular choice in educational markets. The company began packaging systems in a fashion similar to the HP2000, with a line of "Edusystems" tailored to different needs.[3]
Although DEC continued to promote FOCAL, use evaporated almost instantly with the release of BASIC-8. DEC would ultimately offer five different BASICs for the PDP-8, each one making up for limitations of the original minimal implementation. With the release of the PDP-11 in 1970, an entirely new and greatly expanded dialect was offered, BASIC-PLUS.Шаблон:Sfn Customers complained about the variations between dialects, but Ahl later claimed that if he had been a stickler for such details it would have taken another two years to get the products out.Шаблон:Sfn
Ahl had also noticed another curious fact; when they began publishing the EDU newsletter, they expected perhaps 2000 to 3000 subscribers, about 10 each for DEC's 300 educational sites. Within 18 months, circulation had reached 20,000, significantly more than all of the computers in the educational field. When he inquired, he found that many subscribers didn't even have a computer, let alone a DEC one, and were reading it for ideas on how computers might be used in education. This led to early consideration of an independent educational-focused computer magazine.Шаблон:Sfn Invariably the most popular section of EDU were the BASIC listings, especially games. This led to his decision to collect the most popular programs, notably Super Star Trek, into book form as 1973's 101 BASIC Games. This sold tens of thousands of copies over three print runs.Шаблон:SfnШаблон:Sfn
In spite of some success on the part of the educational division, at the start of the 1973–1975 recession, DEC decided to reduce the size of the group. When Ahl complained that the division should be left alone, his boss put him on the list of people to be laid off. Even before he received his last paycheck, he was re-hired into a newly-formed hardware group.Шаблон:Sfn They produced two small prototype computers, one all-in-one design based on the PDP-8, and a slightly larger system based on the newer PDP-11. Other divisions in the company became concerned these might cut into their own sales and began to agitate against the systems. This ultimately reached the desk of Ken Olsen, who finally stated that he could not understand why anyone might want a computer for their private use.Шаблон:Sfn The project was killed.Шаблон:Sfn
Ahl left the company and joined AT&T's educational sales department. Ahl had continued publishing EDU before leaving DEC, but with his departure, only one or two more editions were published before the company abandoned it. This left the market to HP, who had by this time had widespread distribution of their BASIC programs in the People's Computer Company newsletter and the rapidly growing Minnesota Educational Computing Consortium (MECC) collection. Noting a lack of a newsletter like EDU aimed specifically at the education market, Ahl soon started Creative Computing magazine and later left AT&T to produce it full-time.Шаблон:Sfn In 1975 he purchased the rights to 101 BASIC Games from DEC and re-launched it as BASIC Computer Games. This went on to become the first million-selling computer book.Шаблон:SfnШаблон:Sfn
HP's dialect formed the basis for many early personal computer BASIC implementations, including Integer BASIC and Atari BASIC among others. Bill Gates had used BASIC-PLUS in high school, and this formed the basis for what became Altair BASIC in 1975. Continued development and sales of varieties of Microsoft BASIC for multiple platforms led to DEC's dialect ultimately becoming the de facto standard on home computers rather than HP's version.Шаблон:Sfn
Description
Like most versions of BASIC, BASIC-8 could be operated in "immediate mode" where users type in commands and immediately receive a response (like a hand-held calculator), or in "deferred mode", where entries were stored for later execution using the command Шаблон:Code. Deferred mode is triggered by typing a line number at the start of a line of text. In BASIC-8 the line numbers could range from 1 to 2046;Шаблон:Sfn the PDP-8 was a 12-bit machine and normally held a value from −2048 to +2047 in a single word.[4]
As was common in many minimal BASIC implementations of the era, Шаблон:Code statements could only be used to perform a branch; Шаблон:Code had to be followed by a line number to jump to, it could not contain arbitrary statements as was common in later BASICs.Шаблон:Sfn Thus Шаблон:Code was valid, Шаблон:Code was not. An alternate form was Шаблон:Code. The space in GO TO is not optional as it was in some dialects, either in an Шаблон:Code or as a stand-alone statement.Шаблон:Sfn Subroutines were supported using Шаблон:Code,Шаблон:Sfn but could not be called from Шаблон:Code statements.Шаблон:Efn Loops could be performed with Шаблон:Code or using Шаблон:Code.Шаблон:Sfn
In contrast to most BASICs, Шаблон:Code was not optional, and had to be used on all assignments.Шаблон:Sfn Variable names could be a single letter or a letter and a single digit.Шаблон:Sfn Шаблон:Code can be used to define one and two dimensional arrays.Шаблон:Sfn The floating point number format had 8 significant digits and exponents from −38 to +38.Шаблон:Sfn Standard math symbols were used for arithmetic, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code and Шаблон:Code (represented on a Teletype Model 33 as an up-arrow),Шаблон:Sfn and it included the standard functions Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code and Шаблон:Code.Шаблон:Sfn There was no support for string variables or functions. Boolean comparisons in Шаблон:Code statements included Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code and Шаблон:Code.Шаблон:Sfn Шаблон:Code was supported for user-defined functions.Шаблон:Sfn
Шаблон:Code supported both commas and semicolons could be used to space out multiple outputs in tabular format or with no space, respectively.Шаблон:Sfn Шаблон:Code was supported and could read multiple inputs in a single statement, but prompts were not supported.Шаблон:Sfn Lacking file-operating commands, any data within a program could only be entered using Шаблон:Code statements and read using Шаблон:Code.Шаблон:Sfn Шаблон:Code returned the Шаблон:Code back to the start of the Шаблон:Code list; there was no optional line number as seen in some dialects.Шаблон:Sfn
Шаблон:Code, Шаблон:Code and Шаблон:Code round out the command list.Шаблон:Sfn
Implementation
In contrast to most competing minicomputer-based systems and early home computers, where BASIC was the entire environment seen by the user, BASIC-8 was one of a number of programs that could be run at the command line of the underlying TSS/8 operating system.Шаблон:Sfn As such, commands that would normally be associated with BASIC itself, like Шаблон:Code or Шаблон:Code, are not part of the language proper, but part of the shell, and thus cannot be used within programs. This was typical of many early BASIC environments, where the editor and runtime were completely different programs.Шаблон:Sfn
BASIC programs could be entered by starting BASIC-8 at the command line and typing, or by starting a text editor like EDIT-8 and typing in the code as a text file. In both cases, the BASIC code was stored as pure text, and retained any extra characters the user typed – one could type in code without spaces to make the file more compact,Шаблон:Sfn or add additional spaces to indent loops.Шаблон:Sfn
When BASIC was started one could type Шаблон:Code to clear any existing program, or Шаблон:Code to load an existing file. At any time, one could Шаблон:Code the working file or Шаблон:Code to delete an existing saved file. Шаблон:Code produced a list of saved program files.Шаблон:Sfn Шаблон:Code printed the source code, and could be limited using two comma-separated values for start and end line numbers, like Шаблон:Code.Шаблон:SfnШаблон:Efn Шаблон:Code deleted a range of lines from the program, Шаблон:Code started execution, and Шаблон:Code exited BASIC and returned to the TSS/8 command line.Шаблон:Sfn
Internally, the system consisted of five separate sub-programs that were loaded as required in order to minimize memory use. These were Шаблон:Code, Шаблон:Code, Шаблон:Code, Шаблон:Code and Шаблон:Code. COMPILER was not a compiler in the modern sense of the word, as it did not generate lower-level language; in modern terms it would be referred to as a "tokenizer" or front-end. Its purpose was to parse the BASIC source code and convert it into a series of "tokens", one-word numbers representing various keywords and commands. The result was then left in memory while INTERPRETER was instructed to begin running the resulting tokenized code. ERROR mapped error numbers in BASIC to textual output. A table in memory, SYPTBA, held pointers to the locations of the programs on disk.Шаблон:Sfn
Notes
References
Citations
Bibliography
Шаблон:Digital Equipment Corporation