Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

048617,000002:                                                                                                  ## Copyright:   Public domain.
048618,000003:                                                                                                  ## Filename:    WAITLIST.agc
048619,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
048620,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
048621,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
048622,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
048623,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
048624,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
048625,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
048626,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
048627,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
048628,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
048629,000014:                                                                                                  ##              the original YUL assembler.
048630,000015:                                                                                                  ##
048631,000016:                                                                                                  ## Assembler:   yaYUL
048632,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
048633,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
048634,000019:                                                                                                  ## Pages:       1117-1132
048635,000020:                                                                                                  ## Mod history: 2009-05-25 RSB  Adapted from the corresponding 
048636,000021:                                                                                                  ##                              Luminary131 file, using page 
048637,000022:                                                                                                  ##                              images from Luminary 1A.
048638,000023:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
048639,000024:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
048640,000025:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
048641,000026:                                                                                                  ##                              and corrected the errors found.
048642,000027:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
048643,000028:                                                                                                  ##              2017-02-09 RSB  Comment-text fixes identified in proofing Artemis 72.
048644,000029:                                                                                                  ##              2017-02-27 RSB  Corrected WAITP00H and LONGP00H to similar POOH names.
048645,000030:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
048646,000031:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
048647,000032:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
048648,000033:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
048649,000034: 
048650,000035:                                                                                                  ## This source code has been transcribed or otherwise adapted from
048651,000036:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
048652,000037:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
048653,000038:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
048654,000039:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
048655,000040:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
048656,000041:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
048657,000042:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
048658,000043:                                                                                                  ## actually created.
048659,000044:                                                                                                  ##
048660,000045:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
048661,000046:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
048662,000047:                                                                                                  ## the listing from which it was transcribed. It has been verified to
048663,000048:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
048664,000049:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
048665,000050:                                                                                                  ##
048666,000051:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
048667,000052:                                                                                                  ##
048668,000053:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
048669,000054: 

Page 1117

048671,000056:                                                                                                  #  PROGRAM DESCRIPTION                                                           DATE - 10 OCTOBER 1966
048672,000057:                                                                                                  #  MOD NO - 2                                                                    LOG SECTION - WAITLIST
048673,000058:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)                          ASSEMBLY SUNBURST REV 5
048674,000059:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
048675,000060:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
048676,000061: 
048677,000062:                                                                                                  #  FUNCTIONAL DESCRIPTION -
048678,000063:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
048679,000064:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
048680,000065:                                                                                                  #        FOLLOW.
048681,000066: 
048682,000067:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
048683,000068: 
048684,000069:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
048685,000070:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
048686,000071:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
048687,000072:                                                                                                  #                                        .
048688,000073:                                                                                                  #                                        .
048689,000074:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
048690,000075:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
048691,000076: 
048692,000077:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
048693,000078:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
048694,000079:                                                                                                  #                                        .
048695,000080:                                                                                                  #                                        .
048696,000081:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
048697,000082:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
048698,000083: 
048699,000084:                                                                                                  #  WARNINGS -
048700,000085:                                                                                                  #  --------
048701,000086:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
048702,000087:                                                                                                  #        2)      9 TASKS MAXIMUM
048703,000088:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
048704,000089:                                                                                                  #        4)      TASKS END BY TC TASKOVER
048705,000090: 
048706,000091:                                                                                                  #  CALLING SEQUENCE -
048707,000092:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
048708,000093:                                                                                                  #        L       TC      WAITLIST
048709,000094:                                                                                                  #        L+1     2CADR   DESIRED TASK
048710,000095:                                                                                                  #        L+2     (MINOR OF 2CADR)
048711,000096:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
048712,000097: 
048713,000098:                                                                                                  #  TWIDDLE -
048714,000099:                                                                                                  #  -------
048715,000100:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
048716,000101:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1118

