Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Data General Extended BASIC

From Wikipedia, the free encyclopedia
Version of the BASIC programming language developed by Data General
See also:Data General Business Basic
Extended BASIC
DeveloperData General
Initial release1970; 56 years ago (1970)
PlatformData General Nova
TypeBASIC
LicenseCommercialproprietary software

Data General Extended BASIC, also widely known asNova Extended BASIC, was aBASIC programming languageinterpreter for theData General Nova seriesminicomputers. It was based on the seminalDartmouth BASIC, including the Fifth Edition's string variables and powerfulMAT commands formatrix manipulation. In contrast to thecompile-and-go Dartmouth BASIC, Extended BASIC was aninterpreter.

To Dartmouth's simple string manipulation system, Extended BASIC addedarray slicing, which was common on BASICs of the era after its introduction inHP Time-Shared BASIC. It became common in 1980s eramicrocomputers that did not useMicrosoft BASIC, likeSinclair BASIC,Atari BASIC and others. This contrasts with the Microsoft style which uses string functions likeLEFT$, and thus makes porting string code to other dialects somewhat difficult.

Data General later purchased rights to a much-expanded BASIC which was released asData General Business Basic. This added powerfuldatabase functionality and largely replaced Extended BASIC on DG platforms.

Description

[edit]

Mathematics

[edit]

The internalfloating point number format normally used two 16-bit words for a total of 32-bits, storedleast significant bit first. Bit 0 was the sign, 1 through 7 was theexponent stored inexcess-64 format, and 8 through 31 themantissa stored as hexadecimal digits.[1] Numbers could alternately use a double-precision format that extended the mantissa only, adding another 32-bits. That meant the double-precision format did not extend the range of numbers that could be stored, only the accuracy of those numbers.[2] Possible numbers ranged from 5.4×10−79 to −7.2×1075. Numbers with less than six digits were displayed as decimals, while those with more were displayed in exponent format.[1]

Variable names could consist of a single letter, or a letter and a single digit. Two-letter names were not allowed. Arrays could beDIMmed in 1 (array) or 2 (matrix) dimensions, and the lower bound was always 1.[2] As was common at the time, variables with noDIM defaulted to a 1-D array of 10 elements. Confusingly, if a variablewasDIMed, it was not the same as a variable with the same name that had not beenDIMed;A(1) andA might be the same or different variables depending on how they were created.[3]

Mathematics operators were the standard set, with the addition of a unary plus.[3] Relational operators for comparisons were also the standard set, there was no# for not-equals as found in some contemporary BASICs.[3]

Matrix math

[edit]

Extended BASIC added the suite of matrix math operations from Dartmouth BASIC's Fifth Edition. These were, in essence,macros that performed operations that would otherwise be accomplished withFOR...NEXT loops.[4]

The system included a number of pre-rolled matrixes, likeZER for a zero-matrix,CON for a matrix of all 1's, andIDN for theidentity matrix. Most mathematical operations were supported, for instance,MAT A=A*2 multiplies every element in A by 2.MAT A=DET A takes the determinant, andMAT A=INV(A) inverts it.[4]

Strings

[edit]

String literals (constants) were entered between double-quotes. Characters within strings could be escaped by placing theirASCII value between angle-brackets, for instance,"This prints a quote, <34>." String variables, like their numeric counterparts, consisted of only a single letter, or one letter and one digit.[5]

As is the case for all variables in Extended BASIC, string variables were normally allocated ten spaces, but could be extended up to a maximum of 32 k with an explicitDIM. Because the array syntax was used to declare the length of the string, string arrays were not possible. Assigning a string to a variable that was too small too hold it resulted in any excess being truncated.[6]

String manipulation was carried out usingarray slicing syntax.A$(10) referred to the substring from position 10 to the end of the string, whileA$(10,20) referred to characters 10 through 20. Concatenation used the comma, soA$=A$,B$ addedB$ to the end ofA$.[7] This was an uncommon syntax, even when it was being introduced, most BASICs using slicing used that for concatenation as well, for instance,A$(LEN(A$))=B$ would appendB$ at the end ofA$, while those using string functions, likeMicrosoft BASIC, already widely used the plus sign for this operation.

