1401 Test Tape Loader

The first record on the IBM diagnostics tape contains a loader for the programs on the tape. After the initial load, it halts at 400 (I-address register 404) with the A-address register 433. Pushing start results in another halt at 3000 (I-star 3001). Then if 1277 is

1 The program is loaded if 73-76 ≠ 1273-1276

2 The program is loaded if 73-76 = 1273-1276

3 The program is loaded if 73-74 ≠ 1273-1274

4 The program is loaded if 73-74 = 1273-1274

Else The program isn’t loaded.

This is a routine that checks for errors and starts over at the beginning of the tape when the end-of-file is noticed. It occupies 3000-3498. Pushing start reset and then start after the halt at 400 causes positions 73-76 of tape records after headers to be compared with 1273-1276. It only checks program codes that have no zone in the second character (74). If sense switch F is on, it runs the first program that matches. If sense switch F is off, it runs the first program that doesn’t match. This loader fits on 1400-character machines.

1401 Test Tape and Decks — Revised

Programs can be stacked in the card reader, or run from tape. When run from tape, a program that selects which programs to run, called the chain loader, decides which programs to run based upon parameters pre-loaded into core. When run from cards, the chain loader simply loads the next program. The following are assumed to be in 181-199 when a program, including the tape chain loader, runs:

181  / for “run if target ID not equal to test ID,”

S for “run if target ID equal to test ID,” T for “run if target ID less than test ID,” U for “run if target ID greater than test ID,” Blank for “run everything.” B … G for “run if the specified sense switch is on.”

182  Last digit of address of target and test IDs: 3, 4, 5 or 6. Run everything if blank.
183-186 Target ID.
187-189 Top address to clear, max 3999, use 3999 if last character blank.
190  Print headers if not blank.
191-199 Programs can look here for options.

These can be loaded either from the console switches, or by a one-card loader:

  1     SW   8,12
  8     SW   19
 12     SW   26,30
 19     SW   37,44
 26     SW   45
 30     LCA  63,199         LOAD PARAMETERS
 37     MN   2,81           CLOBBER GM IN CASE LOADING FROM CARDS
 44     H
 45     DCW  #1    181      D MODIFIER FOR TARGET ID TEST
 46     DC   #1    182      LAST DIGIT OF ADDRESS FOR TARGET, 3-6
 47-50  DC   #4    183-186  TARGET ID
 51-53  DC   #3    187-189  TOP ADDRESS TO CLEAR, USE 3999 IF BLANK
 54     DC   #1    190      HEADER PRINTER PRINTS IF NOT BLANK
 55-63  DC   #12   188-199  PROGRAMS CAN LOOK HERE FOR OPTIONS

....5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
,008012,019,026030,037044,045L063199D002081./#ididTTThBCDEFGHIJ  PARAMS     01 A
1      1   1      1      1   1      1      11

It is intended that this would be loaded from the card reader. When it halts, the tests would be loaded either from cards or tape. Core locations 1-80 are cleared before a program is run no matter whether it is run from cards or tape. If programs are run from tape, 100-180 and 200 to the address in 187-189 are also cleared. If 189 is blank, 3999 is used for the top address. If run from cards, core (including the parameter area from 181-199) is cleared if the clear storage cards (the first two produced by Autocoder) are included in the run deck, and not cleared otherwise. The clear storage cards should not be included ahead of the chain loader. Otherwise, every program will be run. Each test block consists of the test program header record, the test program, and its detail records. The first two detail records, which are present even if the program needs no other detail records, are the page headings that are printed if 190 is not blank. Header records are actually little programs that run in 1-80. All other programs are loaded into 201. The last address loaded is limited by the origin of the program that writes programs on tape – 3694 – but programs can use core at higher addresses, for example, for tape input/output areas. When run from cards, several decks can be stacked in the card reader. Each test program loads the next one. Program headers have A in column 80, ID in 73-76, C in 79 for the chain loader, T in 79 for test programs, E in 79 for the end-of-file program, an optional title in 49-71, and the following in 1-27 if it’s not an end-of-file program and the clear storage cards produced by Autocoder are included:

  1  SW   8,15
  8  SW   26,30
 15  B    26
     ORG  26
 26  R    1
 26  DCW  #1