048718,000103:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
048719,000104:                                                                                                  #                L-1     CA      DELTAT
048720,000105:                                                                                                  #                L       TC      TWIDDLE
048721,000106:                                                                                                  #                L+1     ADRES   DESIRED TASK
048722,000107:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
048723,000108: 
048724,000109:                                                                                                  #  NORMAL EXIT MODES -
048725,000110:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
048726,000111: 
048727,000112:                                                                                                  #  ALARM OR ABORT EXIT MODES -
048728,000113:                                                                                                  #        TC      ABORT
048729,000114:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
048730,000115: 
048731,000116:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
048732,000117:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
048733,000118:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
048734,000119: 
048735,000120:                                                                                                  #  OUTPUT --
048736,000121:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
048737,000122: 
048738,000123:                                                                                                  #  DEBRIS -
048739,000124:                                                                                                  #        CENTRALS - A,Q,L
048740,000125:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
048741,000126: 
048742,000127:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
048743,000128:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
048744,000129:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
048745,000130:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
048746,000131:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
048747,000132:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
048748,000133:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
048749,000134:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
048750,000135:                                                                                                  #                         (Z=0, USUALLY)
048751,000136:                                                                                                  #                LET DELTD  = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
048752,000137:                                                                                                  #                THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
048753,000138:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
048754,000139:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
048755,000140:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
048756,000141:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
048757,000142: 
048758,000143:    5173                                           BLOCK    02                                    

Page 1119

048760,000145:    5173  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
048761,000146: 
048762,000147:    5173                                           COUNT*   $$/WAIT                               
048763,000148:    5173           00004        TWIDDLE            INHINT                                         
048764,000149:    5174           54001                           TS       L                                     #  SAVE DELAY TIME IN L
048765,000150:    5175           34733                           CA       POSMAX                                
048766,000151:    5176           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
048767,000152:    5177           30006                           CA       BBANK                                 
048768,000153:    5200           00006                           EXTEND                                         
048769,000154:    5201           04007                           ROR      SUPERBNK                              
048770,000155:    5202           56001                           XCH      L                                     
048771,000156: 
048772,000157:    5203           00004        WAITLIST           INHINT                                         
048773,000158:    5204           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
048774,000159:    5205           54061                           TS       WAITEXIT                              #  WAITEXIT.
048775,000160:    5206           00006                           EXTEND                                         
048776,000161:    5207           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
048777,000162:    5210           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
048778,000163:    5211           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
048779,000164:    5212           35220        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
048780,000165:    5213           56006                           XCH      BBANK                                 
048781,000166:    5214           13231                           TCF      WAIT2                                 
048782,000167: 
048783,000168:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
048784,000169: 
048785,000170:    5215           52062        LVWTLIST           DXCH     WAITEXIT                              
048786,000171:    5216           64752                           AD       TWO                                   
048787,000172:    5217           52006                           DTCB                                           
048788,000173: 
048789,000174:    5220  E3,1400                                  EBANK=   LST1                                  
048790,000175:    5220           02063        WAITBB             BBCON    WAIT2                                 
048791,000176: 
048792,000177:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
048793,000178: 
048794,000179:    5221           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
048795,000180:    5222           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
048796,000181:    5223           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
048797,000182: 
048798,000183:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
048799,000184: 
048800,000185:    5224           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
048801,000186:    5225           54063                           TS       WAITADR                               
048802,000187:    5226           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
048803,000188:    5227           00006                           EXTEND                                         
048804,000189:    5230           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
048805,000190:    5231           54001                           TS       L                                     
048806,000191:    5232           35235                           CAF      DELAYEX                               
048807,000192:    5233           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
048808,000193:    5234           15212                           TCF      DLY2                                  
048809,000194: 

Page 1120

048811,000196:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
048812,000197: 

Page 1121

