IBM 1401 instructions

Instruction representation

Instructions are represented by consecutive characters in memory.

The first character has a word mark. With three exceptions, the representation continues through characters at increasing addresses, up to but not including the next character that has a word mark. Instructions can have lengths of one, two, four, five, seven, or more than seven characters. Instruction lengths of three or six result in address decoding errors, which cause the processor to stop with the "check stop" lamp illuminated.

The three instructions that do not need to be followed by a character with a word mark are five-character branch with blank D modifier, seven-character set word mark, and seven-character clear storage and branch. Instructions and their formats are summarized below.

Instruction fields

Instructions have from one to four fields.

OP code field

The first character of every instruction is the operation code, or the OP code. It specifies the operation to be performed.

A address field

If the instruction length is four or more, the second, third and fourth characters of the instruction are the A address field. If the first character is % or @ this is a device address. Otherwise, this is the memory address of a branch target in a branching instruction or an operand of an operation.

B address field

If the instruction length is seven or more, the fifth, sixth and seventh characters are the B address field. This is the address of an operand of an instruction.

D modifier field

If the instruction length is two, five, or more than seven, the final character is the D modifier field. It further specifies or modifies the operation. The D modifier of an instruction is taken from the A register. Therefore, if an instruction expects to use a D modifier character, but it doesn't have enough characters, the last one fetched is used as the D modifier. Instructions with operation codes of B or V use a D modifier if the instruction is one character or more than six characters. Instructions with operation codes of L or M use a D modifier if the A address field of the instruction begins with % or @ and the instruction is longer than six characters.

Instruction summary

The Dataflow manual provides detailed information about the instruction fetch phase, and about the method of operation of most instructions. It was not updated when the overall logic scheme was changed at serial number 25,000, and it does not include input/output.

The Principles of Operation manual provides detailed information about each instruction.

OP, D AutocoderLengthsDescription BranchSpecial
1 R 1 4 Read a card If A No
1, C R 2 5 Read column binary If A Yes
2 W 1 4 Print If A No
2, S W 2 5 Print, suppress spacingIf A No
2, ) W 2 5 Print word marks If A No
3 WR 1 4 Print and read a cardIf A No
4 P 1 4 Punch a card If A No
4, C P 2 5 Punch column binaryIf A Yes
5 RP 1 4 Read and punch If A No
5, C RP 2 5 Read and punch, column binaryIf A Yes
6 WP 1 4 Print and punch If A No
7 WRP 1 4 Read, print and punchIf A No
8 SRF 1 4 Start read feed If A No
9 SPF 1 4 Start punch feed If A No
# MA 1 4 7 Modify address No If > 4k
@ M 1 4 7 Multiply No Yes
/ CS 1 4 7 Clear storage To A if BNo
S S 1 4 7 Subtract No No
T T 1 4 7 Translate No 1410, 1460
U, A CU 5 Diagnostic read tapeNo No
U, B BSP 5 Backspace tape No No
U, E SKP 5 Skip and erase tapeNo No
U, M WTM 5 Write tape mark No No
U, R RWD 5 Rewind tape No No
U, U RWU 5 Rewind tape and unloadNo No
V, 1 BW 1 >6 Branch if word markYes No
V, 2 BWZ 1 >6 Branch if no zone Yes No
V, B BWZ 1 >6 Branch if AB zone Yes No
V, K BM 1 >6 Branch if B zone Yes No
V, S BWZ 1 >6 Branch if A zone Yes No
W, d BBE 1 >6 Branch if bit equalYes Yes
Y MZ 1 4 7 Move zone No No
Z MCS 1 4 7 Move and suppress zeroNo No
, SW 1 4 7 Set word mark No No
% D 1 4 7 Divide No Yes
K, 1248SS 2 5 Select 1402 stackerIf A No
K, L SS 2 5 1009 load mode If A 1009
K, $ SS 2 5 Overlap on If A Yes
K, A SS 2 5 1009 suppress alarmIf A 1009
K, C SS 2 5 DDC read request If A DDC
K, D SS 2 5 1009 set receive If A 1009
K, D SS 2 5 DDC write request If A DDC
K, E SS 2 5 1009 set transmit If A 1009
K, E SS 2 5 DDC reset If A DDC
K, F SS 2 5 1009 send EOF If A 1009
K, . SS 2 5 1402 Overlap off If A Yes
K, ) SS 2 5 1402 Reset overlap If A Yes
L LCA 1 4 7 Load to A-field word markNoNo
L, R RTW >6 Read tape with word marksNoTape
L, W RTW >6 Write tape with word marksNoTape
M MCW 1 4 6 Move to A- or B-field word markNoNo
M, R RT >6 Read tape No Tape
M, W WT >6 Write tape No Tape
N NOP any No operation No No
P MCM 1 4 7 Move record No Yes
Q SAR 1 4 Store A-address registerNoYes
! ZS 1 4 7 Zero and subtract No No
A A 1 4 7 Add No No
B B 4 Branch, 4-charactersYes No
B, A BLC 5 Branch if last cardYes No
B, B-G BSS 5 Branch if sense switchYesYes
B, otherBIN 5 Branch on indicator, see next tableYesSome
B, otherBCE 1 >6 Branch if character equalYesNo
C C 1 4 7 Compare No No
D MN 1 4 7 Move numeric No No
E MCE 1 4 7 Move and edit No Some
F, d CC 2 5 Carriage control No No
H SBR 1 4 7 Store B-address registerNoYes
? ZA 1 4 7 Zero and add No No
) CW 1 4 7 Clear word mark No No

