IBM 704 Programmers Model

The IBM 704 had several programmer accessable registers.

The machine use signed magnitude arithmetic, so S bit was sign.

IBM 704 Registers

All memory was access as full word.

Floating point has the following format, characteristic (exponent) is +128.
IBM 704 Floating Pointer

Instructions as coded one of the following types:

Type A

IBM 704 Type A Instruction Format

Type B

IBM 704 Type B Instruction Format

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:

OctalOPTypeNameNotes
 0 36100 t aaaaaACLB ADD AND CARRY LOGICAL WORD 
 0 40000 t aaaaaADDB ADD 
 0 40100 t aaaaaADMB ADD MAGNITUDE 
 0 76700 t aaaaaALSB ACCUMULATOR LEFT SHIFT 
-0 32000 t aaaaaANAB AND TO ACCUMULATOR 
 0 32000 t aaaaaANSB AND TO STORAGE 
 0 76700 t aaaaaARSB ACCUMULATOR RIGHT SHIFT 
 0 76400 t aaaaaBSRB BACKSPACE RECORD 
-0 70000 t aaaaaCADB COPY, ADD AND CARRY 
-0 50000 t aaaaaCALB CLEAR AND ADD LOGICAL 
 0 34000 t aaaaaCASB COMPARE ACCUMULATOR WITH STORAGE 
 0 76000 0 00002CHSB CHANGE SIGN 
 0 50000 t aaaaaCLAB CLEAR AND ADD 
 0 76000 0 00001CLMB CLEAR MAGNITUDE 
 0 50200 t aaaaaCLSB CLEAR AND SUBTRACT 
 0 76000 0 00006COMB COMPLEMENT MAGNITUDE 
 0 70000 t aaaaaCPYB COPY 
 0 76000 0 00012DCTB DIVIDE CHECK TEST 
 0 22000 t aaaaaDVHB DIVIDE OR HALT 
 0 22100 t aaaaaDVPB DIVIDE OR PROCEED 
 0 76000 0 00007ETMB ENTER TRAPPING MODE 
-0 76000 0 00011ETTB END OF TAPE TEST 
 0 30000 t aaaaaFADB FLOATING ADD 
 0 24000 t aaaaaFDHB FLOATING DIVIDE OR HALT 
 0 24100 t aaaaaFDPB FLOATING DIVIDE OR PROCEED 
 0 26000 t aaaaaFMPB FLOATING MULTIPLY 
 0 30200 t aaaaaFSBB FLOATING SUBTRACT 
 0 42000 t aaaaaHPRB HALT AND PROCEED 
 0 00000 t aaaaaHTRB HALT AND TRANSFER 
 0 76000 0 00001LBTB LOW ORDER BIT TEST 
 0 46000 t aaaaaLDAB LOCATE DRUM ADDRESS 
 0 56000 t aaaaaLDQB LOAD MQ 
-0 76300 t aaaaaLGLB LOGICAL LEFT SHIFT 
 0 76300 t aaaaaLLSB LONG LEFT SHIFT 
 0 76500 t aaaaaLRSB LONG RIGHT SHIFT 
-0 76000 0 00007LTMB LEAVE TRAPPING MODE 
 0 53400 t aaaaaLXAB LOAD INDEX FROM ADDRESS 
-0 53400 t aaaaaLXDB LOAD INDEX FROM DECREMENT 
 0 20000 t aaaaaMPYB MULTIPLY 
-0 20000 t aaaaaMPRB MULTIPLY AND ROUND 
-0 76000 0 00000MSEB MINUS SENSE 
 0 76100 t aaaaaNOPB NO OPERATION 
-0 50100 t aaaaaORAB OR TO ACCUMULATOR 
-0 60200 t aaaaaORSB OR TO STORAGE 
 0 73400 t aaaaaPAXB PLACE ADDRESS IN INDEX 
-0 76000 0 00001PBTB P BIT TEST 
-0 73400 t aaaaaPDXB PLACE DECREMENT IN INDEX 
 0 76000 0 00000PSEB PLUS SENSE 
