Key-in loader

All computers have to have some mechansim to load software into them when they are first turned on. Modern computers typically have a ROM or (FLASH ROM) that holds the BIOS, and one of its tasks is to load code after reset, typically reading the first sector from the hard disk into memory and jumping to that code.

The memory on the Series-16 machines is implemented as magnetic core memory, so that programs stored in memory are not lost when the power is removed. This is a property shared with FLASH memory in modern computers. So when the machine is turned on the key-in loader is usually already in memory. The procedure to load a program is to load a Self Loading System Tape (SLST) into the paper-tape reader, set the program counter to location 1 and press start. The key-in loader reads the bootstrap loader from the paper-tape that completes the loading process.

However, sometimes the key-in loader is not in memory or has been corrupted in some way. In this case the loader has to be entered manually from the front-panel, and this process of "keying in" the loader explains its name. The index register, X, shadows location zero in memory, and the next 15 locations are used by the key-in loader. These locations are hardware protected and cannot be overwritten by programs, so it is very unusual to have to enter the key-in loader.

Key-in Loader
Location PTR ASR Assembler Notes
'01 0010057 0010057 STA  '57 Save for later
'02 0030001 0030004 OCP  '000x Start tape running
(or enable ASR input mode)
'03 0131001 0131004 INA  '100x Clear A, input character
'04 0002003 0002003 JMP  *-1 Loop until ready
'05 0101040 0101040 SNZ Read past leader?
'06 0002003 0002003 JMP  *-3 No - read some more
'07 0010000 0010000 STA  0 Set up pointer
'10 0131001 0131004 INA  '100x Clear A, input character
'11 0002010 0002010 JMP  *-1 Loop until ready
'12 0041470 0041470 LGL  8 Shift to upper half
'13 0130001 0130004 INA  '000x Input character
'14 0002013 0002013 JMP  *-1 Loop until ready
'15 0110000 0110000 STA* 0
'16 0024000 0024000 IRS  0 Increment index register
'17 0100040 0100040 SZE Skip over JMP to start of loop
Note The "x" at the end of the I/O instructions is either a '1' for the high speed paper-tape reader, or a '4' for the ASR.

If you are trying to make sense of what this does you need to know that the first non-zero character on the tape always has the value '20 so that this is the value placed in the pointer by the instruction at location '07. The next two characters form the instruction that is placed at location '20 and this is always a jump back into the loader like this:

First instruction of bootstrap loader
Location PTR ASR Assembler Notes
'20 0002010 0002010 JMP  '0010 Loop to read bootstrap

More to do...