CALL/360:BASIC

Last updated

CALL/360:BASIC was an IBM dialect of the BASIC programming language for the System/360 and later platforms. It was based on mid-1960s versions of Dartmouth BASIC but added a number of extensions. Most of these were related to file handling, which, at that time, Dartmouth lacked. It also added support for the mathematical symbols found on some IBM terminals, so that <= could be entered directly as . Differences are otherwise minor.

Contents

History

CALL/360:BASIC was announced in 1968, [1] along with several other languages for the system including APL and FORTRAN and the Datatext markup language based text editor. Early advertizing for the system boasted that one could "Start learning CALL / 360 : BASIC after breakfast and you can share our computer before lunch". [2]

The CALL/360 suite was developed within IBM's Information Marketing department. Initially, the products were considered proprietary and could only be accessed via the online service. Customer demand forced them to offer these products to other System/360 users, which they did by releasing it on an "as is" basis with no support. [3] Later the same year, IBM transferred this department, along with the rest of its timesharing services, to the Service Bureau Corporation (SBC), [4] including the CALL/360 operating system and CALL/360:BASIC. Manuals after that date refer to the language as an SBC product. [5]

In 1973, SBC was itself transferred to Control Data Corporation as part of a long running anti-trust lawsuit. [6]

Description

CALL/360:BASIC is almost identical to Dartmouth BASIC the Fourth, including support for the advanced MATrix math features. It differs primarily in its support of file handling. [7]

Basics

The language included the commands LET, PRINT, END, FOR...NEXT with an optional STEP, [lower-alpha 1] GOTO, GOSUB...RETURN, IF...THEN, IF...GOTO, DEF, READ, DATA, RESTOREDIM, and REM. To this list, it added computed GOTO of the form GOTO 100,200,300 ON X. [10] Note that the THEN in an IF statement can only be followed by a line number, the idea of allowing arbitrary statements after THEN did not appear until later. [11] REMarks are always shown with a colon in the manual, REM: or REMARK:, but it is not clear if these were required. [12] The RESTORE, END and STOP commands could also be followed by a comment string, where a colon was not required. [10]

PRINT was expanded with PRINT USING followed by a line number. The line referred to started with a colon and then a series of formatting strings. This series of strings was known as an "image". [13] Items to be printed could be separated by commas or semicolons, with commas having "print zones" 18-characters wide. [14] A new command, PAUSE, stopped the program with a statement "PAUSE AT LINE 35" and then waited for the user to enter text, which was ignored. The end-of-line character caused the program to continue. [lower-alpha 2] It could also be followed by a comment in the source. [13]

It also included the same basic set of math instructions as Dartmouth, +, -, * and /, as well as the up-arrow for exponents and adding the two-asterisk form, 10**9. [15] Logical operators included the standard set of =, >, =>, <, <= and <>, as well as the special character versions, , , . [15] It included the standard set of mathematical functions from Dartmouth, adding COT, SEC, CSC, ASN, ACS, HSN, HCS, HTN, LTW for base-2 logs, and LGT for base-10. It also included DEG and RAD functions to convert between degrees and radians, [16] and three pre-defined internal constants, &PI, $E and $SQR2, which could be used instead of typing in the actual numbers. [17]

CALL/360 included string variables, only recently introduced to Dartmouth, using the same dollar-sign notation. It added the ability to delimit string constants with either single or double quotes, as well as the ability to type two of either character within a string to include a single character of that type. For instance, "ABC""DE" represents ABC"DE. [18] Strings were broken into 18-character lengths internally, and strings that did not use up an entire 18-character record were padded with blanks, meaning "" would be interpreted as 18 spaces. [18]

Arrays and matrix math

Like early versions of Dartmouth, CALL/360:BASIC supported one and two dimensional arrays, with the lower index always being 1. Thus an array defined using DIM A(3) contains three values, A(1) through A(3). CALL/360 also added the ability to define string arrays, with each entry being a single 18-character string. [19] In contrast to Dartmouth, it does not appear variables were always DIMed; in Dartmouth one could refer to A(5) without dimensioning A, in which case it had a default behaviour of being DIM A(10). The manual does not explicitly say CALL/360 does not do this, but it does state variables cannot be used in matrix operations without being dimensioned. A maximum of 29 numeric arrays were allowed in a program, with the total sum of the elements across all arrays being no more than 7167. [20]