048814,000199:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
048815,000200: 
048816,000201:    5236  E3,1400                                  EBANK=   LST1                                  
048817,000202:    5236           72537 73714  ENDTASK            -2CADR   SVCT3                                 
048818,000203: 
048819,000204:    5240           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
048820,000205:    5241           15261                           TCF      TASKOVER                              
048821,000206:    5242           15261                           TCF      TASKOVER                              
048822,000207:    5243           15244                           TCF      +1                                    
048823,000208: 
048824,000209:    5244           11304        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
048825,000210:    5245           15256                           TCF      SVCT3X                                #  IMUSTALL.
048826,000211:    5246           15251                           TCF      +3                                    
048827,000212:    5247           15256                           TCF      SVCT3X                                
048828,000213:    5250           15256                           TCF      SVCT3X                                
048829,000214: 
048830,000215:    5251           37723                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
048831,000216:    5252           05072                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
048832,000217:    5253  E3,1460                                  EBANK=   NBDX                                  
048833,000218:    5253           03555 14063                     2CADR    NBDONLY                               
048834,000219: 
048835,000220:    5255           15261                           TCF      TASKOVER                              
048836,000221: 
048837,000222:    5256           05221        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
048838,000223:    5257           00764                           DEC      500        B-14                       
048839,000224:    5260           05240                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
048840,000225: 

Page 1122

048842,000227:                                                                                                  #  BEGIN TASK INSERTION.
048843,000228: 
048844,000229: 01,3231                                           BANK     01                                    
048845,000230: 01,3231                                           COUNT*   $$/WAIT                               
048846,000231: 01,3231           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
048847,000232: 01,3232           30002                           CA       Q                                     
048848,000233: 01,3233           00006                           EXTEND                                         
048849,000234: 01,3234           63523                           BZMF     WAITPOOH                              
048850,000235: 
048851,000236: 01,3235           40026                           CS       TIME3                                 
048852,000237: 01,3236           64744                           AD       BIT8                                  #  BIT 8 = OCT 200
048853,000238: 01,3237           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
048854,000239:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
048855,000240:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
048856,000241:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
048857,000242: 
048858,000243: 01,3240           66107                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
048859,000244: 01,3241           40000                           CS       A                                     #  T - T1 + 1.0 - 201
048860,000245: 
048861,000246:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
048862,000247: 
048863,000248: 01,3242           63370                           AD       OCT40201                              
048864,000249: 01,3243           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
048865,000250: 
048866,000251: 01,3244           10000                           CCS      A                                     #  TEST TD - T1 + 1
048867,000252: 
048868,000253: 01,3245           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
048869,000254: 01,3246           13310                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
048870,000255: 
048871,000256: 01,3247           13250                           NOOP                                           
048872,000257: 01,3250           40002                           CS       Q                                     
048873,000258: 
048874,000259:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
048875,000260:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
048876,000261:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
048877,000262:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
048878,000263: 
048879,000264: 01,3251           64736                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
048880,000265: 01,3252           64736                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
048881,000266: 01,3253           56026                           XCH      TIME3                                 
048882,000267: 01,3254           64735                           AD       NEGMAX                                
048883,000268: 01,3255           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
048884,000269: 01,3256           00006                           EXTEND                                         #  ZERO INDEX Q.
048885,000270: 01,3257           22007                           QXCH     7                                     #  (ZQ)
048886,000271: 

Page 1123

