Source Code

These source-code files are part of a reconstructed copy of LM131 revision 1, the final release of the Apollo 13 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The source reconstruction began with source code of Luminary 131 previously transcribed from a digitized copy of that program. A dump of the flight spare core rope memory module B5, part number 2010802-171, serial number RAY 411, was obtained. This module is the only module different between Luminary 131 and LM131 revision 1. The dump was disassembled and all changes were incorporated into these source files. Note that page numbers in the reconstructed code match those on the Luminary 131 printout, although the changed code would likely have changed page numbers for a real LM131 revision 1 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

046568,000002:                                                                                                  ## Copyright:   Public domain.
046569,000003:                                                                                                  ## Filename:    WAITLIST.agc
046570,000004:                                                                                                  ## Purpose:     A section of LM131 revision 1.
046571,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
046572,000006:                                                                                                  ##              release of the flight software for the Lunar Module's (LM)
046573,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13. The code has
046574,000008:                                                                                                  ##              been reconstructed from a listing of Luminary 131 and a dump
046575,000009:                                                                                                  ##              of a core rope memory module B5, part number 2010802-171,
046576,000010:                                                                                                  ##              which is the only module different between LM131 revision 1
046577,000011:                                                                                                  ##              and Luminary 131. The executable generated from this source
046578,000012:                                                                                                  ##              has been verified against the module dump, so while the names,
046579,000013:                                                                                                  ##              comments, and ordering may not be exactly correct, the
046580,000014:                                                                                                  ##              resulting binary is.
046581,000015:                                                                                                  ## Reference:   pp. 1111-1126
046582,000016:                                                                                                  ## Assembler:   yaYUL
046583,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
046584,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046585,000019:                                                                                                  ## Mod history: 2022-10-28 MAS  Created from Luminary 131.
046586,000020: 

Page 1111

046588,000022:                                                                                                  #  PROGRAM DESCRIPTION                                           DATE - 10 OCTOBER 1966
046589,000023:                                                                                                  #  MOD NO - 2                                                    LOG SECTION - WAITLIST
046590,000024:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)          ASSEMBLY SUNBURST REV 5
046591,000025:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
046592,000026:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
046593,000027: 
046594,000028:                                                                                                  #  FUNCTIONAL DESCRIPTION -
046595,000029:                                                                                                  #        PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
046596,000030:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
046597,000031:                                                                                                  #        FOLLOW.
046598,000032: 
046599,000033:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
046600,000034: 
046601,000035:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
046602,000036:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
046603,000037:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
046604,000038:                                                                                                  #                                        .
046605,000039:                                                                                                  #                                        .
046606,000040:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
046607,000041:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
046608,000042: 
046609,000043:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
046610,000044:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
046611,000045:                                                                                                  #                                        .
046612,000046:                                                                                                  #                                        .
046613,000047:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
046614,000048:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
046615,000049: 
046616,000050:                                                                                                  #  WARNINGS -
046617,000051:                                                                                                  #  --------
046618,000052:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
046619,000053:                                                                                                  #        2)      9 TASKS MAXIMUM
046620,000054:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
046621,000055:                                                                                                  #        4)      TASKS END BY TC TASKOVER
046622,000056: 
046623,000057:                                                                                                  #  CALLING SEQUENCE -
046624,000058:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
046625,000059:                                                                                                  #        L       TC      WAITLIST
046626,000060:                                                                                                  #        L+1     2CADR   DESIRED TASK
046627,000061:                                                                                                  #        L+2     (MINOR OF 2CADR)
046628,000062:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
046629,000063: 
046630,000064:                                                                                                  #  TWIDDLE -
046631,000065:                                                                                                  #  -------
046632,000066:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
046633,000067:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1112

