       ttl                    Dartmouth Time-Sharing System 235 Executive  00001
       stl                    Initial Loader                               00002
       loc 34000              Date of latest reassembly goes here          00003
#date  bss 0                                                               00004
       oct 1032               Update August 26, 1965 [RPL]                 00005
                                                                           00006
                                                                           00007
                                                                           00008
                        Dartmouth College Time-Sharing System              00009
                                                 235 Executive             00010
                                                                           00011
                        Richard P. Lacey [67]  April 1965 -                00012
                        John S. McGeachie [65]  April 1964 - April 65      00013
                                                                           00014
                        Phase IV                                           00015
                          For 44 teletype disk allocation of July 13,      00016
                          1965.                                            00017
                                                                           00018
                                                                           00019
                        16K Loader - will load 16K GAP cards into          00020
                        upper or lower memory. Accepts single or           00021
                        multiple origin cards and octal corrections.       00022
                        Octal corrections may be single or multiple        00023
                        origin. Scan terminated by single character        00024
                        field.                                             00025
                        Author Charles G. Moore [65]                       00026
                                                                           00027
                                                                           00028
       loc 3000                                                            00029
#r     bss 42                 read-in area                                 00030
#rw    bss 41                 analyze area                                 00031
octacc bss 1                  working storage for octal corrections        00032
octadd bss 1                                                               00033
#wdct  oct 2017777            mask to leave address and sign bit           00034
#R2    dec #rw                card move constants                          00035
       dec -40                                                             00036
#mc    dec 2                  memory clear constants                       00037
       dec -1533                                                           00038
#mc1   dec #last+1                                                         00039
       dec -12286                                                          00040
#addr  oct 1760000            address correction mask                      00041
#8k    dec 8192                                                            00042
octc   oct 3776000            octal correction mask                        00043
#load1 ldz                    check switch 19 for memory clear             00044
       sta #last              clear to contents of switches                00045
       sta 1                                                               00046
       ldx 8k      2          get upper bit                                00047
       lda #date   2          and save date                                00048
       sta #x3sv                                                           00049
       dld #mc                                                             00050
       mov 1                                                               00051
       rcs                    Check if clear later part                    00052
       sta #sflag             Set systems flag                             00053
       bod                                                                 00054
       bru #load              No                                           00055
       dld #mc1                                                            00056
       mov #last                                                           00057
       ldx #8k     1          Restore at earliest                          00058
       lda #x3sv                                                           00059
       sta #date   1          opportunity                                  00060
#load  rcb #r                 Read first card - fill buffer                00061
       hcr                    but is loaded normally                       00062
       ldz                    Make sure we start in lower bank             00063
       sta #x3sv                                                           00064
#r1    dld #r2                Normal entrance for card read                00065
       bcn                                                                 00066
       bru *-1                Wait for reader ready                        00067
       mov #r                 and then move from read buffer               00068
       sta #rw+40             Set zero to end of card image                00069
       ldx #zf     1          Set up for scan                              00070
       ldx #x3sv   3          Restore X3                                   00071
       lda #rw     1          RW is working area - get control word        00072
       bze                                                                 00073
       bru #oct                                                            00074
       ext #wdct                                                           00075
       bze                                                                 00076
       bru #t                                                              00077
       rcb #r                                                              00078
       hcr                                                                 00079
       sra 13                                                              00080
#ze    sta 0                                                               00081
       lda #rw     1                                                       00082
       ext #addr              Leave address and sign bit                   00083
       bmi                    If upper 8k add index bit                    00084
#dart2 bru #dart1             First Dartmouth-style card found             00085
       sto 3                  Otherwise, GAL convention                    00086
#ret   inx 1       1          is return for each word in string            00087
       lda #rw     1                                                       00088
       sta 0       3          Put it away                                  00089
       add #rw-1   1          totaling for checksum                        00090
       bov                                                                 00091
       ado                                                                 00092
       sta #rw     1          Save present checksum                        00093
       inx -1      0          Bump down word counter                       00094
       inx 1       3          and bump up address counter - put away       00095
       bxh 1       0          and check for end of string                  00096
       bru #ret               If not, put away another word                00097
       sub #rw+1   1                                                       00098
       bze                    Check checkword                              00099
       bru *+3                                                             00100
       lda #rrr               If not, set up for error halt                00101
       bru *                  Recover is backspace A-I start               00102
       inx 2       1                                                       00103
       lda #rw     1                                                       00104
       ext #wdct                                                           00105
       bnz                                                                 00106
       bru #ze-1                                                           00107
#rrr   bru #r1                Go get another card                          00108
#t     lda #rw     1          Get transfer address                         00109
       bmi                                                                 00110
#dart3 ldx #8k     3          If first Dartmouth-style, do not panic       00111
       sto 3                  Else GAL                                     00112
       lda #sflag             Save systems flag                            00113
       sta sload                                                           00114
       bru 0       3          exit                                         00115
       add #8k                                                             00116
#dart1 lda *-1                Set instructions for Dartmouth style         00117
       sta #dart2                                                          00118
       sta #dart3             Reset transfer                               00119
       lda octe+1                                                          00120
       sta #dart2+1                                                        00121
       sta #dart3+1                                                        00122
       bru #ze+1              Get back                                     00123
                                                                           00124
                        Free-form octal corrections -                      00125
                                                                           00126
#oct   rcb #r                                                              00127
       hcr                                                                 00128
       ldx #ze     2                                                       00129
       stx #x3sv   3          Save index register 3                        00130
       bru octe                                                            00131
octb   sra 10                                                              00132
       ext octc               Get left half of word, and dump rest         00133
       nor 16                                                              00134
       sla 1                                                               00135
       lda octacc                                                          00136
       bov                    If overflow, there is a word                 00137
       bru octd                                                            00138
       bxl 2       3                                                       00139
       bru octe                                                            00140
       bxl 3       3                                                       00141
       bru #r1                Single character field - get out             00142
       bxh 7       3                                                       00143
       bru octf                                                            00144
       sta octadd             Or address                                   00145
octe   ldz                                                                 00146
       sta 3                                                               00147
       lqa                                                                 00148
       bru octa-1                                                          00149
octd   sld 3                                                               00150
       ext 0                                                               00151
       bno                                                                 00152
       chs                                                                 00153
       sta octacc                                                          00154
octa   inx 1       3                                                       00155
       bxh 40      1                                                       00156
       bru #r1                Card finished                                00157
       lda octc                                                            00158
       lqa                                                                 00159
       lda #rw     1                                                       00160
       bxl 1       2                                                       00161
       spb octb    2                                                       00162
       inx 1       1                                                       00163
       ldx #ze     2                                                       00164
       bru octb+1                                                          00165
octf   ldx octadd  3                                                       00166
       sta 0       3                                                       00167
       inx 1       3                                                       00168
       stx octadd  3                                                       00169
       bru octf                                                            00170
#x3sv  bss 1                  X 3 temporary save                           00171
#sflag bss 1                  Systems temporary flag                       00172
#last  equ *                                                               00173
       tcd #load1                                                          00174
                                                                           00175
       stl                    Disk loader for systems and executive        00176
       ejt                                                                 00177
                                                                           00178
                        Load checks switch 7 - if down, then no            00179
                        billing is desired, so KBILL and IREC are          00180
                        inhibited.                                         00181
                        - if up, billing is desired.                       00182
                                                                           00183
                                                                           00184
                        The SRES sequence performs a series of             00185
                        checks to insure that                              00186
                        1] the SPR switch is set to the all position       00187
                        2] the disk is clear                               00188
                            and the 6k mod is working                      00189
                        3] the console switches are reset                  00190
                        4] the AAU is ready                                00191
                        If any of the above conditions fail to             00192
                        be true, the console typewriter will type          00193
                        a message to the operator and continue to          00194
                        do so until the condition has been corrected.      00195
                                                                           00196
                        5] SRES also checks the batch flag. If on,         00197
                        it crumps the switch check and sets up an          00198
                        entry into the batch overlay in the task           00199
                        list.                                              00200
                        6] It reads in the summary record from the         00201
                        disk and resets it to zero if the bootstrap was    00202
                        typed on TTY 1.                                    00203
                                                                           00204
       loc 1000                                                            00205
load   bss 0                                                               00206
       ton                                                                 00207
       sxg 0                  Set zero in case switch bad                  00208
       ldx 8k      3                                                       00209
       lmo                    Set disk flag 2 on                           00210
       sta dkflg2                                                          00211
       ldz                    and set address for relinquish               00212
       sta relad   3                                                       00213
       rcs                    Check billing switch                         00214
       ext $bmsk              billing mask - oct 3767777                   00215
       sta $bf                and set in flag                              00216
       bnz1                                                                00217
       bru *+4                Billing not set                              00218
       spb $ertyp  2          Billing flag on                              00219
       dec bon                                                             00220
       bru sres                                                            00221
       spb $ertyp  2          Billing flag off                             00222
       dec boff                                                            00223
       lda $nob               Inhibit KBILL and IREC                       00224
       sta kbill   3                                                       00225
       sta irec    3                                                       00226
                                                                           00227
sres   sxg 0                                                               00228
       set pbk                and prevent interrupts                       00229
       lda sign                                                            00230
       sta pmbx0                                                           00231
       ton                                                                 00232
       ldz                    Now find out what group we are in            00233
       sta xr01                                                            00234
       sta z1                                                              00235
       spb *+1     1                                                       00236
       lda xr01                                                            00237
       bnz                                                                 00238
       bru saok               Ok, neither API not Trap                     00239
       lda z1                 API...                                       00240
       bnz                                                                 00241
       set pst                yes, exit                                    00242
       set pbk                                                             00243
       set trpmode                                                         00244
       set ntpmode                                                         00245
       ldx zero    2          and exit                                     00246
       bru *+1     2                                                       00247
saok   sxg 5                  continue                                     00248
       ldx 8k      3          Set upper 8k bit on                          00249
       ldx zero    1          Test SPB switch                              00250
       spb *+1     1                                                       00251
       bxh 1       1          If 1 is higher than 1, then SPB switch is    00252
       bru *+6                set to all, else it is at 0                  00253
       sxg 0                  set 0                                        00254
       ldx 8k      3          Upper 8k bit on                              00255
       spb $ertyp  2                                                       00256
       dec rspb               Reset SPB switch to all                      00257
       bru sres               Go back and test again                       00258
       bar bar     7          See how AAU is                               00259
       bru *+4                                                             00260
       spb $ertyp  2                                                       00261
       dec raau               Loafing                                      00262
       bru sres               and check again                              00263
       spb $dkstst 2          Get disk                                     00264
       lda loadf              Check for card load                          00265
       bmi                    If load flag on,                             00266
       bru loadc              then punt message this time                  00267
                                                                           00268
                        If batch bootstrap do not bring in the summary     00269
       lda sbak               See if batch                                 00270
       bpl                                                                 00271
       bru *+12                                                            00272
       lda sbak+1             See if have a front                          00273
       sta io1                minus if a front card was around             00274
       dld .sres.             Batch - so set up return                     00275
       dst iplst   3                                                       00276
       dld bsums1             Get summary back                             00277
       mov bsums                                                           00278
       lac                    Compute batch running time                   00279
       sub otim1t  3                                                       00280
       add fkbat                                                           00281
       sta fkbat                                                           00282
       bru skex               and get out                                  00283
                                                                           00284
                        procede with normal bootstrap                      00285
       sel 0                                                               00286
       prf         0          Position for efficiency record               00287
       oct 402                                                             00288
       bcs brn     0                                                       00289
       bru *-1                                                             00290
       sel 0                                                               00291
       rrd 1       0                                                       00292
       dec fclock                                                          00293
       bcs brn     0          Wait                                         00294
       bru *-1                                                             00295
       bcs ber     0                                                       00296
       bru *-11                                                            00297
       lda sign               Reset special mailbox to normal status       00298
       sta pmbx0                                                           00299
       lda fclock             Check starting time                          00300
       bnz                    If not zero, then regular bootstrap          00301
       bru soak2              so skip initialization                       00302
       dld fclear             If zero, clear summary area                  00303
       mov fclock                                                          00304
       sta acrun                                                           00305
       sta acswap                                                          00306
       sta acdisk             Initialize accumulated time counts           00307
       sta acbat                                                           00308
       lac                    Get starting time                            00309
       sta fclock                                                          00310
       sta acstrt                                                          00311
       spb $time   2                                                       00312
                        Pick up starting times for short-run summary       00313
       dst fstim                                                           00314
       dst astim2             Long run summary                             00315
       sel 0                  Rewrite on disk                              00316
       prf         0                                                       00317
       oct 402                                                             00318
       bcs brn     0                                                       00319
       bru *-1                                                             00320
       sel 0                                                               00321
       wrf 1       0                                                       00322
       dec fclock                                                          00323
       bcs brn     0                                                       00324
       bru *-1                                                             00325
       bcs ber     0                                                       00326
       bru *-11                                                            00327
soak2  ldx zero    1          Reset flag                                   00328
       lda f4      1          and transmit summary so far to accumulator   00329
       sta fkedit  1                                                       00330
       inx 1       1          Step count                                   00331
       bxl fkbat-f31          and test if done                             00332
       bru *-4                No                                           00333
       lda ohzyf   3                                                       00334
       sta bzyf                                                            00335
                                                                           00336
                        Further checks to make sure system is working      00337
       ldz                    Check for switch 1 down                      00338
       bcs                                                                 00339
       bze                                                                 00340
       bru *+3                                                             00341
       spb $ertyp  2                                                       00342
       dec res                Reset switches                               00343
       lda exec2+1 3          Check 6K mod on disk                         00344
       sub 1025               Left in from bootstrap                       00345
       bnz                                                                 00346
       Bru *+4                OK                                           00347
       spb $ertyp  2                                                       00348
       dec sdsd                                                            00349
       bru load1              Try again                                    00350
       lda $bf                Billing flag                                 00351
       bnz                                                                 00352
       bru stime              Not on, crump                                00353
sboot  spb $twait  2          Wait for tape                                00354
       bru *-1                Try again                                    00355
       sel 1                  If OK, write                                 00356
       wtb boot    0          Bootstrap message                            00357
       dec 30                 Different length                             00358
       spb $twait  2          Check again                                  00359
       bru sboot              Try again                                    00360
       bru stime              Get around buffer                            00361
stime  spb $time   2                                                       00362
       sta d1                 Store it in done statement                   00363
       laq                                                                 00364
       sta d1+1                                                            00365
       spb $ertyp  2                                                       00366
       dec d                                                               00367
       lda tmm                Temporary malfunction                        00368
       sta mbx1                                                            00369
       lda kermes             Error message                                00370
       sta mbx0                                                            00371
                                                                           00372
skex   spb $relin  2          Get rid of the disk                          00373
       ldx zero    2                                                       00374
       lda pmbx0              Wait for d-30 to answer                      00375
       bmi                                                                 00376
       bru *+5                                                             00377
       inx 1       2          See how long he takes                        00378
       ldx zero    1          Waste time                                   00379
       bxl 8190    2                                                       00380
       bru *-6                2/3 of a second                              00381
       kon                    Go on with load                              00382
       oct 2506014            Priority request                             00383
       bru wait    3          Get out                                      00384
                                                                           00385
                                                                           00386
$relin bru relin   3                                                       00387
$time  bru time    3                                                       00388
                                                                           00389
                                                                           00390
                                                                           00391
$twait lda dtime              Get inteval                                  00392
       bcs btr     1          If tape ready                                00393
       bru 2       2          return OK                                    00394
       maq                    Save count                                   00395
       rcs                    Check switches                               00396
       sra 19-7               and check switch 7                           00397
       bod                                                                 00398
       bru stime              If down, punt                                00399
       laq                    Else keep counting                           00400
       sbo                    else count                                   00401
       bpl                                                                 00402
       bru $twait+1           Still OK                                     00403
       stx $temp   2          Save register                                00404
       spb $ertyp  2          and type message                             00405
       dec $tpnr              Tape not ready                               00406
       ldx $temp   2          Get register                                 00407
       bru 1       2          and bad return                               00408
                                                                           00409
                                                                           00410
                                                                           00411
$ertyp ldx zero     0         Initialize coutner                           00412
       lda 1       2          and get address of message                   00413
       sta temp                                                            00414
       ldx temp    1                                                       00415
       ton                    Turn on typewriter                           00416
       bnr                    and check if ready                           00417
       bru $type1                                                          00418
       inx 1       0          Count                                        00419
       bxl 8190    0                                                       00420
       bru *-4                and keep trying                              00421
       bru 2       2          Exit if not ready                            00422
                                                                           00423
$type1 lda 0       1          Get word                                     00424
       ext sign               and get rid of sign                          00425
       srd 12                 Get most in Q                                00426
       inx 1       1          and step pointer                             00427
       ldx zero    0          Reset counter                                00428
                                                                           00429
$type  stx temp    0          Save character pointer                       00430
       bnn                    and wait for ready                           00431
       bru *-1                                                             00432
       inx 1       0          Step counter                                 00433
       bxl 100     0          Stupid typewriter - IBM equipment            00434
       bru *-4                Make sure ready 50 times before using        00435
       ldx temp    0          Restore character pointer                    00436
       cab peom               and check for end of message                 00437
       bru *+2                no                                           00438
       bru 2       2          Exit                                         00439
       san 6                  else type                                    00440
       typ                                                                 00441
       inx 1       0          Step character counter                       00442
       bxh 3       0          One word typed...                            00443
       bru $type1             yes                                          00444
       sld 6                  Get next character                           00445
       bru $type              and type it                                  00446
                                                                           00447
                                                                           00448
$tpnr  bss 0                  Tape controller not ready.                   00449
       oct 373772             Tape controller not ready                    00450
       alf tap                Make sure handler 0 has a scratch tape       00451
       alf e c                and is on remote.  Then clear controller     00452
       alf ont                                                             00453
       alf rol                                                             00454
       alf ler                                                             00455
       alf  no                                                             00456
       alf t r                                                             00457
       alf ead                                                             00458
       oct 701537                                                          00459
       oct 754421                                                          00460
       alf ke                                                              00461
       alf sur                                                             00462
       alf e h                                                             00463
       alf and                                                             00464
       alf ler                                                             00465
       alf  0                                                              00466
       alf has                                                             00467
       alf  a                                                              00468
       alf scr                                                             00469
       alf atc                                                             00470
       alf h t                                                             00471
       alf ape                                                             00472
       alf  an                                                             00473
       alf d i                                                             00474
       alf s o                                                             00475
       alf n r                                                             00476
       alf emo                                                             00477
       alf te.                                                             00478
       oct 376330                                                          00479
       alf en                                                              00480
       alf cle                                                             00481
       alf ar                                                              00482
       alf con                                                             00483
       alf tro                                                             00484
       alf lle                                                             00485
       oct 513355                                                          00486
                                                                           00487
                        Messages                                           00488
                                                                           00489
res    bss 0                  Reset switches                               00490
       oct 374124                                                          00491
       alf set                                                             00492
       alf  sw                                                             00493
       alf itc                                                             00494
       alf hes                                                             00495
       oct 557777                                                          00496
                                                                           00497
rspb   bss 0                  Set SPB switch to all                        00498
       oct 376225                                                          00499
       alf t s                                                             00500
       alf pb                                                              00501
       alf swi                                                             00502
       alf tch                                                             00503
       alf  to                                                             00504
       alf  al                                                             00505
       oct 435577                                                          00506
                                                                           00507
boot   bss 0                                                               00508
       oct 2606060                                                         00509
       oct 557755             Special pattern                              00510
       alf boo                                                             00511
       alf tst                                                             00512
       alf rap                                                             00513
       alf  no                                                             00514
       oct 333535                                                          00515
       alf                                                                 00516
       alf                                                                 00517
       alf                                                                 00518
       alf ---                                                             00519
       alf                                                                 00520
                                                                           00521
d      bss 0                  End load   Date and time.                    00522
       oct 372545                                                          00523
       alf d l                                                             00524
       alf oad                                                             00525
       alf                                                                 00526
date   alf                                                                 00527
       alf                                                                 00528
       alf                                                                 00529
       alf                                                                 00530
       alf                                                                 00531
       alf   t                                                             00532
       alf ime                                                             00533
d1     alf                    Time goes in these two locations             00534
       alf                                                                 00535
       alf  ho                                                             00536
       alf urs                                                             00537
       oct 373755                                                          00538
       oct 2606060                                                         00539
                                                                           00540
bon    bss 0                  Billing flag set to bill                     00541
       oct 372231                                                          00542
       alf lli                                                             00543
       alf ng                                                              00544
       alf fla                                                             00545
       alf g s                                                             00546
       alf et                                                              00547
       alf to                                                              00548
       alf bil                                                             00549
       oct 433355                                                          00550
                                                                           00551
boff   bss 0                  Flag set for no bill                         00552
       oct 372643                                                          00553
       alf ag                                                              00554
       alf set                                                             00555
       alf  fo                                                             00556
       alf r n                                                             00557
       alf o b                                                             00558
       alf ill                                                             00559
       oct 335577                                                          00560
                                                                           00561
sdsd   bss 0                                                               00562
       alf som                                                             00563
       alf e f                                                             00564
       alf ool                                                             00565
       alf  ch                                                             00566
       alf ang                                                             00567
       alf ed                                                              00568
       alf the                                                             00569
       alf  6K                                                             00570
       alf  mo                                                             00571
       alf d s                                                             00572
       alf wit                                                             00573
       oct 233037                                                          00574
       oct 557777                                                          00575
                                                                           00576
raau   bss 0                  AAU loafing                                  00577
       alf aau                                                             00578
       alf  lo                                                             00579
       alf afi                                                             00580
       alf ng.                                                             00581
       oct 373755                                                          00582
       ejt                    Page 19                                      00583
                        The main body of the executive is first put        00584
                        on the disk.  The 16K loader is then               00585
                        re-entered to read in the executive                00586
                        overlays, each of which is put on the disk         00587
                        in turn.  The last overlay is followed by two      00588
                        transfer cards, the second of which transfers      00589
                        to the SRES routine which types out the            00590
                        DONE message to signify loading has been           00591
                        completed.                                         00592
                                                                           00593
                                                                           00594
loadc  ldz                    Reset load flag                              00595
       sta loadf                                                           00596
       lda sload              Check system flag                            00597
       bpl                    If not on,                                   00598
       bru lself              Load executive                               00599
       dld .set.              Set up linkage                               00600
       dst iplst   3          Set in list                                  00601
       set pst                Just in case                                 00602
       oct 2506014            SET PRQ                                      00603
       bru wait    3          and scram                                    00604
                                                                           00605
set    dld unset              delete entry                                 00606
       dst iplst   3                                                       00607
       inx sys     2          and set for system                           00608
       bru perget  3                                                       00609
                                                                           00610
                        write bootstrap on the disk                        00611
lself  bcs brn     0          Put loader on the disk first                 00612
       bru *-1                                                             00613
       sel 0                                                               00614
       prf                    Position                                     00615
       oct 2476               Disk 0, Position 5, Record 31                00616
       bcs brn     0                                                       00617
       bru *-1                                                             00618
       sel 0                                                               00619
       wrf 1       0                                                       00620
       dec load1              Loader                                       00621
       bcs brn     0                                                       00622
       bru *-1                                                             00623
       bcs ber     0                                                       00624
       BRU *-11                                                            00625
       lda mask6              Convert loader to write executive on disk    00626
       sra 3                  Place a 37 in highorder bits                 00627
       ory load2                                                           00628
       ory load3                                                           00629
       lda zero                                                            00630
       sta in                 Zero out some critical locations             00631
       sta mbx0                                                            00632
       lda $bldv              Pick up branch and overwrite bootstrap       00633
       sta ltrans                                                          00634
       bru load1                                                           00635
                                                                           00636
                                                                           00637
loadov ldz                    Clear overlay areas                          00638
       sta execove 3                                                       00639
       dld ovclr                                                           00640
       mov execov                                                          00641
       sxg 0                  Set zero for loader                          00642
       bru #load              and reenter it                               00643
                                                                           00644
                                                                           00645
lovwrt bss 0                                                               00646
       sxg 5                                                               00647
       ldx 8k      3                                                       00648
       ldx pernum+12          Pick up overlay address pointer              00649
       lda 2       2                                                       00650
       bmi                    If negative, error, so crump works           00651
       bru *                                                               00652
       sta relad   3          Set for relinquish                           00653
       sta *+5                Put away in position location                00654
       bcs brn     0          Wait for disk ready                          00655
       bru *-1                                                             00656
       sel 0                                                               00657
       prf         0          Position                                     00658
       oct 0                                                               00659
       bcs brn     0                                                       00660
       bru *-1                                                             00661
       sel 0                                                               00662
       wrd 8       0          Write                                        00663
       dec execov                                                          00664
       bcs brn     0          Wait                                         00665
       bru *-1                                                             00666
       bcs ber     0          Errors...                                    00667
       Bru *-11               If so, rewrite                               00668
       bru loadov             Continue picking up overlays                 00669
                                                                           00670
                                                                           00671
$dktst ldx zero    0          Set counter                                  00672
       ldo                    and ask for disk                             00673
       sta pmbx0                                                           00674
       lda dtime                                                           00675
       bcs brr     0          Check if ready                               00676
       bru 1       2          If so, exit                                  00677
       sbo                    Decrement                                    00678
       bpl                    and wait again                               00679
       bru *-4                                                             00680
       inx 1       0          Increment                                    00681
       bxl 3       0                                                       00682
       bru $dktst+1           and try again                                00683
       stx $temp   2          Save entry                                   00684
       spb $ertyp  2          and type a nasty mesage                      00685
       dec dc                                                              00686
       ldx $ttemp  2          Restore entry                                00687
       bru $dktst             and wait again                               00688
.set.  ldx zero    2          Set pointer                                  00689
       bru set     2                                                       00690
bsums1 dec fkedit                                                          00691
       dec -8                                                              00692
ovclr  dec execov+1                                                        00693
       dec -511                                                            00694
unset  bru iplst+2                                                         00695
       dec 0                                                               00696
fclear dec flapse             Constant to clear out summary area           00697
       dec f1-f2                                                           00698
.bres. spb bres    1          Reset entry to batch                         00699
       dec -1                                                              00700
date1  dec date               Date move constants                          00701
       dec -5                                                              00702
date2  dec sdate                                                           00703
       dec -6                 plus coded date                              00704
dtime  oct 40000              Disk waiting time                            00705
$bmsk  oct 3767777            Billing flag mask                            00706
$nor   bru 1       2          Tape inhibit                                 00707
$bldv  bru loadov             Bootstrap overwrite                          00708
pernum bss 2                  Overlay number and address pointer           00709
$bf    bss 1                  Billing flag                                 00710
$temp  bss 1                  Storage                                      00711
                                                                           00712
       stl                    Bootstrap                                    00713
       ejt                    Page 22                                      00714
                                                                           00715
                                                                           00716
                        Disk map of 235 executive                          00717
                                                                           00718
                        Tracks 0-4 are reserved for the D-30               00719
                                                                           00720
                              0 5 0-30  Batchsim                           00721
                        2476  0 5 31    Bootstrap                          00722
                        2500  0 5 32    Lower memory portion               00723
                        2540  0 5 48    Upper memory portion               00724
                        2600  0 5 64    more upper memory                  00725
                                                                           00726
                              0 6 0-31  Batchsim                           00727
                        3100  0 6 32    Card lister                        00728
                        3120  0 6 40    Reproducer                         00729
                        3140  0 6 48    System loader                      00730
                        3160  0 6 56    Catalogue files                    00731
                        3200  0 6 64    Catalogue printout                 00732
                        3220  0 6 72    Disk dump                          00733
                        3240  0 6 80    Disk load                          00734
                        3260  0 6 88    Billing overlay                    00735
                                                                           00736
                        3400  0 7 00    Batch front card record            00737
                        3500  0 7 32    System loader                      00738
                        3520  0 7 40    GAP lister                         00739
                        3540  0 7 48    Efficiency summary of system       00740
                        3560  0 7 56    Time-sharing background monit      00741
                        3600  0 7 64    Background monitor part two        00742
                        3620  0 7 72    Sysout lister                      00743
                        3640  0 7 80    Tape subroutine                    00744
                        3660  0 7 88    Batch systems catalogue            00745
                                                                           00746
                        4100  0 8 32    T-S batch system monitor           00747
                        4120  0 8 40    T-S batch part three               00748
                        4140  0 8 48    T-S batch part two                 00749
                        4160  0 8 56    T-S batch part four                00750
                        4200  0 8 64    Card to tape                       00751
                                                                           00752
                        Tracks 10 to 31 are for systems                    00753
                                                                           00754
                        24100 0 40 32   Batch dump areas                   00755
                        24500 0 41 32                                      00756
                        25100 0 42 32                                      00757
                        25500 0 43 32                                      00758
                                                                           00759
                        30000 0 48 00   Batch scratch areas                00760
                        30400 0 49 00                                      00761
                        31000 0 50 00                                      00762
                        31400 0 51 00                                      00763
                                                                           00764
                        32000 0 52 00   Batch loaders                      00765
                                                                           00766
                        40000 1 00 00   Batch programs                     00767
                         to                                                00768
                        51400 1 19 00                                      00769
                                                                           00770
       loc 6000               225 Executive bootstrap                      00771
load1  bcs brn     0          Wait for disk ready                          00772
       bru *-1                                                             00773
       sel 0                  Position                                     00774
       prf         0                                                       00775
       oct 2500                                                            00776
       bcs brn     0                                                       00777
       bru *-1                                                             00778
       sel 0                  Read in lower memory part                    00779
load2  rrf 16      0          16 records                                   00780
           0                  from beginning of memory                     00781
       bcs brn     0          Wait                                         00782
       bru *-1                                                             00783
       bcs ber     0          Check for errors                             00784
       bru *-11                                                            00785
       sel 0                  Position again                               00786
       prf         0                                                       00787
       oct 2540                                                            00788
       bcs brn     0          Wait                                         00789
       bru *-1                                                             00790
       sel 0                  Read in first K of program                   00791
load3  oct 1210010            Read 24 records                              00792
       z01 exec1   1                                                       00793
       bcs brn     0          Wait                                         00794
       bru *-1                                                             00795
       bcs ber     0          Check for errors                             00796
       bru *-11                                                            00797
       lda sbak                                                            00798
       bmi                                                                 00799
       bru *+13                                                            00800
       sel 0                  Position for OBA from last dump              00801
       prf         0                                                       00802
       oct 25660                                                           00803
       bcs brn     0          Wait                                         00804
       bru *-1                                                             00805
       sel 0                                                               00806
       rrf 8       0          Put it back                                  00807
           execov                                                          00808
       bcs brn     0          Wait                                         00809
       bru *-1                                                             00810
       bcs ber     0          Check for errors                             00811
       bru *-11                                                            00812
       sel 0                  Pick up date for output message              00813
       prf         0                                                       00814
       oct 400                                                             00815
       bcs brn     0          Wait                                         00816
       bru *-1                                                             00817
       sel 0                  Read in date                                 00818
       rrf 1       0                                                       00819
           ldate              into date region                             00820
       bcs brn     0          Wait                                         00821
       bru *-1                                                             00822
       bcs ber     0          Error check                                  00823
       bru *-11               If errors, re-read                           00824
       dld date1                                                           00825
       mov ldate+3                                                         00826
       dld date2                                                           00827
       mov ldate+2                                                         00828
ltrans bru sres                                                            00829
       loc 6074               Special flags                                00830
sbak   dec 0                  Background-in-operation flag                 00831
       dec 0                                                               00832
sload  dec 0                  System load flag                             00833
loadf  dec -1                 Initialize load flag at -1                   00834
ldate  eqo 10000                                                           00835
                                                                           00836
       stl                    Lower-lower storage                          00837
       ejt                                                                 00838
       loc 0                                                               00839
       bss 1                  Index registers used by Edit                 00840
xr01   bss 1                                                               00841
xr02   bss 1                                                               00842
xr03   bss 1                                                               00843
xr10   bss 1                                                               00844
xr11   bss 1                                                               00845
       bss 1                                                               00846
       bss 1                                                               00847
ech2   bss 1                  Character holders for echar                  00848
ech3   bss 1                                                               00849
eselec bss 1                  Binary line number for selective list        00850
       bss 1                  Starting disk address for selective list     00851
edy    bss 1                  Address of CR at end of instruction          00852
edt    bss 1                  Address of CR at end previous instruction    00853
edz    bss 1                  Line number currently being adjusted         00854
       bss 5                  Other index registers                        00855
       bss 2                  X-group 5                                    00856
xr52   bss 2                                                               00857
ty     bss 20                 Typewriter input line build                  00858
t      bss 16                 Temporary storage for peripheral routines    00859
ta     equ t+4                Space for tape subroutine storage            00860
dkflg1 bss 1                  Disk flag 1 for regular tasks                00861
dkflg2 bss 1                  For extra tasks                              00862
iadrs  bss 2                  Disk addresses, second is memory location    00863
in     bss 2                  Current system identifier and rep number     00864
mstemp bss 2                  Temporary storage                            00865
save   bss 2                  A and Q saved by interrupt routine           00866
                                                                           00867
                                                                           00868
bzyf   bss 1                  Busy flag                                    00869
dcnt   bss 1                  Disk operations counter                      00870
dival  bss 1                  Disk operations elapsed time interval        00871
drcnt  bss 1                  Disk operations error counter                00872
dstakf bss 1                  Gives number of disk requests stacked up     00873
.eff   bss 1                  Efficiency flag                              00874
hdskd  bss 1                  Time counter for disk requests               00875
inov   bss 1                  Overlay in use by current system             00876
inpnt  bss 1                  Points to disk address of current system     00877
.ins   bss 1                  Insert task save                             00878
int1   bss 1                  Interrupt time for 235                       00879
isum   bss 1                  Clock save at interrupt time                 00880
itim   bss 1                  Real time + 1 minute                         00881
kanswr bss 1                  Answer for Datanet-30                        00882
kret   bss 1                  Temporary storage for Datanet-30 routines    00883
pcnt   bss 2                  Word and character counters used by ptype    00884
pct    bss 1                  P counter save                               00885
perin  bss 1                  Indicates peripheral task currently in mem.  00886
preg   bss 1                  P-counter save for kdump                     00887
ptemp  bss 1                  Storage for word currently being type        00888
rawt   bss 1                  Temporary storage                            00889
stack  bss 1                  Backlog of typewriter requests               00890
swflg  bss 1                  Switch flag for next sector and peripherals  00891
temp   bss 1                  Temporary storage                            00892
typf   bss 1                  Typewriter usage flag                        00893
                                                                           00894
                        Accumulator for systems operation summary          00895
                                                                           00896
fkedit bss 1                  0 - Mailbox routine numbers                  00897
fkstrt bss 1                  1                                            00898
fkwtnu bss 1                  2                                            00899
fkdump bss 1                  3                                            00900
fkread bss 1                  4                                            00901
fkwrit bss 1                  5                                            00902
fktea  bss 1                  6                                            00903
fkbat  bss 1                  Batch accumulator                            00904
f3     equ fkedit-1                                                        00905
                                                                           00906
                                                                           00907
cmess  oct 0                  Peripheral communications                    00908
cmessb bss 1                  Batch flag                                   00909
eavail dec eplst              End of list                                  00910
einit  dec iplst              Start of task list                           00911
ovtsk  dec 0                  Either zero or pointing to routine loc.      00912
ty1    dec 0                  Word pointer for typweriter input            00913
ty2    dec 8192               Character pointer for typewriter input       00914
                                                                           00915
.dskc. spb dskc    1          Entries                                      00916
.dskd. spb dskd    1                                                       00917
.dsec. spb dsec    1          dskop continuation                           00918
.dskx. spb dskx    1          Disk request entry for dska, part 2          00919
.krst. bru krst    3          Trap restore branch                          00920
.krex. spb krex    1          Special interrupt-trap branch                00921
.kset. spb kset    1          kdump disk write entry                       00922
.ktri. bru ktri    3          Branch to check trapmode                     00923
.ktrs. bru ktrs    3          Trap save check                              00924
.ktrs] spb tx2     0          Trap check                                   00925
.kwrt. spb kwrt    1          Entry for source rewriting                   00926
.syov. spb syov    1          Overlay read entry                           00927
.pms1. spb pms1    1          Typewriter entry                             00928
                                                                           00929
       org 128                                                             00930
z0     dec 0                                                               00931
z1     dec 0                                                               00932
z2     dec 0                                                               00933
z3     oct 20000              Upper 8K bit                                 00934
       bru inter   3          Go to interrupt routine                      00935
       bss 1                  AAU trapping mode - overflow                 00936
itrap  bss 1                  AAU trapping mode - underflow                00937
       bss 1                  AAU trapping mode - divide check             00938
       bss 2                  AAU trapping mode index group                00939
tx2    bss 2                  Registers 2 and 3                            00940
                                                                           00941
       stl                    Mailbox area                                 00942
       ejt                                                                 00943
                        Mailbox zero flag is set to indicate               00944
                        Datanet-30 message.                                00945
                        Return message also goes in mailbox 0              00946
                        These messages [to D-30] are:                      00947
                           +1 Error, mbx1 tells what type                  00948
                              0 Temporary malfunction                      00949
                              1 No program                                 00950
                              2 Unrecognizable system name                 00951
                           +2 Read done                                    00952
                           +3 Write done                                   00953
                           +4 Request dump                                 00954
                        Messages used only after a dump from the D-30:     00955
                           +5 Terminal exit                                00956
                           +6 Intermediate output                          00957
                           +7 Call for input                               00958
                                                                           00959
                        ******************************************         00960
                        Special message switching mailbox                  00961
                        has the followind code:                            00962
                        +1 Disk request from 235                           00963
                        +2 235 finished with disk                          00964
                        +3 Request Datanet-30 to stop counting time        00965
                        +4 Datanet-30 can start counting time again        00966
                        +5 Not used at present                             00967
                        +6 Off                                             00968
                        +7 On                                              00969
                        -0 Acknowledge by D-30 and normal status           00970
                        +10 Start batch                                    00971
                        +11 Stop batch                                     00972
                        Special request by a running system...             00973
                        +12 Transfer ending disk address                   00974
                                                                           00975
                                                                           00976
mbx0   bss 1                  Points to routine to be executed             00977
mbx1   bss 1                  Alfameric system name - first three letters  00978
bmx2   bss 1                  Starting disk address                        00979
mbx3   bss 1                  Ending disk address and rel. loc. for LIST   00980
       bss 2                  User number - or Selective LIST line number  00981
       bss 2                  Problem name                                 00982
mbx8   bss 2                  Real time for Datanet-30                     00983
                                                                           00984
pmbx0  bss 2                  Special mailbox                              00985
                                                                           00986
                                                                           00987
                        Upon receipt of a message from the Datanet-30      00988
                        The messages get moved into the saved mailbox      00989
                        area, which follows:                               00990
                                                                           00991
                                                                           00992
smbx0  bss 1                  Saved message                                00993
smbx1  bss 1                  Saved system name                            00994
smbx2  bss 1                  Saved starting disk address                  00995
smbx3  bss 1                  Saved ending disk address                    00996
smbx4  bss 1                  Saved user #, sel. LIST #, Teach address     00997
smbx5  bss 1                  Saved ending Teach disk address              00998
       bss 2                  Saved problem name                           00999
sdate  bss 6                  Date always kept here - used in billing      01000
sclock bss 4                  Billing time information                     01001
                                                                           01002
       stl                    Constants                                    01003
       ejt                                                                 01004
                                                                           01005
                                                                           01006
                        Double-length constants                            01007
                                                                           01008
cov1   oct 1777777            Overflow-causing constant                    01009
       oct 1777777                                                         01010
cun1   oct 2000000            Underflow causer                             01011
       oct 2000001                                                         01012
edeof  oct 777755             End of message mark                          01013
edfill oct 777777             Fill character.                              01014
.drmc. spb drmc    1          System disk usage entry                      01015
       z00 --                 filled in by executive                       01016
kfuge1 bru iplst              Special regular mailbox entry delete constant01017
       dec wait-5             Special for dexit                            01018
kxo    dec mkx0               Save index groups 0-4                        01019
       dec -20                                                             01020
movmbx dec smbx1              Mailbox 1, 2, 3, 4, 5, 6, 7 save             01021
       dec -7                                                              01022
d15    dec 15                                                              01023
       dec -1                                                              01024
trapr  dec itrap-1            Trapping restore constant                    01025
       dec -7                                                              01026
traps  dec mktrp+1            Trapping mode save constant                  01027
       dec -7                                                              01028
zero   ddc 0                                                               01029
.effy. spb effy    1          Efficiency entry                             01030
       dec -1                                                              01031
.disk. spb disk    1          Dskop entry                                  01032
       dec 0                                                               01033
.iras  bru 2                  Erase entry                                  01034
       oct 0                                                               01035
.kbil. sbp kbil    1          Billing entry                                01036
       dec -1                                                              01037
.pty.  bnr                    Pty pointer                                  01038
       spb pty     1                                                       01039
                                                                           01040
                        Constants                                          01041
                                                                           01042
one    oct 1                                                               01043
mone   dec -1                                                              01044
two    oct 2                                                               01045
mtwo   dec -2                                                              01046
three  oct 3                                                               01047
four   oct 4                                                               01048
five   oct 5                                                               01049
six    oct 6                                                               01050
seven  oct 7                                                               01051
o10    oct 10                                                              01052
ten    dec 10                                                              01053
o20    oct 20                 Disk count stepping constant                 01054
cr     oct 37                 Carriage return                              01055
o40    oct 40                                                              01056
o60    oct 60                 Trailing blank...                            01057
o100   oct 100                Position step for disk addresses             01058
o140   oct 140                96 records for disk                          01059
o200   oct 200                Buffer flip for dump routine                 01060
o300   oct 300                Illegal disk address test                    01061
o400   oct 400                                                             01062
o440   oct 440                Fudge constants for scratch algorithm        01063
8K     oct 20000              Upper memory relocation constant             01064
mask1  oct 3777400            For disk address checking                    01065
mask3  oct 3777770            Message protect mask                         01066
mask4  oct 3760000            Disk protect mask                            01067
mask6  oct 3000000                                                         01068
mask7  oct 3777700            Edit mask                                    01069
mask8  oct 0000077            Edit mask                                    01070
mask9  oct 3600000            API mask                                     01071
mask10 oct 3700000                                                         01072
mask11 oct 0077777            Special P-counter mask                       01073
mask12 oct 0177777            Special edit mask                            01074
bit3   oct 200000             Stacker full indicator on disk operations    01075
bit4   oct 100000             Error indicator on disk operations           01076
dinst  oct 10040              Disk instruction less high order bits        01077
dstakp dec dstak-4            Special disk fudge factor                    01078
kfudge dec iprior             Special dska fudge factor                    01079
mblnk  oct 2606060            End of print line blank                      01080
ovflo  oct 1000000            Overflow constant                            01081
sign   oct -0                                                              01082
stwo   oct -2                                                              01083
peom   oct 55                 End of message for ptype routine             01084
tend1  dec k3area-2           End of program                               01085
nfl    set nflpoint                                                        01086
unf    set uflpoint                                                        01087
fix    set fixpoint           Set AAU modes                                01088
                                                                           01089
                        System table with disk addresses                   01090
                        Standard overlay is 3K, system is on fast          01091
                        tracks and experimantal sys is on slow             01092
                                                                           01093
sytab  bss 0                                                               01094
       alf BAS                Basic                                        01095
       oct 5000               0  10  00                                    01096
       oct 10540              0  17  48                                    01097
       alf ALG                Algol                                        01098
       oct 5400               0  11  00                                    01099
       oct 6140               0  12  48                                    01100
       oct 6540               0  13  48                                    01101
       oct 15400              0  27  00                                    01102
       alf FOR                Fortran                                      01103
       oct 13400              0  23  00                                    01104
       oct 14000              0  24  00                                    01105
       oct 14400              0  25  00                                    01106
       alf DIP                Dartmouth Interpretive Program               01107
       oct 7000               0  14  00                                    01108
       alf TSA                Time-Sharing Assembly processor              01109
       oct 7400               0  15  00                                    01110
       oct 15000              0  26  00                                    01111
       alf XAL                Experimental Algol                           01112
       oct 10000              0  16  00                                    01113
       oct 6000               0  12  00                                    01114
       oct 6400               0  13  00                                    01115
       oct 16000              0  28  00                                    01116
       alf XBA                Experimental Basic                           01117
       oct 11000              0  18  00                                    01118
       oct 10400              0  17  00                                    01119
       alf XFO                Experimantal Fortran                         01120
       oct 11400              0  19  00                                    01121
       oct 12000              0  20  00                                    01122
       oct 12400              0  21  00                                    01123
       alf EDI                Edit system                                  01124
       oct 13000              0  22  00                                    01125
last   equ *-sytab            Maximum number of entries in table           01126
sexit1 bru sysex              Exit branch                                  01127
sexit2 oct 20000              Exit constant [must have 8K bit set]         01128
syloc  dec system             Read-in location                             01129
mendt  oct 1400               Move test constant                           01130
smove1 mov 0                  Move constant                                01131
wait1  dec wait               Interrupt point test                         01132
h1     oct 52140              Time constants [21600 = 3600*6]              01133
blzz   alf  00                                                             01134
h2     oct 550                [360 = 60*6]                                 01135
colon  oct 150000                                                          01136
dumpbl alf                                                                 01137
k2loc  dec k2area             2K area                                      01138
k3loc  dec k3area             3K area                                      01139
k6loc  dec k6area             6K area                                      01140
k6area eqo 4000               6K area start                                01141
k2area eqo 6000               2K area start                                01142
k3area eqo 12000              3K area start                                01143
kermes equ one                Error answer                                 01144
kmes2  equ two                Normal answer for reads                      01145
kmes3  equ three              Normal answer for writes                     01146
kmesd  equ four               Request dump                                 01147
kmest  equ five               Terminal exit message                        01148
kmeso  equ six                Intermediate output message                  01149
kmesi  equ seven              Real-time input call message                 01150
bit1   equ ovflo              Parity error indicator                       01151
hdreq  equ one                Disk request message                         01152
exec1  eqo 34000              First part of 235 executive                  01153
exec2  eqo 36000              Second part 235 executive                    01154
imer   oct -10                                                             01155
                                                                           01156
                       Edit constants                                      01157
                                                                           01158
rog    equ k3loc                                                           01159
rog2   equ k2loc                                                           01160
tend   equ k3loc                                                           01161
edsf   equ o100                                                            01162
edpnt2 dec smbx4              Points to selective list number              01163
$edig  equ mask12             Edit mask 0177777                            01164
edtwo  equ mtwo                                                            01165
edmsk1 equ mask7              oct 3777700                                  01166
edmsk2 equ mask8              oct 0000077                                  01167
edcarr equ cr                 Carriage return                              01168
upper8 equ 8K                                                              01169
table  eqo 4000               Start of edit linkage table                  01170
                                                                           01171
       stl                    Time-sharing typewriter options              01172
       ejt                                                                 01173
                                                                           01174
com    bss 0                  List of options available on typewriter      01175
       oct 623700             Stop - same as crump                         01176
       bru icrump  3                                                       01177
key    equ *-2                Key to catalogue                             01178
       oct 3160               0  6  56                                     01179
                                                                           01180
       alf OFF                Off tells the D-30 to stop counting time     01181
       bru ioff    3                                                       01182
summry equ *-2                Time-sharing operations efficiency summary   01183
       oct 3540               0  7  48                                     01184
                                                                           01185
c/p    alf C/P                Lister                                       01186
       bru perget  3                                                       01187
       oct 3100               0  6  32                                     01188
                                                                           01189
c/c    alf C/C                Reproducer                                   01190
       bru perget  3                                                       01191
       oct 3120               0  6  40                                     01192
                                                                           01193
sys    alf SYS                System loader                                01194
       bru perget  3                                                       01195
       oct 3140               0  6  48                                     01196
                                                                           01197
cat    alf CAT                Catalogue printout                           01198
       bru perget  3                                                       01199
       oct 3200               0  6  64                                     01200
                                                                           01201
dum    alf DUM                Disk dump                                    01202
       bru perget  3                                                       01203
       oct 3220               0  6  72                                     01204
                                                                           01205
loa    alf LOA                Disk loader                                  01206
       bru perget  3                                                       01207
       oct 3240               0  6  80                                     01208
                                                                           01209
bil    alf BIL                Billing pack program                         01210
       bru perget  3                                                       01211
       oct 3260               0  6  88                                     01212
                                                                           01213
dbg    alf DBG                Debugging overlay                            01214
       bru perget  3                                                       01215
       oct 3500               0  7  32                                     01216
                                                                           01217
g/p    alf G/P                GAP lister                                   01218
       bru perget  3                                                       01219
       oct 3520               0  7  40                                     01220
                                                                           01221
s/o    alf S/O                Sysout lister                                01222
       bru perget  3                                                       01223
       oct 3620               0  7  72                                     01224
                                                                           01225
batch  alf BAT                Bacground processor                          01226
       bru perget  3                                                       01227
       oct 3560               0  7  56                                     01228
                                                                           01229
c/t    alf C/T                Card to tape                                 01230
       bru perget  3                                                       01231
       oct 4200               0  8  64                                     01232
                                                                           01233
cru    bss 0                                                               01234
oba    alf OBA                Special batch system overlay                 01235
       bru *                  Will never come here                         01236
       oct 4100               0  8  32                                     01237
tap    equ *-2                Tape read/write subroutine                   01238
       oct 3640               0  7  80                                     01239
ocat   equ *-2                Batch Systems catalogue                      01240
       oct 3660               0  7  88                                     01241
bat2   equ *-2                Background part 2                            01242
       oct 3600               0  7  64                                     01243
                                                                           01244
                                                                           01245
       stl                    Error messages                               01246
       ejt                                                                 01247
                                                                           01248
tmm    equ zero               Temporary malfunction message                01249
npr    equ one                No program message                           01250
usn    equ two                Unrecognizable system message                01251
                                                                           01252
datnet bss 0                  D-30 kept disk                               01253
       oct 372403                                                          01254
       oct 3755                                                            01255
                                                                           01256
dc     bss 0                  Disk controller                              01257
       oct 372431                                                          01258
       oct 624237                                                          01259
       oct 557777                                                          01260
                                                                           01261
dp     bss 0                  Parity                                       01262
       oct 473755                                                          01263
                                                                           01264
ilg    bss 0                  Illegal                                      01265
       oct 313755                                                          01266
                                                                           01267
adrs   bss 0                  Adrs xxxxxx                                  01268
       oct 372160                                                          01269
adr1   alf                                                                 01270
       alf                                                                 01271
pcr    oct 375577                                                          01272
                                                                           01273
mssage bss 0                  Message                                      01274
       oct 443755                                                          01275
                                                                           01276
full   bss 0                  Full                                         01277
       oct 372643                                                          01278
       oct 433755                                                          01279
                                                                           01280
del    bss 0                  Deleted                                      01281
       alf  DE                                                             01282
       alf LET                                                             01283
       oct 252437                                                          01284
       oct 557777                                                          01285
                                                                           01286
rea    bss 0                  Ready                                        01287
       oct 375125                                                          01288
       alf ADY                                                             01289
       oct 333755                                                          01290
                                                                           01291
bzy    bss 0                  Busy.                                        01292
       oct 372264                                                          01293
       alf SY.                                                             01294
       oct 375577                                                          01295
                                                                           01296
ilr    bss 0                  Illegal task                                 01297
       oct 373232                                                          01298
       oct 323755                                                          01299
                                                                           01300
       stl                    Efficiency summary and buffer areas          01301
       ejt                                                                 01302
                                                                           01303
                        Efficiency summary of systems operations           01304
                                                                           01305
                                                                           01306
                                                                           01307
       loc 600                One 64-word record                           01308
fclock bss 1                  Starting time                                01309
flapse bss 1                  Elapsed time                                 01310
fstim  bss 2                  Actual time of start                         01311
fcnt   bss 1                  Half-hour counter                            01312
       bss 5                  Save 5 locations on principle                01313
f4     bss 0                                                               01314
       bss fkbat-f3                                                        01315
f2     bss 0                                                               01316
                        Day accumulators                                   01317
acstrt bss 1                                                               01318
acrun  bss 1                                                               01319
acswap bss 1                                                               01320
acdisk bss 1                                                               01321
acbat  bss 1                  Accumulated batch                            01322
astim2 bss 2                  Start for accumulated storage                01323
ftem   bss 4                  Temporary storage                            01324
                                                                           01325
f1     equ flapse                                                          01326
                                                                           01327
                                                                           01328
                                                                           01329
       loc 1000                                                            01330
io1    bss 84                 Buffer area no. 1                            01331
       loc 1200               Second buffer area                           01332
io2    bss 84                 Buffer area no. 2                            01333
                                                                           01334
                        Sysout buffer areas                                01335
       loc 600                                                             01336
sio1   bss 80                 80 words                                     01337
sio2   bss 40                 40 words                                     01338
sio3   bss 40                 40 words                                     01339
sio4   bss 111                110 words + 1 residue word                   01340
sio5   bss 111                110 words + 1 residue word                   01341
       bss 1                  Just to see how far I am                     01342
                                                                           01343
                                                                           01344
                        Disk addresses to be used at load time only        01345
       loc 2000                                                            01346
oba2   equ *-2                More of batch system overlay                 01347
       oct 4140               0  8  48                                     01348
oba3   equ *-2                More batch                                   01349
       oct 4120               0  8  40                                     01350
oba4   equ 4160               Still more                                   01351
       oct 4160               0  8  56                                     01352
                                                                           01353
       stl                    Save area                                    01354
       ejt                                                                 01355
                                                                           01356
                                                                           01357
                        The save area is used to save all                  01358
                        the important registers and index groups 0-4       01359
                        when a program is temporarily dumped on the        01360
                        disk.                                              01361
                                                                           01362
       loc 4000                                                            01363
kclock bss 1                  Adjusted starting time for systems           01364
mkprnt bss 1                  System output area pointer                   01365
mksxg  bss 1                  Index group save - TEACH flag                01366
ilngth bss 1                  Length of source program in memory           01367
mkdisk bss 1                  Starting address of 6K area                  01368
       bss 1                  Blank for now                                01369
mkaq   bss 2                  A and Q registers save                       01370
mkov   bss 1                  Overflow save                                01371
mkp    bss 1                  P-counter save                               01372
mkx0   bss 20                 Index groups 0-4 save                        01373
mkax   bss 2                  AX register save                             01374
mkqx   bss 2                  QX register save                             01375
mode   bss 2                  AAU mode and indicator save                  01376
mktrp  bss 6                  Trapping mode flag and branch save           01377
mktx2  bss 2                  Trapping mode index register 2 save          01378
movid  bss 1                  Overlay identifier #                         01379
morep  bss 1                  Number of current replacement                01380
molen  bss 1                  Length of overlay                            01381
momem  bss 1                  Memory location of overlay                   01382
movint bss 1                  Flag to indicate whether read completed      01383
clock  bss 1                  Elapsed time counter                         01384
mdc    bss 1                  Dump code for D-30                           01385
mdl    bss 1                  Dump length starts at 96 records             01386
mkpr1  eqo 4100               System output buffer                         01387
                                                                           01388
system eqo 20000              System read-in area                          01389
sname  equ system+4           Alfameric system name                        01390
                                                                           01391
       stl                    Interrupt routine                            01392
       ejt                                                                 01393
                                                                           01394
                        When not performing any specific                   01395
                        task, the executive sits in its wait loop,         01396
                        displaying a distinctive pattern in the            01397
                        A register.                                        01398
                                                                           01399
                                                                           01400
       loc 34001                                                           01401
wait   sxg 5                                                               01402
       spb time    2          Get time                                     01403
       dst mbx8               and give to Datanet-30                       01404
       set pst                If in interrupt mode, exit                   01405
       set trpmode            If in trap program, exit                     01406
       set ntpmode            with no trap set                             01407
       ldx 8K      3                                                       01408
       bru *+1     3                                                       01409
       bno                    Turn off overflow indicator                  01410
       nop                                                                 01411
       lac                                                                 01412
       cab int1               Check if 1 second elapsed                    01413
       bru *+4                No                                           01414
       oct 2506014            Yes, interrupt                               01415
       add four               Set timing interval for 2/3 seconds          01416
       sta int1                                                            01417
       cab itim               Check if 1+minute elapsed                    01418
       bru *+2                If less, do nothing                          01419
       bru wait               If so, pick up time again                    01420
       cab .eff               Check if efficiency save due                 01421
       bru *-10                                                            01422
       bru *-11                                                            01423
       set pbk                Ten minutes elapsed, save                    01424
       lda cov1               Make sure no more called until completion    01425
       sta .eff                                                            01426
       dld .effy.                                                          01427
       spb insert  2          Insert task in list                          01428
       bru wait+3             and get back                                 01429
       ejt                                                                 01430
                        Inter saves the working registers, and             01431
                        first looks at the regular mailbox.  If this       01432
                        is positive, it goes through the regular           01433
                        mailbox and then the peripheral mailbox            01434
                        task tables in turn.                               01435
                        If the regular mailbox was negative, ireg          01436
                        isolates the low order end and performs            01437
                        a table lookup with the result.                    01438
                                                                           01439
                                                                           01440
                                                                           01441
       oct 0                                                               01442
       ddc 0                  Make sure itab is even                       01443
       bss -3                                                              01444
inter  dst save               Save A and Q                                 01445
       bov                    Turn off overflow indicator                  01446
       bru *+1                                                             01447
       stx pct     1          and save P-counter                           01448
       lda mbx0               Look at regular mailbox                      01449
       bmi                    Check if negative                            01450
       bru ireg               If so, go service it                         01451
                                                                           01452
                        ******   WARNING...iprior must be even ******      01453
                                                                           01454
iprior bru *+2                Priority task entry                          01455
       oct 0                                                               01456
                                                                           01457
iplst  bru *+2                0                                            01458
       oct 0                                                               01459
                                                                           01460
       bru *+2                1                                            01461
       oct 0                                                               01462
                                                                           01463
       bru *+2                2                                            01464
       oct 0                                                               01465
                                                                           01466
       bru *+2                3                                            01467
       oct 0                                                               01468
                                                                           01469
       bru *+2                4                                            01470
       oct 0                                                               01471
                                                                           01472
       bru *+2                5                                            01473
       oct 0                                                               01474
                                                                           01475
       bru *+2                6                                            01476
       oct 0                                                               01477
                                                                           01478
       bru *+2                7                                            01479
       oct 0                                                               01480
                                                                           01481
       bru ispmbx             Last entry                                   01482
       oct 0                                                               01483
eplst  equ *                  End of list                                  01484
eplen  equ *-iplst            List length                                  01485
                                                                           01486
                                                                           01487
ispmbx lda pct                Check P-counter                              01488
       bmi                    If plus, then TON set                        01489
       bnn                    so crump                                     01490
       bru irest+1                                                         01491
       ldx ty1     1          Restore register 1                           01492
       ldx ty2     2          and 2                                        01493
       sna 19                 Get character                                01494
       ext sign               and get rid of a sign                        01495
       lqa                    Keep a copy in Q                             01496
       cab mask8              Check for line delete                        01497
       bru *+2                                                             01498
       bru indel              Delete line                                  01499
       inx 1       2          Increment character counter                  01500
       bxh 3       2          and check if over word                       01501
       ldx 8K      2          Yes                                          01502
       stx ty2     2          Save                                         01503
       bru *+1     2          Code for characters as follows               01504
       bru inr                Rightmost is 0                               01505
       bru inl                Leftmost is 1                                01506
       sla 6                  Middle is 2                                  01507
       ory ty      1          Save middle character in word                01508
       bru inchar             and check for carriage returns               01509
inl    sla 12                 Get character into word                      01510
       sta ty      1                                                       01511
       bru inchar                                                          01512
inr    ory ty      1          Rightmost character                          01513
       inx 1       1          Increment word pointer                       01514
       stx ty1     1          and save                                     01515
                                                                           01516
                                                                           01517
inchar laq                    Get character                                01518
       sub cr                 Check for carriage return                    01519
       bze                                                                 01520
       bru ianaly             Yes, analyze command                         01521
       bxl 20      1          Check status of one                          01522
       bru irest                                                           01523
                                                                           01524
                                                                           01525
indel  spb messg   2          DELETED message                              01526
       dec del                                                             01527
indelx ldz                    Reset pointers                               01528
       sta ty1                                                             01529
       sto ty2                                                             01530
       bru irest              and get out                                  01531
                                                                           01532
                                                                           01533
ibusy  sbp messg   2          Type message                                 01534
       dec bzy                BUSY                                         01535
       bru indelx             and get out                                  01536
                                                                           01537
                                                                           01538
ianaly sta ty1                Reset pointers                               01539
       sto ty2                                                             01540
       sta z2                                                              01541
       inc com     2                                                       01542
       lda ty                 and analyze command                          01543
ianalz cab 0       2                                                       01544
       bru *+2                                                             01545
       bru 1       2          Go to task                                   01546
       inx 3       2          Step pointer                                 01547
       bxl cru     2          Check for end of list                        01548
       bru ianalz                                                          01549
                                                                           01550
                                                                           01551
ild    spb messg   2          Type message                                 01552
       dec ilr                Illegal task                                 01553
       bru irest              and crump                                    01554
                                                                           01555
                                                                           01556
ioff   lda three              Stop time count                              01557
       bru *+2                                                             01558
icrump lda four               Ask for time count again                     01559
       spb spmess  2                                                       01560
iredy  spb messg   2          Type READY message                           01561
       dec rea                                                             01562
       ldx ovtsk   1          Check if task used at all                    01563
       bxh 1       1                                                       01564
       spb irase   2          If greater than 1, then used                 01565
iresp  ldz                    Reset various pointers                       01566
       sta ovtsk              Reset pointer                                01567
       sta bzyf               and turn off busy flag                       01568
       sta cmessb             Reset batch flag                             01569
       sta io1                for batch front card search                  01570
       sta kbfdg   3          Fix billing                                  01571
       sta kbfdg+4 3                                                       01572
                                                                           01573
                                                                           01574
irest  lda pct                Restore P-counter                            01575
       sta z1                                                              01576
       bov                    Make sure overflow is not on accidentally    01577
       bru *+1                                                             01578
       ext mask9              and get rid of high order bits               01579
       sla 4                  Restore overflow                             01580
       dld save               Restore A and Q                              01581
       set pst                                                             01582
       bru 0       1          Return                                       01583
                                                                           01584
                                                                           01585
irase  dld .ipas              Entered on 2 with pointer to be erased       01586
       add z1                 in register 1.  Construct bru *+2 and        01587
       ext 8K                 make for bank-compatible addresses           01588
       dst 0       1          Delete entry                                 01589
       bru 1       2          And return                                   01590
                                                                           01591
                                                                           01592
insert sta .ins               Save entry.  Insert sets up tasks for        01593
       ldx zero    0          API time                                     01594
       ldx eavail  3          Get next available location pointer          01595
ins1   inx 2       3          Actually is last available                   01596
       bxh eplst   3          and check for wraparound                     01597
       ldx einit   3          Yes, re-initialize                           01598
       stx eavail  3          Save pointer                                 01599
       inx 2       0          Count                                        01600
       bxh eplen+2 0          and check for end of table                   01601
       bru inful              Yes                                          01602
       lda 1       3          Check if entry free                          01603
       bnz                    Entries have second word non-zero            01604
       bru ins1               Not free, keep searching                     01605
       lda .ins               Yes                                          01606
       dst 0       3          and set entries in list                      01607
       oct 2506014            Make sure it gets serviced soon              01608
       lda eavail             and set pointer in A                         01609
       ldx 8K      3          Reset register 3                             01610
       bru 1       2          and scram                                    01611
inful  ldx 8K      3          Restore 8K bit                               01612
       ldx eavail  1          and get entry being looked at                01613
       spb irase   2          Crump some task or other                     01614
       sbp messg   2          and give room to output message              01615
       dec full               Should never happen                          01616
       bru irest              and of course crump task                     01617
                                                                           01618
                                                                           01619
ireg   sta smbx0              Save message                                 01620
       cab imer               Check for illegal message                    01621
       bru *+3                                                             01622
       bru *+2                                                             01623
       bru mer                Message error                                01624
       add 8K                 Add upper 8K bit                             01625
       sta z2                 Set up for indexed branch to task            01626
       stx preg    1          Save P-counter for kdump                     01627
       dld kfuge1             Get special erase entry                      01628
       dst iprior  3          and set in regular mailbox task entry        01629
       lda wait1              and set P-location for exit                  01630
       sta pct                                                             01631
       lac                    Save time                                    01632
       sta isum                                                            01633
       dld movmbx             Save mailbox 1, 2, 3, 4, 5, 6, 7.            01634
       mov mbx1                                                            01635
       sta mbx0               Aknowledge message received                  01636
cbuga  bru *+1     2          And branch according to mailbox number       01637
       bru kedit              0                                            01638
       bru kstart             1                                            01639
       bru kcntnu             2                                            01640
       bru kdump              3                                            01641
       bru kdskrd             4                                            01642
       bru kdskwr             5                                            01643
       bru kteach             6                                            01644
       bru kbrun              7                                            01645
       bru ktrrun             10                                           01646
                                                                           01647
                                                                           01648
mer    spb adrser+12          Message error                                01649
       dec mssage                                                          01650
       bru erxtmm                                                          01651
                                                                           01652
       stl                    Edit                                         01653
       ttl                    Executive routines                           01654
                                                                           01655
                                                                           01656
                        EDIT - message 0                                   01657
                        1) Read variable-length source program from        01658
                           teletype standard area into upper [3K]          01659
                           area of memory.                                 01660
                        2) Edit source program into lower [2K] area        01661
                           of memory.                                      01662
                        3) Write variable-length source program onto       01663
                           teletype standard area from lower [2K]          01664
                           area of memory.                                 01665
                        4) Place 2*length into mbx1, starting disk         01666
                           address [selective list] into mbx2.             01667
                        Normal answer = 2                                  01668
                                                                           01669
                                                                           01670
                        EDIT reorders a source program according           01671
                        to the line numbers which precede each             01672
                        statement.                                         01673
                             A linked list is constructed, each entry      01674
                        in the list corresponding to one statement         01675
                        and consisting of four words, as follows           01676
                        1)  location of first word of each statement       01677
                        2)  length of statement in two's complement        01678
                        3)  statement number in binary                     01679
                        4)  relative address of link with next             01680
                            highest line number.                           01681
                        EDIT moves the source program down to              01682
                        6000 octal, ordering it according to               01683
                        the list.                                          01684
                                                                           01685
                                                                           01686
                                                                           01687
kedit  bss 0                                                               01688
       spb upread  2          Read source program into upper area          01689
       sxg 0                  Set group zero for edit                      01690
       set pst                and exit priority mode                       01691
       bru edita   3                                                       01692
                                                                           01693
                                                                           01694
kwrt   spb lwwrit  2          Write source program from lower are          01695
       bru kexitr                                                          01696
                                                                           01697
                                                                           01698
edit1  mpy ten                Convert character                            01699
       bru echar              and get next                                 01700
                                                                           01701
edita  dld zero               Selective list pickup                        01702
       sta mbx3               Set relative location to zero                01703
       lda smbx4              Check first character for digit              01704
       ext $edig              Extract all but high order zone bits         01705
       bnz                                                                 01706
       dld edeof              If first character not a digit, set to fills 01707
       ldx edpnt2  1          Set pointer                                  01708
       spb echar1  3          Get character                                01709
       cab ten                Check if digit                               01710
       bru edit1              Yes, convert                                 01711
       bru *+1                No, crump                                    01712
       laq                    Get converted digit                          01713
       sta eselec             and save                                     01714
       lda smbx2              Pick up starting disk address                01715
       ext one                Mask off extraneous bits                     01716
       sta eselec+1           and save                                     01717
       lda ilngth             Pick up program length                       01718
       sla 6                  Computer number of words to multiple of 64   01719
       add rog                                                             01720
       add mone                                                            01721
       sta xr01               Last word of last record - odd location      01722
       ldx four    2          Initialize table pointers                    01723
       ldx zero    3           and other registers                         01724
       lda mone               Initialize table entries                     01725
       sta table                                                           01726
       lda edfill             Large number                                 01727
       sta table+2                                                         01728
                                                                           01729
                                                                           01730
edbob  lda xro1               Begin search for carriage returns            01731
       add edtwo              which must be in an odd location             01732
       sta xr01                                                            01733
       bxl k3area  1          Check for no carriage returns at all         01734
       bru enpr               No-program exit                              01735
       lda 0       1          Proceed down through program                 01736
       ext edmsk1                                                          01737
       cab edcarr                                                          01738
       bru edbob                                                           01739
       bru edkar              Carriage return                              01740
       bru edbob                                                           01741
                                                                           01742
                                                                           01743
edkar  stx edy     1          Address of CR at end of statement            01744
edbla  lda xr01               Proceed down through program                 01745
       add edtwo              for next carriage return                     01746
       sta xr01                                                            01747
       bxl k3area  1          Has end of program been reached...           01748
       bru edblax             Yes                                          01749
       lda 0       1                                                       01750
       ext edmsk1             Look for CR at end of next previous          01751
       cab edcarr             statement                                    01752
       bru edbla                                                           01753
       bru edblax                                                          01754
       bru edbla                                                           01755
edblax stx edt     1          Address of CR at end previous statement      01756
       inx 1       1                                                       01757
       lda 0       1          Is word after CR an end-of-message           01758
       cab ededof                                                          01759
       bru edblay                                                          01760
       bru *+2                                                             01761
       bru edblay                                                          01762
       lda xr01                                                            01763
       add edsf               Increase XR-1 to next multiple of 64         01764
       ext edmsk2               (to beginning of statement following       01765
       sta xr01                end-of-message)                             01766
edblay lda xr01                                                            01767
       sta table   2          Address of first word of statement           01768
       sub edy                                                             01769
       add mone               Get two's complement of correct length       01770
       sta table+1 2          Number of words in statement                 01771
       lda 0       1          Get first character of line number           01772
       ext $edig              and check it                                 01773
       bze                                                                 01774
       bru edig               Digit                                        01775
       lmo                                                                 01776
       sta table+1 2                                                       01777
       bru enless             and set as smaller number                    01778
                                                                           01779
                                                                           01780
edig1  mpy ten                Convert digit                                01781
       bru echar              and get next                                 01782
                                                                           01783
                                                                           01784
edig   sxg 1                  Set index group 1                            01785
       dld zero               Initialize register and Q                    01786
       xr10                                                                01787
       ldx xr10    1          Set pointer                                  01788
       spb echar1  3          Get character                                01789
       inx 1       0          Count                                        01790
       bxh 6       0          Test                                         01791
       bru edigx              Crump if done                                01792
       cab ten                Check for digit                              01793
       bru edig1              Yes, convert                                 01794
       bru *+1                No                                           01795
edigx  sxg 0                  Reset index group                            01796
       laq                    and get converted line number                01797
       sta table+2 2          Statement number in binary                   01798
       cab table+2 3          Is new statement higher or equal             01799
       bru enless             Less                                         01800
       bru edout              Equal                                        01801
       sta edz                Save line number and start adjusting links   01802
       stx edy     3          Next lower group in list                     01803
       lda table+3 3                                                       01804
       sta xr01               Next higher group in list                    01805
edigy  lda edz                                                             01806
       cab table+2 1          Does the new statement fit between these     01807
       bru edigz              two groups                                   01808
       bru edout                                                           01809
       stx edy     1          Next lower in list                           01810
       lda table+3 1                                                       01811
       sta xr01                                                            01812
       bru edigy                                                           01813
edigz  lda xr01               Link new group to higher                     01814
       sta table+3 2                                                       01815
       ldx edy     1          Group just below new one                     01816
       lda xr02                                                            01817
       sta table+3 1          Link lower group to new one                  01818
       bru enlesx                                                          01819
enless lda xr03                                                            01820
       sta table+3 2          Address link of next higher group in list    01821
       ldx xr02    3          Change pointer to lowest statement in list   01822
enlesx inx 4       2          Next entry group in table                    01823
                                                                           01824
                                                                           01825
edout  bxh 1024    2          256 statements maximum                       01826
       bru edoutx                                                          01827
       lda edt                                                             01828
       cab rog                Has end of program been reached              01829
       bru edoutx                                                          01830
       bru *+1                                                             01831
       ldx edt     1          CR at end of next statement to               01832
       bru edkar                be listed                                  01833
edoutx ldx xr03    2          Initialize, begn rewrite                     01834
       lda rog2                                                            01835
       sta edt                                                             01836
       ldx upper8  3                                                       01837
                                                                           01838
                                                                           01839
edgurk lda table   2                                                       01840
       bmi                    If last group in list, prepare to exit       01841
       bru edsout                                                          01842
       sta xr11                                                            01843
       lda table+1 2                                                       01844
       cab edtwo                                                           01845
       bru eslec                                                           01846
       bru *+2                                                             01847
       bru edelet             Delete if length is -1                       01848
       sxg 1                  Set index group 1                            01849
       spb echar1  3          and get character                            01850
       cab ten                Is it a digit                                01851
       bru echar              Get next if so                               01852
       bru *+1                Reset index group                            01853
       sxg 0                    As here either delete or exit              01854
       ext o40                  get rid of bit                             01855
       cab cr                   and check if done with line number         01856
       bru eslec                No, do not delete                          01857
       bru edelet             Delete                                       01858
                                                                           01859
                        Selective LIST feature                             01860
                                                                           01861
eslec  lda table+2 2          Check line number against list parameter     01862
       cab eselec                                                          01863
       bru go                 If less than selec number, then get out      01864
       bru *+1                Check special case of first nubmer           01865
       lda edt                Location of line # of current statement      01866
       ext mask7              Get rid of all but position mod 64,          01867
       sta mbx3               then set relative position in record for D-3001868
       lda edt                Get address of line number again             01869
       ext edmsk2             and get rid of relative part                 01870
       sub rog2               Compute how many records from start we are   01871
       sra 5                                                               01872
       add eselec+1           Add starting address                         01873
       sta eselec+1           and save to send over to Datanet-30          01874
       lda edfill             Take care of special selec case              01875
       sta eselec             Crump selective LIST                         01876
                                                                           01877
                                                                           01878
go     dld table   2          Set up move instruction to                   01879
       sto *+2     3          sequentially position program in new area    01880
       lda edt                                                             01881
       mov --                 Dummy move instruction                       01882
       xaq                                                                 01883
       neg                                                                 01884
       add edt                                                             01885
       sta edt                Compute next area to be filled               01886
       cab tend               Check for program toolong                    01887
       bru edelet             OK, continue                                 01888
       bru *+1                No, trim it down                             01889
       lda tend1              Two words                                    01890
       bru edsout+1           and crump                                    01891
                                                                           01892
                                                                           01893
edelet lda table+3 2                                                       01894
       sta sr02               Go to next higher instruction                01895
       bru edgurk                                                          01896
                                                                           01897
                                                                           01898
edsout lda edt                Edsout computes length of program            01899
       sta xr01               Filling begins here                          01900
       bxl k2area+11          Also check for no program                    01901
       bru enpr               If none, crump                               01902
       add edsf               Prepare to fill in last buffer load          01903
       ext edmsk2             (to next multiple of 64)                     01904
       neg                    Construct end-of-fill test                   01905
       sto eds1    3                                                       01906
       neg                    Re-negate                                    01907
       sub rog2               Compute length                               01908
       sra 5                  for Datanet-30                               01909
       sta mbx1                                                            01910
       sra 1                  and for TEACH                                01911
       sta ilngth             Save length in pointer                       01912
       dld edeof              Pick EOM and fill                            01913
       dst 0       1          Put away                                     01914
       laq                    Double fills                                 01915
eds0   inx 2       1          Increment pointer                            01916
eds1   bxh *       1          Test                                         01917
       bru eds2               If done, crump                               01918
       dst 0       1          Fill out                                     01919
       bru eds0                                                            01920
eds2   lda eselec+1           Starting disk address                        01921
       sta mbx2               Give to Datanet-30                           01922
       lda .kwrt.             Get entry                                    01923
       sta iprior  3          and set in entry for D-30 tasks              01924
       set prq                and priority request                         01925
       bru wait               and get out                                  01926
                                                                           01927
                        Character picking routine - places one at a        01928
                        time in the A-register                             01929
                                                                           01930
echar  bxl 2       2          Check if first character coming up           01931
       bru ech23               characters 2 or 3                           01932
echar1 ldx zero    2          Entry point first time - set counter         01933
       lda 0       1          Get word                                     01934
       inx 1       1            and step pointer                           01935
       sta ech3               Rightmost character                          01936
       sra 6                                                               01937
       sta ech2               Middle character                             01938
       sra 6                  High order                                   01939
echar2 ext mask7              Extract high-order bits                      01940
       bru 1       3          and return                                   01941
ech23  lda ech2    2          Get next character                           01942
       inx 1       2          Step pointer for characters                  01943
       bru echar2             and exit                                     01944
                                                                           01945
                                                                           01946
enpr   lda npr                No program                                   01947
       bru erex                                                            01948
                                                                           01949
       stl                    KSTART and KCNTNU                            01950
       ejt                                                                 01951
                                                                           01952
                                                                           01953
                        KSTART - message 1                                 01954
                        1) Read system, if necessary, into 20000           01955
                        2) Start RUN                                       01956
                        Normal answers to Datanet-30...                    01957
                           4 - Request dump                                01958
                           5 - Terminal exit                               01959
                           6 - Intermediate output                         01960
                           7 - Call for input                              01961
                                                                           01962
                                                                           01963
                                                                           01964
kstart bss 0                                                               01965
       dld zero                                                            01966
       dst movid              Initialize replacement and overlay indicators01967
       lda kmeso              Set dump code for time dump                  01968
       sta mdc                                                             01969
       lda o140               and set dump length to 96 records            01970
       sta mdl                                                             01971
       lda smbx2              Save disk address                            01972
       sta mkdisk                                                          01973
       lac                    Get starting time                            01974
       dst sclock             Set time and flag                            01975
       sta kclock             Set clock for systems                        01976
       spb syread  2          Read in system...                            01977
       spb relin   2          and relinquish disk if necessary             01978
       rin                    Turn off bad lights                          01979
       set pst                and interrupt mode                           01980
       bru system+13          and exit (to system)                         01981
                                                                           01982
                                                                           01983
                                                                           01984
                        KCNTNU - message 2                                 01985
                        1) Read in 6K swap from teletype 6K area.          01986
                        2) Read system, if necessary, into 20000.          01987
                        3) Begin run where last interrupted                01988
                        Normal answers to Datanet-30...                    01989
                        4 - Request dump                                   01990
                        5 - Terminal exit                                  01991
                        6 - Intermediate output                            01992
                        7 - Real-time input call                           01993
                                                                           01994
                                                                           01995
kcntnu bss 0                                                               01996
       lac                    Set time for billing                         01997
       dst sclock                                                          01998
       lda smbx3              Get length                                   01999
       sto *+2     3          and save for read                            02000
       spb dska    2          and read in 6K from teletype 6K area         02001
       z12 96                 Read, 96 records                             02002
       dec k6area             into 4000 - 6K area                          02003
       z20 smbx2              Indirect to address                          02004
       bru erxtmm             Error return                                 02005
       spb syread  2          Read in system                               02006
       spb relin   2          Relinquish disk                              02007
       spb ksuma   2          Get elapsed time for 6K swaps                02008
       lda kmeso              Set dump code for time dump                  02009
       sta mdc                                                             02010
       set fixpoint           For trap work                                02011
       lda 8K                 Set register for trap group                  02012
       sta tx2+1                                                           02013
       lda .krst.             Set for trap                                 02014
       sta itrap-1                                                         02015
       sta itrap                                                           02016
       sta itrap+1                                                         02017
       set ntpmode            Set no-trap mode                             02018
       ldx mktrp   1          Get condition of trapping group              02019
       bru *+1     1          and go to branch table                       02020
       bru krtrp              Trapmode set and in trap program             02021
       bru krtri              Not in trap program when interrupt occurred  02022
                        Trap not set so fall through                       02023
                                                                           02024
kcrest spb khold   2          Restore hold indicators                      02025
       lda kx0+1              Restore index registers                      02026
       maq                                                                 02027
       mov mkx0                                                            02028
       sta mkprnt             and reset output pointer                     02029
       lac                    Adjust clock to give                         02030
       sub clock              correct starting time to system              02031
       sta kclock             (without swap time)                          02032
       dld trapr              Restore trap contents                        02033
       mov mktrp+1                                                         02034
       lda mode               and restore AAU mode                         02035
       sta *+1     3                                                       02036
       set nflpoint           Dummy...                                     02037
       fld mkqx               Get QX register                              02038
       lqa         a          and restore                                  02039
       fld mkax               Restore AX resgister                         02040
       dld mkaq               Prepare to restore A and Q                   02041
       dst save                                                            02042
       ldx mksxg   1          and restore old index group                  02043
       oct 2526013            *** sxg 0,1 ***                              02044
       lda mkov               Isolate overflow bits                        02045
       ext mask11                                                          02046
       add mkp                and get P-counter location                   02047
       bru irest+1            Then exit to system                          02048
                                                                           02049
                                                                           02050
krtri  spb khold   2          Trap mode set, but program not in trap when  02051
       set trpmode            exit occurred                                02052
       bru kcrest+1           and get out                                  02053
                                                                           02054
krtrp  set trpmode            In trap when interrupt occured               02055
       fdv zero               Cause trap                                   02056
       bru irest              and exit so trap can take place              02057
                                                                           02058
krst   rin                    Reset indicators - entry is here from self-  02059
       lda .krex.             caused trap                                  02060
       sta iprior  3          so set for later interrupt                   02061
       set prq                then interrupt this trap                     02062
                                                                           02063
krex   spb irase   2          After above interrupt, erase entry that      02064
       bru kcrest             called here, and go finish process           02065
                                                                           02066
                                                                           02067
khold  ldx mode+1  1          Get type of hold condition to be restored    02068
       bru *+1     1                                                       02069
       bru 1       2          None                                         02070
       bru kcov               Overflow hold on                             02071
       bru kcun               Underflos hold on                            02072
       fdv zero               Divide check on - recreate it                02073
       bru 1       2          and exit                                     02074
                                                                           02075
kcov   fld cov1               Overflow hold on                             02076
       fad cov1               Restore it                                   02077
       bru 1       2          and exit                                     02078
                                                                           02079
       kcunfld cun1           Underflow indicator on                       02080
       fad cun1               Restore it                                   02081
       bru 1       2          and exit                                     02082
                                                                           02083
       stl                    KDUMP                                        02084
       ejt                                                                 02085
                                                                           02086
                                                                           02087
                        KDUMP - message 3                                  02088
                        1) Checks mdc to see what type of dump is          02089
                           required.  If it is a terminal exit it          02090
                           goes to koutpt.  If not,                        02091
                        2) Saves all program working registers in a        02092
                           64-word block at the beginning of the 6K        02093
                           area.                                           02094
                        3) Checks dump length and dumps the required       02095
                           number of words.                                02096
                        4) Puts running time in mbx1.                      02097
                        5) Intermediate output flag for D-30 in mbx2.      02098
                        6) Dump length in mbx3.                            02099
                        7) Writes billing record                           02100
                        8) Gives D-30 type of dump in mbx0                 02101
                           6 if intermediate output                        02102
                           7 if real-time input                            02103
                                                                           02104
                                                                           02105
                                                                           02106
kdump  bss 0                                                               02107
       lda mdc                Check dump code                              02108
       sub six                                                             02109
       bmi                                                                 02110
       bru koutpt             Terminal exit only needs 1K dump             02111
                        Start regular dump procedure                       02112
       dld save               Save A and Q registers                       02113
       dst mkaq                                                            02114
       lda preg               get P-counter                                02115
       sta mkov                                                            02116
       ext mask10             Get rid of high-order bits                   02117
       cab wait1              and check where interrupted...               02118
       sta mkp                In program                                   02119
       bru *+1                In executive                                 02120
       dld kx0                Save index groups 0-4                        02121
       mov 0                                                               02122
       oga                    Get index group                              02123
       sta mksxg              and save index group with instruction        02124
       ldx mkprnt  1          Store end-of-message                         02125
       lda edeof              in output area according                     02126
       sta mkpr1   1          to program pointer                           02127
       lac                    Compute total adjusted elapsed time          02128
       dst sclock+2           Give ending time and set flag for kdump      02129
       sub kclock                                                          02130
       sta clock              and save                                     02131
       maq                    and put total # of seconds                   02132
       dvd six                                                             02133
       sta mbx1               in mailbox 1 for Datanet-30.                 02134
       spb ksumb   2          Get time for program run                     02135
       dld traps              Save contents of trapping mode locations     02136
       mov itrap-1                                                         02137
       sta xr52               and initialize for later test                02138
       sta movint             Set flag to indicate interrupt occurred      02139
       lda .ktrs.             Branch to check simultaneous interrupts      02140
       sta tx2                                                             02141
       lda .ktrs]             spb tx2,0                                    02142
       sta itrap+1            and set in trapping mode locations           02143
       sta itrap                                                           02144
       sta itrap-1                                                         02145
       lda 8K                 Set register 3 to 8K bit                     02146
       sta tx2+1                                                           02147
       fst mkax               Save AX register                             02148
       laq         a          and move QX to AX                            02149
       fst mkqx               and save QX                                  02150
       lda nfl                Save AAU mode of operation - assume normalize02151
       bar bup     7          Check for un-normalized                      02152
       lda unf                                                             02153
       bar bfx     7          Check for fixed point                        02154
       lda fix                                                             02155
       sta mode               and save mode of operation                   02156
       ldz                    Save hold indicators - zero if none          02157
       bar boo     7                                                       02158
       ldo                    Overflow hold on                             02159
       bar buo     7                                                       02160
       lda two                Underflow hold on                            02161
       bar bdc     7                                                       02162
       lda three              Divide check on                              02163
       add 8K                 and set upper bit                            02164
       sta mode+1                                                          02165
       sxg 5                  Set index group for executive use            02166
       set pst                and exit priority mode                       02167
       bru *+1     3          If there was a simultaneous trap, the program02168
       spb *+1     2          will transfer to ktrs, else will go here     02169
       lda xr52               Check to see if in middle of trap program    02170
       bnz                                                                 02171
       bru ktrchk             Not in trap program, go check if trap set    02172
                                                                           02173
                                                                           02174
                        ktex sets a flag for cntnu as follows...           02175
                        0 - Program running trap group when dump           02176
                            command was given,                             02177
                            or trap occurred simultaneously with API       02178
                        1 - Not in trap program, but trpmode set           02179
                        2 - Trap mode not set                              02180
                                                                           02181
                                                                           02182
ktex   add 8K                 Set upper 8K bit on for branch table         02183
       sta mktrp              Set flag - 8K if dropped through             02184
       rin                    Reset any indicators we may have turned on   02185
       lda .kset.             Set entry for later disk work                02186
       sta iprior  3                                                       02187
       set prq                Set priority request                         02188
       bru wait               and go to wait loop                          02189
                                                                           02190
                                                                           02191
ktrs   lda preg               Simultaneous occurrence of trap and interrupt02192
       sta mktx2-1            Set trap register 1 appropriately            02193
       lda tx2-2              Get entrance                                 02194
       ext mask10             Get rid of high order                        02195
       sta mkp                Set for return                               02196
       ldz                    Set indicator for cntnu                      02197
       bru ktex               and exit                                     02198
                                                                           02199
                                                                           02200
ktri   ldo                    Trap mode set, but not in trap program       02201
       bru ktex               exit                                         02202
                                                                           02203
                                                                           02204
ktrchk lda .ktri.             Test for trapmode set                        02205
       sta itrap+1            If set, a branch to ktri will occur, else    02206
       set fixpoint           try and insure fdv will work ok              02207
       fdv zero               the program will continue                    02208
       lda two                Trapmode not set                             02209
       bru ktext              exit                                         02210
                                                                           02211
                                                                           02212
                        kset sets up the billing for one-shot usage,       02213
                        and then writes the 6K area onto the disk          02214
                                                                           02215
                                                                           02216
kset   spb kbill   2          Set up to bill                               02217
       lda mdl                Get dump length                              02218
       sto *+3     3          and put in list                              02219
       sta mbx3               also send to D-30                            02220
       spb dska    2          Write on disk                                02221
       z37 96                 Write, 96 records                            02222
       dec k6area             from 4000 (6K area)                          02223
       z20 mkdisk             indirect to disk address                     02224
       bru erxtmm             Error exit                                   02225
       bru kexitd             Dump exit                                    02226
                                                                           02227
                                                                           02228
                        kexitd picks up the output area pointer and        02229
                        sends it to the D-30 as an output flag.  It        02230
                        also puts the dump code in A for kexit             02231
                                                                           02232
kexitd lda mkprnt             Get output area pointer                      02233
       sta mbx2               Send to D-30                                 02234
       lda mdc                Dump code                                    02235
       bru kexit              and exit                                     02236
                                                                           02237
       stl                    KOUTPT, KDSKRD, KDSKWRT                      02238
       ejt                                                                 02239
                                                                           02240
                                                                           02241
                        KOUTPT - entered through KDUMP                     02242
                        1) Dump output area onto first 16 records          02243
                           of teletype standard area                       02244
                        2) Write terminal billing record                   02245
                        Normal answer...                                   02246
                          5 - terminal exit                                02247
                                                                           02248
                                                                           02249
koutputlac                    Set total elapsed time for terminal billing  02250
       sta sclock+2                                                        02251
       sub kclock             Subtract adjusted starting time              02252
       sta sclock+3           Total elapsed time for billing record        02253
       spb ksumb   2          and get program running time                 02254
       spb kbill   2          and set up for billing                       02255
       spb dska    2          Now write on disk                            02256
       z37 16                 Write, 16 records                            02257
       dec k6area             from 4000 (also output area)                 02258
       z20 mkdisk             indirect to address                          02259
       bru erxtmm             Error exit                                   02260
       bru kexitd             Dump exit                                    02261
                                                                           02262
                                                                           02263
                                                                           02264
                        KDSKRD - message 4                                 02265
                        1) Read variable-length source program from        02266
                           specified address into lower (2K) area.         02267
                        2) Place 2*length in mbx1                          02268
                        Normal answer...                                   02269
                          2 - read completed                               02270
                                                                           02271
                                                                           02272
kdskrd spb lwread  2          Read into lower area                         02273
       lda ilngth             Get length                                   02274
       sla 1                  and multiply by two                          02275
       sta mbx1               and set in mailbox 1                         02276
       bru kexitr             Done                                         02277
                                                                           02278
                                                                           02279
                                                                           02280
                        KDSKWR - message 5                                 02281
                        Write variable-length source program onto          02282
                        specified address from lower (2K) area             02283
                        Normal answer...                                   02284
                          3 - write completed                              02285
                                                                           02286
                                                                           02287
kdskwr spb lwwrit  2          Write from lower                             02288
       bru kexitw             and terminate                                02289
                                                                           02290
       stl                    KTEACH                                       02291
       ejt                                                                 02292
                                                                           02293
                                                                           02294
                        KTEACH - message 6                                 02295
                        1) Read in testing program from address            02296
                           specified                                       02297
                        2) Read system, if necessary, into 20000           02298
                        3) Start run                                       02299
                        Normal answers...same as for START                 02300
                                                                           02301
                                                                           02302
                                                                           02303
kteach lda ilngth             Get end of tested program, and compute       02304
       sla 6                  where testing program is to go               02305
       add k2loc              Step past 6000                               02306
       sta ktea2+2 3          and set memory address in parameter list     02307
       lda smbx5              Get length of testing program                02308
       sub smbx4                                                           02309
       sra 1                  Correct to number of 64-word records         02310
       sto ktea2+1 3          and set in parameter list                    02311
       add ilngth             Get combined length for teach                02312
       add sign               Set flag for teach                           02313
       sta mksxg                                                           02314
                                                                           02315
ktea2  spb dska    2          and pull in program                          02316
       z12 --                 read, constructed length (variable)          02317
       dec 0                  constructed address (memory)                 02318
       z20 smbx4              indirect to disk address                     02319
       bru erxtmm             Error exit                                   02320
       bru kstart             and pull in system                           02321
                                                                           02322
                                                                           02323
                        KTBRUN - message 10                                02324
                        1) Run teletype batch                              02325
                        Normal answer ... 0                                02326
ktbrun bru *                                                               02327
                                                                           02328
       stl                    Normal and error exits                       02329
       ejt                                                                 02330
                                                                           02331
                                                                           02332
                        Both exists relinquish the disk and send           02333
                        a completion message to the Datanet-30, as         02334
                        follows...                                         02335
                                                                           02336
                        1 - error message, sent through erxtmm             02337
                        2 - read completed, sent through kexitr            02338
                        3 - write completed, sent through kexitw           02339
                                                                           02340
                                                                           02341
                                                                           02342
erxtmm spb irec    2          Dump debugging locations on tape             02343
       lda tmm                Temporary malfunction message                02344
erex   sta mbx1                                                            02345
       lda kermes             Error message                                02346
       bru kexit              and send                                     02347
                                                                           02348
                                                                           02349
kexitr lda kmes2              Message 2                                    02350
       bru kexit                                                           02351
                                                                           02352
kexitw lda kmes3              Message 3                                    02353
kexit  sta kanswr             and save                                     02354
       spb relin   2          Relinquish disk                              02355
       spb ksuma   2          and get routine elapsed time                 02356
       lda mbx0               Try not to wipe out D-30 message             02357
       bpl                                                                 02358
       lda kanswr             OK, send it                                  02359
cbugb  sta mbx0               None, so send answer over                    02360
       cab kermes             Check if error exit                          02361
       bru iplst              No                                           02362
       bru wait               Yes, special exit                            02363
       bru iplst              No, continue normal running                  02364
                                                                           02365
                        Elapsed time calculating routines                  02366
                                                                           02367
ksuma  ldx smbx0   1          Get elapsed time for called routine          02368
       lac                                                                 02369
       sub isum               Subtract starting time                       02370
       add fkedit  1          and step particular counter                  02371
       sta fkedit  1                                                       02372
       bru 1       2          and return                                   02373
                                                                           02374
                                                                           02375
ksumb  lac                    Get elapsed time for program runs            02376
       sub sclock             Starting time set by Continue and Start      02377
       add fkstrt             Step running time counter                    02378
       sta fkstrt                                                          02379
       bru 1       2          and return                                   02380
                                                                           02381
                                                                           02382
                        Users will be billed according to the              02383
                        amount of central processor time they              02384
                        use.                                               02385
                        The time portion of the billing record             02386
                        is broken up as follows...                         02387
                        1) sclock    Starting time for a run               02388
                        2) sclock+1  Flag, set as follows...               02389
                                     0 for a first run                     02390
                                     non-zero otherwise                    02391
                        3) sclock+2  Ending time for a run                 02392
                        4) sclock+3  Flag, set as follows...               02393
                                     Elapsed time if terminal run          02394
                                     Negative number if 6K dump            02395
                                                                           02396
                                                                           02397
kbill  lda swflg              Check for stacked-up bills                   02398
       bod                                                                 02399
       bru 1       2          Yes, crump this one                          02400
       ldo                    Set flag on                                  02401
       sto swflg                                                           02402
       dld .kbil.             Set entry to bill this particular clunk      02403
       bru insert             and return                                   02404
                                                                           02405
kbil   bcs btn     1          Check if tape ready                          02406
       bru 2       1          Crump if not                                 02407
       ldz                    Set batch tape error flag                    02408
       sto swflg              Reset flag                                   02409
       spb irase   2          Erase entry                                  02410
kbdfg  nop                    Branch to tape op overlay if in              02411
       sel 1                  and write billing record                     02412
       wtb smbx1   0                                                       02413
           24                 Short record                                 02414
       nop                                                                 02415
       bru iplst              and go to API list                           02416
                                                                           02417
                                                                           02418
       stl                    UPREAD, LWREAD, LWWRIT                       02419
       ttl                    Utility routines for source input/output     02420
                                                                           02421
                        Upread reads a source program from the             02422
                        teletype standard area into upper (3k) area        02423
                        of core memory.                                    02424
                                                                           02425
                                                                           02426
upread lda k3loc              Get memory address for 3K area               02427
       bru kreada             and go read                                  02428
                                                                           02429
                                                                           02430
                                                                           02431
                        lwread reads a source program from the             02432
                        teletype standard area into lower (2K) area        02433
                        of core memory.                                    02434
                                                                           02435
                                                                           02436
lwread lda k2loc              Get memory address for 2K area               02437
kreada sta kreadb+23          Set in parameter list                        02438
       stx kret    2          and save return location                     02439
       lda smbx3              Ending disk address                          02440
       sub smbx2              Subtract starting disk address               02441
       sra 1                  and correct to number of 64-word records     02442
       sta ilngth             and save in program length indicator         02443
       sta mksxg              Make positive for TEACH                      02444
       sto *+2     3          and set in parameter list                    02445
kreadb spb dska    2          Go read                                      02446
       z12 --                 Read, constructed length                     02447
       z00 --                 Constructed memory address                   02448
       z20 smbx2              Points to disk address                       02449
       bru erxtmm             Error return                                 02450
                                                                           02451
kreta  ldx kret    2          Return point                                 02452
       bru 1       2          and get out                                  02453
                                                                           02454
                                                                           02455
                        lwwrit writes a source program from the            02456
                        lower (2K) area of memory onto the teletype        02457
                        standard area                                      02458
                                                                           02459
                                                                           02460
lwwrit stx kret    2          Save return location                         02461
       lda ilngth             Get program length                           02462
       sto *+2     3                                                       02463
       spb dska    2          Write                                        02464
       z37 --                 write, constructed length                    02465
       dec k2area             from lower area                              02466
       z20 smbx2              address in mailbox 2                         02467
       bru erxtmm             Error return                                 02468
       bru kreta              Get back                                     02469
                                                                           02470
       stl                    SYREAD                                       02471
       ttl                    System intput/output routines                02472
                                                                           02473
                                                                           02474
                        Each time-sharing compatible system or             02475
                        system overlay must carry certain information      02476
                        for the executive at its head.  The format         02477
                        is rigid and must be exactly followed by           02478
                        overlays, replacements, and systems.               02479
                                                                           02480
                                                                           02481
                                                                           02482
                        Word No.             Function                      02483
                                                                           02484
                        0] System exit location - exit branch              02485
                           supplied by executive when systems are          02486
                           brought into memory.                            02487
                        1] Entry point - executive transfers here to       02488
                           begin running a problem.                        02489
                        2] Transfer to cleanup routine for systems         02490
                           that use disk - this is so that when a          02491
                           user types *STOP* his disk space is             02492
                           returned to the available space list.           02493
                        3] Spare                                           02494
                        4] Alfameric system name - first 3 letters.        02495
                        5] Number of replacement of overlay - 0 for        02496
                           systems.  In the case of an *OVERLAY*,          02497
                           bit 1 is set on if the overlay                  02498
                           destroys the system or replacement that         02499
                           called it.                                      02500
                        6] Move constant - 0 if no move - tells            02501
                           executive to move to here...                    02502
                        7] this many words (in two's complement form)      02503
                        8] from here.                                      02504
                                                                           02505
                                                                           02506
                                                                           02507
                                                                           02508
                                                                           02509
                        syread checks to see if the called system          02510
                        is in memory.  If not, it searches for its         02511
                        address in a table, then reads in the system       02512
                        into core memory address 20000.                    02513
                                                                           02514
                                                                           02515
syread stx kret    2          Save entry point                             02516
       dld movid              Put replacement number in Q                  02517
       lda smbx1              System wanted                                02518
       dcb in                 Check to see if in memory                    02519
       bru *+2                No                                           02520
       bru syovk              Check if correct overlay in memory           02521
       ldx zero    2          Initialize counter/pointer                   02522
sysrch cab sytab   2          Seatch system table                          02523
       bru *+2                                                             02524
       bru syfind             Found                                        02525
       inx 1       2          Count                                        02526
       bxl last    2          and check for end of table                   02527
       bru sysrch             No, try again                                02528
       bru rsnot              System not in table                          02529
syfind lda z2                 Save table pointer (for overlay calls)       02530
       lda inpnt                                                           02531
       add morep              Step by replacement number                   02532
       sta z2                 and set to get system disk address           02533
       lda sytab+1 2          Address                                      02534
       sta *+4     3          Set in parameter list                        02535
       spb dska    2          and go read                                  02536
       z12 96                 Read, 96 records                             02537
       dec system             into 20000                                   02538
       z00 --                 address, constructed                         02539
       bru erxtmm             Error return                                 02540
       ldx syloc   1          Read-in location                             02541
       spb symov   2          Move constants down and set up identifiers   02542
                        If system was read, overlays must be read in       02543
       lda movid                                                           02544
       bze                                                                 02545
       bru *+2                No overlay                                   02546
       bry syova              Get overlay                                  02547
       sta inov               Set flag to zero                             02548
       bru kreta              and get out                                  02549
                                                                           02550
syovk  lda movid              Get overlay number requested                 02551
       bze                    Check for no overlay                         02552
       sta inov               If so, then reset overlay indicator          02553
       cab inov               Check for correct overlay                    02554
       bru syova              No, go read in overlay                       02555
       bru kreta              Yes, get out                                 02556
       bru syova              Else go get overlay                          02557
                                                                           02558
                                                                           02559
rxnot  lda usn                System cannot be found or read in            02560
       bru erex                                                            02561
                                                                           02562
       stl                    syov                                         02563
       ejt                                                                 02564
                                                                           02565
                        Overlay read-in routine.  Entered from syread      02566
                        or from ovcall, reads in overlay to                02567
                        specified location, then returns according to      02568
                        which routine called it, back to program if        02569
                        called from ovcall - else back to original         02570
                        caller- kstart or kcntnu.                          02571
                                                                           02572
                                                                           02573
                                                                           02574
syov   spb irase   2          Erase entry that called                      02575
       spb dskb    2          Request disk from Datanet-30                 02576
       ldz                    Overlay is special, so special measures      02577
       sta dkflg2             must be taken - reset disk flag 2            02578
       lda movint             and check interrupt flag                     02579
       bze                    If zero, then interrupted                    02580
       bru 2       1          So ignore the rest of this                   02581
       lda movid              Overlay identifying number                   02582
                                                                           02583
                                                                           02584
syova  add inpnt              inpnt points to master system address        02585
       sta z2                 Location of overlay address                  02586
       lda sytab+1 2          Get it                                       02587
       sta syovb+3 3          set address in parameter list                02588
       lda molen              Length of overlay                            02589
       sto syovb+1 3          set in parameter list                        02590
       lda momem              Memory address of where it goes              02591
       sta syovb+2 3          set in parameter list                        02592
                                                                           02593
syovb  spb dska    2          Get overlay                                  02594
       z12 --                 read, constructed length                     02595
       z00 --                 memory address                               02596
       z00 --                 disk address - constructed                   02597
       bru erxtmm             No go                                        02598
       ldx momem   1          Get read-in address                          02599
       lda morep              and set up replacement number of current     02600
       sto 5       1          System                                       02601
       lda movid              Set overlay number in indicator              02602
       sta inov                                                            02603
       spb symov   2          and go move constants and set up identifiers 02604
       lda movint             Check if dump 6 occurred while reading       02605
       bze                    in overlay                                   02606
       bru kreta              Yes, go back to caller                       02607
       spb relin   2          Let's not relinquish twice                   02608
       bru sret               No, go back to system                        02609
                                                                           02610
                                                                           02611
                                                                           02612
symov  lda sexit1             Set exit location                            02613
       sta 0       1          and set in first word of system/overlay      02614
       dld 4       1          Check if correct system...                   02615
       cab smbx1              brought in                                   02616
       bru rsnot              No                                           02617
       bru *+2                                                             02618
       bru rsnot              No                                           02619
       dst in                 Yes, set in indicator which gives system and 02620
       lda 8       1          overlay #.  Construct system constant move   02621
       add smove1                                                          02622
       sta symov1  3                                                       02623
       dld 6       1          Where and how may words                      02624
       cab mendt              Check for no move                            02625
       bru 1       2          If no move, exit                             02626
       bru *+1                Yes                                          02627
symov1 mov --                 Move constants where requested               02628
       bru 1       2          and exit                                     02629
                                                                           02630
       stl                    Disk request                                 02631
       ttl                    Disk read/write routines                     02632
                                                                           02633
                        DSKR is entered on xreg 2 by non-D-30 tasks.       02634
                        It checks both dkflg1 and dkflg2 for non-zero.     02635
                        It also steps dreqf on entry, an decrements        02636
                        it on exit.  This is so that the relinquish        02637
                        routine will not needlessly give back the          02638
                        disk to the Datanet-30.  When both dkflg1 and      02639
                        dkflg2 have gone zero, it asks the Datanet-30      02640
                        for the disk.                                      02641
                                                                           02642
                                                                           02643
dskb   lda z2                 Get return point                             02644
       maq                    and save in entry                            02645
       lda .dskc.             Set up entry to check                        02646
       spb insert  2          for other disk usage.                        02647
       sta z1                 Save where inserted for returns              02648
                                                                           02649
dskc   lda dkflg1             Check disk flags.  If either non-zero, then  02650
       bze                    some task is waiting for or using the disk   02651
       bru dskc1                                                           02652
       lda dstakf             Wait for special requests to terminate       02653
       bze                    before granting access to Datanet-30-called  02654
       bru 2       1          tasks.  So wait on D-30 if non special.      02655
dskc1  lda dkflg2             Time-sharing task using the disk or no       02656
       bnz                    D-30 task waiting.                           02657
       bru 2       1          Some other routine using disk, so punt       02658
       lda pmbx0              Wait for message switching to go normal      02659
       bpl                                                                 02660
       bru 2       1          If plus, the message waiting to be answered  02661
       sta dkflg2             All OK, so set disk flag 2 non-zero          02662
       lac                    Set timing interval to 1 second plus         02663
       add seven                                                           02664
       sta hdskd                                                           02665
       lda .dskd.             Get entry to wait for D-30 answer            02666
       sta 0       1                                                       02667
       lda hdreq              Ask for disk                                 02668
       sta pmbx0                                                           02669
                                                                           02670
dskd   bcs brr     0          If the disk is ready                         02671
       bru dskg               then get out                                 02672
       lda pmbx0              Else check if D-30                           02673
       bmi                                                                 02674
       bru 2       1          has answered, and if so, wait on             02675
       lac                    Else check timing interval                   02676
       cab hdskd                                                           02677
       bru 2       1          Still OK                                     02678
       bru 2       1          Ditto                                        02679
       add cr                 Reset time check                             02680
       sta hdskd                                                           02681
dsko   spb messg   2          and type message to clear disk               02682
       dec dc                 Disk controller                              02683
       bru 2       1          and exit                                     02684
                                                                           02685
dskg   lda 1       1          Disk ready, so get return                    02686
       sta z2                                                              02687
       bru irase              Erase entry and return to caller             02688
                                                                           02689
                                                                           02690
                                                                           02691
                        DSKA is entered by D-30-called routines.           02692
                        It sets dkflg1 to +1, then waits for dkflg2        02693
                        to be reset.  When other tasks have finished       02694
                        with the disk, it sets dkflg1 negative to          02695
                        indicate the disk is being used.                   02696
                        Entry is on xreg 2 with the disk parameters        02697
                        immediately following th calling sequence -        02698
                        see dskop for an explanation of the parameter      02699
                        setup.                                             02700
                                                                           02701
                                                                           02702
                                                                           02703
dska   lda z2                 Get return point                             02704
       sta dkflg1             and set disk flag 1 positive to indicate wait02705
       maq                    Save return                                  02706
       lda .dskx.             Set entry for continuation                   02707
       dst iprior  3          and set in priority entry                    02708
       ldx kfudge  1          and get where entry is by fudge factor       02709
                                                                           02710
dskx   lda dskflg2            Wait for disk flag 2 to go zero              02711
       bnz                                                                 02712
       bru 2       1          No, exit                                     02713
       lda dstakf             Check special requests stack flag            02714
       bnz                    and punt it they are not done                02715
       bru 2       1          dskb will continue to give them the disk     02716
       ldx dkflg1  2          Now get flag - is also calling point here    02717
       lmo                    Set disk 1 negative to indicate              02718
       sta dkflg1             actual use                                   02719
       lda .disk.             Set entry for disk routine                   02720
       sta 0       1                                                       02721
       bru dskh               and go to special entry point                02722
                                                                           02723
       stl                    DSKOP                                        02724
       ejt                                                                 02725
                                                                           02726
                                                                           02727
                                                                           02728
                        DSKOP may be entered directly or through dskh      02729
                        The calling sequence follows the spb on xreg2      02730
                        and is given below...                              02731
                                                                           02732
                        A      spb  x, 2                                   02733
                        A+1    1) No. of 64-word records in bits 5-19      02734
                               2) Type of instruction in bits 2-4...       02735
                                  12  indicates a read.                    02736
                                  37  indicates a write.                   02737
                        A+2    Starting memory address - mod 64            02738
                        A+3    If negative, indirect pointer to disk       02739
                               address.  If positive, address itself.      02740
                        A+4    Error return - nature of error in high      02741
                               order bits.                                 02742
                                  Bit 4 - illegal address                  02743
                                  Bit 3 - not used as yet.                 02744
                        A+5    Normal return.  Any non-terminal error      02745
                               conditions are reflected in bits 0-4        02746
                               as follows...                               02747
                                  Bit 2 - unused as yet                    02748
                                  Bit 1 - recovered parity error           02749
                                  Bit 0 - unrecovered parity error.        02750
                                                                           02751
                        Dskop uses 96-record-read and will give            02752
                        illegal address indication if more than            02753
                        92 records are asked for.                          02754
                                                                           02755
                                                                           02756
dksop  stx .disk.+12          Get return point                             02757
       dld .disk.             and get entry                                02758
       spb insert  2                                                       02759
       sta z1                 save for returns                             02760
       ldx .disk.+12          Get entry point again                        02761
                                                                           02762
dskh   ldz                                                                 02763
       sta dcnt               Reset length counter                         02764
       sta drcnt              Error count                                  02765
       lda 1       2                                                       02766
       sto dnct               Length of operation                          02767
       ext mask11             Get high order bits for type                 02768
       add dinst              Construct instruction                        02769
       sta doper+1 3                                                       02770
       lda 2       2          Memory address                               02771
       sta iadrs+1                                                         02772
       lda 3       2          Pick up disk address                         02773
       sta z2                                                              02774
       bmi                    Indirect if minus                            02775
       lda 0       2                                                       02776
       sta iadrs                                                           02777
       ext mask1              Check if legal                               02778
       sub o300               If over 300 with other bits gone then        02779
       bpl                    illegal                                      02780
       bru dker               yes                                          02781
       lda iadrs              Get address back                             02782
       sta dseek+2 3          put away in case legal                       02783
       ado                    Set bit 19 for relinquish                    02784
       sta relad   3                                                       02785
       lac                                                                 02786
       add o40                Set timing interval                          02787
       sta dival                                                           02788
                                                                           02789
disk   spb dskwt   2          Wait for disk                                02790
       lda .dsec.                                                          02791
       sta 0       1                                                       02792
dseek  sel 0                  Seek command                                 02793
       prf         0                                                       02794
       oct 0                  Disk address - constructed                   02795
       lda dcnt               Compute 96-record bit setting                02796
       sta z0                 See if over 96 records                       02797
       bxh 97      0                                                       02798
       bru dker               Should not happen                            02799
       srd 4                                                               02800
       xaq                    Remainder mod 16 in A                        02801
       sra 15                 Position remainder                           02802
       bze                                                                 02803
       dad d15                15, -1                                       02804
       ory doper+1 3          Put away                                     02805
       lda iadrs+1            Get memory address                           02806
       ext mask10             3700000  make sure not to wipe high order bit02807
       sta doper+2 3                                                       02808
       ldz                    Set bits 2-4                                 02809
       scd 4                                                               02810
       ory doper+2 3                                                       02811
doper  sel 0                  Read/write                                   02812
       z00 --                 Constructed (instruction, length?)           02813
       z00 --                 Constructed (memory address?)                02814
       bru 2       1                                                       02815
                                                                           02816
dsec   spb dskwt   2          Wait                                         02817
       bcs ber     0          Check for errors                             02818
       bru dcorr              Try to correct                               02819
dexit  lda 1       1          Get return point                             02820
       add four               and step for correct return                  02821
       sta z2                                                              02822
       bru irase              and exit back to caller                      02823
                                                                           02824
                                                                           02825
                                                                           02826
dskwt  bcs brr     0          Is disk ready...                             02827
       bru 1       2          yes, exit back to caller                     02828
       lac                    Check interval                               02829
       cab dival                                                           02830
       bru 2       1          Still OK, go back to task list               02831
       bru 2       1          ditto                                        02832
       add cr                 Set interval large enough to give            02833
       sta dival              message time to get out                      02834
       oct 2516036            Check for lockout bit set                    02835
       bru dsko               No, so type message to clear                 02836
       spb messg   2          Yes, type reminder on typewriter             02837
       dec datnet                                                          02838
       lda hdreq              Ask D-30 for disk - shouldn;t have to        02839
       spb spmess  2                                                       02840
       bru 2       1          and return                                   02841
                                                                           02842
                                                                           02843
                        Error correction routine - will try                02844
                        five times and then consider the frame as          02845
                        correctly transferred.  Any error is noted         02846
                        by setting bit 1 on in the return address.         02847
                        If an error persisted the record was rewritten     02848
                        on the disk and bit 0 is set.                      02849
                                                                           02850
dcorr  ldx drcnt   0          Error counter                                02851
       inx 1       0                                                       02852
       bxh 6       0          Tried five times                             02853
       bru dnorec             No recovery                                  02854
       stx drcnt   0                                                       02855
       lda bit1               Set bit 1 on in return address               02856
       ory 1       1          to signify parity error of some sort         02857
       bru dseek                                                           02858
                                                                           02859
                                                                           02860
dnorec lda sign               Set bit 0 on in return address               02861
       ory 1       1                                                       02862
       bpe                    Clear out any parity indicator               02863
       nop                                                                 02864
       ldx iadrs+1 2          Get read-in address                          02865
       bru *+2                                                             02866
dnore1 inx 2       2                                                       02867
       dld 0       2          and find where parity error was              02868
       dst 0       2                                                       02869
       bxl 2       2          Do not go too far                            02870
       bru *                  Parity on disk yet none in memory            02871
       bpc                                                                 02872
       bru dnore1             Try again                                    02873
       lda z2                 Get address of error                         02874
       ext mask8              77  make a multiple of 64 words              02875
       sta dcorra  3          Put address in write command                 02876
       sub iadrs+1                                                         02877
       sra 5                  Compute new disk address                     02878
       add dseek+2 3                                                       02879
       sta dcorrp  3                                                       02880
       sel 0                                                               02881
       prf         0          Position to write back bad record            02882
dcorrp oct 0                  Disk address                                 02883
       bcs brn     0          Wait till ready                              02884
       bru *-1                                                             02885
       sel 0                                                               02886
       wrf 1       0          Write record back on                         02887
dcorra 0                      Address in memory                            02888
       lda dcorrp  3          Get exact disk address                       02889
       spb adrser+12          and output it                                02890
       dec dp                                                              02891
       lda .disk.             Set up task for disk                         02892
       sta 0       1                                                       02893
       bru 2       1          and get out                                  02894
                                                                           02895
                                                                           02896
dker   spb adrser  2          Illegal address message                      02897
       declilg                                                             02898
       lda 1       1          Get return address                           02899
       add bit4               Set bit 4 on                                 02900
       add three              and return to error return                   02901
       bru dexit+2            Get out                                      02902
                                                                           02903
                                                                           02904
adrser lda iadrs              Get address                                  02905
       stx rawt    2          Save entry point                             02906
       spb convrt  2          and convert address                          02907
       sta adr1               and set in message                           02908
       laq                                                                 02909
       sta adr1+1                                                          02910
       spb messg   2          Type message                                 02911
       dec adrs                                                            02912
       ldx rawt    2          Get entry again                              02913
       bru messg              and type kind of address error               02914
                                                                           02915
       stl                    Relinquish                                   02916
       ejt                                                                 02917
                                                                           02918
                        RELIN relinquishes the disk to the Datanet-30.     02919
                        If no task has used the disk, then the relin-      02920
                        quish is vacuous; if any task is waiting for       02921
                        the disk, then the relinquish is punted.           02922
                                                                           02923
                                                                           02924
relin  set prq                Request interrupt after completion           02925
       dld zero               Check out status of flags                    02926
       cab dstakf             See if more tasks waiting                    02927
       bru relex              yes                                          02928
       bru *+1                                                             02929
       cab dkflg1             Against disk flag 1                          02930
       bru relex              waiting                                      02931
       bru *+2                Not used by D-30-called tasks                02932
       bru relq               Definitely used                              02933
       cab dkflg2             Against regular task flag                    02934
       bru relq               Used                                         02935
       bru relmes             no, so send message only                     02936
                                                                           02937
relq   dst dkflg1             Reset flags                                  02938
       bcs brn     0                                                       02939
       bru *-1                It shouldn't happen, but just in case        02940
       sel 0                  and relinquish                               02941
       prf         0          Disk had better be ready                     02942
relad  oct 403                Set up by dskop - 403 if for after boot.     02943
       bcs brn     0          Wait here                                    02944
       bru *-1                for disk                                     02945
       sel 0                  and read after write next sector 0 records   02946
       oct 1213040            with power dropped and API set               02947
       oct 0                                                               02948
relmes lda two                Tell D-30 it has disk                        02949
       sta pmbx0                                                           02950
       bru 1       2          and return                                   02951
                                                                           02952
relex  sta dkflg2             Reset disk flag 2                            02953
       bru 1       2          and get out                                  02954
                                                                           02955
       stl                    Peripheral overlay read                      02956
       ejt                                                                 02957
                                                                           02958
                        The peripheral overlay calling routine is          02959
                        entered from the table of typewriter-entered       02960
                        tasks, to perget.  It is also entered to           02961
                        pgetb, byt other peripheral tasks, to chain        02962
                        several in sequence.  When entry is through        02963
                        perget, the routine checks to see if any           02964
                        other peripheral tasks are currently in            02965
                        memory...if so, it punts and types 'busy',         02966
                        else it calls in the overlay from the disk         02967
                        address given in the word after the calling        02968
                        location.                                          02969
                        It also saves the overlay called, so that if       02970
                        the same peripheral task is called twice in        02971
                        a row, it does not read it in the second time.     02972
                                                                           02973
                                                                           02974
                                                                           02975
perget lda bzyf               Check busy flag - if on                      02976
       bnz                    then not zero,                               02977
       bru ibusy              so punt.                                     02978
                                                                           02979
pgetb  lda z2                 Get caller                                   02980
       sta bzyf               and set flag to busy status                  02981
       cab perin              and check if already in memory...            02982
       bru *+2                No                                           02983
       bru execov             Yes, go execute                              02984
       sta perin              Else set in indicator                        02985
       lda 2       2          and get disk address                         02986
       sta pgetx   3          and set in parameter list                    02987
       spb dskb    2          Get disk from Datanet-30                     02988
       spb dskop   2          and go read in overlay                       02989
       z12 8                  Read eight records                           02990
       dec execov             Memory location                              02991
pgetx  z00 --                 Disk address                                 02992
       dec -1                 Should never ever return here.....           02993
       spb relin   2          Relinquish disk to Datanet-30                02994
       bru execov             and go execute                               02995
                                                                           02996
       stl                    System-called routines                       02997
       ejt                                                                 02998
                                                                           02999
                        DRAMB is entered on xreg 2 by background           03000
                        systems that require disk usage.                   03001
                        DRAMA is entered on xreg 1 by time-sharing         03002
                        systems that request the disk.                     03003
                        The calling sequence is...                         03004
                                                                           03005
                        A      spb   dramb,2                               03006
                        A+1    Indirect pointer to a parameter list -      03007
                               see later for an explanation.               03008
                        A+2    Return point.  The return is executed       03009
                               immediately, and the completion of the      03010
                               operation is signalled by setting a         03011
                               flag in the parameter list.                 03012
                                                                           03013
                        The parameter list is a four-word table, set       03014
                        up as follows...                                   03015
                                                                           03016
                        P      1) No of 64-word records in bits 5-19,      03017
                               2) Type of operation in bits 2-4...         03018
                                  12 - indicates a read                    03019
                                  37 - indicates a wite                    03020
                        P+1    Starting memory address - mod 64            03021
                        P+2    Disk address for read or write,             03022
                               sign bit set if scratch area is to be       03023
                               supplied to a system by the executive.      03024
                               In this case, each system has 48            03025
                               64-word records available, and the low      03026
                               order end of the parameter word must        03027
                               specify what particular record is to        03028
                               be accessed.                                03029
                               Note...the particular address used          03030
                               will be stored in P+2 by the executive      03031
                               but most users will want to ignore          03032
                               this.                                       03033
                        P+3    Flag to indicate completion of              03034
                               operation.  Upon completion of              03035
                               the operation, it will be set odd if        03036
                               the operation was successful, even          03037
                               otherwise.  In either case, certain         03038
                               conditions will be indicated in the         03039
                               high order bits...                          03040
                                  Bit 4 - illegal address (error)          03041
                                  Bit 3 - too many requests stacked        03042
                                          up (error)                       03043
                                  Bit 2 - not used at present              03044
                                  Bit 1 - parity (recovered, no error)     03045
                                  Bit 0 - parity (unrecovered, but         03046
                                          transfer complete, so no         03047
                                          error indication given)          03048
                                                                           03049
                        A maximum of four                                  03050
                        simultaneous calls are allowed.  There             03051
                        must be as many parameter lists as there may       03052
                        be simultaneous calls, and the user should         03053
                        not modify the parameter list for a given          03054
                        call until that disk operation has been            03055
                        completed.                                         03056
                                                                           03057
                                                                           03058
                                                                           03059
drama  ldx mkp     2          Get entry point                              03060
       bru *+2                                                             03061
                                                                           03062
                                                                           03063
dramb  inx 1       2          Step for return in any event                 03064
       lda 0       2          Points to *P*                                03065
       sta .drmc.+1           save                                         03066
       ldx .drmc+1 1          Set in register                              03067
       ldx dstakf  0          Get stackup flag                             03068
       bxh 4       0          If four stacked up, crump                    03069
       bru dsful                                                           03070
       inx 1       0          Else step by one                             03071
       stx dstakf  0          and save                                     03072
       ldz                    and zero out return word                     03073
       sta 3       1          *P+3*                                        03074
       dld .drmc.             Get list entry                               03075
       bru insert             and go insert in task list                   03076
                                                                           03077
                                                                           03078
                                                                           03079
drmc   ldx dstakp  2          Points to dstak-4                            03080
       inx 3       2          Step to next entry                           03081
       lda 3       2          and get second word - check if entry free    03082
       bnz                    non-zero in use                              03083
       bru *-3                so try again - we know there is at least 1   03084
       lda 1       1          Get pointer to *P*                           03085
       sta 3       2          and set in stack                             03086
       bru irase              then erase current entry                     03087
                                                                           03088
                        The following entries go in groups of              03089
                        four.  They are all identical                      03090
                                                                           03091
dstak  spb dskb    2          Now wait for disk                            03092
       spb drms    2          then use                                     03093
       z00 --                 Pointer to *P* goes here                     03094
                                                                           03095
       spb dskb    2          Group 2                                      03096
       spb drms    2                                                       03097
       z00 --                                                              03098
                                                                           03099
       spb dskb    2          Group 3                                      03100
       spb drms    2                                                       03101
       z00 --                                                              03102
                                                                           03103
       spb dskb    2          Group 4 - last entry                         03104
       spb drms    2                                                       03105
       z00 --                                                              03106
                                                                           03107
                                                                           03108
                                                                           03109
drms   stx temp    1          Save place in task list                      03110
       lda 1       2          Points to *P*                                03111
       sta z1                 set for indirect #1                          03112
       add stwo               Points to *P+2*                              03113
       sta drmd+3  3          set in parameter list                        03114
       lda 0       1          Get instruction type and length              03115
       sta drmd+1  3          and set in parameter list                    03116
       lda 1       1          Get memory address                           03117
       sta drmd+2  3          set in parameter list                        03118
       ldz                    Reset waiting list                           03119
       sta 1       2                                                       03120
       lda 2       1          Get disk address                             03121
       bpl                    Check if real address                        03122
       bru drmd               Yes, skip all this                           03123
       ext mask4              Get rid of all high order bits and start to  03124
       lqa                    computer scratch address                     03125
       add drmd+1  3          Add record count to starting scratch address 03126
       ext mask4              Wipe out high order bits                     03127
       sta z0                                                              03128
       bxh 49      0          See if too many [records]                    03129
       bru dnovl              Yes, error return                            03130
       xaq                    Get number [of records] back                 03131
       sla 1                  Position correctly                           03132
       add mkdisk             add teletype address                         03133
       add o440               step 400 to get scratch area                 03134
       sta 2       1          and put away                                 03135
                                                                           03136
drmd   spb dskop   2          Read/write on disk                           03137
       z00 --                 Type and length                              03138
       z00 --                 Starting memory address                      03139
       z00 --                 Pointer to disk address in parameter list    03140
       nop                    Ignore errors - sort of                      03141
       stx temp    1          and save place in list                       03142
drme   lda drmd+3  3          Points to *P+2*                              03143
       sta z1                                                              03144
       lda z2                 Get spb to dskop - has error info in high    03145
       ext mask11             order bits.  Isolate these                   03146
       bze                    check for no errors                          03147
       ldo                    If none, set completion indicator odd        03148
       sta 1       1          and set in word four of parameter list       03149
       lda dstakf             Release stackup flag one notch               03150
       sbo                                                                 03151
       sta dstakf                                                          03152
       ldx temp    2          Get place in task list                       03153
       bru relin              and relinquish disk                          03154
                                                                           03155
                                                                           03156
                                                                           03157
dnovl  ldx bit4    2          Set illegal address bit on                   03158
       bru drme               and return                                   03159
                                                                           03160
                                                                           03161
dsful  lda bit3               Special bits for stacker full error          03162
       sta 3       1          and set in *P+3*                             03163
       bru 1       2          Return to caller                             03164
                                                                           03165
       stl                                                                 03166
       ttl                    System exits                                 03167
                        All exits are entered by an spb 20000 (octal)      03168
                        on index register 1, with an appropriate           03169
                        constant in the A-register.                        03170
                        The constants and their corresponding              03171
                        exits are as follows...                            03172
                        0 - Terminal exit.                                 03173
                        1 - Intermediate output exit.                      03174
                        2 - Input call exit.                               03175
                        3 - Overlay call temporary exit.                   03176
                        4 - Overlay delete call                            03177
                        5 - Disk operations call                           03178
                        6 - Special data transfer to the D-30,             03179
                            using the special mailbox.                     03180
                        7 - Special data transfer to the D-30,             03181
                            using the regular mailbox.                     03182
                            The calling sequence for these is              03183
                                A    spb 20000 (octal)                     03184
                                A+1  data word 1                           03185
                                A+2  data word 2                           03186
                                A+3  return                                03187
                            Data words 1 and 2 will be sent to the D-30    03188
                            Data word 1 has special transfer code...       03189
                                12 - send ending disk address              03190
                         8 - Change dump length.  Q has the ending dump    03191
                             address, which must be rounded to the         03192
                             the next higher multiple of 64.               03193
                                                                           03194
                        When the sytems request a terminal exit,           03195
                        intermediate output, or real-time input, the       03196
                        executive will request a dump from the D-30        03197
                        after saving the type of exit.                     03198
                                                                           03199
                                                                           03200
sysex  set pbk                No interrupts while setting up exits         03201
       inx 1       1          Save return location incremented by one      03202
       stx mkp     1                                                       03203
       cab ten                Dec 10 to see if legal call                  03204
       bru sysx1              Yes [length < 10]                            03205
       bru sret               No, so return                                03206
       bru sret                                                            03207
sysx1  sto sexit2             Set up for branch                            03208
       ldx sexit2  1                                                       03209
       bru sysx2   1          and branch to start of list                  03210
sysx2  bru term               0 - Terminal exit                            03211
       bru otex               1 - Intermediate output exit                 03212
       bru inex               2 - Input call exit                          03213
       bru ovcall             3 - Overlay call                             03214
       bru ovdel              4 - Overlay delete                           03215
       bru drama              5 - Disk operation                           03216
       bru sptra              6 - Special transfer                         03217
       bru sret               7 - Not used yet so just return              03218
       bru sydlc              8 - Change dump length                       03219
                                                                           03220
                                                                           03221
sret   ldx mkp     1          Return                                       03222
       set pst                                                             03223
       bru 0       1                                                       03224
                                                                           03225
                                                                           03226
sptra  ldx mkp     1          Get entrance location                        03227
       lda pmbx0              Wait for special mailbox                     03228
       bpl                    to go minus                                  03229
       bru *-2                better not take too long                     03230
       lda 0       1          Data word 1                                  03231
       cab ten                See if legal                                 03232
       bru sptrx              No                                           03233
       bru *+1                Yes                                          03234
       sta pmbx0                                                           03235
       lda 1       1          Data word 2                                  03236
       sta pmbx0+1            in special mailbox+1                         03237
       lda pmbx0              Wait for acknowledgment                      03238
       bpl                                                                 03239
       bru *-2                                                             03240
sptrx  inx 2       1          Set for return                               03241
       bru sret+1             and enter return                             03242
                                                                           03243
                                                                           03244
waitex lda mbx0               Do not wipe out D-30 message                 03245
       bpl                    If none, go on                               03246
       lda kmesd              Request dump                                 03247
       sta mbx0               Answer Datanet-30                            03248
       set pst                Hang up waiting for interrupts so as not     03249
       bru *-1                  to destroy any index registers             03250
                                                                           03251
                                                                           03252
term   lda kmest              Terminal exit                                03253
       sta mdc                put in dump code                             03254
       bru waitex             and exit                                     03255
                                                                           03256
                                                                           03257
otex   lda kmeso              Intermediate output message                  03258
       sta mdc                put in dump code                             03259
       bru waitex             and exit                                     03260
                                                                           03261
                                                                           03262
inex   lda kmesi              Real-time input call                         03263
       sta mdc                put in dump code                             03264
       bru waitex             and exit                                     03265
                                                                           03266
                        Change dump length.  Q has ending memory address   03267
sydlc  xaq                    Get address in A                             03268
       sub k6loc              subtract starting address                    03269
       sra 6                  divide by 64 to get record count             03270
       cab o140               See if legal length [<= 96]                  03271
       bru *+3                yes                                          03272
       bru *+2                                                             03273
       bru sret               No, so just return                           03274
       sta mdl                Store in length                              03275
       bru sret               and return                                   03276
                                                                           03277
       stl                    Overlay call                                 03278
       ejt                                                                 03279
                                                                           03280
                                                                           03281
                        The overlay call is a special system feature.      03282
                        It is treated as a special system exit.            03283
                        An overlay call may be used to supplement or       03284
                        replace part or all of a system.  If a system      03285
                        is replaced by an overlay (this is indicated       03286
                        in the calling sequence), only the replacing       03287
                        overlay will be called back in after swaps.        03288
                        Furthermore, system replacements may have          03289
                        their own overlays.                                03290
                        If a called-for overlay is already in memory       03291
                        the information will be placed in the save         03292
                        area, and the overlay will not be read in.         03293
                                                                           03294
                        Two conventions must be rididly adhered to:        03295
                        1) All systems, overlays, and replacements         03296
                           must have the same heading information          03297
                           in the same format.  (See SYREAD)               03298
                        2) The numbering system for overlays,              03299
                           replacements, and systems, must be unique.      03300
                           That is, if overlays, replacements, and         03301
                           systems are considered as integral units        03302
                           of core memory, then each of                    03303
                           these units must have a unique identiying       03304
                           number in the word after the system name.       03305
                                                                           03306
                                                                           03307
                        The calling sequence is as follows...              03308
                                                                           03309
                        A      spb 8192, 1 with a 3 in the A-register      03310
                        A+1    Replacement # of current unit in            03311
                               memory, unless a new replacement is         03312
                               being called, in which case this            03313
                               should have the number of the new           03314
                               replacement.  This is the only case         03315
                               in which overlay and replacement            03316
                               numbers may match up in the calling         03317
                               sequence - see next item.                   03318
                        A+2    Number of overlay being called.  If the     03319
                               overlay destroys [??] the system currently  03320
                               in memory, then this word should            03321
                               have the sign bit on.  This is so that      03322
                               if a dump occurs while the overlay is       03323
                               being brought in, the executive will        03324
                               not needlessly read in the system           03325
                               again for a new problem.                    03326
                        A+3    Length of overlay.  It will be truncated.   03327
                               So if length is not an exact multiple       03328
                               of 64 words, it should be extended at       03329
                               least as far as the next 64-word multiple   03330
                        A+4    Memory address where the overlay            03331
                               is desired - must be a multiple of          03332
                               64 words.                                   03333
                        A+5    Return address.                             03334
                                                                           03335
                                                                           03336
ovcall ldx mkp     1          Entry location, stepped by one               03337
       lda 0       1          [A+1] Replacement number                     03338
       sta morep              and save                                     03339
       lda 1       1          [A+2] Overlay number                         03340
       bmi                    Check if destroys system                     03341
       sta in                 yes                                          03342
       sto movid              and set in save location                     03343
       lda 2       1          [A+3] Get length mod 64                      03344
       sra 6                                                               03345
       sta molen              and save in length indicator                 03346
       lda 3       1          [A+4] Get memory address and extract         03347
       ext edmsk2             low-order end                                03348
       sta momem              memory location                              03349
       inx 4       1          [A+5] Step return address                    03350
       stx mkp     1          and save                                     03351
       lda movid              See if overlay called is already in memory   03352
       sub inov                                                            03353
       bze                                                                 03354
       bru sret               yes                                          03355
       stx movint  1          Set flag for interrupts                      03356
       ldx 8K      1          Do not destroy system's index registers      03357
       lda .syov.             Set entry to read in overlay                 03358
       sta iprior  1          Special treatment                            03359
       sta inov               Destroy overlay indicator                    03360
       set prq                Priority request                             03361
       set pst                and wait for process to finish               03362
       bru *-1                                                             03363
                                                                           03364
                                                                           03365
                                                                           03366
                        Overlay delete call deletes unneeded overlays.     03367
                        Return is to the first word after the spb.         03368
                                                                           03369
                                                                           03370
                                                                           03371
ovdel  ldz                    Reset indicator to show no overlay           03372
       sta movid                                                           03373
       bru sret               and get back                                 03374
                                                                           03375
       stl                    MESSG - type routine                         03376
       ttl                    Odds and ends                                03377
messg  ldx stack   0          Check stack                                  03378
       bxh 4       0                                                       03379
       bru 2       2          If three stacked up, crump                   03380
       inx 1       0          Bump up stack                                03381
       stx stack   0          and save                                     03382
       lda 1       2          Get pointer for message                      03383
       maq                                                                 03384
       lda .pms1.             Initial entry                                03385
       inx 1       2          Step for return                              03386
       ton                    Set for output                               03387
       bru insert                                                          03388
                                                                           03389
pms1   ldx typf    2          Check output flag                            03390
       bxh 1       2          If non-zero, then on                         03391
       bru 2       1          so try again later.                          03392
       lda 1       1          Address of message                           03393
       sta pcnt+1             and set in save location                     03394
       dld .pty.              Get entry                                    03395
       dst 0       1          and replace old                              03396
       stx typf    1          Set flag on and save pointer                 03397
pmore  inx 12      2          Set for first character                      03398
       stx pcnt    2          and save                                     03399
       ldx pcnt+1  2          Word pointer                                 03400
       lda 0       2          Get next word                                03401
       sta ptemp              and save it                                  03402
       inx 1       2          Step pointer                                 03403
       stx pcnt+1  2          and save it                                  03404
       bru 0       1          Then exit                                    03405
                                                                           03406
pty    ldx typf    1          Get branch word                              03407
       ldx pcnt    2          and get word pointer                         03408
       lda ptemp              Get word                                     03409
       sra 0       2          and shift for character [12, 6, 0]           03410
       ext mask7              Get rid of high-order bits                   03411
       cab peom               and check for end-of-message                 03412
       bru *+2                if not, OK                                   03413
       bru pdend              else crump                                   03414
       san 6                  Put character into N-register                03415
       typ                    and output it                                03416
       bxl 1       2          Check for new word needed                    03417
       bru pmore              if so, get it                                03418
       inx -6      2          Else set for next character                  03419
       stx pcnt    2          and save                                     03420
       bru 0       1          Exit                                         03421
                                                                           03422
pdend  lda stack              Decrement stack counter                      03423
       sbo                                                                 03424
       sta stack                                                           03425
       bze                    Do not reset unless stack at zero            03426
       kon                                                                 03427
       stx z2      1          Set for 'irase' exit                         03428
       ldz                    and reset flag                               03429
       sta typf                                                            03430
       bru irase              and exit                                     03431
                                                                           03432
       stl                    IREC, SPMESS, EFFY, CONVRT, TIME             03433
       ejt                                                                 03434
                                                                           03435
                        Debugging tape dump.  Writes lower memory          03436
                        from 0 to 'sclock'+3 - see how long tape           03437
                        takes to come ready by saving counts in dump       03438
                                                                           03439
                                                                           03440
irec   lac                                                                 03441
       add three              Wait two counts of clock                     03442
       sta temp                                                            03443
irecs  lac                    Now check                                    03444
       sub temp                                                            03445
       bpl                    If time up, exit                             03446
       bru 1       2                                                       03447
       bcs rtn     1          Else check tape                              03448
       bru irecx                                                           03449
       sel 1                  and write lots of stuff                      03450
       wtb 0       0                                                       03451
           sclock+3                                                        03452
       bru 1       2          and get out                                  03453
                                                                           03454
                                                                           03455
                        This routine waists for the Datanet-30 to          03456
                        answer all previous messages and then              03457
                        exits.                                             03458
                                                                           03459
                                                                           03460
spmess bss 0                                                               03461
       lqa                    Save message in Q                            03462
       lda pmbx0              and wait for any other messages to be        03463
       bpl                    acknowledged                                 03464
       bru *-2                Hope we don't hang too long                  03465
       laq                    Get message                                  03466
       sta pmbx0              and set in special mailbox                   03467
spmesx lda pmbx0              and wait for this message to be answered     03468
       bmi                    If negative, we are OK                       03469
       bru 1       2          so get back                                  03470
       bru spmesx             else wait for answer                         03471
                                                                           03472
                                                                           03473
                        EFFY is set up by the wait loop every 10           03474
                        minutes.  It waits for all peripheral              03475
                        activity to cease, then calls in an overlay        03476
                        which dumpes the efficiency summary info           03477
                        onto the disk.                                     03478
                                                                           03479
                                                                           03480
effy   lda bzyf               Wait for peripheral tasks to be completed    03481
       add stack              and wait for all typing to stop              03482
       bnz                                                                 03483
       bru 2       1                                                       03484
       spb irase   2          Erase entry                                  03485
       ldx zero    2          and get summary overlay                      03486
       inx summry  2                                                       03487
       bru pgetr                                                           03488
                                                                           03489
                                                                           03490
                                                                           03491
                        Conversion routine                                 03492
                                                                           03493
                                                                           03494
convrt ext mask6              Mask out sign bits                           03495
       srd 15                 Put most in Q                                03496
       sla 3                  Begin spacing with zeros                     03497
       sld 3                                                               03498
       sla 3                                                               03499
       sld 3                                                               03500
       sta mstemp                                                          03501
       ldz                                                                 03502
       sld 3                                                               03503
       sla 3                                                               03504
       sld 3                                                               03505
       sla 3                                                               03506
       sld 3                                                               03507
       lqa                                                                 03508
       lda mstemp                                                          03509
       bru 1       2          Return                                       03510
                                                                           03511
                        TIME - entered on xreg 2                           03512
                        uses temp and mstemp                               03513
                                                                           03514
time   lac                                                                 03515
       add h2                 Add 1 minute                                 03516
       sta itim               Save incremented time                        03517
       sub o400               Make it reasonable                           03518
       maq                                                                 03519
       dvd h1                 Get hours                                    03520
       dst mstemp                                                          03521
       maq                    [Move hours to Q]                            03522
       dvd ten                Convert to decimal                           03523
       bze                    Delete leading zeros                         03524
       lda o60                [If zero, get a blank]                       03525
       sla 6                  [Move char left one char position]           03526
       sta temp                                                            03527
       laq                    [Or in the second character]                 03528
       ory temp               [temp now has the hours]                     03529
       dld mstemp             [Get fractional hours in Q]                  03530
       lda zero                                                            03531
       dvd h2                 Get minutes                                  03532
       maq                    [Move minutes to Q]                          03533
       dvd ten                                                             03534
       sla 6                  [Tens of minutes in mstemp]                  03535
       dst mstemp             [minutes < 10 in mstemp+1]                   03536
       add mstemp+1           [Complete minutes in A]                      03537
       add colon                                                           03538
       maq                    [Leading colon, minutes in Q]                03539
       lda temp               [Hours in A]                                 03540
       add blzz               Leading blank                                03541
       bru 1       2          Return                                       03542
                                                                           03543
                                                                           03544
       loc 37000              Overlays go here                             03545
execov bss 1                  Normal peripheral entry point                03546
       bss 1                  System entry to peripherals                  03547
bres   bss 1                  Restart entry to peripherals                 03548
kbrun  bss 1                  Permission to run entry for batch processing 03549
       bss 508                Save some space                              03550
       tcd load                                                            03551
       stl                    Lister                                       03552
       ttl                    Peripheral overlays                          03553
                                                                           03554
                                                                           03555
                        Time-sharing lister.  Will list a deck of          03556
                        decimal cards, converting parentheses and          03557
                        other characters for printer compatibility.        03558
                        This lister is buffered and requires that the      03559
                        first card be in the hopper before starting.       03560
                        The deck must be followed by two blank cards.      03561
                                                                           03562
                        Error messages are printed on the console          03563
                        typewriter.                                        03564
                        At any time, depressing switch zero will           03565
                        cause all activity to halt.                        03566
                        For the 235, as follows...                         03567
                        C/P followed by a carriage return will             03568
                            produce a single-spaced, untranslated          03569
                            listing.  All other options must follow        03570
                            the following code...                          03571
                        S   Single spacing                                 03572
                        D   Double spacing                                 03573
                        N   Not translated                                 03574
                        T   Translated for printer compatibility           03575
                        C/P must be followed by two letters if an          03576
                        alternative option is selected,                    03577
                        as in  C/PST  followed by a CR.                    03578
                        After an error, depressing switch 2 will           03579
                        cause the listing to take up where it              03580
                        left off.                                          03581
                                                                           03582
                                                                           03583
       org pernum                                                          03584
       dec 0                                                               03585
       dec c/p                                                             03586
       org execov                                                          03587
       dld .lst.   3          Get entry                                    03588
       spb insert  2          and insert in list                           03589
       sta ovtsk                                                           03590
       bcs bpr     6                                                       03591
       bru lst1                                                            03592
       spb messg   2                                                       03593
       dec pnr                Printer not ready                            03594
       bru lndra                                                           03595
lst1   bcr                                                                 03596
       bru L235                                                            03597
       spb messg   2          Card reader not ready                        03598
       dec crn                                                             03599
       bru lndra                                                           03600
L235   ldz                                                                 03601
       sta lf                                                              03602
       lmo                                                                 03603
       sta llnt1                                                           03604
       sta llsd1                                                           03605
       spb lchar   1          Get next character from ty+1                 03606
       cab cr                 Check if carriage return                     03607
       bru *+2                                                             03608
       bru lsn                Go check all correct                         03609
       bxh 3       2          If not CR, and LF gte 3, then error          03610
       bru lerr1                                                           03611
       ldx 8K      2          Initialize looping variable                  03612
lst2   cab ltab    2                                                       03613
       bru *+2                                                             03614
       bru ltab+1  2          Go to indicated task                         03615
       inx 2       2          Increment                                    03616
       bxl 8       2          Test for end                                 03617
       bru lst2                                                            03618
lerr1  bru ild                Illegal task                                 03619
                                                                           03620
lsn    lda lf                 Check indicator                              03621
       cab two                                                             03622
       bru lsn1               Single spaced and untranslated               03623
       bru lerr1              lf equals 2, second char a CR, error         03624
       bru lista              done                                         03625
       oct 624537             S N CR                                       03626
lsn1   lda *-1     3          Easiest way to get N and S                   03627
       sta ty+1                                                            03628
       bru L235                                                            03629
                                                                           03630
lchar  ldx lf      2          Character picking up routine - easily        03631
       bxh 1       2          modified to other uses...                    03632
       bru lchar1             If greater than zero, then not first time    03633
       lda ty+1               Get second word                              03634
       sta lch3               Last character                               03635
       sra 6                                                               03636
       sta lch2               Middle character                             03637
       sra 6                  First character                              03638
lchar2 ext mask7              Get rid of higher-order end                  03639
       inx 1       2          and increment counter                        03640
       stx lf      2          and save                                     03641
       bru 1       1          Get out                                      03642
lchar1 lda lch2-1             Get character                                03643
       bru lchar2             and return                                   03644
                                                                           03645
                                                                           03646
ltab   alf 00N                No translation                               03647
       bru ln                                                              03648
       alf 00S                Single spacing                               03649
       bru ls                                                              03650
       alf 00D                Double spacing                               03651
       bru ld                                                              03652
       alf 00T                Translated                                   03653
       bru lt                                                              03654
                                                                           03655
ln     lda ln1     3                                                       03656
       sta lnt     3          Set up instruction                           03657
       bru llnt                                                            03658
                                                                           03659
lt     lda lt1     3                                                       03660
       sta lnt     3          Store                                        03661
       bru llnt                                                            03662
                                                                           03663
llnt   lda llnt1              Get counter                                  03664
       ado                    increment                                    03665
       bnz                                                                 03666
       bru lerr1              Some idiot did it again                      03667
       sta llnt1                                                           03668
       bru lchar                                                           03669
                                                                           03670
                                                                           03671
ls     lda lss     3          Get instructions                             03672
       sta lpr+1   3          [JSM: 9/30/02 Corrected, missing index 3]    03673
       lda L56     3          Number of lines per page                     03674
lscnt  sta lpage                                                           03675
       sta lncnt                                                           03676
       lda llsd1              Make sure no idiot tries both single and     03677
       ado                    double space                                 03678
       bnz                                                                 03679
       bru lerr1                                                           03680
       sta llsd1                                                           03681
       bru lchar              Go back for some more                        03682
                                                                           03683
ld     lda lss     3          Get instruction                              03684
       sla 1                  modify for double space                      03685
       sta lpr+1   3                                                       03686
       lda L56     3          and count                                    03687
       sra 1                                                               03688
       bru lscnt              and get out                                  03689
                                                                           03690
                                                                           03691
                                                                           03692
lst    ldz                    Entry point here                             03693
       bcs                    Check switch zero down                       03694
       bmi                                                                 03695
       bru 2       1          If so, out                                   03696
       ldx lpoin   2          Get exit point                               03697
       bru 1       2          and return                                   03698
                                                                           03699
                                                                           03700
                                                                           03701
lista  dld lareas  3          Get buffer areas                             03702
       dst lin                and set in flip-flops                        03703
       sta io1+27             [Trash first buffer's syncword location]     03704
       lac                    and set timing interval                      03705
       add six                                                             03706
       sta lctim                                                           03707
       lda cmessb             Do not acknowledge if batch on               03708
       bze                                                                 03709
       spb messg   2          Acknowledge receipt                          03710
       dec pcr                [Works because lda = 00]                     03711
       rcd io1                Read in first card                           03712
       hcr                                                                 03713
                                                                           03714
lslew  spb lret    2          Exit and wait                                03715
       bcs bpn     6          Punt if not ready                            03716
       bru 2       1                                                       03717
       sel 6                  Slew to top of page                          03718
       slt 8                                                               03719
       spb lret    3          then exit and wait again                     03720
       bcs bpn     6          punt and wait                                03721
       bru 2       1                                                       03722
       sel 6                  Slew 3 lines                                 03723
       slw 3                                                               03724
       lda lpage              Reset page count                             03725
       sta lncnt                                                           03726
                                                                           03727
                                                                           03728
list   spb lret    2          Exit and wait                                03729
       bcs bpn     6                                                       03730
       bru 2       1                                                       03731
       spb lhop    2          Now check hopper condition                   03732
       ldx lin     2          Area last read into                          03733
       lda 27      2          Check syncowrd                               03734
       add lsync   3                                                       03735
       bnz                    If not matched, card read error              03736
       bru lserr                                                           03737
       ldx lin+1   1          Area to be next read into                    03738
       stx lin     1          Flip-flop them                               03739
       stx lin+1   2                                                       03740
       sta 27      1          Zero out next syncword location              03741
       dld 0       2          Check for quote card                         03742
       dcb lquot   3                                                       03743
       bru *+2                No                                           03744
       bru lqchk              Yes, check rest                              03745
lndq   rcd 0       1          Read card otherwise                          03746
       hcr                                                                 03747
lnt    bru lppnt              [Default single-space no translation]        03748
lnt1   dld lmask   3          Mask for table lookup                        03749
                                                                           03750
                                                                           03751
lookp  lda 0       2          Pick up word to be translated                03752
       bmi                                                                 03753
       bru lprnt                                                           03754
       z13 z1                 Put mask into xreg 1 [dst odd location]      03755
       ory z1                 Put character into low-order end             03756
       sra 6                  Make room for new character                  03757
       add 0       1          Pick it up                                   03758
       z13 z1                 Second character                             03759
       ory z1                                                              03760
       sra 6                                                               03761
       add 0       1                                                       03762
       z13 z1                 Third character                              03763
       ory z1                                                              03764
       sra 6                                                               03765
       add 0       1                                                       03766
       sta 0       2          Put away word                                03767
       inx 1       2          Increment address register                   03768
       bru lookp              Return to loop                               03769
                                                                           03770
                                                                           03771
lprnt  lda lin+1                                                           03772
       sto lpr+1   3          Construct address                            03773
       sel 6                                                               03774
lpr    wpl 0                  Print line                                   03775
       sta z1                 Set address in register                      03776
       lmo                    Set end-of-line flag                         03777
       sta 27      1                                                       03778
       add lncnt              and decrement page counter                   03779
       bze                    If zero, set up to slew                      03780
       bru lslew                                                           03781
       sta lncnt                                                           03782
       bru list               Get back                                     03783
                                                                           03784
                                                                           03785
                                                                           03786
lret   stx lpoin   2          Save exit point                              03787
       ldx ovtsk   1          Get entry point                              03788
       bru 1       2          and get back again                           03789
                                                                           03790
                                                                           03791
lhop   bcn                    Check reader                                 03792
       bru lhop1              Test hopper not ready                        03793
       lac                    Step timer if OK                             03794
       add seven                                                           03795
       sta lctim              and save                                     03796
       bru 1       2          exit back                                    03797
lhop1  ldx lin     2          Get buffer address                           03798
       lda 27      2          and check syncword for hopper empty          03799
       cab lsync+1 3                                                       03800
       bru *+2                                                             03801
       bru lendr              End run for list if hopper empty             03802
       lac                    Time check                                   03803
       cab lctim              If time has run over, then                   03804
       bru 2       1          get out if time still good                   03805
       bru 2       1                                                       03806
       spb time    2          or unattended.  Type message and abort run.  03807
       dst lab1    3          Put away                                     03808
       spb messg   2          Type message                                 03809
       dec lab                Aborting list, date and time                 03810
       bru iredy              and crump                                    03811
                                                                           03812
                                                                           03813
                                                                           03814
                                                                           03815
lserr  spb messg   2          Type message                                 03816
       dec cre                Card read error                              03817
       spb lret    2          Exit and wait on switch 2 down               03818
       ldz                    Resume normal operations                     03819
       rcs                    2 is depressed                               03820
       ext mask6                                                           03821
       sla 2                                                               03822
       bno                                                                 03823
       bru 2       1                                                       03824
       ldx lin     2          Pick up address of buffer                    03825
       rcd 0       2          Read card                                    03826
       hcr                                                                 03827
       lac                    Pick up and compute delay time               03828
       add six                                                             03829
       sta lctim                                                           03830
       bru list               and get back and try again                   03831
                                                                           03832
                                                                           03833
lqchk  lda cmessb             Check background flag                        03834
       bze                                                                 03835
       bru lndq               If not on, crump immediately                 03836
lqchk1 ldx ovtsk   1          Get entry point                              03837
       spb irase   2          and erase it                                 03838
       ldx zero    2          Reset 2                                      03839
       inx batch   2          and set for batch monitor                    03840
       lmo                                                                 03841
       sta io1                Set front card in                            03842
       bru pgetb              Go get batch monitor                         03843
                                                                           03844
                                                                           03845
lndra  spb lret    2                                                       03846
       lda stack                                                           03847
       bnz                                                                 03848
       bru 2       1                                                       03849
       lda cmessb             Check batch flag                             03850
       bnz                                                                 03851
       bru lqchk1             get batch back                               03852
lendr  spb time    2          Pick up time                                 03853
       dst el1     3          Put it in type message                       03854
       spb messg   2          Type message                                 03855
       dec dl                 Done listing, time                           03856
       spb lret    2          Slew after list                              03857
       bcs brn     6                                                       03858
       bru 2       1          wait for printer                             03859
       sel 6                                                               03860
       slt 8                  and slew                                     03861
       spb irase   2          and erase entry                              03862
       ldz                    Reset some things                            03863
       sta bzyf                                                            03864
       sta ovtsk                                                           03865
       sta io1                So batch does not get fouled up.             03866
       bru 2       1          Crump right away                             03867
                                                                           03868
                                                                           03869
                                                                           03870
.lst.  spb lst     1                                                       03871
       dec -1                                                              03872
lmask  oct 0                                                               03873
       oct 3777700            Special geek mask for table lookup           03874
lareas dec io1                Area 1                                       03875
       dec io2                Area 2                                       03876
lsync  oct 1171701            Negation of syncword                         03877
       oct 3606077            Hopper-empty constant                        03878
louot  oct 777777             Double 0-7-8 punches                         03879
       oct 777777                                                          03880
lss    add 0                  printer instruction to slew 1 line           03881
L56    dec 56                 Number of lines per page                     03882
ln1    bru lprnt                                                           03883
lt1    bru lnt1                                                            03884
                                                                           03885
pnr    oct 374751             Printer not ready.                           03886
       alf INT                                                             03887
       alf ER                                                              03888
       alf NOT                                                             03889
       alf  RE                                                             03890
       alf ADY                                                             03891
       oct 333755                                                          03892
                                                                           03893
crn    bss 0                  Card reader not ready                        03894
       oct 372321                                                          03895
       alf RD                                                              03896
       alf REA                                                             03897
       alf DER                                                             03898
       alf  NO                                                             03899
       alf T R                                                             03900
       alf EAD                                                             03901
       oct 703337                                                          03902
       oct 557777                                                          03903
                                                                           03904
cre    oct 372321             Card read error                              03905
       alf RD                                                              03906
       alf REA                                                             03907
       alf D E                                                             03908
       alf RRO                                                             03909
       alf R B                                                             03910
       alf ACK                                                             03911
       alf SPA                                                             03912
       alf CE                                                              03913
       alf 1 C                                                             03914
       alf ARD                                                             03915
       alf  AN                                                             03916
       alf D T                                                             03917
       alf OGG                                                             03918
       alf LE                                                              03919
       alf 2 W                                                             03920
       alf HEN                                                             03921
       alf  RE                                                             03922
       alf ADY                                                             03923
       oct 333755                                                          03924
                                                                           03925
       ddc 0                                                               03926
       bss -2                                                              03927
lab    bss 0                  Aborting list -- time                        03928
       oct 372122                                                          03929
       alf ORT                                                             03930
       alf ING                                                             03931
       alf  LI                                                             03932
       alf ST.                                                             03933
       alf                                                                 03934
lab1   alf                                                                 03935
       alf                                                                 03936
       alf  HO                                                             03937
       alf URS                                                             03938
       oct 373755                                                          03939
                                                                           03940
       oct 0                                                               03941
       ddc 0                                                               03942
       bss -3                                                              03943
dl     bss 0                  Done listing - time                          03944
       oct 372446                                                          03945
       alf NE                                                              03946
       alf LIS                                                             03947
       alf TIN                                                             03948
       alf G.                                                              03949
el1    alf                                                                 03950
       alf                                                                 03951
       alf  HO                                                             03952
       alf URS                                                             03953
       oct 373755                                                          03954
                                                                           03955
                                                                           03956
       org t                  Temporary storage                            03957
lin    bss 2                                                               03958
lncnt  bss 1                                                               03959
lpage  bss 1                                                               03960
lctim  bss 1                                                               03961
lch2   bss 1                  Character storage - they must be in          03962
lch3   bss 1                  sequential order                             03963
llnt1  bss 1                                                               03964
llsd1  bss 1                                                               03965
lf     bss 1                  Character counter                            03966
lpoin  bss 1                  Entry pointer                                03967
                                                                           03968
                                                                           03969
       loc 37700              Lookup table for lister [*must be at 37700*] 03970
       oct 000000                                                          03971
       oct 010000                                                          03972
       oct 020000                                                          03973
       oct 030000                                                          03974
       oct 040000                                                          03975
       oct 050000                                                          03976
       oct 060000                                                          03977
       oct 070000                                                          03978
       oct 100000                                                          03979
       oct 110000                                                          03980
       oct 120000                2-8                                       03981
       oct 160000             #  6-8                                       03982
       oct 140000             at sign                                      03983
       oct 150000             -                                            03984
       oct 160000             =                                            03985
       oct 170000                                                          03986
       oct 200000                                                          03987
       oct 210000                                                          03988
       oct 220000                                                          03989
       oct 230000                                                          03990
       oct 240000                                                          03991
       oct 250000                                                          03992
       oct 260000                                                          03993
       oct 270000                                                          03994
       oct 300000                                                          03995
       oct 310000                                                          03996
       oct 320000                                                          03997
       oct 330000                                                          03998
       oct 760000             ]                                            03999
       oct 350000                                                          04000
       oct 360000                                                          04001
       oct 370000                                                          04002
       oct 400000                                                          04003
       oct 410000                                                          04004
       oct 420000                                                          04005
       oct 430000                                                          04006
       oct 440000                                                          04007
       oct 450000                                                          04008
       oct 460000                                                          04009
       oct 470000                                                          04010
       oct 500000                                                          04011
       oct 510000                                                          04012
       oct 520000                                                          04013
       oct 530000                                                          04014
       oct 540000                                                          04015
       oct 550000                                                          04016
       oct 560000                                                          04017
       oct 570000                                                          04018
       oct 600000                                                          04019
       oct 610000                                                          04020
       oct 620000                                                          04021
       oct 630000                                                          04022
       oct 640000                                                          04023
       oct 650000                                                          04024
       oct 660000                                                          04025
       oct 670000                                                          04026
       oct 700000                                                          04027
       oct 710000                                                          04028
       oct 720000                                                          04029
       oct 730000                                                          04030
       oct 750000             [                                            04031
       oct 750000             [                                            04032
       oct 760000             ]                                            04033
       oct 770000             End of translation table                     04034
       tcd lovwrt             List transfer                                04035
                                                                           04036
       stl                    Reproducer                                   04037
       ejt                                                                 04038
       org pernum                                                          04039
       dec 2                                                               04040
       dec c/c                                                             04041
                        Card reproducer                                    04042
                        Will reproduce any type of card deck.              04043
                        Buffered, with error checking.                     04044
                        Switch 0 down at any time will cause all           04045
                        activity to halt.                                  04046
                        Card read errors may be corrected by               04047
                        placing the top card from the out stacker          04048
                        (the last card read) in the read station           04049
                        and toggling switch two.                           04050
                                                                           04051
                                                                           04052
       org execov                                                          04053
       dld .rst.   3          Get entry                                    04054
       spb insert  2          and set up in list                           04055
       sta ovtsk                                                           04056
       sta z1                                                              04057
       lda 8K                 Set initialization entry                     04058
       sta rpoin                                                           04059
       bpr                    Crump if not ready                           04060
       bru *+4                                                             04061
       spb messg   2                                                       04062
       dec rpnr               Punch not ready                              04063
       bru rcmpa                                                           04064
       bcr                    [Test card reader]                           04065
       bru *+4                                                             04066
       spb messg   2                                                       04067
       dec rcrn               Reader not ready                             04068
       bru rcmpa                                                           04069
       lda cmessb             Check batch flag                             04070
       bze                    If on continue, else                         04071
       spb messg   2          acknowledge receipt                          04072
       dec pcr                [Works because lda = 00]                     04073
       dld zero               Zero out first syncwords                     04074
       dst io1+82                                                          04075
       rcf io1                Read first card                              04076
       lac                    Compute first time delay                     04077
       add six                                                             04078
       sta rinf               Save incremented time                        04079
       dld rads    3          Buffer addresses                             04080
       dst rin                                                             04081
       bru rep                and get out                                  04082
                                                                           04083
                                                                           04084
                                                                           04085
rst    ldx ovtsk   1          Make like all other overlays                 04086
       ldz                    This is the entry point                      04087
       rcs                    Check switch 0 own                           04088
       bmi                                                                 04089
       bru 2       1          Yes, crump for now                           04090
       ldx rpoin   2          Get pointer                                  04091
       bru 1       2          and get there                                04092
                                                                           04093
rret   stx rpoin   2          Temporary exit                               04094
       ldx ovtsk   1                                                       04095
       bru 2       1                                                       04096
                                                                           04097
                                                                           04098
                                                                           04099
rep    spb rret    2          Give things a chance to come ready           04100
       ldx rin     2          area last read into                          04101
       bcn                    If reader not ready, check hopper            04102
       bru rhop                                                            04103
       ldx rin+1   1          Next area                                    04104
       lda 82      2          Darned card reader... check if out of phase  04105
       ext rbit8   3          bit 8                                        04106
       bze                    if so, word before will have crap in it      04107
       lda 83      2          Check syncword                               04108
       add rsync   3                                                       04109
       bnz                    If not matched, reader error                 04110
       bru rderr                                                           04111
       sta 82      1          and set in word again                        04112
       dld 0       2          Check for quote cards                        04113
       dcb rquot   3                                                       04114
       bru *+2                No                                           04115
       bru rqchk              Yes, check rest of card and flag             04116
rnoq   stx rin+1   2          Else switch buffer addresses                 04117
       stx rin     1                                                       04118
       sta 83      1          zero out [overwrite] next area's syncword    04119
       wcf 0       2          Punch previous card                          04120
       rcf 0       1          read in next one                             04121
       bru rep                and start all over                           04122
                                                                           04123
                                                                           04124
rhop   lda 83      2          Hopper empty test                            04125
       add rsynch  3                                                       04126
       bze                    If matched, task completed                   04127
       bru rcmplt                                                          04128
       lac                    Check clock                                  04129
       cab rinf               Has time run over...                         04130
       bru 2       1          Just punt                                    04131
       bru 2       1                                                       04132
       spb messg   2          Else card reader not ready                   04133
       dec rcrn               Card reader not ready                        04134
       lac                    Set up new time count                        04135
       add cr                 long wait                                    04136
       sta rinf                                                            04137
       bru 2       1          Punt again                                   04138
                                                                           04139
                                                                           04140
rqchk  lda cmessb             Check back flag                              04141
       bze                    if not on, return                            04142
       bru rnoq                                                            04143
       dld rquot   3          Ekse check out card some more                04144
       dcb 2       2                                                       04145
       bru rnoq               No                                           04146
       bru *+2                                                             04147
       bru rnoq               Neither                                      04148
       dcb 4       2          Then check last word                         04149
       bru rnoq               Not Ok unless six 0-7-8 punches in a row     04150
       bru *+2                                                             04151
       bru rnoq                                                            04152
rqex   ldx ovtsk   1          Get entry's location                         04153
       spb irase   2          and erase entry                              04154
       ldx zero    2          Reset 2                                      04155
       inx batch   2          and set to get batch monitor                 04156
       lmo                                                                 04157
       sta io1                Set front card in                            04158
       bru pgetb              and get monitor                              04159
                                                                           04160
                                                                           04161
rcmpa  spb rret    2          [Either reader or punch not ready at start]  04162
       lda stack                                                           04163
       bnz                                                                 04164
       bru 2       1                                                       04165
       lda cmessb                                                          04166
       bnz                                                                 04167
       bru rqex                                                            04168
rcmplt spb time    2          Get time                                     04169
       dst rdat1   3          out away                                     04170
       spb messg   2          Type message                                 04171
       dec repc               Reproduction completed, time                 04172
       ldx ovtsk   1          Get task                                     04173
       spb irase   2          and erase task                               04174
       ldz                    zero out flags                               04175
       sta bzyf                                                            04176
       sta ovtsk                                                           04177
       sta io1                So batch does not get fouled up              04178
       bru 2       1          and exit                                     04179
                                                                           04180
                                                                           04181
rderr  spb messg   2          Type message                                 04182
       dec rcre               Card read error                              04183
       spb rret    2                                                       04184
       ldz                                                                 04185
       rcs                    Wait for switch 2 down before continuing     04186
       ext mask6                                                           04187
       sla 2                                                               04188
       bno                    Wait                                         04189
       bru 2       1          Not down                                     04190
       ldx rin     2          Pick up last-used read-in area               04191
       rcf 0       2          read a card                                  04192
       bru rep                and start up again                           04193
                                                                           04194
                                                                           04195
                                                                           04196
.rst.  rpr                    If punch ready, go to task, else not         04197
       spb rst     1                                                       04198
rads   dec io1                Buffer addresses                             04199
       dec io2                                                             04200
rouot  oct 1006                                                            04201
       oct 1007                                                            04202
rsync  oct 1770001            Syncword OK check                            04203
rsynch oct 0770001                                                         04204
rbit8  oct 4000               Bit 8 for special bad card check             04205
                                                                           04206
rpnr   bss 0                  Punch not ready                              04207
       oct 374764                                                          04208
       alf NCH                                                             04209
       alf  NO                                                             04210
       alf T R                                                             04211
       alf EAD                                                             04212
       oct 703337                                                          04213
       oct 557777                                                          04214
                                                                           04215
rcrn   bss 0                  Card Reader not ready                        04216
       oct 372321                                                          04217
       alf RD                                                              04218
       alf REA                                                             04219
       alf DER                                                             04220
       alf  NO                                                             04221
       alf T R                                                             04222
       alf EAD                                                             04223
       oct 703337                                                          04224
       oct 557777                                                          04225
                                                                           04226
       oct 0                                                               04227
       ddc 0                                                               04228
       bss -3                                                              04229
repc   bss 0                  Reproduction completed                       04230
       oct 375125                                                          04231
       alf PRO                                                             04232
       alf DUC                                                             04233
       alf TIO                                                             04234
       alf N C                                                             04235
       alf OMP                                                             04236
       alf LET                                                             04237
       alf ED.                                                             04238
       alf                                                                 04239
rdat1  alf                                                                 04240
       alf                                                                 04241
       alf  HO                                                             04242
       alf URS                                                             04243
       oct 373755                                                          04244
                                                                           04245
rcre   bss 0                  Card read error                              04246
       oct 372321                                                          04247
       alf RD                                                              04248
       alf REA                                                             04249
       alf D E                                                             04250
       alf RRO                                                             04251
       alf R B                                                             04252
       alf ACK                                                             04253
       alf SPA                                                             04254
       alf CE                                                              04255
       alf 1 C                                                             04256
       alf ARD                                                             04257
       alf  AN                                                             04258
       alf D T                                                             04259
       alf OGG                                                             04260
       alf LE                                                              04261
       alf 2 W                                                             04262
       alf HEN                                                             04263
       alf  RE                                                             04264
       alf ADY                                                             04265
       oct 333755                                                          04266
                                                                           04267
                                                                           04268
                                                                           04269
       org t                  Temporary storage                            04270
rin    bss 2                  Buffer areas flip-flop                       04271
rinf   bss 1                  Initial flag                                 04272
rpoin  bss 1                  Entry point                                  04273
       tcd lovwrt             Transfer                                     04274
                                                                           04275
       stl                    Catalogue printout                           04276
       ejt                                                                 04277
                                                                           04278
                        The catalogue printout, disk dump and              04279
                        Billing pack routines are all one package.         04280
                        The billing and the catalogue routines may         04281
                        be called separately by *BIL* or *CAT* res-        04282
                        pectively but the usual sequence is to call        04283
                        in the dump routine with *DUM*.  The dump          04284
                        then calls in the catalogue and billing            04285
                        routines.                                          04286
                                                                           04287
                        Memory allocation for the disk dump package        04288
                        is as follows...                                   04289
                                                                           04290
                        Catalogue temporary storage                        04291
                              4000 - 4077                                  04292
                        Printer buffer areas                               04293
                              4100 - 4477                                  04294
                        Catalogue Buffer #1                                04295
                              5000 - 6777                                  04296
                        Catalogue buffer #2                                04297
                              7100 - 11077                                 04298
                        Disk dump catalogue file area                      04299
                              11176 - 13177                                04300
                        Billing routine buffer area                        04301
                              13300 - 16777                                04302
                        Billing temporary storage                          04303
                              17000 - 17777                                04304
                        Catalogue file key                                 04305
                              20000 - 20577                                04306
                        Print line build area                              04307
                              20700 - 20777                                04308
                        Catalogue routine                                  04309
                              21000 - 21777                                04310
                        Billing routine                                    04311
                              22000 - 22777                                04312
                        Disk dump buffer #1                                04313
                              23076 - 27077                                04314
                        Disk dump buffer #2                                04315
                              27176 - 33177                                04316
                                                                           04317
                        CMESS is used as a flag and has the                04318
                        following code                                     04319
                           Bit 19 - dump in memory                         04320
                           Bit 18 - catalogue in memory                    04321
                           Bit 17 - billing in memory                      04322
                                                                           04323
                                                                           04324
                                                                           04325
pr     eqo 4100               Print line buffers [adrs end key-see CPL]    04326
cin1   eqo 5000               Catalogue file buffers                       04327
cin2   eqo 7100               Catalogue files                              04328
ckey   eqo 20000                                                           04329
catw   eqo 21000                                                           04330
                                                                           04331
jfile  eqo 11200                                                           04332
jbuf1  eqo 23100              Buffer 1                                     04333
jbuf2  eqo 27200              Buffer 2                                     04334
                                                                           04335
bin1   eqo 13300              Billing buffer area                          04336
biltmp eqo 17000              Billing temporary storage                    04337
billw  eqo 22000              Billing program                              04338
                                                                           04339
lcr1   eqo 23076                                                           04340
lcr2   eqo 27176                                                           04341
ltap   equ jfile                                                           04342
ltap1  equ ltap+28                                                         04343
                                                                           04344
                                                                           04345
                                                                           04346
       org pernum                                                          04347
       dec 4                                                               04348
       dec cat                                                             04349
                                                                           04350
                                                                           04351
                                                                           04352
       org execov                                                          04353
       lda three              Ask time to stop [wow - wish I could do that]04354
       spb spmess  2                                                       04355
       lda six                Ask for OFF                                  04356
       spb spmess  2                                                       04357
       dld *+4     3          Move catalogue down to where it should go    04358
       mov execov                                                          04359
       bru cata               and transfer it                              04360
       dec -1                 Spare                                        04361
       dec catw               All goes down                                04362
       dec -512                                                            04363
                                                                           04364
                                                                           04365
                                                                           04366
                        Catalog format                                     04367
                                                                           04368
                        Each entry in the catalog is 8 words long          04369
                        and containes information about a single           04370
                        saved program in the following format...           04371
                        Word 1 - first three characters of the user        04372
                                 number.                                   04373
                        Word 2 - second three characters                   04374
                        Word 3 - first three characters of problem         04375
                                 name.                                     04376
                        Word 4 - second three characters                   04377
                        Word 5 - beginning disk address of program         04378
                        Word 6 - ending disk address of program            04379
                        Word 7 - coded date on which program was last      04380
                                 accessed.                                 04381
                        Word 8 - presently contains only length            04382
                                 information - 0 if less than a half K,    04383
                                 1 if greater.                             04384
                                                                           04385
                        The end of the entries in a given catalog is       04386
                        signified by a 555555 appearing in word            04387
                        2.  If more than 127 programs are saved by users   04388
                        in a particular equivalence class, another         04389
                        1024-word block will be added to the catalog.      04390
                        The presence of another link is indicated          04391
                        as follows...in word 2 of what would be the        04392
                        128th entry will appear 373737.  The word          04393
                        before this will be the disk address of the        04394
                        added catalog.                                     04395
                                                                           04396
                                                                           04397
       org catw+10                                                         04398
cata   spb dskb    2          Go ask for disk                              04399
       spb dskop   2          Read in key to catalogue                     04400
       z12 6                  6 records, with labels                       04401
       dec ckey               memory address                               04402
       z20 key+2              inidirect to disk address                    04403
       bru *                  Should never ever return here                04404
       spb messg   2          Acknowledge request                          04405
       dec pcr                                                             04406
                                                                           04407
catb   spb dksop   2          Go read in date                              04408
       z12 1                  1 record                                     04409
       dec cin1               into area 1                                  04410
       oct 400                disk address                                 04411
       dec -1                 Should never return here                     04412
       spb relin   2          Give up disk                                 04413
       lda cmess              Set flag on to indicate calogue in           04414
       add two                                                             04415
       sta cmess                                                           04416
       spb time    2          Get time for heading line                    04417
       dst chead1  3                                                       04418
       sxg 5                  Set executive group                          04419
       set pst                and exit priority mode                       04420
       bru *+1     3                                                       04421
       ldx 8K      3          and make sure upper 8K bit is in right place 04422
       dld cinit   3          Get buffer flip-flops                        04423
       dst cin                                                             04424
       dld zero                                                            04425
       dst in                                                              04426
       sta cdass              Reset save area for address                  04427
       ldx zero    2                                                       04428
       lda ovflo                                                           04429
       dst cpnum   2          Set flag in program counters for decmode     04430
       inx 2       2                                                       04431
       bxl 16      2                                                       04432
       bru *-3                                                             04433
       lda nblnk              Negative blank for print line                04434
       sta p16     3                                                       04435
       sta perin              Knock out indicator                          04436
       ext sign               and reset sign bit                           04437
       lqa                    Copy in Q                                    04438
       dst p*0     3          and push over the line                       04439
       sta p1      3                                                       04440
       sta p2      3                                                       04441
       dst ptl     3                                                       04442
       inx 2       3                                                       04443
       bxl 40      3                                                       04444
       bru *-3                                                             04445
       lda mask6              Set end of line                              04446
       sta ptl-2   3                                                       04447
       ldx 8K      3          Reset register                               04448
       lda cin1               Pick up dlong - long programs counter        04449
       spb convrt  2          convert it                                   04450
       dst chdas2  3          Put away in heading line                     04451
       lda cin1+2             Pick up coded date                           04452
       spb convrt  2          convert it                                   04453
       dst chcode  3          put away in next heading line                04454
       dld ctdat   3          Move constant for date                       04455
       mov cin1+3                                                          04456
       sxg 4                  and use all sorts of index groups            04457
       ldx 8K      2          Set some registers                           04458
       ldx 8K      3                                                       04459
       lda ckey    2          Get first catalogue entry                    04460
       inx 1       2          and step for next                            04461
       sta cfilea+23          and set in parameter list                    04462
       sxg 3                                                               04463
       set pbk                                                             04464
       spb dramb   2          Get catalogue                                04465
       dec cfilea             File 1                                       04466
       set pst                                                             04467
       sxg 5                  and get into some decent group               04468
       spb slt8    2          Slew to top of page                          04469
       spb slw3    2          Slew page three lines                        04470
       lda linit   3          Initialize line counter at eight             04471
       sta cline                                                           04472
       bcs bpn     6          Wait for printer ready                       04473
       bru *-1                                                             04474
       sel 6                                                               04475
       z26 --                 [What's this?]                               04476
       z02 chead   1          Skip two lines when printing headers         04477
       bcs bpn     6          Wait again                                   04478
       bru *-1                                                             04479
       sel 6                                                               04480
       z26 --                                                              04481
       z02 chdass  1                                                       04482
       bcs brn     6          Wait                                         04483
       bru *-1                                                             04484
       sel 6                                                               04485
       z26 --                                                              04486
       z04 cdate   1          Coded date heading line                      04487
                                                                           04488
                                                                           04489
cloop  lda cin+1              Get next address                             04490
       sta xr52               and set in register                          04491
       sta cmore+1 3          and in indirect parameter                    04492
       sxg 4                  Get next catalogue address                   04493
       lda ckey    2                                                       04494
       inx 1       2                                                       04495
       sxg 5                                                               04496
       bmi                    Check the address                            04497
       bru crump1             If negative, stop                            04498
       bze                    If zero                                      04499
       bru cflip              then print last entry and crump              04500
       sta 2       2          set in parameter list                        04501
       sxg 3                                                               04502
       set pbk                                                             04503
                                                                           04504
cmore  spb dramb   2          Get catalogue                                04505
       z00 --                 Constructed indirect                         04506
       set pst                                                             04507
       sxg 5                                                               04508
       ldx cin     2          Get last used file address                   04509
       lda 3       2          and check done word                          04510
       bze                    Wait for disk to finish                      04511
       bru *-2                                                             04512
       bev                    If error, stop so we can see what and where  04513
       dec -1                                                              04514
cflip  lmo                    Set print flag                               04515
       sta pflag                                                           04516
       dld cin                Switch buffers                               04517
       xaq                                                                 04518
       dst cin                                                             04519
       ldx cin+1   2          Last entry is now +1                         04520
       lda 1       2          Get memory address                           04521
       sta xr52-1                                                          04522
       lda 2       2          and get address                              04523
       sta cadrs              save it for later                            04524
                                                                           04525
cscan  lda 1       1          Check for 55s in second word                 04526
       cab c55s    3                                                       04527
       bru *+2                If not, continue                             04528
       bru cloop              Else try again                               04529
       cab c37s    3          See if one of Kip's crazy catalogs           04530
       bru *+2                                                             04531
       bru ccon               Yep                                          04532
       lda bzyf               Check for crump                              04533
       bze                    If so, then flag will be zero                04534
       bru wait               so get out                                   04535
       lda pflag              Look at print flag                           04536
       bze                    If zero, special case                        04537
       bru pset               Wipe out disk address                        04538
       bpl                    If non-zero plus, get out                    04539
       bru pnext                                                           04540
       lda ovflo                                                           04541
       sta p3      3                                                       04542
cconk  bss 0                                                               04543
       lda cadrs                                                           04544
       spb convrt  2                                                       04545
       sta p*0+1   3          Move address over                            04546
       xaq                                                                 04547
       sta p0      3                                                       04548
       lda zero                                                            04549
       sta pflag                                                           04550
                                                                           04551
pnext  lda p3      3          Increment counter                            04552
       set pbk                                                             04553
       set decmode            for decimal mode arithmetic                  04554
       add one                                                             04555
       set binmode                                                         04556
       set pst                                                             04557
       sta p3      3          Put away counter                             04558
       dld 2       1          Problem number                               04559
       dst p6      3                                                       04560
       lda 4       1          Starting disk address                        04561
       ext mask1              Check for legal address                      04562
       cab o300                                                            04563
       bru *+3                                                             04564
       bru *+1                                                             04565
       spb cerr    2          No                                           04566
       lda 4       1          Get address again                            04567
       cab cdass              Check against last highest available         04568
       bru *+3                location for saved programs                  04569
       bru *+2                                                             04570
       sta cdass                                                           04571
       spb convrt  2          Convert it                                   04572
       dst p8      3                                                       04573
       lda 5       1          Ending disk address                          04574
       sub 4       1          Compute length of program                    04575
       bze                                                                 04576
       spb cerr    2          Zero-length is illegal                       04577
       bmi                    Check if length all wrong                    04578
       spb cerr    2          Yes                                          04579
       cab o100               Or out of bounds                             04580
       bru *+3                                                             04581
       bru *+2                                                             04582
       spb cerr    2          Yes                                          04583
       dld 0       1          User number                                  04584
       dst p4      3          put away                                     04585
       sub c77s    3          and see if hole                              04586
       bze                                                                 04587
       bru pnoc               If so, do not count it                       04588
       set pbk                                                             04589
       set decmode            Decimal mode for counting problems           04590
       lda 7       1          Length code                                  04591
       ext mask3              just low end of interest                     04592
       sla 1                  Double length table                          04593
       sta xr52               In group 5                                   04594
       dld cpnum   2                                                       04595
       dad cone    3          Increment                                    04596
       dst cpnum   2                                                       04597
       set binmode                                                         04598
       set pst                                                             04599
pnoc   lda 5       1          Pick up ending disk address again            04600
       spb convrt  2                                                       04601
       dst p10     3                                                       04602
       lda 6       1          Pick up coded date                           04603
       spb convrt  2                                                       04604
       dst p12     3                                                       04605
       lda 7       1          Pick up unused word                          04606
       spb convrt  2          convert'                                     04607
       dst p14     3                                                       04608
       lda cerrf              Check error flag                             04609
       bmi                                                                 04610
       spb cerr1   2                                                       04611
       dld pprnt   3          Get number of words in Q                     04612
       lda cpl     3          Get currently used buffer address            04613
       add o200               Switch it                                    04614
       ext o400                                                            04615
       sta cpl     3          and restore                                  04616
       mov P*0                Move into print area                         04617
       bcs bpn     6          Wait for printer                             04618
       bru *-1                                                             04619
       sel 6                                                               04620
       z36 cform   1          Format line                                  04621
cpl    z01 pr                 Print line                                   04622
       inx 8       1          Increment area pointer                       04623
       lda cline              Check if slew necessary                      04624
       add one                                                             04625
       sta cline              put away incremented counter                 04626
       cab c57     3          57 lines per page                            04627
       bru cscan              If less, go scan again                       04628
       lda three              Else reset counter                           04629
       sta cline              and slew page                                04630
       spb slt8    2          Slew to top                                  04631
       bcs bpn     6          Wait for printer                             04632
       bru *-1                                                             04633
       sel 6                                                               04634
       slw 1                  Slew one line at top                         04635
       lda ptl1    3          and get page                                 04636
       set pbk                                                             04637
       set decmode            Count [page number]                          04638
       ado                                                                 04639
       set binmode            get back                                     04640
       set pst                                                             04641
       sta ptl1    3                                                       04642
       bcs bpn     6          Wait again                                   04643
       bru *-1                                                             04644
       sel 6                                                               04645
       z26 --                                                              04646
       z03 ptl     1          Title print                                  04647
       bru cscan              go scan                                      04648
                                                                           04649
                                                                           04650
pset   lda dumpbl             Blanks                                       04651
       sta p*0+1   3          Wipe out disk address                        04652
       sta p0      3                                                       04653
       sta p1      3                                                       04654
       sta pflag              Reset flag to positive                       04655
       bru pnext              Get back                                     04656
                                                                           04657
                                                                           04658
                        This is used to fudge the right catalog when       04659
                        a linked one is found.  It reads the linked        04660
                        catalog over the one it just listed and            04661
                        then lists it.                                     04662
ccon   bss 0                                                               04663
       ldx cin+1   2                                                       04664
       lda 1       2          Fudge right catalog                          04665
       sta cconl+1 3                                                       04666
       lda 0       1                                                       04667
       sta cconl+2 3                                                       04668
       sta cadrs                                                           04669
       set pbk                                                             04670
       spb dramb   2                                                       04671
       dec cconl                                                           04672
       set pst                                                             04673
       lda cconl+3 3                                                       04674
       bze                                                                 04675
       bru *-2                Wait till done                               04676
       bev                                                                 04677
       bru *                  [Hang on error]                              04678
       lda cconl+1 3                                                       04679
       sta xr52-1                                                          04680
       bru cconk                                                           04681
                                                                           04682
                        Catalog printout finished, determine next          04683
                        available location and number of programs.         04684
                                                                           04685
crump1 spb slw3    2          Slew three lines                             04686
       lda cdass              Next available location for saved programs   04687
       add o100               round up                                     04688
       sta cdass              save                                         04689
       ext mask1              Check legality                               04690
       sub o300                                                            04691
       bpl                    Bad                                          04692
       bru *+3                                                             04693
       ldz                    OK                                           04694
       bru *+2                                                             04695
       lda o100                                                            04696
       add cdass              Get good address                             04697
       spb convrt  2          convert it                                   04698
       dst ccom2   3          put away                                     04699
       bcs bpn     6                                                       04700
       bru *-1                                                             04701
       sel 6                  Print it                                     04702
       z26 --                                                              04703
       z02 ccom1   1                                                       04704
                        Now start totalling progams                        04705
crump2 ldx zero    2          Loop counter                                 04706
       bcs bpn     6          Wait at start                                04707
       bru *-1                                                             04708
       dld cpnum   2          Number of programs                           04709
       cab ovflo                                                           04710
       bru *+1                                                             04711
       add cig1    3          Delete right number of characters            04712
       add cig2    3                                                       04713
       dst ctotp   3          Total programs                               04714
       set pbk                                                             04715
       set decmode                                                         04716
       dld cpnum   2                                                       04717
       dad ctot6   3          Keep total programs                          04718
       dst ctot6   3                                                       04719
       set binmode                                                         04720
       set pst                                                             04721
       lda xr52               Get counter                                  04722
       sra 1                                                               04723
       add cig2    3          Do not want zeros                            04724
       sta cend1   3          Put in print line                            04725
       sel 6                  Print it                                     04726
       wpl cend1                                                           04727
       inx 2       2                                                       04728
       bxl 12      2                                                       04729
       bru crump2+1           Start again                                  04730
       spb slw3    2          Slew three lines                             04731
       dld ctot+6  3          Get rid of high-order zeros on this too      04732
       cab ovflo                                                           04733
       bru *+1                                                             04734
       add cig1    3                                                       04735
       add cig2    3                                                       04736
       dst ctot6   3                                                       04737
       bcs bpn     6                                                       04738
       bru *-1                                                             04739
       sel 6                  Print total programs                         04740
       z24 --                                                              04741
       dec ctot                                                            04742
       spb slt8    2                                                       04743
       lda cmess              Delete catalogue from roster                 04744
       sub two                                                             04745
       sta cmess                                                           04746
       bnz                                                                 04747
       bru wait               Yes, so crump                                04748
       bru icrump             and type message                             04749
                                                                           04750
                                                                           04751
cerr   lmo                    Set flag                                     04752
       sta cerrf   3                                                       04753
       bru 1       2          and get out                                  04754
cerr1  dld ****    3          Get asterisks                                04755
       dst p12     3          and set in last words                        04756
       dst p14     3                                                       04757
       ldz                    Reset flag                                   04758
       sta cerrf   3                                                       04759
       bru 1       2          and get out                                  04760
                                                                           04761
                                                                           04762
slw3   bcs bpn     6          Wait                                         04763
       bru *-1                                                             04764
       sel 6                                                               04765
       slw 3                                                               04766
       bru 1       2                                                       04767
                                                                           04768
                                                                           04769
slt8   bcs bpn     6                                                       04770
       bru *-1                                                             04771
       sel 6                                                               04772
       slw 8                                                               04773
       bru 1       2                                                       04774
                                                                           04775
                        Constants                                          04776
                                                                           04777
                                                                           04778
                                                                           04779
cfilea z12 16                 Read, 16 records - file parameter list       04780
       dec cin1               Area 1                                       04781
       z00 --                 Constructed disk address                     04782
       z00 --                 Special terminate word                       04783
                                                                           04784
cfileb z12 16                                                              04785
       dec cin2                                                            04786
       z00 --                                                              04787
       z00 --                                                              04788
                                                                           04789
                                                                           04790
                                                                           04791
cconl  z12 16                                                              04792
       z00 --                                                              04793
       z00 --                                                              04794
       z00 --                                                              04795
                                                                           04796
                                                                           04797
c37s   oct 373737                                                          04798
c57    dec 57                 Number of lines per page                     04799
c77s   oct 777777                                                          04800
****   alf ***                Special indicators                           04801
       alf ***                                                             04802
cinit  dec cfilea             Areas flip flop                              04803
       dec cfileb                                                          04804
ctdat  dec chead2             Move constant for date                       04805
       dec -5                                                              04806
cone   oct 0                                                               04807
       oct 1                                                               04808
pprnt  dec 0                  Print move constant                          04809
       dec -19                                                             04810
c55s   oct 555555                                                          04811
linit  dec 11                 Initial value for line counter               04812
cerrf  oct 0                  Flag                                         04813
cig1   oct 35                                                              04814
cig2   oct 603500                                                          04815
                                                                           04816
                        Format line                                        04817
                                                                           04818
cform  oct 353535                                                          04819
       oct 353535                                                          04820
       oct 353535                                                          04821
       oct 353535                                                          04822
       oct 373757                                                          04823
       oct 353535                                                          04824
       oct 363535                                                          04825
       oct 353535                                                          04826
       oct 363535                                                          04827
       oct 353535                                                          04828
       oct 363535                                                          04829
       oct 353535                                                          04830
       oct 363535                                                          04831
       oct 353535                                                          04832
       oct 363535                                                          04833
       oct 353535                                                          04834
       oct 363535                                                          04835
       oct 353535                                                          04836
       oct 353535                                                          04837
                                                                           04838
                        General heading line                               04839
                                                                           04840
       oct 0                  Make into odd location                       04841
       ddc 0                                                               04842
       org *-3                                                             04843
chead  alf DAR                Dartmouth College Time-Sharing System        04844
       alf TMO                Catalogue files as of   date                 04845
       alf UTH                                                             04846
       alf  CO                                                             04847
       alf LLE                                                             04848
       alf GE                                                              04849
       alf TIM                                                             04850
       alf E-S                                                             04851
       alf HAR                                                             04852
       alf ING                                                             04853
       alf  SY                                                             04854
       alf STE                                                             04855
       alf M C                                                             04856
       alf ATA                                                             04857
       alf LOG                                                             04858
       alf UE                                                              04859
       alf FIL                                                             04860
       alf ES                                                              04861
       alf AS                                                              04862
       alf OF                                                              04863
chead2 alf                    Date goes in these five locations            04864
       alf                                                                 04865
       alf                                                                 04866
       alf                                                                 04867
       alf                                                                 04868
       alf   T                                                             04869
       alf IME                                                             04870
chead1 alf                    Time goes in these two locations             04871
       alf                                                                 04872
       alf  HO                                                             04873
       alf URS                                                             04874
       oct 2336060                                                         04875
                                                                           04876
                        Second heading line                                04877
                                                                           04878
       oct 0                  Make sure chdass is even                     04879
chdass oct 353545             [Next available location for saved ]         04880
       alf EXT                [programs is]                                04881
       alf  AV                                                             04882
       alf AIL                                                             04883
       alf ABL                                                             04884
       alf E L                                                             04885
       alf OCA                                                             04886
       alf TIO                                                             04887
       alf N F                                                             04888
       alf OR                                                              04889
       alf SAV                                                             04890
       alf ED                                                              04891
       alf PRO                                                             04892
       alf GRA                                                             04893
       alf MS                                                              04894
       alf IS                                                              04895
chdas2 alf                    Dassgn foes in these two locations           04896
       alf                                                                 04897
       oct 2336060                                                         04898
                                                                           04899
                        Third heading line                                 04900
                                                                           04901
cdate  oct 353523             Coded date--                                 04902
       alf ODE                                                             04903
       alf D D                                                             04904
       alf ATE                                                             04905
       oct 404060                                                          04906
chcode alf                    Coded date goes in these two locations       04907
       alf                                                                 04908
       oct 2336060                                                         04909
                                                                           04910
                        Computed next available location                   04911
                                                                           04912
ccom1  alf COM                                                             04913
       alf PUT                                                             04914
       alf ED                                                              04915
       alf NEX                                                             04916
       alf T A                                                             04917
       alf VAI                                                             04918
       alf LAB                                                             04919
       alf LE                                                              04920
       alf LOC                                                             04921
       alf ATI                                                             04922
       alf ON                                                              04923
       OCT 601660             Equal sign                                   04924
       oct 353535             Ignores                                      04925
ccom2  alf                                                                 04926
       alf                                                                 04927
       oct 2336060                                                         04928
                                                                           04929
                        Terminating lines for catalog printout             04930
                                                                           04931
cend1  alf                                                                 04932
       alf  LE                                                             04933
       alf NGT                                                             04934
       alf H P                                                             04935
       alf ROG                                                             04936
       alf RAM                                                             04937
       alf S =                                                             04938
ctotp  alf                                                                 04939
       alf                                                                 04940
       oct -336060                                                         04941
       oct 0                  Make next even                               04942
ctot   alf  TO                                                             04943
       alf TAL                                                             04944
       alf  PR                                                             04945
       alf OGR                                                             04946
       alf AMS                                                             04947
       alf  =                                                              04948
ctot6  ddc 0                                                               04949
       oct -336060                                                         04950
                                                                           04951
                        Print line build area                              04952
                                                                           04953
       loc 20700                                                           04954
p*0    bss 2                  Leading blanks                               04955
p0     bss 1                                                               04956
p1     bss 1                                                               04957
p2     bss 1                                                               04958
p3     bss 2                                                               04959
p4     bss 2                                                               04960
p6     bss 2                                                               04961
p8     bss 2                                                               04962
p10    bss 2                                                               04963
p12    bss 2                                                               04964
p14    bss 2                                                               04965
p16    bss 1                                                               04966
ptl    bss 40                 Save 40 places for title                     04967
ptl1   equ ptl+38                                                          04968
                                                                           04969
                        Temporary storage                                  04970
                                                                           04971
       org k6area                                                          04972
cin    bss 2                                                               04973
cpnum  bss 16                 Counters for programs                        04974
cdass  bss 1                                                               04975
cadrs  bss 1                                                               04976
pflag  bss 1                                                               04977
cline  bss 1                                                               04978
                                                                           04979
                                                                           04980
       org k2area             Special fudging routine                      04981
excv   equ execov                                                          04982
       dec excv+10                                                         04983
       dec -502                                                            04984
catmov dld *-2                Move catalogue up for loading onto disk      04985
       mov cata                                                            04986
       bru lovwrt             and go write overlay                         04987
                                                                           04988
       tcd lovwrt                                                          04989
                                                                           04990
       stl                    Disk dump                                    04991
       ejt                                                                 04992
                                                                           04993
                        Time-sharing disk dump.                            04994
                        The following areas will be dumped...              04995
                        1) The first half of disk zero                     04996
                        2) The catalogue files                             04997
                        3) All saved programs                              04998
                        Usually only one tape will be required,            04999
                        and it should be mounted on handler 3.             05000
                        If a second tape were to be required, the          05001
                        program will ask for it via the console            05002
                        typewriter and wait for zero to be toggled.        05003
                        The second tape must be placed on handler          05004
                        7.  In this case tape three will have to           05005
                        be rewound manually.                               05006
       org pernum             Heading information                          05007
       dec 6                                                               05008
       dec dum                                                             05009
                                                                           05010
       org execov                                                          05011
       lda three              Ask for time count stop                      05012
       sbp spmess  2                                                       05013
       lda six                Ask for OFF                                  05014
       spb spmess  2                                                       05015
       lda wait1              Reset P-counter                              05016
       sta pct                                                             05017
       lmo                    Reset some indicators                        05018
       sta perin              Peripheral indicator                         05019
       sta in                 System indicator                             05020
       ldo                    Set cmess                                    05021
       sta cmess                                                           05022
       spb dskb    2          Ask for disk                                 05023
       spb dskop   2          and read in tape routine                     05024
       z12 3                  300 octal words                              05025
       dec treqst                                                          05026
       z20 tap+2              Indirect to disk address                     05027
       bru *                  Should never happen                          05028
       spb treqst  2          Then use it                                  05029
       sel 1                  to rewind tape 3                             05030
       rwd         3                                                       05031
       oct 0                  Flag to indicate return                      05032
       spb dskop   2          Read in catalogue routine                    05033
       z12 8                  1K octal                                     05034
       dec catw                                                            05035
       z20 cat+2              Indirect to address                          05036
       bru *                  Neither should it return here                05037
       spb dskop   2          Read in key to catalogue                     05038
       z12 6                  6 records, with labels for dump              05039
       dec ckey               Key area                                     05040
       z20 ckey+2             Indirecto to disk address                    05041
       bru *                  Real trouble if it returns here              05042
       spb dskop   2          Read in billing routine                      05043
       z12 8                                                               05044
       dec billw                                                           05045
       z20 bil+2              Indirect to disk address                     05046
       bru *                                                               05047
       dld .jlnk.  3          Get linkage to dump routine                  05048
       spb insert  2          and insert in task list                      05049
       sta jlist              Save entrance                                05050
       bru catb               and transfer to catalogue                    05051
                                                                           05052
                                                                           05053
                        JLNK is entered after the catalogue routine        05054
                        is initialized, and it writes labels on            05055
                        tapes and types them out and does other odd        05056
                        things.                                            05057
                                                                           05058
                                                                           05059
jlnk   lda 1       1          Switch entries for rest of time              05060
       sta 0       1                                                       05061
       dld jinit   3          Points to jfila, jfileb                      05062
       dst jin                                                             05063
       spb dramb   2          Pick up first 2K from disk zero              05064
       dec jfila                                                           05065
       dld lab3               Get date                                     05066
       mov sdate+1                                                         05067
       spb time    2          and time                                     05068
       dst dlab2   3                                                       05069
       lmo                    Set flag word negative                       05070
       sta dlab5              to indicate tape #1                          05071
       spb jexec   2          and exit with return saved                   05072
       bcs brw     1          Wait for tape to finish rewinding            05073
       bru 2       1          If so [rewinding], exit                      05074
       spb billi   2          Initialize billing routine                   05075
       spb treqst  2          Write label                                  05076
       sel 1                                                               05077
       wtb dlab1   3                                                       05078
           30                                                              05079
       oct 0                                                               05080
       spb jexec   2          Do not overload task table                   05081
       lda *-2                                                             05082
       bze                    If label not done, crump                     05083
       bru 2       1                                                       05084
       spb messg   2          and type message                             05085
       dec dlab1              label                                        05086
       spb messg   2          and time                                     05087
       dec dumtim                                                          05088
                                                                           05089
                                                                           05090
                                                                           05091
                        JLOOPA reads in the first half of disk zero        05092
                        and writes it on the dump tape                     05093
                                                                           05094
                                                                           05095
                                                                           05096
jloopa spb jexec   2          Exit                                         05097
       ldx jin     2          Points to current file                       05098
       spb jchk    0          See if any errors                            05099
       spb jtape   1          Go write records on tape                     05100
       ldx jin     2          Get file addresses again                     05101
       ldx jin+1   1                                                       05102
       lda 2       2          Disk addresses                               05103
       cab jlast   3          and check for end first half disk zero       05104
       bru *+2                                                             05105
       bru jlba               exit if so                                   05106
       add o100               Step 2K                                      05107
       sta 2       1          and set in next file                         05108
       ext mask1              Check for illegal                            05109
       cab o300                                                            05110
       bru *+5                OK                                           05111
       bru *+1                No, so step position                         05112
       lda 2       1                                                       05113
       add o100                                                            05114
       sta 2       1                                                       05115
       stx jin+1   2          Flip flop buffer addresses                   05116
       lda z1                 Get next one                                 05117
       sta jin                                                             05118
       sta *+2     3          and set in calling pointer                   05119
       spb dramb   2          Pick up next 2K                              05120
       dec jfilb                                                           05121
       bru jloopa             and get next                                 05122
                                                                           05123
                                                                           05124
                        JLBA picks up catalogue files as indicated         05125
                        by addresses in the key.                           05126
                                                                           05127
                                                                           05128
jlba   ldx 8K      2          Begin saved programs dump                    05129
       stx jkey    2          Initialize catalogue pointer                 05130
jlbb   ldx jkey    2          Get file pointer                             05131
       lda ckey    2          and entry for file                           05132
       bze                    Check for all done                           05133
       bru jend               Yes, so terminate dump                       05134
       inx 1       2          Step pointer                                 05135
       stx jkey    2          and save                                     05136
jlcn   sta jfilc+2 3                                                       05137
       spb jexec   2          Now exit                                     05138
       lda jtflg   3          and check to make sure last entry written    05139
       bze                    on tape if one file empty                    05140
       bru 2       1          Wait if not                                  05141
       spb dramb   2          If OK, bring in file                         05142
jlfdg  dec jfilc              Fudge factor                                 05143
       spb jexec   2          and exit                                     05144
       lda jdfilc  3                                                       05145
       sta z2                                                              05146
       spb jchk    0          See if any errors                            05147
       lda jlfdg   3          Get fudge constant                           05148
       sta z2                 and set in register 2                        05149
       spb jtape   1          Write file on tape                           05150
       lda jfilc+1 3          Get memory address and initialize running    05151
       sub jeig               dec 8                                        05152
       sta jkvar              pointer                                      05153
       sta z2                 and set in register                          05154
       bru jl1;               and begin saving programs                    05155
                                                                           05156
                                                                           05157
                        JLOOPB picks up saved programs according to        05158
                        the entries in each individual catalogue           05159
                        file, and writes them out onto the dump            05160
                        tape.                                              05161
                                                                           05162
                                                                           05163
jloopb spb jexec   2          Exit                                         05164
       ldx jin+1   2          Get current entry pointer                    05165
       spb jchk    0          See if any errors                            05166
       spb jtape   1          Write out just-read program                  05167
jl1    ldx jkvar   2          Get running pointer                          05168
       inx 8       2          and step                                     05169
       stx jkvar   2          save                                         05170
       lda 1       2          Check for end file                           05171
       cab c37s               check linked catalo                          05172
       bru *+2                                                             05173
       bru jl2                Get next link                                05174
       cab j55s               See if end of catalog file                   05175
       bru *+2                No                                           05176
       bru jlbb               Get next catalog record                      05177
       cab c77s    3          See if hole                                  05178
       bru *+2                No                                           05179
       bru jl1                Yes, just skip it                            05180
       lda 4       2          Get starting disk address                    05181
       ext mask1                                                           05182
       cab o300               Check for legal                              05183
       bru *+3                                                             05184
       bru jl1                No, crump it                                 05185
       bru jl1                                                             05186
       lda 5       2          Get length                                   05187
       sub 4       2                                                       05188
       sra 1                  Mod 64                                       05189
       bpl                    Check if bad length, such as                 05190
       bze                    zero                                         05191
       bru jl1                or negative                                  05192
       cab o40                or too long                                  05193
       bru *+3                                                             05194
       bru *+2                                                             05195
       bru jl1                                                             05196
       ldx jin+1   1          Get pointer to next parameter list           05197
       sto 0       1          and set length in command                    05198
       lda 4       2          Get address again                            05199
       sta 2       1          and set in parameter list                    05200
       dld jin                Flip entries                                 05201
       xaq                                                                 05202
       dst jin                                                             05203
       sta *+2     3          and in call                                  05204
       spb dramb   2          Now read a program                           05205
       dec 0                  Constructed parameter list pointer           05206
                        These are fudges for buffering.  Skip              05207
                        write out prgram first time through and            05208
                        make sure last one gets written                    05209
       lda *+4     3          Get branch for next time                     05210
       sta *-1     3                                                       05211
       sta jloopb-13          Make sure last program gets written          05212
       bru jl1                and get next program                         05213
       bru jloopb             Normal entrance                              05214
                                                                           05215
jl2    lda 0       2          This is a fudge to get extended catalog      05216
       bru jlch               and get it                                   05217
                                                                           05218
                        JTAPE is entered on xreg1.  Index register 2       05219
                        points to the disk parameter list                  05220
                        containing the information about the record        05221
                        to be written on the tape.                         05222
                        This information becomes part of each tape         05223
                        record in a special two-word key at the            05224
                        beginning of each one, as follows.                 05225
                                                                           05226
                           word 1 - disk address                           05227
                           word 2 - length (mod 64)                        05228
                                                                           05229
                                                                           05230
jtape  stx jtmp    1          Save entrance                                05231
       stx jtmpp   2          and save other                               05232
       spb jexec   2          and exit                                     05233
       lda jtflg   3          Get completion flag                          05234
       bze                    If zero, not yet done                        05235
       bru 2       1                                                       05236
       sra 1                  Check for end of tape                        05237
       bod                                                                 05238
       bru jswtch             in which case change tapes                   05239
jt2    ldx jtmpp   2          Get file pointer                             05240
       lda 1       2          and get memory address                       05241
       sub two                decrement for key                            05242
       sta z1                 and set in register                          05243
       lda jtap+2  3          Get operation                                05244
       ext mask11             less address                                 05245
       add z1                 and add memory address                       05246
       sta jtap+2  3          Then set in call                             05247
       lda 0       2          Get length                                   05248
       ext mask10             extract high-order end                       05249
       sta 1       1          and set in key                               05250
       sla 6                  and set as # of records                      05251
       add two                incremented for key                          05252
       sto jtap+3  3          in call                                      05253
       lda 2       1          Set disk address in key                      05254
       sta 0       1                                                       05255
jtap   spb treqst  2          Write record on tape                         05256
       sel 1                                                               05257
       wtb --      3          Constructed                                  05258
           0                                                               05259
jtflg  oct 1                  Flag word - initialized                      05260
       ldx jtmp    1          Get return                                   05261
       bru 1       1          and return                                   05262
                                                                           05263
                                                                           05264
                                                                           05265
jexec  stx jpoin   2          Save caller                                  05266
       ldx jlist   1          Get entrance point                           05267
       bru 1       2          get back                                     05268
                                                                           05269
jent   ldx jpoin   2          Get caller                                   05270
       bru 1       2          and return                                   05271
                                                                           05272
                                                                           05273
                                                                           05274
jswtch lda jtap+3  3          Check for tape 7 already                     05275
       bmi                    If so, real trouble                          05276
       bru jtroub                                                          05277
       spb messg   2          Else type message to change tapes            05278
       dec t07                                                             05279
       lda sign               Now switch handlers                          05280
       ory jtap+3  3                                                       05281
       ory jend0+3 3          [jsm: *** CLEARLY AN ERROR *** was jend0+3]  05282
       ory jend1+3 3                                                       05283
       spb treqst  2          and rewind old tape                          05284
       sel 1                                                               05285
       rwd         3                                                       05286
       oct 0                                                               05287
       spb jexec   2          Exit                                         05288
       ldz                    and wait for 2 to be toggled                 05289
       rcs                                                                 05290
       sla 2                                                               05291
       bno                                                                 05292
       bru 2       1          Exit if not down yet                         05293
       ldz                    Set flag for second label                    05294
       sta dlab5.3                                                         05295
       spb treqst  2          and write it on second tape which had better 05296
       sel 1                  be rewound                                   05297
       wtb dlab1   7          Write label out on 7                         05298
           30                                                              05299
       oct 0                                                               05300
       spb jexec   2          Exit and wait for label to be done           05301
       lda *-2                                                             05302
       bze                                                                 05303
       bru 2       1                                                       05304
       bru jt2                                                             05305
                                                                           05306
jtroub spb messg   2          Type message and abort run                   05307
       dec psoo                                                            05308
                                                                           05309
                        JEND must write out the last program which is      05310
                        still in memory                                    05311
                                                                           05312
jend   spb jexec   2          Exit first                                   05313
       ldx jin+1   2          Get current file entry pointer               05314
       spb jchk    0          Check disk                                   05315
       spb jtape   1          Write on tape                                05316
       spb jexec   2          Exit again                                   05317
       lda jtflg   3          Check done                                   05318
       bze                                                                 05319
       bru 2       1          Not yet                                      05320
jend0  spb treqb   2          Now rewind 3 - or 7 as may be                05321
       sel 1                  and write end-of-file on three - or 7        05322
       wef         3                                                       05323
       oct 0                                                               05324
jend1  spb treqb   2                                                       05325
       sel 1                                                               05326
       rwd         3                                                       05327
       oct                                                                 05328
       spb jexec   2          Exit and wait                                05329
       lda *-2     3          Keep checking                                05330
       bze                    punt if not done                             05331
       bru 2       1                                                       05332
       lda cmess              Decrement flag to indicate completion        05333
       sbo                                                                 05334
       sta cmess                                                           05335
       sra 2                  Check for billing in                         05336
       bev                                                                 05337
       spb tclos   2          If not, close out tape routine               05338
       ldx jlist   1          Get entry point                              05339
       spb irase   2          and erase                                    05340
       lda cmess                                                           05341
       bze                    Check if billing or catalogue still in       05342
       bru icrump             if none, exit and type message               05343
       bru 2       1          Exit                                         05344
                                                                           05345
jchk   lda 3       2          Check for file read                          05346
       bze                                                                 05347
       bru 2       1          If not, punt                                 05348
       stx rawt    0          Save entrance                                05349
       bev                    Hang if any errors                           05350
       bru *                  not recovered                                05351
       ldx rawt    1                                                       05352
       bru 1       1          Return                                       05353
                                                                           05354
                                                                           05355
                        Disk parameter lists                               05356
                                                                           05357
                                                                           05358
jfila  z12 32                 Read in first half of disk zero              05359
       dec jbuf1              into buffer #1                               05360
       dec 0                  constructed                                  05361
       dec 0                  completion indicator                         05362
                                                                           05363
jfilb  z12 32                 Read 2K                                      05364
       dec jbuf2              Buffer 2                                     05365
       dec 0                  constructed                                  05366
       dec 0                  completion indicator                         05367
                                                                           05368
jfilc  z12 16                 Special file for catalogues                  05369
       dec jfile                                                           05370
       dec 0                                                               05371
       dec 0                                                               05372
                                                                           05373
                                                                           05374
                                                                           05375
.jlnk. spb jlnk    1          Linkage entry for first time                 05376
       spb jent    1          subsequent times entry                       05377
jinit  dec jfila              Files flip flop                              05378
       dec jfilb                                                           05379
jdfilc dec jfilc                                                           05380
dlab3  dec dlab               Date move                                    05381
       dec -5                                                              05382
jlast  oct 37600              Last record on disk zero                     05383
j55s   oct 555555                                                          05384
jeig   dec 8                  Start jkvar off right                        05385
                                                                           05386
                        **********************************************     05387
                        Do not go above 37500--tape sub. overlay           05388
                        **********************************************     05389
                                                                           05390
                                                                           05391
                                                                           05392
       org ta                 Leave treqst some room                       05393
jin    bss 2                                                               05394
jlist  bss 1                                                               05395
jkey   bss 1                                                               05396
jkvar  bss 1                                                               05397
jtmp   bss 1                                                               05398
jtmpp  bss 1                                                               05399
jpoin  bss 1                                                               05400
       tcd lovwrt             Transfer                                     05401
                                                                           05402
       stl                    Billing master pack                          05403
       ejt                                                                 05404
                        The billing master packing routine writes an       05405
                        end-of-file on tape 0, rewinds 0 and 6,            05406
                        then spaces forward 6 until it senses an           05407
                        end-of-file.  It then packs tape 0 onto 6,         05408
                        blocking the latter by a factor of ten.            05409
                        If called by *BILL*, it moves itself down to       05410
                        22000, but normally it is read in by the           05411
                        dump routine and is part of the dump -  cat        05412
                        - billing package.                                 05413
                                                                           05414
                                                                           05415
       org pernum                                                          05416
       dec 8                                                               05417
       dec bil                                                             05418
                                                                           05419
                                                                           05420
       org execov                                                          05421
       lda three              Ask for off                                  05422
       spb spmess  2                                                       05423
       lda six                Turn off other teletypes                     05424
       spb mess    2                                                       05425
       dld *+4     3          Move program down                            05426
       mov execov                                                          05427
       bru billa                                                           05428
       dec -1                 Spare word                                   05429
       dec billw                                                           05430
       dec -512               Lots of words...P                            05431
                                                                           05432
                                                                           05433
       org billw+10                                                        05434
billa  lda wait1              Reset P-counter                              05435
       sta pct                                                             05436
       spb messg   2          and acknowledge                              05437
       dec pcr                                                             05438
       spb dskb    2          Get disk to read in tape routine             05439
       spb dskop   2          and read in tape routine                     05440
       z12 3                                                               05441
       dec treqst             Upper part of overlay                        05442
       z20 tap+2              Indirect to its address                      05443
       bru *                  This should never happen                     05444
       spb relin   2          Relinquish disk, so we can get it later      05445
       dld .blii.  3          Get entry                                    05446
       xaq                                                                 05447
       spb insert  2          and insert in table                          05448
       sta bilin              and save                                     05449
                                                                           05450
                                                                           05451
billb  spb treqb   2          Normal running routine                       05452
       sel 1                  Write end-of-file on zero                    05453
       wef         0                                                       05454
       oct 0                  Return flag                                  05455
       spb treqb   2          and rewind 6                                 05456
       sel 1                                                               05457
       rwd         6                                                       05458
bilrw  oct 0                  Flag for completion                          05459
       lmo                    Reset some indicators                        05460
       sta pering                                                          05461
       sta in                                                              05462
       lda cmess              Set cmess to indicate billing in             05463
       add four                                                            05464
       sta cmess                                                           05465
       spb bexec   2          Exit and return                              05466
       lda bilrw   3          to check if rewind of 6 done                 05467
       bze                                                                 05468
       bru 2       1          No, so exit                                  05469
       bcs brw     1          Wait for rewind                              05470
       bru 2       1                                                       05471
       spb treqb   2          Go rewind zero                               05472
       sel 1                                                               05473
       rwd         0                                                       05474
bilw0  oct 0                                                               05475
bilsum spb bexec   2          Reset summary                                05476
       spb irase   2                                                       05477
       spb dskb    2                                                       05478
       spb dskop   2          Read in summary                              05479
       z12 1                                                               05480
       dec fclock                                                          05481
       oct 402                                                             05482
       nop                                                                 05483
       ldz                    Reset first word                             05484
       sta fclock                                                          05485
       spb dskop   2          Re-write summary                             05486
       z37 1                                                               05487
       dec fclock                                                          05488
       oct 402                                                             05489
       nop                                                                 05490
       dld .blii.  3          Restore billing                              05491
       xaq                                                                 05492
       spb insert  2                                                       05493
       sta bilin                                                           05494
       spb relin   2          Done with disk                               05495
blsrch spb treqb   2          Go search for end of master                  05496
       sel 1                                                               05497
       rtb bin1    6          Read in record                               05498
           0                  but not much                                 05499
blsrw  oct o                  Flag word                                    05500
       spb bexec   2          Exit and wait                                05501
       lda blsrw   3          Check flag on read                           05502
       bze                                                                 05503
       bru 2       1          Crump if not done                            05504
       sra 2                  Check for EOF                                05505
       bev                                                                 05506
       bru blsrch             None                                         05507
       spb treqb   2          Now begin copying 0 onto 6                   05508
       sel 1                                                               05509
       bkw         6          Backspace 6 over EOF                         05510
       oct 0                                                               05511
       spb bexec   2          Exit and wait                                05512
       lda *-2     3          Check flag                                   05513
       bze                                                                 05514
       bru 2       1          exit                                         05515
       lda bilw0   3          Check flag on that op                        05516
       bze                                                                 05517
       bru 2       1          Crump if unattended                          05518
       bcs brw     1          else wait for rewind                         05519
       bru 2       1                                                       05520
                                                                           05521
                                                                           05522
bill3  spb treqb   2          Begin reading and search for BOO messg       05523
       sel 1                                                               05524
       rtb bin1    0                                                       05525
           30                                                              05526
       oct 0                                                               05527
       spb bexec   2          Exit and wait                                05528
       lda bill3+4 3                                                       05529
       bze                    Check flag                                   05530
       bru 2       1          exit if not yet done                         05531
       dld bin1               Else check for message                       05532
       dsu boo1    3                                                       05533
       bze                    First word zero                              05534
       xaq                    Check second                                 05535
       bnz                    Either non-zero,                             05536
       bru bill3              keep at it                                   05537
                                                                           05538
                                                                           05539
                        BILL4 reads in records from the billing            05540
                        scratch tape, discards all debbuging info,         05541
                        then packs the good records in 20-record           05542
                        blocks which get written onto the packed           05543
                        billing tape, on 6.                                05544
                                                                           05545
                                                                           05546
                                                                           05547
bill4  lda bin2    3          Get address                                  05548
       ldx zero    1          and initialize counter                       05549
       stx binf    1          save                                         05550
       bru *+3                and skip first part                          05551
                                                                           05552
                                                                           05553
bill5  lda bin     3          Get address                                  05554
       add b24     3          Step it                                      05555
       sta bin     3          and save                                     05556
       sto *+3     3          and set in call                              05557
bill5r spb treqb   2          Read tape zero                               05558
       sel 1                                                               05559
       rtb --                 Constructed                                  05560
           24                                                              05561
       oct 0                  Flag word                                    05562
       spb bexec   2          Exit and wait                                05563
       lda *-2     3                                                       05564
       bze                    Exit if not done                             05565
       bru 2       1                                                       05566
       sra 2                                                               05567
       bod                    Check for end-of-file                        05568
       bru bill8              Found, so end near                           05569
       lda bin     3          Get address                                  05570
       sta z2                 set in register                              05571
       lda 24      2          Get residue word                             05572
       bnz                    and check for greater or less                05573
       bru bill5r             Crump if not 24 words                        05574
       ldx binf    1          Get counter                                  05575
       inx 1       1          step it                                      05576
       stx binf    1          and save                                     05577
       bxl 20      1          Check for 20                                 05578
       bru bill5              no, so go back and read some more            05579
       spb treqst  2          This time check for errors                   05580
       sel 1                                                               05581
       wtb bin1    6          Write many records                           05582
           480                                                             05583
       oct 0                                                               05584
       spb bexec   2          Exit and wait                                05585
       lda *-2     3          Now wait                                     05586
       bze                                                                 05587
       bru 2       1          and exit if not done                         05588
       bru bill4              else restart sequence                        05589
                                                                           05590
                                                                           05591
                                                                           05592
bill8  spb treqb   2          Wrapup operation                             05593
       sel 1                                                               05594
       rwd         0          Rewind zero                                  05595
       oct 0                  Flag word                                    05596
       lda binf               Get last-used address counter                05597
       bze                    Check for none written this time             05598
       bru bill9              EOF came first, so exit                      05599
       maq                                                                 05600
       mpy b24     3          Else get number of words left                05601
       laq                    Pick them up                                 05602
       sto *+4     3          and put away in call                         05603
       spb treqst  2          and write on billing tape last time          05604
       sel 1                                                               05605
       wtb bin1    6                                                       05606
           0                  constructed                                  05607
       oct 0                                                               05608
                                                                           05609
bill9  spb treqb   2          Pile them up                                 05610
       sel 1                                                               05611
       wef         6          Write EOF on 6                               05612
       oct 0                                                               05613
       spb treqb   2          and some more                                05614
       sel 1                                                               05615
       rwd         6          Rewind 6                                     05616
       oct 0                                                               05617
       lda cmess                                                           05618
       sub four               Delete billing from roster                   05619
       sta cmess                                                           05620
       bev                    Check if dump still in                       05621
       spb tclos   2          Else close out tape                          05622
       ldx bilin   1          Get entrance                                 05623
       spb irase   2          and erase                                    05624
       lda cmess              Get again                                    05625
       bze                    Check if any in                              05626
       bru icrump             and type message if none                     05627
       bru 2       1          and exit                                     05628
                                                                           05629
                                                                           05630
                                                                           05631
billi  dld .blii.  3          Get first entry                              05632
       bru insert             and exit                                     05633
                                                                           05634
                                                                           05635
                                                                           05636
blii   stx bilin   1          Save entry                                   05637
       lda .blin.  3          Get usual entry                              05638
       sta 0       1          and set in list                              05639
       bru billr              and initialize operations                    05640
                                                                           05641
                                                                           05642
                                                                           05643
blin   ldx bpoin   2          Get exit point                               05644
       bru 1       2          and get going                                05645
                                                                           05646
                                                                           05647
bexec  stx bpoin   2          Save exit point                              05648
       ldx bilin   1          and get entry point                          05649
       bru 1       2          and exit                                     05650
                                                                           05651
                                                                           05652
                                                                           05653
.blii. spb blii    1          Bill initializer                             05654
.blin. spb blin    1          Regular billing entry                        05655
boo1   oct 2606060            Special check constant                       05656
       oct 557755                                                          05657
bin2   dec bin1               Buffer address                               05658
b24    dec 24                                                              05659
bin    bss 1                  Address                                      05660
                                                                           05661
                                                                           05662
       org biltmp             Temporary storage                            05663
binf   bss 1                  Counter                                      05664
bilin  bss 1                  Entry point save                             05665
bpoin  bss 1                  Exit pointer                                 05666
                                                                           05667
                                                                           05668
                                                                           05669
       org k2area             Fudge routine                                05670
       dec excv+10                                                         05671
       dec -502                                                            05672
bilmov dld *-2                Move billing routine up so can write on disk 05673
       mov billa                                                           05674
       bru lovwrt             and transfer                                 05675
       tcd bilmov                                                          05676
                                                                           05677
       stl                    Catalogue files key                          05678
       ejt                                                                 05679
                                                                           05680
                        Cataogue files key.                                05681
                                                                           05682
                        Contains in addition certain labels for the        05683
                        dump and load routines.                            05684
                        This overlay is read in by the catalogue           05685
                        into 20000                                         05686
                                                                           05687
                                                                           05688
                                                                           05689
       org pernum             Special overlay called by dump and catalogue 05690
       dec 10                                                              05691
       dec key                                                             05692
                                                                           05693
                                                                           05694
                                                                           05695
       org ckey                                                            05696
                        Key to the catalog                                 05697
                        Disk 1                                             05698
       oct 061400                                                          05699
       oct 061440                                                          05700
       oct 061500                                                          05701
       oct 061540                                                          05702
       oct 061600                                                          05703
       oct 061640                                                          05704
                                                                           05705
                        Disk 2                                             05706
       oct 121400                                                          05707
       oct 121440                                                          05708
       oct 121500                                                          05709
       oct 121540                                                          05710
       oct 121600                                                          05711
       oct 121640                                                          05712
                                                                           05713
                        Disk 3                                             05714
       oct 161400                                                          05715
       oct 161440                                                          05716
       oct 161500                                                          05717
       oct 161540                                                          05718
       oct 161600                                                          05719
       oct 161640                                                          05720
                                                                           05721
                        Disk 4                                             05722
       oct 221400                                                          05723
       oct 221440                                                          05724
       oct 221500                                                          05725
       oct 221540                                                          05726
       oct 221600                                                          05727
       oct 221640                                                          05728
                                                                           05729
                        Disk 5                                             05730
       oct 261400                                                          05731
       oct 261440                                                          05732
       oct 261500                                                          05733
       oct 261540                                                          05734
       oct 261600                                                          05735
       oct 261640                                                          05736
                                                                           05737
                        Disk 6                                             05738
       oct 321400                                                          05739
       oct 321440                                                          05740
       oct 321500                                                          05741
       oct 321540                                                          05742
       oct 321600                                                          05743
       oct 321640                                                          05744
                                                                           05745
                        Disk 7                                             05746
       oct 361400                                                          05747
       oct 361440                                                          05748
       oct 361500                                                          05749
       oct 361540                                                          05750
       oct 361600                                                          05751
       oct 361640                                                          05752
                                                                           05753
                        Disk 8                                             05754
       oct 421400                                                          05755
       oct 421440                                                          05756
       oct 421500                                                          05757
       oct 421540                                                          05758
       oct 421600                                                          05759
       oct 421640                                                          05760
                                                                           05761
                        Disk 9                                             05762
       oct 461400                                                          05763
       oct 461440                                                          05764
       oct 461500                                                          05765
       oct 461540                                                          05766
       oct 461600                                                          05767
       oct 461640                                                          05768
                                                                           05769
                        Disk 10                                            05770
       oct 521400                                                          05771
       oct 521440                                                          05772
       oct 521500                                                          05773
       oct 521540                                                          05774
       oct 521600                                                          05775
       oct 521640                                                          05776
                                                                           05777
                        Disk 11                                            05778
       oct 561400                                                          05779
       oct 561440                                                          05780
       oct 561500                                                          05781
       oct 561540                                                          05782
       oct 561600                                                          05783
       oct 561640                                                          05784
                                                                           05785
                        Disk 12                                            05786
       oct 621400                                                          05787
       oct 621440                                                          05788
       oct 621500                                                          05789
       oct 621540                                                          05790
       oct 621600                                                          05791
       oct 621640                                                          05792
                                                                           05793
                        Disk 13                                            05794
       oct 661400                                                          05795
       oct 661440                                                          05796
       oct 661500                                                          05797
       oct 661540                                                          05798
       oct 661600                                                          05799
       oct 661640                                                          05800
                                                                           05801
                        Disk 14                                            05802
       oct 721400                                                          05803
       oct 721440                                                          05804
       oct 721500                                                          05805
       oct 721540                                                          05806
       oct 721600                                                          05807
       oct 721640                                                          05808
                                                                           05809
                        Disk 15                                            05810
       oct 761400                                                          05811
       oct 761440                                                          05812
       oct 761500                                                          05813
       oct 761540                                                          05814
       oct 761600                                                          05815
       oct 761640                                                          05816
                        Extra catalogs on disk 15                          05817
       oct 761000                                                          05818
       oct 761040                                                          05819
       oct 761100                                                          05820
       oct 761140                                                          05821
       oct 761200                                                          05822
       oct 761240                                                          05823
                                                                           05824
       oct 760400                                                          05825
       oct 760440                                                          05826
       oct 760500                                                          05827
       oct 760540                                                          05828
       oct 760600                                                          05829
       oct 760640                                                          05830
       oct 0                  End for dump                                 05831
       dec -1                 End for catalogue printout                   05832
                                                                           05833
                                                                           05834
                        Labels for dump and load                           05835
                                                                           05836
                                                                           05837
       ddc 0                  Insure even                                  05838
       bss -2                                                              05839
dlab1  bss 0                  Dartmouth College Time-Sharing System        05840
       oct 377777                                                          05841
       alf DAR                                                             05842
       alf TMO                Disk dump-load tapes.  Date                  05843
       alf UTH                                                             05844
       alf  CO                                                             05845
       alf LLE                                                             05846
       alf GE                                                              05847
       alf TIM                                                             05848
       alf E-S                                                             05849
       alf HAR                                                             05850
       alf ING                                                             05851
       alf  SY                                                             05852
       alf STE                                                             05853
       alf M D                                                             05854
       alf ISK                                                             05855
       alf  DU                                                             05856
       alf MP-                                                             05857
       alf LOA                                                             05858
       alf D T                                                             05859
       alf APE                                                             05860
       alf S.                                                              05861
       oct 606037                                                          05862
dlab   alf                                                                 05863
       alf                                                                 05864
       alf                                                                 05865
       alf                                                                 05866
       alf                                                                 05867
       oct 375577                                                          05868
dlab5  oct 0                  This word indicates which tape is on         05869
                                                                           05870
                                                                           05871
       oct 0                  Must be odd location                         05872
       ddc 0                                                               05873
       bss -3                                                              05874
dumtim bss 0                                                               05875
       alf DIS                                                             05876
       alf K D                Disk dump time  etc.                         05877
       alf UMP                                                             05878
       alf . T                                                             05879
       alf IME                                                             05880
dlab2  alf                                                                 05881
       alf                                                                 05882
       alf  HO                                                             05883
       alf URS                                                             05884
       oct 373755                                                          05885
                                                                           05886
to7    bss 0                  Place tape 2 on handler 7.  Toggle zero      05887
       oct 374743             when ready.                                  05888
       alf ACE                                                             05889
       alf  TA                                                             05890
       alf PE                                                              05891
       alf 2 O                                                             05892
       alf N H                                                             05893
       alf  7.                                                             05894
       alf   T                                                             05895
       alf OGG                                                             05896
       alf LE                                                              05897
       alf 2 W                                                             05898
       alf HEN                                                             05899
       alf  RE                                                             05900
       alf ADY                                                             05901
       oct 333755                                                          05902
                                                                           05903
psoo   bss 0                  Tapes on wrong density.                      05904
       alf PES                                                             05905
       alf  ON                                                             05906
       alf  WR                                                             05907
       alf ONG                                                             05908
       alf  DE                                                             05909
       alf NSI                                                             05910
       alf TY.                                                             05911
       oct 375577                                                          05912
                                                                           05913
                                                                           05914
                        Fudge routine to move overlay up                   05915
                                                                           05916
                                                                           05917
                                                                           05918
       org k2area                                                          05919
       dec execov                                                          05920
       dec -512                                                            05921
filmov dld *-2                                                             05922
       mov ckey               and move                                     05923
       bru lovwrt             Now write on disk                            05924
       tcd filmov                                                          05925
                                                                           05926
       stl                    Disk load                                    05927
       ejt                                                                 05928
                                                                           05929
                                                                           05930
       org pernum                                                          05931
       dec 12                                                              05932
       dec loa                                                             05933
                                                                           05934
                                                                           05935
                                                                           05936
                        Time-sharing disk load.  This routine ex-          05937
                        pects each record on the tape to have two          05938
                        code words at the beginning, with the              05939
                        following information...                           05940
                                                                           05941
                           Word 1 - disk address                           05942
                           Word 2 - length (mod 64)                        05943
                                                                           05944
                                                                           05945
                              Tape one of the load set must be             05946
                        mounted on handler 3.  The tape will be            05947
                        transferred to the disk until an end-of-           05948
                        file is sensed, at which point the load            05949
                        terminates.  If an EOF is sensed before the        05950
                        EOF is reached, the program will ask to have       05951
                        the second tape from the load set mounted          05952
                        on handler #7.                                     05953
                              The first tape must have the correct         05954
                        label written on it by the dump routine and        05955
                        the last word of this must be negative.  For       05956
                        second tape, the label is the same but the         05957
                        code word is zero.                                 05958
                                                                           05959
                        Memory layout is the same as for the dump          05960
                        routine.                                           05961
                                                                           05962
       org execov                                                          05963
                                                                           05964
                                                                           05965
       lda three              Ask for time count stop                      05966
       spb spmess  2                                                       05967
       lda six                Ask for OFF                                  05968
       spb spmess  2                                                       05969
       lda wait1              Reset counter                                05970
       sta pct                                                             05971
       spb messg   2          Acknowledge                                  05972
       dec pcr                                                             05973
       spb dskb    2          Ask for disk                                 05974
       spb dskop   2                                                       05975
       z12 3                  and read in tape subroutine                  05976
       dec treqst                                                          05977
       z20 tap+2              Indirect to disk address                     05978
       bru *                                                               05979
       spb relin   2          Relinquish disk                              05980
       spb treqst  2          Now rewind 3                                 05981
       sel 1                                                               05982
       rwd         3                                                       05983
lcrwd  oct 0                  Flag word                                    05984
       dld .link.  3          Set up linkage                               05985
       spb insert  2                                                       05986
       sta lclist             Save entry point                             05987
       dld ld3     3          Date move constant                           05988
       mov sdate+1                                                         05989
       lmo                    Reset various indicators                     05990
       sta in                                                              05991
       sta perin                                                           05992
       spb time    2          Get time                                     05993
       dst ld2     3          and set in message                           05994
       spb messg   2          Type heading line                            05995
       dec ldm                                                             05996
       spb lexec   2          Exit and wait                                05997
       lda lcrwd   3          wait for rewind to finish                    05998
       bze                                                                 05999
       bru 2       1                                                       06000
       bcs brw     1                                                       06001
       bru 2       1          Exit if all not OK                           06002
       spb treqst  2          Read in label                                06003
       sel 1                                                               06004
       rtb ltap    3                                                       06005
           30                                                              06006
       oct 0                                                               06007
       spb lexec   2          Exit and wait                                06008
       lda *-2     3          wait for label to come in                    06009
       bze                                                                 06010
       bru 2       1          Exit if not                                  06011
       ldx zero    2          Prepare to compare labels                    06012
labcom dld ltap    2          Check label out                              06013
       dcb labl    3                                                       06014
       bru lderr                                                           06015
       bru *+2                                                             06016
       bru lderr              No match                                     06017
       inx 2       2          Step pointers                                06018
       inx 2       3                                                       06019
       bxl 20      3          Count                                        06020
       bru labcom                                                          06021
       ldx 8K      3          Restore register                             06022
       lda ltap1              Get code word                                06023
       bpl                                                                 06024
       bru lderr              all over if plus                             06025
       spb mess    2          Type message                                 06026
       dec ltap               type out label                               06027
       spb treqst  2          and read tape                                06028
       sel 1                                                               06029
       rtb lcr1    3          Read in first record                         06030
           2050               Many words...                                06031
       oct 0                  Completion indicator                         06032
       spb lexec   2          Exit and return                              06033
       lda *-2     3                                                       06034
       bze                                                                 06035
       bru 2       1                                                       06036
       dld ldar3   3          Ready, so get buffer addresses               06037
       dst lcbuf                                                           06038
       ldo                                                                 06039
       sta dstkaf             Inhibit relinquishes                         06040
                                                                           06041
                                                                           06042
                                                                           06043
lloopa dld lcbuf              Get areas                                    06044
       xaq                    Switch them                                  06045
       dst lcbuf              and save                                     06046
       lda lcread+23          Get read tape instruction                    06047
       ext mask11             get rid of address                           06048
       add lcbuf              add new address [buffer area]                06049
       sta lcread+23                                                       06050
lcread spb treqst  2          Now read again                               06051
       sel 1                                                               06052
       rtb --      3          Constructed                                  06053
           2050                                                            06054
lcrdw  oct 0                  Completion indicator                         06055
       spb lexec   2                                                       06056
       lda lcrdw   3          Wait for tape                                06057
       bze                                                                 06058
       bru 2       1          Exit if not ready                            06059
       srd 2                  Now check for EOF                            06060
       bod                                                                 06061
       bru lcend              Crump if so                                  06062
       sld 1                  Else check for EOT                           06063
       bod                                                                 06064
       bru lswtch             Go switch tapes if so                        06065
       lda lfila+3 3          Wait for last disk operation to finish       06066
       bze                                                                 06067
       bru 2       1          not done                                     06068
       ldx lcbuf   2          Get address                                  06069
       lda 0       2          and pick up code words                       06070
       sta lfila+2 3          and set in parameter list                    06071
       lda 1       2          Get number of words                          06072
       sto lfila   3          and set in file parameter list               06073
       inx 2       2          Step adress                                  06074
       lda z2                 Get it                                       06075
       sta lfila+1 3          and set in parameter list                    06076
       spb dramb   2          Now use disk                                 06077
       dec lfila              and write out previous record                06078
       bru lloopa             Keep going else                              06079
                                                                           06080
                                                                           06081
                                                                           06082
lswtch spb messg   2          Type message                                 06083
       dec lo7                                                             06084
       spb treqst  2          Now rewind 3                                 06085
       sel 1                                                               06086
       rwd         3                                                       06087
       oct 0                  Flag                                         06088
       spb lexec   2          Exit and wait on switch 2                    06089
       ldz                                                                 06090
       rcs                                                                 06091
       sla 2                  Check [console switch] 2                     06092
       bno                                                                 06093
       bru 2       1          If not down, exit                            06094
       lda sign               Switch handlers to 7                         06095
       ory lcread+33                                                       06096
       ory lcend+3 3                                                       06097
       spb treqst  2          Read label from 7 and beware clods who       06098
       sel 1                  don't rewind tapes                           06099
       rtb ltap    7                                                       06100
           30                                                              06101
       oct 0                                                               06102
       spb lexec   2          Exit and wait                                06103
       lda *-2     3          and check completion word                    06104
       bze                                                                 06105
       bru 2       1          and exit if not ready                        06106
       ldx zero    2          Set up for label scan                        06107
lswcom dld ltap    2          Check labels                                 06108
       dcb labl    3                                                       06109
       bru lderr              no match                                     06110
       bru *-2                                                             06111
       bru lderr              no match                                     06112
       inx 2       2          Step pointers                                06113
       inx 2       3                                                       06114
       bxl 20      3          Count                                        06115
       bru lswcom                                                          06116
       ldx 8K      3          Restore register                             06117
       lda ltap1              Check key word                               06118
       bnz                    had better be zero                           06119
       bru lderr              no, so error                                 06120
       bru lloopa             Else get back and keep going                 06121
                                                                           06122
                                                                           06123
                                                                           06124
lderr  spb messg   2          Bad error, abort run                         06125
       dec lw                                                              06126
                                                                           06127
lcend  spb treqst  2          Rewind 3 - or 7 if that is the case          06128
       sel 1                                                               06129
       rwd         3                                                       06130
       oct 0                  Completion indicator                         06131
       spb lexec   2          Exit and wait                                06132
       lda *-2     3          on the indicator                             06133
       bze                                                                 06134
       bru 2       1          Exit if not ready                            06135
       spb tclos   2          Just to close up tape                        06136
       stx ovtsk   1          Erase task to link                           06137
       ldz                                                                 06138
       sta dstakf             unfudge                                      06139
       spb relin   2          Give disk back                               06140
       bru icrump             and crump                                    06141
                                                                           06142
                                                                           06143
                                                                           06144
lexec  ldx lclist  1          Get entry point                              06145
       stx lcpoin  2          and save exit                                06146
       bru 1       2          now get right back                           06147
                                                                           06148
                                                                           06149
                                                                           06150
link   ldx lcpoin  2          Get entry point                              06151
       bru 1       2          and return                                   06152
                                                                           06153
                                                                           06154
                                                                           06155
                                                                           06156
                                                                           06157
.link. spb link    1          Entrance linkage                             06158
       dec -1                                                              06159
ld3    dec ld1                Date move constant                           06160
       dec -5                                                              06161
ldar3  dec lcr1               Buffer areas                                 06162
       dec lcr2                                                            06163
                                                                           06164
                                                                           06165
lfila  z37 32                 Disk parameter list                          06166
       dec lcr1+2             memory address                               06167
       oct 0                  Disk address                                 06168
       oct 1                  Flag word [completion indicator]             06169
                                                                           06170
                                                                           06171
                                                                           06172
       oct 0                  Make sure is odd                             06173
       ddc 0                                                               06174
       bss -3                                                              06175
ldm    oct 377777             LDM must be odd $$$$$$$$$$$$$$$$$$$$$$$$$    06176
       alf DIS                                                             06177
       alf K L                                                             06178
       alf OAD                                                             06179
       alf .                                                               06180
       alf                                                                 06181
ld1    alf                                                                 06182
       alf                                                                 06183
       alf                                                                 06184
       alf                                                                 06185
       alf                                                                 06186
       alf   T                                                             06187
       alf IME                                                             06188
ld2    alf                                                                 06189
       alf                                                                 06190
       alf  HO                                                             06191
       alf URS                                                             06192
       oct 373755                                                          06193
                                                                           06194
labl   bss 0                  LABL must be even $$$$$$$$$$$$$$$$$$$$$$$    06195
       oct 377777                                                          06196
       alf DAR                                                             06197
       alf TMO                                                             06198
       alf UTH                                                             06199
       alf  CO                                                             06200
       alf LLE                                                             06201
       alf GE                                                              06202
       alf TIM                                                             06203
       alf E-S                                                             06204
       alf HAR                                                             06205
       alf ING                                                             06206
       alf  SY                                                             06207
       alf STE                                                             06208
       alf M D                                                             06209
       alf ISK                                                             06210
       alf  DU                                                             06211
       alf MP-                                                             06212
       alf LOA                                                             06213
       alf D T                                                             06214
       alf APE                                                             06215
       alf S.                                                              06216
       oct 606037                                                          06217
                                                                           06218
                                                                           06219
lo7    bss 0                  Put tape 2 on handlr 7.  Toggle 0            06220
       oct 377777             when ready.                                  06221
       alf PUT                                                             06222
       alf  TA                                                             06223
       alf PE                                                              06224
       alf TWO                                                             06225
       alf  ON                                                             06226
       alf  HA                                                             06227
       alf NDL                                                             06228
       alf R 7                                                             06229
       alf . T                                                             06230
       alf OGG                                                             06231
       alf LE 2                                                            06232
       alf  W                                                              06233
       alf HEN                                                             06234
       alf  RE                                                             06235
       alf ADY                                                             06236
       oct 333755                                                          06237
                                                                           06238
lw     alf WRO                                                             06239
       alf NG                                                              06240
       alf TAP                                                             06241
       oct 253337                                                          06242
       oct 375577                                                          06243
                                                                           06244
                        *********************************************      06245
                        Do not go above 37500--tape sub. overlay           06246
                        *********************************************      06247
                                                                           06248
                                                                           06249
                                                                           06250
       org ta                 Leave tape some room - temporary storage     06251
lcbuf  bss 2                  Buffer flip-flops                            06252
lclist bss 1                  Entry save                                   06253
lcpoin bss 1                  Exit save                                    06254
       tcd lovwrt                                                          06255
                                                                           06256
       stl                    Tape operations routine - called by overlays 06257
       ejt                                                                 06258
                              TREQST is a tape operations routine          06259
                        that may be called from either API or non-         06260
                        APi routines.  Return is immediate, and a flag     06261
                        will be set in the last word of the calling        06262
                        sequence to indicate completion.  Non-API          06263
                        systems using it must do a *SET PBK* before        06264
                        entering and a *SET PST* after control is          06265
                        returned to them                                   06266
                              As many as six requests will be              06267
                        stacked up at one time, and the operations         06268
                        will be executed in the order that they are        06269
                        received.                                          06270
                        TREQB is entered when error correcting is to       06271
                        be left up to the program.                         06272
                                                                           06273
                                                                           06274
                        Calling sequence...                                06275
                                                                           06276
                        A     spb TREQST,  2                               06277
                        A+1   sel x           where x is a plug            06278
                        A+2   zzz yyyy,    H  op, loc, handler             06279
                        A+3       NNNN        number of words              06280
                        A+4   ---             completion indicator         06281
                                                                           06282
                                                                           06283
                              The flag at *A+4* is set to zero upon        06284
                        entrance to the tape routine, and is set non-      06285
                        zero upon completion of an operation.              06286
                        The codes for operation completion are             06287
                        as follows...                                      06288
                           1   indicate op successful                      06289
                           2   indicates end-of-tape sensed                06290
                           4   indicates enf-of-file sensed                06291
                          20   indicates an error was encountered          06292
                          40   indicates the request was not               06293
                               accepted because there were too many        06294
                               requests stacked up, so try later           06295
                                                                           06296
                              Upon sensing an error, the program           06297
                        attempts to correct it seven times.  If the        06298
                        calling program specified that it was to do        06299
                        its own error correcting, then no more action      06300
                        is taken, otherwise a console typewriter           06301
                        message is typed out and action is left up         06302
                        to the operator.                                   06303
                                                                           06304
                                                                           06305
       org pernum                                                          06306
       dec 14                                                              06307
       dec tap                                                             06308
                                                                           06309
       org execov                                                          06310
       bss 320                Save space for other routines                06311
                                                                           06312
treqst ldz                    Error correcting to be done internally       06313
       bru *+2                                                             06314
                                                                           06315
treqb  lda ovflo              Error correcting to be done by program       06316
       sta terf    3          Set error flag                               06317
treqe  spb tinit   1          Initialize entrance - else ldx tpoin,1       06318
       inx 1       1          Step pointer and check                       06319
       bxh 6       1          for wraparound                               06320
       ldx 8K      1          Re-initialize if end of table                06321
       lda ttab    1          Check next entry                             06322
       bnz                    If non-zero, then table full                 06323
       bru trful              too many requests stacked up                 06324
       stx tpoin   1          Save pointer                                 06325
       sta 4       2          Reset flag in calling sequence               06326
       stx temp    2          and get caller                               06327
       lda temp                                                            06328
       add terf    3          add error correcting indicator               06329
       sta ttab    1          and set in table                             06330
       inx 4       2          Step for return                              06331
       lac                    Set timer                                    06332
       add seven                                                           06333
       sta tlaps   3          Set timer                                    06334
       dld .tint.  3          and get entry                                06335
       bru insert             and insert in task list                      06336
                                                                           06337
                                                                           06338
                                                                           06339
tint   ldx txpoin  2          Points to entry to be processed              06340
       lda ttab    2          Check if this is the correct entry           06341
       bmi                    If negative, then error corrector has it     06342
       bru 2       1          So punt for now                              06343
       stx rawt    1          Save entrance point                          06344
       sta z2                 Get pointer to SPB list                      06345
       lda 1       2          Get select instruction                       06346
       sta tcw     3                                                       06347
       lda 2       2          Instruction and memory locations             06348
       sta tcw+1   3                                                       06349
       lda 3       2          Get handler and length                       06350
       sta tcw+2   3                                                       06351
       spb ttest   1          Test for tape ready                          06352
       ldx txpoin  2          Get pointer again                            06353
       lda sign               Set sign in table for error corrector        06354
       ory ttab    2                                                       06355
       lda seven              if so, initialize error counter              06356
       sta tcnt                                                            06357
texec  ldx rawt    1          Get entry                                    06358
       lda 1       1          Set error corect entry into list             06359
       sta 0       1                                                       06360
tcw    bss 1                  and execute instructions - select            06361
       bss 1                  op and loc                                   06362
       bss 1                  handler and length                           06363
       bru 2       1                                                       06364
                                                                           06365
                                                                           06366
tchk   stx rawt    1          Save entry                                   06367
       spt ttest   1          and check for ready                          06368
       oct 2554007            Yes, check for error [Not 235 inst list]     06369
       bru tercor             yes, go correct                              06370
tccpt  ldx txpoin  1          Get execution pointer                        06371
       lda ttab    1          and pick up spb location                     06372
       sta z3                 and live dangerously [z3 normally has 8K]    06373
       ldz                    free entry                                   06374
       sta ttab    1                                                       06375
       oct 2554002            and then for end-of-tape                     06376
       add two                                                             06377
       oct 2554001            Check for end-of-file                        06378
       add four                                                            06379
       oct 2554007            and then if 19 toggled                       06380
       add o20                If so, set bit 15 on                         06381
       bze                    Test for all OK                              06382
       ldo                    If so, set odd                               06383
       sta 4       3          and set in spb file [list?]                  06384
       ldx 8K      3          Reset register                               06385
       inx 1       1          Step pointer for execution to next entry     06386
       bxh 6       1          Check for wraparound                         06387
       ldx 8K      1          Yes                                          06388
       stx txpoin  1          and save execution pointer                   06389
       ldx rawt    1          Get return                                   06390
       ldx rawt    2                                                       06391
       set prq                [request interrupt]                          06392
       bru irase              and erase entry                              06393
                                                                           06394
                                                                           06395
                        TERCOR attempts to retrieve an error seven         06396
                        times, after which it transfers to TMANY           06397
                        with the tape positioned after the error           06398
                                                                           06399
                                                                           06400
tercor lda tcnt               Check error counter                          06401
       bmi                                                                 06402
       bru tmany              Five [seven?] times                          06403
       sbo                                                                 06404
       sta tcnt               Save it                                      06405
       lda tcw+2   3          Get handler and number of words              06406
       ext mask11             and get rid of word count                    06407
       sta tcwx+1  3          and store                                    06408
       lda tcw+1   3          Get instruction                              06409
       srd 16                 and prepare to convert                       06410
       bod                    If odd, then write command                   06411
       dld three              So pick up bkw instruction                   06412
       srd 2                                                               06413
       ado                    flip                                         06414
       sld 18                 and restore                                  06415
       sta tcwx    3          and set in storage                           06416
       oct 2540000            Now execute reverse instructions             06417
tcwx   oct 0                                                               06418
       oct 0                                                               06419
       lda .terr.  3          Error entry                                  06420
tex1   ldx rawt    1          Get entry                                    06421
       sta 0       1          and set in list                              06422
       bru 2       1          and get back                                 06423
                                                                           06424
                                                                           06425
terr   stx rawt               Save entry                                   06426
       spb ttest   1          and check if ready                           06427
       bru texec              Yes, go execute original instructions        06428
                                                                           06429
                                                                           06430
ttest  lda tcw     3          Get select instruction                       06431
       sta z2                 and set in register                          06432
       lac                    Get clock                                    06433
       oct 2554000            Test for ready                               06434
       bru ttrdy              [controller is ready]                        06435
       cab tlaps   3          Check against timer                          06436
       bru ttret              OK                                           06437
       bru ttret              OK                                           06438
       add o40                No, type message                             06439
       sta tlaps   3          Restore and wait                             06440
       spb messg   2          Type message                                 06441
       dec tcnr               Tape not ready                               06442
ttret  ldx rawt    1          Get entrance                                 06443
       bru 2       1                                                       06444
ttrdy  add seven              Step [clock]                                 06445
       sta tlaps   3          Save                                         06446
       lda swflg              Check if billing going on                    06447
       bod                    If odd, then on                              06448
       bru ttret              so crump                                     06449
       bru 1       1          and get back                                 06450
                                                                           06451
                                                                           06452
                        TMANY checks the error flag set on entry.          06453
                        If bit 1 is on in the table entry corres-          06454
                        ponding to [this thread], the calling              06455
                        program will do its own error correcting.          06456
                                                                           06457
                                                                           06458
tmany  ldx tpoin   1          Get execution pointer                        06459
       lda ttab    1          and table entry                              06460
       sla 1                  Check bit 1                                  06461
       bov                                                                 06462
       bru tccpt              If on, then accept error and return          06463
       spb messg   2          Else type message to operator                06464
       dec ttog               Bad tape error, 2 down to accept then tog 1  06465
       lda .twt.   3          Switch another entry                         06466
       bru tex1               and get out                                  06467
                                                                           06468
                                                                           06469
                        Switch options after a tape error are              06470
                          1 down to rewrite the record after the bad       06471
                            one.                                           06472
                          2 down to rety                                   06473
                          both up to accept the error                      06474
                        then toggle 19                                     06475
twt    stx rawt    1          Error check                                  06476
       spb ttest   1          Wait for tape ready                          06477
       ldz                    Check switches                               06478
       rcs                                                                 06479
       bev                                                                 06480
       bru ttret              19 not down so get out                       06481
       sla 1                                                               06482
       bov                                                                 06483
       bru texec              Rewrite - but do not reset error count       06484
       sla 1                                                               06485
       bno                                                                 06486
       bru tccpt              Accept                                       06487
       lda seven              Else reset error counter and                 06488
       sta tcnt                                                            06489
       bru tercor             Try again                                    06490
                                                                           06491
trful  lda sign               Too many requests stacked up                 06492
       sta 4       2          Reset flag to indicate this                  06493
       bru 5       1          and crump                                    06494
                                                                           06495
                                                                           06496
                                                                           06497
tinit  lda 8K                 Initialize pointers and entries              06498
       sta tpoin                                                           06499
       ado                    Fudge for first execution                    06500
       sta txpoin                                                          06501
       lda .trqb.  3                                                       06502
       sta kbfdg   3          Set in billing                               06503
       lda .ldx.   3          Clear for next times                         06504
       sta 0       1          and set in entry point                       06505
       bru 0       1          and get back to it                           06506
                                                                           06507
                                                                           06508
                                                                           06509
tclos  lda treqst  3          ldz                                          06510
       sta kbfdg   3          Make billing harmless                        06511
       sta kbfdg+4 3                                                       06512
       lda tspb    3          and set entrance                             06513
       sta treqe   3                                                       06514
       bru 1       2                                                       06515
                                                                           06516
                                                                           06517
ttab   oct 0                  Table stack - 6 entries                      06518
       oct 0                                                               06519
       oct 0                                                               06520
       oct 0                                                               06521
       oct 0                                                               06522
       oct 0                                                               06523
                                                                           06524
                                                                           06525
terf   bss 1                  Error flag indicator                         06526
.tint. spb tint    1          Initial entry                                06527
       spb tchk    1          Error-checking entry                         06528
.terr. spb terr    1          Error correct                                06529
.twt.  spb twt     1          Toggle wait                                  06530
.trqb. spb treqb   2          Entered when billing on                      06531
.ldx.  ldx tpoin   1          Used to initialize                           06532
tspb   spb tinit   2          used to close out                            06533
tlaps  bss 1                  Timing interval                              06534
                                                                           06535
tcnr   bss 0                                                               06536
       alf TAP                Tape                                         06537
       oct 253755                                                          06538
                                                                           06539
                                                                           06540
ttog   bss 0                                                               06541
       oct 376347             TP 1 DW TO RWR 2 DW TO RTY TOG 19            06542
       alf  1                                                              06543
       alf DW                                                              06544
       alf TO                                                              06545
       alf RWR                                                             06546
       alf  2                                                              06547
       alf DW                                                              06548
       alf TO                                                              06549
       alf RTY                                                             06550
       alf  TO                                                             06551
       alf G 1                                                             06552
       oct 113755                                                          06553
                                                                           06554
                                                                           06555
                                                                           06556
       org t                  Temporary storage                            06557
tpoin  bss 1                  Stacking pointer                             06558
txpoin bss 1                  Execution pointer                            06559
tcnt   bss 1                  Tape error count                             06560
       bss 1                  Spare for re-writing due shortly             06561
                                                                           06562
                                                                           06563
                                                                           06564
       org k2area             Moving patch                                 06565
       dec execov                                                          06566
       dec -192                                                            06567
tapmov dld *-2                                                             06568
       mov treqst                                                          06569
       bru lovwrt                                                          06570
       tcd tapmov                                                          06571
                                                                           06572
       stl                    Card to tape                                 06573
       ejt                                                                 06574
                                                                           06575
                        Normal call is C/T in which case decimal           06576
                        cards will be written on tape four.                06577
                                                                           06578
                        If it is desired to use any other options,         06579
                        a handler number must be given immediately         06580
                        after the C/T.  You can stop there or read in      06581
                        binary or full modes.  These are B and F           06582
                        respectively.                                      06583
                                                                           06584
                        The program terminates on finding a quote char     06585
                        or hopper empty.  Decimal and full quote cards     06586
                        have 0-7-8 punches in columns 1-6.  Binary         06587
                        quote cards have 0 in 1 and 2 and 0-7-8 in 3-6.    06588
                        The program then writes and EOF.                   06589
                                                                           06590
                        If it is desired to skip to an EOF on the tape,    06591
                        type S at the end of the options.  This will       06592
                        start writing over the EOF.                        06593
       org pernum                                                          06594
       dec 16                                                              06595
       dec c/t                                                             06596
                                                                           06597
       org execov                                                          06598
                                                                           06599
                                                                           06600
       dld ctbup   3          Initialize buffer pointers                   06601
       dst ctbp               in lower memory                              06602
       lda ty+1               Get control word from typewriter             06603
       srd 12                 Get first character                          06604
       cab cr                 see if done                                  06605
       bru *+2                                                             06606
       bru ctsca              Decimal cards all set up                     06607
       sta perin              Call in new next time                        06608
       sta z2                                                              06609
       bhx 7       2          See if legal tape -- not 7                   06610
       bru ctfr1              Question marks                               06611
       inx 8191    2          Get 8K or almost                             06612
       lda cttab+1 2          Get hander information                       06613
       sta ctexe+3 3          put in instruction                           06614
       ldx zero    0          Counter                                      06615
ctsc   bxh 2       0          See if done                                  06616
       bru ctsca              Start cards                                  06617
       inx 1       0          Step for next time through                   06618
       ldz                                                                 06619
       sld 6                  Get character                                06620
       cab ctr1    3          See if binary                                06621
       bru cter1              really illegal                               06622
       bru ctb                binary                                       06623
       cab ctd1    3          See if decimal                               06624
       bru cter1              illegal                                      06625
       bru ctsc               decimal all set up                           06626
       cab ctf1    3          See if full                                  06627
       bru cter1              illegal                                      06628
       bru ctf                full                                         06629
       cab cr                                                              06630
       bru cter1                                                           06631
       bru ctsca              Begin - was a carriage return                06632
       cab cts1    3          See if skip                                  06633
       bru cter1              illegal                                      06634
       bru *+2                                                             06635
       bru cter1                                                           06636
       lda z0                 See if skip last                             06637
       sbo                                                                 06638
       bze                                                                 06639
       bru cter1              No                                           06640
       bru ctskip             So skip                                      06641
                                                                           06642
cter1  ldz                                                                 06643
       sta bzyf               Turn off busy flag                           06644
       bru ild                Question marks                               06645
                                                                           06646
ctb    lda crcb1   3          Read card in binary                          06647
       sto crins1  3          Set up read insructions                      06648
       sto crins2  3                                                       06649
       sto crins3  3                                                       06650
       lda ctd40   3          Decimal 40                                   06651
       sto ctexe+3 3          words to write                               06652
       lda cbsyn   3          Normal binary synch                          06653
       sta cnsyn   3          Fill in syncword check                       06654
       lda cbq1    3          Quote card                                   06655
       sta crok    3          branch for quote card check                  06656
       lda cbsynp  3          Get location of syncword                     06657
       sta csync   3          and store it in the check area               06658
       sta csync2  3                                                       06659
       bru ctsc               and see if have an 'S'                       06660
                                                                           06661
ctf    lda crcf1   3          Read card full                               06662
       sto crins1  3          Set up read insructions                      06663
       sto crins2  3                                                       06664
       sto crins3  3                                                       06665
       lda ctd80   3          Decimal 80                                   06666
       sto ctexe+3 3          words to write                               06667
       lda cfsyn   3          Full sync                                    06668
       sta cnsyn   3          Fill in synchword check                      06669
       lda cfq1    3          Quote card                                   06670
       sta crok    3          branch for quote card check                  06671
       lda cfsynp  3          Get location of full syncword                06672
       sta csync   3          and store it in the check area               06673
       sta csync2  3                                                       06674
       bru ctsc               and see if have an 'S'                       06675
                                                                           06676
ctsca  bss 0                  Start everything here                        06677
       dld .ctst.  3          Get entrance                                 06678
       spb insert  2          and put in task list                         06679
       sta ovtsk              Save pointer                                 06680
       sta z1                                                              06681
ctsca1 spb ctext   2          [Save exit and return]                       06682
       bcn                    First wait for reader                        06683
       bru 2       1                                                       06684
       ldx ctbp+1  1          Get first buffer                             06685
crins1 rcd 0       1          First card read instruction                  06686
       hcr                                                                 06687
                        Instructions now set up                            06688
ctcr   spb cread   2          Read a card and check last sync word         06689
       spb ctext   2          Set up exit                                  06690
       lda ctexw   3          See if tape write completed                  06691
       bze                                                                 06692
       bru 2       1          No, so wait some more                        06693
ctexe  spb treqst  2          Tape subroutine                              06694
       sel 1                                                               06695
       wtb 0       4                                                       06696
           27                                                              06697
ctexw  oct 1                  Flag                                         06698
       bru ctcr               and get another card                         06699
                                                                           06700
                        CREAD reads a card in proper mode, checks          06701
                        syncword and quote, and then flips buffer          06702
                        addresses.                                         06703
                                                                           06704
cread  stx cren    2          Save entrance                                06705
cread1 lac                                                                 06706
       add four               Increment time for check                     06707
       sta ctime                                                           06708
       spb ctext   2          Set up exit                                  06709
       ldx ctbp+1  2                                                       06710
       bcn                                                                 06711
       bru crhop              Check hopper empty condition                 06712
       ldx ctbp    1          Get buffer pointer in index register         06713
crins2 rcd 0       1          Read the card                                06714
       hcr                                                                 06715
csync  lda 27      2          Get last syncword                            06716
       cab cnsyn   3          Normal syn                                   06717
       bru *+2                Error message                                06718
       bru crok               OK                                           06719
       spb messg   2                                                       06720
       dec crerm2             Card reader error backspace 2 and toggle 1   06721
       spb ctext   2                                                       06722
       ldz                    Wait for toggle                              06723
       rcs                                                                 06724
       sla 1                                                               06725
       bno                                                                 06726
       bru 2       1          Not yet                                      06727
       spb ctext   2          1 down                                       06728
       ldz                    [I think wait for sw 1 up again]             06729
       rcs                                                                 06730
       sla 1                                                               06731
       bov                                                                 06732
       bru 2       1                                                       06733
       ldx ctbp+1  2          Prime buffer again                           06734
crins3 rcd 0       2                                                       06735
       hcr                                                                 06736
       bru cread1             and read again                               06737
                        Card read was OK - change buffers and get out      06738
                                                                           06739
crok   bss 0                  Check for quote - filled in with a bru       06740
       bru cdq                Normal is decimal                            06741
crok1  dld ctbp                                                            06742
       xaq                                                                 06743
       dst ctbp                                                            06744
       sto ctexe+2 3          Store address in write instruction           06745
       ldx cren    2          Get entrance                                 06746
       bru 1       2          and return                                   06747
                        Check for hopper empty                             06748
crhop  lac                                                                 06749
       cab ctime              See if it should be ready                    06750
       bru 2       1          OK                                           06751
       bru 2       1          OK                                           06752
csync2 lda 27      2          Check last syncword                          06753
       sla 1                                                               06754
       bov                                                                 06755
       bru ctter              Terminal [exit] - write EOF and get out      06756
       spb messg   2                                                       06757
       dec cterm3                                                          06758
       lac                                                                 06759
       add cr                 Increment wait time                          06760
       sta ctime                                                           06761
       bru 2       1          and get out                                  06762
                        Binary quote check                                 06763
cbq    lda 0       2          [First quote word]                           06764
       bnz                                                                 06765
       bru crok1              OK, go on                                    06766
       lda 1       2                                                       06767
       sub cbqu1   3          Second quote word                            06768
       bnz                                                                 06769
       bru crok1              OK                                           06770
       lda 2       2          Third word                                   06771
       sub cbqu1   3                                                       06772
       bnz                                                                 06773
       bru crok+1             Go on                                        06774
       bru ctter              Quote card - terminal exit                   06775
cbqu1  oct 2015006            Binary quote                                 06776
                        Decimal quote                                      06777
cdq    dld 0       2                                                       06778
       dcb cdqu1   3                                                       06779
       bru crok1              OK - process                                 06780
       bru ctter                                                           06781
       bru crok1                                                           06782
cdqu1  oct 777777                                                          06783
       oct 777777                                                          06784
                        Full quote                                         06785
cfq    ldx zero    0                                                       06786
cfql   dld 0       2                                                       06787
       dcb cfqu1   3                                                       06788
       bru crok1                                                           06789
       bru *+2                First matches                                06790
       bru crok1                                                           06791
       bxh 2       0          Check for done                               06792
       bru ctter              Quote found                                  06793
       inx 1       0          Step                                         06794
       inx 2       2                                                       06795
       bru cfql               and try again                                06796
cfqu1  oct 1006               Full quote                                   06797
       oct 1006                                                            06798
                                                                           06799
                        Read till end-of-file, backspace, and start        06800
ctskip dld .ctst.  3          Put task in list                             06801
       spb insert  2                                                       06802
       sta ovtsk              Save where it is                             06803
       lda ctexe+3 3          Get handler                                  06804
       sta ctskh+1 3                                                       06805
       ext mask11             77777                                        06806
       sta ctsk1+1 3                                                       06807
ctskn  spb treqst  2                                                       06808
       sel 1                                                               06809
ctskh  rtb io1     4                                                       06810
           27                                                              06811
       oct 0                                                               06812
       spb ctext   2                                                       06813
       lda *-2     3                                                       06814
       bze                    If [completion] flag zero, get out           06815
       bru 2       1                                                       06816
       sra 2                  Check for EOF                                06817
       bev                                                                 06818
       bru ctskn              not yet                                      06819
       spb treqst  2                                                       06820
       sel 1                                                               06821
ctsk1  bkw         4          Backspace                                    06822
       oct 0                                                               06823
       spb ctext   2                                                       06824
       lda *-2     3                                                       06825
       bze                                                                 06826
       bru 2       1          Get out                                      06827
       bru ctsca1             Start at beginning - almost                  06828
                                                                           06829
ctext  stx ctpoi2  2                                                       06830
       ldx ovtsk   1                                                       06831
       bru 1       2                                                       06832
                        Write end-of-file.  If from batch, return to       06833
                        it.  If not, reset flags and exit to task list     06834
                                                                           06835
ctter  lda ctexe+3 3          Get handler                                  06836
       ext mask11             77777                                        06837
       sta ctter1+33          [EOF write instruction]                      06838
       sta ctter2+33          [Rewind instruction]                         06839
ctter1 spb treqst  2          Tape op                                      06840
       sel 1                                                               06841
       wef         4                                                       06842
       oct 0                  Flag                                         06843
ctter2 spb treqst  2                                                       06844
       sel 1                  Rewind now                                   06845
       rwd         4                                                       06846
       oct 0                                                               06847
       spb ctext   2                                                       06848
       lda *-2     3                                                       06849
       bze                                                                 06850
       bru 2       1                                                       06851
       bcs brw     1                                                       06852
       bru 2       1          [Wait for both tape operations to complete]  06853
       lda cmessb             See if batch in                              06854
       bze                                                                 06855
       bru iredy              No                                           06856
       ldx zero    2          Get batch                                    06857
       inx batch   2                                                       06858
       lmo                                                                 06859
       sta io1                Front in                                     06860
       bru pgetb              Get batch                                    06861
                                                                           06862
                        Normal entrance is here                            06863
ctst   ldz                    Check for zero down                          06864
       rcs                                                                 06865
       bmi                                                                 06866
       bru 2       1          Yes, get out                                 06867
       ldx ctpoi2  2          Get entrance to routine                      06868
       bru 1       2          and go there                                 06869
                                                                           06870
                                                                           06871
                        Table of syncwords and places                      06872
cnsyn  oct 2606077            Normal decimal sync                          06873
cbsyn  oct 2001777            Binary                                       06874
cfsyn  oct 2007777            Full                                         06875
cbsynp lda 41      2          Location of binary syncword after read       06876
cfsynp lda 83      2          Location of full sync after read             06877
                                                                           06878
                        Tape handler table                                 06879
                                                                           06880
cttab  bss 0                                                               06881
       z21 27                 [0]                                          06882
       z02 27                 [1]                                          06883
       z04 27                 [2]                                          06884
       z10 27                 [3]                                          06885
       z21 27                 [4]                                          06886
       z22 27                 [5]                                          06887
       z24 27                 [6]                                          06888
       z21 27                 [7]Make 0 to 4                               06889
                                                                           06890
.ctst. spb ctst    1                                                       06891
       dec -1                                                              06892
                                                                           06893
ctbup  dec io1                Buffer pointers                              06894
       dec io2                                                             06895
                                                                           06896
                        Card reader trouble                                06897
cterm3 oct 372321                                                          06898
       alf RD                                                              06899
       alf REA                                                             06900
       alf DER                                                             06901
       alf  TR                                                             06902
       alf OUB                                                             06903
       alf LE.                                                             06904
       oct 375577                                                          06905
                                                                           06906
                        Card reader error backspace 2 and toggle 1         06907
                                                                           06908
crerm2 oct 372321                                                          06909
       alf RD                                                              06910
       alf REA                                                             06911
       alf DER                                                             06912
       alf  ER                                                             06913
       alf ROR                                                             06914
       alf  BA                                                             06915
       alf CKS                                                             06916
       alf PAC                                                             06917
       alf E 2                                                             06918
       alf  AN                                                             06919
       alf D T                                                             06920
       alf OGG                                                             06921
       alf LE                                                              06922
       oct 13755                                                           06923
crcb1  rcb 0                                                               06924
crcf1  rcf 0                                                               06925
ctd40  dec 40                                                              06926
ctd80  dec 80                                                              06927
cbq1   bru cbq                                                             06928
cfq1   bru cfq                                                             06929
ctb1   alf 00B                [These 4 characters must be in alpha order]  06930
ctd1   alf 00D                                                             06931
ctf1   alf 00F                                                             06932
cts1   alf 00S                                                             06933
                                                                           06934
                        Lower memory                                       06935
       org ta                                                              06936
ctbp   bss 2                                                               06937
ctpoi2 bss 1                  Master return                                06938
cren   bss 1                                                               06939
ctime  bss 1                                                               06940
                                                                           06941
       loc 6000               Put tape subroutine on the end of this       06942
ctfix  lda tap+2              Disk address of subroutine                   06943
       sta *+5                                                             06944
       bcs brn     0                                                       06945
       bru *-1                                                             06946
ctfix1 sel 0                                                               06947
       prf         0                                                       06948
       oct 0                                                               06949
       bcs brn     0                                                       06950
       bru *-1                                                             06951
       sel 0                                                               06952
       rrd 3       0                                                       06953
           treqst                                                          06954
       bcs brn     0                                                       06955
       bru *-1                                                             06956
       bcs ber     0                                                       06957
       bru ctfix1                                                          06958
                                                                           06959
       bru lovwrt             Now go and load                              06960
                                                                           06961
       tcd ctfix                                                           06962
                                                                           06963
       stl                    System loader                                06964
       ejt                                                                 06965
                                                                           06966
                        The system loader will load a time-sharing-        06967
                        compatible system from the card reader.            06968
                        Transfer to the end card on index register         06969
                        2 and index group zero, and expect a return        06970
                        to 1,2.  The loader will then write the            06971
                        system on the disk and read in the next            06972
                        card.  It terminates on a hopper-empty             06973
                        condition.  It also checks for cards               06974
                        loaded into illegal addresses, namely all          06975
                        those not in between 1400 and 33777.   It          06976
                        works while time-sharing is running by             06977
                        asking the D-30 to start a batch run.  This        06978
                        prevents wiping people out.                        06979
                                                                           06980
                        After an overlay has been loaded, the loader       06981
                        expects to find the length of the overlay,         06982
                        raised to the next highest multiple of 64          06983
                        words in the A register.                           06984
                                                                           06985
                                                                           06986
       org pernum                                                          06987
       dec 18                                                              06988
       dec sys                SYStem                                       06989
                                                                           06990
       org execov                                                          06991
       lda o10                                                             06992
       spb spmess  2          Start batch                                  06993
       bru 2       1          return to exec                               06994
       lda three              Ask for clock off                            06995
       spb spmess  2                                                       06996
       lda kermes             Error message                                06997
       sta mbx0               will crump batch                             06998
       dld .sin.   3          Insert task                                  06999
       spb insert  2                                                       07000
       sta ovtsk              and save where                               07001
       spb messg   2          Acknowledge message                          07002
       dec pcr                                                             07003
       lda 8K                 and initialize                               07004
       sta spoin              task pointer                                 07005
       sta io1+41             Synchword                                    07006
       sta in                 Reset system indicator                       07007
       sta perin              Knock out overlay-in-memory indicator        07008
       lac                    and set interval                             07009
       add seven                                                           07010
       sta slapse                                                          07011
       lda swdct1  3          Word count mask                              07012
       sta swdct                                                           07013
       lda saddr1  3          Address mask                                 07014
       sta saddr                                                           07015
       lda soctct1 3          One bits for octal correction module         07016
       sta soctc                                                           07017
       lda sign               Construct mask                               07018
       sra 5                                                               07019
       sta smask              3760000                                      07020
       lda wait1              Upper bound check                            07021
       sta pct                set return to wait loop                      07022
       sta slim                                                            07023
       ldz                    Clear memory                                 07024
       sta io2+40                                                          07025
       sta sx3sv                                                           07026
       rcs                    to contents of switches                      07027
       bod                                                                 07028
       bru sinx               [but not if 19 down?]                        07029
       sta sl1                                                             07030
       dld sl2     3                                                       07031
       mov sl1                                                             07032
sinx   lda .sin1.                                                          07033
       sto spoin                                                           07034
       set prq                Set prq to get started                       07035
       bru slret              and wait in loop                             07036
                                                                           07037
sin1   spb srchk   2          Check reader                                 07038
       rcb io1                Read first card                              07039
       hcr                    and crump the silly thing                    07040
       lda .swn.              Set pointer                                  07041
       sto spoin                                                           07042
       bru slret              and get out                                  07043
                                                                           07044
                                                                           07045
                                                                           07046
swn    spb srchk   2          Set pointer for main routine                 07047
       lda .sld.                                                           07048
       sto spoin                                                           07049
       dld io1                and check card                               07050
       dsu .swon1  3          Check if first card is system loader         07051
       bze                                                                 07052
       xaq                                                                 07053
       bnz                    If not, process it                           07054
       bru sld                                                             07055
       dld io1+2              Else check next word                         07056
       dsu .swon2  3                                                       07057
       bze                                                                 07058
       xaq                                                                 07059
       bnz                    If unequal, process                          07060
       bru sld                                                             07061
       rcb io1                If matches, crump this card                  07062
       hcr                                                                 07063
       bru slret              and get out                                  07064
                                                                           07065
                                                                           07066
                                                                           07067
sin    ldz                    All entries begin her                        07068
       rcs                    Check switch 0                               07069
       bmi                    If down, crump                               07070
       bru 2       1                                                       07071
       ldx spoin   2                                                       07072
       bru *+1     2                                                       07073
       bru sld                [Main routine]                               07074
       bru sror               Checksum error                               07075
       bru sdsk               Write system on disk                         07076
       bru 2       1          Return and do nothing                        07077
       bru 2       1          Not used now                                 07078
       bru 2       1          Not used now                                 07079
       bru sin1               and initial sequence                         07080
       bru swn                First card check                             07081
.sld.  equ zero                                                            07082
.sror. equ one                                                             07083
.sdsk. equ two                                                             07084
.styp. equ three                                                           07085
.sin1. equ six                                                             07086
.swn.  equ seven                                                           07087
                                                                           07088
                                                                           07089
                                                                           07090
srchk  bcn                    Check reader                                 07091
       bru schk               not ready                                    07092
       lac                    Set timer                                    07093
       add seven                                                           07094
       sta slapse                                                          07095
       bru 1       2          and get back                                 07096
                                                                           07097
schk   lda io1+41             Check syncword for hopper empty              07098
       sub .schk   3                                                       07099
       bze                    If empty, completely done                    07100
       bru syend                                                           07101
       nop                    jsm *****ERROR was bru 2,1                   07102
       lac                    Else check time                              07103
       cab slapse                                                          07104
       bru slret                                                           07105
       bru slret              Crump                                        07106
       add cr                 and set it up if over                        07107
       sta slapse                                                          07108
       spb messg   2                                                       07109
       dec scrn               Card reader not ready                        07110
       bru slret                                                           07111
                                                                           07112
                                                                           07113
                                                                           07114
sld    spb srchk   2          This is the main routine - check reader      07115
       dld sr2     3                                                       07116
       mov io1                Move card image into working area            07117
       sta z1                 Initialize word pointer                      07118
       sta sdiskf             Blank flag                                   07119
       lda io2     1          Begins in lower bank... get first word       07120
       bze                    Octal corrections module                     07121
       bru soct                                                            07122
       ldx sx3sv   3          Keep same bank as before                     07123
       ext swdct              Mask off all but word count                  07124
       bze                    If none, transfer card                       07125
       bru stran                                                           07126
       rcb io1                and get next card                            07127
       hcr                                                                 07128
                                                                           07129
snext  sra 13                 Get word count right-justified               07130
       sta z0                 and set in counter                           07131
       lda io2     1          Get word again                               07132
       ext saddr              and get address                              07133
       bmi                    If negative, Dartmouth-style card            07134
sdart2 bru sdart1             Change loader to take Dar cards              07135
       sto z3                 Else set in register and leave bank          07136
       lda z3                 Check if too low                             07137
       ext smask                                                           07138
       cab mendt                                                           07139
       bru serad              Crump                                        07140
       bru *+1                OK                                           07141
smore  inx 1       1          Increment working area pointer               07142
       lda z3                 Check where storing for too far up           07143
       ext smask                                                           07144
       cab slim                                                            07145
       bru *+3                OK                                           07146
       bru serad              Crump                                        07147
       bru serad                                                           07148
       lda io2     1          Get next word                                07149
       sta 0       3          and put away                                 07150
       add io2-1   1          Checksum                                     07151
       bov                    If overflow, step by one                     07152
       ado                                                                 07153
       sta io2     1          and save across card                         07154
       inx -1      0          Decrement counter                            07155
       inx 1       3          Step address counter                         07156
       bxh 1       0          and check if end of block                    07157
       bru smore              No, get some more words                      07158
       sub io2+1   1          See if checkword OK                          07159
       bnz                    Checksum error                               07160
       bru ser1                                                            07161
       inx 2       1          Get next origin                              07162
       lda io2     1                                                       07163
       ext swdct              and leave word count                         07164
       bnz                    If words, get them                           07165
       bru snext                                                           07166
       stx sx3sv   3                                                       07167
                                                                           07168
                                                                           07169
                                                                           07170
slret  ldx 8K      3          Reset register                               07171
       ldx ovtsk   1          Get return                                   07172
       bru 2       1          and get out                                  07173
                                                                           07174
                                                                           07175
                                                                           07176
soct   rcb io1                Octal corrections module                     07177
       hcr                                                                 07178
       bru socte              and begin scanning                           07179
                                                                           07180
soctb  sra 10                 Get left half                                07181
       ext soctc              and mask off sign and high-order end         07182
       nor 16                                                              07183
       sla 1                  Check for word                               07184
       lda socacc             Get accumulated word so far                  07185
       bov                    overflow if word                             07186
       bru soctd                                                           07187
       bxl 2       3          Nothing so far, keep scanning                07188
       bru socte                                                           07189
       bxl 3       3          Terminate on single character field          07190
       bru slret                                                           07191
       bxh 7       3          6 or 7 character is instruction              07192
       bru soctf                                                           07193
       sta socadd             Else address                                 07194
                                                                           07195
socte  dld zero               Zero out A, Q, and register 3                07196
       sta z3                                                              07197
       bru socta-1            and check card                               07198
                                                                           07199
soctd  sld 3                  Accumlate characters                         07200
       ext 0                                                               07201
       bno                                                                 07202
       chs                                                                 07203
       sta socacc             and save                                     07204
socta  inx 1       3          Step character count immediately             07205
       bxh 40      1          and check if end of card                     07206
       bru slret                                                           07207
       lda soctc                                                           07208
       lqa                    Put some one bits in Q                       07209
       lda io2     1          Get word                                     07210
       bxl 1       2          Check if end  of word                        07211
       spb soctb   2          No, get first half                           07212
       inx 1       1          Else get next word                           07213
       ldx zero    2          and reset flag                               07214
       bru soctb+1                                                         07215
                                                                           07216
soctf  ldx socadd  3          Get address counter                          07217
       sta 0       3          and put away word                            07218
       inx 1       3          Bump up counter                              07219
       stx socadd  3          and save                                     07220
       bru socte              and get some more                            07221
                                                                           07222
                                                                           07223
                                                                           07224
sdart1 ldx 8K      3          Reset register                               07225
       lda sdart   3          Change instructions                          07226
       sta sdart2  3          to assume all rest will be Dartmouth-style   07227
       sta sdart3  3                                                       07228
       lda socte+1 3                                                       07229
       sta sdart2+13                                                       07230
       sta sdart3+13                                                       07231
       bru snext+2 3          Get back                                     07232
                                                                           07233
                                                                           07234
                                                                           07235
stran  lda io2     1          Transfer card                                07236
       bmi                    If negative, Dartmouth upper memory          07237
sdart3 ldx 8K      3          If first of kind, transfer correctly         07238
       sto z3                 else stay in bank                            07239
       lda z3                 Save location                                07240
       sta xr03                                                            07241
       lmo                    Reset flag for correct exit                  07242
       sta sdiskf                                                          07243
       sxg 0                  Set group zero for system                    07244
       set pst                and prepare to exit API                      07245
       set pbk                with no interrupts                           07246
       ldx 8K      3          Restore register                             07247
       bru *+2     3                                                       07248
       bru 0       3          Transfer                                     07249
       spb *-1     2          Save return for systems                      07250
       rcb io1                Now get next card - as well as generate      07251
       hcr                    interrupt on 225                             07252
       ldx z3      3          [API register 3 to current register 3]       07253
       sta sleng              Length of overlay                            07254
       sra 6                                                               07255
       sto sdksb+1 3          Number of records for operation              07256
       lda sname+1 3          See if overlay                               07257
       bnz                                                                 07258
       bru *+3                                                             07259
       lda so140   3          System to put 96 records back                07260
       sto sdskb+1 3                                                       07261
       lda .sdsk.             Return is to here                            07262
       sto spoin              and set pointer                              07263
       set pst                                                             07264
       set prq                Set prq                                      07265
       bru wait                                                            07266
                                                                           07267
                                                                           07268
                                                                           07269
ser1   ldx 8K      3          Set up register                              07270
       lda .sror.                                                          07271
       sto spoin              and set pointer                              07272
       spb messg   2                                                       07273
       dec schksm             Checksum error - backspace two cards         07274
sror   ldz                    toggle 2 when ready.                         07275
       rcs                    Check 2                                      07276
       sla 2                                                               07277
       bno                    Not down, crump                              07278
       bru slret                                                           07279
       spb srchk   2                                                       07280
       rcb io1                OK                                           07281
       hcr                                                                 07282
       lda .sld.                                                           07283
       sto spoin              and set it to load                           07284
       bru slret                                                           07285
                                                                           07286
                                                                           07287
                                                                           07288
serad  stx sx3sv   3          Address out of bounds                        07289
       ldx 8K      3          Restore register                             07290
       spb messg   2          and type message                             07291
       dec silad                                                           07292
       bru slret              and get next card                            07293
                                                                           07294
                                                                           07295
                                                                           07296
sdsk   ldx zero    2          Set register for search                      07297
       lda sname   3          Get name                                     07298
sdsk1  cab sytab   2          Search address table                         07299
       bru *+2                                                             07300
       bru sfnd               Found                                        07301
       inx 1       2          and step pointer                             07302
       bxl last    2          Check end of table                           07303
       bru sdsk1              OK                                           07304
       sta ssno1   3                                                       07305
       spb messg   2                                                       07306
       dec ssno               System not available                         07307
       bru icrump                                                          07308
                                                                           07309
                                                                           07310
sfnd   lda .styp.             Set up to do nothing while writing on disk   07311
       sto spoin              and set in pointer                           07312
       lda sname+1 3          Get replacement or overlay number            07313
       sto sylo2   3          set in overlay message                       07314
       sto *+1     3          and set for step to get address              07315
       inx 0       2          Step pointer by identifying number           07316
       lda sytab+1 2          Get correct disk address                     07317
       sta sdksb+3 3          Set in parameter list                        07318
       lda sname   3          Get system name again                        07319
       ldx 8K      2          and initialize for search                    07320
sfnd1  cab snames  2          Check against list of system names           07321
       bru *+2                Not found                                    07322
       bru *+3                Found OK                                     07323
       inx 3       2          Keep searching                               07324
       bru sfnd1              and try again                                07325
       sta syl1    3          Get names and set in typewriter message      07326
       lda snams+1 2          Second word                                  07327
       sta syl1+1  3                                                       07328
       lda snams+2 3          Third word                                   07329
       sta syl1+2  3                                                       07330
       spb messg   2          Output system name                           07331
       dec syl                System                                       07332
       lda sname+1 3          Get identifying number and see if overlay    07333
       bze                    If zero, then system                         07334
       bru sfnd2              so punt                                      07335
       spb messg   2          Else type overlay number                     07336
       dec sylo                                                            07337
       lda sleng              See if overlay fits in space                 07338
       sra 5                  Position for disk command                    07339
       sub two                translate to zero                            07340
       add sdskb+3 3          Disk address                                 07341
       ext mask1              3777400                                      07342
       sub o300                                                            07343
       bpl                                                                 07344
       bru sler                                                            07345
sfnd2  spb dskb    2          Ask for disk                                 07346
                                                                           07347
sdksb  spb dskop   2          and write system on disk                     07348
       z37 96                 write, 96 records                            07349
       dec system             from system location                         07350
       z00 --                 constructed disk address                     07351
       bru sterm              Error - crump works                          07352
       spb relin   2          Relinquish disk                              07353
sdskb2 lda .sld.                                                           07354
       sto spoin                                                           07355
       ldz                    Reset lower bank                             07356
       sta sx3sv                                                           07357
       bru sld                Process                                      07358
                                                                           07359
                                                                           07360
sler   spb messg   2                                                       07361
       dec stlo               Overlay too long                             07362
       bru sdskb2             Continue                                     07363
                                                                           07364
                                                                           07365
sterm  spb messg   2          Type no-load message and crump as disk error 07366
       dec snol               No load                                      07367
       bru icrump             and punt                                     07368
                                                                           07369
                                                                           07370
                                                                           07371
syend  lda sdiskf             Check for silly clods who leave off          07372
       bmi                    extra blank                                  07373
       bru icrump             OK                                           07374
       spb messg   2          Else type message                            07375
       dec sblank                                                          07376
       ldx ovtsk   1                                                       07377
       spb irase   2          and delete entry                             07378
       lda four               Ask for count                                07379
       spb spmess  2                                                       07380
       bru iresp              and reset pointers                           07381
                                                                           07382
                                                                           07383
                                                                           07384
snams  alf BAS                BASIC                                        07385
       oct 313277                                                          07386
       oct 777777                                                          07387
       alf ALG                ALGOL                                        07388
       oct 464377                                                          07389
       oct 777777                                                          07390
       alf XBA                XBASIC                                       07391
       alf SIC                                                             07392
       oct 777777                                                          07393
       alf XAL                XALGOL                                       07394
       alf GOL                                                             07395
       oct 777777                                                          07396
       alf FOR                FORTRAN                                      07397
       alf TRA                                                             07398
       oct 457777                                                          07399
       alf XFO                XFORTRAN                                     07400
       alf RTR                                                             07401
       oct 214577                                                          07402
       alf DIP                Dartmouth Interpretive Program               07403
       alf                                                                 07404
       alf                                                                 07405
       alf TSA                Time-Sharing Assembly Processor              07406
       alf P                                                               07407
       alf                                                                 07408
       alf EDI                EDIT system                                  07409
       alf T                                                               07410
       alf                                                                 07411
                                                                           07412
                                                                           07413
                                                                           07414
.sin.  spb sin     1          Entry                                        07415
       dec -1                                                              07416
sl2    dec sl3                                                             07417
       dec -13566                                                          07418
sr2    dec io2                                                             07419
       dec -40                                                             07420
.swon1 ldo                    First four words of system loader card       07421
       sta pmbx0                                                           07422
.swon2 bcs brn     0                                                       07423
       bru 2                                                               07424
saddr1 oct 1760000            Leave address                                07425
swdct1 oct 2017777            Leave word count                             07426
soctc1 oct 3776000            Upper end mask                               07427
so140  oct 140                96 records                                   07428
sdart  add 8K                 Instruction change for Dartmouth cards       07429
.schk  oct 3001777            Hopper empty check                           07430
sl1    eqo 1400                                                            07431
sl3    eqo sl1+1                                                           07432
                                                                           07433
                                                                           07434
                                                                           07435
                                                                           07436
syl    bss 0                  System                                       07437
       oct 373737                                                          07438
syl1   alf                                                                 07439
       alf                                                                 07440
       alf                                                                 07441
       oct 375577                                                          07442
                                                                           07443
sylo   bss 0                  Overlay #                                    07444
       alf OVE                                                             07445
       alf RLA                                                             07446
       oct 707777                                                          07447
       oct 601360                                                          07448
sylo2  alf                                                                 07449
       oct 375577                                                          07450
                                                                           07451
scrn   bss 0                  Card reader not ready                        07452
       oct 372321                                                          07453
       alf RD                                                              07454
       alf REA                                                             07455
       alf DER                                                             07456
       alf  NO                                                             07457
       alf T R                                                             07458
       alf EAD                                                             07459
       oct 703337                                                          07460
       oct 557777                                                          07461
                                                                           07462
schksm bss 0                  Checksum error, backspace two cards and      07463
       oct 372330             toggle 2 when ready                          07464
       alf ECK                                                             07465
       alf SUM                                                             07466
       alf  ER                                                             07467
       alf ROR                                                             07468
       alf          B                                                      07469
       alf ACK                                                             07470
       alf SPA                                                             07471
       alf CE                                                              07472
       alf 2 C                                                             07473
       alf ARD                                                             07474
       alf S A                                                             07475
       alf ND                                                              07476
       alf TOG                                                             07477
       alf GLE                                                             07478
       alf  2                                                              07479
       alf WHE                                                             07480
       alf N R                                                             07481
       alf EAD                                                             07482
       oct 703337                                                          07483
       oct 557777                                                          07484
                                                                           07485
silad  bss 0                  Address out of bounds                        07486
       oct 372124                                                          07487
       alf DRE                                                             07488
       alf SS                                                              07489
       alf OUT                                                             07490
       alf  OF                                                             07491
       alf  BO                                                             07492
       alf UND                                                             07493
       oct 623337                                                          07494
       oct 557777                                                          07495
                                                                           07496
ssno   bss 0                  System not available                         07497
       oct 376270                                                          07498
       alf STE                                                             07499
       alf M N                                                             07500
       alf OT                                                              07501
       alf AVA                                                             07502
       alf ILA                                                             07503
       alf BLE                                                             07504
       oct 777760                                                          07505
ssno1  alf                                                                 07506
       oct 333755                                                          07507
                                                                           07508
snol   bss 0                  No load.                                     07509
       oct 374546                                                          07510
       alf  LO                                                             07511
       alf AD.                                                             07512
       oct 375577                                                          07513
                                                                           07514
sblank bss 0                  *** Missing blank ***                        07515
       oct 373754                                                          07516
       alf ***                                                             07517
       alf  MI                                                             07518
       alf SSI                                                             07519
       alf NG                                                              07520
       alf BLA                                                             07521
       alf NK                                                              07522
       alf ***                                                             07523
       oct 543755                                                          07524
                                                                           07525
stlo   bss 0                  Overlay too long                             07526
       oct 374665                                                          07527
       alf ERL                                                             07528
       alf AY                                                              07529
       alf TOO                                                             07530
       alf  LO                                                             07531
       alf NG                                                              07532
       oct 375577                                                          07533
                                                                           07534
                                                                           07535
                                                                           07536
                                                                           07537
       org t                  Temporary storage                            07538
spoin  bss 1                  Routine pointer                              07539
slapse bss 1                  Elapsed time counter for card reader         07540
sx3sv  bss 1                  Register 3 save                              07541
swdct  bss 1                  Word count mask                              07542
saddr  bss 1                  Address mask                                 07543
soctc  bss 1                  High-order mask                              07544
soctaccbss 1                  Word accumulator                             07545
soctaddbss 1                  Address                                      07546
slim   bss 1                  Upper limit                                  07547
smask  bss 1                  Mask for all high-order bits above 16K       07548
sdiskf bss 1                  Disk flag for missing blanks                 07549
sleng  bss 1                  Overlay length                               07550
       tcd lovwrt             end                                          07551
                                                                           07552
       stl                    Debugging package - DBGOUT, DBGOCT, DBGCOM   07553
       ejt                                                                 07554
                        These debugging routines are called from           07555
                        the console typewriter.                            07556
                        The commands are...                                07557
                           *DBGOUT* to dump on the printer with HSMP       07558
                           *DBGOCT* to use the octal insert routine        07559
                           *DBGCOM* to get a communications dump           07560
                                                                           07561
                                                                           07562
                        CHAR is a character pickup routine that            07563
                        takes characters from ty and places them one       07564
                        at a time in the A register.                       07565
                                                                           07566
                                                                           07567
                        OUT takes parameters inputted from the             07568
                        console typewriter and will dump from the          07569
                        specified locations onto the high speed            07570
                        printer.                                           07571
                        The format is as follows                           07572
                        OUT xxxxx,xxxxxx$  where $ stands for              07573
                        a carriage return.  Embedded blanks and            07574
                        other non-numeric characters are ignored.  The     07575
                        dump will be from the location before the          07576
                        comma to the location after.  OUT, will            07577
                        dump from 0, but the other parameter must          07578
                        be there.                                          07579
                                                                           07580
                                                                           07581
                        OCTAL takes the input before a colon and sets      07582
                        it in the location counter.  A comma causes        07583
                        the previous input to be stored in the             07584
                        address of the counter, and increments it by       07585
                        one.  [The format is...]                           07586
                        OCTAAAAA,XXXXXXX,YYYYYYY, etc.                     07587
                        OCTAL without an address will save the pre-        07588
                        viously used one - zero if not initialized         07589
                        WARNING...8, 9 are treated as zero                 07590
                                                                           07591
                                                                           07592
                        DUMP is a modified version of GE's high-           07593
                        speed printer memory dump.  The dump               07594
                        is entered with from and to adresses in            07595
                        A and Q.  It uses two separate buffer areas        07596
                        for printing from.                                 07597
                                                                           07598
                                                                           07599
                                                                           07600
                                                                           07601
       org pernum                                                          07602
       dec 20                                                              07603
       dec dbg                                                             07604
                                                                           07605
       org execov                                                          07606
       spb bgtoff             Ask time stop                                07607
       lda sloc1   3          Get accumulated counter so far               07608
       sta sloc                                                            07609
       lda com3    3          Set up test registers                        07610
       sta com1                                                            07611
       lda col3    3                                                       07612
       sta col1                                                            07613
       dld dumpmb  3          Setup some more constants for HSMP           07614
       dst dmpmsk                                                          07615
       lda ty+1               Check if OUT or OCTAL                        07616
       cab comnic  3          Communications debugging                     07617
       bru sdel               No, error                                    07618
       bru combug             Debug communications system                  07619
       cab oct     3          OCTAL                                        07620
       bru sdel               No                                           07621
       bru octal                                                           07622
       cab out     3          HSMP dump                                    07623
       bru sdel               No                                           07624
       bru HSMP                                                            07625
       cab bgtim   3          Check for clock-set                          07626
       bru sdel               No                                           07627
       bru bgtime                                                          07628
       bru sdel               Not found at all, error                      07629
                                                                           07630
char   bxl 2       2          2 must be initialized at plus two            07631
       bru char23                                                          07632
       ldx zero    2                                                       07633
char2  inx 1       1          and increment one                            07634
       lda ty      1          Get word                                     07635
       sta ch3                and break up                                 07636
       sra 6                                                               07637
       sta ch2                                                             07638
       sra 6                                                               07639
char1  ext mask7              Get rid of all but character                 07640
       bru 1       3          Exit                                         07641
char23 lda ch2     2          Get next character                           07642
       inx 1       2          and increment pointer                        07643
       bru char1                                                           07644
                                                                           07645
                                                                           07646
                                                                           07647
hsmp   dld zero                                                            07648
       sta temp               and temporary storage                        07649
       dst z0                                                              07650
       sta z2                                                              07651
       sta rawt                                                            07652
       spb char2   3          and get character                            07653
       cab com1               Check for comma                              07654
       bru *+2                No                                           07655
       bru ocom               Yes                                          07656
       cab cr                 and check for carriage return                07657
       bru *+2                                                             07658
       bru ocr                Yes                                          07659
common cab seven              Check if less than 7.                        07660
       bru *+3                OK                                           07661
       bru *+2                                                             07662
       bru char               Ignore and get another                       07663
       bxh 7       0          Check if more than 7                         07664
       bru sdel                                                            07665
       inx 1       0          Increment counter                            07666
       srd 3                                                               07667
       add temp               Save character and build word                07668
       sld 3                                                               07669
       bov                    If overflow, sign bit set                    07670
       add sign                                                            07671
       sta temp               Save word                                    07672
       bru char               and get out                                  07673
                                                                           07674
                                                                           07675
ocom   lmo                    Reset flag                                   07676
       sta rawt                                                            07677
       lda temp               Get word                                     07678
       sta dumpbg                                                          07679
ocomon ldz                    Reset counters and storage                   07680
       sta temp                                                            07681
       sta z0                                                              07682
       bru char                                                            07683
                                                                           07684
ocr    lda rawt               If no comma yet, crump                       07685
       bpl                                                                 07686
       bru sdel                                                            07687
       lda temp               Get to location                              07688
       lqa                                                                 07689
       lda dumpbg             and from in A                                07690
       ldx 8k      3                                                       07691
       spb dump    1                                                       07692
       bru oct3               Get out                                      07693
                                                                           07694
                                                                           07695
                                                                           07696
octal  dld zero               Initialize registers                         07697
       sta temp                                                            07698
       dst z0                                                              07699
       sta z2                                                              07700
       spc char2   3          Get character                                07701
       cab col1               Check for colon                              07702
       bru *+2                                                             07703
       bru scolon             Found                                        07704
       cab com1               Check for comma                              07705
       bru *+2                                                             07706
       bru scomma             Found                                        07707
       cab cr                 and carriage return                          07708
       bru common                                                          07709
       bru scr                                                             07710
       bru common                                                          07711
                                                                           07712
scolon lda temp               Get location                                 07713
       sta sloc               Set in counter                               07714
       bru ocomon             and reset storage                            07715
                                                                           07716
scomma stx rawt    2          Save register                                07717
       stx dtmp    3          Save register 3                              07718
       spb scom1   2                                                       07719
       ldx rawt    2                                                       07720
       ldx dtmp    3          Restore 3                                    07721
       bru char               and get another character                    07722
scom1  ldx sloc    3          Get location                                 07723
       lda temp               and store word there                         07724
       sta 0       3                                                       07725
       inx 1       3          Bump up address counter                      07726
       stx sloc    3          and save                                     07727
       ldz                    Reset                                        07728
       sta temp                                                            07729
       sta z0                                                              07730
       bru 1       2                                                       07731
                                                                           07732
scr    spb scom1   2          Act as if comma                              07733
       ldx 8K      3                                                       07734
       lda sloc               Restore location counter                     07735
       sta sloc1   3                                                       07736
oct3   bru icrump             and get out                                  07737
                                                                           07738
sdel   ldx 8K      3          Restore register                             07739
       spb messg   2          Illegal task                                 07740
       dec del                                                             07741
       bru oct3               and crump                                    07742
                                                                           07743
                                                                           07744
                                                                           07745
                        COMBUG is used to debug communications by          07746
                        patching out certain selected locations in         07747
                        the main body of the executive.  In place          07748
                        of the original instructions, which it saves,      07749
                        it places branches to printout routines,           07750
                        which dump the lower-lower storage area,           07751
                        and the inserted tasks in iplst.                   07752
                                                                           07753
                                                                           07754
                                                                           07755
combug bss 0                                                               07756
       lda cbuga   3          The routine is terminated by stop.           07757
       sta cbugas  3                                                       07758
       lda cbugb   3          Exit patch                                   07759
       sta cbugbs  3                                                       07760
       lda icrump  3          Crump location                               07761
       sta cbugcs  3                                                       07762
       lda .coma.  3          and set in mailbox receipt routine           07763
       sta cbuga   3                                                       07764
       lda .comb.  3          Get exit patch                               07765
       sta cbugb   3                                                       07766
       lda .comc.  3          and patch out crump                          07767
       sta icrump  3                                                       07768
       sta perin              Destroy system-in indicator                  07769
       spb messg   2          Type ready                                   07770
       dec rea                                                             07771
       spb bgton   2          and ask for ON                               07772
       bru 2       1          and get back                                 07773
                                                                           07774
                                                                           07775
coma   stx dtmp    2          Entry from mailbox                           07776
       spb bgtoff  2          Ask for OFF                                  07777
       bcs bpn     6          and slew to top of page so we can            07778
       bru *-1                see what we're doing                         07779
       sel 6                                                               07780
       slt 8                                                               07781
       dld obug1   3          Get first set of locaitons                   07782
       spb dump    1          and dump                                     07783
       dld obug2   3          Dump save area                               07784
       spb dump    1                                                       07785
       dld obug3   3          iprior-iplst                                 07786
       spb dump    1                                                       07787
       bcs bpn     6          and slew extra four lines in between         07788
       bru *-1                                                             07789
       sel 6                                                               07790
       slw 4                                                               07791
       spb bgton   2          Ask for ON again                             07792
       ldx dtmp    2          and return                                   07793
       bru cbuga+1 2          and branch to list                           07794
                                                                           07795
                                                                           07796
comb   sta dtmp               Exit-debugging dump                          07797
       spb bgtoff  2          Ask for OFF                                  07798
       dld obug3   3          Third set                                    07799
       spb dump    1                                                       07800
       dld obug2   3          Second set                                   07801
       spb dump    1          and dump                                     07802
       dld obug1   3          First set                                    07803
       spb dump    1          and dump                                     07804
       spb bgton   2          Ask for ON                                   07805
       lda dtmp               Get answer again                             07806
       sta mbx0               and set in mailbox                           07807
       bru cbugb+1            and get back                                 07808
                                                                           07809
                                                                           07810
comc   lda cbugas  3          Restore debugging entries                    07811
       sta cbuga   3                                                       07812
       lda cbugps  3          Restore second patch                         07813
       sta cbugb   3                                                       07814
       lda cbugcs  3          Icrump restore                               07815
       sta icrump  2                                                       07816
       bru icrump             and get back                                 07817
                                                                           07818
                                                                           07819
                                                                           07820
bgtoff lda three              Ask for time count stop                      07821
       bru spmess                                                          07822
                                                                           07823
bgton  lda four               Ask for time count resumption                07824
       bru spmess                                                          07825
                                                                           07826
                                                                           07827
                        BGTIME converts a time entered in hours and        07828
                        minutes to octal 6ths of a second for the          07829
                        real-time clock.  The call is DBGTIM               07830
                        followed by the hours, then a colon, then the      07831
                        minutes.  [A final $ is required for the time      07832
                        to take effect.]                                   07833
                                                                           07834
bgtime dld zero               Initialize some areas                        07835
       dst z0                                                              07836
       sta z2                                                              07837
       sta temp               and temporary storage                        07838
       sta rawt                                                            07839
       spb char2   3          and then get characters                      07840
       cab col1               Check for colon                              07841
       bru *+2                No                                           07842
       bru bgcol              Yes, go process                              07843
       cab cr                 Check for carriage return                    07844
       bru *+2                No                                           07845
       bru bgcr               Else go process                              07846
       cab ten                Check for digits                             07847
       bru bgcon              Yes, convert them                            07848
       bru char               Else continue scan                           07849
       bru char                                                            07850
                                                                           07851
                                                                           07852
bgcon  bxh 2       0          Check if over two characters                 07853
       bru sdel               If so, crump                                 07854
       mpy ten                Else convert to binary                       07855
       inx 1       0          and step counter                             07856
       bru char               and get next character                       07857
                                                                           07858
bgcol  ldz                    Colon                                        07859
       mpy h1                 Get hours in sixths of a second              07860
       bnz                    Check for too many                           07861
       bru sdel               If so, crump                                 07862
       laq                    Else get them                                07863
       sta dumpx              and save them                                07864
       lda rawt               Check if second time or fudge carriate ret   07865
       bod                                                                 07866
       bru bgdon              Two colons will also do                      07867
       lda two                Colons will reset if more than one           07868
       sta rawt                                                            07869
       dld zero               Re-initialize                                07870
       sta z0                 and reset counter                            07871
       bru char               and get some more characters                 07872
                                                                           07873
                                                                           07874
bgcr   lda rawt               Check if colon previously                    07875
       bnz                    Yes, OK                                      07876
       bru *+4                                                             07877
       ldo                    Else pretend colon                           07878
       sta rawt                                                            07879
       bru bgcol              and go process hours                         07880
       ldz                    Get minutes in sixths of a second            07881
       mpy h2                                                              07882
       laq                                                                 07883
       add dumpx              add hours                                    07884
                                                                           07885
bgdon  ldx 8K      3                                                       07886
       bmi                    Check if too large by far                    07887
       bru sdel                                                            07888
       cab bgmax   3          and check if over 24 hours                   07889
       bru *+3                No, OK                                       07890
       bru *+2                Still OK                                     07891
       bru sdel               Dummy...                                     07892
       sta dumpx              Save for later                               07893
       spb bgton   2          ask for time count                           07894
       dld .bgst.  3          Get entry for table                          07895
       spb inset   2                                                       07896
       sta ovtsk              and make crumpable                           07897
       spb messg   2          Type message                                 07898
       dec rea                                                             07899
       bru irest              and get back                                 07900
                                                                           07901
                                                                           07902
bgst   lda pct                Check for TON                                07903
       bpl                                                                 07904
       bru 2       1          If so, get out                               07905
       sna 19                 Else get character                           07906
       sub bgkey   3          [Check if $]                                 07907
       bnz                    If not, keep trying                          07908
       bru 2       1                                                       07909
       lda dumpx              Else get time                                07910
       lca                    and set in C register                        07911
       add four               Set various timers according to new clock    07912
       sta int1                                                            07913
       add three                                                           07914
       sta dival                                                           07915
       sta hdskd                                                           07916
       add h2                                                              07917
       bmi                    Check too large                              07918
       bru *+4                                                             07919
       cab bgmax   3          Check for too close to midnight              07920
       bru *+3                OK                                           07921
       bru *+1                [too] close                                  07922
       lda bgmax   3          Too close                                    07923
       sta itim                                                            07924
       add k3loc                                                           07925
       bmi                                                                 07926
       bru *+4                Too large                                    07927
       cab bgmax   3          Check for close to midnight                  07928
       bru *+3                OK                                           07929
       bru *+1                [too] close                                  07930
       lda bgmax   3                                                       07931
       sta .eff                                                            07932
       spb time    2          and type out new time                        07933
       dst bgnew1  3                                                       07934
       spb messg   2          and type message                             07935
       dec bgnew                                                           07936
       spb irase   2          and erase task                               07937
       ldz                    Zero out flags                               07938
       sta ovtsk                                                           07939
       sta bzyf               and busy flag                                07940
       bru irest              and crump                                    07941
                                                                           07942
                                                                           07943
                                                                           07944
                                                                           07945
                                                                           07946
dump   stx dumpx1  1          Save return                                  07947
       ext seven              From A to Q                                  07948
       sta dumpbg             Save starting address                        07949
       bcs bpn     6          Wait for printer ready                       07950
       bru *-1                                                             07951
       sel 6                                                               07952
       slw 4                  Slew page 4 lines                            07953
       laq                    Get ending address                           07954
       ext seven              Mask out low order end                       07955
       sta dumped                                                          07956
       dld dumpbk  3          Get buffer addresses                         07957
       dst dumpio             and set in flip flops                        07958
       sto dump1x+13          as well as a couple of other places          07959
       sto dump04  3                                                       07960
       sta z3                                                              07961
       ldx 8K      2          Set register                                 07962
       lda dumpbl             Get blanks                                   07963
       sta 0       3                                                       07964
       sta 40      3          Buffer areas differ by 40                    07965
       inx 1       3          Increment area                               07966
       inx 1       2          Count                                        07967
       bxl 35      2          and test                                     07968
       bru *-5                No                                           07969
       add sign               Make last entries negative blanks            07970
       sta 0       3                                                       07971
       sta 40      3                                                       07972
       ldx 8K      2          Initialize registers                         07973
       ldx dumpbg  3                                                       07974
       bru dumpad                                                          07975
                                                                           07976
dumpov stx dumpx   3                                                       07977
       lda dumpx                                                           07978
       sub dumped             Test for end dump                            07979
       bpl                    If finished dumping, get out                 07980
       bru dumpex                                                          07981
       lda 0       3          Repetitive                                   07982
       sub 8       3           edit by lines                               07983
       bnz                    Not alike                                    07984
       bru dumpit                                                          07985
       inx 1       3          Test next                                    07986
       bru dumpov                                                          07987
                                                                           07988
dumpwb lda 0       3          Get word                                     07989
       srd 18                 Position for build                           07990
       ext dmpmsk             oct 3777774 - mask out high-order bits       07991
       add dmpbbz              with leading blanks                         07992
dump1x ext sign               Insure plus                                  07993
       sta 0       2           in image [modified instruction]             07994
       inx 1       2          Count                                        07995
       bru 1       1          Return                                       07996
dumpbd sla 3                  Build                                        07997
       sld 3                   3                                           07998
       sla 3                   characters                                  07999
       sld 3                   in                                          08000
dumpa1 sla 3                   A reg.                                      08001
       sld 3                   from Q reg.                                 08002
       bru dump1x             and go store                                 08003
                                                                           08004
dumpit inx 8       3          Catch up on index                            08005
dumpad stx dumpx   3          pointer                                      08006
       lda dumpx                                                           08007
       ext seven                                                           08008
       sta dumpbg                                                          08009
       ldx dumpbg  3                                                       08010
       stx dumpx   3                                                       08011
       srd 12                 Position                                     08012
       add dmpbbz              and blank fill                              08013
       spb dumpa1  1          convert                                      08014
       spb dumpbd  1          and store                                    08015
dumpwd spb dumpwb  1          Set sign and bit 1                           08016
       spb dumpbd  1          Build 7                                      08017
       spb dumpbd  1           characters per word                         08018
       inx 1       3          Count for next word                          08019
       bxl 26      2          Test end of image                            08020
       bru dumpwd              no.                                         08021
       inx 1       2          Leave a blank space before BCD dump          08022
       ldx dumpx   3          Build BCD portion of line                    08023
dump03 lda 0       3                                                       08024
       inx 1       3          Step block counter                           08025
       spb dump1x  1          Go store                                     08026
       bxl 35      2          Test for end-of-line                         08027
       bru dump03                                                          08028
       bcs bpn     6          Wait for printer                             08029
       bru *-1                                                             08030
       sel 6                                                               08031
       oct 2600000                                                         08032
dump04 add 0       1          [Constructed ...]                            08033
       ldx 8K      3                                                       08034
       dld dumpio             Get addresses and switch                     08035
       xaq                                                                 08036
       dst dumpio                                                          08037
       sto dump04  3                                                       08038
       sto dump1x+13                                                       08039
       ldx dumpbg  3                                                       08040
       ldx 8K      2                                                       08041
       bru dumpov             Get back                                     08042
                                                                           08043
dumpex ldx dumpx1  3          Get return location                          08044
       ldx 8K      3          and restore x3                               08045
       bru 1       1          and return                                   08046
                                                                           08047
                                                                           08048
dumpbk dec dumpa              Dump buffer areas                            08049
       dec dumpb                                                           08050
obug1  dec t+16               Dump quite a bit                             08051
       dec sclock                                                          08052
obug2  dec kclosk                                                          08053
       dec mkpr1-1            Dump save area                               08054
obug3  dec iprior                                                          08055
       dec eplst-1                                                         08056
dumpmb oct 3777774            Mask                                         08057
       alf   0                and leading blanks                           08058
.bgst. spb bgst    1          Entry to set time in register                08059
       dec -1                                                              08060
bgnew  oct 374525             New time is...                               08061
       alf W T                                                             08062
       alf IME                                                             08063
       alf  IS                                                             08064
bgnew1 alf                                                                 08065
       alf                                                                 08066
       alf  HO                                                             08067
       alf URS                                                             08068
       oct 333755                                                          08069
dumpa  bss 40                                                              08070
dumpb  bss 40                                                              08071
sloc1  dec 0                  Location counter                             08072
out    alf OUT                                                             08073
oct    alf OCT                                                             08074
comnic alf COM                                                             08075
.coma. bru coma                                                            08076
.comb. bru comb                                                            08077
.comc. bru comc                                                            08078
com3   oct 73                 Comma                                        08079
col3   oct 15                 Colon                                        08080
bgmax  oct 1764370            Nearly 24 hours [518392 D = 23:59:58:4]      08081
bgkey  oct -53                Dollar sign                                  08082
bgtim  alf TIM                Time check constant                          08083
cbugas bss 1                                                               08084
cbugbs bss 1                                                               08085
cbugbc bss 1                                                               08086
                                                                           08087
                                                                           08088
                                                                           08089
       org t                  Temporary storage                            08090
dumpio bss 2                  Flip-flop for print areas                    08091
dumpbg bss 1                  Block currently being typed (must be even)   08092
dumped bss 1                  End of print block (must be in order)        08093
dmpmsk bss 1                  oct 3777774 - these must be in order and     08094
dmpbbz bss 1                  the above must be even                       08095
dumpx  bss 1                  Index register 3 temporary save              08096
dumpx1 bss 1                  Dump entry save                              08097
sloc   bss 1                  Location counter for octal insert            08098
ch2    bss 1                  Character storage - they must be in order    08099
ch2    bss 1                                                               08100
com1   bss 1                                                               08101
col1   bss 1                                                               08102
dtmp   bss 1                                                               08103
       tcd lovwrt                                                          08104
                                                                           08105
       stl                    Lister for GAP tapes                         08106
       ejt                                                                 08107
                        This routine will list a GAP assembly tape         08108
                        [from handler] 3 provided it is written in         08109
                        binary print-line images.                          08110
                        It will also punch the corresponding binary        08111
                        deck.                                              08112
                                                                           08113
                           1)  EJT cards will cause a slew but will        08114
                               not be printed                              08115
                           2)  NAM cards will change the title as          08116
                               in regular GAP assemblies                   08117
                           3)  REM cards will be printed with the op       08118
                               code delted and the remarks field           08119
                               shifted over two words.                     08120
                                                                           08121
                                                                           08122
       org pernum                                                          08123
       dec 22                                                              08124
       dec G/P                                                             08125
                                                                           08126
                                                                           08127
       org execov                                                          08128
       lda 8K                 Initialize to rewind tape 3                  08129
       sta gpoin                                                           08130
       dld .gst.   3          and set up branch in list                    08131
       spb insert  2                                                       08132
       sta ovtsk              Save where                                   08133
       sta z1                 and save exit register                       08134
ginit  dld gareas  3          Initialize buffer areas                      08135
       dst gin                                                             08136
       dst io1                Reset start load area                        08137
       ldz                    Set page flag for first time                 08138
       sta gejtf                                                           08139
       lda dumpbl             Clear out title line                         08140
       lqa                                                                 08141
       dst gtl     3                                                       08142
       inx 2       3                                                       08143
       bxl 40      3                                                       08144
       bru *-3                                                             08145
       lda mask6              oct 3000000                                  08146
       sta gtl-1   3          and set page count to zero                   08147
       ldx 8K      3          and restore register                         08148
                                                                           08149
                        This is the common entrance point                  08150
                                                                           08151
gst    bcs btn     1          Check on tape                                08152
       bru 2       1                                                       08153
       bcs bpn     6          and printer                                  08154
       bru 2       1                                                       08155
       bcs bef     1          Ignore end-of-files                          08156
       bru gread0             Get select instruction                       08157
       lda swflg              Check if billing on                          08158
       bod                    is on if odd                                 08159
       bru 2       1                                                       08160
       rcs                    or switch 0 down                             08161
       bmi                                                                 08162
       bru 2       1                                                       08163
       ldx gpoin   2          Get routine pointer                          08164
       bru *+1     2                                                       08165
       bru grwd               [0] Rewind                                   08166
       bru gprm               [1] Prime buffers                            08167
       bru gslt               [2] Slew to top of page                      08168
       bru gslw               [3]                                          08169
       bru gp0                [4] Pass 0                                   08170
       bru gp1                [5] Pass 1                                   08171
       bru gp2                [6] Pass 2                                   08172
       bru gjt                [7] Eject                                    08173
       bru gpun               [8] Punch card                               08174
       bru gcon               [9] and search for next assembly             08175
.gprm. equ one                                                             08176
.gslt. equ two                                                             08177
.gslw. equ three                                                           08178
.gp0.  equ four                                                            08179
.gp1.  equ five                                                            08180
.gp2.  equ six                                                             08181
.gjt.  equ seven                                                           08182
.gpun. dec 8                  These must be indexed                        08183
                                                                           08184
                                                                           08185
                                                                           08186
grwd   sel 1                  Rewind tape 3                                08187
       rwd         3                                                       08188
       lda cmessb             Check batch flag                             08189
       bze                    if not on, continue                          08190
       spb mesg    2          Acknowledge                                  08191
       dec pcr                                                             08192
       spb gslt8   2          and slew to top of page                      08193
       lda .gprm.                                                          08194
       sto gpoin                                                           08195
       bru 2       1                                                       08196
                                                                           08197
                                                                           08198
gprm   bcs brw     1          Wait for rewind                              08199
       bru 2       1                                                       08200
       bpn                    and punch                                    08201
       bru 2       1                                                       08202
       sel 1                                                               08203
       rtb io1     3                                                       08204
           40                                                              08205
       dld io1                Scan for GAP Pass 0 message                  08206
       dcb ggap    3                                                       08207
       bru 2       1          Exit if not                                  08208
       bru *+2                yes                                          08209
       bru 2       1          no, so exit                                  08210
       lda .gp0.              Set for pass 0                               08211
       sto gpoin                                                           08212
       spb gslew   2          Slew two lines                               08213
       spb gslew   2          Slew total of 6 lines first time             08214
       spb gslew   2                                                       08215
       bru 2       1                                                       08216
                                                                           08217
                                                                           08218
gslt8  lda gpoin              Save pointer                                 08219
       sta gpsav                                                           08220
       stx gpsav+1 2                                                       08221
       lda .gslt.                                                          08222
       sto gpoin                                                           08223
       bcs bpn     6          Wait for printer                             08224
       bru gex                and crump if not ready                       08225
gslt   sel 6                  Slew to top                                  08226
       slt 8                                                               08227
       ldx gpsav+1 2          Restore registers                            08228
       lda gpsav                                                           08229
       sta gpoin                                                           08230
       ldz                                                                 08231
       sta gline                                                           08232
       bru 2       1          and return                                   08233
                                                                           08234
                                                                           08235
gslew  lda gpoin              Save pointers                                08236
       sta gpsav                                                           08237
       stx gpsav+1 2                                                       08238
       lda .gslw.             and set for slew two lines                   08239
       sto gpoin                                                           08240
       bcs bpn     6          Wait for printer                             08241
       bru gex                                                             08242
gslw   sel 6                                                               08243
       slw 2                                                               08244
       ldx gpsav+1 2          Restore registers                            08245
       lda gpsav                                                           08246
       sta gpoin                                                           08247
       bru 2       1          and return                                   08248
                                                                           08249
                                                                           08250
gp)    dld gin                Pass 0 - get buffer addresses                08251
       sta z2                                                              08252
       sto gprnt1  3                                                       08253
       xaq                                                                 08254
       dst gin                                                             08255
       sto gread   3                                                       08256
       lda mblnk              Preset end of line                           08257
       sta 24      2                                                       08258
       lda 0       2          and check for end of pass 0                  08259
       sub gend1   3                                                       08260
       bnz                                                                 08261
       bru gprnt              no                                           08262
       dld 2       2          Check rest of field                          08263
       dcb gpass   3                                                       08264
       bru gprnt              no                                           08265
       bru *+2                yup                                          08266
       bru gprnt                                                           08267
       lda d54     3                                                       08268
       sta gline              and set line so it will slew next time       08269
       lda .gp1.              and set for Pass 1                           08270
       sto gpoin                                                           08271
       bru gprnt                                                           08272
                                                                           08273
                                                                           08274
gp1    dld gin                Get last used address                        08275
       sta z2                 and put in register                          08276
       xaq                    flip                                         08277
       dst gin                re-save                                      08278
       sto gread   3                                                       08279
       lda sign               Set negative bit beforehand                  08280
       ory 23      2          Do not print sequence numbers                08281
       lda 0       2          Check for end pass 1                         08282
       sub gend1   3                                                       08283
       bze                                                                 08284
       spb gp1chk  1          Check it out                                 08285
       lda 2       2                                                       08286
       ext gzone   3          Check for zone bits                          08287
       bze                                                                 08288
       bru *+4                                                             08289
gp1b   lda z2                 Get read-in address                          08290
       sto gprnt1  3                                                       08291
       bru gprnt              and print - no unpacking                     08292
       lda gin+1              Get address                                  08293
       add d30                and increment for expanded symbol table      08294
       sto gprnt1  3          and set up for instruction                   08295
       sta z1                 and register 1                               08296
       add d36     3                                                       08297
       neg                    Construct end-of-line                        08298
       sto gpck2   3          End of line test                             08299
                                                                           08300
gpack  dld 0       2          Get symbol                                   08301
       dst 0       1          and put away in expanded line                08302
       dld gibn    3          Get special blanks                           08303
       sta 2       1          put away first part                          08304
       lda 2       2          Get address of symbol                        08305
       sta 3       1          put away msh                                 08306
       lda 3       2          Get lsh                                      08307
       dst 4       1          and put away with trailing blank             08308
       inx 6       1                                                       08309
       inx 4       2                                                       08310
gpck2  bxl *       1          Test end-of-line                             08311
       bxl gpack                                                           08312
       bru gprnt              and print the stupid line                    08313
                                                                           08314
gp1chk dld 2       2          Check rest of field                          08315
       dcb gpass   3                                                       08316
       bru 1       1          No                                           08317
       bru *+2                                                             08318
       bru 1       1                                                       08319
       lda d54     3          Yes, pre-set for slew                        08320
       sta gline                                                           08321
       lda .gp2.              Set for pass 2                               08322
       sto gpoin                                                           08323
       dld gin                Modify addresses to leave for punch          08324
       sto gidnt1  3                                                       08325
       sto temp                                                            08326
       dad go100   3                                                       08327
       dst gin                                                             08328
       sto gread   3                                                       08329
       ldx zero    1          Set up for identifying card punch            08330
       dld gident  3                                                       08331
gidnt1 dst 0       1          Set in spare buffer                          08332
       inx 2       1          Count                                        08333
       bxl 26      1          and check for buffer filled                  08334
       bru gidnt1             Still more                                   08335
       ldx temp    1          Get address                                  08336
       wcd 0       1          and punch card                               08337
       bru gp1b               and get back                                 08338
                                                                           08339
                                                                           08340
                                                                           08341
gp2    ldx gin     2          Get area last read into                      08342
       lda 40      2          and check residue word                       08343
       bze                                                                 08344
       bru gpunch                                                          08345
       bpl                    If greater than 40 words, ignore             08346
       bru gread0                                                          08347
       lda sign                                                            08348
       ory 33      2          Set minus sign in word                       08349
       dld gin                                                             08350
       sto gprnt1  3          and print instruction                        08351
       xaq                    Flip                                         08352
       dst gin                and save                                     08353
       sto gread   3          and set in tape instruction                  08354
       lda 0       2          Get first word and check for ENDGAPPASSES    08355
       sub gend1   3                                                       08356
       bze                                                                 08357
       spb gp2chk  1          Check out rest of field                      08358
       lda 10      2          Now get op code - damn fool odd word         08359
       srd 18                                                              08360
       lda 9       2                                                       08361
       ext gmask   3          This is the odd word                         08362
       sld 6                  Now get the whole op code                    08363
       cab gejt1   3          and check for EJT                            08364
       bru gprnt              no                                           08365
       bru gejt                                                            08366
       cab gnam1   3          [Check for NAM]                              08367
       bru gprnt                                                           08368
       bru gnam                                                            08369
       cab grem1   3          REM                                          08370
       bru gprnt                                                           08371
       bru grem                                                            08372
                                                                           08373
                                                                           08374
gprnt  sel 6                  Print the line                               08375
       z26 --                                                              08376
gprnt1 add --                                                              08377
       lda gline              and now check for end of page                08378
       ado                                                                 08379
       sta gline                                                           08380
       sub d54     3                                                       08381
       bpl                                                                 08382
       bru gejt               Yes, eject and print title if called for     08383
                                                                           08384
                                                                           08385
gread0 sel 1                  Tape read                                    08386
gread  rtb io1     3                                                       08387
           40                                                              08388
gex    ldx ovtsk   1          Get entry point                              08389
       bru 2       1          and get out                                  08390
                                                                           08391
                                                                           08392
gejt   lda gline              Check if just slewed to top of line          08393
       bze                    If so,                                       08394
       bru gread0             ignore ejt card                              08395
       spb glst8   2          Else slew to top of page                     08396
       spb gslew   2          and slew two lines                           08397
       lda gpoin              Then check for pass 2                        08398
       ext 8K                                                              08399
       sub .gp2.                                                           08400
       bnz                                                                 08401
       bru gejt2              no                                           08402
       lda .gjt.              Set for heading line                         08403
       sto gpoin                                                           08404
       bcs bpn     6          Check out printer                            08405
       bru gex                and wait if not                              08406
gjt    sel 6                  Print heading line                           08407
       z26 --                                                              08408
       z03 gtl     1                                                       08409
       lda gtl+39  3          Page number                                  08410
       set decmode            and step                                     08411
       add gejtf              with flag                                    08412
       set binmode                                                         08413
       sta gtl+39  3          and restore                                  08414
       ldo                    and set flag for subsequent times            08415
       sta gejtf                                                           08416
       lda .gp2.              and restore pointer                          08417
       sto gpoin                                                           08418
       bru gread0                                                          08419
gejt2  spb gslew   2          Slew two lines at top                        08420
       bru gread0                                                          08421
                                                                           08422
                                                                           08423
gnam   lda gin+1              Last area read into                          08424
       add d17     3          and get remarks field - we hope              08425
       add smove1             and construct move instruction               08426
       sta *+2     3                                                       08427
       dld gnam2   3                                                       08428
       mov --                                                              08429
                                                                           08430
                                                                           08431
grem   dld grem2   3          Get constant                                 08432
       lda gin+1              Then buffer address                          08433
       add d11     3          and step to remarks field                    08434
       add smove1             Construct move                               08435
       sta *+2     3                                                       08436
       sub two                and move remarks field over two left         08437
       mov --                 on page                                      08438
       lda dumpbl             Blank out end of line                        08439
       lqa                                                                 08440
       dst 30      2          blank end-of-field                           08441
       sta 9       2                                                       08442
       sta 10      2          This should get rid of damned remark         08443
       bru gprnt                                                           08444
                                                                           08445
                                                                           08446
gpunch lda .gpun.  3          Punch binary card                            08447
       sto gpoin                                                           08448
gpun   bpn                    Check out punch                              08449
       bru gex                                                             08450
       dld gpmov   3          Get Q portion for move                       08451
       lda gin                Area last read into                          08452
       add smove1             and construct instruction                    08453
       sta *+3     3                                                       08454
       sub o100               and set down to multiple of 128              08455
       sta z2                                                              08456
       mov --                                                              08457
       wcb 0       2                                                       08458
       lda .gp2.              Return to pass 2                             08459
       sto gpoin                                                           08460
       bru gread0                                                          08461
                                                                           08462
                                                                           08463
gp2chk lda 1       2          Check rest of field if end                   08464
       sub gend1+1 3                                                       08465
       bnz                                                                 08466
       bru 1       1                                                       08467
       dld 2       2                                                       08468
       dcb gend2   3          Check for PASSES                             08469
       bru 1       1          no                                           08470
       bru *+2                                                             08471
       bru 1       1                                                       08472
       spb gslt8   2          Slew page                                    08473
       spb gslt8   2          Again                                        08474
       dld gin                Set addresses back as originally             08475
       dsu go100   3                                                       08476
       dst gin                                                             08477
       ldx ovtsk   1          Get entry point                              08478
       lda .gcon.  3          and set up for continuation                  08479
       sta 0       1                                                       08480
       lac                    and set timer in case tape runs away         08481
       add six                                                             08482
       sta gpsav                                                           08483
                                                                           08484
                                                                           08485
gcon   bpn                    Wait for punch so as not to wipe out last    08486
       bru gex                transfer card                                08487
       lda swflg              Check billing flag                           08488
       bod                    if odd, then billing on                      08489
       bru 2       1          billing on...                                08490
       rcs                    and then check switch 0                      08491
       bmi                                                                 08492
       bru 2       1          If down, crump                               08493
       bcs btn     1          Else check tape                              08494
       bru gtchk              if not ready, go check                       08495
       lda gline              and search six entries from tape             08496
       ado                                                                 08497
       sta gline                                                           08498
       sub ten                                                             08499
       bpl                                                                 08500
       bru gendp              The P is for permanent                       08501
       lac                    Step timer if OK                             08502
       add six                                                             08503
       sta gpsav                                                           08504
       dld gin                Get addresses                                08505
       sto gread   3          and do it backwards                          08506
       xaq                                                                 08507
       sta z2                                                              08508
       dst gin                                                             08509
       dld 0       2                                                       08510
       dcb ggap    3          Check for GAP 0                              08511
       bru gread0                                                          08512
       bru *+2                                                             08513
       bru gread0                                                          08514
       lda .gst.   3          Get original entry                           08515
       sta 0       1          and set up                                   08516
       lda .gprm.             Set for buffer printing                      08517
       sto gpoin                                                           08518
       ldx zero    2          Set up for end identifier                    08519
       dld gident  3                                                       08520
       dst io2     2                                                       08521
       inx 2       2          Count                                        08522
       bxl 26      2          and check                                    08523
       bru *-3                                                             08524
       wcd io2                                                             08525
       sel 1                  Now read tape backwards                      08526
       rbb io1     3                                                       08527
           0                                                               08528
       bru ginit              and set for new listing                      08529
                                                                           08530
                                                                           08531
                                                                           08532
gtchk  lac                    Check if time up                             08533
       sub gpsav                                                           08534
       bmi                    No, then keep on                             08535
       bru 2       1                                                       08536
       lda .gst.   3          Get original entry and prepare to hang       08537
       sta 0       1          tape completely as it is running awat        08538
                                                                           08539
gendp  sel 1                                                               08540
       rwd         3                                                       08541
       ldx zero    2          Set up for end identifier                    08542
       dld gident  3          Set up for last card                         08543
       dst io2     2                                                       08544
       inx 2       2          Count                                        08545
       bxl 26      2          and check                                    08546
       bru *-3                                                             08547
       wcd io2                                                             08548
       spb gslt8   2                                                       08549
       lda cmessb             Check batch flag                             08550
       bze                                                                 08551
       bru iredy              normal crump if off                          08552
       ldx ovtsk   1          Else recall monitor                          08553
       spb irase   2                                                       08554
       ldz                    Reset pointer                                08555
       sta ovtsk                                                           08556
       sta z2                                                              08557
       inx batch   2          Get monitor                                  08558
       lmo                                                                 08559
       sta io1                Set front card in                            08560
       bru pgetb                                                           08561
                                                                           08562
                                                                           08563
gtl    bss 40                 Title line                                   08564
gnam2  dec gtl                Move constant                                08565
       dec -15                                                             08566
.gst.  spb gst     1                                                       08567
.gcon. spb gcon    1                                                       08568
gareas dec io1                                                             08569
       dec io2                                                             08570
gend1  alf END                                                             08571
       alf GAP                                                             08572
gend2  alf PAS                                                             08573
       alf SES                                                             08574
gpass  alf  PA                                                             08575
       alf SS                                                              08576
gibn   oct 603535             Fudge blanks                                 08577
       alf                                                                 08578
ggap   alf GAP                Starting checker                             08579
       alf  0                                                              08580
gpmov  dec 0                                                               08581
       dec -40                Forty words to a binary card                 08582
go100  oct 100                Buffer-areas-adjust constant                 08583
       oct 100                                                             08584
gident alf ABC                                                             08585
       alf DEF                                                             08586
grem2  oct 0                                                               08587
       dec -21                                                             08588
                                                                           08589
gejt1  alf EJT                                                             08590
gnam1  alf NAM                                                             08591
grem1  alf REM                                                             08592
d11    dec 11                                                              08593
d17    dec 17                                                              08594
d30    dec 30                                                              08595
d36    dec 36                                                              08596
d54    dec 54                                                              08597
gmask  oct 3770000                                                         08598
gzone  oct 3171717                                                         08599
                                                                           08600
                                                                           08601
                                                                           08602
       org t                  Temporary storage                            08603
gin    bss 2                                                               08604
gpoin  bss 1                                                               08605
gpsav  bss 2                                                               08606
gline  bss 1                                                               08607
gejtf  bss 1                  Page count flag                              08608
       tcd lovwrt             End                                          08609
                                                                           08610
       stl                    Sysout lister                                08611
       ejt                                                                 08612
                        SYSOUT lister                                      08613
                                                                           08614
                        The sysoute lister will process tapes written      08615
                        by batch or any tapes in the same format.          08616
                                                                           08617
                        It can be called directly from the batch           08618
                        ovrlay or from the console typewriter.             08619
                        If it is called from BAT it checks to see          08620
                        which tape was written on last, and waits          08621
                        until the proper tape is on handler seven.         08622
                        If called by the typewriter it assumes the         08623
                        tape is already on seven.                          08624
                        It automatically flip-flops between handlers       08625
                        6 and 7.                                           08626
                                                                           08627
                        The tape format is two control words followed      08628
                        by the data.  Each has either the word count       08629
                        or zero in word two (almost).  All numbers         08630
                        are octal.                                         08631
                                                                           08632
                        Start output file  0 in both words                 08633
                        Print              1 in the low-order end of       08634
                                           word one, the high order        08635
                                           high order bits of control      08636
                                           word one.  Word two has the     08637
                                           length in the low-order         08638
                                           end and the high-order          08639
                                           is the same as the high         08640
                                           order part of controller        08641
                                           word two.                       08642
                        Set format         2 in word one.  This record     08643
                                           contains the horizontal         08644
                                           format information to be        08645
                                           used in all subsequent          08646
                                           print with format records.      08647
                                           Word count in two.              08648
                        Punch decimal      7 in word one, count in two     08649
                        Punch binary       10 in one, count in two         08650
                        Punch full         11 in one, count in two         08651
                        End of output file 20 in one, 0 in two             08652
                                                                           08653
                                                                           08654
                        An EOF indicates the end                           08655
                                                                           08656
                        Buffers used                                       08657
                           sio1   600    80 words - punch                  08658
                           sio2   720    40 words - print                  08659
                           sio3   770    40 words - format line            08660
                           sio4  1040   110 words - tape read-in           08661
                           sio5  1217   110 words - tape read-in           08662
                                                                           08663
                        Flags and things                                   08664
                        slbufp  Buffer flip-flop           upper           08665
                        sllen   Words left in each buffer  lower           08666
                        sllen2  Words used in first buffer lower           08667
                        slcon   Control words              upper           08668
                        slbuff  Buffer to use              upper           08669
                                                                           08670
                        The tape subroutine was put on the end at          08671
                        load time.                                         08672
                                                                           08673
       org pernum                                                          08674
       dec 24                                                              08675
       dec S/O                                                             08676
                                                                           08677
       org execov                                                          08678
                                                                           08679
       dld .sle2.  3                                                       08680
       spb insert  2          Put in task list                             08681
       sta ovtsk              Save place in list                           08682
       spb messg   2          Acknowledge receipt                          08683
       dec pcr                 with carriage return                        08684
       spb treqb   2          Now rewind 7                                 08685
       sel 1                                                               08686
       rwd         7                                                       08687
       oct 0                  [Completion] flag                            08688
       spb slext   2          Set up exit                                  08689
       lda *-2     3                                                       08690
       bze                                                                 08691
       bru 2       1          Not ready                                    08692
       bcs brw     1          Now see if done rewinding                    08693
       bru 2       1          No                                           08694
       bcs bpn     6                                                       08695
       bru 2       1                                                       08696
       sel 6                  Start with a slew                            08697
       slt 8                                                               08698
                        Prime both buffers - sio4 and sio5                 08699
       spb slrnr   2          Read                                         08700
       spb slrnc   2          Wait and compute length                      08701
       spb slrnr   2          Get next one                                 08702
sllst2 lda slbufp  3          Find beginning of output                     08703
       sta z2                 Get buffer address                           08704
       dld 0       2          See if start                                 08705
       dcb zero                                                            08706
       bru *+2                Nope                                         08707
       bru sllst3             OK                                           08708
       spb slrnc   2          Wait for last read                           08709
       spb slrnr   2          Get next record                              08710
       bru sllst2             and check again                              08711
sllst3 sta sllen2             Initialize                                   08712
       bru slgp               and start                                    08713
                                                                           08714
                        Subroutine to get next record.  Entered on 2.      08715
                        Will check the buffer flip-flop read into the      08716
                        first and exchange them.                           08717
                                                                           08718
slrnr  stx slt1    2          Save entrance                                08719
       dld slbufp  3          Buffer pointers                              08720
       sto slrnr1  3          Set for read                                 08721
       xaq                                                                 08722
       dst slbufp  3          and exchange                                 08723
       spb treqb   2          Tape routine                                 08724
       sel 1                                                               08725
slrnr1 rtb sio5    7                                                       08726
           110                                                             08727
slrnrf oct 0                  flag                                         08728
       dld sllen              Length                                       08729
       xaq                    switch also                                  08730
       dst sllen                                                           08731
       ldx slt1    2          Get return back                              08732
       bru 1       2                                                       08733
                                                                           08734
                        Will compute length of record just read by         08735
                        SLRNR and store in length list.  Maximum           08736
                        record length is 110 words.                        08737
                        Exits with length in A                             08738
                                                                           08739
slrnc  stx slt1    2          Save entrance                                08740
       spb slfxt   2          Set up exit                                  08741
       lda slrnrf  3          Check flag                                   08742
       bze                                                                 08743
       bru 2       1          Not ready                                    08744
                        If EOF found, then end of sysout tape              08745
       sra 2                  Check flag for EOF                           08746
       bod                                                                 08747
       bru slend              Finished                                     08748
       lda slrnr1  3                                                       08749
       ext mask10             3700000                                      08750
       sta z1                 Address read into                            08751
       lda 110     1          Get residue word                             08752
       bpl                    Make sure record is not too long             08753
       bze                                                                 08754
       bru slrnc1             OK                                           08755
       ldz                    Bad                                          08756
       bru *+2                                                             08757
slrnc1 add sd110   3          Now have length                              08758
       sta sllen+1            and save                                     08759
       ldx slt1    2          Get return                                   08760
       bru 1       2          and get back                                 08761
                                                                           08762
                        Pull out the parameter words and make an           08763
                        initial check on them.                             08764
                                                                           08765
slgp   bss 0                                                               08766
       lda slrf    3          See if another buffer needed                 08767
       bpl                                                                 08768
       bru slgp1              No                                           08769
       lda sllen              yes, so fudge length back                    08770
       sta sllen+1                                                         08771
       dld slbufp  3          Flip buffers back                            08772
       xaq                                                                 08773
       dst slbufp  3                                                       08774
       spb slrnr   2          get buffer                                   08775
       sta slbf    3          Reset read flag - return is positive         08776
slgp1  lda sllen              and change length pointers                   08777
       bnz                                                                 08778
       bru slgp2                                                           08779
       sta sllen2                                                          08780
       spb slrnc   2          Check last read done                         08781
       spb slrnr   2          and get more                                 08782
       bze                                                                 08783
       bru *-3                I can go in circles too.                     08784
slgp2  sub two                                                             08785
       sta sllen                                                           08786
       lda sllen2             Words used                                   08787
       sta z2                                                              08788
       add two                                                             08789
       sta sllen2                                                          08790
       lda slbufp  3          Buffer pointer                               08791
       sto slgp3   3          set up loads                                 08792
       ado                                                                 08793
       sto *+1     3                                                       08794
       lda *       2          Modified to come from right buffer           08795
       sta slcon+1 3          Save control words                           08796
slgp3  lda *       2                                                       08797
       sta slcon   3                                                       08798
       ext mask7              Just save low order - 3777700                08799
       sta z2                                                              08800
       bxl 3       2          Make first check on control words            08801
       bru slo2               Set up buffer 2 - print                      08802
       bxl 10      2                                                       08803
       bru slo1               Set up buffer 1 - punch                      08804
       bxl 17      2                                                       08805
       bru slcon1             Control record                               08806
       bru slill              Illegal control word                         08807
                                                                           08808
slo1   lda sdio1   3          dec sio1                                     08809
       sta slbuff             Buffer to move to                            08810
       ldz                                                                 08811
       sta slmin              Set for punch                                08812
       bru slmov              yes, move in                                 08813
                                                                           08814
slo2   lda sdio2   3          dec sio2                                     08815
       sta slbuff             Buffer to move to                            08816
       lda so611   3                                                       08817
       sta slmin              Set up for print                             08818
                        Ready, so move                                     08819
                                                                           08820
                        If enough words remain in input buffer, move       08821
                        directly to output buffer.  If not, fudge like     08822
                        mad.                                               08823
                                                                           08824
slmov  lda slcon+1 3          Second control word                          08825
       ext slms1   3          3777600                                      08826
       sta slt2               Save for a while                             08827
       cab sllen              Words left                                   08828
       bru slmov1             OK                                           08829
       bru slmov1             Still OK                                     08830
       bru slmv               Partial move and re-read                     08831
slmov1 neg                    Set up move command                          08832
       xaq                                                                 08833
       lda slbufp  3          Get buffer address                           08834
       add sllen2             get from address                             08835
       sto slmg2   3          Set up move instruction                      08836
       lda slbuff             Address to move to                           08837
       dst slmc1+2 3          and constant                                 08838
       lda sllen              Words left                                   08839
       sub slt2               get new total                                08840
       sta sllen              and save                                     08841
       lda sllen2             Get new total of words used                  08842
       add slt2                                                            08843
       sta sllen2                                                          08844
       spb slext   2          Get out                                      08845
       ldx slmin   2          Either printer or punch                      08846
       oct 2556007            Either printer or punch                      08847
       bru 2       1                                                       08848
slmg   dld slmc1   3          Get to address and length                    08849
slmg1  mov 1                  Filled in                                    08850
       dlc slmc1+2 3          Second move                                  08851
slmg2  mov 1                  Filled in                                    08852
       sta slmc1+1 3          Reset move constant                          08853
       bru slexe              and execute                                  08854
                        Not enough words left in present buffer            08855
                                                                           08856
slmv   sub sllen              Get left-over words                          08857
       sta slt2               Temp location                                08858
       lda sllen              Get words to move                            08859
       neg                                                                 08860
       xaq                                                                 08861
       lda slbufp  3          Buffer address                               08862
       add sllen2             make from address                            08863
       sto slmg1   3          Set up move instruction                      08864
       lda slbuff             Move to                                      08865
       dst slmc1   3          move constant                                08866
                        Compute next move-to address                       08867
       add sllen                                                           08868
       sta slbuff                                                          08869
       spb slpnc   2          Get length info on last read                 08870
       sta sllen              Length left in A after calculation           08871
       dld slbufp  3          Flip buffers manually                        08872
       xaq                                                                 08873
       dst slbufp  3                                                       08874
       lmo                                                                 08875
       sta slrf    3          Set read flag for slgp                       08876
       ldz                                                                 08877
       sta sllen2             Reset words used                             08878
       lda slt2               Get number of left over words                08879
       bru slmov1             and enter middle of move routine             08880
                                                                           08881
                        Will pick up instructions and execute them         08882
slexe  lda slcon   3          Get first control word                       08883
       ext mask7              get code 3777700                             08884
       add 8K                                                              08885
       sta z2                 Have upper memory branch                     08886
       bru *+1     2                                                       08887
       bru slsta              Start file                                   08888
       bru slpri              Print                                        08889
       bru slfor              Format line                                  08890
       bru slgp               Illegal next control word                    08891
       bru slgp                                                            08892
       bru slgp                                                            08893
       bru slgp                                                            08894
       bru slpud              Punch decimal                                08895
       bru slpub              Binary                                       08896
       bru slpuf              Full                                         08897
                                                                           08898
                        Print routine                                      08899
slpri  lda slcon   3                                                       08900
       sta slprie+13          Get control words                            08901
       lda slcon+1 3                                                       08902
       sta slprie+23                                                       08903
       lda slforf             Format address, if any                       08904
       sto slprie+13          put in instruction                           08905
       lda sdio2   3          Buffer address                               08906
       sto slprie+23                                                       08907
slprie sel 6                                                               08908
       oct 0                  Filled in earlier                            08909
       oct 0                                                               08910
       bru slgp               and start again                              08911
                                                                           08912
                        Set up format line                                 08913
slfor  dld slform  3          Format move constant                         08914
       mov sio2               to format line                               08915
       lda sdio3   3                                                       08916
       sta slforf             Put in format address                        08917
       bru slgp               and continue                                 08918
                                                                           08919
slpud  wcd sio1               Punch decimal                                08920
       bru slgp                                                            08921
slpub  wcb sio1               Binary                                       08922
       bru slgp                                                            08923
slpuf  wcf sio1               Full                                         08924
       bru slgp                                                            08925
                        Illegal control code so compute where to find      08926
                        next useful record                                 08927
slill  lda slcon+1 3          Get length                                   08928
       ext slms1   3          3777600                                      08929
       cab sllen                                                           08930
       bru slill2             Can stay in same record                      08931
       bru slill2                                                          08932
       sub sllen              Get words left over                          08933
       sta slt2                                                            08934
       spb slrnc   2          Wait                                         08935
       spb slrnr   2          Get next one                                 08936
       lda sllen              Get new length                               08937
       sub slt2                                                            08938
       sta sllen                                                           08939
       lda slt2                                                            08940
       sta sllen2             Words used                                   08941
       bru slgp               Start again                                  08942
slill2 bss 0                  Stay in same buffer                          08943
       lqa                                                                 08944
       add sllen2             Get new words used                           08945
       sta sllen2                                                          08946
       xaq                    Get A back                                   08947
       sub sllen                                                           08948
       neg                    Now have words left again                    08949
       sta sllen                                                           08950
       bru slgp               and continue                                 08951
                                                                           08952
                        Start output file - 27-word image of name card     08953
                                                                           08954
slsta  lda slbufp  3          Buffer address                               08955
       add two                                                             08956
       sto *+2     3          Set up move                                  08957
       dld slsta1  3          Get card image to punch area                 08958
       mov --                 Filled in                                    08959
       lda sign                                                            08960
       ory sio1+26                                                         08961
       spb slext   2          Prepare to exit                              08962
       bcs bpr     6          Test both printer                            08963
       bpn                    and punch                                    08964
       bru 2       1          Get out                                      08965
       sel 6                                                               08966
       wpl sio1               Name line                                    08967
       ldz                                                                 08968
       sta sllen                                                           08969
       bru slpud              Punch card and continue                      08970
                                                                           08971
slsta1 dec sio1                                                            08972
       dec -27                                                             08973
                                                                           08974
                                                                           08975
                        Examine control records - these are by them-       08976
                        selves.                                            08977
slcon1 bxl 16      2          Check to see if legal                        08978
       bru slill              Yes                                          08979
                        End of output file                                 08980
       spb sslt8   2          Slew to top of page                          08981
       spb slext   2                                                       08982
       bpn                                                                 08983
       bru 2       1                                                       08984
       ldx zero    2                                                       08985
       dld sliden  3          Pretty last card                             08986
       dst sio1    2                                                       08987
       inx 2       2                                                       08988
       bxl 26      2                                                       08989
       bru *-3                                                             08990
       wcd sio1                                                            08991
       bru sllst2             and look for zeros                           08992
                                                                           08993
                                                                           08994
slend  spb treqb   2          Tape routine                                 08995
       sel                                                                 08996
       rwd         7          Rewind 7                                     08997
       oct 1                  Set to done                                  08998
       spb tclos   2          Close out tape routine                       08999
       spb sslt8   2          Slew to top of page                          09000
       bru iredy              and all done                                 09001
                                                                           09002
sliden alf ABC                                                             09003
       alf DEF                                                             09004
                                                                           09005
                        Normal entrance is here                            09006
sle2   ldz                                                                 09007
       rcs                                                                 09008
       bmi                    punt if zero is down                         09009
       bru 2       1                                                       09010
       ldx slpoi2  2          Set up re-entrance                           09011
       bru 1       2          and go there                                 09012
                                                                           09013
                        Slew to top of page                                09014
sslt8  stx slt1    2          Save entrance                                09015
       spb slext   2                                                       09016
       bcs bpn     6                                                       09017
       bru 2       1                                                       09018
       sel 6                                                               09019
       slt 8                                                               09020
       ldx slt1    2          Get back                                     09021
       bru 1       2                                                       09022
                                                                           09023
                        Enter on 2 - sets up exits                         09024
slext  stx slpoi2  2                                                       09025
       ldx ovtsk   1                                                       09026
       bru 1       2          and get back                                 09027
                                                                           09028
slrf   dec 0                  Read flag - minus if read necessary aftr move09029
                                                                           09030
.sle2. spb sle2    1                                                       09031
slms1  oct 3777600                                                         09032
sd110  dec 110                                                             09033
slbufp dec sio4               Flip-flop buffer addresses                   09034
       dec sio5                                                            09035
sdio1  dec sio1                                                            09036
sdio2  dec sio2                                                            09037
sdio3  dec sio3                                                            09038
slform dec sio3               Format-move constant                         09039
       dec -40                                                             09040
slmc1  dec 1                  Move constants                               09041
       dec 0                                                               09042
       ddc 0                                                               09043
slcon  ddc 0                  Control word storage                         09044
so611  oct 611                used to change punch to printer              09045
                                                                           09046
                                                                           09047
       org ta                 Storage for lister after tape subroutines    09048
                                                                           09049
sllen  bss 2                  Words left                                   09050
sllen2 bss 1                  Words used                                   09051
slt1   bss 1                  Temp storage                                 09052
slt2   bss 1                  Temp storage                                 09053
slforf bss 1                  Format line address or zero                  09054
slpoi2 bss 1                                                               09055
slbuff bss 1                  Buffer to use                                09056
slmin  bss 1                  Used to index bpn                            09057
                                                                           09058
       loc 6000                                                            09059
slfix  bss 0                  Get tape subroutine on end                   09060
       lda tap+2              Disk address of subroutine                   09061
       sta *+5                                                             09062
       bcs brn     0                                                       09063
       bru *-1                                                             09064
slfir  sel 0                                                               09065
       prf         0                                                       09066
       oct 0                                                               09067
       bcs brn     0                                                       09068
       bru *-1                                                             09069
       sel 0                                                               09070
       rrd         3                                                       09071
           treqst                                                          09072
       bcs brw     0                                                       09073
       bru *-1                                                             09074
       bcs ber     0          Check errors                                 09075
       bru slfir                                                           09076
                                                                           09077
       bru lovwrt             now go and load                              09078
                                                                           09079
       tcd slfix                                                           09080
                                                                           09081
       stl                    Time-Sharing Operations Summary              09082
       ejt                                                                 09083
                                                                           09084
                        This efficiency summary of time-sharing            09085
                        computes the following information                 09086
                        and writes it on the disk every ten                09087
                        minutes...                                         09088
                        1) Percentage of running time over total           09089
                           on-time.                                        09090
                        2) Percentage of swap time over on-time.           09091
                        3) Percentage idle time over total on-time.        09092
                        4) Percentage disk times other than swap over      09093
                           total on-time.                                  09094
                                                                           09095
                        The operation summary is called every ten          09096
                        minutes through the wait loop.  It keeps a         09097
                        summary for half-hour periods, then re-initia-     09098
                        lizes itself for the next half-hour period.        09099
                                                                           09100
       org pernum                                                          09101
       dex 26                                                              09102
       dec summry                                                          09103
                                                                           09104
       org execov                                                          09105
       dld .eff1.  3          New entry                                    09106
       spb insert  2                                                       09107
       sta z1                 and save return                              09108
       bru 2       1          and get out                                  09109
                                                                           09110
                                                                           09111
eff1   bss 0                                                               09112
       spb irase   2          Delete entry otherwise                       09113
       spb dskb    2          Pick up previous summary                     09114
       spb dskop   2                                                       09115
       z12 1                                                               09116
       dec fclock                                                          09117
       oct 402                                                             09118
       nop                    [Ignore error return?]                       09119
       spb relin2             and get rid of disk                          09120
       ldx zero    1          Else move summary into area                  09121
       lda fkedit  1                                                       09122
       sta f4      1                                                       09123
       inx 1       1          Step pointer                                 09124
       bxl fkbat-f31          Test for end                                 09125
       bru *-4                                                             09126
       lda fclock                                                          09127
       bze                                                                 09128
       bru fsumr              Need to reset everything                     09129
       lac                    Check time                                   09130
       sub fclock             Get elapsed time                             09131
       sta flapse             and check for                                09132
       bmi                                                                 09133
       bru fsumr              If past midnight, restart everything         09134
       lda fcnt               Check for over half hour                     09135
       ado                    step                                         09136
       sta fcnt               and store                                    09137
       bru fcrest             Now compute                                  09138
                                                                           09139
fsumr  ldz                    Re-initialize                                09140
       sta fclock                                                          09141
       dld fmid    3          Midnight                                     09142
       mov fclock                                                          09143
       sta acrun              Zero accumulated counters                    09144
       sta acswap                                                          09145
       sta acdisk                                                          09146
       sta acbat                                                           09147
       sta flapse             and zero out elapsed time                    09148
       sta z1                                                              09149
       lac                    Reset counters and pointers                  09150
       sta fclock                                                          09151
       sta acstrt             accumulated start                            09152
       spb time    2                                                       09153
       dst fstim                                                           09154
       dst astim+2                                                         09155
       lda F4      1                                                       09156
       sta fkedit  1                                                       09157
       inx 1       1          Step                                         09158
       bxl fkbat-f31          Test for end                                 09159
       bru *-4                                                             09160
                                                                           09161
                                                                           09162
fcrest bss 0                                                               09163
       spb time    2          Get time for output line                     09164
       dst ssump+2 3          set in line                                  09165
       lda fkstrt                                                          09166
       sta ftem               Temporary location                           09167
       spb pcent   2          Compute percentage running time              09168
       sta ssr     3          Run time                                     09169
       lda fkdump             Swap times                                   09170
       add fkntnu             Dump 6 and continue                          09171
       sta ftem+1                                                          09172
       spb pcent   2          Compute percentage of swap times             09173
       sta sss     3          Swap time                                    09174
       lda fkread             Read-ins                                     09175
       add fkwrit                                                          09176
       add fkedit             Edits as well                                09177
       add fktea              and teach, for want of a better place        09178
       sta ftem+2                                                          09179
       spb pcent   2          Compute percentage miscellaneous             09180
       sta ssm     3          Misc. time                                   09181
       lda fkbat              Get batch time                               09182
       sta ftem+3                                                          09183
       spb pcent   2          Compute percentage batch                     09184
       sta ssb     3          Batch time                                   09185
       lda flapse             Get elapsed time                             09186
       sub ftem               and try to ensure 100 percent                09187
       sub ftem+1                                                          09188
       sub ftem+2                                                          09189
       sub ftem+3                                                          09190
       bmi                                                                 09191
       ldz                    Make it look nice                            09192
       spb pcent   2          Get percentage idle time                     09193
       sta ssi     3          Idle time                                    09194
       dld .effe.  3          Efficiency intermediate entrance             09195
       spb insert  2                                                       09196
       sta ovtsk              Save location                                09197
       sta z1                 In case printer not working                  09198
       dld fstim              Get starting time                            09199
       dst ssump+103          Set in print line                            09200
fcre2  bcs bpn     6          [Allow printouts to be omitted]              09201
       bru fcre21             Just punt if not ready                       09202
       sel 6                                                               09203
       wpl ssump              Summary printout                             09204
       spb eexit   2                                                       09205
       bcs bpn     6                                                       09206
       bru 2       1          Wait again                                   09207
       sel 6                                                               09208
       slw 2                  Slew two lines                               09209
       spb eexit   2                                                       09210
       bcs bpn     6                                                       09211
       bru 2       1                                                       09212
       sel 6                                                               09213
       wpl ssump+6            Get short summary                            09214
       spb eexit   2                                                       09215
       bcs bpn     6                                                       09216
       bru 2       1                                                       09217
fcre21 lac                    Get accumulated times                        09218
       sub acstrt                                                          09219
       sta flapse                                                          09220
       lda ftem                                                            09221
       add acrun                                                           09222
       spb pcent   2                                                       09223
       sta ssr     3                                                       09224
       lda ftem+1                                                          09225
       add acswap                                                          09226
       spb pcent   2                                                       09227
       sta sss     3                                                       09228
       lda ftem+2                                                          09229
       add acdisk                                                          09230
       spb pcent   2                                                       09231
       sta ssm     3                                                       09232
       lda ftem+3                                                          09233
       add acbat                                                           09234
       spb pcent   2                                                       09235
       sta ssb     3                                                       09236
       lda flapse                                                          09237
       sub acrun                                                           09238
       sub acswap                                                          09239
       sub acdisk                                                          09240
       sub acbat                                                           09241
       sub ftem                                                            09242
       sub ftem+1                                                          09243
       sub ftem+2                                                          09244
       sub ftem+3                                                          09245
       bmi                                                                 09246
       ldz                    Make pretty                                  09247
       spb pcent   2                                                       09248
       sta ssi     3                                                       09249
fcre3  bcs bpn     6          [Allow printouts to be omitted]              09250
       bru fcre31             punt if not ready                            09251
       sel 6                  Know printer is ready                        09252
       slw 2                  Slew 2 lines                                 09253
       dld astim2             Set time for long run summary                09254
       dst ssump+103                                                       09255
       spb eexti   2                                                       09256
       bcs bpn     6                                                       09257
       bru 2       1                                                       09258
       sel 6                                                               09259
       wpl ssump+6            Write long run summary                       09260
       spb eexit   2                                                       09261
       bcs bpn     6                                                       09262
       bru 2       1                                                       09263
       sel 6                                                               09264
       slw 4                  Slew four lines                              09265
       spb irase   2          Get rid of task                              09266
                        See if necessary to reset summary                  09267
       lda fcnt               Check half-hours                             09268
       sub three                                                           09269
       bmi                                                                 09270
       bru fcre4              OK, so punt                                  09271
                        Time to restart so add to accumulated things       09272
       lda ftem                                                            09273
       add acrun                                                           09274
       sta acrun                                                           09275
       lda ftem+1                                                          09276
       add acswap                                                          09277
       sta acswap                                                          09278
       la  ftem+2                                                          09279
       add acdisk                                                          09280
       sta acdisk                                                          09281
       lda ftem+3                                                          09282
       add acbat                                                           09283
       sta acbat                                                           09284
       ldz                    Restart                                      09285
       sta fclock                                                          09286
       dld fmid    3                                                       09287
       mov fclock                                                          09288
       sta z1                                                              09289
       lac                                                                 09290
       sta fclock             Starting time                                09291
       spb time    2                                                       09292
       dst fstim                                                           09293
       lda f4      1                                                       09294
       sta fkedit  1                                                       09295
       inx 1       1                                                       09296
       bxl fkbat-f31          Check for end                                09297
       bru *-4                                                             09298
fcre4  spb dskb    2          and get disk                                 09299
       spb dskop   2          and write out summary                        09300
       z37 1                  Write, 1 record                              09301
       dec fclock             From summary area                            09302
       oct 402                Disk address                                 09303
       nop                    Should never return here, but punt if it does09304
       spb relin2             Relinquish disk                              09305
       lac                    and set interval for next time               09306
       add finc    3                                                       09307
       bmi                    Check for too large                          09308
       bru *+4                                                             09309
       cab fmid1   3          Check for midnight                           09310
       bru *+3                OK                                           09311
       bru *+1                                                             09312
       lda fmid1   3          Too close                                    09313
       sta .eff                                                            09314
       ldz                    Reset busy flag                              09315
       sta bzyf                                                            09316
       bru 2       1          and get out                                  09317
                                                                           09318
                                                                           09319
pcent  maq                    Compute percentage                           09320
       mpy fcent   3          Get one extra digit                          09321
       dvd flapse             and get percentage twice as large            09322
       ado                    Round upwards                                09323
       srd 20                 Get in Q less one bit                        09324
       dvd ten                Convert to decimal                           09325
       cab finc2   3          Check for funny case                         09326
       bru pcent1             OK                                           09327
       bru *+1                Yes                                          09328
       lda finc3   3          Get 100 percent                              09329
       bru 1       2          and get out                                  09330
pcent1 bze                    Check for leading zero                       09331
       lda o60                replace by zero if so                        09332
       sla 6                  Shift to middle                              09333
       add blzz               and get rid of high-order zero               09334
       sta mstemp+1           First character                              09335
       laq                    Remainder is second                          09336
       add mstemp+1           and total up                                 09337
       bru 1       2                                                       09338
                                                                           09339
                                                                           09340
effe   ldx epoi2   2          Get correct re-entrance                      09341
       bru 1       2          and go there                                 09342
                                                                           09343
eexit  stx epoi2   2          Temporary exit                               09344
       ldx ovtsk   1                                                       09345
       bru 1       2          and just go back                             09346
                                                                           09347
                        Print lines for printer summary                    09348
ssump  alf TIM                                                             09349
       alf E                                                               09350
       alf                                                                 09351
       alf                                                                 09352
       oct -606060                                                         09353
       oct 0                                                               09354
       alf SUM                                                             09355
       alf MAR                                                             09356
       alf Y F                                                             09357
       alf ROM                                                             09358
       alf                                                                 09359
       alf                                                                 09360
       alf                                                                 09361
       alf RUN                                                             09362
ssr    alf                                                                 09363
       alf %                                                               09364
       alf SWA                                                             09365
       oct 473535                                                          09366
sss    alf                                                                 09367
       alf %                                                               09368
       alf BAT                                                             09369
       oct 233035                                                          09370
ssb    alf                                                                 09371
       alf %                                                               09372
       alf MIS                                                             09373
       oct 233535                                                          09374
ssm    alf                                                                 09375
       alf %                                                               09376
       alf IDL                                                             09377
       oct 253535                                                          09378
ssi    alf                                                                 09379
       oct -746060                                                         09380
                                                                           09381
                                                                           09382
.eff1. spb eff1    1                                                       09383
.effe. spb effe    1                                                       09384
       dec -1                                                              09385
fmid   dec flapse                                                          09386
       dec f1-f2                                                           09387
finc   oct 7020               10 + fraction                                09388
finc2  dec 10                                                              09389
finc3  alf 100                                                             09390
fcent  dec 200                Percentage constant                          09391
fmid2  oct 1764375            [23:59:59 3/6]                               09392
       dec f2                 Just to reference them [?]                   09393
       dec f3                                                              09394
                                                                           09395
       org t                                                               09396
epoi2  bss 1                                                               09397
                                                                           09398
       loc 6000                                                            09399
                        Check for printer                                  09400
fpc    ldx 8K      3                                                       09401
       ldz                                                                 09402
       rcs                                                                 09403
       sra 1                  See if switch 18 down                        09404
       bev                                                                 09405
       bru lovwrt             No, so load                                  09406
       bru *+2                If so, no printer                            09407
       nop                                                                 09408
       lda *-1                Get NOP                                      09409
       sta fcre2   3          and place in test instructions               09410
       sta fcre3   3                                                       09411
       spb $ertyp  2          and type message                             09412
       dec *+2                                                             09413
       bru lovwrt             and load                                     09414
       oct 3777777            No printer                                   09415
       alf NO                                                              09416
       alf PRI                                                             09417
       alf NTE                                                             09418
       alf R.                                                              09419
       oct 375577                                                          09420
                                                                           09421
       tcd fpc                                                             09422
                                                                           09423
       stl                    Card scan                                    09424
       ttl                    Background monitor overlays                  09425
                                                                           09426
                           The batch overlay processes cards for           09427
                        background operation, reading and scanning         09428
                        cards on an API bases, looking for either          09429
                        asterisk-blank-blank type cards, or SCC card       09430
                           Action on control cards may be of               09431
                        several types.                                     09432
                        1) If the card type is not in the catalog,         09433
                        it is completely ignored, and the next card        09434
                        is considered.                                     09435
                        2) If the card can be processed completely         09436
                        within this overlay, that is done, and the         09437
                        overlay then considers the next card.              09438
                        3) If the card can be processed, or calls          09439
                        another overlay (a LIST perhaps) then that         09440
                        overlay is called with provision for return        09441
                        to the BATCH overlay on completion of that         09442
                        task.                                              09443
                        4) If the card calls for the execution of a        09444
                        major program, then the OBA2, or OBA3 overlay      09445
                        is called in, and control transferred to           09446
                        them.                                              09447
                                                                           09448
                           Batch mode terminates on a hopper empty         09449
                        conditio, or a STOP from the console               09450
                        typewriter.                                        09451
                                                                           09452
                                                                           09453
       org pernum             Loading information for exec                 09454
       dec 28                                                              09455
       dec batch              Name of overlay                              09456
                                                                           09457
                                                                           09458
       org execov             Is standard overlay location.                09459
       spb messg   2          Acknowledge call with a carriage return      09460
       dec bcr                                                             09461
       sta io1+27             Set sync word off to a start                 09462
       dld .bent.  3          Insert task into API list                    09463
       spb insert  2                                                       09464
       sta ovtsk              and save return location                     09465
       sta z1                                                              09466
       lda bper3   3                                                       09467
       sta bper               and put period character into lower array    09468
       ldo                                                                 09469
       sta cmessb             Set CMESSB right                             09470
       lda io1                                                             09471
                        BFFLG is a 3-way flag.  It is minus if a front     09472
       sta bfflg   3          card has been found, 0 if needs one, and     09473
                        positive if it needs a back card.                  09474
       bpr                    To keep my many friends, check the punch for 09475
       bru *+3                for them                                     09476
       spb messg   2          Type them a message                          09477
       dec bpnr               Punch not ready                              09478
       bru bcd                and go to normal read                        09479
bcr    oct 375577             Carriage-return message - given on entrance  09480
bper3  oct 33                 Period - used in card-scan terminate check.  09481
bcom   eqo 37700                                                           09482
                                                                           09483
                                                                           09484
                        Normal entrance is here                            09485
bent   bss 0                                                               09486
       ldz                                                                 09487
       rcs                                                                 09488
       bmi                    Check console switches                       09489
       bru 2       1          and if negative, crump                       09490
       lda typf               Don't even bother if message being typed     09491
       bnz                                                                 09492
       bru 2       1                                                       09493
       ldx bpoin2  2          Set up return                                09494
       bru 1       2          and execute it                               09495
bc1    oct 546060             [*-blank-blank]                              09496
bc2    oct 54243              [(*  ) - (SCC) (maybe the opposite)]         09497
bcd    spb bcard   1          Card processing loop - get a card            09498
       lda io1                Pick up first character                      09499
       sub bc1     3          check for asterisk                           09500
       bze                                                                 09501
       bru *+4                                                             09502
       sub bc2     3                                                       09503
       bnz                    Check for SCC                                09504
       bru bcd                Non-control, so crump                        09505
       dld zero                                                            09506
       dst t                  Set scan array 0                             09507
       dst t+2                                                             09508
                                                                           09509
                             ---Card scan routine---                       09510
                           Scans a card in IO1, skipping first 6           09511
                        columns, and putting all non-blank characters      09512
                        into T through T+3.  It terminates on              09513
                        reaching column 42, or finding a period,           09514
                        or filling the fourth word of the array.           09515
                        Unused characters in array become 0                09516
                                                                           09517
       ldx zero    1                                                       09518
       sta io1+1   1          Set word pointer to 0                        09519
       inx 12      3          Will use xr3 maximum of 12 characters        09520
baw1   bss 0                                                               09521
       inx 1       1          Bump up word pointer                         09522
       bxh 12      1          Crump                                        09523
       bru bex0.1             See if have front card                       09524
       lda io1+1   1                                                       09525
       cab dumpbl             See if all blanks                            09526
       bru *+2                                                             09527
       bru baw1                                                            09528
       srd 12                 Position                                     09529
       spb baway   2          and put it away                              09530
       sld 6                                                               09531
       spb baway   2                                                       09532
       sld 6                                                               09533
       spb baway   2                                                       09534
       bru baw1               and go get next word                         09535
                                                                           09536
                                                                           09537
baway  bss 0                  Character put-away routine                   09538
       stx io1     1          Save calling register                        09539
       ldx io1+1   1          and get pointer to list                      09540
       cab o60                Check for blank character                    09541
       bru *+2                                                             09542
       bru bblnk                                                           09543
       cab bper               See if terminal period                       09544
       bru *+2                                                             09545
       bru bex0.1                                                          09546
       sla 0       3          Shift                                        09547
       ory t       1          and put away                                 09548
       inx -6      3                                                       09549
bblnk  bxl 1000    3                                                       09550
       bru bawa1                                                           09551
       inx 18      3                                                       09552
       inx 1       1                                                       09553
       bxh 4       1                                                       09554
       bru bex0.1                                                          09555
bawa1  stx io1+1   1                                                       09556
       ldz                                                                 09557
       ldx io1     1                                                       09558
       bru 1       2          and return                                   09559
                                                                           09560
                                                                           09561
bex0.1 bss 0                                                               09562
       ldx 8K      3                                                       09563
       lda bfflg   3          Check front card status                      09564
       bmi                                                                 09565
       bru bex1               yes                                          09566
       bze                                                                 09567
       bru bex0.2             See if front                                 09568
       dld t                  See if back                                  09569
       dcb bbcard  3                                                       09570
       bru bcd                no                                           09571
       bru bcback             yes                                          09572
       bru bcd                                                             09573
bex0.2 dld t                                                               09574
       dcb bfcard  3                                                       09575
       bru bcd                Try again                                    09576
       bru bcfrnt             Found it                                     09577
       bru bcd                                                             09578
bfcard alf FRO                                                             09579
       alf NT0                                                             09580
bbcard alf BAC                                                             09581
       alf K00                                                             09582
                                                                           09583
bex1   bss 0                  Card scan done - do card catalog scan        09584
       lda ocat+2                                                          09585
       sta btlst+2 3                                                       09586
       sta t+7                and set for disk routine                     09587
bex2   bss 0                  Enter here for each record                   09588
       lda btlst+2 3          Get disk address                             09589
       add two                bump it                                      09590
       sta btlst+2 3                                                       09591
       spb dramb   2          Read in a 64-word type record                09592
       dec btlst                                                           09593
       spb bexit   1                                                       09594
       lda btlst+3 3          Check for operation competed                 09595
       bze                                                                 09596
       bru 2       1          exit                                         09597
       ldx 8K      2                                                       09598
       bru baw3               and search this record                       09599
                                                                           09600
btlst  bss 0                  Parameter list for catalog read              09601
       z12 1                  1 record at a time                           09602
       oct 37700                                                           09603
       oct 0                  Disk address specified                       09604
       oct 0                  Flag location ....                           09605
                                                                           09606
                           Table search to see if card type now in         09607
                        matches some entry in the catalog.                 09608
                        All entries consist of a 4-word alphabetic         09609
                        part, plus a 4-word paramater part specifying      09610
                        information about the type - including             09611
                        a branch location to process it.                   09612
                                                                           09613
baw3   bss 0                                                               09614
       dld bcom    2                                                       09615
       bze                                                                 09616
       bru bcdc               Check for RUN or SYM                         09617
       dcb t                  Check first two words                        09618
       bru *+2                no match                                     09619
       bru bfm                at least first two match                     09620
baw6   inx 8       2          Bump up catalog pointer                      09621
       bxh 64      2          Check this record searched                   09622
       bru bex2               yes - so go get next                         09623
       bru baw3               n0 - go try another entry                    09624
bfm    dld bcom+2  2          Check second two words                       09625
       bmi                                                                 09626
       bru baw7               If minus just check first two                09627
       dcb t+2                                                             09628
       bru baw6               No match                                     09629
       bru *+2                                                             09630
       bru baw6               No match, check again.                       09631
baw7   inx bcom+4  2                                                       09632
       lda 0       2                                                       09633
       sta z1                                                              09634
       bru *       1                                                       09635
       bru bcback                                                          09636
       bru bint2                                                           09637
       bru bint                                                            09638
       bru bctype                                                          09639
       bru bcrwnd                                                          09640
       bru bcslew                                                          09641
       bru bext                                                            09642
       bss 4                                                               09643
                                                                           09644
                                                                           09645
bcdc   bss 0                                                               09646
       lda t                  Check for first word RUN or SYM              09647
       cab bsym    3                                                       09648
       bru *+2                                                             09649
       bru bcsym1             Call SYM-locator                             09650
       cab brun    3                                                       09651
       bru bcd                                                             09652
       bru bcsym1             SYM locator will also position for a RUN     09653
       bru bcd                                                             09654
                                                                           09655
bcsym1 lda .bsym1  3          Branch to bsym1                              09656
       bru bcbat2             call BAT2                                    09657
bcfrnt spb bcard   1          Get next card first                          09658
       lda .bfrnt  3          then linkage                                 09659
       bru bcbat2                                                          09660
bcback lda .bback  3                                                       09661
       bru bcbat2                                                          09662
bctype lda 1       2          Get control word for halt or no-halt         09663
       sta t+1                                                             09664
       spb bcard   1          and get card to type                         09665
       lda .btype  3                                                       09666
       bru bcbat2                                                          09667
bcrwnd lda .brwnd  3                                                       09668
       bru bcbat2                                                          09669
bcslew lda .bslew  3                                                       09670
       bru bcbat2                                                          09671
                                                                           09672
                                                                           09673
.bsym1 bru bsym1                                                           09674
.bfrnt bru bfrnt                                                           09675
.bback bru bback                                                           09676
.btype bru btype                                                           09677
.brwnd bru brwnd                                                           09678
.bslew bru bslew                                                           09679
                                                                           09680
                        Exit to get to BAT2                                09681
                                                                           09682
bcbat2 bss 0                                                               09683
       sta bbra               Store branch for BAT2                        09684
       set prq                Make sure to get back                        09685
       spb bexit   1          Get out so messages can be typed             09686
       spb irase   2          Erase present entry                          09687
       ldx zero    2                                                       09688
       inx bat2    2                                                       09689
       bru pgetb              Get it                                       09690
                                                                           09691
bsym   alf SYM                                                             09692
brun   alf RUN                                                             09693
                                                                           09694
                            Card read routine ---                          09695
                        Reads cards - checking for errors, EOF, etc        09696
                                                                           09697
bcard  bss 0                                                               09698
       bcn                                                                 09699
       bru beofc                                                           09700
       ldz                                                                 09701
       sta io1+27                                                          09702
       rcd io1                                                             09703
       hcr                                                                 09704
bcard0 lac                                                                 09705
       add o6o                                                             09706
       sta bclk    3          Start countdown on reader                    09707
bcard1 bss 0                                                               09708
       stx bpoin1  1                                                       09709
       spb bexit   1                                                       09710
       lda io1+27             Wait for card reader sync in                 09711
       bmi                                                                 09712
       bru bcard2                                                          09713
       lac                                                                 09714
       cab bclk    3          Countdown on it                              09715
       bru *+3                [Unecessary instruction--could be bru 2,1]   09716
       bru bcnr                                                            09717
       bru bcnr                                                            09718
       bru 2       1                                                       09719
bcnr   bss 0                  Type card reader not ready and return        09720
       ldx bpoin1  1                                                       09721
       spb messg   2                                                       09722
       dec bcnl                                                            09723
       bru bcard0                                                          09724
bcard2 bss 0                                                               09725
       sub bsync   3                                                       09726
       bnz                                                                 09727
       bru bcard4                                                          09728
       spb bexit   1                                                       09729
       bcn                                                                 09730
       bru 2       1                                                       09731
       ldx bpoin1  1                                                       09732
       bru 1       1          and exit                                     09733
bcard4 bss 0                                                               09734
       sla 1                  Now check for EOF                            09735
       bze                                                                 09736
       bru bcard3             EOF on read - set flag and exit              09737
       spb messg   2          Type out card read error                     09738
       dec bcre                                                            09739
       spb bexit   1          and wait for reader                          09740
       ldz                                                                 09741
       rcs                    to toggle switch 2                           09742
       ext mask6                                                           09743
       bze                    Wait for switch 2 down                       09744
       bru 2       1                                                       09745
       ldx bpoin1  1          toggled                                      09746
       bru bcard              So try reading card again                    09747
bcard3 ldo                                                                 09748
       sta beof               Set EOF on last read flag                    09749
       ldx bpoin1  1          Get entrance back                            09750
       bru 1       1          and exit.                                    09751
                                                                           09752
beofc  bss 0                                                               09753
       lda beof               Will indicate last card read                 09754
       bze                                                                 09755
       spb messg   2          If not read, type out not-ready message      09756
       dec bcnl               and crump, else just crump                   09757
       lda bfflg   3          Check to see if a back card was found        09758
       bnz                                                                 09759
       bru bcback             No, so make one                              09760
       lda fclock+2           Else see if using Sysout                     09761
       cab bno2    3                                                       09762
       bru *+2                                                             09763
       bru beofc0             No Sysout                                    09764
       spb bexit   1          if so, write end-of-file                     09765
       bcs btn     1                                                       09766
       bru 2       1                                                       09767
       sel 1                                                               09768
       wef         7          Put on an EOF                                09769
       bru bcs/o              and call sysout                              09770
       spb time    2                                                       09771
       sta bpdo1   3                                                       09772
       xaq                                                                 09773
       sta bpdo1+1 3                                                       09774
       spb messg   2                                                       09775
       dec bpdo                                                            09776
       ldx ovtsk   1                                                       09777
       spb irase   2          Get rid of this task from list               09778
       ldz                                                                 09779
       sta ovtsk                                                           09780
       sta bzyf                                                            09781
       sta beof                                                            09782
       sta cmessb             Set batch flag back to zero                  09783
       sta io1                                                             09784
       bru 2       1                                                       09785
                                                                           09786
bno2   alf NO                                                              09787
bclk   dec 0                  Used to hold countdown on card reader        09788
                                                                           09789
                                                                           09790
                                                                           09791
                        Exit to start listing of SYSOUT tape               09792
bcs/o  spb irase   2          Erase present task                           09793
       ldx zero    2                                                       09794
       inx s/o     2                                                       09795
       bru pgetb              and get S/O                                  09796
                                                                           09797
                                                                           09798
bext   bss 0                  Call in OBA overlay to execute               09799
       inx 1       2          Get address of parameters to move down       09800
       lda z2                                                              09801
       add bmovp   3          Set up move                                  09802
       sta *+2     3                                                       09803
       dld btmov   3                                                       09804
       dec -1                 and move down to T-array                     09805
       spb bint    2          Call in OBA overlay                          09806
       alf OBA                                                             09807
btmov  dec t+4                                                             09808
       dec -3                 Move down three parameter words              09809
                                                                           09810
bint2  bss 0                  Entered for overlays that need options in TY+09811
       lda 1       2                                                       09812
       sta ty+1               Get single spca translation message          09813
       inx 1       2          set to name                                  09814
                        and continue                                       09815
bint   bss 0                  Enter here to call peripheral overlay in 1,2 09816
       lda 1       2          Get name                                     09817
       sta z0                 save                                         09818
       ldx ovtsk   1                                                       09819
       spb irase   2                                                       09820
       ldx zero    2                                                       09821
       lda z0                 Search for address                           09822
       inx com     2                                                       09823
       cab 0       2                                                       09824
       bru *+2                                                             09825
       bru pgetb              Get overlay                                  09826
       inx 3       2                                                       09827
       bru *-4                Better be in list                            09828
                                                                           09829
.bent. spb bent    1                                                       09830
       dec -1                                                              09831
                                                                           09832
bsync  oct 2606077            Good card-read sync word                     09833
bmovp  z24 0                  Used to construct moves                      09834
bfflg  dec 0                  Front card flag, minus 1 if found one        09835
bexit  stx bpoin2  1                                                       09836
       ldx ovtsk   1                                                       09837
       bru 2       1                                                       09838
bcre   bss 0                                                               09839
       oct 372351                                                          09840
       alf  ER                                                             09841
       alf ROR                                                             09842
       oct 333755                                                          09843
bcnl   bss 0                                                               09844
       oct 372351                                                          09845
       alf  NO                                                             09846
       alf T R                                                             09847
       alf EAD                                                             09848
       oct 703755                                                          09849
                                                                           09850
bpnr   bss 0                  Punch not ready                              09851
       oct 374764                                                          09852
       alf NCH                                                             09853
       alf  NO                                                             09854
       alf T R                                                             09855
       alf EAD                                                             09856
       oct 703755                                                          09857
                                                                           09858
bpdo   bss 0                                                               09859
       oct 372545                                                          09860
       alf D B                                                             09861
       alf ATC                                                             09862
       oct 306060                                                          09863
bpdo1  dec 0                                                               09864
       dec 0                                                               09865
       alf   H                                                             09866
       alf OUR                                                             09867
       alf S.                                                              09868
       oct 373755                                                          09869
                                                                           09870
                        ***********************************************    09871
                        Stop at 37677 for catalog                          09872
                                                                           09873
       org t                                                               09874
       bss 4                  Card-type build area                         09875
bper   bss 1                  Put alpha period                             09876
bpoin1 bss 1                  Index register storage                       09877
bpoin2 bss 1                  Index register storage                       09878
beof   bss 1                  EOF for card read                            09879
bbra   bss 1                  Branch for BAT2                              09880
                                                                           09881
                        Make sure this is at least t+8                     09882
bdc    bss 1                  Batch dump code - 0 for disk handler for tape09883
       tcd lovwrt                                                          09884
                                                                           09885
       stl                    BAT2 - SYM, TYPE, FRONT, BACK, REWIND, SLEW  09886
       ejt                                                                 09887
                        The BAT2 overlay processes standard control        09888
                        cards which would not fit in the batch overlay.    09889
                        When entered the T-array has a branch to the       09890
                        desired routine.                                   09891
                        Any card input will be in IO1.                     09892
                        The tape subroutine is tacked onto the end         09893
                        when this is loaded.                               09894
                                                                           09895
       org pernum                                                          09896
       dec 30                                                              09897
       dec bat2               Overlay name                                 09898
                                                                           09899
                                                                           09900
       org execov                                                          09901
       dld .baen.  3          Insert task in list                          09902
       spb insert  2                                                       09903
       sta ovtsk              and save return location                     09904
       sta z1                                                              09905
       lda bbra               Get branch                                   09906
       sta *+1     3                                                       09907
       nop                    Branch to needed routine                     09908
                                                                           09909
                        Normal entrance to here                            09910
baen   bss 0                                                               09911
       ldz                                                                 09912
       rcs                                                                 09913
       bmi                                                                 09914
       bru 2       1          If sw-0 down, crump                          09915
       lda typf                                                            09916
       bnz                                                                 09917
       bru 2       1          Punt if typing also                          09918
       ldx bpoin2  2          Set up return                                09919
       bru 1       2          and get there                                09920
                                                                           09921
.baen. spb baen    1                                                       09922
       dec -1                                                              09923
                        Enter on 2                                         09924
baex   stx bpoin2  2                                                       09925
       ldx ovtsk   1                                                       09926
       bru 1       2                                                       09927
                                                                           09928
                                                                           09929
                                                                           09930
                        BSYM1 locates symbolic file on tape and            09931
                        positions tape to read after location              09932
                                                                           09933
bsym1  lda io1+17             Get handler number                           09934
       ext mask3              extract plug                                 09935
       add 8K                                                              09936
       sta z1                                                              09937
       lda btab    1                                                       09938
       sta btmsg1+53          Construct rewind                             09939
       add four               Read four words                              09940
       sta bsyex+2 3          Construct instructions                       09941
       spb treqst  2          Tape subroutine                              09942
bsyex  sel 1                                                               09943
       z05 io1                RTB                                          09944
       oct 0                  Constructed                                  09945
       oct 0                  Flag                                         09946
       spb baex    2                                                       09947
       lda *-2     3          Check flag word                              09948
       bze                                                                 09949
       bru 2       1          Not ready                                    09950
       bod                                                                 09951
       bru *+4                                                             09952
       sra 1                                                               09953
       bod                                                                 09954
       bru btmsg1             End of tape                                  09955
                        Only other could be EOF so go on.                  09956
       ldx zero    1                                                       09957
bs1    lda io1     1                                                       09958
       cab io1+7   1          See if match                                 09959
       bru bsyex-1                                                         09960
       bru *+2                                                             09961
       bru bsyex-1            No match, try again                          09962
       inx 1       1                                                       09963
       bxl 4       1                                                       09964
       bru bs1                                                             09965
                                                                           09966
                        Check to see if RUN or SYM.  If SYM, go back       09967
                        to BAT.  If RUN call in OBA for tape loader.       09968
       lda io1                                                             09969
       cab bsym2   3          alf SYM                                      09970
       bru *+2                Must be RUN                                  09971
       bru baret-1            Close tape then get other ovrlay             09972
       spb tclos   2          Close tape                                   09973
       lda btpc    3          Tape constant for OBA                        09974
       sta t+4                Set in T-array                               09975
       ldz                                                                 09976
       sta t+6                                                             09977
       sta z2                                                              09978
       inx oba     2          Get entrance to overlay call                 09979
       bru pgetb              Get overlay                                  09980
                                                                           09981
btpc   oct 20004              Tells OBA to get tape loader                 09982
bsym2  alf SYM                                                             09983
                                                                           09984
btmsg1 spb messg   2                                                       09985
       dec bet                End of tape                                  09986
       spb treqst  2                                                       09987
       sel 1                                                               09988
       z20 --                 Rewind                                       09989
       oct 0                                                               09990
       oct 0                  Flag                                         09991
       bru bartcl             Close tape and wait for typing               09992
                                                                           09993
btab   bss 0                                                               09994
       z21 --                 Make 0 to 4                                  09995
       z02 --                 [1]                                          09996
       z04 --                 [2]                                          09997
       z10 --                 [3]                                          09998
       z21 --                 [4]                                          09999
       z22 --                 [5]                                          10000
       z21 --                 6 to 4                                       10001
       z21 --                 7 to 4                                       10002
                                                                           10003
                        Type routine - entered on reading *TYPE            10004
                        card.  Location 1,1 specifies type or R            10005
                        type and halt - type and halt is on switch 1       10006
                                                                           10007
btype  bss 0                                                               10008
       lda t+1                Pick up control word                         10009
       sta btypf   3          Save 0 or minus 1                            10010
       lda bacr    3          Put in EOM character                         10011
       sta io1+27                                                          10012
       spb messg   2                                                       10013
       dec io1                                                             10014
       spb baex    2                                                       10015
       lda btypf   3                                                       10016
       bnz                                                                 10017
       bru baretw                                                          10018
       ldz                                                                 10019
       rcs                                                                 10020
       bod                                                                 10021
       bru baretw             Exit to BAT1                                 10022
       bru 2       1                                                       10023
                                                                           10024
                                                                           10025
                        Handle front cards - take necessary action         10026
                        to sign on new user                                10027
                                                                           10028
bfrnt  bss 0                                                               10029
       lda io1                Get part of user number                      10030
       add bo606   3          Get rid of special characters                10031
       ext bm1     3          3771717                                      10032
       bnz                    Give gas                                     10033
       bru biluse             illegal user number                          10034
       spr irase   2          Must erase entry before DSKB                 10035
       spb time    2          Get time into type line                      10036
       sta bftm1   3                                                       10037
       sta io1+4              Put on front card                            10038
       xaq                                                                 10039
       sta bftm1+1 3                                                       10040
       sta io1+5                                                           10041
       spb messg   2                                                       10042
       dec bftm               Front card message                           10043
                        Write front card on sysout tape                    10044
       spb dskb    2          Find out what tape to use                    10045
       spb dskop   2                                                       10046
       z37 1                  Write one record                             10047
       dec io1                From IO1                                     10048
       z20 bfda    1          Indirect to front card disk address          10049
       nop                                                                 10050
       spb relin2             and relinquish disk                          10051
       dld zero                                                            10052
       sta bdc                Initialize dump code                         10053
       dst io1-2              Set start control words                      10054
       dld .baen.  3                                                       10055
       spb insert  2          Get entrance back                            10056
       sta ovtsk              and save place in list                       10057
       lda io1+2                                                           10058
       cab bno     3          alf NO - see if they want sysout             10059
       bru bfrnt1                                                          10060
       bru bfrnt2                                                          10061
       cab bt      3          See if dump on tape                          10062
       bru bfrnt1             nope                                         10063
       bru *+2                yes                                          10064
       bru bfrnt1             nope                                         10065
       lda bhan7   3          On sysout tape                               10066
       sta bdc                                                             10067
bfrnt1 spb treqst  2                                                       10068
       sel 1                                                               10069
       wtb io1-2   7          Use tape 7                                   10070
           29                                                              10071
bfrntf oct 1                  Flag - initialize to done                    10072
bfrnt2 spb bpwt    1          Wait for punch                               10073
       wcd io1                                                             10074
       spb bpwt    1                                                       10075
       spb bafx    2                                                       10076
       lda bfrntf  3          Wait for tape before exiting                 10077
       bze                                                                 10078
       bru 2       1          Not done                                     10079
       bru bartcl                                                          10080
bftm   bss 0                                                               10081
       oct 377777                                                          10082
       alf ON                                                              10083
       alf AT                                                              10084
bftm1  dec 0                                                               10085
       dec 0                                                               10086
       oct 375577                                                          10087
                                                                           10088
bno    alf NO                 For  sysout                                  10089
bt     alf T                  For tape dump                                10090
bhan7  oct 3000000            Handler bits for tape seven                  10091
bo606  oct 606                                                             10092
bm1    oct 3771717                                                         10093
                                                                           10094
                                                                           10095
                        Illegal user number, type message and wait         10096
                        for 19 to be toggled.                              10097
biluse spb messg   2          user.                                        10098
       dec bilusm                                                          10099
       spb baex    2          Get out                                      10100
       ldz                                                                 10101
       rcs                                                                 10102
       bev                                                                 10103
       bru 2       1          Not yet                                      10104
       spb baex    2                                                       10105
       ldz                                                                 10106
       rcs                                                                 10107
       bod                                                                 10108
       bru 2       1                                                       10109
       rcd io1                                                             10110
       hcr                                                                 10111
       spb baex    2                                                       10112
       bcn                    Wait to get in                               10113
       bru 2       1                                                       10114
       bru bfrnt              and start over                               10115
                                                                           10116
                                                                           10117
bilusm oct 376462                                                          10118
       alf ER.                                                             10119
       oct 375577                                                          10120
                                                                           10121
                                                                           10122
                                                                           10123
                                                                           10124
                        Handle back card - sign user off                   10125
                                                                           10126
bback  bss 0                                                               10127
       spb irase   2          Erase entry so can use the disk              10128
       spb dskb    2          Ask                                          10129
       spb dskop   2          Read                                         10130
       z12 1                                                               10131
       dec fclock             into 600                                     10132
       z20 bfda    1          Indirect to address                          10133
       nop                                                                 10134
       spb relin2             Get rid of disk                              10135
       dld .baen.  3                                                       10136
       spb insert  2          Get entrance back                            10137
       sta ovtsk                                                           10138
       lda fclock+2           See if using sysout                          10139
       cab bno     3                                                       10140
       bru *+2                                                             10141
       bru bback3             No, so skip                                  10142
       spb treqb   2          Yes, so terminate                            10143
       sel 1                                                               10144
       wtb bs/of1  7          Write ending record                          10145
           29                                                              10146
bback2 oct 1                  Initialize to done                           10147
bback3 spb time    2                                                       10148
       sta bbkm1   3                                                       10149
       xaq                                                                 10150
       sta bbkm1+1 3                                                       10151
       spb messg   2                                                       10152
       dec bbkm               Back card message                            10153
       spb bpwt    1                                                       10154
       lda bbwd    3                                                       10155
       sta io1                                                             10156
       dld bamov   3                                                       10157
       mov io1                                                             10158
       wcf io1                                                             10159
       spb bpwt    1          Wait for punch                               10160
       ldz                                                                 10161
       sta io1                Look for front card                          10162
       spb baex    2                                                       10163
       lda bback2  3          See if tape done                             10164
       bze                                                                 10165
       bru 2       1          No                                           10166
       bru bslew              and slew to top to terminate                 10167
                                                                           10168
bs/de1 oct 20                 Control words for end of file                10169
       oct 0                                                               10170
bbwd   oct 4001               Used to punch back card                      10171
bbkm   bss 0                                                               10172
       oct 377777                                                          10173
       alf OFF                                                             10174
       alf  AT                                                             10175
       oct 607777                                                          10176
bbkm1  dec 0                                                               10177
       dec 0                                                               10178
       oct 375577                                                          10179
                                                                           10180
bpwt   bss 0                                                               10181
       stx bpoin1  1          Save return                                  10182
       spb baex    2                                                       10183
       bpn                                                                 10184
       bru 2       1          and if punch not ready, continue to crump    10185
       ldx bpoin1  1                                                       10186
       bru 1       1          and return                                   10187
                                                                           10188
                                                                           10189
                        Rewidn any tape except 0                           10190
                                                                           10191
brwnd  bss 0                                                               10192
       lda t+2                                                             10193
       sra 12                 Right-justify handler                        10194
       ext mask3              Get rid of high order                        10195
       add 8K                                                              10196
       sta z1                                                              10197
       lda btab    1          Get handler code                             10198
       sta brwndh  3                                                       10199
       spb baex    2                                                       10200
       bcs btn     1                                                       10201
       bru 2       1                                                       10202
       sel 1                                                               10203
       z20 --                 Rewind                                       10204
brwndh oct 0                                                               10205
       spb baex    2                                                       10206
       bcs btn     1                                                       10207
       bru 2       1                                                       10208
       spb baex    2                                                       10209
       bcs brw     1                                                       10210
       bru 2       1                                                       10211
       bru baret                                                           10212
                                                                           10213
                                                                           10214
                        Slew to top of page                                10215
                                                                           10216
bslew  bss 0                                                               10217
       spb baex    2                                                       10218
       bcs bpn     6                                                       10219
       bru 2       1                                                       10220
       sel 6                                                               10221
       slt 8                                                               10222
       spb tclos   2          Close out tape                               10223
       bru baret1             Leave io1 alone this time                    10224
                                                                           10225
btypf  dec 0                  Set to indicate type and halt or type no halt10226
                                                                           10227
bamov  dec io1+1              Constants to clear punch area                10228
       dec -79                                                             10229
bacr   oct 375577                                                          10230
                                                                           10231
                        Call batch ovrlay back                             10232
       spb tclos   2          Close tape                                   10233
baret  bss 0                                                               10234
       lmo                                                                 10235
       sta io1                Set front card in flag                       10236
baret1 ldx ovtsk   1          Erase entry to this overlay                  10237
       spb irase   2                                                       10238
       ldx zero    2                                                       10239
       inx batch   2                                                       10240
       bru pgetb              Bring in overlay                             10241
                                                                           10242
                                                                           10243
bartcl spb tclos   2          Close tape and then wait for typing          10244
                        Wait for typed message and then call batch         10245
                        back in                                            10246
baretw bss 0                                                               10247
       spb baretx  2          Type fudge                                   10248
       lda typf               Type flag                                    10249
       bnz                                                                 10250
       bru 2       1                                                       10251
       bru baret                                                           10252
       ldx ovtsk   1                                                       10253
       inx 1       2                                                       10254
       stx bpoin2  2                                                       10255
       bru 2       1          Exit so typf can get set                     10256
                                                                           10257
                                                                           10258
bet    bss 0                  End of tape                                  10259
       alf END                                                             10260
       alf  OF                                                             10261
       alf  TA                                                             10262
       alf PE.                                                             10263
       oct 375577                                                          10264
                                                                           10265
bfda   oct 3400               Disk address for batch front card            10266
                                                                           10267
                        Set up a couple disk addresses and pull in tape    10268
                        subroutine                                         10269
                                                                           10270
       loc 6000                                                            10271
b2fix  ldx 8K      3                                                       10272
       lda tap+2              Get tape subroutine on end                   10273
       sta b2fix2                                                          10274
       bcs brn     0                                                       10275
       bru *-1                                                             10276
b2fix1 sel 0                                                               10277
       pwf         0                                                       10278
b2fix2 oct 0                  Disk address filled in                       10279
       bcs brn     0                                                       10280
       bru *-1                                                             10281
       sel 0                                                               10282
       rrd 3                                                               10283
           treqst                                                          10284
       bcs brn     0          Wait                                         10285
       bru *-1                                                             10286
       bcs ber     0          Check for errors                             10287
       bru b2fix1                                                          10288
       bru lovwrt             and load                                     10289
                                                                           10290
       tcd b2fix                                                           10291
                                                                           10292
       stl                    Batch temporary storage                      10293
       ejt                                                                 10294
xr312  equ 126                Register for trap save                       10295
                                                                           10296
                                                                           10297
       loc 216                                                             10298
otmp   bss 1                  API                                          10299
odret  bss 1                  ODDP, OTTIM                                  10300
       loc 230                                                             10301
odret2 bss 1                  Index register storage for SYSOUT, ODSK      10302
otmp2  bss 1                  OSOTER, OTRAP, ORTRAP                        10303
otmp3  bss 1                  OTYPE                                        10304
otemp  bss 1                                                               10305
otmp1  bss 1                                                               10306
                        End API area definitions                           10307
                                                                           10308
                                                                           10309
       stl                    Batch part 1                                 10310
       ejt                                                                 10311
       org pernum                                                          10312
       dec 32                                                              10313
       dec oba                                                             10314
       org execov                                                          10315
                        ********************************************       10316
                                                                           10317
                            This overlay is called in by the -BAT-         10318
                        overlay whenever there is a call to run a          10319
                        background program which destroys the time-        10320
                        sharing executive.  [sacre bleu.....]              10321
                            The overlay has four possible entrances.       10322
                         1) 37000 - overlay entered here when first        10323
                        loaded by 235 exec, then never entered here        10324
                        again.                                             10325
                         2) 37001 - entered here by the running            10326
                        system upon completion of the entire               10327
                        run, or to begin the execution of a disk,          10328
                        tape, or typing operation by the executive.        10329
                        3) 37002 - entered here by exec whenever           10330
                        exec is loaded into memory, and OBFLG (in          10331
                        the bootstrap) is not zero.                        10332
                         4) 37003 - enter here when permission has         10333
                        been granted by the D-30 to run a background       10334
                        system.                                            10335
                                                                           10336
       bru oinit              Enter here from exec, first time             10337
       bru osys               Enter here from calling system               10338
       bru ores               Enter here from exec on reset                10339
       bru orun               Enter here from 235 exec on run from D-30    10340
                                                                           10341
                            ORUN is entered at any time the D-30           10342
                        gives a run-batch message to the 235 exec.         10343
                        The result of this may be the initial running      10344
                        of a batch task previously set up, or the          10345
                        restoration of an OLD problem previously run.      10346
                        In any case, the following things happen...        10347
                         1) If switch 0 is down, the batch job is          10348
                            punted until next time around.                 10349
                         2) If the 235-exec us typing a message,           10350
                            again, the run time is punted.                 10351
                         3) If the tapes are not ready after a reason-     10352
                            able amount of time, or there is an error,     10353
                            this batch period is punted.                   10354
                         4) The interrupt branch is stolen from the        10355
                            235 exec, and given to this overlay.           10356
                                                                           10357
                            If this is a run being brought in for the      10358
                        first time, the previously constructed             10359
                        load sequence is executied to bootstrap the        10360
                        system in, and control is transferred to it        10361
                        in index-group 0, non-trpmode, pst, binmode        10362
                        and kon.                                           10363
                                                                           10364
                            On reloads of jobs peviously running,          10365
                        the following conditions are restored -            10366
                        A. Arithmetic mode [AAU]                           10367
                        B. Binmode or Decmode                              10368
                        C. AX, QX, A, Q                                    10369
                        D. Index group                                     10370
                        E. Overflow                                        10371
                        F. Kon is set (it should never be off)             10372
                        G. Non-trapping mode is set (never on I hope)      10373
                        H. A set prq is executed to start                  10374
                           peripheral tasks going again                    10375
                                 .....and then back to the program.        10376
                                                                           10377
                                                                           10378
                                                                           10379
orun   bss 0                                                               10380
                                                                           10381
       lac                    Set run+swap time counter                    10382
       sta otim1t  3                                                       10383
       ldz                                                                 10384
       rcs                    Check switch 0 - if down, punt               10385
       bmi                                                                 10386
       bru onrun              punt                                         10387
       lda typf               See if 235 typing                            10388
       bnz                                                                 10389
       bru onrun              If so, punt                                  10390
       dld bsums2  3          Move summary up                              10391
       mov fkedit                                                          10392
       lda offlg   3          Now check for initial or rerun               10393
       bze                                                                 10394
       bru orunf              First run to be executed                     10395
       ldo                                                                 10396
       sta cmessb             Just in case of bootstrap                    10397
       spb oload   1          Load in the damn program from storage        10398
       lda oapib   3          Get API branch instruction                   10399
       sta z2+2               and put where API branch will be to          10400
       lda oarr+4  3          Pick up save xr1 contents                    10401
       sta otmp               and put where routine will restore them      10402
oruna  set ntpmode            spb ortrap,1 if necessary                    10403
       fld oarr+2  3          Reset AAU registers                          10404
       xaq         A                                                       10405
       fld oapr    3                                                       10406
       kon                    Just in case                                 10407
       lac                                                                 10408
       sta otim2t  3                                                       10409
       set prq                Set prq - to get things going                10410
orung  bru *                                                               10411
orunm  bru *                                                               10412
       bru oint2              Go to normal restore sequence                10413
                                                                           10414
       stl                    Batch part 1 - load                          10415
       ejt                                                                 10416
                        ********************************************       10417
                        OLOAD determines whether the program was           10418
                        dumped on tapes or the disk and then loads         10419
                        correctly.                                         10420
                        Disk dump - four 4K blocks                         10421
                        Tape dump - lower memory on tape, upper on         10422
                                    disk                                   10423
                                                                           10424
oload  spb odask   2          Always need disk                             10425
       lda opar    3          See where dump is                            10426
       bze                                                                 10427
       bru oload0             Disk                                         10428
       spb otop    2          Tape                                         10429
       oct 1517777            Read backwards                               10430
oltc   oct 0017550                                                         10431
       bru oload1             Get upper memory from disk                   10432
oload0 spb odop    2          Lower memory                                 10433
       z12 2                                                               10434
       dec 0                                                               10435
       oct 24100              Disk address                                 10436
       spb odop    2                                                       10437
       z12 62                                                              10438
       dec 256                Read into wrong place                        10439
       oct 24104              From right place                             10440
       spb odskwt  2          Wait to get in                               10441
       dld damov   3          move down                                    10442
       mov 256+24                                                          10443
       spb odop    2                                                       10444
       z12 64                                                              10445
       dec 4096                                                            10446
       oct 24500                                                           10447
                        Upper memory                                       10448
oload1 spb odop    2                                                       10449
       z12 64                                                              10450
       dec 8192                                                            10451
       oct 25100                                                           10452
       sob odop    2                                                       10453
       z12 56                                                              10454
       dec 12288                                                           10455
       oct 25500                                                           10456
       lda opar    3                                                       10457
       bze                                                                 10458
       bru oload2                                                          10459
       spb otop    2                                                       10460
       z15 127                Get rest of tape                             10461
oltc2  dec 129                Set busy flag                                10462
       spb otop    2          Wait for tape                                10463
       dec 0                                                               10464
oload2 spb orflin  2          Get rid of disk                              10465
       bru 1       1          and return                                   10466
                                                                           10467
                                                                           10468
                        ********************************************       10469
                                                                           10470
onrun  bss 0                  Entered if for some reason a -RUN BATCH-     10471
                        permission message is to be temporarily            10472
                        ignored, an immediate return to time-              10473
                        sharing is desired                                 10474
                                                                           10475
                                                                           10476
       lda otwo    3          Just tell D-30 to resume normal T-S          10477
       sta mbx0                                                            10478
       bru iplst              and go to peripheral task list               10479
                        ********************************************       10480
                                                                           10481
                        ***Typed message will be put here****              10482
                                                                           10483
orunf  bss 0                                                               10484
       lda oapib   3          Get API branch                               10485
       sta z2+2                                                            10486
       lac                                                                 10487
       sta otim    3          Set run start time                           10488
       sta obzyf   3          Set to busy                                  10489
       ldo                                                                 10490
       sta offlg   3          Set not first entrance flag                  10491
       spb odask   2          Get disk from D-30                           10492
       spb odop    2          Bring in 35000 and 36000 parts of BATCH      10493
       z12 16                                                              10494
       oct 35000              Memory address to read into                  10495
orunf. oct 0                  Filled in when loaded                        10496
       ldo                                                                 10497
       sta cmessb             Reset+                                       10498
       spb odskwt  2          Wait for disk to finish                      10499
       dld orun.2  3          Move trap routines where they belong         10500
       mov osbu1                                                           10501
       bru orun.3             and go finish this there                     10502
                                                                           10503
orun.2 dec ortrap                                                          10504
       dec -128                                                            10505
                                                                           10506
       org orun                                                            10507
       bss 31                 Save space for typed messages                10508
                                                                           10509
       stl                    Batch part 1 - tape routines                 10510
       ejt                                                                 10511
                                                                           10512
                                                                           10513
otop   bss 0                  Tape operations                              10514
       stx odret   2          Save index before tape waiting               10515
       spb otapwt  2                                                       10516
       ldx odret   2          and get it back after wait                   10517
       lda 1       2                                                       10518
       bze                                                                 10519
       bru 2       2                                                       10520
       sta otp2    3                                                       10521
       lda 2       2                                                       10522
       sta otp2+1  3                                                       10523
       sel 1                                                               10524
otp2   dec -                                                               10525
       dec -                  ***                                          10526
       bru 3       2          and return                                   10527
                                                                           10528
                                                                           10529
otapwt lda o8K     3                                                       10530
       sla 2                  Get a reasonable countdown value             10531
       bcs btr     1                                                       10532
       bru 1       2                                                       10533
       sbo                                                                 10534
       bnz                                                                 10535
       bru *-4                                                             10536
       spb otyp    2          Type out message                             10537
       dec otem               Alert halt on tapes                          10538
       bru ostop0             and punt run                                 10539
                        ********************************************       10540
                            The following routine picks up tape            10541
                        commands from tp2 and tp2+1,                       10542
                        constructs correction commands for each type       10543
                        of operation, and executes these instructions      10544
                        assuming the tapes are ready on entrance.          10545
                         On forward reads, a backwards read in the         10546
                        same mode is constructed.                          10547
                         On backwards reads, a forward read in the         10548
                        same mode is constructed.                          10549
                         On write instructions, a BKW is contructed.       10550
                             These routines are based on the               10551
                        following characteristics of the GE tape           10552
                        instructions.                                      10553
                        Bit 1 on always means backwards tape movement      10554
                        Bit 2 on always means a read operation             10555
                        Bit 3 on always means a write operation.           10556
                                                                           10557
oter   bss 0                                                               10558
                                                                           10559
       lda otp2    3                                                       10560
       srd 16                 BKW, EKT, RWD, WEF.                          10561
       bod                    Check bit 3                                  10562
       dld othree  3          Pick up words which will give BKW            10563
       srd 2                  Now check for foward or backwards            10564
       ado                    Else construct backwards                     10565
       sld 18                 Get the instruction back                     10566
       sta oter2   3          and put in correction sequence               10567
       lda otp2+1  3                                                       10568
       ext otmsk   3          and make it a zero word count                10569
       sta oter2+1 3          and put away                                 10570
       sel 1                  and execute correction instruction.          10571
oter2  dec -                                                               10572
       dec -                                                               10573
       bru 1       2          and return                                   10574
otmsk  oct 0077777            Mask to extract word count from tape command 10575
                                                                           10576
       stl                    Batch part 1 - disk routines                 10577
       ejt                                                                 10578
                        ********************************************       10579
                            ODOP is the disk operation subroutine          10580
                        for the overlay.  It serves both the executive     10581
                        and user's programs, but must be called            10582
                        only while in an API program.  The calling         10583
                        sequence is -                                      10584
                              spb odop,2                                   10585
                              rrf (or wrf), x records, less than 97.       10586
                              memory address for read or write             10587
                              oct position on disk for read or write       10588
                              return location.                             10589
                                                                           10590
                        There is not, at the moment, any provision         10591
                        for indirect addressing of the parameter           10592
                        list.  In addition, the D-30 should already        10593
                        have been asked for the disk, and this             10594
                        routine does not relinquish the disk when it       10595
                        is through.  [JSM: code reads otherwise]           10596
                        the disk is not checked for error on               10597
                        entrance, nor does it check on the last            10598
                        operation it executes (because it exits            10599
                        before it is done).  On intermediate errors,       10600
                        it tries 5 times, and then returns an              10601
                        error message.  Three error types are checked      10602
                        1 - disk not ready                                 10603
                        2 - illegal addres on disk                         10604
                        3 - parity error on read or write.                 10605
                        4 - illegal disk address                           10606
                        These are all indicated by a positive              10607
                        number in the A register on return, else A         10608
                        will be zero.                                      10609
                                                                           10610
odop   bss 0                                                               10611
       ldz                    Zero odcnt just in case                      10612
       sta odcnt   3                                                       10613
       stx odret   2          Save entrance register                       10614
       lda 3       2          Pick up the disk address                     10615
       sta z2                 Indirect if word is minus                    10616
       bmi                                                                 10617
       lda 0       2                                                       10618
       sta odseek+23          Put it away in case it is legal              10619
       ext omsk2   3          check for legal position address             10620
       sub oo300   3                                                       10621
       bpl                                                                 10622
       bru odker              Illegal address                              10623
       lda odseek+23          Get disk address back and store for relinqsh 10624
       sta orelad  3          Store disk address for the relinquish        10625
       spb odskwt  2                                                       10626
odseek sel 0                  Seek command                                 10627
       prf         0          ***                                          10628
       oct 0                  ***                                          10629
       ldx odret   2          Restore entrance register                    10630
       lda 1       2          Get RRF-WRF-WRD-RRD-                         10631
       sto odcnt   3          Save record count                            10632
       ext omsk1   3          Now punt record count                        10633
       add odinst  3          Set up proper instruction                    10634
       sta odoper+13          Put it away                                  10635
       lda odcnt   3          Now compute bit setting for 96-record RW     10636
       srd 4                                                               10637
       xaq                    Remainder mod 16 in A                        10638
       sra 15                 Position remainder...if zero                 10639
       bze                    want 16 in A and 1 less in Q                 10640
       dad ofudge  3          OFUDGE = 15, -1                              10641
       ory odoper+13          Put it away                                  10642
       ldz                    Now set bits 2-4                             10643
       scd 4                                                               10644
       add 2       2          Add the memory address                       10645
       sta odoper+23          Put it away                                  10646
odoper sel 0                  Execute the instruction                      10647
       z00 0                  ***                                          10648
       z00 0                  ***                                          10649
       ldz                                                                 10650
       bru 4       2          Return to caller                             10651
ofudge dec 15                                                              10652
       dec -1                                                              10653
                        ********************************************       10654
                        Wait for disk - if ready exit immediately,         10655
                        if not, wait awhile, then see if can ask D-30      10656
odskwt bss 0                                                               10657
       lac                                                                 10658
       add oseven  3                                                       10659
       sta odival  3                                                       10660
odskw0 bcs brr     0                                                       10661
       bru 1       2                                                       10662
       lac                                                                 10663
       cab odival  3                                                       10664
       bru odskw0                                                          10665
       bru odskw0                                                          10666
       add oo40    3                                                       10667
       sta odival  3                                                       10668
       stx odret2  2          Disk not ready so type message               10669
       spb otyp2   2                                                       10670
       dec odnr               Disk not ready                               10671
       ldx odret2  2                                                       10672
       bru odskw0             Keep trying to get disk                      10673
                                                                           10674
                                                                           10675
                                                                           10676
odker  spb otyp    2          Give illegal address message                 10677
       dec oiad                                                            10678
       lda ofour   3          Pick up error indication                     10679
       ldx odret   2          Get return address                           10680
       bru 4       2          Error exit, code in A register               10681
                                                                           10682
                        ********************************************       10683
odask  bss 0                  Disk Request routine - ask D-30              10684
       ldo                                                                 10685
       sta pmbx0                                                           10686
       lda pmbx0                                                           10687
       bpl                                                                 10688
       bru *-2                                                             10689
       bru odskwt             Now wait for ready                           10690
                                                                           10691
                                                                           10692
                        ********************************************       10693
orelin bss 0                  Disk relinquish - enter on xr2               10694
       stx odret   2          Save index register for wait                 10695
       spb odskwt  2                                                       10696
       ldx odret   2                                                       10697
       ldo                                                                 10698
       ory orelad  3                                                       10699
       sel 0                                                               10700
       prf         0          Position on last operation                   10701
orelad oct 0                  ***                                          10702
       bcs brn     0                                                       10703
       bru *-1                                                             10704
       sel 0                                                               10705
       oct 1213040            Read-after-write - 0 records                 10706
       oct 0                                                               10707
       lda otwo    3          Send - can-have-disk message -               10708
       bru ospmb              and set message and will bru 1,2             10709
                                                                           10710
       stl                    Restore after dump                           10711
       ejt                                                                 10712
                                                                           10713
                                                                           10714
                        ********************************************       10715
                            ORES is entered after every reload of          10716
                        the 235 exec by this overlay.                      10717
                        It does six things-                                10718
                        1) Sets the busy flag BZYF to busy                 10719
                        2) Sets CMESSB - the batch flag - to BATCH mode    10720
                        3) Tells D-30 it can have the disk.                10721
                        4) Tells D-30 to resume normal time-sharing        10722
                        5) Checks to see if the last program ran to done   10723
                        6) Checks to see if exist was to type message.     10724
                           It then exits back to the 235-exec.             10725
                                                                           10726
                                                                           10727
ores   bss 0                                                               10728
       spb irase   2                                                       10729
       lac                                                                 10730
       sub otim1t  3                                                       10731
       add otim1   3          Accumulate running plus swap time            10732
       sta otim1   3                                                       10733
       lda otwo    3          ******yes - maybe ***                        10734
       sta mbx0               Tell D-30 to resume normal time-sharing      10735
       ldo                                                                 10736
       sta cmessb             and set cmessb non-zero                      10737
       sta bzyf               and same for busy flag                       10738
       lda ofour   3          Tell D-30 to start counting time             10739
       spb ospmb   2                                                       10740
       ldz                                                                 10741
       sta otypf   3          Set type flag to 0 for next entry            10742
       lda otad    3          Check for message to be typed                10743
       bnz                    if there is an address                       10744
       spb messg   2          go to 235 and type it                        10745
otad   dec 0                  Address of any typed message goes here.      10746
       dld .ors2.  3                                                       10747
       spb insert  2                                                       10748
       sta ovtsk                                                           10749
       lda obflg   3          See if terminal                              10750
       bze                                                                 10751
       bru 2       1          No                                           10752
ors0   lda osrat   3          Give D-30 a crump-batch message              10753
       spb ospmb   2                                                       10754
       bru orst               and get out                                  10755
ors2   bss 0                                                               10756
       lda typf                                                            10757
       bnz                                                                 10758
       bru 2       1                                                       10759
       ldz                                                                 10760
       sta otad    3          Crump typewriter task                        10761
       bnr                                                                 10762
       sna 19                 and check for STOP message                   10763
       sub ost     3                                                       10764
       bnz                                                                 10765
       bru *+4                                                             10766
       ldo                    Set up to look for BACK card                 10767
       sta io1                and crump since S was typed                  10768
       bru ors0               Crump - somebody typed -S-                   10769
       lda obflg   3          Now check for entered on completion          10770
       bze                                                                 10771
       bru 2       1                                                       10772
orst   bss 0                  Stop whole operation                         10773
       lda otim2   3          Real running time                            10774
       spb ogtim   2          Convert                                      10775
       dec otimr                                                           10776
       lda otim1   3                                                       10777
       sub otim2   3          Get swap time                                10778
       spb ogtim   2                                                       10779
       dec otims                                                           10780
       lac                                                                 10781
       sub otim    3          Get total time on machine                    10782
       spb pgtim   2                                                       10783
       dec otimo                                                           10784
       ldx ovtsk   1                                                       10785
       bcs bpn     6                                                       10786
       bru 2       1                                                       10787
       sel 6                                                               10788
       slw 4                                                               10789
       lda .orst1  3          Change branch                                10790
       sta 0       1                                                       10791
orst1  lda typf                                                            10792
       bze                    Wait for alert halt message                  10793
       bcs bpn     6                                                       10794
       bru 2       1                                                       10795
       sel 6                                                               10796
       wpl otiml                                                           10797
       ldz                                                                 10798
       sta obzyf   3          Reset                                        10799
       spb irase   2          Erase this entry to task list                10800
       spb dskb    2          Get disk                                     10801
       spb dskop   2          Disk operatin                                10802
       z37 8                                                               10803
       oct 37000              Dump from 37000                              10804
       oct 25600                                                           10805
       nop                    Error return                                 10806
       spb relin   2          and get rid of disk                          10807
       lda opar    3          Get dump code                                10808
       sta bdc                save for next part, if any                   10809
       ldx zero    2                                                       10810
       inx batch   2          Call in batch overlay                        10811
       bru pgetb              Overlay caller in exec                       10812
                                                                           10813
ogtim  bss 0                  Convert time to decimal                      10814
       stx z0      2          Save calling register                        10815
       maq                    and conversion                               10816
       lda 1       2          Pick up where to put away                    10817
       sta z2                                                              10818
       ldz                                                                 10819
       dvd h1                 52140 [21600 = 3600*6]                       10820
       spb obcd    1                                                       10821
       sta 0       2                                                       10822
       ldz                                                                 10823
       dvd h2                 550 [360 = 60*6]                             10824
       spb obcd    1                                                       10825
       sta 1       2                                                       10826
       ldz                                                                 10827
       dvd six                                                             10828
       spb obcd    1                                                       10829
       sta 2       2                                                       10830
       ldx z0      2                                                       10831
       bru 1       2                                                       10832
                                                                           10833
obcd   bss 0                                                               10834
       dst oaq     3                                                       10835
       maq                                                                 10836
       dvd ten                                                             10837
       sla 6                                                               10838
       sta oaq     3                                                       10839
       xaq                                                                 10840
       add colon                                                           10841
       ory oaq     3                                                       10842
       dld oaq     3                                                       10843
       bru 1       1                                                       10844
                                                                           10845
                                                                           10846
otiml  bss 0                  Line for time printout                       10847
       alf  TO                                                             10848
       alf TAL                                                             10849
       alf  TI                                                             10850
       alf ME                                                              10851
otimo  dec 0                  Actual on-to-off time                        10852
       dec 0                                                               10853
       dec 0                                                               10854
otimt  oct 373751                                                          10855
       alf UNN                                                             10856
       alf ING                                                             10857
       alf  TI                                                             10858
       alf ME                                                              10859
otimr  dec 0                  Actual computer running time                 10860
       dec 0                                                               10861
       dec 0                                                               10862
       oct 375562                                                          10863
       alf WAP                                                             10864
       alf  TI                                                             10865
       alf ME                                                              10866
otims  dec 0                  Swap time                                    10867
       dec 0                                                               10868
       dec 0                                                               10869
       alf .                                                               10870
       dec -1                 Print line delimiter                         10871
                                                                           10872
       stl                    Batch part 1 - initialization                10873
       ejt                                                                 10874
                                                                           10875
                        ********************************************       10876
                                                                           10877
                        OINIT is entered after the batch overlay           10878
                        discovers a time-sharing-destroying system is      10879
                        to be run.  It expects to find the                 10880
                        following information left in the array -T-        10881
                        T   = Alphanumeric -RUN-                           10882
                        T+1 = xxx                                          10883
                        T+2 = xxx                                          10884
                        T+3 = Alphanumeric system name                     10885
                        T+4 = 0, 4, 10...code for loader type plus         10886
                              8K bit on in word.                           10887
                               0 is standard disk image loader             10888
                               4 is bridge-type tape loader                10889
                              10 is blocked disk loader                    10890
                              14 is binary card loader                     10891
                                                                           10892
                        T+5 = octal disk address, of the first             10893
                              program record - used by loader              10894
                        T+6 = 0 if system is to be dumped                  10895
                              intermediately on disk.                      10896
                            = octal handler configuration if               10897
                              system is to be dumped on tape.              10898
                                                                           10899
                        OINIT will insert the handers where they           10900
                        belong, set up the sequence to load the            10901
                        loader, set up the D-30 start-batch message,       10902
                        and exit to wait for a begin-batch message.        10903
                                                                           10904
oinit  bss 0                                                               10905
                                                                           10906
       lda obbru   3          Pick a bru 1,1                               10907
       sta execov  3          Preset API exit to no action                 10908
       lda pmbx0              See if have an unanswered message            10909
       bpl                                                                 10910
       bru *-2                yes                                          10911
       lda oten    3          Ask D-30 to initiate batch mode.             10912
       spb ospmb   2                                                       10913
       bru 2       1          and return immediately to exec.              10914
                                                                           10915
                                                                           10916
                        ********************************************       10917
ospmb  bss 0                  Sends special mailbox message to D-30        10918
       sta pmbx0                                                           10919
       lda pmbx0              and waits for an answer                      10920
       bpl                                                                 10921
       bru *-2                                                             10922
       bru 1       2                                                       10923
                                                                           10924
                                                                           10925
                        ********************************************       10926
otyp   bss 0                  Entered internally to set up typed message   10927
       lda 1       2                                                       10928
       sta otad    3          Put in message adddress                      10929
       bru 2       2          and exit                                     10930
                                                                           10931
       stl                    Constants and things                         10932
       ejt                                                                 10933
                        Constants and flag storage                         10934
odival bss 1                                                               10935
odcnt  dec 0                  Count disk records - must be initally 0      10936
.ors2. spb ors2    1                                                       10937
.orst1 spb orst1   1                                                       10938
oo40   oct 40                                                              10939
       oct 2000                                                            10940
                        Running time constants                             10941
otim   dec 0                  Will hold total real time for job            10942
otim1  dec 0                  Will hold actual running time                10943
otim2  dec 0                  Will hold running time + swap time           10944
otim1t dec 0                  Temporary accumulator for otim1              10945
ptim2t dec 0                  Temp. accumulator for otim2                  10946
                        End time holders                                   10947
oseven dec 7                                                               10948
omsk1  oct 77777                                                           10949
omsk2  oct 3777400                                                         10950
odinst oct 10040                                                           10951
oo300  oct 300                                                             10952
ost    alf 00S                OPSTOP message on typewriter                 10953
oent1  equ execov             User's branch put here                       10954
osbat  oct 11                 Stop-batch to D-30                           10955
oaq    dec 0                  A and Q storage                              10956
       dec 0                                                               10957
othree oct 3                  Constant                                     10958
ofour  oct 4                  Constant                                     10959
otem   oct 376321             Tape alert.                                  10960
       alf PE                                                              10961
       alf ALE                                                             10962
       alf RT.                                                             10963
       oct 375577                                                          10964
o8K    dec 8192                                                            10965
oti    equ o8K                                                             10966
odi    equ o8K                                                             10967
obflg  dec 0                  Flag 0 = no special circumstances            10968
                                   1 = job ran to completion               10969
omop   z24 0                  Move opcode, used in overlay call routine    10970
offlg  dec 0                  First run flag                               10971
otwo   oct 2                  Constant                                     10972
opar   dec 0                  Save disk-or-tape flag here                  10973
odec   dec 0                  Error count of diskp                         10974
oiad   bss 0                  Illegal disk address                         10975
       oct 312155                                                          10976
odnr   bss 0                  Disk-not-ready message                       10977
       oct 244255                                                          10978
otypf  dec 0                  Signals type of entry to OBA                 10979
                                                                           10980
                             ODAD is a table of parameters for             10981
                        the various types of loaders it is possible        10982
                        to call during batch.                              10983
                             Each entry is three words long,               10984
                        consisting of the disk address and read            10985
                        commands for this loader.  It is assumed           10986
                        that the first memory location for the             10987
                        loader is the first program location and           10988
                        entrance point.                                    10989
                                                                           10990
odad   bss 0                  Table of disk loader parameters              10991
       z12 6                  Disk card image loader                       10992
       oct 35000              into 35000 in memory                         10993
       oct 32000              from this disk address                       10994
       dec 0                                                               10995
       z12 3                  Bridge-type tape loader                      10996
       oct 17500              into memory at 17500                         10997
       oct 32010              from this disk address                       10998
       dec 0                                                               10999
       z12 7                  Blocked disk loader                          11000
       oct 17000                                                           11001
       oct 32020                                                           11002
       dec 0                                                               11003
       z12 7                  Card loader                                  11004
       oct 35000              memory address                               11005
       oct 32030              into memory from this disk address           11006
       dec 0                                                               11007
       bss 0                  End of catalog                               11008
oten   oct 10                                                              11009
otwen  oct 20                                                              11010
oapib  bru oint    3          Steal API branch from exec to run            11011
oamov  z00 128+24             Used to move disk records down to API area   11012
       dec -3948              a few too many makes no difference           11013
                                                                           11014
       stl                    Batch part 1 - Tape correction for hard error11015
       ejt                                                                 11016
                                                                           11017
                        This routine is entered from the tape routine      11018
                        after it has tried the operation five times        11019
                        and still gets an error indication.                11020
                        If the operation was a write it will erase         11021
                        tape and re-write the record.                      11022
                        If the operation was a read it will try            11023
                        switching modes and re-reading.  If that does      11024
                        not work it will return to the original mode.      11025
                        It punts if it finds a read special.               11026
                                                                           11027
otera  lda otpb    3          Get bad tape command                         11028
       srd 16                 Check bit three - if on it was a write       11029
       bod                                                                 11030
       bru otera1             So erase                                     11031
                        Instruction was a read so change modes             11032
       bmi                                                                 11033
       bru otwrp2             Was a read-special so punt                   11034
       lda oswc    3          3-way flag 0 - first entrance, minus -       11035
                        second entrance, plus - third (and final) entrance 11036
       bnz                    Set flags for next time                      11037
       bru *+3                                                             11038
       lmo                                                                 11039
       bru store                                                           11040
       bpl                                                                 11041
       bru otwrp2             Last time so punt                            11042
       ldo                                                                 11043
store  sta oswc    3                                                       11044
       lda otpb    3          Get bad tape command                         11045
       srd 15                                                              11046
       bev                                                                 11047
       ado                                                                 11048
       ext otwo    3          Wipe out bit 18 - now we have the changed    11049
                        instruction                                        11050
       sld 15                 Put insruction back together                 11051
       sta otlst   2          put back in list                             11052
       ext otmsk   3          77777                                        11053
       add oten    3          Get proper error bit on                      11054
       sta otst    3                                                       11055
       spb oter    2          Back up tape                                 11056
       lda oseven  3          Reset error count to seven                   11057
       sta otec    3                                                       11058
       bru 1       1          Exit and try again                           11059
                                                                           11060
oswc   dec 0                                                               11061
                                                                           11062
                        Command was write so erase                         11063
otera1 lda otpb    3          Get command back                             11064
       sta otlst   2                                                       11065
       spb oter    2          Back up tape                                 11066
       lda oter2+1 3          Get handler information                      11067
       add oo2476  3          Erase at least 2476 words                    11068
       sta otap1+2 3                                                       11069
       lda otap1.  3          spb otap1,1                                  11070
       sta oint2+1 3          Fudge branch                                 11071
       bru 1       1                                                       11072
otap1  spb otop    2                                                       11073
       ert         4          Will be changed                              11074
           0                                                               11075
       lda otape.  3          spb otape,1                                  11076
       sta oint2+1 3                                                       11077
obbru  bru 1       1          Exit - also constant to set API branch       11078
otap1. spb otap1   1                                                       11079
                                                                           11080
bsums  bss 8                  Space for summary                            11081
                                                                           11082
bsums2 dec bsums              Constant to move summary up                  11083
       dec -8                                                              11084
otape. spb otape   1                                                       11085
                                                                           11086
       loc 37777                                                           11087
obzyf  dec 0                  Busy flag in case of bootstraps              11088
                                                                           11089
                                                                           11090
       loc 6000                                                            11091
obaf1  ldx 8K      3                                                       11092
       lda oba3+2                                                          11093
       sta orunf.  3          Initialize disk address                      11094
       bcs brn     0                                                       11095
       bru *-1                                                             11096
obaf2  sel 0                                                               11097
       prf         0                                                       11098
       oct 26160              Put on dump part                             11099
       bcs brn     0                                                       11100
       bru *-1                                                             11101
       sel 0                                                               11102
       wrd 8       0                                                       11103
           execov                                                          11104
       bcs brn     0                                                       11105
       bru *-1                                                             11106
       bcs ber     0                                                       11107
       bru obaf2                                                           11108
       bru lovwrt                                                          11109
                                                                           11110
       tcd obaf1                                                           11111
                                                                           11112
       stl                    Batch part 2                                 11113
       ejt                                                                 11114
                                                                           11115
                        Information for 235 loading routine                11116
       org pernum                                                          11117
       dec 34                                                              11118
       dec oba2               Overlay name                                 11119
       loc 36000              Lower memory part of batch overlay           11120
                                                                           11121
                                                                           11122
                        This entrance must remain at 36000 to be           11123
                        entered from the loader.                           11124
       sxg 2                  Call in OBA3                                 11125
       ldx z2+1    3                                                       11126
olobar lda otwo    3                                                       11127
       spb exec    1                                                       11128
       dec oloba3                                                          11129
       lda oloba3+33                                                       11130
       bze                                                                 11131
       bru *-2                                                             11132
       bev                                                                 11133
       bru olobar             Error, try again                             11134
       sxg 0                                                               11135
       bru 0       3          Go to program                                11136
oloba3 z12 8                  8 records                                    11137
       oct 35000                                                           11138
       oct 0                  Filled in when loaded                        11139
       oct 0                                                               11140
                                                                           11141
       stl                    Program exits                                11142
       ejt                                                                 11143
                                                                           11144
                            OSYS handles entrances from user programs.     11145
                        It is the only part of the overlay which is        11146
                        executed outside of API, and may be interrupted.   11147
                        It may be entered in any index group, stays        11148
                        there, and very well may destroy said index grp.   11149
                        There are five possible entrances, according,      11150
                        to the contents of the A register.                 11151
                                                                           11152
                        Codes are as follows                               11153
                        0 = Termination                                    11154
                        1 = Tape operation                                 11155
                        2 = Disk operation                                 11156
                        3 = Typewriter output                              11157
                            sign on is type and crump                      11158
                        4 = overlay or new system call.                    11159
                        5 = Sysout write, sign on if indirect              11160
                                                                           11161
                                                                           11162
                                                                           11163
osys   bss 0                                                               11164
       sta otemp              Construct a branch pointer                   11165
       ldx otemp   2          from calling routine                         11166
       inx -1      2          [make zero also an error]                    11167
       ldx z2+1    3          Get 8K into xr3                              11168
       set pst                Just in case some dummy.......               11169
       bxh 8       2          Check for legal calling number               11170
       bru oterm              and if it isn't, crump the bum               11171
       bru *+1     2          Branch according to calling value            11172
       bru otap               1 = tapes                                    11173
       bru odsk               2 = disk operation                           11174
       bru otype              3 = type routine                             11175
       bru oovr               4 = overlay call                             11176
       bru oso                5 = sysout                                   11177
                        6 and 7 are reserved for special messages to       11178
                        the D-30                                           11179
       bru oterm                                                           11180
       bru oterm                                                           11181
       bru oitrap             10 = Start trap restore                      11182
                                                                           11183
       stl                    Interrupt routine                            11184
       ejt                                                                 11185
                                                                           11186
                        ********************************************       11187
                            This is the entrance for API interrupts        11188
                        during the running of a background system.         11189
                        Interrupt branches are set up whenever the         11190
                        overlay gets word to run the background            11191
                        system.                                            11192
                        On interrupt, the routine has one definite         11193
                        task, and three possible tasks.                    11194
                                                                           11195
                        A) It checks the mailbox for a stop running        11196
                           batch message.  If there is such, it dumps      11197
                           the system and takes necessary action to        11198
                           restore normal time sharing.                    11199
                        B) If there are any disk operation to be           11200
                           done, or just completed, they are executed.     11201
                        C) If there are tape operations to be done,        11202
                           or completed, they are taken care of.           11203
                        D) The overlay checks to see if the running        11204
                           system wants to execute an API program, if      11205
                           so it branches to it.                           11206
                                                                           11207
                        The interrupt routine assumes 8K in xr3 of         11208
                        interrupt group.                                   11209
                                                                           11210
oint   bss 0                  Enter overlay here on API interrupt.         11211
                                                                           11212
       dst oaq     3          Save A and Q                                 11213
       set binmode            Will restore it to decmode if needed         11214
       hcr                    Just on general principles                   11215
       stx otmp    1          Save index register for return               11216
       lda mbx0               Check for D-30 dump command.                 11217
       sub odmp    3          octal 11 - dump batch message.               11218
       bnz                                                                 11219
       bru oint2              No dump message from the D-30                11220
       sta mbx0               Answer D-30 dump command                     11221
       bru odump              and exit                                     11222
oint2  bss 0                  May return here                              11223
       spb odisk   1          Check to see if there are disk commands to be11224
                              executed                                     11225
       spb otape   1          Check to see if there are tape commands to be11226
                              executed                                     11227
       ldz                    Check typewriter input                       11228
       bnr                    If an -S- is input, it is command to stop    11229
       sna 19                 Pick up N-reg character                      11230
       sub ost     3          Subtract BCD -S-                             11231
       bze                                                                 11232
       bru ostop-2            Stop program and look for back card          11233
       sbo                    See if T                                     11234
       bze                                                                 11235
       spb ottim   0          Output running time                          11236
       spb oent1   1          Execute user's API program, if any           11237
       lda otypf   3          Pick up type-of-entry flag.                  11238
                        0 means not special                                11239
                        1 means type message to be set up                  11240
                          also dump for overlay                            11241
                        2 means terminal dump entrance                     11242
       bze                                                                 11243
       bru otin3              No task assigned by this flag [value]        11244
       bod                                                                 11245
       bru odump              Dump in order to type out message........    11246
       bru ostop              Terminal exit so do it                       11247
otin3  ldz                    Check console switches, and if no good, punt 11248
       rcs                                                                 11249
       bmi                                                                 11250
       bru odump                                                           11251
       ldx otmp    1          Get return register                          11252
       lda otmp                                                            11253
       bov                    Reset overflow if on                         11254
       bru *+1                                                             11255
       sla 1                  and start restoring                          11256
       bov                                                                 11257
       ton                    Bit one                                      11258
       sla 1                                                               11259
       bov                                                                 11260
       bru *+1                Ignore DECMODE carry                         11261
       sla 1                                                               11262
       bov                                                                 11263
       set decmode            [Bit 3]                                      11264
       sla 1                  [Bit 4 restore overflow indicator]           11265
       dld oaq     3          conditions                                   11266
       set pst                before                                       11267
       bru 0       1          returning                                    11268
                                                                           11269
       stl                    Batch part 2 - Tape set-up                   11270
       ejt                                                                 11271
                        ********************************************       11272
                            OTAP is entered to place a tape command        11273
                        into the command list.  The commands must be       11274
                        in the format given in subroutine OTAPE, and       11275
                        are never checked for validity.                    11276
                        The index group entered on is destroyed, with      11277
                        the exception of xr1.                              11278
                        The flag words is set to 0 before exiting.  If     11279
                        the list is full, the routine waits until          11280
                        it can insert the task before exiting.             11281
                                                                           11282
otap   bss 0                                                               11283
                                                                           11284
       lda oto     3          Pick up pointer to tape task list            11285
       sta otemp                                                           11286
       ldx otemp   2          Get pointer to tape list in xr2              11287
       lda otlst   2          and check for room in task list              11288
       bnz                                                                 11289
       bru *-2                No room - so wait until there is.            11290
       lda 1       1          Pick up pointer to tape op                   11291
       stx otemp   1                                                       11292
       bpl                                                                 11293
       bru otap0              Indirect                                     11294
       inx 3       1          Set for return, direct                       11295
       lda otemp                                                           11296
       ado                    Get address correct                          11297
otap0  sta otemp                and then                                   11298
       ldx otemp   3              put in xr3 and                           11299
       sta otlst+2 2              tape task list                           11300
       ldz                    Zero the task done flag in user's param list 11301
       sta 3       3                                                       11302
       lda 2       3          Store tape command                           11303
       sta otlst+1 2            in                                         11304
       lda 1       3              the                                      11305
       sta otlst   2                tape task list                         11306
       ldx z2+1    3          Restore up8 bit to xr3                       11307
       inx 4       2          Bump up list pointer                         11308
       stx otemp   2                                                       11309
       lda otemp              Get list pointer back and reset              11310
       bxh 16      2          Check for wraparound = 4 entries             11311
       lda oti     3          Wrap around                                  11312
       sta oto     3          and put away the pointer                     11313
       set prq                set prq in case nothing in operation         11314
       bru 2       1          Return to the user's program                 11315
                                                                           11316
       stl                    Disk set-up                                  11317
       ejt                                                                 11318
                        ********************************************       11319
                                                                           11320
                            ODSK is entered to insert parameters in        11321
                        the disk task list.  An internal wait is           11322
                        made for an opening list location.  Scratch        11323
                        disk areas are assigned here.                      11324
                                                                           11325
odsk   bss 0                                                               11326
       stx odret2  1          Save entrance                                11327
       lda odo     3          Get pointer to task list                     11328
       sta otemp                                                           11329
       ldx otemp   2                                                       11330
       lda odlst   2          See if entry available                       11331
       bnz                                                                 11332
       bru *-2                                                             11333
       lda 1       1          Entry now available                          11334
       sta otemp                                                           11335
       sta odlst+3 2          so get pointer to parameter list             11336
       ldx otemp   1                                                       11337
       ldz                    Set flag-word to zero for user               11338
       sta 3       1                                                       11339
       lda 1       1          Will be memory address for read or write     11340
       sta odlst+1 2                                                       11341
       lda 2       1          Get PRF                                      11342
       bpl                                                                 11343
       bru odsk2              Address given, no scratch area request       11344
       lda odsa    3          Get pointer to scratch list                  11345
       sta otemp                                                           11346
       ldx otemp   3                                                       11347
       lda odsl    3          Get next address from task liust             11348
       bze                    If zero - end of list                        11349
       bru odske              so give error exit                           11350
       inx 1       3          Set up pointer to get next entry next time   11351
       stx otemp   3                                                       11352
       ldx z2+1    3          and restore 8K to xr3                        11353
       sta odlst+2 2          Put address in command list                  11354
       sta 2       1          and also return to exec                      11355
       lda otemp              Now get pointer to scratch list              11356
       sta odsa    3          and put it back                              11357
       bru odsk2+1            and jump around normal put-away              11358
odsk2  bss 0                                                               11359
       sta odlst+2 2                                                       11360
       lda 0       1          Will be RRF or WRF                           11361
       sto otemp              and get record count to be processed         11362
       ldx otemp   0                                                       11363
       bxh 97      0          Disallow anything over 96                    11364
       bru odske              Go set too-many-records flag                 11365
       sta odlst   2                                                       11366
       inx 4       2          Else bump pointer and exit                   11367
       stx otemp   2                                                       11368
       lda otemp                                                           11369
       bxh 16      2          End of list if so                            11370
       lda odi     3          so re-initialize                             11371
       sta odo     3                                                       11372
       set prq                set prq in case nothing going                11373
                                                                           11374
odskx  ldx odret2  1          Get return back                              11375
       bru 2       1          and go back around address word              11376
odske  ldo                    Set too-many-records bit on                  11377
       sla 19-2               Task list stays zero                         11378
       sta 3       1          Flag location                                11379
       bru odskx                                                           11380
                                                                           11381
       stl                    Type routine                                 11382
       ejt                                                                 11383
                        ********************************************       11384
                           OTYPE makes it possible for user programs       11385
                        to type out messages without use of normal         11386
                        time-sharing time, and without having the          11387
                        message garbled by intervening interrupts.         11388
                        When a type command is given, the program is       11389
                        immediately dumped, and not reloaded until         11390
                        the message has been typed out.                    11391
                           The calling aequence for the type routine       11392
                        is as follows -                                    11393
                           lda three                                       11394
                           spb type,1 = 37000                              11395
                           dec message location                            11396
                                                                           11397
                                                                           11398
otype  bss 0                                                               11399
                                                                           11400
       bpl                                                                 11401
       bru otype1                                                          11402
       stx otmp3   1          Save entrance register                       11403
       sta io1                Have front                                   11404
       spb osoter  1          Terminate sysout buffer                      11405
       ldo                    Set up to crump after message                11406
       sta obflg   3                                                       11407
       ldx otmp3   1          Get it back                                  11408
       lda 1       1          move message-to-be-typed to exec             11409
       add omop    3          Z24                                          11410
       sta *+2     3                                                       11411
       dld omtex   3                                                       11412
       mov 0                                                               11413
       lda oeom    3                                                       11414
       sla 12                                                              11415
       sta orune+303                                                       11416
       ldx z2+1    3          Get 8K back into xr3 [when did it leave?]    11417
       set pbk                Break around type setup routine              11418
       lda omtex   3          Get pointer to message for exec              11419
       sta otad    3          and put it in address for res routine        11420
       ldo                                                                 11421
       sta otypf   3          Set up type entrance call for exec           11422
       set pst                and get back in API                          11423
       set prq                set prq                                      11424
       bru 2       1          and return - message is typed.               11425
omtex  dec orune                                                           11426
       dec -30                                                             11427
                                                                           11428
       stl                    Dump                                         11429
       ejt                                                                 11430
                        ********************************************       11431
                                                                           11432
                           ODUMP is entered when the D-30 gives a          11433
                        dump-batchmode message.  It results in the         11434
                        complete dump of a system on tape or the           11435
                        disk, depending on parameters previously           11436
                        specified.  All conditions are save for later      11437
                        restoration.  The 235-exec is then called          11438
                        back in to memory, with the batch flag set.        11439
                        No attempt is made to restore trap mode            11440
                        conditions - thus no system should run in          11441
                        trap mode under background.  [JSM: then what's     11442
                     the purpose of Batch part 3 - Trap Restore?]          11443
                        Disk dump format -                                 11444
                            Four 4K-recods written on high-speed           11445
                            tracks.                                        11446
                        Tape dump format -                                 11447
                            Lower memory in 2 records on tape              11448
                            Upper memory on two 4K disk records.           11449
                                                                           11450
odump  bss 0                                                               11451
                                                                           11452
       lac                                                                 11453
       sub otim2t  3          Accumulate running time                      11454
       add otim2   3                                                       11455
       sta otim2   3                                                       11456
       fst oarr    3          Save AX                                      11457
       xaq         A                                                       11458
       fst oarr+2  3          and QX                                       11459
       lda otmp               [Save location in user's program]            11460
       sta oarr+4  3                                                       11461
       lda onfl    3          [Now save AAU modes--assume]                 11462
       bar bup     7          [normalized floating point to]               11463
       lda ounf    3          [start, then test for un-normalized]         11464
       bzr bfx     7          [and fixed-point modes respectively]         11465
       lda ofix    3                                                       11466
       sta orunm   3          set mode-set in restore sequence             11467
       lda osxg    3          [Preserve index register group]              11468
       oga                                                                 11469
       sta orung   3          Set index-group-restore into restore sequence11470
                                                                           11471
       lda othree  3          Tell D-30 to stop counting                   11472
       spb ospmb   2                                                       11473
odump1 lda otip    3          Wait for any tape operations to be           11474
       sta z2                 completed and corrected before exit          11475
       lda otlst   2                                                       11476
       bpl                                                                 11477
       bru odump2                                                          11478
       spb otop    2          Wait for tapes to come ready                 11479
       dec 0                                                               11480
       spb otape   1          Go to routine until null condition           11481
       bru odump1             and see if done                              11482
odump2 lda odip    3          Make sure disk operation is done             11483
       sta z2                                                              11484
       lda odlst   2                                                       11485
       bze                    If list is zero, no task                     11486
       bru odump3                                                          11487
       ado                    If minus-one then task in progress           11488
       bnz                                                                 11489
       bru odump3                                                          11490
       spb odwrp   1          so finish task                               11491
       bru odump2             and see if done                              11492
odump3 ldx z2+1    0          Wil serve for 0, since is 8K                 11493
       bcr                    Check card reader                            11494
       bru odump4             OK - dump                                    11495
       inx 1       0                                                       11496
       bxl 3000    0          Will give slightly more than u/lth second    11497
       bru *-4                Go check again  [1/12th??]                   11498
odump4 spb odask   2          Ask D-30                                     11499
       lda opar    3                                                       11500
       bze                    If zero, dump on disk, else tapes            11501
       bru oddmp                                                           11502
       spb otop    2          Else dump on tapes                           11503
       z03 0                  Write out around index and mailboxes         11504
odtc   z00 128                Number of words - handler inserted           11505
       spb otop    2                                                       11506
       oct 0300230            Dump beginning word                          11507
odtc2  oct 0017550            Number of words, handler inserted            11508
                        Enter odmp2 to dump upper memory on disk           11509
odmp2  bru *+1                Filled in with SPB OTRAP,1 if necessary      11510
       spb odop    2                                                       11511
       z37 64                 Third 4K block                               11512
       dec 8192                                                            11513
       oct 25100              Disk address                                 11514
       spb odop    2                                                       11515
       z37 64                 Last block                                   11516
       dec 12288              [8192+4096]                                  11517
       oct 25500                                                           11518
       spb odop    2          Get bootstrap for exec                       11519
       z12 1                                                               11520
       dec load1                                                           11521
oo2476 oct 2476                                                            11522
       ldz                                                                 11523
       sta z1                 Set zero into xr1                            11524
       spb odskwt  2          Wait for bootstrap to get in                 11525
       lmo                    Set flag in bootstrap to get ores entrance   11526
       sta sbak               Set flag in exec to indicate batch mode      11527
       lda io1                                                             11528
       sta sbak+1             Front card status                            11529
       set pst                                                             11530
       set pbk                Immediately get out                          11531
       sxg 0                                                               11532
       bru load1                                                           11533
                                                                           11534
oddmp  bss 0                  Dump from disk                               11535
       spb odop    2                                                       11536
       z37 64                 Dump first 4k of memory                      11537
       dec 0                                                               11538
       oct 24100              Address on disk 0                            11539
       spb odop    2          Dump second 4K                               11540
       z37 64                                                              11541
       dec 4096                                                            11542
       oct 24500              Disk position                                11543
       bru odmp2                                                           11544
                                                                           11545
       stl                    Disk routine                                 11546
       ejt                                                                 11547
                                                                           11548
                        ********************************************       11549
                            ODSK is the disk read-write subroutine.        11550
                        It scans a 4-words-per-entry list, executing       11551
                        a given entry if the disk is ready, setting a      11552
                        task done flag if the operation is done, else      11553
                        just returning.                                    11554
                                                                           11555
                                                                           11556
odisk  bss 0                  Process previously built disk task list      11557
       lda odip    3          Get internal pointer to task list            11558
       sta z2                                                              11559
odisk2 dld odlst   2                                                       11560
       bze                                                                 11561
       bru 1       1          No disk task waiting                         11562
       ado                                                                 11563
       bze                                                                 11564
       bru odwrp              Was minus 1, so task in progress             11565
       sbo                                                                 11566
       dst odpb    3          Put commands away                            11567
       lda odlst+2 2                                                       11568
       sta odpb+2  3          and set last instruction                     11569
       lmo                    Preset entry to in-progress                  11570
       sta odlst   2                                                       11571
       lda othree  3          Tell Mike [Busch] to stop couting time       11572
       spb ospmb   2                                                       11573
       spb odask   2          Ask for disk before using                    11574
       lac                                                                 11575
       add otwen   3                                                       11576
       sta odclk   3          Set countdown for disk.                      11577
       nop                                                                 11578
       ddc 0                                                               11579
       org *-3                                                             11580
       spb odop    2                                                       11581
odpb   dec -                                                               11582
       dec -                                                               11583
       dec -                                                               11584
       bze                    Check return status                          11585
       bru odpb1              OK, just get D-30 going again                11586
       ldo                                                                 11587
       sla 19-4               Set illegal address on                       11588
       ory odst    3                                                       11589
odpb1  lda ofour   3          and start counting time                      11590
       spb pspmb   2                                                       11591
odwrp  bcs brr     0          [Check for disk ready]                       11592
       bru odpb2              Skip clock check and disk wait               11593
       lac                    Check for countdown                          11594
       cab odclk   3                                                       11595
       bru 1       1          Not counted down yet                         11596
       nop                                                                 11597
       spb odskwt  2          Dump must have intervened - so get disk      11598
odpb2  bcs ber     0          Now see if read successful                   11599
       bru oderc              If not, correct it                           11600
odwrp2 lda odip    3          Get list pointer again                       11601
       sta z2                                                              11602
       ldz                                                                 11603
       sta odlst   2          Preset task to completed                     11604
       lda odlst+3 2          Get address of status-return word            11605
       sta z2                                                              11606
       lda odst    3          Get disk status word                         11607
       bze                                                                 11608
       ldo                    If AOK, set 1 status                         11609
       sta 3       2                                                       11610
       ldz                                                                 11611
       sta odst    3          and then set disk status to 0 for next       11612
       sta odec    3          and set error count down                     11613
       spb orelin  2          Relinquisk so D-30 can get int               11614
       lda odip    3          Bump up pointer to disk list                 11615
       sta z2                                                              11616
       inx 4       2                                                       11617
       lda z2                                                              11618
       bxh 16      2          Check for wrap-around                        11619
       lda o8K     3                                                       11620
       sta odip    3          and put back for next time                   11621
       bru 1       1                                                       11622
                                                                           11623
oderc  lda odec    3          Error on read                                11624
       ado                                                                 11625
       sta odec    3          Bump up error count                          11626
       cab oseven  3                                                       11627
       bru *+2                Not limit yet                                11628
       bru odte               Too late, give parity message                11629
       ldo                                                                 11630
       sla 19-1               Set parity, but recovered message            11631
       ory odst    3                                                       11632
       lda odpb    3          and restore task list                        11633
       sta odlst   2                                                       11634
       bru odisk2             and try again                                11635
odte   ldz                                                                 11636
       chs                    - indicates non-recovered parity             11637
       ory odst    3                                                       11638
       bru odwrp2             and wrapup as if read was OK                 11639
                                                                           11640
       stl                    Tape routine                                 11641
       ejt                                                                 11642
                                                                           11643
                        ********************************************       11644
                                                                           11645
                            OTAP is the tape operation subroutine.         11646
                        It scans a list of tape operations, executing      11647
                        them as the tape controller comes ready,           11648
                        setting flags as each operation is completed.      11649
                        All error checking, and error messages, are        11650
                        taken care of internally.                          11651
                            The calling sequence to execute a tape         11652
                        operation is as follows -                          11653
                           LDA ONE                                         11654
                           SPB TAPEOP (=37001)                             11655
                           DEC pointer to the parameter list               11656
                        Four-word parameter list has the following         11657
                        form                                               11658
                           SEL x  - tape controller desired                11659
                           Word 1 of tape command -                        11660
                           Word 2 of tape command -                        11661
                           DEC 0                                           11662
                                                                           11663
                        Alternately                                        11664
                           LDO                                             11665
                           SPB EXEC   1                                    11666
                           SEL 1                                           11667
                           word 1                                          11668
                           word 2                                          11669
                           DEC 0    flag                                   11670
                           return                                          11671
                                                                           11672
                                                                           11673
                        When OTAPE is entered, it puts the supplied        11674
                        parameters into a task list, and immediately       11675
                        exits to the user's program, after setting         11676
                        the -DEC 0- word of the calling sequence           11677
                        to 0.  The tape operation is initiated as soon     11678
                        as the tape controller is ready.                   11679
                        When the operation has been completed, the         11680
                        TAPEOP routine will set the -DEC 0- word as        11681
                        follows -                                          11682
                           =  1 if the operation was normally successful   11683
                           =  2 if there was an EOT indication             11684
                           =  4 if there was an EOF indication             11685
                           = 10 if there was a recovered read error        11686
                             which was recovered by changing read modes    11687
                           = 20 if the error was not recoverable           11688
                             after 5 tries at a read or write.             11689
                           = 40 if the instruction caused the tape         11690
                             controller to go permanently not ready.       11691
                                                                           11692
                                                                           11693
                        No other status returns are possible.              11694
                                                                           11695
otape  bss 0                                                               11696
       lda otip    3          Pick up pointer to tape task list.           11697
       sta z2                 and put in xr2                               11698
       dld otlst   2          pick up next list entry                      11699
       bnz                    If so there is an entry                      11700
       bcs rtn     1          See if tapes ready                           11701
       bru 1       1          Either no tasks or tapes not ready           11702
       ado                    See if operation just completed              11703
       bze                    If so - was minus 1                          11704
       bru otwrp              so go set flags and wrap up                  11705
       sbo                    Restore - is real command                    11706
       dst otpb    3          Put in otop calling sequence                 11707
       lmo                    and set entry to task initiated              11708
       sta otlst   2                                                       11709
       nop                    ***                                          11710
       ddc 0                  ***                                          11711
       org *-3                ***                                          11712
       spb otop    2          Execute tape commands                        11713
otpb   dec -                                                               11714
       dec -                                                               11715
       bru 1       1          and exit                                     11716
                                                                           11717
otwrp  bss 0                  Enter here after tape operation completed    11718
       sta otlst   2          and set entry to completed - for now -       11719
       bcs bne     1                                                       11720
       bru otwrp2             No errors                                    11721
       lda otec    3          Check error count                            11722
       sbo                    and decrement                                11723
       sta otec    3                                                       11724
       bnz                                                                 11725
       bru otwrp1             Countdown not done - so try again            11726
       lda otwen   3          Get octal 20 - error flag                    11727
       sta otst    3          and put in status word                       11728
       bru otera              Erase if write or change mode if read        11729
otwrp1 lda otpb    3          Pick up tape command giving error            11730
       sta otlst   2                                                       11731
       spb oter    2          and go correct bad operation                 11732
       bru 1       1                                                       11733
otwrp2 bcs bnf     1          EOF test                                     11734
       bru *+3                No end of file                               11735
       lda ofour   3                                                       11736
       ory otst    3          Put EOF bit on in status word                11737
       bcs bnt     1          Test EOT                                     11738
       bru *+3                No end of tape                               11739
       lda otwo    3          Pick up EOT indicator                        11740
       ory otst    3          and put into status word                     11741
       lda otlst+2 2          Get flag location                            11742
       xaq                    and save                                     11743
       inx 4       2          Point to next list entry                     11744
       lda z2                                                              11745
       bxh 16      2          Four entries in list                         11746
       lda o8K     3          Initialize pointer at 8K                     11747
       sta otip    3          and save pointer to next entry               11748
       xaq                    Get back place to put status                 11749
       sta z2                                                              11750
       lda otst    3          Get status                                   11751
       bze                    and if it is zero                            11752
       ldo                    job completed                                11753
       sta 3       2          and store in user's parameter list           11754
       ldz                    Job completed                                11755
       sta otst    3          Set status word zero,                        11756
       sta oswc    3          set switch mode flag off                     11757
       lda oseven  3          Preset error count to 7                      11758
       sta otec    3          and error count 0                            11759
       bru otape              Now take a look at that next entry           11760
                                                                           11761
                        Output running time on the typewriter              11762
ottim  bss 0                                                               11763
       stx odret   0                                                       11764
       lda otim2   3          Real running time                            11765
       spb ogtim   2                                                       11766
       dec otimr                                                           11767
       spb otyp    2          Set up to be typed                           11768
       dec otimt                                                           11769
       ldo                                                                 11770
       sta otypf   3                                                       11771
       ldx odre    2                                                       11772
       set prq                                                             11773
       bru 1       2                                                       11774
                        [Needs ejt after stl once baseline established]    11775
       stl                    Batch part 2                                 11776
                        ********************************************       11777
                                                                           11778
odlst  bss 0                  Disk task list                               11779
                        Entry 1                                            11780
       dec 0                                                               11781
       dec 0                                                               11782
       dec 0                                                               11783
       dec 0                  Parameter pointer                            11784
                        Entry 2                                            11785
       dec 0                                                               11786
       dec 0                                                               11787
       dec 0                                                               11788
       dec 0                                                               11789
                        Entry 3                                            11790
       dec 0                                                               11791
       dec 0                                                               11792
       dec 0                                                               11793
       dec 0                                                               11794
                        Entry 4                                            11795
       dec 0                                                               11796
       dec 0                                                               11797
       dec 0                                                               11798
       dec 0                                                               11799
otlst  bss 0                  Tape task list                               11800
                        Entry 1                                            11801
       dec 0                                                               11802
       dec 0                                                               11803
       dec 0                                                               11804
       dec 0                                                               11805
                        Entry 2                                            11806
       dec 0                                                               11807
       dec 0                                                               11808
       dec 0                                                               11809
       dec 0                                                               11810
                        Entry 3                                            11811
       dec 0                                                               11812
       dec 0                                                               11813
       dec 0                                                               11814
       dec 0                                                               11815
                        Entry 4                                            11816
       dec 0                                                               11817
       dec 0                                                               11818
       dec 0                                                               11819
       dec 0                                                               11820
                                                                           11821
                                                                           11822
                            OSTOP is entered if an S is typed on the       11823
                        console typewriter while a batch program is        11824
                        running.  The result is the complete abortion      11825
                        of this program, and restoration of normal         11826
                        batch mode.                                        11827
                                                                           11828
ostop0 ldo                    Set flag to look for BACK card               11829
       sta io1                                                             11830
ostop  bss 0                                                               11831
       lac                    Accumulate running time                      11832
       sub otim2t  3                                                       11833
       add otim2   3          Accumulate actual running time               11834
       sta otim2   3                                                       11835
                                                                           11836
       ldo                    Set flag in overlay to tell -ORES- same      11837
       sta obflg   3          Tell ORES batch job done.                    11838
       lda othree  3          and now tell D-30 to stop counting           11839
       spb ospmb   2                                                       11840
       spb odask   3          Get disk                                     11841
       bru odmp2              and enter in middle of dump routine.         11842
                                                                           11843
odmp   oct -11                Dump-batch message from D-30                 11844
otst   dec 0                  Used to hold tape status word return         11845
otec   dec 7                  Tape error count - initialize at seven       11846
oarr   bss 6                  Storage for dump {=swap]                     11847
oeom   oct 55                 End-of-message character for type routine    11848
osxg   sxg 0                                                               11849
ounf   set uflpoint                                                        11850
ofix   set fixpoint                                                        11851
ofnl   set nflpoint                                                        11852
odip   dec 8192               Internal pointer to API disk taks list       11853
odst   dec 0                  Holds disk status for system subroutine      11854
otip   dec 8192               Points to tape list command (iternal)        11855
odo    dec 8192               Pointer to disk task list                    11856
oto    dec 8192               Pointer to tape task list                    11857
odsl   bss 0                  List of scratch area addresses on disk       11858
       oct 30000                                                           11859
       oct 30400                                                           11860
       oct 31000                                                           11861
       oct 31400                                                           11862
       dec 0                  Only 4 areas available -                     11863
       bss 4                  (More can be put here - last must be a 0)    11864
odsa   dec 8192               Pointer to scratch area being supplied       11865
odclk  dec 0                  Count down on disk with real clock - svd here11866
                                                                           11867
       loc 6000                                                            11868
area   eqo 36000                                                           11869
oba2m  ldx 8K      3                                                       11870
       lda oba3+2                                                          11871
       sta oloba3+23                                                       11872
       bru *+3                                                             11873
       dec execov                                                          11874
       dec -512                                                            11875
       dld *-2                                                             11876
       mov area               Move                                         11877
                        Read exec back in                                  11878
       bcs brn     0                                                       11879
       bru *-1                                                             11880
oba2n  sel 0                                                               11881
       prf         0                                                       11882
       oct 2600               Get exec                                     11883
       bcs brn     0                                                       11884
       bru *-1                                                             11885
       sel 0                                                               11886
       rrf 8       0                                                       11887
           area                                                            11888
       bcs brn     0                                                       11889
       bru *-1                                                             11890
       bcs ber     0                                                       11891
       bru oba2n                                                           11892
       bru lovwrt             Now write on disk                            11893
                                                                           11894
       tcd oba2m                                                           11895
                                                                           11896
       stl                    Batch part 3 - Trap restore                  11897
       ejt                                                                 11898
       org pernum                                                          11899
       dec 36                                                              11900
       dec oba3                                                            11901
                                                                           11902
                                                                           11903
       loc 34600                                                           11904
                        Restore for trap                                   11905
                        Must put hold indicators back and get into         11906
                        trap program if necessary                          11907
                                                                           11908
ortrap stx otmp2   1          Save entrance                                11909
       lda z2+1               Get 8K bit                                   11910
       sta tx2+1              Set in trap register                         11911
       lda .orst.  3          Set for trap                                 11912
       sta itrap-1                                                         11913
       sta itrap                                                           11914
       sta itrap+1                                                         11915
       lda otrfl   3          Get indicator flag                           11916
       sta z1                                                              11917
       set fixpoint           Make it easy to get a trap                   11918
       bru *+1     1          Now see what has to be restored              11919
       bru ortrp              In trap[mode] program                        11920
       bru ortri              Not in trap program                          11921
       set ntpmode            Trap not set                                 11922
                                                                           11923
ocrest spb ohold   2          Restore hold indicators                      11924
       dld omovt2  3          Restore trap registers                       11925
       mov ostrp                                                           11926
       ldx otmp2   1          Get back to rest of restore                  11927
       bru 1       1                                                       11928
                        In trap program                                    11929
ortrp  set trpmode            Fudge way into trap                          11930
       fdv ozero   3          Generate trap                                11931
       set pst                Get out of API                               11932
       set pbk                                                             11933
       bru *+1     3                                                       11934
orstb  rin                    Enter from self-caused trap                  11935
       lda .orex.  3          have to get back in API                      11936
       sta z2+2               Fudge entrance                               11937
       set pst                                                             11938
       set prq                set prq                                      11939
                                                                           11940
orex   lda oapib   3          Get API branch back                          11941
       sta z2+2                                                            11942
       bru ocrest             and continue with restore                    11943
                                                                           11944
ortri  spb ohold   2          Not in trap program when interrupted         11945
       set trpmode            Restore hold indicators and set trap         11946
       bru ocrest+1           and leave                                    11947
                                                                           11948
ohold  lda otimfl  3          Mode flag                                    11949
       sta z1                                                              11950
       bru *+1     1                                                       11951
       bru 1       2          None on                                      11952
       bru oocov              Overflow hold on                             11953
       bru ocun               Underflow hold on                            11954
       fdv zero    3          Divide check on                              11955
       bru 1       2          Get out                                      11956
                                                                           11957
oocov  fld oocov1  3          overflow hold on                             11958
       fad oocov1  3          1777777.1777777                              11959
       bru 1       2          Leave                                        11960
oocov1 oct 1777777                                                         11961
       oct 1777777                                                         11962
ocun   fld ocun1   3          Underlow on                                  11963
       fad ocun1   3          2000000.2000000                              11964
       bru 1       2          and exit                                     11965
ocun1  oct 2000000                                                         11966
       oct 2000000                                                         11967
ozer   ddc 0                                                               11968
omovt1 dec ostrp                                                           11969
       dec -7                                                              11970
omovt2 dec itrap-1                                                         11971
       dec -7                                                              11972
otrfl  bss 1                  Trap flag                                    11973
otimfl bss 1                  Mode flag                                    11974
.otrs] spb tx2     0                                                       11975
.otrs. bru otrs    3                                                       11976
.otri. bru otri    3                                                       11977
.otra. spb otrap   1                                                       11978
.ortr. spb ortrap  1                                                       11979
Error: index field overlaps next field
.orst.:spb bru orstb,3
                   ^
.orex. bru orex    3                                                       11981
ostrp  bss 7                  Trap save                                    11982
                                                                           11983
       stl                    Batch 3 - part of initial start              11984
       ejt                                                                 11985
                        Continuation of ORUNF in OBA1                      11986
                        Sets up for proper loader and dump                 11987
orun.3 ldo                                                                 11988
       sta cmessb             Reset                                        11989
       ldx t+4     1          Get parameters from catalog                  11990
       lda odad    1          Type of loader                               11991
       sta orun30+13                                                       11992
       lda odad+1  1          Loader address                               11993
       sta orun30+23                                                       11994
       lda odad+2  1                                                       11995
       sta orun30+33                                                       11996
orun30 spb odop    2          Disk operation to get loader                 11997
       dec -                                                               11998
       dec -                                                               11999
       dec -                                                               12000
       lda bdc                Get dump load info                           12001
       sta opar    3          0 if on disk, handler bits if                12002
       ory oltc    3          on tape                                      12003
       ory oltc2   3                                                       12004
       ory odtc    3                                                       12005
       ory odtc2   3                                                       12006
       lac                                                                 12007
       sta otim2t  3                                                       12008
       spb orelin  2          Give back disk                               12009
       sxg 0                  Set group zero for loader entrance           12010
       lda odect   3          Pointer to parameter list                    12011
       sta 2                  for loader                                   12012
       ldx t+4     1          Loader address                               12013
       lda odad+1  1          Address from disk read                       12014
       sta z1                                                              12015
       set pst                out of API and                               12016
       bru 0       1          to loader                                    12017
                                                                           12018
odect  dec t                  Address of t-array                           12019
                                                                           12020
                        Initialize branches to trap routines               12021
oitrap lda .otra.  3          Get start                                    12022
       sta odmp2   3          Put in correct SPB                           12023
       lda .ortr.  3          Restore                                      12024
       sta oruna   3                                                       12025
       bru 1       1          Back to guy's program                        12026
                                                                           12027
       stl                    Sysout                                       12028
       ejt                                                                 12029
       loc 35000                                                           12030
                                                                           12031
                        Sysout buffers                                     12032
                                                                           12033
osbuf1 bss 110                                                             12034
osbuf2 bss 110                                                             12035
                                                                           12036
                                                                           12037
                        Sysout routine                                     12038
                        Entrance on xr-1, A-reg minus if indirect -        12039
                        plus if direct.  First two words are sysout        12040
                        control words, third word is address of data       12041
                                                                           12042
                                                                           12043
                        Regular entrance is to here                        12044
                                                                           12045
oso    ldx z2+1    3          Get 8K bit                                   12046
       bpl                    See if direct or indirect                    12047
       bru oso1               direct                                       12048
       lda 1       1          Get pointer in A                             12049
       inx 2       1          Return in 1                                  12050
       bru oso2               Skip indirect                                12051
oso1   inx 1       1          Step to parameter                            12052
       stx odret2  1                                                       12053
       lda odret2             Get pointer in A                             12054
       inx 3       1          step pointer for return                      12055
oso2   sta osop    3          Save pointer permanently                     12056
       sta odret2                                                          12057
       ldx odret2  2          Get in 2                                     12058
       stx odret2  1          Get return                                   12059
       lda odret2                                                          12060
       sta osor    3          and put where it belongs                     12061
       lda 0       2          xr-2 has pointer to list                     12062
       sta osobl   3          Save parameter in my list                    12063
       lda 1       2                                                       12064
       sta osobl+1 3                                                       12065
       lda 2       2                                                       12066
       sta osobl+2 3                                                       12067
       lda osobp   3          Get location to put in                       12068
       add osobw   3                                                       12069
       sta odret2                                                          12070
       ldx odret2  1          Address to move to                           12071
       dld osobl   3                                                       12072
       sta 0       1                                                       12073
       xaq                                                                 12074
       sta 1       1          Control words stored                         12075
       ext omw     3          3777600                                      12076
       sta osobw1  3          Number of words to write                     12077
       cab od110   3          See if legal length                          12078
       bru oso3                                                            12079
       bru oso3                                                            12080
       bru osore              Exit                                         12081
oso3   lda osobw   3                                                       12082
       add otwo    3                                                       12083
       sta osobw   3          Increment word count                         12084
       add osobw1  3                                                       12085
       cab od110              dec 110                                      12086
       bru osok               Just move in                                 12087
       bru osok                                                            12088
                                                                           12089
                        Length too great for one buffer, so split.         12090
                        Change number of words and address and then        12091
                        write.                                             12092
                                                                           12093
       sub od110   3          Get number of excess words                   12094
       sta osobw2  3          Save for next operation                      12095
       sub osobw1  3          Get number to move                           12096
       lqa                    Set up to move                               12097
       neg                                                                 12098
       add osobl+2 3          Save new address to write from next time     12099
       sta otmp1              Save for awhile                              12100
       lda osobl+2 3          From address                                 12101
       ada omop    3                                                       12102
       sta *+3     3                                                       12103
       lda osobp   3                                                       12104
       add osobw   3                                                       12105
       mov *                  Constructed                                  12106
       lda od110   3                                                       12107
       sta osobw   3          For tape write                               12108
       lda osobw2  3                                                       12109
       sta osobw1  3          Set to finish operation                      12110
       lda otmp1                                                           12111
       sta osobl+2 3          New address                                  12112
       bru osowr              Write it                                     12113
                                                                           12114
                        Room to plunk in present buffer                    12115
                                                                           12116
osok   lda osobw   1                                                       12117
       neg                                                                 12118
       xaq                    Set for move                                 12119
       lda osobl+2 3          From address                                 12120
       add omop    3          Z24                                          12121
       sta *+3     3          Put in move command                          12122
       lda osobp   3                                                       12123
       add osobw   3                                                       12124
       mov *                  Constructed                                  12125
       lda osobw   3                                                       12126
       add osobw1  3                                                       12127
       sta osobw   3          Reset word count                             12128
       cab od108   3                                                       12129
       bru osore              Do not need to write out yet                 12130
       bru osore                                                           12131
       ldz                                                                 12132
       sta osobw1  3          Reset words to write                         12133
       bru osowr              Must write out, can not split control words  12134
                                                                           12135
                        Time to write tape.  After finished switch         12136
                        buffers if other one ready.                        12137
                                                                           12138
osowr  dld osotp   3          Pointer to next tape list                    12139
       sta odret2                                                          12140
       sta osowr1+13                                                       12141
       xaq                                                                 12142
       dst osotp   3          Switch for next time                         12143
       ldx odret2  2                                                       12144
       dld osobp   3                                                       12145
       sto 1       2          Put address in                               12146
       xaq                                                                 12147
       dst osobp   3          Flip buffer                                  12148
       lda osobw   3          Word count                                   12149
       bze                                                                 12150
       bru osok               Punt if zero                                 12151
       sto 2       2          put away                                     12152
       ldo                                                                 12153
osowr1 spb exec    1          Write tape                                   12154
       dec 0                  Constructed                                  12155
       ldz                                                                 12156
       sta osobw   3          Set buffer count to zero                     12157
                        Now check to see if the other buffer is ready      12158
       lda osotp   3                                                       12159
       sta odret2                                                          12160
       ldx odret2  2                                                       12161
       lda 3       2          Get flag word                                12162
       bze                    Wait till tape operation done                12163
       bru *-2                                                             12164
       bod                                                                 12165
       bru osok               Buffer OK to fill                            12166
       sra 1                                                               12167
       bod                                                                 12168
       bru osoeot             End of tape, change them                     12169
       bru osok                                                            12170
                                                                           12171
                                                                           12172
                        End of tape occurred, write record and rewind,     12173
                        then switch tape.                                  12174
                                                                           12175
osoeot ldo                                                                 12176
       spb exec    1                                                       12177
       sel 1                                                               12178
       wtb osyet   7          End tape record                              12179
           13                                                              12180
       dec 0                                                               12181
       ldo                                                                 12182
       spb exec    1                                                       12183
       sel 1                                                               12184
       rwd         7                                                       12185
       dec 0                                                               12186
       ldz                    If we get this far make sure dump is on      12187
       sta opar    3          the disk                                     12188
                                                                           12189
                        Wait until next tape is mounted                    12190
       lda othree  3                                                       12191
       spb exec    1                                                       12192
       dec osoty              Toggle 19 when sysout tape is ready          12193
       ldz                                                                 12194
       rcs                                                                 12195
       bev                                                                 12196
       bru *-3                                                             12197
       ldz                                                                 12198
       rcs                                                                 12199
       bod                                                                 12200
       bru *-3                                                             12201
       bru osok                                                            12202
                                                                           12203
                        Enter here to write out sysout buffer              12204
osoter stx otmp2   1          Save entrance                                12205
       lda odter1  3                                                       12206
       sta osor    3          Set up to return correctly                   12207
       bru osowr              Write out                                    12208
oster1 lda osot1+3 3          Make sure done                               12209
       bze                                                                 12210
       bru *-2                                                             12211
       lda osot2+3 3                                                       12212
       bze                                                                 12213
       bru *-2                                                             12214
       ldx otmp2   1          All done so get out                          12215
       bru 1       1                                                       12216
                                                                           12217
odter1 dec oster1                                                          12218
                                                                           12219
                        Enter here to return to user's program             12220
                                                                           12221
osore  lda osor    3          Return address                               12222
       sta odret2                                                          12223
       ldx odret2  1                                                       12224
       bru 0       1          Get back                                     12225
                                                                           12226
                        Flip-flop constants                                12227
                                                                           12228
osobp  dec osbu1                                                           12229
       dec osbu2                                                           12230
osobw  dec 0                  Number of words in use in buffer             12231
osobl  dec 0                  User's parameter list                        12232
       dec 0                                                               12233
       dec 0                                                               12234
osobw1 dec 0                  Words to write                               12235
osobw2 dec 0                  used if overflow                             12236
osotp  dec osot1              Next tape list to use                        12237
       dec osot2                                                           12238
osdp   bss 1                  Pointer to user's info                       12239
osor   bss 1                  Return address                               12240
osyet  oct 21                                                              12241
od100  dec 100                                                             12242
od108  dec 018                                                             12243
omw    oct 3777600                                                         12244
osot1  sel 1                  Dummy parameter list actual parameters are   12245
       z03 0       1                                                       12246
       z30 0                                                               12247
       dec 1                  Initialize flag to 1                         12248
osot2  sel 1                  Dummy parameters                             12249
       z03 0       1                                                       12250
       z30 0                                                               12251
       dec 1                                                               12252
                                                                           12253
                        New s/o tg 19                                      12254
osoty  alf NEW                                                             12255
       alf  S/                                                             12256
       alf O T                                                             12257
       alf G 1                                                             12258
       oct 113755                                                          12259
                                                                           12260
       stl                    Trap save                                    12261
       ejt                                                                 12262
                        Save trap conditions                               12263
                                                                           12264
otrap  stx otmp2   1          Save entrance                                12265
       dld omovt1  3          Save trap locations                          12266
       mov itrap-1                                                         12267
       sta xr312              Initialize register to 0                     12268
       lda z2+1               Get 8K bit                                   12269
       sta tx2+1              put in for trap                              12270
       sta xr312+1                                                         12271
       lda .otrs.  3                                                       12272
       sta tx2                Branch for simultaneous interrupts           12273
       lda .otrs]  3          but you have to get there first              12274
       sta itrap-1                                                         12275
       sta itrap                                                           12276
       sta itrap+1                                                         12277
                        Now see how fouled up trap is                      12278
                                                                           12279
                        Save hold indicators                               12280
       ldz                    Zero if none                                 12281
       bar boo     7                                                       12282
       ldo                    Overflow hold on                             12283
       bar buo     7                                                       12284
       lda otwo    3          Underflow hold on                            12285
       bar bdc     7                                                       12286
       lda othree  3          Divide check on                              12287
       add z2+1               Set upper 8K bit                             12288
       sta otmifl  3          Trap indicator flag                          12289
                                                                           12290
       sxg 31                 Get into group away from punch               12291
       set pst                Get out of API                               12292
       set pbk                                                             12293
       bru *+1     3          If simultaneous trap, then program           12294
       spb *+1     2          will go to OTRS, else here                   12295
       lda xr312              See if in trap program                       12296
       bnz                                                                 12297
       bru otrchk             Not in trap program, but see if it is set    12298
                                                                           12299
                        OBTEX sets a flag as follows                       12300
                           0 - in trap program                             12301
                           1 - trap mode set                               12302
                           2 - trap mode not set                           12303
                                                                           12304
obtex  add z2+1                                                            12305
       sta otrfl   3          Trap flag for restore                        12306
       rin                    Do not foul anyone else                      12307
       set trpmode                                                         12308
       set ntpmode                                                         12309
       bru *+1     3          Get out of trap program if in one            12310
                        Have to get back into API                          12311
       lda otmp2              So set up return                             12312
       sta z2                                                              12313
       lda *+4     3          Bru 1,2                                      12314
       sta z2+2                                                            12315
       set pst                                                             12316
       set prq                and interrupt to go there                    12317
                                                                           12318
       bru 1       2          constant for OBTEX                           12319
                                                                           12320
                                                                           12321
otrs   lda oarr+4  3          Simultaneous trap and interrupt              12322
       sta ostrp+4 3          Set trap register 1                          12323
                        Following works because in lower memory            12324
       lda tx2-2              Get register 0                               12325
       sto oarr+4  3                                                       12326
       ldz                                                                 12327
       bru obtex                                                           12328
                                                                           12329
otrchk lda .otri.  3          See if trap[mode] set                        12330
       sta itrap+1            If set, a branch to OTRI will occur          12331
       set fixpoint           Make sure FDV will trap                      12332
       fdv ozero   3                                                       12333
       lda otwo    3          [Trap did not occur, land here]              12334
       bru obtex                                                           12335
                                                                           12336
otri   ldo                    [Trap did occur, land here]                  12337
       bru obtex                                                           12338
                                                                           12339
       stl                    Batch part 3 - overlay call and terminal exit12340
       ejt                                                                 12341
                             Overlay calling entrance - code is            12342
                        4 in A register, and SPB must be followed          12343
                        by a 4-word alphabetic name for the overlay        12344
                        desired.  The routine destroys index groups        12345
                        1 and 2 and the T-array in the user's program      12346
oovr   inx 1       1          Get pointer to list                          12347
       stx odret2  2                                                       12348
       lda odret2                                                          12349
       sxg 0                                                               12350
       ldx z2+1    3                                                       12351
       sta oovrp   3          Store in pointer                             12352
       spb osoter  1          Terminate sysout buffer                      12353
oovr1  lda otwo    3          Disk operation                               12354
       spb exec    1                                                       12355
       dec ovlst2                                                          12356
       lda ovlst2+33                                                       12357
       bze                                                                 12358
       bru *-2                                                             12359
       bev                    Wait till get a one                          12360
       bru oovr1                                                           12361
       bru ovsc               Go to overlay scan                           12362
ovlst2 z12 7                  7 records                                    12363
       oct 35000                                                           12364
       oct 0                  From                                         12365
       dec 0                                                               12366
                                                                           12367
oovrp  bss 1                                                               12368
                                                                           12369
                        Terminal exit                                      12370
oterm  spb osoter  1          Terminate sysout buffer                      12371
       lda otwo    3          Set job-done code into API entrance flag     12372
       sta otypf   3                                                       12373
       lmo                                                                 12374
       sta io1                Have front                                   12375
       set prq                                                             12376
       bru *-1                Just in case get a return                    12377
                                                                           12378
                        Restore for OBA3                                   12379
       loc 6000                                                            12380
oba3m  ldx 8K      3                                                       12381
       lda oba4+2                                                          12382
       sta ovlst2+23          Initialize disk address                      12383
       dld oba3m1                                                          12384
       mov ortrap             Get trap routine with overlay                12385
       bru *+3                                                             12386
       dec execov                                                          12387
       dec -512                                                            12388
       dld *-2                                                             12389
       mov ovcat              Move to 37000                                12390
                        Read exec back in                                  12391
       bcs brn     0                                                       12392
       bru *-1                                                             12393
oba3m0 sel 0                                                               12394
       prf         0                                                       12395
       oct 2554               0 5 54                                       12396
       bcs brn     0                                                       12397
       bru *-1                                                             12398
       sel 0                                                               12399
       rrf 10      0                                                       12400
           ortrap                                                          12401
       bcs brn     0                                                       12402
       bru *-1                                                             12403
       bcs ber     0                                                       12404
       bru oba3m0                                                          12405
       bru lovwrt             Now write on the disk                        12406
                                                                           12407
oba3m1 dec osbu1                                                           12408
       dec -128                                                            12409
                                                                           12410
       tcd oba3m                                                           12411
                                                                           12412
       stl                    Batch part 4 - overlay scan                  12413
       ejt                                                                 12414
                                                                           12415
       org pernum                                                          12416
       dec 38                                                              12417
       dec oba4                                                            12418
       loc 35000                                                           12419
                                                                           12420
ovcat  bss 256                Space to read in catalog                     12421
                                                                           12422
                        Overlay lengths are critical.                      12423
                        OBA4 can only be 7 records long because it is      12424
                        called from the last record of OBA3.  Also the     12425
                        Disk Image Loader can only be 6 records long       12426
                        because it is called from the 35600 part of        12427
                        this overlay.                                      12428
                                                                           12429
                        Start of scan for overlay                          12430
                        Executed in group zero                             12431
                                                                           12432
ovsc   lda oovrp   3                                                       12433
       add omop    3          Move                                         12434
       sta *+2     3                                                       12435
       dld ocov    3          Move to OVCT array                           12436
       mov *                                                               12437
       lda ocata   3                                                       12438
       add otwo    3                                                       12439
       sta ovlst1+23          Disk address                                 12440
ovs1.1 lda otwo    3                                                       12441
       spb exec    1                                                       12442
       dec ovlst1             Pointer to parameters                        12443
       lda ovst1+3 3                                                       12444
       bze                                                                 12445
       bru *-2                                                             12446
       bev                                                                 12447
       bru ovs1.1                                                          12448
       ldx z2+1    2                                                       12449
ovs1.2 dld ovcat   2          Scan catalog                                 12450
       bze                                                                 12451
       bru opunt              Not in catalog, so terminal exit             12452
       dcb ovct    3          Check first two words                        12453
       bru ovs1.3                                                          12454
       bru ovsc2              Check next two                               12455
ovs1.3 inx 8       2                                                       12456
       bxh 256     2          See if done with record                      12457
       bru ovsc3              get next one                                 12458
       bru ovs1.2             Look at next record [entry?]                 12459
ovsc2  ldl ovcat+2 2                                                       12460
       bmi                                                                 12461
       bru ovs1.4             Minus so just check first two                12462
       dcb ovct+2  3          Check second two                             12463
       bru ovs1.3             no match                                     12464
       bru ovs1.4                                                          12465
       bru ovs1.3                                                          12466
ovs1.4 inx ovcat+4 2                                                       12467
       lda 0       2                                                       12468
       sta 1                                                               12469
       bru *+1     1                                                       12470
       bru opunt              [0] Not allowed from overlay call            12471
       bru opunt              [1] Not allowed from overlay call            12472
       bru opunt              [2] Not allowed from overlay call            12473
       bru opunt              [3] Not allowed from overlay call            12474
       bru opunt              [4] Not allowed from overlay call            12475
       bru opunt              [5] Not allowed from overlay call            12476
       bru opunt              [6] Not allowed from overlay call            12477
       bru ovsc4                                                           12478
ovsc3  lda ovlst1+23          Get next 4 catalog records                   12479
       add ov8     3                                                       12480
       sta ovlst1+23                                                       12481
       bru ovs1.1             and read it in                               12482
                                                                           12483
                        Gets correct loader for system                     12484
ovsc4  lda 2                                                               12485
       ado                                                                 12486
       add omop    3          Move to T-array                              12487
       sta *+2     3                                                       12488
       dld ocov1   3                                                       12489
       mov *                                                               12490
                        Go to OBA to get loader and system                 12491
                        Fudge API entrance                                 12492
       set pbk                                                             12493
       lda z2+2                                                            12494
       sta z0                                                              12495
       lda ovapi   3          Fudge API branch                             12496
       sta z2+2                                                            12497
       set prq                set prq                                      12498
       set pst                                                             12499
       nop                                                                 12500
ovsc5  lda z0                                                              12501
       sta z2+2               Restore old API branch                       12502
       bru orunf2             Get loader                                   12503
                                                                           12504
                        Someone goofed, terminal exit                      12505
opunt  ldo                                                                 12506
       sta io1                Look for BACK card                           12507
       lda otwo    3          Set up terminal exit                         12508
       sta otypf   3                                                       12509
       set prq                [Request] interrupt                          12510
       bru *-1                                                             12511
                                                                           12512
ov8    dec 8                                                               12513
ocov1  dec ovct+4                                                          12514
       dec -3                                                              12515
ovlst1 bss 0                                                               12516
       z12 4                  Read 4 records                               12517
       oct 35000              into 35000                                   12518
       oct 0                  disk address                                 12519
       dec 0                  flag                                         12520
ocata  oct 0                  Address of catalog - filled in in load       12521
ovapi  bru ovsc5   3                                                       12522
                                                                           12523
                        This reads in the overlay after it has been        12524
                        found in the catalog.  It is almost the same       12525
                        as ORUNF.                                          12526
                                                                           12527
       loc 35600                                                           12528
orunf2 lda ovct+4  3          Get out of the way of the loader             12529
       sta z1                                                              12530
       spb odask   2          Get the disk                                 12531
       lda odad    1          Pick up                                      12532
       sta orunf3+13          loader disk address                          12533
       lda odad+1  1          and set in parameter list                    12534
       sta orunf3+23                                                       12535
       lda odad+2  1                                                       12536
       sta orunf3+33                                                       12537
orunf3 spb odop    2                                                       12538
       dec -                                                               12539
       dec -                                                               12540
       dec -                                                               12541
       spb orelin  2          Relinquish - read next may be from tape      12542
       sxg 0                  Set group zero for loader entrance           12543
       lda ocov    3          Pick up pointer to parameter list            12544
       sta 2                  and put where loader can get at it.          12545
       lda orunf3+23          Gives address from disk read                 12546
       sta z1                                                              12547
       set pst                Exit API mode                                12548
       bru 0       1          and exit to loader                           12549
                                                                           12550
ovct   bss 7                  T-array for overlay calls                    12551
                                                                           12552
ocov   dec ovct                                                            12553
       dec -4                                                              12554
                                                                           12555
exec   eqo 37001                                                           12556
                                                                           12557
                        Restore routine for OBA4                           12558
                                                                           12559
       loc 6000                                                            12560
oba4m  ldx 8K      3                                                       12561
       lda ocat+2                                                          12562
       sta ocata   3          Initialize disk address                      12563
       ldz                    Zero buffer area                             12564
       sta ovcat   3                                                       12565
       bru *+3                                                             12566
       dec ovcat+1                                                         12567
       dec -255                                                            12568
       dld *-2                                                             12569
       mov ovcat                                                           12570
       nop                                                                 12571
       bru *+3                                                             12572
       dec execov                                                          12573
       dec -512                                                            12574
       dld *-2                                                             12575
       mov ovcat              Move to 37000                                12576
                        Read exec back in                                  12577
       bcs brn     0                                                       12578
       bru *-1                                                             12579
oba4mo sel 0                                                               12580
       prf         0                                                       12581
       oct 2560               Address 0 5 56                               12582
       bcs brn     0                                                       12583
       bru *-1                                                             12584
       sel 0                                                               12585
       rrf 10      0                                                       12586
           ovcat                                                           12587
       bcs brn     0                                                       12588
       bru *-1                                                             12589
       bcs ber     0                                                       12590
       bru oba4m0                                                          12591
       bru lovwrt             Now write overlay on the disk                12592
                                                                           12593
       tcd oba4m                                                           12594
                                                                           12595
       stl                    Background card catalog                      12596
       ejt                                                                 12597
       org pernum                                                          12598
       dec 40                                                              12599
       dec ocat                                                            12600
                                                                           12601
                                                                           12602
       org execov                                                          12603
                                                                           12604
                        Disk addresses available for systems               12605
       oct 40000                                                           12606
       oct 0                                                               12607
       oct 40400                                                           12608
       oct 0                                                               12609
       oct 41000                                                           12610
       oct 0                                                               12611
       oct 41400                                                           12612
       oct 0                                                               12613
       oct 42000                                                           12614
       oct 0                                                               12615
       oct 42400                                                           12616
       oct 0                                                               12617
       oct 43000                                                           12618
       oct 0                                                               12619
       oct 43400                                                           12620
       oct 0                                                               12621
       oct 44000                                                           12622
       oct 0                                                               12623
       oct 44400                                                           12624
       oct 0                                                               12625
       oct 45000                                                           12626
       oct 0                                                               12627
       oct 45400                                                           12628
       oct 0                                                               12629
       oct 46000                                                           12630
       oct 0                                                               12631
       oct 46400                                                           12632
       oct 0                                                               12633
       oct 47000                                                           12634
       oct 0                                                               12635
       oct 47400                                                           12636
       oct 0                                                               12637
       oct 50000                                                           12638
       oct 0                                                               12639
       oct 50400                                                           12640
       oct 0                                                               12641
       oct 51000                                                           12642
       oct 0                                                               12643
       oct 51400                                                           12644
       oct 0                                                               12645
       dec -1                                                              12646
                                                                           12647
                        Catalog of card types ---------------              12648
                                                                           12649
                        Each entry to the catalog is 8 words long.         12650
                        The first 4 words consist of the alphanumeric      12651
                        system name, with blanks replaced by zeroes.       12652
                           The fifth word is a transfer to the             12653
                        excecutive subroutine which processes this         12654
                        type of card.  [Revised--see below]                12655
                           The rest of the information is peculiar         12656
                        to the type of card the entry corresponds to       12657
                        and may consist of disk address, loader names      12658
                        etc., etc.                                         12659
                        The catalog search is terminated upon finding      12660
                        a 0-entry, or wrapping around memory.              12661
                                                                           12662
                        The fifth word of ech catalog entry is used        12663
                        for an indexed branch as follows.                  12664
                                                                           12665
                        BBACK  20001                                       12666
                        BINT2  20002                                       12667
                        BINT   20003                                       12668
                        BTYPE  20004                                       12669
                        BRWND  20005                                       12670
                        BLSEW  20006                                       12671
                        BEXT   20007                                       12672
                                                                           12673
       org excv+64                                                         12674
                                                                           12675
       alf BAC                BACK card                                    12676
       alf K00                                                             12677
       alf 000                                                             12678
       alf 000                                                             12679
       oct 20001                                                           12680
       dec 0                                                               12681
       dec 0                                                               12682
       dec 0                                                               12683
                                                                           12684
       alf LIS                List deck                                    12685
       alf TDE                                                             12686
       alf CK0                                                             12687
       alf 000                                                             12688
       oct 20002                                                           12689
       oct 456237             N,S,CR - indiates to C/P overlay, no trans.  12690
       alf C/P                                                             12691
       dec 0                                                               12692
                                                                           12693
       alf LIS                List deck T (translated)                     12694
       alf TDE                                                             12695
       alf CKT                                                             12696
       alf 000                                                             12697
       oct 20002                                                           12698
       oct 636237             T,S,CR                                       12699
       alf C/P                                                             12700
       dec 0                                                               12701
                                                                           12702
       alf LIS                List GAP assembly                            12703
       alf TGA                                                             12704
       alf PAS                                                             12705
       alf SEM                                                             12706
       oct 20003                                                           12707
       alf G/P                                                             12708
       dec 0                                                               12709
       dec 0                                                               12710
                                                                           12711
       alf REP                Reproduce                                    12712
       alf ROD                                                             12713
       alf UCE                                                             12714
       alf 000                                                             12715
       oct 20003                                                           12716
       alf C/C                                                             12717
       dec 0                                                               12718
       dec 0                                                               12719
                                                                           12720
       alf CAR                Card to tape                                 12721
       alf DTO                                                             12722
       alf TAP                                                             12723
       alf E00                                                             12724
       oct 20002                                                           12725
       oct 370000             CR                                           12726
       alf C/T                                                             12727
       dec 0                                                               12728
                                                                           12729
       alf TYP                Type and halt                                12730
       alf EAN                                                             12731
       alf DHA                                                             12732
       alf LT0                                                             12733
       oct 20004                                                           12734
       dec 0                                                               12735
       dec 0                                                               12736
       dec 0                                                               12737
                                                                           12738
       alf TYP                Type no halt                                 12739
       alf ENO                                                             12740
       alf HAL                                                             12741
       alf T00                                                             12742
       oct 20004                                                           12743
       dec -1                                                              12744
       dec 0                                                               12745
       dec 0                                                               12746
                                                                           12747
       alf TYP                Type                                         12748
       alf E00                                                             12749
       alf 000                                                             12750
       alf 000                                                             12751
       oct 20004                                                           12752
       dec 0                                                               12753
       dec 0                                                               12754
       dec 0                                                               12755
                                                                           12756
       alf REW                Rewind I (tape number)                       12757
       alf IND                                                             12758
       dec -1                                                              12759
       alf 000                                                             12760
       oct 20005                                                           12761
       dec 0                                                               12762
       dec 0                                                               12763
       dec 0                                                               12764
                                                                           12765
       alf SLE                Slew                                         12766
       alf W00                                                             12767
       alf 000                                                             12768
       alf 000                                                             12769
       oct 20006                                                           12770
       dec 0                                                               12771
       dec 0                                                               12772
       dec 0                                                               12773
                                                                           12774
       alf BIN                Binary                                       12775
       alf ARY                                                             12776
       alf 000                                                             12777
       alf 000                                                             12778
       oct 20007                                                           12779
       oct 20014                                                           12780
       oct 32030                                                           12781
       dec 0                                                               12782
                                                                           12783
       dec 0                  End-of-catalog marker                        12784
                                                                           12785
                                                                           12786
       loc 6000                                                            12787
bcatm  spb $ertyp  2          Tell them catalog has been loaded            12788
       dec *+2                                                             12789
       bru lovwrt             and then proceed with load                   12790
       oct 373777                                                          12791
       alf BAT                                                             12792
       alf CH                                                              12793
       alf CAT                                                             12794
       alf LOG                                                             12795
       alf  LO                                                             12796
       alf AD                                                              12797
       alf COM                                                             12798
       alf PLE                                                             12799
       alf TE.                                                             12800
       oct 375577                                                          12801
                                                                           12802
       tcd bcatm                                                           12803
                                                                           12804
       end sres               End                                          12805
