Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

046624,000002:                                                                                                  ## Copyright:   Public domain.
046625,000003:                                                                                                  ## Filename:    WAITLIST.agc
046626,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
046627,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
046628,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
046629,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
046630,000008:                                                                                                  ##              that the code format has been changed to conform to the
046631,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
046632,000010:                                                                                                  ##              original YUL assembler.
046633,000011:                                                                                                  ## Reference:   pp. 1111-1126
046634,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
046635,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046636,000014:                                                                                                  ## Mod history: 05/31/03 RSB.   Began transcribing.
046637,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
046638,000016:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
046639,000017:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
046640,000018:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
046641,000019:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
046642,000020:                                                                                                  ##                              numbers in 1701.pdf.
046643,000021:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
046644,000022:                                                                                                  ##              2017-02-09 RSB  Comment-text fixes identified in proofing Artemis 72
046645,000023:                                                                                                  ##              2017-02-27 RSB  Proofed comment text using octopus/ProoferComments.
046646,000024:                                                                                                  ##                              Also corrected WAITP00H and LONGP00H to their POOH
046647,000025:                                                                                                  ##                              equivalents.
046648,000026:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
046649,000027:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
046650,000028:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
046651,000029: 

Page 1111

046653,000031:                                                                                                  #  PROGRAM DESCRIPTION                                           DATE - 10 OCTOBER 1966
046654,000032:                                                                                                  #  MOD NO - 2                                                    LOG SECTION - WAITLIST
046655,000033:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)          ASSEMBLY SUNBURST REV 5
046656,000034:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
046657,000035:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
046658,000036: 
046659,000037:                                                                                                  #  FUNCTIONAL DESCRIPTION -
046660,000038:                                                                                                  #        PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
046661,000039:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
046662,000040:                                                                                                  #        FOLLOW.
046663,000041: 
046664,000042:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
046665,000043: 
046666,000044:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
046667,000045:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
046668,000046:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
046669,000047:                                                                                                  #                                        .
046670,000048:                                                                                                  #                                        .
046671,000049:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
046672,000050:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
046673,000051: 
046674,000052:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
046675,000053:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
046676,000054:                                                                                                  #                                        .
046677,000055:                                                                                                  #                                        .
046678,000056:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
046679,000057:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
046680,000058: 
046681,000059:                                                                                                  #  WARNINGS -
046682,000060:                                                                                                  #  --------
046683,000061:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
046684,000062:                                                                                                  #        2)      9 TASKS MAXIMUM
046685,000063:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
046686,000064:                                                                                                  #        4)      TASKS END BY TC TASKOVER
046687,000065: 
046688,000066:                                                                                                  #  CALLING SEQUENCE -
046689,000067:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
046690,000068:                                                                                                  #        L       TC      WAITLIST
046691,000069:                                                                                                  #        L+1     2CADR   DESIRED TASK
046692,000070:                                                                                                  #        L+2     (MINOR OF 2CADR)
046693,000071:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
046694,000072: 
046695,000073:                                                                                                  #  TWIDDLE -
046696,000074:                                                                                                  #  -------
046697,000075:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
046698,000076:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1112

046700,000078:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
046701,000079:                                                                                                  #                L-1     CA      DELTAT
046702,000080:                                                                                                  #                L       TC      TWIDDLE
046703,000081:                                                                                                  #                L+1     ADRES   DESIRED TASK
046704,000082:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
046705,000083: 
046706,000084:                                                                                                  #  NORMAL EXIT MODES -
046707,000085:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
046708,000086: 
046709,000087:                                                                                                  #  ALARM OR ABORT EXIT MODES -
046710,000088:                                                                                                  #        TC      ABORT
046711,000089:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
046712,000090: 
046713,000091:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
046714,000092:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
046715,000093:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
046716,000094: 
046717,000095:                                                                                                  #  OUTPUT--
046718,000096:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
046719,000097: 
046720,000098:                                                                                                  #  DEBRIS-
046721,000099:                                                                                                  #        CENTRALS - A,Q,L
046722,000100:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
046723,000101: 
046724,000102:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
046725,000103:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
046726,000104:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
046727,000105:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
046728,000106:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
046729,000107:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
046730,000108:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
046731,000109:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
046732,000110:                                                                                                  #        (Z=0, USUALLY)
046733,000111:                                                                                                  #                LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
046734,000112:                                                                                                  #             THEN   DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
046735,000113:                                                                                                  #        *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
046736,000114: 
046737,000115:                                                                                                  #             IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
046738,000116:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
046739,000117:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
046740,000118: 
046741,000119:    5173                                           BLOCK    02                                    