046635,000069:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
046636,000070:                                                                                                  #                L-1     CA      DELTAT
046637,000071:                                                                                                  #                L       TC      TWIDDLE
046638,000072:                                                                                                  #                L+1     ADRES   DESIRED TASK
046639,000073:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
046640,000074: 
046641,000075:                                                                                                  #  NORMAL EXIT MODES -
046642,000076:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
046643,000077: 
046644,000078:                                                                                                  #  ALARM OR ABORT EXIT MODES -
046645,000079:                                                                                                  #        TC      ABORT
046646,000080:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
046647,000081: 
046648,000082:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
046649,000083:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
046650,000084:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
046651,000085: 
046652,000086:                                                                                                  #  OUTPUT--
046653,000087:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
046654,000088: 
046655,000089:                                                                                                  #  DEBRIS-
046656,000090:                                                                                                  #        CENTRALS - A,Q,L
046657,000091:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
046658,000092: 
046659,000093:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
046660,000094:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
046661,000095:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
046662,000096:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
046663,000097:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
046664,000098:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
046665,000099:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
046666,000100:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
046667,000101:                                                                                                  #        (Z=0, USUALLY)
046668,000102:                                                                                                  #                LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
046669,000103:                                                                                                  #             THEN   DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
046670,000104:                                                                                                  #        *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
046671,000105: 
046672,000106:                                                                                                  #             IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
046673,000107:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
046674,000108:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
046675,000109: 
046676,000110:    5173                                           BLOCK    02                                    

Page 1113

046678,000112:    5173  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
046679,000113: 
046680,000114:    5173                                           COUNT*   $$/WAIT                               
046681,000115:    5173           00004        TWIDDLE            INHINT                                         
046682,000116:    5174           54001                           TS       L                                     #  SAVE DELAY TIME IN L
046683,000117:    5175           34733                           CA       POSMAX                                
046684,000118:    5176           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
046685,000119:    5177           30006                           CA       BBANK                                 
046686,000120:    5200           00006                           EXTEND                                         
046687,000121:    5201           04007                           ROR      SUPERBNK                              
046688,000122:    5202           56001                           XCH      L                                     
046689,000123: 
046690,000124:    5203           00004        WAITLIST           INHINT                                         
046691,000125:    5204           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
046692,000126:    5205           54061                           TS       WAITEXIT                              #  WAITEXIT.
046693,000127:    5206           00006                           EXTEND                                         
046694,000128:    5207           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
046695,000129:    5210           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
046696,000130:    5211           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
046697,000131:    5212           35220        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
046698,000132:    5213           56006                           XCH      BBANK                                 
046699,000133:    5214           13232                           TCF      WAIT2                                 
046700,000134: 
046701,000135:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
046702,000136: 
046703,000137:    5215           52062        LVWTLIST           DXCH     WAITEXIT                              
046704,000138:    5216           64752                           AD       TWO                                   
046705,000139:    5217           52006                           DTCB                                           
046706,000140: 
046707,000141:    5220  E3,1400                                  EBANK=   LST1                                  
046708,000142:    5220           02063        WAITBB             BBCON    WAIT2                                 
046709,000143: 
046710,000144:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
046711,000145: 
046712,000146:    5221           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
046713,000147:    5222           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
046714,000148:    5223           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
046715,000149: 
046716,000150:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
046717,000151: 
046718,000152:    5224           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
046719,000153:    5225           54063                           TS       WAITADR                               
046720,000154:    5226           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
046721,000155:    5227           00006                           EXTEND                                         
046722,000156:    5230           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
046723,000157:    5231           54001                           TS       L                                     
046724,000158:    5232           35235                           CAF      DELAYEX                               
046725,000159:    5233           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
046726,000160:    5234           15212                           TCF      DLY2                                  
046727,000161: 

Page 1114

046729,000163:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
046730,000164: 

Page 1115