....5...10...15...20...25...30
,008015,026030B026       1001
1      1      1          1   1

which works with all clear routines produced by Autocoder or SPS, or the following in 1-40, which only works for Autocoder programs, if the clear storage cards are removed:

  1  SW   8,15
  8  SW   36,40
 15  B    36
 36  R    1
 26  DCW  #1
....5...10...15...20...25...30...35...40
,008015,036040B036                 1001
1      1      1                    1   1

The program that writes programs onto tape replaces 1-30 by

  1  RTW  1,201
  9  BER  21
 14  CS   ###,80
 21  BSP  1
 26  H    1
 30  DCW  #1

....5...10...15...20...25...30
L%U1201RB018L/###080U%U1B.001
1       1    1      1    1   1

The ### is filled from the entry address on the END card of the program’s object deck. If the header is an end-of-file program, the following is expected in 1-36:

 1  SW   8,15
 8  SW   22,27
15  SW   31,32
22  RWD  1
27  NOP  99
31  H
32  B    1
36  DC   #1
....5...10...15...20...25...30...35.
,008015,022027,031032U%U1RN099.B001
1      1      1      1    1   11

Each program has a routine that reads and prints its page headings if 190 is not blank, and reads its detail records or the header record for the next program. It reads from cards if there are any. Then if there are no cards and 81 is a group mark (the tape drive deposits a group mark in 81 if the program is loaded from tape) it reads them from tape. If a header has A in column 80 the detail-reading routine branches to 1.

    *
    * Halts:
    * 99 in A-star and B-star if no more detail records and no header.
    *    Pushing start tries again.  If reading detail from tape it
    *    is nonetheless possible to read more detail from cards here.
    * 86 in A-star and B-star if tape error.  Pushing start tries again.
    *    It is possible to read more detail from cards here.
    *
              org  336            At 336 to allow chaining CS to W
    headpr    equ  190            Print first two detail if not blank.
336 headct    dcw  0              How many detail read?  Print first 2.
337 taperr    bsp  1              Backspace
342           nop  86             86 if tape error
346           h                   Halt with 86 in A-star and B-star
347 detail    sw   1,81           1 for header, 81 under GM if tape
354           blc  nocard         No cards left?
359           r    testhd         Read a detail or header card
363 nocard    bce  tapehd,81,"    Tape load puts GM in 81
371           b    finis
375 tapeof    bsp  1
380 finis     nop  99             99 if no tape or EOF
384           h                   Halt with 99 in A-star and B-star
385           b    detail         Try again
389 tapehd    rtw  1,1            Read a detail or header tape record
397           ber  taperr         Error?
402           bef  tapeof         Eof?
407 testhd    bce  1,80,a         Execute if a header
415           bce  cont,headct,2  Headers printed yet?
423           bce  skiphd,headpr,  Skip header printing?
431           lca  77,277         Print the first two headers
438           w

 439           cs
 440           cs
 441           w
 442 skiphd    a    *-6,headct
 449           b    detail
 453 cont      equ  *&1
     * Continue here after reading detail

The CONT label is where the program continues if the next record does not have A in column 80. If the program is run from tape, but one wants to read some detail records from cards and then read more from tape, put the following one-card program after the detail records read from cards:

  1  SW   8,15
  8  SW   22,29
 15  LCA  33,358  LCA  33,DETAIL&11
 22  CS   347,80  CS   DETAIL,80
 29  B    363     B    NOCARD
....5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80
,008015,022029L033358/347080B363
1      1      1      1      1

Loading programs onto tape

To write programs on tape, put the program to write programs on tape at the head of the deck. Then put a copy of the chain loader header and chain loader program ahead of each test block. Finally, put an end-of-file header at the end of the deck. The program that loads programs onto tape reads heading cards, programs and detail cards, and writes them to tape. The headers are modified as described above. All records on the tape are written with word marks. The sequence of records for a program block is

Header record Header records are read into 1-80, with word marks. This results in a group mark in 81. The header record loads the program.

Program Programs are written from 201 to their group mark with a word mark, and read into 201 with word marks when they are run. They should therefore not depend upon initializations of core below 201. Also, the parameter block that the chain loader and header printer use, and options that programs might find useful, are in 181-199.

Detail records Other than the page headings, these are optional.