Page 1113

046743,000121:    5173  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
046744,000122: 
046745,000123:    5173                                           COUNT*   $$/WAIT                               
046746,000124:    5173           00004        TWIDDLE            INHINT                                         
046747,000125:    5174           54001                           TS       L                                     #  SAVE DELAY TIME IN L
046748,000126:    5175           34733                           CA       POSMAX                                
046749,000127:    5176           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
046750,000128:    5177           30006                           CA       BBANK                                 
046751,000129:    5200           00006                           EXTEND                                         
046752,000130:    5201           04007                           ROR      SUPERBNK                              
046753,000131:    5202           56001                           XCH      L                                     
046754,000132: 
046755,000133:    5203           00004        WAITLIST           INHINT                                         
046756,000134:    5204           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
046757,000135:    5205           54061                           TS       WAITEXIT                              #  WAITEXIT.
046758,000136:    5206           00006                           EXTEND                                         
046759,000137:    5207           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
046760,000138:    5210           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
046761,000139:    5211           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
046762,000140:    5212           35220        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
046763,000141:    5213           56006                           XCH      BBANK                                 
046764,000142:    5214           13232                           TCF      WAIT2                                 
046765,000143: 
046766,000144:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
046767,000145: 
046768,000146:    5215           52062        LVWTLIST           DXCH     WAITEXIT                              
046769,000147:    5216           64752                           AD       TWO                                   
046770,000148:    5217           52006                           DTCB                                           
046771,000149: 
046772,000150:    5220  E3,1400                                  EBANK=   LST1                                  
046773,000151:    5220           02063        WAITBB             BBCON    WAIT2                                 
046774,000152: 
046775,000153:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
046776,000154: 
046777,000155:    5221           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
046778,000156:    5222           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
046779,000157:    5223           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
046780,000158: 
046781,000159:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
046782,000160: 
046783,000161:    5224           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
046784,000162:    5225           54063                           TS       WAITADR                               
046785,000163:    5226           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
046786,000164:    5227           00006                           EXTEND                                         
046787,000165:    5230           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
046788,000166:    5231           54001                           TS       L                                     
046789,000167:    5232           35235                           CAF      DELAYEX                               
046790,000168:    5233           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
046791,000169:    5234           15212                           TCF      DLY2                                  
046792,000170: 

Page 1114

046794,000172:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
046795,000173: 

Page 1115

046797,000175:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
046798,000176: 
046799,000177:    5236  E3,1400                                  EBANK=   LST1                                  
046800,000178:    5236           72537 73714  ENDTASK            -2CADR   SVCT3                                 
046801,000179: 
046802,000180:    5240           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
046803,000181:    5241           15261                           TCF      TASKOVER                              
046804,000182:    5242           15261                           TCF      TASKOVER                              
046805,000183:    5243           15244                           TCF      +1                                    
046806,000184: 
046807,000185:    5244           11301        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
046808,000186:    5245           15256                           TCF      SVCT3X                                #  IMUSTALL.
046809,000187:    5246           15251                           TCF      +3                                    
046810,000188:    5247           15256                           TCF      SVCT3X                                
046811,000189:    5250           15256                           TCF      SVCT3X                                
046812,000190: 
046813,000191:    5251           37726                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
046814,000192:    5252           05072                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
046815,000193:    5253  E3,1460                                  EBANK=   NBDX                                  
046816,000194:    5253           03563 14063                     2CADR    NBDONLY                               
046817,000195: 
046818,000196:    5255           15261                           TCF      TASKOVER                              
046819,000197: 
046820,000198:    5256           05221        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
046821,000199:    5257           00764                           DEC      500        B-14                       
046822,000200:    5260           05240                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
046823,000201: 

Page 1116