046732,000166:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
046733,000167: 
046734,000168:    5236  E3,1400                                  EBANK=   LST1                                  
046735,000169:    5236           72537 73714  ENDTASK            -2CADR   SVCT3                                 
046736,000170: 
046737,000171:    5240           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
046738,000172:    5241           15261                           TCF      TASKOVER                              
046739,000173:    5242           15261                           TCF      TASKOVER                              
046740,000174:    5243           15244                           TCF      +1                                    
046741,000175: 
046742,000176:    5244           11301        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
046743,000177:    5245           15256                           TCF      SVCT3X                                #  IMUSTALL.
046744,000178:    5246           15251                           TCF      +3                                    
046745,000179:    5247           15256                           TCF      SVCT3X                                
046746,000180:    5250           15256                           TCF      SVCT3X                                
046747,000181: 
046748,000182:    5251           37726                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
046749,000183:    5252           05072                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
046750,000184:    5253  E3,1460                                  EBANK=   NBDX                                  
046751,000185:    5253           03563 14063                     2CADR    NBDONLY                               
046752,000186: 
046753,000187:    5255           15261                           TCF      TASKOVER                              
046754,000188: 
046755,000189:    5256           05221        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
046756,000190:    5257           00764                           DEC      500        B-14                       
046757,000191:    5260           05240                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
046758,000192: 

Page 1116

046760,000194:                                                                                                  #  BEGIN TASK INSERTION.
046761,000195: 
046762,000196: 01,3232                                           BANK     01                                    
046763,000197: 01,3232                                           COUNT*   $$/WAIT                               
046764,000198: 01,3232           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
046765,000199: 01,3233           30002                           CA       Q                                     
046766,000200: 01,3234           00006                           EXTEND                                         
046767,000201: 01,3235           63524                           BZMF     WAITPOOH                              
046768,000202: 
046769,000203: 01,3236           40026                           CS       TIME3                                 
046770,000204: 01,3237           64744                           AD       BIT8                                  #  BIT 8 = OCT 200
046771,000205: 01,3240           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
046772,000206:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
046773,000207:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
046774,000208:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
046775,000209: 
046776,000210: 01,3241           66112                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
046777,000211: 01,3242           40000                           CS       A                                     #  T - T1 + 1.0 - 201
046778,000212: 
046779,000213:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
046780,000214: 
046781,000215: 01,3243           63371                           AD       OCT40201                              
046782,000216: 01,3244           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
046783,000217: 
046784,000218: 01,3245           10000                           CCS      A                                     #  TEST TD - T1 + 1
046785,000219: 
046786,000220: 01,3246           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
046787,000221: 01,3247           13311                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
046788,000222: 
046789,000223: 01,3250           13251                           NOOP                                           
046790,000224: 01,3251           40002                           CS       Q                                     
046791,000225: 
046792,000226:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
046793,000227:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
046794,000228:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
046795,000229:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
046796,000230: 
046797,000231: 01,3252           64736                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
046798,000232: 01,3253           64736                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
046799,000233: 01,3254           56026                           XCH      TIME3                                 
046800,000234: 01,3255           64735                           AD       NEGMAX                                
046801,000235: 01,3256           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
046802,000236: 01,3257           00006                           EXTEND                                         #  ZERO INDEX Q.
046803,000237: 01,3260           22007                           QXCH     7                                     #  (ZQ)
046804,000238: 

Page 1117