-0 75400 t aaaaaPXDB PLACE INDEX IN DECREMENT 
 0 76200 t aaaaaRDSB READ SELECT 
 0 77200 t aaaaaREWB REWIND TAPE 
 0 76000 0 00010RNDB ROUND 
-0 77300 t aaaaaRQLB ROTATE MQ LEFT 
-0 76000 0 00012RTTB REDUNDANCY TAPE TEST 
-0 77200 t aaaaaRUNB REWIND AND UNLOAD 
-0 40000 t aaaaaSBMB SUBTRACT MAGNITUDE 
 0 76000 0 00140SLFB SENSE LIGHTS OFF 
 0 76000 0 00141SLN1B SENSE LIGHTS ON 
 0 76000 0 00142SLN2B SENSE LIGHTS ON 
 0 76000 0 00143SLN3B SENSE LIGHTS ON 
 0 76000 0 00144SLN4B SENSE LIGHTS ON 
-0 76000 0 00140SLTB SENSE LIGHT TEST 
-0 62000 t aaaaaSLQB STORE LEFT HALF MQ 
 0 60200 t aaaaaSLWB STORE LOGICAL WORD 
-0 76000 0 00003SSMB SET SIGN MINUS 
 0 76000 0 00003SSPB SET SIGN PLUS 
 0 62100 t aaaaaSTAB STORE ADDRESS 
 0 62200 t aaaaaSTDB STORE DECREMENT 
 0 60100 t aaaaaSTOB STORE 
-0 60000 t aaaaaSTQB STORE MQ 
 0 63000 t aaaaaSTPB STORE PREFIX 
 0 60000 t aaaaaSTZB STORE ZERO 
 0 76000 0 00161SWT1B SENSE SWITCH TEST 
 0 76000 0 00162SWT2B SENSE SWITCH TEST 
 0 76000 0 00163SWT3B SENSE SWITCH TEST 
 0 76000 0 00164SWT4B SENSE SWITCH TEST 
 0 76000 0 00165SWT5B SENSE SWITCH TEST 
 0 76000 0 00166SWT6B SENSE SWITCH TEST 
 0 40200 t aaaaaSUBB SUBTRACT 
-0 63400 t aaaaaSXDB STORE INDEX IN DECREMENT 
 2 ddddd t aaaaaTIXA TRANSFER ON INDEX 
 0 04000 t aaaaaTLQB TRANSFER ON LOW MQ 
-0 12000 t aaaaaTMIB TRANSFER ON MINUS 
-0 14000 t aaaaaTNOB TRANSFER ON NO OVERFLOW 
-2 ddddd t aaaaaTNXA TRANSFER ON NO INDEX 
-0 10000 t aaaaaTNZB TRANSFER ON NO ZERO 
 0 01400 t aaaaaTOVB TRANSFER ON OVERFLOW 
 0 12000 t aaaaaTPLB TRANSFER ON PLUS 
 0 16100 t aaaaaTQOB TRANSFER ON MQ OVERFLOW 
 0 16200 t aaaaaTQPB TRANSFER ON MQ PLUS 
 0 02000 t aaaaaTRAB TRANSFER 
 0 07400 t aaaaaTSXB TRANSFER AND SET INDEX 
 0 02100 t aaaaaTTRB TRAP TRANSFER 
 3 ddddd t aaaaaTXHA TRANSFER ON INDEX HIGH 
 1 ddddd t aaaaaTXIA TRANSFER WITH INDEX INCREMENTED 
-3 ddddd t aaaaaTXLA TRANSFER ON INDEX LOW 
 0 10000 t aaaaaTZEB TRANSFER ON ZERO 
-0 30000 t aaaaaUFAB UNNORMALIZED FLOATING ADD 
-0 26000 t aaaaaUFMB UNNORMALIZED FLOATING MULTIPLY 
-0 30200 t aaaaaUFSB UNNORMALIZED FLOATING SUBTRACT 
 0 77000 t aaaaaWEFB WRITE END OF FILE 
 0 76600 t aaaaaWRSB 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:

DeviceOctaltoDecimalto
Drums301310193200
Tapes BCD201212129138
Tapes Bin221232145154
Line Printer361 241 
Card Punch341 225 
Card Reader321 209 
CRT Film Printer030 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.