046825,000203:                                                                                                  #  BEGIN TASK INSERTION.
046826,000204: 
046827,000205: 01,3232                                           BANK     01                                    
046828,000206: 01,3232                                           COUNT*   $$/WAIT                               
046829,000207: 01,3232           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
046830,000208: 01,3233           30002                           CA       Q                                     
046831,000209: 01,3234           00006                           EXTEND                                         
046832,000210: 01,3235           63524                           BZMF     WAITPOOH                              
046833,000211: 
046834,000212: 01,3236           40026                           CS       TIME3                                 
046835,000213: 01,3237           64744                           AD       BIT8                                  #  BIT 8 = OCT 200
046836,000214: 01,3240           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
046837,000215:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
046838,000216:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
046839,000217:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
046840,000218: 
046841,000219: 01,3241           66112                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
046842,000220: 01,3242           40000                           CS       A                                     #  T - T1 + 1.0 - 201
046843,000221: 
046844,000222:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
046845,000223: 
046846,000224: 01,3243           63371                           AD       OCT40201                              
046847,000225: 01,3244           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
046848,000226: 
046849,000227: 01,3245           10000                           CCS      A                                     #  TEST TD - T1 + 1
046850,000228: 
046851,000229: 01,3246           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
046852,000230: 01,3247           13311                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
046853,000231: 
046854,000232: 01,3250           13251                           NOOP                                           
046855,000233: 01,3251           40002                           CS       Q                                     
046856,000234: 
046857,000235:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
046858,000236:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
046859,000237:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
046860,000238:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
046861,000239: 
046862,000240: 01,3252           64736                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
046863,000241: 01,3253           64736                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
046864,000242: 01,3254           56026                           XCH      TIME3                                 
046865,000243: 01,3255           64735                           AD       NEGMAX                                
046866,000244: 01,3256           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
046867,000245: 01,3257           00006                           EXTEND                                         #  ZERO INDEX Q.
046868,000246: 01,3260           22007                           QXCH     7                                     #  (ZQ)
046869,000247: 

Page 1117

046871,000249: 01,3261           57400        WTLST4             XCH      LST1                                  
046872,000250: 01,3262           57401                           XCH      LST1       +1                         
046873,000251: 01,3263           57402                           XCH      LST1       +2                         
046874,000252: 01,3264           57403                           XCH      LST1       +3                         
046875,000253: 01,3265           57404                           XCH      LST1       +4                         
046876,000254: 01,3266           57405                           XCH      LST1       +5                         
046877,000255: 01,3267           57406                           XCH      LST1       +6                         
046878,000256: 01,3270           57407                           XCH      LST1       +7                         
046879,000257: 
046880,000258: 01,3271           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
046881,000259: 01,3272           50002                           INDEX    Q                                     
046882,000260: 01,3273           13274                           TCF      +1                                    
046883,000261: 
046884,000262: 01,3274           53411                           DXCH     LST2                                  
046885,000263: 01,3275           53413                           DXCH     LST2       +2                         
046886,000264: 01,3276           53415                           DXCH     LST2       +4                         
046887,000265: 01,3277           53417                           DXCH     LST2       +6                         
046888,000266: 01,3300           53421                           DXCH     LST2       +8D                        
046889,000267: 01,3301           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
046890,000268: 01,3302           53425                           DXCH     LST2       +12D                       
046891,000269: 01,3303           53427                           DXCH     LST2       +14D                       
046892,000270: 01,3304           53431                           DXCH     LST2       +16D                       
046893,000271: 01,3305           65236                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
046894,000272:                                                                                                  #  THE LENGTH OF THE LIST.
046895,000273: 01,3306           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
046896,000274: 01,3307           15215                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
046897,000275: 01,3310           13364                           TCF      WTABORT                               #  IT.
046898,000276: 

Page 1118

046900,000278: 01,3311           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
046901,000279: 01,3312           61401                           AD       LST1       +1                         
046902,000280: 01,3313           13317                           TCF      +4                                    
046903,000281: 01,3314           64753                           AD       ONE                                   
046904,000282: 01,3315           03375                           TC       WTLST2                                
046905,000283: 01,3316           00001                           OCT      1                                     
046906,000284: 
046907,000285: 01,3317           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
046908,000286: 01,3320           61402                           AD       LST1       +2                         
046909,000287: 01,3321           13325                           TCF      +4                                    
046910,000288: 01,3322           64753                           AD       ONE                                   
046911,000289: 01,3323           03375                           TC       WTLST2                                
046912,000290: 01,3324           00002                           OCT      2                                     
046913,000291: 
046914,000292: 01,3325           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
046915,000293: 01,3326           61403                           AD       LST1       +3                         
046916,000294: 01,3327           13333                           TCF      +4                                    
046917,000295: 01,3330           64753                           AD       ONE                                   
046918,000296: 01,3331           03375                           TC       WTLST2                                
046919,000297: 01,3332           00003                           OCT      3                                     
046920,000298: 
046921,000299: 01,3333           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
046922,000300: 01,3334           61404                           AD       LST1       +4                         
046923,000301: 01,3335           13341                           TCF      +4                                    
046924,000302: 01,3336           64753                           AD       ONE                                   
046925,000303: 01,3337           03375                           TC       WTLST2                                
046926,000304: 01,3340           00004                           OCT      4                                     
046927,000305: 
046928,000306: 01,3341           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
046929,000307: 01,3342           61405                           AD       LST1       +5                         
046930,000308: 01,3343           13347                           TCF      +4                                    
046931,000309: 01,3344           64753                           AD       ONE                                   
046932,000310: 01,3345           03375                           TC       WTLST2                                
046933,000311: 01,3346           00005                           OCT      5                                     
046934,000312: 
046935,000313: 01,3347           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
046936,000314: 01,3350           61406                           AD       LST1       +6                         
046937,000315: 01,3351           13355                           TCF      +4                                    
046938,000316: 01,3352           64753                           AD       ONE                                   
046939,000317: 01,3353           03375                           TC       WTLST2                                
046940,000318: 01,3354           00006                           OCT      6                                     
046941,000319: 