CALL/360:BASIC included most of the matrix commands from Dartmouth, including the ability to perform basic math on a matrix as a single operation, like MAT A = A * 10 where A is an array that will then have all of its elements multiplied by 10. It also included the functions CON, IDNZER, [21] INV and TRN. [8] Data could be loaded into a matrix with MAT READ and output with MAT PRINT. To these original commands they also added GET and PUT, which were used to read or write all the elements in a matrix to or from a file. [22]

Files

The major addition to CALL/360:BASIC was a usable file handling system. This started with the OPEN 10, 'filename' which opened a file and assigned it to the provided file number, 10 in this case, which could be an expression. Reading from the file was accomplished with GET 10: A, B, C in the same general fashion as the READ statement. Writing was handled by the otherwise identical PUT. [23] The file pointer could be moved back to the start of the file with RESET followed by one or more file numbers. There was no way to specify a position within a file. [24] CLOSE with a similar list of one or more file numbers freed the file handles. [25]

Example

The following program opens the file TEMPFILE for input as file handle 10, and then reads lines of data containing a product name and four sales prices in a loop. Notice that the loop is not terminated, instead, this program ends when it runs out of data and causes a END OF FILE error. How control is passed to line 70 at that point is not explained in the manual. The output to the screen is formatted using the image on line 50. [26]

10 OPEN 10, 'ITEMFILE', INPUT  20 GET 10: A$,A,B,C,D 30 LET Al = (A+B+C+D)/4 40 PRINT USING 50, A$,Al 50 :AVERAGE PRICE FOR A ######## IS $#.##  60 GOTO 20 70 CLOSE 10 80 END

Notes

  1. The manual often fails to mention optional features, STEP is not mentioned in the list of keywords for instance, although NEXT is. [8] STEP does appear in the detailed description of the FOR loop later in the manual. [9]
  2. In this respect, PAUSE operates identically to an INPUT, differing only in that it prints the line number.

Related Research Articles

BASIC Family of programming languages

BASIC is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny, Thomas E. Kurtz at Dartmouth College in 1964. They wanted to enable students in non-scientific fields to use computers. At the time, nearly all computers required writing custom software, which only scientists and mathematicians tended to learn.

BASIC09 is a structured BASIC programming language dialect developed by Microware on behalf of Motorola for the then-new Motorola 6809 CPU and released in February 1980. It is primarily used with the OS-9 operating system, released in 1979. Microware also released a version for OS-9/68k on the 68000 as Microware BASIC.

Atari BASIC

Atari BASIC is an interpreter for the BASIC programming language that shipped with the Atari 8-bit family of 6502-based home computers. Unlike most BASICs of the home computer era, Atari BASIC is not a derivative of Microsoft BASIC and differs in significant ways. It includes keywords for Atari-specific features and lacks support for string arrays, for example.

Integer BASIC is a BASIC interpreter written by Steve Wozniak for the Apple I and Apple II computers. Originally available on cassette for the Apple I in 1976, then included in ROM on the Apple II from its release in 1977, it was the first version of BASIC used by many early home computer owners.

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 interactive programming environment to all undergraduates as well as the larger university community.

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 incrementing by 1 for each successive line.

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 through the 1980s.

TI BASIC (TI 99/4A) Programming language for TI-99 home computers

TI BASIC is an ANSI-compliant BASIC programming language interpreter built into the 1979 Texas Instruments TI-99/4 home computer and its improved 1981 version, the TI-99/4A.

HP Time-Shared BASIC is a BASIC programming language interpreter for Hewlett-Packard's HP 2000 line of minicomputer-based time-sharing computer systems. TSB is historically notable as the platform that released the first public versions of the game Star Trek.

IBM System/34 BASIC was an interpreter for the IBM System/34 midrange computer.

IBM System/36 BASIC was an interpreter for the IBM System/36 midrange computer.

Southampton BASIC System (SOBS) was a dialect of the BASIC programming language developed for and used on ICT 1900 series computers in the late 1960s and early 1970s; it was implemented as an incremental BASIC interpreter under the MINIMOP operating system at the University of Southampton and also ran under MAXIMOP.

SCELBAL, short for SCientific ELementary BAsic Language, is a version of the BASIC programming language released in 1976 for the SCELBI and other early Intel 8008 and 8080-based microcomputers like the Mark-8. Later add-ons to the language included an extended math package and string handling. The original version required 8 kB of RAM, while the additions demanded at least 12 kB.

SUPER BASIC, sometimes SBASIC for short, is an advanced dialect of the BASIC programming language offered on Tymshare's SDS 940 systems starting in 1968 and available well into the 1970s.

Data General Extended BASIC, also widely known as Nova Extended BASIC, was a BASIC programming language interpreter for the Data General Nova series minicomputers. It was based on the seminal Dartmouth BASIC, including the Fifth Edition's string variables and powerful MAT commands for matrix manipulation. In contrast to the compile-and-go Dartmouth BASIC, Extended BASIC was an interpreter.

SDS BASIC, also known as CP-V BASIC, Batch BASIC or Sigma BASIC depending on the version, is a BASIC programming language compiler for Scientific Data Systems's (SDS) Sigma series mainframe computers, originally released in 1967. Xerox purchased SDS in 1969 and began rebranding it as Xerox Data Systems, and finally just Xerox, at which time the language became known as Xerox BASIC.

BASIC interpreter Interpreter that enables users to enter and run programs in the BASIC language

A BASIC interpreter is an interpreter that enables users to enter and run programs in the BASIC language and was, for the first part of the microcomputer era, the default application that computers would launch. Users were expected to use the BASIC interpreter to type in programs or to load programs from storage.

Wang BASIC is a series of BASIC programming languages for computers from Wang Laboratories. The term can be used to refer to the BASIC on any Wang machine, but is mostly associated with the versions on the Wang 2200 minicomputer series of the early 1970s. When these machines were updated to the VP series in 1976, BASIC-2 was introduced and remained the pattern for future machines in the 2200 series. A planned BASIC-3 was never released.

Minimal BASIC is a dialect of the BASIC programming language developed as an international standard. The effort started at ANSI in January 1974, and was joined in September by a parallel group at ECMA. The first draft was released for comments in January 1976 and the final standard, known alternately as ANSI X3.60-1978 or ECMA-55, was published in December 1977. The US Bureau of Standards introduced the NBSIR 77-1420 test suite to ensure implementations met the definition.

Full BASIC, sometimes known as Standard BASIC or ANSI BASIC, is an international standard defining a dialect of the BASIC programming language. It was developed by the American National Standards Institute (ANSI) X3.60 group in partnership with the European ECMA. It describes an advanced version of BASIC with many features including structured programming, matrix math, input/output for file handling, and many other options.

References

Citations

  1. "Computer Digest". 1968.{{cite magazine}}: Cite magazine requires |magazine= (help)
  2. "IBM ad". Scientific Research. 1968.
  3. Sharpe, William (1969). The Economics of Computers. Columbia University Press. p. 523.
  4. Gregory, Nathan (2018). The Tym Before. p. 76. ISBN   9781387304059.
  5. Manual 1970, p. i.
  6. Pollack, Andrew (3 February 1982). "I.B.M. Will Rent Time On Its Units". New York Times.
  7. Kemeny & Kurtz 1985.
  8. 1 2 Manual 1970, p. 24.
  9. Manual 1970, p. 34.
  10. 1 2 Manual 1970, p. 31.
  11. Manual 1970, p. 36.
  12. Manual 1970, p. 29.
  13. 1 2 Manual 1970, p. 44.
  14. Manual 1970, p. 46.
  15. 1 2 Manual 1970, p. 14.
  16. Manual 1970, p. 13.
  17. Manual 1970, p. 9.
  18. 1 2 Manual 1970, p. 10.
  19. Manual 1970, p. 11.
  20. Manual 1970, p. 56.
  21. Manual 1970, p. 12.
  22. Manual 1970, p. 51.
  23. Manual 1970, p. 74.
  24. Manual 1970, p. 79.
  25. Manual 1970, p. 80.
  26. Manual 1970, p. 75.

Bibliography