The end-of-file header is not followed by a program or detail records. The sequence of program blocks on the tape is

Chain loader This program reads further on the tape and decides which programs to load and execute. It uses specifications in 181-186 to decide.

Test program This is the program that actually does the tests.

Program Listing – Write Chain Tape

 CLEAR STORAGE 1     ,008015,019026,030,034041,045,053,0570571026                                                 1
 CLEAR STORAGE 2     L068112,102106,113/101099/I99,027A070028)027B0010270B0261,001/001113I0                       2
 BOOTSTRAP           ,008015,022029,036040,047054,061068,072/061039              ,0010011040                      3
                           WRITE CHAIN TAPE                                                               PAGE    1
  SEQ PG LIN  LABEL  OP    OPERANDS                                            SFX CT  LOCN  INSTRUCTION TYPE  CARD
  101                JOB   WRITE CHAIN TAPE

102         *
103         * READ PROGRAM HEADERS, PROGRAMS AND DETAIL CARDS, AND WRITE THEM
104         * ON TAPE 6.  EVERYTHING IS WRITTEN WITH WORD MARKS, SO PROGRAMS
105         * NEED TO READ DETAIL RECORDS WITH WORD MARKS, AND NOT EXPECT
106         * WORD MARKS THEY SET TO BE PRESERVED.  THERE'S A WORD MARK IN 1
107         * FOR DETAIL RECORDS.
108         *
109         * PROGRAM HEADERS HAVE  A  IN COLUMN 80, ID IN 73-76,  C IN 79 FOR
110         * THE CHAIN LOADER, H IN 79 FOR THE PAGE HEADING PRINTING PROGRAM, T
111         * IN 79 FOR TEST PROGRAMS, E IN 79 FOR THE END-OF-FILE PROGRAM, AN
112         * OPTIONAL TITLE IN 49-71, AND THE FOLLOWING IN 1-27 IF IT'S NOT AN
113         * END-OF-FILE PROGRAM:
114         *
115         * ....5...10...15...20...25..
116         * ,008015,022026N0000001001
117         * 1      1      1      1   1
118         *
119         * ON THE TAPE, 1-27 ARE REPLACED BY
120         *
121         * ....5...10...15...20...25..
122         * L%U1201RB018LB###U%U1B.001
123         * 1       1    1   1    1   1
124         *
125         * THE ### IS FILLED FROM THE ENTRY ADDRESS ON THE END CARD OF THE
126         * PROGRAM'S OBJECT DECK.
127         *
128         * IF IT IS AN END-OF-FILE PROGRAM, THE FOLLOWING IS EXPECTED IN 1-36:
129         *
130         * ....5...10...15...20...25...30...35.
131         * ,008015,022027,031032U%U1RN099.B001
132         *
133         * THE SOURCE CODE FOR THIS IS AT THE END OF THIS DECK.
134         *
135         * THE PROGRAM IS WRITTEN ON THE TAPE FROM 201 UP TO ITS GMWM, AND
136         * IS READ BACK INTO 201.  THIS IS TO PRESERVE THE PARAMETER BLOCK
137         * AT 181-199.  THUS, THE PROGRAM SHOULDN'T BOTHER TO LOAD ANYTHING
138         * BELOW THAT.  IN PARTICULAR, IT SHOULDN'T DEPEND UPON INITIALIZING
139         * THE INDEX REGISTERS.
140         *
141         * PROGRAM DECKS ARE IN AUTOCODER FORMAT.
142         * THE PROGRAM CANNOT HAVE A GMWM WITHIN IT.  IF IT HAS NONE AT THE
143         * END, THE ONE JUST BEFORE "HEADER" WILL SERVE.
144         *
145         * THE ENTRY POINT FOR EVERY PROGRAM IS TAKEN FROM THE /XXX080 CARD
146         * AT THE END OF ITS DECK.
147         *
148         * HALTS IDENTIFIED BY A/B-STAR CONTENTS:
149         * 111 => TAPE WRITE ERROR, START WRITES BLANK TAPE AND RETRIES
150         * 666 => FIRST CARD IS NOT A HEADER, START READS ANOTHER
151         * 999 => DONE, START LOOPS ON THE HALT
152         *
153         SYSTP  EQU   %U6                                                         %U6
154         *
155         START  R                                                              1  0333  1                    4
156                BCE   HEADER,80,A   IS IT A HEADER                             8  0334  B G26 080 A          4
157                NOP   666                                                      4  0342  N 666                4
158                H                                                              1  0346  .                    4
159                B     START                                                    4  0347  B 333                4
160         *
161         * THIS GMWM IS FOR WRITING DETAIL RECORDS.
162         *
163                ORG   81                                                                 0081
164                DCW   @"@                                                      1  0081                       5
165         *
166         * THIS GMWM IS FOR WRITING HEADERS.
167         *
168                ORG   181                                                                0181
169                DCW   @"@                                                      1  0181                       6
170         *
171         * SOME CONSTANTS
172         *
173                ORG   3692                                                               3692
174         GMWM   DCW   @"@                                                      1  3692                       7
175                ORG   *&X00                                                              3700
176                ORG   *-100                                                              3600
177         BCLEAR EQU   *                                                           3599
178                ORG   GMWM&1                                                             3693
179         KCLEAR DSA   BCLEAR                                                   3  3695  E99                  7
180         * TAPE LOADER TO PUT IN THE HEADER THAT'S WRITTEN ON TAPE
181                RTW   1,201                                                    8  3696  L %U1 201 R          7
182                BER   21                                                       5  3704  B 021 L              7
183         ENTRY  CS    345,80                                                   7  3709  / 345 080            7
184                BSP   1                                                        5  3716  U %U1 B              7
185                H     1                                                        4  3721  . 001                7
186         TAPLDR DCW   #1                                                       1  3725                       8

