IBM 701 Programmers Model
The IBM 701 had two programmer accessable registers. The Multiplier Quotient (MQ) and the Accmulator (AC). The AC contained two extra overflow bits to improve numeric accuracy. The machine use signed magnitude arithmetic, so S bit was sign.
Memory was access as either full word or half word. If the sign of the instruction was negative, access was to full word address. If it was positive, then it refered to either the right or left half of the word. The half word was adjusted so that it always occupied bits S,1-17 and the lower half was set to zero.
The machine had a total of 33 instructions. Each instruction was 18 bits long and was accessed via a half word operation. memory.
The opcodes decode as follows:
|STOP||0||Stops the processor|
|TR||1||IC <- EA|
|TR OV||2||If overflow then IC <- EA|
|TR +||3||If AC > 0 then IC <- EA|
|TR 0||4||If AC is 0 then IC <- EA|
|SUB||5||AC <- AC - (EA)|
|R SUB||6||AC <- 0; AC <- -(EA)|
|SUB AB||7||AC <- AC - |(EA)||
|NO OP||8||No operation|
|ADD||9||AC <- AC + (EA)|
|R ADD||10||AC <- 0; AC <- (EA)|
|ADD AB||11||AC <- AC + |(EA)||
|STORE||12||(EA) <- AC|
|EXTR||-13||(EA) <- (EA) & AC|
|STORE A||+13||(EA)<6:17> <- AC<6:17>|
|STORE MQ||14||(EA) <- MQ|
|LOAD MQ||15||MQ <- (EA)|
|MPY||16||AC,MQ <- AC * (EA)|
|MPY R||17||AC,MQ <- AC * (EA);RND|
|DIV||18||AC,MQ <- AC,MQ / (EA)|
|RND||19||If MQ bit 1 is 1 then AC <- AC + 1|
|L LEFT||20||AC,MQ <- AC,MQ shift left EA|
|L RIGHT||21||AC,MQ <- AC,MQ shift right EA|
|A LEFT||22||AC,MQ <- AC,MQ shift left EA|
|A RIGHT||23||AC,MQ <- AC,MQ shift right EA|
|READ||24||Start read on device EA|
|READ B||25||Start read backwords on device EA|
|WRITE||26||Start write on device EA|
|WRITE EOF||27||Write EOF on device EA|
|REWIND||28||Rewind device EA|
|SET DR||29||drum addr <- EA|
For COPY 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. COPY 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 READ, WRITE, etc I/O instructions the EA refered to the device to operate on:
|Line Printer||1000||512|| |
|Card Punch||2000||1024|| |
|Card Reader||4000||2048|| |
A SENSE on a device would skip if the device had an error on it. Device codes 64 cleared the sense lights. Codes 65 to 68 set the corrosponding sense light. Codes 70 to 74 skiped if the corrosponding sense switch was set.
Read or write to drums required that the address to be modified be set with the SET DR instruction. Not issuing this would cause the drum to start at address 0. The address was incremented after each copy.