046806,000240: 01,3261           57400        WTLST4             XCH      LST1                                  
046807,000241: 01,3262           57401                           XCH      LST1       +1                         
046808,000242: 01,3263           57402                           XCH      LST1       +2                         
046809,000243: 01,3264           57403                           XCH      LST1       +3                         
046810,000244: 01,3265           57404                           XCH      LST1       +4                         
046811,000245: 01,3266           57405                           XCH      LST1       +5                         
046812,000246: 01,3267           57406                           XCH      LST1       +6                         
046813,000247: 01,3270           57407                           XCH      LST1       +7                         
046814,000248: 
046815,000249: 01,3271           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
046816,000250: 01,3272           50002                           INDEX    Q                                     
046817,000251: 01,3273           13274                           TCF      +1                                    
046818,000252: 
046819,000253: 01,3274           53411                           DXCH     LST2                                  
046820,000254: 01,3275           53413                           DXCH     LST2       +2                         
046821,000255: 01,3276           53415                           DXCH     LST2       +4                         
046822,000256: 01,3277           53417                           DXCH     LST2       +6                         
046823,000257: 01,3300           53421                           DXCH     LST2       +8D                        
046824,000258: 01,3301           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
046825,000259: 01,3302           53425                           DXCH     LST2       +12D                       
046826,000260: 01,3303           53427                           DXCH     LST2       +14D                       
046827,000261: 01,3304           53431                           DXCH     LST2       +16D                       
046828,000262: 01,3305           65236                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
046829,000263:                                                                                                  #  THE LENGTH OF THE LIST.
046830,000264: 01,3306           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
046831,000265: 01,3307           15215                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
046832,000266: 01,3310           13364                           TCF      WTABORT                               #  IT.
046833,000267: 

Page 1118

046835,000269: 01,3311           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
046836,000270: 01,3312           61401                           AD       LST1       +1                         
046837,000271: 01,3313           13317                           TCF      +4                                    
046838,000272: 01,3314           64753                           AD       ONE                                   
046839,000273: 01,3315           03375                           TC       WTLST2                                
046840,000274: 01,3316           00001                           OCT      1                                     
046841,000275: 
046842,000276: 01,3317           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
046843,000277: 01,3320           61402                           AD       LST1       +2                         
046844,000278: 01,3321           13325                           TCF      +4                                    
046845,000279: 01,3322           64753                           AD       ONE                                   
046846,000280: 01,3323           03375                           TC       WTLST2                                
046847,000281: 01,3324           00002                           OCT      2                                     
046848,000282: 
046849,000283: 01,3325           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
046850,000284: 01,3326           61403                           AD       LST1       +3                         
046851,000285: 01,3327           13333                           TCF      +4                                    
046852,000286: 01,3330           64753                           AD       ONE                                   
046853,000287: 01,3331           03375                           TC       WTLST2                                
046854,000288: 01,3332           00003                           OCT      3                                     
046855,000289: 
046856,000290: 01,3333           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
046857,000291: 01,3334           61404                           AD       LST1       +4                         
046858,000292: 01,3335           13341                           TCF      +4                                    
046859,000293: 01,3336           64753                           AD       ONE                                   
046860,000294: 01,3337           03375                           TC       WTLST2                                
046861,000295: 01,3340           00004                           OCT      4                                     
046862,000296: 
046863,000297: 01,3341           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
046864,000298: 01,3342           61405                           AD       LST1       +5                         
046865,000299: 01,3343           13347                           TCF      +4                                    
046866,000300: 01,3344           64753                           AD       ONE                                   
046867,000301: 01,3345           03375                           TC       WTLST2                                
046868,000302: 01,3346           00005                           OCT      5                                     
046869,000303: 
046870,000304: 01,3347           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
046871,000305: 01,3350           61406                           AD       LST1       +6                         
046872,000306: 01,3351           13355                           TCF      +4                                    
046873,000307: 01,3352           64753                           AD       ONE                                   
046874,000308: 01,3353           03375                           TC       WTLST2                                
046875,000309: 01,3354           00006                           OCT      6                                     
046876,000310: 

Page 1119

046878,000312: 01,3355           10000                 +4        CCS      A                                     
046879,000313: 01,3356           61407                           AD       LST1       +7                         
046880,000314: 01,3357           13363                           TCF      +4                                    
046881,000315: 01,3360           64753                           AD       ONE                                   
046882,000316: 01,3361           03375                           TC       WTLST2                                
046883,000317: 01,3362           00007                           OCT      7                                     
046884,000318: 
046885,000319: 01,3363           10000                 +4        CCS      A                                     
046886,000320: 01,3364           03372        WTABORT            TC       FILLED                                
046887,000321: 01,3365           13366                           NOOP                                           #  CAN'T GET HERE
046888,000322: 01,3366           64753                           AD       ONE                                   
046889,000323: 01,3367           03375                           TC       WTLST2                                
046890,000324: 01,3370           00010                           OCT      10                                    
046891,000325: 
046892,000326: 01,3371           40201        OCT40201           OCT      40201                                 
046893,000327: 