Page 1119

046943,000321: 01,3355           10000                 +4        CCS      A                                     
046944,000322: 01,3356           61407                           AD       LST1       +7                         
046945,000323: 01,3357           13363                           TCF      +4                                    
046946,000324: 01,3360           64753                           AD       ONE                                   
046947,000325: 01,3361           03375                           TC       WTLST2                                
046948,000326: 01,3362           00007                           OCT      7                                     
046949,000327: 
046950,000328: 01,3363           10000                 +4        CCS      A                                     
046951,000329: 01,3364           03372        WTABORT            TC       FILLED                                
046952,000330: 01,3365           13366                           NOOP                                           #  CAN'T GET HERE
046953,000331: 01,3366           64753                           AD       ONE                                   
046954,000332: 01,3367           03375                           TC       WTLST2                                
046955,000333: 01,3370           00010                           OCT      10                                    
046956,000334: 
046957,000335: 01,3371           40201        OCT40201           OCT      40201                                 
046958,000336: 

Page 1120

046960,000338: 01,3372           52062        FILLED             DXCH     WAITEXIT                              
046961,000339: 01,3373           05706                           TC       BAILOUT1                              #  NO ROOM IN THE INN
046962,000340: 01,3374           31203                           OCT      31203                                 
046963,000341: 

Page 1121

046965,000343:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
046966,000344:                                                                                                  #                                                   N           N+1
046967,000345:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
046968,000346:                                                                                                  #                                                              N+1
046969,000347:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
046970,000348:                                                                                                  #                   N+1  N                                 N
046971,000349:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
046972,000350:                                                                                                  #              N+1
046973,000351: 
046974,000352: 01,3375           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
046975,000353: 01,3376           50002                           INDEX    Q                                     
046976,000354: 01,3377           30000                           CAF      0                                     
046977,000355: 01,3400           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
046978,000356: 
046979,000357: 01,3401           34753                           CAF      ONE                                   
046980,000358: 01,3402           60064                           AD       WAITTEMP                              
046981,000359: 01,3403           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
046982,000360: 01,3404           27377                           ADS      LST1       -1                         #                 N
046983,000361: 
046984,000362: 01,3405           40064                           CS       WAITTEMP                              
046985,000363: 01,3406           50002                           INDEX    Q                                     
046986,000364: 01,3407           13261                           TCF      WTLST4                                
046987,000365: 
046988,000366:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
046989,000367: 
046990,000368:                                                                                                  #        C(LST1)         =       - (T2 - T1) + 1
046991,000369:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
046992,000370:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
046993,000371:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
046994,000372:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
046995,000373: 
046996,000374:                                                                                                  #        C(LST2)         =       2CADR TASK1
046997,000375:                                                                                                  #        C(LST2+2)       =       2CADR TASK2
046998,000376:                                                                                                  #        C(LST2+4)       =       2CADR TASK3
046999,000377:                                                                                                  #        C(LST2+6)       =       2CADR TASK4
047000,000378:                                                                                                  #        C(LST2+8)       =       2CADR TASK5
047001,000379:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
047002,000380: 

Page 1122