D-modifier indicators for five-character branch

D Char  Autocoder  Unit Meaning
blank   BIN        1401 Unconditional -- no word mark needed in next char
1       BIN        1009 in run condition A24-3071-2 I-66
                   1011 punch in backspace operation
                   1011 reader parity indicator on
                   1231 auto select
                   1285 error
                   1412 control-check indicator on
                   1418 late read
                   1419 document to be read
                   1428 late read or late reading mode change
                   1445 printer error
                   7340 hypertape unusual end
                   7740 transmission complete with abnormal status
                   DDC  transmission error A24-3071-2 I-14
2       BIN        1009 buffer available A24-3071-2 I-66
                   1011 punch ready
                   1011 reader ready
                   1231 full buffer
                   1285 end of line
                   1412 reader-not-ready signal on
                   1418 ready to engage
                   1419 document under read head (PDS 4)
                   1428 ready to engage
                   7340 hypertape normal end
                   7740 transmission complete successfully
                   DDC  transmission ended by GMWM A24-3071-2 I-14
3       BIN        1009 good transmission occurred A24-3071-2 I-66
                   1011 punch not ready to receive data
                   1231 ready to read
                   1285 reader transporting
                   1412 read-check indicator on
                   1418 document under selected read station
                   1419 valid amount field
                   1428 document under selected read station
                   7340 hypertape control unit 7641 busy
                   7740 receive request
                   DDC  read request A24-3071-2 I-14
4       BIN        1009 reply-bad indicator on A24-3071-2 I-66
                   1011 punch not ready to read
                   1231 empty hopper
                   1285 marked line
                   1412 amount-field indicator on
                   1419 valid process-control field
                   7340 hypertape attention
                   7740 7740 attention
                   DDC  write request A24-3071-2 I-14
5       BIN        1009 error reply acknowledgement A24-3071-2 I-66
                   1011 punch overextended
                   1231 read error or overrun
                   1285 header information
                   1412 process-control indicator on
                   1418 document end
                   1419 valid account-number field
                   1428 document end
                   1445 printer busy
6       BIN        1009 program attention required A24-3071-2 I-66
                   1011 punch supply reel low or chad box full
                   1231 timing mark check
                   1285 ready to read a line
                   1412 account-number indicator on
                   1418 character on line
                   1419 valid transit-number field
                   1428 character on line
                   1445 carriage busy
                   DDC  write in progress A24-3071-2 I-14
7       BIN        1009 end of message A24-3071-2 I-66
                   1285 reader ready
                   1412 transit-number indicator on
                   1418 empty hopper and transport (end of file)
                   1419 valid serial-number field
                   1428 empty hopper and transport (end of file)
                   1445 carriage channel 9
                   DDC  read in progress A24-3071-2 I-14
8       BIN        1009 end of file A24-3071-2 I-66
                   1285 end of file
                   1412 document-spacing-check indicator on
                   1418 ready to read
                   1419 auto-select
                   1428 ready to read
                   1448 carriage channel 12
                   DDC  system A stopped A24-3071-2 I-14
9       BIN        1403 carriage tape channel 9
0       BIN        1404 validity error
#/=   
@/'     BCV        1403 carriage tape channel 12
:     
>       BIN        1448 end of block
{     
^     
/       BU         1401 unequal compare
S       BE         1401 equal compare
T       BL         1401 low compare
U       BH         1401 high compare
V       BIN        1301 disk error
                   1311 disk error
                   1405 read or write parity check or read back check error
W       BIN        1301 wrong-length record
                   1311 wrong-length record
                   1405 wrong-length record
X       BIN        1301 uniqual-address compare
                   1311 uniqual-address compare
                   1405 unequal-address compare
Y       BIN        1301 any disk-unit error condition
                   1311 any disk-unit error condition
                   1405 any disk-unit error condition
Z       BAV        1401 arithmetic overflow
|       BIN        1403 printer error (record mark)
,     
%/(     BIN        1401 process check with process check switch off (%)
                   1440 I/O check stop switch off (maybe 1440 only)
~     
\       BIN        1301 access busy
                   1311 access busy
"     
-     
J       BIN        1419 I/O channel-busy indicator
                   TAU  tape busy
                   SIO  serial input-output busy
K       BEF        TAU  end of reel (writing) or tape mark (reading)
L       BER        TAU  tape error
M     
N       BIN        1301 access inoperable
                   1311 access inoperable
                   1405 access inoperable
O     
P       BIN        1403 printer busy
Q       BIN        1407 inquiry request
R       BIN        1403 carriage busy
!                  1402 punch error
$     
*       BIN        1407 inquiry clear
]     
;     
_     
&/+     BIN        1442 last card (Reader unit 2)
A       BLC        1402 last card if SS A is on
B       BSS        1401 SS B
        BIN        7340 hypertape attention response
C       BSS        1401 SS C
D       BSS        1401 SS D
E       BSS        1401 SS E
        BIN        7340 hypertape end response
F       BSS        1401 SS F
G       BSS        1401 SS G
H       BIN        1402 reader busy
I       BIN        1402 punch busy
?       BIN        1402 reader error
.     
)     
[     
<       BIN        1448 early warning
}