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.

046649,000002:                                                                                                  ## Copyright:   Public domain.
046650,000003:                                                                                                  ## Filename:    WAITLIST.agc
046651,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
046652,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
046653,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
046654,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
046655,000008:                                                                                                  ##              that the code format has been changed to conform to the
046656,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
046657,000010:                                                                                                  ##              original YUL assembler.
046658,000011:                                                                                                  ## Reference:   pp. 1111-1126
046659,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
046660,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046661,000014:                                                                                                  ## Mod history: 05/31/03 RSB.   Began transcribing.
046662,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
046663,000016:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
046664,000017:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
046665,000018:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
046666,000019:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
046667,000020:                                                                                                  ##                              numbers in 1701.pdf.
046668,000021:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
046669,000022:                                                                                                  ##              2017-02-09 RSB  Comment-text fixes identified in proofing Artemis 72
046670,000023:                                                                                                  ##              2017-02-27 RSB  Proofed comment text using octopus/ProoferComments.
046671,000024:                                                                                                  ##                              Also corrected WAITP00H and LONGP00H to their POOH
046672,000025:                                                                                                  ##                              equivalents.
046673,000026:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
046674,000027:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
046675,000028:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
046676,000029: 

Page 1111

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

Page 1112

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

Page 1113

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

Page 1114

046819,000172:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
046820,000173: 

Page 1115

046822,000175:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
046823,000176: 
046824,000177:    5236  E3,1400                                  EBANK=   LST1                                  
046825,000178:    5236           72537 73714  ENDTASK            -2CADR   SVCT3                                 
046826,000179: 
046827,000180:    5240           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
046828,000181:    5241           15261                           TCF      TASKOVER                              
046829,000182:    5242           15261                           TCF      TASKOVER                              
046830,000183:    5243           15244                           TCF      +1                                    
046831,000184: 
046832,000185:    5244           11301        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
046833,000186:    5245           15256                           TCF      SVCT3X                                #  IMUSTALL.
046834,000187:    5246           15251                           TCF      +3                                    
046835,000188:    5247           15256                           TCF      SVCT3X                                
046836,000189:    5250           15256                           TCF      SVCT3X                                
046837,000190: 
046838,000191:    5251           37726                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
046839,000192:    5252           05072                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
046840,000193:    5253  E3,1460                                  EBANK=   NBDX                                  
046841,000194:    5253           03563 14063                     2CADR    NBDONLY                               
046842,000195: 
046843,000196:    5255           15261                           TCF      TASKOVER                              
046844,000197: 
046845,000198:    5256           05221        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
046846,000199:    5257           00764                           DEC      500        B-14                       
046847,000200:    5260           05240                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
046848,000201: 

Page 1116

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

Page 1117

046896,000249: 01,3261           57400        WTLST4             XCH      LST1                                  
046897,000250: 01,3262           57401                           XCH      LST1       +1                         
046898,000251: 01,3263           57402                           XCH      LST1       +2                         
046899,000252: 01,3264           57403                           XCH      LST1       +3                         
046900,000253: 01,3265           57404                           XCH      LST1       +4                         
046901,000254: 01,3266           57405                           XCH      LST1       +5                         
046902,000255: 01,3267           57406                           XCH      LST1       +6                         
046903,000256: 01,3270           57407                           XCH      LST1       +7                         
046904,000257: 
046905,000258: 01,3271           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
046906,000259: 01,3272           50002                           INDEX    Q                                     
046907,000260: 01,3273           13274                           TCF      +1                                    
046908,000261: 
046909,000262: 01,3274           53411                           DXCH     LST2                                  
046910,000263: 01,3275           53413                           DXCH     LST2       +2                         
046911,000264: 01,3276           53415                           DXCH     LST2       +4                         
046912,000265: 01,3277           53417                           DXCH     LST2       +6                         
046913,000266: 01,3300           53421                           DXCH     LST2       +8D                        
046914,000267: 01,3301           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
046915,000268: 01,3302           53425                           DXCH     LST2       +12D                       
046916,000269: 01,3303           53427                           DXCH     LST2       +14D                       
046917,000270: 01,3304           53431                           DXCH     LST2       +16D                       
046918,000271: 01,3305           65236                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
046919,000272:                                                                                                  #  THE LENGTH OF THE LIST.
046920,000273: 01,3306           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
046921,000274: 01,3307           15215                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
046922,000275: 01,3310           13364                           TCF      WTABORT                               #  IT.
046923,000276: 

Page 1118