Page 1120

046895,000329: 01,3372           52062        FILLED             DXCH     WAITEXIT                              
046896,000330: 01,3373           05706                           TC       BAILOUT1                              #  NO ROOM IN THE INN
046897,000331: 01,3374           31203                           OCT      31203                                 
046898,000332: 

Page 1121

046900,000334:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
046901,000335:                                                                                                  #                                                   N           N+1
046902,000336:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
046903,000337:                                                                                                  #                                                              N+1
046904,000338:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
046905,000339:                                                                                                  #                   N+1  N                                 N
046906,000340:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
046907,000341:                                                                                                  #              N+1
046908,000342: 
046909,000343: 01,3375           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
046910,000344: 01,3376           50002                           INDEX    Q                                     
046911,000345: 01,3377           30000                           CAF      0                                     
046912,000346: 01,3400           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
046913,000347: 
046914,000348: 01,3401           34753                           CAF      ONE                                   
046915,000349: 01,3402           60064                           AD       WAITTEMP                              
046916,000350: 01,3403           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
046917,000351: 01,3404           27377                           ADS      LST1       -1                         #                 N
046918,000352: 
046919,000353: 01,3405           40064                           CS       WAITTEMP                              
046920,000354: 01,3406           50002                           INDEX    Q                                     
046921,000355: 01,3407           13261                           TCF      WTLST4                                
046922,000356: 
046923,000357:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
046924,000358: 
046925,000359:                                                                                                  #        C(LST1)         =       - (T2 - T1) + 1
046926,000360:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
046927,000361:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
046928,000362:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
046929,000363:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
046930,000364: 
046931,000365:                                                                                                  #        C(LST2)         =       2CADR TASK1
046932,000366:                                                                                                  #        C(LST2+2)       =       2CADR TASK2
046933,000367:                                                                                                  #        C(LST2+4)       =       2CADR TASK3
046934,000368:                                                                                                  #        C(LST2+6)       =       2CADR TASK4
046935,000369:                                                                                                  #        C(LST2+8)       =       2CADR TASK5
046936,000370:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
046937,000371: 

Page 1122

046939,000373:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
046940,000374: 
046941,000375: 01,3410           00006        T3RUPT             EXTEND                                         
046942,000376: 01,3411           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
046943,000377: 01,3412           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
046944,000378: 01,3413           00006                           EXTEND                                         
046945,000379: 01,3414           22012                           QXCH     QRUPT                                 
046946,000380: 
046947,000381: 01,3415           34734        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
046948,000382: 01,3416           57407                           XCH      LST1       +7                         
046949,000383: 01,3417           57406                           XCH      LST1       +6                         
046950,000384: 01,3420           57405                           XCH      LST1       +5                         
046951,000385: 01,3421           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
046952,000386: 01,3422           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
046953,000387: 01,3423           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
046954,000388: 01,3424           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
046955,000389: 01,3425           57400                           XCH      LST1                                  
046956,000390: 01,3426           64733                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
046957,000391: 01,3427           26026                           ADS      TIME3                                 #     SO T3 WONT TICK DURING UPDATE.
046958,000392: 01,3430           54332                           TS       RUPTAGN                               
046959,000393: 01,3431           44755                           CS       ZERO                                  
046960,000394: 01,3432           54332                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
046961,000395: 
046962,000396: 01,3433           00006                           EXTEND                                         #  DISPATCH TASK.
046963,000397: 01,3434           45237                           DCS      ENDTASK                               
046964,000398: 01,3435           53431                           DXCH     LST2       +16D                       
046965,000399: 01,3436           53427                           DXCH     LST2       +14D                       
046966,000400: 01,3437           53425                           DXCH     LST2       +12D                       
046967,000401: 01,3440           53423                           DXCH     LST2       +10D                       
046968,000402: 01,3441           53421                           DXCH     LST2       +8D                        
046969,000403: 01,3442           53417                           DXCH     LST2       +6                         
046970,000404: 01,3443           53415                           DXCH     LST2       +4                         
046971,000405: 01,3444           53413                           DXCH     LST2       +2                         
046972,000406: 01,3445           53411                           DXCH     LST2                                  
046973,000407: 
046974,000408: 01,3446           56001                           XCH      L                                     
046975,000409: 01,3447           00006                           EXTEND                                         
046976,000410: 01,3450           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
046977,000411: 01,3451           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
046978,000412: 01,3452           52006                           DTCB                                           
046979,000413: 

