BASIC

From Maze

(Difference between revisions)
Jump to: navigation, search
(→BASIC Code in Human Memory)
(Tried to improve machine language paragraph)
Line 21:Line 21:
The computer programs that followed in the electro-mechanical and early electronic age of computing were less intelligible than Lovelace's algorithm, bearing little relationship to any kind of written word -- or numbers. For example, the ENIAC, a fully electronic computer built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables (da Cruz). To run particular calculations, constants were then set using dials.
The computer programs that followed in the electro-mechanical and early electronic age of computing were less intelligible than Lovelace's algorithm, bearing little relationship to any kind of written word -- or numbers. For example, the ENIAC, a fully electronic computer built at the University of Pennsylvania from 1943 to 1945, was programmed initially by plugging in an elaborate set of cables (da Cruz). To run particular calculations, constants were then set using dials.
−
The next step in programming was machine language. A program in machine language was simply a sequence of numbers that spoke, as it were, to the machine in the machine's own language. Each number corresponded to a particular machine operation, while the operands, if there were any, were similarly provided as numbers. On the ENIAC, these numbers were decimal (base 10), but different bases were used on other early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal (Bergin 62). In all of these cases, programmers arduously determined the sequence of numbers that would constitute a program, resulting in code that did not remotely resemble any spoken human language. For instance, to jump unconditionally to a particular absolute address, an opcode such as "76" (in base 10) is used, followed by two bytes specifying the address. In fact, this is the opcode used for an unconditional branch to an absolute address on the Commodore 64 -- though one would never know from looking at it.
+
The next step in programming was machine language. A program in machine language is simply a sequence of numbers which cause the computer to operate but are not very understandable to a human. On the ENIAC, the numbers that formed a machine language program were decimal (base 10), but different bases were used on other early systems. The EDVAC used binary; the ORDVAC, octal; and the BRLESC, sexadecimal (Bergin 62). The numbers specify what operations the computer is to carry out, and consist of opcodes (indicating low-level commands) which may be followed by operands (). For instance, the opcode to add two values would have to have two operands after it, specifying what is to be added together, while the opcode to increment a particular register would not have any operands at all, since the opcode alone completely specifies what is to be done. To jump unconditionally to a particular absolute address, an opcode such as "76" (in base 10) is used, followed by two bytes specifying the address. In fact, this is the opcode used for an unconditional branch to an absolute address on the Commodore 64. While the sequence of numbers in a machine language program is unambiguous to the computer, it is far from obvious at a glance which numbers are the commands (opcodes) and which ones are parameters and data (operands). An expert in machine language would have to determine this by starting at the beginning, recognizing each opcode, knowing how many operands correspond to it, and continuing though as if executing the program; writing a machine-language program required similar low-level expertise. Working at this level is clearly something that computers do better than people, as was acknowledged when programming took the next step up.
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 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.
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 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.

Current revision

View this revision of BASIC.

Personal tools