047004,000382:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
047005,000383: 
047006,000384: 01,3410           00006        T3RUPT             EXTEND                                         
047007,000385: 01,3411           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
047008,000386: 01,3412           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
047009,000387: 01,3413           00006                           EXTEND                                         
047010,000388: 01,3414           22012                           QXCH     QRUPT                                 
047011,000389: 
047012,000390: 01,3415           34734        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
047013,000391: 01,3416           57407                           XCH      LST1       +7                         
047014,000392: 01,3417           57406                           XCH      LST1       +6                         
047015,000393: 01,3420           57405                           XCH      LST1       +5                         
047016,000394: 01,3421           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
047017,000395: 01,3422           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
047018,000396: 01,3423           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
047019,000397: 01,3424           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
047020,000398: 01,3425           57400                           XCH      LST1                                  
047021,000399: 01,3426           64733                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
047022,000400: 01,3427           26026                           ADS      TIME3                                 #     SO T3 WONT TICK DURING UPDATE.
047023,000401: 01,3430           54332                           TS       RUPTAGN                               
047024,000402: 01,3431           44755                           CS       ZERO                                  
047025,000403: 01,3432           54332                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
047026,000404: 
047027,000405: 01,3433           00006                           EXTEND                                         #  DISPATCH TASK.
047028,000406: 01,3434           45237                           DCS      ENDTASK                               
047029,000407: 01,3435           53431                           DXCH     LST2       +16D                       
047030,000408: 01,3436           53427                           DXCH     LST2       +14D                       
047031,000409: 01,3437           53425                           DXCH     LST2       +12D                       
047032,000410: 01,3440           53423                           DXCH     LST2       +10D                       
047033,000411: 01,3441           53421                           DXCH     LST2       +8D                        
047034,000412: 01,3442           53417                           DXCH     LST2       +6                         
047035,000413: 01,3443           53415                           DXCH     LST2       +4                         
047036,000414: 01,3444           53413                           DXCH     LST2       +2                         
047037,000415: 01,3445           53411                           DXCH     LST2                                  
047038,000416: 
047039,000417: 01,3446           56001                           XCH      L                                     
047040,000418: 01,3447           00006                           EXTEND                                         
047041,000419: 01,3450           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
047042,000420: 01,3451           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
047043,000421: 01,3452           52006                           DTCB                                           
047044,000422: 

Page 1123

047046,000424:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
047047,000425: 
047048,000426:    5261                                           BLOCK    02                                    
047049,000427:    5261                                           COUNT*   $$/WAIT                               
047050,000428:    5261           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
047051,000429:    5262           35220                           CAF      WAITBB                                
047052,000430:    5263           54006                           TS       BBANK                                 
047053,000431:    5264           13415                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
047054,000432: 
047055,000433:    5265           30016                           CA       BANKRUPT                              
047056,000434:    5266           00006                           EXTEND                                         
047057,000435:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
047058,000436: 
047059,000437:    5270           00006        RESUME             EXTEND                                         
047060,000438:    5271           22012                           QXCH     QRUPT                                 
047061,000439:    5272           30016        NOQRSM             CA       BANKRUPT                              
047062,000440:    5273           56006                           XCH      BBANK                                 
047063,000441:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
047064,000442:    5275           00003                           RELINT                                         
047065,000443:    5276           50017                           RESUME                                         
047066,000444: 

Page 1124

047068,000446:                                                                                                  #  LONGCALL
047069,000447:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
047070,000448:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
047071,000449:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
047072,000450: 
047073,000451:                                                                                                  #  FUNCTIONAL DESCRIPTION -
047074,000452:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
047075,000453:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
047076,000454:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
047077,000455:                                                                                                  #        START
047078,000456:                                                                                                  #  CALLING SEQUENCE -
047079,000457:                                                                                                  #                EXTEND
047080,000458:                                                                                                  #                DCA     TIMELOC
047081,000459:                                                                                                  #                TC      LONGCALL
047082,000460:                                                                                                  #                2CADR   TASKTODO
047083,000461:                                                                                                  #  NORMAL EXIT MODE -
047084,000462:                                                                                                  #        1).     TC      WAITLIST
047085,000463:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
047086,000464:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
047087,000465:                                                                                                  #  ALARM OR ABORT EXIT MODE -
047088,000466:                                                                                                  #        NONE
047089,000467:                                                                                                  #  OUTPUT -
047090,000468:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
047091,000469:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
047092,000470:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
047093,000471:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
047094,000472:                                                                                                  #  ERASABLE INITIALIZATION -
047095,000473:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
047096,000474:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
047097,000475:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
047098,000476:                                                                                                  #  DEBRIS -
047099,000477:                                                                                                  #        A,Q,L
047100,000478:                                                                                                  #        LONGCADR AND LONGCADR+1
047101,000479:                                                                                                  #        LONGEXIT AND LONGEXIT+1
047102,000480:                                                                                                  #        LONGTIME AND LONGTIME+1
047103,000481:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
047104,000482: 
047105,000483:    5277                                           BLOCK    02                                    
047106,000484:    5277  E3,1400                                  EBANK=   LST1                                  
047107,000485:    5277           53153        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
047108,000486: 
047109,000487:    5300           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1125