048888,000273: 01,3260           57400        WTLST4             XCH      LST1                                  
048889,000274: 01,3261           57401                           XCH      LST1       +1                         
048890,000275: 01,3262           57402                           XCH      LST1       +2                         
048891,000276: 01,3263           57403                           XCH      LST1       +3                         
048892,000277: 01,3264           57404                           XCH      LST1       +4                         
048893,000278: 01,3265           57405                           XCH      LST1       +5                         
048894,000279: 01,3266           57406                           XCH      LST1       +6                         
048895,000280: 01,3267           57407                           XCH      LST1       +7                         
048896,000281: 
048897,000282: 01,3270           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
048898,000283: 01,3271           50002                           INDEX    Q                                     
048899,000284: 01,3272           13273                           TCF      +1                                    
048900,000285: 
048901,000286: 01,3273           53411                           DXCH     LST2                                  
048902,000287: 01,3274           53413                           DXCH     LST2       +2                         
048903,000288: 01,3275           53415                           DXCH     LST2       +4                         
048904,000289: 01,3276           53417                           DXCH     LST2       +6                         
048905,000290: 01,3277           53421                           DXCH     LST2       +8D                        
048906,000291: 01,3300           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
048907,000292: 01,3301           53425                           DXCH     LST2       +12D                       
048908,000293: 01,3302           53427                           DXCH     LST2       +14D                       
048909,000294: 01,3303           53431                           DXCH     LST2       +16D                       
048910,000295: 01,3304           65236                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
048911,000296:                                                                                                  #  THE LENGTH OF THE LIST.
048912,000297: 01,3305           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
048913,000298: 01,3306           15215                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
048914,000299: 01,3307           13363                           TCF      WTABORT                               #  IT.
048915,000300: 

Page 1124

048917,000302: 01,3310           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
048918,000303: 01,3311           61401                           AD       LST1       +1                         
048919,000304: 01,3312           13316                           TCF      +4                                    
048920,000305: 01,3313           64753                           AD       ONE                                   
048921,000306: 01,3314           03374                           TC       WTLST2                                
048922,000307: 01,3315           00001                           OCT      1                                     
048923,000308: 
048924,000309: 01,3316           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
048925,000310: 01,3317           61402                           AD       LST1       +2                         
048926,000311: 01,3320           13324                           TCF      +4                                    
048927,000312: 01,3321           64753                           AD       ONE                                   
048928,000313: 01,3322           03374                           TC       WTLST2                                
048929,000314: 01,3323           00002                           OCT      2                                     
048930,000315: 
048931,000316: 01,3324           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
048932,000317: 01,3325           61403                           AD       LST1       +3                         
048933,000318: 01,3326           13332                           TCF      +4                                    
048934,000319: 01,3327           64753                           AD       ONE                                   
048935,000320: 01,3330           03374                           TC       WTLST2                                
048936,000321: 01,3331           00003                           OCT      3                                     
048937,000322: 
048938,000323: 01,3332           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
048939,000324: 01,3333           61404                           AD       LST1       +4                         
048940,000325: 01,3334           13340                           TCF      +4                                    
048941,000326: 01,3335           64753                           AD       ONE                                   
048942,000327: 01,3336           03374                           TC       WTLST2                                
048943,000328: 01,3337           00004                           OCT      4                                     
048944,000329: 
048945,000330: 01,3340           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
048946,000331: 01,3341           61405                           AD       LST1       +5                         
048947,000332: 01,3342           13346                           TCF      +4                                    
048948,000333: 01,3343           64753                           AD       ONE                                   
048949,000334: 01,3344           03374                           TC       WTLST2                                
048950,000335: 01,3345           00005                           OCT      5                                     
048951,000336: 
048952,000337: 01,3346           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
048953,000338: 01,3347           61406                           AD       LST1       +6                         
048954,000339: 01,3350           13354                           TCF      +4                                    
048955,000340: 01,3351           64753                           AD       ONE                                   
048956,000341: 01,3352           03374                           TC       WTLST2                                
048957,000342: 01,3353           00006                           OCT      6                                     
048958,000343: 

Page 1125

048960,000345: 01,3354           10000                 +4        CCS      A                                     
048961,000346: 01,3355           61407                           AD       LST1       +7                         
048962,000347: 01,3356           13362                           TCF      +4                                    
048963,000348: 01,3357           64753                           AD       ONE                                   
048964,000349: 01,3360           03374                           TC       WTLST2                                
048965,000350: 01,3361           00007                           OCT      7                                     
048966,000351: 
048967,000352: 01,3362           10000                 +4        CCS      A                                     
048968,000353: 01,3363           03371        WTABORT            TC       FILLED                                
048969,000354: 01,3364           13365                           NOOP                                           #  CAN'T GET HERE
048970,000355: 01,3365           64753                           AD       ONE                                   
048971,000356: 01,3366           03374                           TC       WTLST2                                
048972,000357: 01,3367           00010                           OCT      10                                    
048973,000358: 
048974,000359: 01,3370           40201        OCT40201           OCT      40201                                 
048975,000360: 

