IBM 704 Programmers Model
The IBM 704 had several programmer accessable registers.
- The Multiplier Quotient (MQ).
- The Accmulator (AC). The AC contained two extra overflow bits to improve numeric accuracy.
- Three 15bit index registers called A, B and C.
All memory was access as full word.
Floating point has the following format, characteristic (exponent) is +128.
Instructions as coded one of the following types:
Type A
Type B
The tag field specified which of the three index registers were to be used. The registers where or'ed together and then subtracted from the address part of the instruction to determine the actual address. When the results where stored back into the index registers if multiple registers were selected, all selected registers were updated to same value. Opcodes which used the address part to select an operation (0 760 and -0 760), the operand could be modified by the use of tags. Same as I/O instructions where the address specified the device to select.
The opcodes decode as follows:
Octal | OP | Type | Name | Notes |
0 36100 t aaaaa | ACL | B | ADD AND CARRY LOGICAL WORD |   |
0 40000 t aaaaa | ADD | B | ADD |   |
0 40100 t aaaaa | ADM | B | ADD MAGNITUDE |   |
0 76700 t aaaaa | ALS | B | ACCUMULATOR LEFT SHIFT |   |
-0 32000 t aaaaa | ANA | B | AND TO ACCUMULATOR |   |
0 32000 t aaaaa | ANS | B | AND TO STORAGE |   |
0 76700 t aaaaa | ARS | B | ACCUMULATOR RIGHT SHIFT |   |
0 76400 t aaaaa | BSR | B | BACKSPACE RECORD |   |
-0 70000 t aaaaa | CAD | B | COPY, ADD AND CARRY |   |
-0 50000 t aaaaa | CAL | B | CLEAR AND ADD LOGICAL |   |
0 34000 t aaaaa | CAS | B | COMPARE ACCUMULATOR WITH STORAGE |   |
0 76000 0 00002 | CHS | B | CHANGE SIGN |   |
0 50000 t aaaaa | CLA | B | CLEAR AND ADD |   |
0 76000 0 00001 | CLM | B | CLEAR MAGNITUDE |   |
0 50200 t aaaaa | CLS | B | CLEAR AND SUBTRACT |   |
0 76000 0 00006 | COM | B | COMPLEMENT MAGNITUDE |   |
0 70000 t aaaaa | CPY | B | COPY |   |
0 76000 0 00012 | DCT | B | DIVIDE CHECK TEST |   |
0 22000 t aaaaa | DVH | B | DIVIDE OR HALT |   |
0 22100 t aaaaa | DVP | B | DIVIDE OR PROCEED |   |
0 76000 0 00007 | ETM | B | ENTER TRAPPING MODE |   |
-0 76000 0 00011 | ETT | B | END OF TAPE TEST |   |
0 30000 t aaaaa | FAD | B | FLOATING ADD |   |
0 24000 t aaaaa | FDH | B | FLOATING DIVIDE OR HALT |   |
0 24100 t aaaaa | FDP | B | FLOATING DIVIDE OR PROCEED |   |
0 26000 t aaaaa | FMP | B | FLOATING MULTIPLY |   |
0 30200 t aaaaa | FSB | B | FLOATING SUBTRACT |   |
0 42000 t aaaaa | HPR | B | HALT AND PROCEED |   |
0 00000 t aaaaa | HTR | B | HALT AND TRANSFER |   |
0 76000 0 00001 | LBT | B | LOW ORDER BIT TEST |   |
0 46000 t aaaaa | LDA | B | LOCATE DRUM ADDRESS |   |
0 56000 t aaaaa | LDQ | B | LOAD MQ |   |
-0 76300 t aaaaa | LGL | B | LOGICAL LEFT SHIFT |   |
0 76300 t aaaaa | LLS | B | LONG LEFT SHIFT |   |
0 76500 t aaaaa | LRS | B | LONG RIGHT SHIFT |   |
-0 76000 0 00007 | LTM | B | LEAVE TRAPPING MODE |   |
0 53400 t aaaaa | LXA | B | LOAD INDEX FROM ADDRESS |   |
-0 53400 t aaaaa | LXD | B | LOAD INDEX FROM DECREMENT |   |
0 20000 t aaaaa | MPY | B | MULTIPLY |   |
-0 20000 t aaaaa | MPR | B | MULTIPLY AND ROUND |   |
-0 76000 0 00000 | MSE | B | MINUS SENSE |   |
0 76100 t aaaaa | NOP | B | NO OPERATION |   |
-0 50100 t aaaaa | ORA | B | OR TO ACCUMULATOR |   |
-0 60200 t aaaaa | ORS | B | OR TO STORAGE |   |
0 73400 t aaaaa | PAX | B | PLACE ADDRESS IN INDEX |   |
-0 76000 0 00001 | PBT | B | P BIT TEST |   |
-0 73400 t aaaaa | PDX | B | PLACE DECREMENT IN INDEX |   |
0 76000 0 00000 | PSE | B | PLUS SENSE |   |
-0 75400 t aaaaa | PXD | B | PLACE INDEX IN DECREMENT |   |
0 76200 t aaaaa | RDS | B | READ SELECT |   |
0 77200 t aaaaa | REW | B | REWIND TAPE |   |
0 76000 0 00010 | RND | B | ROUND |   |
-0 77300 t aaaaa | RQL | B | ROTATE MQ LEFT |   |
-0 76000 0 00012 | RTT | B | REDUNDANCY TAPE TEST |   |
-0 77200 t aaaaa | RUN | B | REWIND AND UNLOAD |   |
-0 40000 t aaaaa | SBM | B | SUBTRACT MAGNITUDE |   |
0 76000 0 00140 | SLF | B | SENSE LIGHTS OFF |   |
0 76000 0 00141 | SLN1 | B | SENSE LIGHTS ON |   |
0 76000 0 00142 | SLN2 | B | SENSE LIGHTS ON |   |
0 76000 0 00143 | SLN3 | B | SENSE LIGHTS ON |   |
0 76000 0 00144 | SLN4 | B | SENSE LIGHTS ON |   |
-0 76000 0 00140 | SLT | B | SENSE LIGHT TEST |   |
-0 62000 t aaaaa | SLQ | B | STORE LEFT HALF MQ |   |
0 60200 t aaaaa | SLW | B | STORE LOGICAL WORD |   |
-0 76000 0 00003 | SSM | B | SET SIGN MINUS |   |
0 76000 0 00003 | SSP | B | SET SIGN PLUS |   |
0 62100 t aaaaa | STA | B | STORE ADDRESS |   |
0 62200 t aaaaa | STD | B | STORE DECREMENT |   |
0 60100 t aaaaa | STO | B | STORE |   |
-0 60000 t aaaaa | STQ | B | STORE MQ |   |
0 63000 t aaaaa | STP | B | STORE PREFIX |   |
0 60000 t aaaaa | STZ | B | STORE ZERO |   |
0 76000 0 00161 | SWT1 | B | SENSE SWITCH TEST |   |
0 76000 0 00162 | SWT2 | B | SENSE SWITCH TEST |   |
0 76000 0 00163 | SWT3 | B | SENSE SWITCH TEST |   |
0 76000 0 00164 | SWT4 | B | SENSE SWITCH TEST |   |
0 76000 0 00165 | SWT5 | B | SENSE SWITCH TEST |   |
0 76000 0 00166 | SWT6 | B | SENSE SWITCH TEST |   |
0 40200 t aaaaa | SUB | B | SUBTRACT |   |
-0 63400 t aaaaa | SXD | B | STORE INDEX IN DECREMENT |   |
2 ddddd t aaaaa | TIX | A | TRANSFER ON INDEX |   |
0 04000 t aaaaa | TLQ | B | TRANSFER ON LOW MQ |   |
-0 12000 t aaaaa | TMI | B | TRANSFER ON MINUS |   |
-0 14000 t aaaaa | TNO | B | TRANSFER ON NO OVERFLOW |   |
-2 ddddd t aaaaa | TNX | A | TRANSFER ON NO INDEX |   |
-0 10000 t aaaaa | TNZ | B | TRANSFER ON NO ZERO |   |
0 01400 t aaaaa | TOV | B | TRANSFER ON OVERFLOW |   |
0 12000 t aaaaa | TPL | B | TRANSFER ON PLUS |   |
0 16100 t aaaaa | TQO | B | TRANSFER ON MQ OVERFLOW |   |
0 16200 t aaaaa | TQP | B | TRANSFER ON MQ PLUS |   |
0 02000 t aaaaa | TRA | B | TRANSFER |   |
0 07400 t aaaaa | TSX | B | TRANSFER AND SET INDEX |   |
0 02100 t aaaaa | TTR | B | TRAP TRANSFER |   |
3 ddddd t aaaaa | TXH | A | TRANSFER ON INDEX HIGH |   |
1 ddddd t aaaaa | TXI | A | TRANSFER WITH INDEX INCREMENTED |   |
-3 ddddd t aaaaa | TXL | A | TRANSFER ON INDEX LOW |   |
0 10000 t aaaaa | TZE | B | TRANSFER ON ZERO |   |
-0 30000 t aaaaa | UFA | B | UNNORMALIZED FLOATING ADD |   |
-0 26000 t aaaaa | UFM | B | UNNORMALIZED FLOATING MULTIPLY |   |
-0 30200 t aaaaa | UFS | B | UNNORMALIZED FLOATING SUBTRACT |   |
0 77000 t aaaaa | WEF | B | WRITE END OF FILE |   |
0 76600 t aaaaa | WRS | B | WRITE SELECT |   |
For CPY/CAD the EA indicated either the location to load the data word or the location to write the data word. Depending on whether the device was in read or write mode. CPY go to next instruction if data copy was successfull. It would skip on instruction on end of file or any error. And it would skip two instructions on end of record. Note all I/O operations destroy the contents of the MQ registers as this was used to assemble data from devices.
For RDS, WRS, etc I/O instructions the EA refered to the device to operate on:
Device | Octal | to | Decimal | to |
Drums | 301 | 310 | 193 | 200 |
Tapes BCD | 201 | 212 | 129 | 138 |
Tapes Bin | 221 | 232 | 145 | 154 |
Line Printer | 361 |   | 241 |   |
Card Punch | 341 |   | 225 |   |
Card Reader | 321 |   | 209 |   |
CRT Film Printer | 030 |   | 024 |   |
Read or write to drums required that the address to be modified be set with the LDA instruction. Not issuing this would cause the drum to start at address 0. The address was incremented after each copy.