187         *
188         * SAVE THE HEADER IN 101-180
189         *
190         HEADER SW    1,201        SET UP FOR AUTOCODER FORMAT, CLEAR          7  3726  , 001 201            8
191                LCA   80,180                                                   7  3733  L 080 180            8
192                BCE   WHEAD,79,E   END-FILE RECORD?                            8  3740  B H82 079 E          8
193         *
194         * LOAD AN AUTOCODER-FORMAT PROGRAM INTO LOW MEMORY.  ALL LOAD
195         * CARDS HAVE "1040" IN 68-71.
196         *
197                MCW   KCLEAR,CLEAR&3                                           7  3748  M F95 G62            8
198                CS    GMWM-1                                                   4  3755  / F91                8
199         CLEAR  CS    0-0                                                      4  3759  / 000                8
200                SW    CLEAR&1                                                  4  3763  , G60                9
201                A     @I0@,CLEAR&2  SUBTRACT 100 FROM CLEAR ADDRESS            7  3767  A I99 G61            9
202                CW    CLEAR&1                                                  4  3774  ) G60                9
203                BW    CLEAR,201    CLEAR MORE IF NOT ALL DONE                  8  3778  V G59 201 1          9
204         SKIP   R                  SKIP CLEAR CORE CARDS                       1  3786  1                    9
205                BCE   LOAD,68,1    BOOTSTRAP CARD?                             8  3787  B G99 068 1          9
206                B     SKIP                                                     4  3795  B G86                9
207         LOAD   MCW   RBACK,71     SETUP TO COME BACK TO LOADR                 7  3799  M H23 071           10
208                B     1            RUN BOOTSTRAP CARD TO SET WORD MARKS        4  3806  B 001               10
209         LOADL  MCW   RBACK,71     SETUP TO COME BACK TO LOADR                 7  3810  M H23 071           10
210                B     40           LOAD THE CARD                               4  3817  B 040               10
211         RBACK  DSA   LOADR                                                    3  3823  H24                 10
212         LOADR  BCE   LOADZ,40,/                                               8  3824  B H40 040 /         10
213                BCE   LOADL,68,1   LOAD THE CARD                               8  3832  B H10 068 1         11
214         *
215         * THE WHOLE PROGRAM HAS BEEN READ.  WRITE THE HEADER.
216         *
217         LOADZ  MCW   43,ENTRY&3                                               7  3840  M 043 G12           11
218                CS    80           CLEAR AUTOCODER LOADER'S WORD MARKS         4  3847  / 080               11
219                LCA   TAPLDR,130   OVERLAY THE HEADER'S CARD LOADER            7  3851  L G25 130           11
220                CHAIN 5                                                                             MACRO
221                LCA                                                            1  3858  L           GEN     11
222                LCA                                                            1  3859  L           GEN     11
223                LCA                                                            1  3860  L           GEN     11
224                LCA                                                            1  3861  L           GEN     12
225                LCA                                                            1  3862  L           GEN     12
226                B     WHEAD                                                    4  3863  B H82               12
227         WHEADE BSP   SYSTP                                                    5  3867  U %U6 B             12
228                NOP   111                                                      4  3872  N 111               12
229                H                                                              1  3876  .                   12
230                SKP   SYSTP        WRITE BLANK TAPE                            5  3877  U %U6 E             12
231         WHEAD  WTW   SYSTP,101    WRITE THE HEADER                            8  3882  L %U6 101 W         13
232                BER   WHEADE       ERROR                                       5  3890  B H67 L             13
233                BCE   DONE,179,E   END FILE PROGRAM?                           8  3895  B I84 179 E         13
234                B     LOADW                                                    4  3903  B I22               13
235         *
236         * ERROR HANDLER FOR WRITING THE PROGRAM
237         *
238         LOADE  BSP   SYSTP        ERROR HANDLER                               5  3907  U %U6 B             13
239                NOP   111                                                      4  3912  N 111               13
240                H                                                              1  3916  .                   13
241                SKP   SYSTP                                                    5  3917  U %U6 E             14
242         *
243         * WRITE THE PROGRAM
244         *
245         LOADW  WTW   SYSTP,201    WRITE THE PROGRAM                           8  3922  L %U6 201 W         14
246                BER   LOADE                                                    5  3930  B I07 L             14
247                SW    1            SO PROGRAMS CAN ASSUME IT                   4  3935  , 001               14
248         *
249         * WRITE DETAIL CARDS WITH WORD MARKS.
250         *
251         DETAIL R                                                              1  3939  1                   14
252                BCE   HEADER,80,A  IS IT A HEADER?                             8  3940  B G26 080 A         14
253         DETLW  WTW   SYSTP,1                                                  8  3948  L %U6 001 W         14
254                BER   DETLE                                                    5  3956  B I65 L             15
255                B     DETAIL                                                   4  3961  B I39               15
256         DETLE  BSP   SYSTP                                                    5  3965  U %U6 B             15
257                NOP   111                                                      4  3970  N 111               15
258                H                                                              1  3974  .                   15
259                SKP   SYSTP                                                    5  3975  U %U6 E             15
260                B     DETLW                                                    4  3980  B I48               15
261         *
262         * WRITE AN END-OF-FILE PROGRAM
263         *
264         DONE   WTM   SYSTP                                                    5  3984  U %U6 M             16
265         DONEL  NOP   999                                                      4  3989  N 999               16
266                H                                                              1  3993  .                   16
267                B     DONEL                                                    4  3994  B I89               16
268                LTORG                                                                    3998
                   DCW   @I0@                                                     2  3999              LIT     16