Page 1126

048977,000362: 01,3371           52062        FILLED             DXCH     WAITEXIT                              
048978,000363: 01,3372           05716                           TC       BAILOUT1                              #  NO ROOM IN THE INN
048979,000364: 01,3373           01203                           OCT      01203                                 
048980,000365: 

Page 1127

048982,000367:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
048983,000368:                                                                                                  #                                                   N           N+1
048984,000369:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
048985,000370:                                                                                                  #                                                              N+1
048986,000371:                                                                                                  #  THE LST1 ENTRY -(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
048987,000372:                                                                                                  #                    N+1  N                                 N
048988,000373:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
048989,000374:                                                                                                  #               N+1
048990,000375: 
048991,000376: 01,3374           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
048992,000377: 01,3375           50002                           INDEX    Q                                     
048993,000378: 01,3376           30000                           CAF      0                                     
048994,000379: 01,3377           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
048995,000380: 
048996,000381: 01,3400           34753                           CAF      ONE                                   
048997,000382: 01,3401           60064                           AD       WAITTEMP                              
048998,000383: 01,3402           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
048999,000384: 01,3403           27377                           ADS      LST1       -1                         #                 N
049000,000385: 
049001,000386: 01,3404           40064                           CS       WAITTEMP                              
049002,000387: 01,3405           50002                           INDEX    Q                                     
049003,000388: 01,3406           13260                           TCF      WTLST4                                
049004,000389: 
049005,000390:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
049006,000391: 
049007,000392:                                                                                                  #        C(LST1)         =       - (T2 - T1) + 1
049008,000393:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
049009,000394:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
049010,000395:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
049011,000396:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
049012,000397: 
049013,000398:                                                                                                  #        C(LST2)         =       2CADR TASK1
049014,000399:                                                                                                  #        C(LST2+2)       =       2CADR TASK2
049015,000400:                                                                                                  #        C(LST2+4)       =       2CADR TASK3
049016,000401:                                                                                                  #        C(LST2+6)       =       2CADR TASK4
049017,000402:                                                                                                  #        C(LST2+8)       =       2CADR TASK5
049018,000403:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
049019,000404: 

Page 1128

049021,000406:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
049022,000407: 
049023,000408: 01,3407           00006        T3RUPT             EXTEND                                         
049024,000409: 01,3410           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
049025,000410: 01,3411           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
049026,000411: 01,3412           00006                           EXTEND                                         
049027,000412: 01,3413           22012                           QXCH     QRUPT                                 
049028,000413: 
049029,000414: 01,3414           34734        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
049030,000415: 01,3415           57407                           XCH      LST1       +7                         
049031,000416: 01,3416           57406                           XCH      LST1       +6                         
049032,000417: 01,3417           57405                           XCH      LST1       +5                         
049033,000418: 01,3420           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
049034,000419: 01,3421           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
049035,000420: 01,3422           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
049036,000421: 01,3423           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
049037,000422: 01,3424           57400                           XCH      LST1                                  
049038,000423: 01,3425           64733                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
049039,000424: 01,3426           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
049040,000425: 01,3427           54734                           TS       RUPTAGN                               
049041,000426: 01,3430           44755                           CS       ZERO                                  
049042,000427: 01,3431           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
049043,000428: 
049044,000429: 01,3432           00006                           EXTEND                                         #  DISPATCH TASK.
049045,000430: 01,3433           45237                           DCS      ENDTASK                               
049046,000431: 01,3434           53431                           DXCH     LST2       +16D                       
049047,000432: 01,3435           53427                           DXCH     LST2       +14D                       
049048,000433: 01,3436           53425                           DXCH     LST2       +12D                       
049049,000434: 01,3437           53423                           DXCH     LST2       +10D                       
049050,000435: 01,3440           53421                           DXCH     LST2       +8D                        
049051,000436: 01,3441           53417                           DXCH     LST2       +6                         
049052,000437: 01,3442           53415                           DXCH     LST2       +4                         
049053,000438: 01,3443           53413                           DXCH     LST2       +2                         
049054,000439: 01,3444           53411                           DXCH     LST2                                  
049055,000440: 
049056,000441: 01,3445           56001                           XCH      L                                     
049057,000442: 01,3446           00006                           EXTEND                                         
049058,000443: 01,3447           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
049059,000444: 01,3450           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
049060,000445: 01,3451           52006                           DTCB                                           
049061,000446: 

