Why Were Computers Invented?
Early computers may not have looked very different from calculators: They had no screens, mouse, or keyboard. Instead, they had multiple switches to input numbers or a punched tape reader and writer. Long lists of numbers could be read in sequence from a paper tape perforated with small holes to encode numbers. The same approach could be used to write out calculation results.
The key thing that separated early computers from mere calculators was that they could repeat operations conditionally. An early motivator to create computers was the need to perform numerous repeated calculations. My imaginary Calcutron-33 computer was developed to mimic behavior of early computer systems, while still following modern ideas around microprocessor design, such as having a RISC (reduced instruction set computer) inspired architecture.
From Abacus to Microprocessors
Understanding modern technology by learning about old technology
The following Calcutron-33 assembly code program is an example of a program which repeatedly adds numbers read from input using the
INP instruction and writes results to output using the
OUT instruction. Text after the
// characters represent comments and are ignored by the computer.
INP x1 // read input into register x1
INP x2 // read input into register x2
ADD x3, x2, x1 // add x1 to x2 and store in x3
OUT x3 // write register x3 to output
JMP start // jump back to start of program
An important part of this program is the
JMP instruction, which allows us to jump back to the beginning of the program, and repeat the same instructions over and over again. The label
start: marks the beginning of the program. Such an assembly program can have many different labels to allow the computer running the program to jump to several locations in the program.