269                JOB   END-OF-FILE PROGRAM
270         *

271         * THE END-OF-FILE PROGRAM
272         *
273                ORG   1                                                                  0001
274                SW    A,B                                                      7  0001  , 008 015           17
275         A      SW    C,D                                                      7  0008  , 022 027           17
276         B      SW    E,F                                                      7  0015  , 031 032           17
277         C      RWD   1                                                        5  0022  U %U1 R             17
278         D      NOP   099                                                      4  0027  N 099               17
279         E      H                                                              1  0031  .                   17
280         F      BIN   1,                                                       5  0032  B 001               17
281                JOB
282                END   START                                                             / 333 080
SYMBOL  ADDRESS  SYMBOL  ADDRESS  SYMBOL  ADDRESS  SYMBOL  ADDRESS  SYMBOL  ADDRESS  SYMBOL  ADDRESS  SYMBOL  ADDRESS
A           8    B          15    BCLEAR   3599    C          22    CLEAR    3759    D          27    DETAIL   3939
DETLE    3965    DETLW    3948    DONE     3984    DONEL    3989    E          31    ENTRY    3709    F          32
GMWM     3692    HEADER   3726    KCLEAR   3695    LOAD     3799    LOADE    3907    LOADL    3810    LOADR    3824
LOADW    3922    LOADZ    3840    RBACK    3823    SKIP     3786    START     333    SYSTP   %U6      TAPLDR   3725
WHEAD    3882    WHEADE   3867

