return to main page
IPL - Initial Program Loadand the "A" switch wiring and usage
The "A" Switch
Most "serious" computers have some easy way to get started without much manual effort, such as toggling a start up loader into memory using front panel switches.
Much of the following was inspired by e-mail between Matthias Goerner (asking the questions), and Van Snyder (with the answers) and LaFarr Stuart keeping track ;-))
The key paragraph from Van Snyder seemed to be
"Seven-character set-word-mark, five-character branch with blank d- modifier, and seven-character clear-storage-and-branch do not need a word mark to *finish* fetching the instruction and enter the EX phase, but every instruction executed has to have a word mark under the op code. Of the three that don't need a word mark to move from I to EX, only set-word-mark is not a branch. Any branch, whether its I phase was terminated by sensing a word mark, or indeed if the I-address register was set from the console, has to land on a character with a word mark."
1401 characteristics which support the "LOAD" operation. (as per my understanding of Van Snyder)
- Depressing the "LOAD" button does the following:
- - reads a card (in BDC mode) into 001 through 080,
- - setting a word mark into memory location 001
- - clearing any word marks 002 through 080.
- - starts executing code starting at memory location 001
- Instructions that do not need a word mark in the following memory location to execute properly are:
- The SET WORD MARK and CLEAR-STORAGE-AND-BRANCH instructions with two addresses do not need a word mark
- permitting the first instruction, SW 008nnn, to work
- UNCONDITIONAL BRANCH (e.g. B with address and d-modifier=BLANK) the machine will stop the fetching after the I-4 cycle and doesn't need a word mark on the next opcode.
- I-8 is the phase that gobbles characters until it sees a word mark.
The original and primary way to get a 1401 started (assuming 1401 power is on) is to:
In a typical program, the first card of a loader is:
- Set the 1401 operator's panel switches
- rotary switch in "RUN"
- assure that any required sense switches "A"-"G" are set correctly
- depress "START RESET" switch
- On the 1402 Card Reader Punch
- assure that the "READER ON" switch is ON
- Depress "NON-PRO RUNOUT" for a few seconds to assure reader path empty
- - (reader gate must be closed)
- insert deck into reader, "9 edge in, face down", assure reader gate closed
- Briefly depress "CHECK RESET" button on 1402
- Briefly depress "LOAD" button on 1402
,008015,022029,036040,047054,061068,072/061039 ,00100110400003followed in one case by setting memory locations 087-089 (index register 1) to zero000 L003089,040040,040040,04004010400004followed many cards later by a branch to memory location 338 in the loaded program/338080 0066
"begin rambling side trip" - from Van Snyder
Oddly, the newest edition of the "Brownie Book" (A24-1403-5) doesn't include the sentence that says clear-storage-and-branch doesn't need a word mark. I don't know why it was removed. I tried it on the HzG machine, serial number 25000-something, and it branched without fetching an eighth character.
At least some 8-character instructions, that the processor knows are 8- character instructions (e.g. BCE, BWZ) work with only seven characters. The processor simply looks in the A register for its d-modifier, thereby using the last character of the B-address. I conjecture this works for other 8-character instructions, e.g. M and L with % as the first character of the A address.
Instructions work if they have too many characters, too. Of course, if the behavior of the instructions changes as the number of characters increases, you get the behavior defined for the maximum meaningful number of characters.
For example, BCE and BWZ work fine with ten characters.
In these cases, the d-modifier is taken from the LAST character, not the eighth one. I conjecture, but I haven't verified, that this also works for five-character instructions, such as select-stacker-and-branch (K), carriage-control-and-branch (F), and maybe control-unit (U). These might get check stops if they have six characters, because the processor might try to form a B-address, but the B-address register is cleared to blanks in I-5, so the fifth character is blank in I-6. But seven or more ought to work.
The default start address for beginning an Autocoder assembly (i.e., if you don't have an ORG paeudo-op) is 333, not 338. Many programs start at their first address, but that's not required.
BTW, pressing the "tape load" key does the following:
- Read a record from tape unit 1 starting in location 1, with word marks - Branch to location 1
There is a line on the SIO that does the same thing, but there's no switch on the console to do it. I assume there was a key on equipment one could plug into the SIO. This makes a PC-to-SIO interface attractive: You don't need to load a "read the SIO" routine to boot from the SIO.
The "A" Switchwith LaFarr Stuart, Van Snyder and the implemention by Ron Mak !! :-))
Ron Mak says (about the latest version of ROPE (Ron's Own Programming Environment :-)) Runtime card input tips
- If sense switch A (the "last card switch") is on when your program executes an R instruction, you can do a "branch on last card" instruction like this:
where the branch to "DONE" is taken only if the card reader is empty (i.e., the last card has already been read). Note the "A" d-character.
- If sense switch A is off, then the above branch is never taken, and the machine will immediately halt on an R instruction if the card reader is empty.
- The sense switches are in the CONSOLE window (press the "Show console ..." button in the EXEC window). The sense switches are settable only after your program has started executing, so put in a breakpoint and press the "Start program" button.
Lots of facts - but how to put them together into what/why you are doing this - it boils down to:
an easy way is to
- assume your application has a large number of input cards to read before doing some other processing, such as printing summaries.
- you want to know when the whole input boxes of cards has been read by the card reader - then do the other processing.
- you write your application to terminate input processing (and go to some other phase, such as writing the output summaries) when the card reader input hopper goes empty
- but if you have many input cards ( say more than 2,000 ) you
For most programs after the last data cards were put in the card reader you did have to go to the console to turn on the "A" sense switch (which was only effective when the reader was empty).
You can leave sense switch A on. It's wired up in series with the last- card switch in the card reader. The only reason to turn it off is so you can read an entire deck -- including the last two cards, for which the reader stops so you have to push "start" on the reader to read them -- then look at the output, then put some more cards in the hopper, then keep going.
I agree with you, when you are running relatively small runs, you want the last card to go the summary portion of the program. But, when you literally have many thousand of data cards (at the phone company we had a card for every long-distance call made from or billed to a Las Vegas number) it is almost guaranteed that the card reader will run empty a few times before the job is done. Then it is important to have the "A" Switch off, until you really want to let the run end. IBM knew what they were doing when they designed the A switch function.
Van said (Mar 23, 2010)
LaFarr asserts it is important to leave Sense Switch A off when running a large batch so the program doesn't inadvertently go to its summary processing just because you haven't gotten around to loading the next tray.
It isn't actually necessary to turn off Sense Switch A to avoid this because the card reader stops just before reading the last card. You have to push the Start key on the 1402 to make it read the last card, after which the last card indicator (actually the "no more cards" indicator), which is wired in series with Sense Switch A, comes on. I'm sure this was intentional in the design, precisely for the reason LaFarr gives.
So you can just run with Sense Switch A on all the time. Just don't push Start on the 1402 when the hopper goes empty if you need to load more cards for the same job.
LaFarr said (Mar 25, 2010)
I am sure Van is right.
But at the phone company we had many different girls running the machines, and it was to easy to just push the Start button whenever any machine stopped.
We had a girl run a few thousand cards through a malfunctioning 519 (mark sensing) that was lacing (punching every row in a column) cards. She had to hold the Start button down because it was stopping on every card. --But she kept it going!
return to main page