046925,000278: 01,3311           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
046926,000279: 01,3312           61401                           AD       LST1       +1                         
046927,000280: 01,3313           13317                           TCF      +4                                    
046928,000281: 01,3314           64753                           AD       ONE                                   
046929,000282: 01,3315           03375                           TC       WTLST2                                
046930,000283: 01,3316           00001                           OCT      1                                     
046931,000284: 
046932,000285: 01,3317           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
046933,000286: 01,3320           61402                           AD       LST1       +2                         
046934,000287: 01,3321           13325                           TCF      +4                                    
046935,000288: 01,3322           64753                           AD       ONE                                   
046936,000289: 01,3323           03375                           TC       WTLST2                                
046937,000290: 01,3324           00002                           OCT      2                                     
046938,000291: 
046939,000292: 01,3325           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
046940,000293: 01,3326           61403                           AD       LST1       +3                         
046941,000294: 01,3327           13333                           TCF      +4                                    
046942,000295: 01,3330           64753                           AD       ONE                                   
046943,000296: 01,3331           03375                           TC       WTLST2                                
046944,000297: 01,3332           00003                           OCT      3                                     
046945,000298: 
046946,000299: 01,3333           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
046947,000300: 01,3334           61404                           AD       LST1       +4                         
046948,000301: 01,3335           13341                           TCF      +4                                    
046949,000302: 01,3336           64753                           AD       ONE                                   
046950,000303: 01,3337           03375                           TC       WTLST2                                
046951,000304: 01,3340           00004                           OCT      4                                     
046952,000305: 
046953,000306: 01,3341           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
046954,000307: 01,3342           61405                           AD       LST1       +5                         
046955,000308: 01,3343           13347                           TCF      +4                                    
046956,000309: 01,3344           64753                           AD       ONE                                   
046957,000310: 01,3345           03375                           TC       WTLST2                                
046958,000311: 01,3346           00005                           OCT      5                                     
046959,000312: 
046960,000313: 01,3347           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
046961,000314: 01,3350           61406                           AD       LST1       +6                         
046962,000315: 01,3351           13355                           TCF      +4                                    
046963,000316: 01,3352           64753                           AD       ONE                                   
046964,000317: 01,3353           03375                           TC       WTLST2                                
046965,000318: 01,3354           00006                           OCT      6                                     
046966,000319: 

Page 1119

046968,000321: 01,3355           10000                 +4        CCS      A                                     
046969,000322: 01,3356           61407                           AD       LST1       +7                         
046970,000323: 01,3357           13363                           TCF      +4                                    
046971,000324: 01,3360           64753                           AD       ONE                                   
046972,000325: 01,3361           03375                           TC       WTLST2                                
046973,000326: 01,3362           00007                           OCT      7                                     
046974,000327: 
046975,000328: 01,3363           10000                 +4        CCS      A                                     
046976,000329: 01,3364           03372        WTABORT            TC       FILLED                                
046977,000330: 01,3365           13366                           NOOP                                           #  CAN'T GET HERE
046978,000331: 01,3366           64753                           AD       ONE                                   
046979,000332: 01,3367           03375                           TC       WTLST2                                
046980,000333: 01,3370           00010                           OCT      10                                    
046981,000334: 
046982,000335: 01,3371           40201        OCT40201           OCT      40201                                 
046983,000336: 

Page 1120

046985,000338: 01,3372           52062        FILLED             DXCH     WAITEXIT                              
046986,000339: 01,3373           05706                           TC       BAILOUT1                              #  NO ROOM IN THE INN
046987,000340: 01,3374           31203                           OCT      31203                                 
046988,000341: 

Page 1121

046990,000343:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
046991,000344:                                                                                                  #                                                   N           N+1
046992,000345:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
046993,000346:                                                                                                  #                                                              N+1
046994,000347:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
046995,000348:                                                                                                  #                   N+1  N                                 N
046996,000349:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
046997,000350:                                                                                                  #              N+1
046998,000351: 
046999,000352: 01,3375           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
047000,000353: 01,3376           50002                           INDEX    Q                                     
047001,000354: 01,3377           30000                           CAF      0                                     
047002,000355: 01,3400           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
047003,000356: 
047004,000357: 01,3401           34753                           CAF      ONE                                   
047005,000358: 01,3402           60064                           AD       WAITTEMP                              
047006,000359: 01,3403           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
047007,000360: 01,3404           27377                           ADS      LST1       -1                         #                 N
047008,000361: 
047009,000362: 01,3405           40064                           CS       WAITTEMP                              
047010,000363: 01,3406           50002                           INDEX    Q                                     
047011,000364: 01,3407           13261                           TCF      WTLST4                                
047012,000365: 
047013,000366:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
047014,000367: 
047015,000368:                                                                                                  #        C(LST1)         =       - (T2 - T1) + 1
047016,000369:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
047017,000370:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
047018,000371:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
047019,000372:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
047020,000373: 
047021,000374:                                                                                                  #        C(LST2)         =       2CADR TASK1
047022,000375:                                                                                                  #        C(LST2+2)       =       2CADR TASK2
047023,000376:                                                                                                  #        C(LST2+4)       =       2CADR TASK3
047024,000377:                                                                                                  #        C(LST2+6)       =       2CADR TASK4
047025,000378:                                                                                                  #        C(LST2+8)       =       2CADR TASK5
047026,000379:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
047027,000380: 