Program Listing – Chain Loader

CLEAR STORAGE 1     ,008015,019026,030,034041,045,053,0570571026                                                 1
CLEAR STORAGE 2     L068112,102106,113/101099/I99,027A070028)027B0010270B0261,001/001113I0                       2
BOOTSTRAP           ,008015,022029,036040,047054,061068,072/061039              ,0010011040                      3
                         CHAIN LOADER                                               CHAIN               PAGE    1
SEQ PG LIN  LABEL  OP    OPERANDS                                            SFX CT  LOCN  INSTRUCTION TYPE  CARD
101                JOB   CHAIN LOADER
102         *
103         * IF RUN FROM CARDS, JUST LOAD THE NEXT PROGRAM.
104         *
105         * OTHERWISE, LOAD THE PROGRAM SELECTED BY PARAMETERS IN
106         * 181-186.  CLEAR FROM 100-180 AND 200 TO THE ADDRESS IN
107         * 187-189.  IF 189 IS BLANK, USE 3999 FOR THE TOP ADDRESS
108         * TO CLEAR
109         *
110         * STOPS:
111         * 86 IN A-STAR AND B-STAR ON READ ERRORS.
112         * 99 IN A-STAR AND B-STAR ON END OF FILE.
113         *
114         * FIELDS IN HEADER RECORDS
115         *
116         ISHEAD EQU   80  A = FOR HEADER                                          0080
117         HEADTP EQU   79  T = TEST, C = CHAIN, H = PRINT, E = EOF                 0079
118         HEADID EQU   76                                                          0076
119         *
120         * RESERVED MEMORY TO CONTROL THE CHAIN LOADER AND EACH PROGRAM.
121         * THE LOW-ORDER DIGIT OF THE ADDRESS OF TARGID MUST BE SIX.
122         *
123         TARGEQ EQU   181  / FOR 'RUN TARGET IF UNEQUAL,'                         0181
124         *                 S FOR 'RUN TARGET IF EQUAL,'
125         *                 T FOR 'RUN IF TARGET ID LESS THAN TEST ID,'
126         *                 U FOR 'RUN IF TARGET ID GREATER THAN TEST ID,'
127         *                 B...G FOR 'RUN IF THE SPECIFIED SENSE SWITCH
128         *                       IS ON.'
129         *                 BLANK FOR UNCONDITIONAL
130         TARGNC EQU   182  LAST DIGIT OF TARGET ADDRESS 3-6                       0182
131         TARGID EQU   186  TARGET ID                                              0186
132         TOPADR EQU   189  TOP ADDRESS TO CLEAR, MAX 3999                         0189
133         *
134                ORG   201                                                                0201
135         *
136         * LOAD THE PROGRAM.  CLEAR CORE, EXCEPT FOR PARAMETER AREA, FIRST.
137         *
138                ORG   201                                                                0201
139         LOAD   SW    300             DONE WHEN THIS IS CLEARED                4  0201  , 300                4
140                LCA   TOP4K,CLEAR&3   DEFAULT TOP ADDRESS TO CLEAR             7  0205  L 263 234            4
141                BCE   CLEARL,TOPADR,  USE DEFAULT IF PARAMETER BLOCK BLANK     8  0212  B 227 189            4
142                MCW   TOPADR,CLEAR&4                                           7  0220  M 189 235            4
143         CLEARL CW    CLEAR&1                                                  4  0227  ) 232                4
144         CLEAR  CS    0-0            CLEAR A HUNDRED                           4  0231  / 000                4
145                SW    CLEAR&1                                                  4  0235  , 232                4
146                A     @I0@,CLEAR&2   SUBTRACT A HUNDRED                        7  0239  A 265 233            5
147                BW    CLEARL,300     MORE TO DO?                               8  0246  V 227 300 1          5
148                CS    1,299          CLEAR ME AND RUN THE HEADER               7  0254  / 001 299            5
149         TOP4K  DSA   3999                                                     3  0263  I99                  5
150                LTORG *                                                                  0264
                   DCW   @I0@                                                     2  0265              LIT      5
151         *
152         * START HERE