Page 1123

046981,000415:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
046982,000416: 
046983,000417:    5261                                           BLOCK    02                                    
046984,000418:    5261                                           COUNT*   $$/WAIT                               
046985,000419:    5261           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
046986,000420:    5262           35220                           CAF      WAITBB                                
046987,000421:    5263           54006                           TS       BBANK                                 
046988,000422:    5264           13415                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
046989,000423: 
046990,000424:    5265           30016                           CA       BANKRUPT                              
046991,000425:    5266           00006                           EXTEND                                         
046992,000426:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
046993,000427: 
046994,000428:    5270           00006        RESUME             EXTEND                                         
046995,000429:    5271           22012                           QXCH     QRUPT                                 
046996,000430:    5272           30016        NOQRSM             CA       BANKRUPT                              
046997,000431:    5273           56006                           XCH      BBANK                                 
046998,000432:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
046999,000433:    5275           00003                           RELINT                                         
047000,000434:    5276           50017                           RESUME                                         
047001,000435: 

Page 1124

047003,000437:                                                                                                  #  LONGCALL
047004,000438:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
047005,000439:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
047006,000440:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
047007,000441: 
047008,000442:                                                                                                  #  FUNCTIONAL DESCRIPTION -
047009,000443:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
047010,000444:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
047011,000445:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
047012,000446:                                                                                                  #        START
047013,000447:                                                                                                  #  CALLING SEQUENCE -
047014,000448:                                                                                                  #                EXTEND
047015,000449:                                                                                                  #                DCA     TIMELOC
047016,000450:                                                                                                  #                TC      LONGCALL
047017,000451:                                                                                                  #                2CADR   TASKTODO
047018,000452:                                                                                                  #  NORMAL EXIT MODE -
047019,000453:                                                                                                  #        1).     TC      WAITLIST
047020,000454:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
047021,000455:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
047022,000456:                                                                                                  #  ALARM OR ABORT EXIT MODE -
047023,000457:                                                                                                  #        NONE
047024,000458:                                                                                                  #  OUTPUT -
047025,000459:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
047026,000460:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
047027,000461:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
047028,000462:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
047029,000463:                                                                                                  #  ERASABLE INITIALIZATION -
047030,000464:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
047031,000465:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
047032,000466:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
047033,000467:                                                                                                  #  DEBRIS -
047034,000468:                                                                                                  #        A,Q,L
047035,000469:                                                                                                  #        LONGCADR AND LONGCADR+1
047036,000470:                                                                                                  #        LONGEXIT AND LONGEXIT+1
047037,000471:                                                                                                  #        LONGTIME AND LONGTIME+1
047038,000472:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
047039,000473: 
047040,000474:    5277                                           BLOCK    02                                    
047041,000475:    5277  E3,1400                                  EBANK=   LST1                                  
047042,000476:    5277           53153        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
047043,000477: 
047044,000478:    5300           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1125