Page 1122

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

Page 1123

047071,000424:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
047072,000425: 
047073,000426:    5261                                           BLOCK    02                                    
047074,000427:    5261                                           COUNT*   $$/WAIT                               
047075,000428:    5261           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
047076,000429:    5262           35220                           CAF      WAITBB                                
047077,000430:    5263           54006                           TS       BBANK                                 
047078,000431:    5264           13415                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
047079,000432: 
047080,000433:    5265           30016                           CA       BANKRUPT                              
047081,000434:    5266           00006                           EXTEND                                         
047082,000435:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
047083,000436: 
047084,000437:    5270           00006        RESUME             EXTEND                                         
047085,000438:    5271           22012                           QXCH     QRUPT                                 
047086,000439:    5272           30016        NOQRSM             CA       BANKRUPT                              
047087,000440:    5273           56006                           XCH      BBANK                                 
047088,000441:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
047089,000442:    5275           00003                           RELINT                                         
047090,000443:    5276           50017                           RESUME                                         
047091,000444: 

Page 1124

047093,000446:                                                                                                  #  LONGCALL
047094,000447:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
047095,000448:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
047096,000449:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
047097,000450: 
047098,000451:                                                                                                  #  FUNCTIONAL DESCRIPTION -
047099,000452:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
047100,000453:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
047101,000454:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
047102,000455:                                                                                                  #        START
047103,000456:                                                                                                  #  CALLING SEQUENCE -
047104,000457:                                                                                                  #                EXTEND
047105,000458:                                                                                                  #                DCA     TIMELOC
047106,000459:                                                                                                  #                TC      LONGCALL
047107,000460:                                                                                                  #                2CADR   TASKTODO
047108,000461:                                                                                                  #  NORMAL EXIT MODE -
047109,000462:                                                                                                  #        1).     TC      WAITLIST
047110,000463:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
047111,000464:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
047112,000465:                                                                                                  #  ALARM OR ABORT EXIT MODE -
047113,000466:                                                                                                  #        NONE
047114,000467:                                                                                                  #  OUTPUT -
047115,000468:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
047116,000469:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
047117,000470:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
047118,000471:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
047119,000472:                                                                                                  #  ERASABLE INITIALIZATION -
047120,000473:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
047121,000474:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
047122,000475:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
047123,000476:                                                                                                  #  DEBRIS -
047124,000477:                                                                                                  #        A,Q,L
047125,000478:                                                                                                  #        LONGCADR AND LONGCADR+1
047126,000479:                                                                                                  #        LONGEXIT AND LONGEXIT+1
047127,000480:                                                                                                  #        LONGTIME AND LONGTIME+1
047128,000481:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
047129,000482: 
047130,000483:    5277                                           BLOCK    02                                    
047131,000484:    5277  E3,1400                                  EBANK=   LST1                                  
047132,000485:    5277           53153        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
047133,000486: 
047134,000487:    5300           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1125

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

Page 1126

047187,000540: 01,3502           34736        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
047188,000541: 01,3503           27153                           ADS      LONGTIME   +1                         
047189,000542: 01,3504           05203                           TC       WAITLIST                              
047190,000543: 01,3505  E3,1400                                  EBANK=   LST1                                  
047191,000544: 01,3505           03517 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
047192,000545: 
047193,000546: 01,3507           33521        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
047194,000547: 01,3510           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
047195,000548: 01,3511           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
047196,000549: 
047197,000550: 01,3512           34736        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
047198,000551: 01,3513           05203                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
047199,000552: 01,3514  E3,1400                                  EBANK=   LST1                                  
047200,000553: 01,3514           03467 02063                     2CADR    LONGCYCL                              
047201,000554: 
047202,000555: 01,3516           13507                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
047203,000556: 
047204,000557:                                                                                                  #  *** WAITLIST TASK GETCADR ***
047205,000558: 
047206,000559: 01,3517           53147        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
047207,000560: 01,3520           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
047208,000561: 
047209,000562: 01,3521           05261        TSKOVCDR           GENADR   TASKOVER                              
047210,000563: 01,3522           53435        LONGPOOH           DXCH     LONGEXIT                              
047211,000564: 01,3523           13525                           TCF      +2                                    
047212,000565: 01,3524           52062        WAITPOOH           DXCH     WAITEXIT                              
047213,000566: 01,3525           05716                 +2        TC       POODOO1                               
047214,000567: 01,3526           21204                           OCT      21204                                 
047215,000568: 

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