047111,000489:    5301           50002                           NDX      Q                                     
047112,000490:    5302           30001                           DCA      0                                     
047113,000491:    5303           53147                           DXCH     LONGCADR                              
047114,000492: 
047115,000493:    5304           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
047116,000494:    5305           35310                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
047117,000495:    5306           52006                           DTCB                                           
047118,000496: 
047119,000497:    5307  E3,1400                                  EBANK=   LST1                                  
047120,000498:    5307           03453 02063  LGCL2CDR           2CADR    LNGCALL2                              
047121,000499: 
047122,000500:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
047123,000501: 
047124,000502: 01,3453                                           BANK     01                                    
047125,000503: 01,3453                                           COUNT*   $$/WAIT                               
047126,000504: 01,3453           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
047127,000505: 01,3454           34752                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
047128,000506: 01,3455           26002                           ADS      Q                                     
047129,000507: 01,3456           55434                           TS       LONGEXIT                              
047130,000508: 
047131,000509: 01,3457           31152                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
047132,000510: 01,3460           10000                           CCS      A                                     
047133,000511: 01,3461           13467                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
047134,000512: 01,3462           13464                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
047135,000513: 01,3463           13522                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
047136,000514: 01,3464           31153                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
047137,000515: 01,3465           00006                           EXTEND                                         
047138,000516: 01,3466           63522                           BZMF     LONGPOOH                              #  BAD DELTA-TIME.  ABORT
047139,000517: 
047140,000518:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
047141,000519: 
047142,000520: 01,3467           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
047143,000521: 01,3470           43501                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
047144,000522: 01,3471           21153                           DAS      LONGTIME                              
047145,000523: 
047146,000524: 01,3472           11153                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
047147,000525: 01,3473           13512                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
047148,000526:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
047149,000527:                                                                                                  #  BASIC INSTRUCTIONS
047150,000528:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
047151,000529:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
047152,000530:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
047153,000531: 01,3474           13475                           NOOP                                           #  CAN:T GET HERE    **********
047154,000532: 01,3475           13476                           TCF      +1                                    
047155,000533: 01,3476           11152                           CCS      LONGTIME                              
047156,000534: 01,3477           13512                           TCF      MUCHTIME                              
047157,000535: 01,3500           00000        DPBIT14            OCT      00000                                 
047158,000536: 01,3501           20000                           OCT      20000                                 
047159,000537: 
047160,000538:                                                                                                  #  LONGCALL

Page 1126

047162,000540: 01,3502           34736        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
047163,000541: 01,3503           27153                           ADS      LONGTIME   +1                         
047164,000542: 01,3504           05203                           TC       WAITLIST                              
047165,000543: 01,3505  E3,1400                                  EBANK=   LST1                                  
047166,000544: 01,3505           03517 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
047167,000545: 
047168,000546: 01,3507           33521        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
047169,000547: 01,3510           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
047170,000548: 01,3511           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
047171,000549: 
047172,000550: 01,3512           34736        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
047173,000551: 01,3513           05203                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
047174,000552: 01,3514  E3,1400                                  EBANK=   LST1                                  
047175,000553: 01,3514           03467 02063                     2CADR    LONGCYCL                              
047176,000554: 
047177,000555: 01,3516           13507                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
047178,000556: 
047179,000557:                                                                                                  #  *** WAITLIST TASK GETCADR ***
047180,000558: 
047181,000559: 01,3517           53147        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
047182,000560: 01,3520           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
047183,000561: 
047184,000562: 01,3521           05261        TSKOVCDR           GENADR   TASKOVER                              
047185,000563: 01,3522           53435        LONGPOOH           DXCH     LONGEXIT                              
047186,000564: 01,3523           13525                           TCF      +2                                    
047187,000565: 01,3524           52062        WAITPOOH           DXCH     WAITEXIT                              
047188,000566: 01,3525           05716                 +2        TC       POODOO1                               
047189,000567: 01,3526           21204                           OCT      21204                                 
047190,000568: 

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