Page 1129

049063,000448:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
049064,000449: 
049065,000450:    5261                                           BLOCK    02                                    
049066,000451:    5261                                           COUNT*   $$/WAIT                               
049067,000452:    5261           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
049068,000453:    5262           35220                           CAF      WAITBB                                
049069,000454:    5263           54006                           TS       BBANK                                 
049070,000455:    5264           13414                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
049071,000456: 
049072,000457:    5265           30016                           CA       BANKRUPT                              
049073,000458:    5266           00006                           EXTEND                                         
049074,000459:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
049075,000460: 
049076,000461:    5270           00006        RESUME             EXTEND                                         
049077,000462:    5271           22012                           QXCH     QRUPT                                 
049078,000463:    5272           30016        NOQRSM             CA       BANKRUPT                              
049079,000464:    5273           56006                           XCH      BBANK                                 
049080,000465:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
049081,000466:    5275           00003                           RELINT                                         
049082,000467:    5276           50017                           RESUME                                         
049083,000468: 

Page 1130

049085,000470:                                                                                                  #  LONGCALL
049086,000471:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
049087,000472:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
049088,000473:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
049089,000474: 
049090,000475:                                                                                                  #  FUNCTIONAL DESCRIPTION -
049091,000476:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
049092,000477:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
049093,000478:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
049094,000479:                                                                                                  #        START
049095,000480:                                                                                                  #  CALLING SEQUENCE -
049096,000481:                                                                                                  #                EXTEND
049097,000482:                                                                                                  #                DCA     TIMELOC
049098,000483:                                                                                                  #                TC      LONGCALL
049099,000484:                                                                                                  #                2CADR   TASKTODO
049100,000485:                                                                                                  #  NORMAL EXIT MODE -
049101,000486:                                                                                                  #        1).     TC      WAITLIST
049102,000487:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
049103,000488:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
049104,000489:                                                                                                  #  ALARM OR ABORT EXIT MODE -
049105,000490:                                                                                                  #        NONE
049106,000491:                                                                                                  #  OUTPUT -
049107,000492:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
049108,000493:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
049109,000494:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
049110,000495:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
049111,000496:                                                                                                  #  ERASABLE INITIALIZATION -
049112,000497:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
049113,000498:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
049114,000499:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
049115,000500:                                                                                                  #  DEBRIS -
049116,000501:                                                                                                  #        A,Q,L
049117,000502:                                                                                                  #        LONGCADR AND LONGCADR+1
049118,000503:                                                                                                  #        LONGEXIT AND LONGEXIT+1
049119,000504:                                                                                                  #        LONGTIME AND LONGTIME+1
049120,000505:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
049121,000506: 
049122,000507:    5277                                           BLOCK    02                                    
049123,000508:    5277  E3,1400                                  EBANK=   LST1                                  
049124,000509:    5277           53154        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
049125,000510: 
049126,000511:    5300           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1131

