IBM 704 Assembly Addition




General Memory

What does this mean?


Instruction to be executed next is highlighted in blue.

Target address of instruction to be executed next is highlighted in pink.

Mouse over words (the binary numbers) to see how they could be interpreted.

Other Registers:

Instruction Location Counter

Instruction Register

Storage Register


Multiplier-Quotient Register:

Index Register A

Index Register B

Index Register C

Welcome to the IBM 704 simulator! To learn how it works, we'll walk through an example.

In the middle column we have the general memory of our computer. This is where all the data comprising our program lives. The general memory is broken into 8192 words, or registers, of 36 bits each (although here we only show 6 words). Each word represents a single, complete unit of data representing either a number, or an instruction. On the right we have some special registers that hold data while the program is executed. Now, reading binary is rather difficult, so we’ve allowed you to see the possible interpretations of a word by mousing over it. Note that the computer doesn’t know how to interpret words automatically-- it is up to the programmer to tell the computer how to interpret each word. If one makes a mistake, they could end up using the program as data, or trying to execute numbers as instructions!

In the left column we have the code that comprises our program. For this simulator, the code is written in assembly language. Assembly language is coding language that is very “low-level”, in programming terms: this means that it more closely resembles machine code. For example, in the IBM 704 assembly language, each line of code, called an instruction, corresponds to a single word in memory, a simple 1-to-1 correspondence you wouldn't see in a higher level programming language like C. You can see that one of the instructions and one of the words in general memory are highlighted in blue; these are the same instruction, which you can verify by mousing over the word.

Now to analyze the code section on the left. Each instruction is denoted by a three-letter code followed by a number that corresponds to the register number in the General Memory that you want to perform that operation on. For those coming from a coding background in modern languages, this should be emphasized: there are no variables that hold values. Instead, everything is referred to by address. For example, CLA(Clear and Add) 4 , clears the accumulator on the right and places the value found at register number 4 into it. You should see register 0 highlighted in blue and register 4 highlighted in pink. If you mouse over register 4, you should see it contains 12 as a fixed point value. If you press the step button, you will execute the instruction highlighted in blue. You should see the accumulator on the right change value to 12 as well. You’ll also see the Instruction Location Counter increase by 1 as you move to the next instruction.

Now another strange thing: you cannot simply add two numbers from two registers together (something that even modern assembly languages allow). Instead you must use the special accumulator register to do addition. The next operation, ADD 5, adds the value at register number 5, which is 30, to the value of the accumulator. Press the step button again to see the accumulator change again. Finally, STO 6, which is short for Store 6, stores the number in the accumulator into register number 6. Mouse over register 6 and you’ll see that it is 12 + 30 = 42, the Answer to Life, the Universe, and Everything. All that just to do some simple addition!

Want to see the whole program run at once? Press the reset button to reset the demo and click run!