This syntax change was because Extended BASIC allowed math operators to be applied to strings, up to the first non-numeric character. For instance,A="1234"+"2345" would put 3579 into A, without the need to explicitly convert them to numerics. In most dialects, this task would require both numbers to be converted to numbers using theVAL function, likeA=VAL("1234")+VAL("2345"). Non-numerics were simply ignored,A="1234"+"FRED" put 1234 into A.[8]

Extended BASIC lacked theCHANGE command from Dartmouth that converted an entire string to or from ASCII values in an array, for instance,CHANGE "HELLOWORLD" TO B which results in B being assigned 10 numbers, each one an ASCII value. This system was replaced with the slicing system.

Statements

[edit]

Extended BASIC is otherwise similar to Dartmouth and Microsoft BASIC in the variety of commands it supports and their syntax. Exceptions includeCON instead ofCONT,DELAY instead ofPAUSE (which was not common anyway). Two additions wereON ERR THEN... which allowed errors to be trapped, a feature that became common on other BASICs, andON ESC THEN... which allowed the break key (escape in this case) to be trapped as well.[9]RETRY was similar toCON, but allowed a single line to be re-run after a break, instead of continuing the entire program.[10]TIME set the time limit forTINPUT statements to respond, which was a "timed input" otherwise identical toINPUT.[11]

Extended BASIC added a variety ofimmediate mode editing statements that are not really part of the languageper se. These includedERASE to remove a range of lines from a program,ENTER to read the contents of a text file into the program, andRENUMBER.[12]CARDS was similar toENTER, but read the lines from the card reader.

It also added a number of statements for dealing with the underlying file system, includingFILE which lists files in the user's directory andLIBRARY which does the same with wildcards,GDIR which printed the name of that directory,LOAD andSAVE for the program code,RENAME andDELETE, andDISK, which printed the free space.PUNCH was likeSAVE, but sent the file to thecard punch.WHATS printed the attributes of a given file.[13]

Otheroperating system-related statements includedWHO to print a list of logged-in users,MSG to bother them,PAGE to set the right margin (page width), andSIZE to print the memory used by the program, the opposite of what would be returned in MS BASIC withFRE().[14]

Functions

[edit]

Functions closely matched Dartmouth and Microsoft BASIC, with a few additions.CPU() returned a numeric value encoding the positions of the front-panel switches.[15]EOF(x) returned whether or not filex had reached the end-of-file.POS(X$,Y$,Z) returned the position ofB$ withinA$, anywhere after the optional positionZ, similar to the MS-standardINSTR.[16] Note that this overrides thePOS found in MS, which returns the current column position of the cursor.

References

[edit]

Citations

[edit]
  1. ^abManual 1978, p. 2.1.
  2. ^abManual 1978, p. 2.2.
  3. ^abcManual 1978, p. 2.3.
  4. ^abManual 1978, Chapter 5.
  5. ^Manual 1978, p. 2.4.
  6. ^Manual 1978, p. 2.5.
  7. ^Manual 1978, p. 2.6.
  8. ^Manual 1978, p. 2.7.
  9. ^Manual 1978, p. 3.26.
  10. ^Manual 1978, p. 3.43.
  11. ^Manual 1978, p. 3.48.
  12. ^Manual 1978, p. 3.42.
  13. ^Manual 1978, p. 3.50.
  14. ^Manual 1978, p. 3.46.
  15. ^Manual 1978, p. 4.3.
  16. ^Manual 1978, p. 4.7.

Bibliography

[edit]
Dialects of theBASIC programming language (list)
Classic
Microsoft
Texas Instruments
Hewlett-Packard
Locomotive Software
Microcomputers
Minicomputers
Time-sharing computers
Other
Extenders
Procedure-
oriented
Proprietary
Free and
open source
Withobject
extensions
Proprietary
Free and
open source
RAD
designers
Proprietary
Free and
open source
Defunct
People
Computers
Minicomputers
Microcomputers andPCs
Servers
Software
Operating systems
Applications
Programming languages
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Data_General_Extended_BASIC&oldid=1329276644"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp