BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→A Brief History of Programming)
(→A Brief History of Programming)
Line 29:Line 29:
A more legible form of code arose in the second generation of programming languages, called assembly languages. Assembly allows mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the more esoteric numerical codes. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76," in effect translating the human-legible mnemonic into machine language. The first assembler ran on Cambridge University's EDSAC in 1949. EDSAC was, incidentally, the first computer capable of storing programs, a feature modern computer users have taken for granted for decades (Campbell-Kelly and Aspray 184).
A more legible form of code arose in the second generation of programming languages, called assembly languages. Assembly allows mnemonics for operators such as LDA ("load accumulator"), JMP ("jump"), and INC ("increment memory") to stand in for the more esoteric numerical codes. On the Commodore 64, the letters JMP followed by an absolute address are converted by the assembler to "76," in effect translating the human-legible mnemonic into machine language. The first assembler ran on Cambridge University's EDSAC in 1949. EDSAC was, incidentally, the first computer capable of storing programs, a feature modern computer users have taken for granted for decades (Campbell-Kelly and Aspray 184).
−
Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless much more comprehensible to a human than a machine language program is. While assembly is still used today in, for instance, programming firmware and in the demoscene, there are usually significant disadvantages to programming at this level. Programming in assembly highlights technical details of platforms and the transfer of values between memory locations and registers. Higher-level languages allow the programmer to concentrate on other matters, such as solving mathematical and scientific problems or modeling business processes.
+
Although cryptic compared to a high-level language such as BASIC, an assembler program is nevertheless more comprehensible to a human than a machine language program. While assembly is still used today in, for instance, programming firmware and in the demoscene, there are usually significant disadvantages to programming at this level. Programming in assembly highlights technical details of platforms and the transfer of values between memory locations and registers. Higher-level languages allow the programmer to concentrate on other matters, such as solving mathematical and scientific problems or modeling financial processes.
−
During the first decade of electronic computing, programming was still crawling toward the ideal of Lovelace's "programs" that specified algorithms in high-level, human-readable form. To reach a level of programming more appropriate for mathematical and scientific tasks, FORTRAN (Formula Translation) was specified in 1954 and first implemented in 1957. This language, and particularly the next version of it (FORTRAN II, which appeared in 1958), had a very strong influence on BASIC.
+
During the first decade of electronic computing, programming was still crawling toward the ideal of Lovelace's "programs" that specified algorithms in high-level, human-readable form. To reach a level of programming more appropriate for mathematical and scientific tasks, FORTRAN (Formula Translation) was outlined in 1954 and first implemented in 1957. This language, and particularly the next version of it (FORTRAN II, which appeared in 1958), had a very strong influence on BASIC. Just as FORTRAN was designed with mathematics in mind, COBOL (Common Business-Oriented Language) was introduced in 1960 to address business uses. FORTRAN and COBOL both allowed for more intelligible code, improving on assembly. But both were also developed in the context of batch processing, for use with stacks of punched cards that would be processed by the machine one at a time. Punch cards were first used in the 18th century to define patterns in mechanical textile looms, but the concept was adopted in computing in the 20th century. The paragon of the punched card became known as simply "the IBM card," IBM's 80-column punched card, introduced in 1928. As explained in the chapter "Regularity," the Commodore 64's 80-column logical line, which appears as two 40-column lines on the screen, is one legacy of this early material medium for computing.
−
Programming languages were developed for other purposes as well. To address business uses, COBOL was specified in 1959 and implemented in 1960. FORTRAN and COBOL both allowed for more intelligible code, improving on assembly, but both were also developed for the context of batch processing, for use with stacks of punched cards. Specifically, they were developed for what became known as simply "the IBM card," IBM's 1928 punched card that had 80 columns. As explained in the chapter "Regularity," the Commodore 64's 80-column logical line, which appears as two 40-column lines on the screen, is one legacy of this early material medium for computing.
+
Programs written in early versions of COBOL and FORTRAN were specific to the punched card in definite ways: COBOL reserved columns 1-6 for the line number and column 7 for a continuation mark if the card's code ran on from the previous one. FORTRAN was similar, with columns 1-5 indicating the statement number. "Comments" (usually the program name) went in columns 73-80 in both languages; a "C" in the first column indicated that the whole FORTRAN card was to be considered a comment. Unless a programmer wrote a one-liner -- which in this case means writing a program that fits on a single card -- a COBOL or FORTRAN program would take the form of a stack, often a massive stack, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were essential should a greatly feared random act occur: if someone dropped the stack of cards and they needed to be resorted into order.
−
Programs written in early versions of COBOL and FORTRAN were specific to the punched card in certain ways: COBOL reserved columns 1-6 for the line number and column 7 for a continuation mark if the card's code ran on from the previous one. FORTRAN was similar, with columns 1-5 indicating the statement number. "Comments" (usually the program name) went in columns 73-80 in both languages; a "C" in the first column indicated that the whole FORTRAN card was to be considered a comment. Unless a programmer wrote a one-liner -- which in this case means writing a program that fits on a single card -- a COBOL or FORTRAN program would take the form of a stack, often a massive stack, of punched cards. These had to be punched on a keypunch machine and fed into a card reader by an operator. Line numbers were of great importance in one particular situation: if someone dropped the stack of cards and they needed to be sorted into order.
+
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does, shifting the interpreter to a specific location of the program. If one were simply interested in easily writing JMP statements, BASIC offers little advantage. Where BASIC shone, though, were in commands such as PRINT. What would take many steps in machine language is efficiently accomplished by a single command in BASIC. The drawback, which becomes more apparent with larger programs, is that every act of translation from a BASIC command to the multiple machine language steps evoked by that command results in a greater time drag.
−
FORTRAN's GOTO command was the basis for the GOTO in the original BASIC (MoP 86), which of course was carried over into Commodore 64 BASIC. GOTO functions in the same way the assembly language JMP does. There is not much of an advantage to using BASIC if one is simply interested in easily writing JMP, but other BASIC commands, such as PRINT, allow one to efficiently accomplish what would take very many machine-language operations.
+
Still, the time delay inherent in the act of translation from human language to machine language amounted to very little compared to the time saved by using a language specifically designed for the next computing revolution, one that would go beyond punched cards and batch processing to allow numerous users interactive access to a system simultaneously. This revolution was time-sharing.
−
 
−
The creators of BASIC hoped to develop a programming language for the next computing revolution, one that would go beyond punched cards and batch processing to allow numerous users interactive access to a system simultaneously. This revolution was time-sharing.
 
== Dartmouth BASIC and Time-Sharing Minicomputers ==
== Dartmouth BASIC and Time-Sharing Minicomputers ==

Revision as of 01:29, 15 July 2011

View this revision of BASIC.

Personal tools