047046,000480:    5301           50002                           NDX      Q                                     
047047,000481:    5302           30001                           DCA      0                                     
047048,000482:    5303           53147                           DXCH     LONGCADR                              
047049,000483: 
047050,000484:    5304           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
047051,000485:    5305           35310                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
047052,000486:    5306           52006                           DTCB                                           
047053,000487: 
047054,000488:    5307  E3,1400                                  EBANK=   LST1                                  
047055,000489:    5307           03453 02063  LGCL2CDR           2CADR    LNGCALL2                              
047056,000490: 
047057,000491:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
047058,000492: 
047059,000493: 01,3453                                           BANK     01                                    
047060,000494: 01,3453                                           COUNT*   $$/WAIT                               
047061,000495: 01,3453           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
047062,000496: 01,3454           34752                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
047063,000497: 01,3455           26002                           ADS      Q                                     
047064,000498: 01,3456           55434                           TS       LONGEXIT                              
047065,000499: 
047066,000500: 01,3457           31152                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
047067,000501: 01,3460           10000                           CCS      A                                     
047068,000502: 01,3461           13467                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
047069,000503: 01,3462           13464                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
047070,000504: 01,3463           13522                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
047071,000505: 01,3464           31153                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
047072,000506: 01,3465           00006                           EXTEND                                         
047073,000507: 01,3466           63522                           BZMF     LONGPOOH                              #  BAD DELTA-TIME.  ABORT
047074,000508: 
047075,000509:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
047076,000510: 
047077,000511: 01,3467           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
047078,000512: 01,3470           43501                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
047079,000513: 01,3471           21153                           DAS      LONGTIME                              
047080,000514: 
047081,000515: 01,3472           11153                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
047082,000516: 01,3473           13512                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
047083,000517:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
047084,000518:                                                                                                  #  BASIC INSTRUCTIONS
047085,000519:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
047086,000520:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
047087,000521:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
047088,000522: 01,3474           13475                           NOOP                                           #  CAN:T GET HERE    **********
047089,000523: 01,3475           13476                           TCF      +1                                    
047090,000524: 01,3476           11152                           CCS      LONGTIME                              
047091,000525: 01,3477           13512                           TCF      MUCHTIME                              
047092,000526: 01,3500           00000        DPBIT14            OCT      00000                                 
047093,000527: 01,3501           20000                           OCT      20000                                 
047094,000528: 
047095,000529:                                                                                                  #  LONGCALL

Page 1126

047097,000531: 01,3502           34736        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
047098,000532: 01,3503           27153                           ADS      LONGTIME   +1                         
047099,000533: 01,3504           05203                           TC       WAITLIST                              
047100,000534: 01,3505  E3,1400                                  EBANK=   LST1                                  
047101,000535: 01,3505           03517 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
047102,000536: 
047103,000537: 01,3507           33521        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
047104,000538: 01,3510           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
047105,000539: 01,3511           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
047106,000540: 
047107,000541: 01,3512           34736        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
047108,000542: 01,3513           05203                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
047109,000543: 01,3514  E3,1400                                  EBANK=   LST1                                  
047110,000544: 01,3514           03467 02063                     2CADR    LONGCYCL                              
047111,000545: 
047112,000546: 01,3516           13507                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
047113,000547: 
047114,000548:                                                                                                  #  *** WAITLIST TASK GETCADR ***
047115,000549: 
047116,000550: 01,3517           53147        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
047117,000551: 01,3520           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
047118,000552: 
047119,000553: 01,3521           05261        TSKOVCDR           GENADR   TASKOVER                              
047120,000554: 01,3522           53435        LONGPOOH           DXCH     LONGEXIT                              
047121,000555: 01,3523           13525                           TCF      +2                                    
047122,000556: 01,3524           52062        WAITPOOH           DXCH     WAITEXIT                              
047123,000557: 01,3525           05716                 +2        TC       POODOO1                               
047124,000558: 01,3526           21204                           OCT      21204                                 
047125,000559: 

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