049128,000513:    5301           50002                           NDX      Q                                     
049129,000514:    5302           30001                           DCA      0                                     
049130,000515:    5303           53150                           DXCH     LONGCADR                              
049131,000516: 
049132,000517:    5304           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
049133,000518:    5305           35310                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
049134,000519:    5306           52006                           DTCB                                           
049135,000520: 
049136,000521:    5307  E3,1400                                  EBANK=   LST1                                  
049137,000522:    5307           03452 02063  LGCL2CDR           2CADR    LNGCALL2                              
049138,000523: 
049139,000524:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
049140,000525: 
049141,000526: 01,3452                                           BANK     01                                    
049142,000527: 01,3452                                           COUNT*   $$/WAIT                               
049143,000528: 01,3452           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
049144,000529: 01,3453           34752                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
049145,000530: 01,3454           26002                           ADS      Q                                     
049146,000531: 01,3455           55434                           TS       LONGEXIT                              
049147,000532: 
049148,000533: 01,3456           31153                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
049149,000534: 01,3457           10000                           CCS      A                                     
049150,000535: 01,3460           13466                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
049151,000536: 01,3461           13463                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
049152,000537: 01,3462           13521                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
049153,000538: 01,3463           31154                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
049154,000539: 01,3464           00006                           EXTEND                                         
049155,000540: 01,3465           63521                           BZMF     LONGPOOH                              #  BAD DELTA-TIME.  ABORT
049156,000541: 
049157,000542:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
049158,000543: 
049159,000544: 01,3466           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
049160,000545: 01,3467           43500                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
049161,000546: 01,3470           21154                           DAS      LONGTIME                              
049162,000547: 
049163,000548: 01,3471           11154                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
049164,000549: 01,3472           13511                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
049165,000550:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
049166,000551:                                                                                                  #  BASIC INSTRUCTIONS
049167,000552:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
049168,000553:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
049169,000554:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
049170,000555: 01,3473           13474                           NOOP                                           #  CAN:T GET HERE **********
049171,000556: 01,3474           13475                           TCF      +1                                    
049172,000557: 01,3475           11153                           CCS      LONGTIME                              
049173,000558: 01,3476           13511                           TCF      MUCHTIME                              
049174,000559: 01,3477           00000        DPBIT14            OCT      00000                                 
049175,000560: 01,3500           20000                           OCT      20000                                 
049176,000561: 
049177,000562:                                                                                                  #  LONGCALL

Page 1132

049179,000564: 01,3501           34736        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA T FOR WAITLIST
049180,000565: 01,3502           27154                           ADS      LONGTIME   +1                         
049181,000566: 01,3503           05203                           TC       WAITLIST                              
049182,000567: 01,3504  E3,1400                                  EBANK=   LST1                                  
049183,000568: 01,3504           03516 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
049184,000569: 
049185,000570: 01,3506           33520        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
049186,000571: 01,3507           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
049187,000572: 01,3510           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
049188,000573: 
049189,000574: 01,3511           34736        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
049190,000575: 01,3512           05203                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
049191,000576: 01,3513  E3,1400                                  EBANK=   LST1                                  
049192,000577: 01,3513           03466 02063                     2CADR    LONGCYCL                              
049193,000578: 
049194,000579: 01,3515           13506                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
049195,000580: 
049196,000581:                                                                                                  #  *** WAITLIST TASK GETCADR ***
049197,000582: 
049198,000583: 01,3516           53150        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
049199,000584: 01,3517           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
049200,000585: 
049201,000586: 01,3520           05261        TSKOVCDR           GENADR   TASKOVER                              
049202,000587: 01,3521           53435        LONGPOOH           DXCH     LONGEXIT                              
049203,000588: 01,3522           13524                           TCF      +2                                    
049204,000589: 01,3523           52062        WAITPOOH           DXCH     WAITEXIT                              
049205,000590: 01,3524           05726                 +2        TC       POODOO1                               
049206,000591: 01,3525           01204                           OCT      01204                                 
049207,000592: 

End of include-file WAITLIST.agc.  Parent file is MAIN.agc