Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

042968,000002:                                                                                                  ## Copyright:   Public domain.
042969,000003:                                                                                                  ## Filename:    WAITLIST.agc
042970,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
042971,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
042972,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
042973,000007:                                                                                                  ##              No original listings of this program are available;
042974,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
042975,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
042976,000010:                                                                                                  ## Assembler:   yaYUL
042977,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042978,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042979,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
042980,000014: 
042981,000015:                                                                                                  ## Sundance 292
042982,000016: 
042983,000017:                                                                                                  #  PROGRAM DESCRIPTION                                                           DATE - 10 OCTOBER 1966
042984,000018:                                                                                                  #  MOD NO - 2                                                                    LOG SECTION - WAITLIST
042985,000019:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)                          ASSEMBLY SUNBURST REV 5
042986,000020:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
042987,000021:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
042988,000022: 
042989,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION -
042990,000024:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
042991,000025:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
042992,000026:                                                                                                  #        FOLLOW.
042993,000027: 
042994,000028:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
042995,000029: 
042996,000030:                                                                                                  #                        C(LST1)    = -(T2-T1)+1
042997,000031:                                                                                                  #                        C(LST1 +1) = -(T3-T2)+1
042998,000032:                                                                                                  #                        C(LST1 +2) = -(T4-T3)+1
042999,000033:                                                                                                  #                                   .
043000,000034:                                                                                                  #                                   .
043001,000035:                                                                                                  #                        C(LST1 +6) = -(T8-T7)+1
043002,000036:                                                                                                  #                        C(LST1 +7) = -(T9-T8)+1
043003,000037: 
043004,000038:                                                                                                  #                        C(LST2)    = 2CADR OF TASK1
043005,000039:                                                                                                  #                        C(LST2 +2) = 2CADR OF TASK2
043006,000040:                                                                                                  #                                   .
043007,000041:                                                                                                  #                                   .
043008,000042:                                                                                                  #                        C(LST2 +14)= 2CADR OF TASK8
043009,000043:                                                                                                  #                        C(LST2 +16)= 2CADR OF TASK9
043010,000044: 
043011,000045:                                                                                                  #  WARNINGS -
043012,000046:                                                                                                  #  --------
043013,000047:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
043014,000048:                                                                                                  #        2)      9 TASKS MAXIMUM
043015,000049:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
043016,000050:                                                                                                  #        4)      TASKS END BY TC TASKOVER
043017,000051: 
043018,000052:                                                                                                  #  CALLING SEQUENCE -
043019,000053:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
043020,000054:                                                                                                  #        L       TC      WAITLIST
043021,000055:                                                                                                  #        L+1     2CADR   DESIRED TASK
043022,000056:                                                                                                  #        L+2     (MINOR OF 2CADR)
043023,000057:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
043024,000058: 
043025,000059:                                                                                                  #  TWIDDLE -
043026,000060:                                                                                                  #  -------
043027,000061:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
043028,000062:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
043029,000063:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
043030,000064:                                                                                                  #                L-1     CA      DELTAT
043031,000065:                                                                                                  #                L       TC      TWIDDLE
043032,000066:                                                                                                  #                L+1     ADRES   DESIRED TASK
043033,000067:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
043034,000068: 
043035,000069:                                                                                                  #  NORMAL EXIT MODES -
043036,000070:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
043037,000071: 
043038,000072:                                                                                                  #  ALARM OR ABORT EXIT MODES -
043039,000073:                                                                                                  #        TC      ABORT
043040,000074:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
043041,000075: 
043042,000076:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
043043,000077:                                                                                                  #        ACCOMPLISHED BY FRESH START,--LST2, ..., LST2 +16 = ENDTASK
043044,000078:                                                                                                  #                                      LST1, ..., LST1 +7  = NEG1/2
043045,000079: 
043046,000080:                                                                                                  #  OUTPUT --
043047,000081:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
043048,000082: 
043049,000083:                                                                                                  #  DEBRIS -
043050,000084:                                                                                                  #        CENTRALS - A,Q,L
043051,000085:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
043052,000086: 
043053,000087:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
043054,000088:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
043055,000089:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
043056,000090:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
043057,000091:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
043058,000092:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
043059,000093:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
043060,000094:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
043061,000095:                                                                                                  #                         (Z=0, USUALLY)
043062,000096:                                                                                                  #                LET DELTD  = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
043063,000097:                                                                                                  #                THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
043064,000098:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
043065,000099:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
043066,000100:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
043067,000101:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
043068,000102: 
043069,000103:    5243                                           BLOCK    02                                    
043070,000104:    5243  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
043071,000105: 
043072,000106:    5243                                           COUNT*   $$/WAIT                               
043073,000107:    5243           54001        TWIDDLE            TS       L                                     #  SAVE DELAY TIME IN L
043074,000108:    5244           35006                           CA       POSMAX                                
043075,000109:    5245           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
043076,000110:    5246           30006                           CA       BBANK                                 
043077,000111:    5247           00006                           EXTEND                                         
043078,000112:    5250           04007                           ROR      SUPERBNK                              
043079,000113:    5251           56001                           XCH      L                                     
043080,000114: 
043081,000115:    5252           00004        WAITLIST           INHINT                                         
043082,000116:    5253           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
043083,000117:    5254           54061                           TS       WAITEXIT                              #  WAITEXIT.
043084,000118:    5255           00006                           EXTEND                                         
043085,000119:    5256           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
043086,000120:    5257           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
043087,000121:    5260           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
043088,000122:    5261           35270        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
043089,000123:    5262           56006                           XCH      BBANK                                 
043090,000124:    5263           13042                           TCF      WAIT2                                 
043091,000125: 
043092,000126:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
043093,000127: 
043094,000128:    5264           30062        LVWTLIST           CA       WAITBANK                              
043095,000129:    5265           54006                           TS       BBANK                                 
043096,000130:    5266           50061                           INDEX    WAITEXIT                              
043097,000131:    5267           00002                           TC       2                                     
043098,000132: 
043099,000133:    5270  E3,1400                                  EBANK=   LST1                                  
043100,000134:    5270           02063        WAITBB             BBCON    WAIT2                                 
043101,000135: 
043102,000136:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
043103,000137: 
043104,000138:    5271           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
043105,000139:    5272           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
043106,000140:    5273           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
043107,000141: 
043108,000142:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
043109,000143: 
043110,000144:    5274           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
043111,000145:    5275           54063                           TS       WAITADR                               
043112,000146:    5276           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
043113,000147:    5277           00006                           EXTEND                                         
043114,000148:    5300           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
043115,000149:    5301           54001                           TS       L                                     
043116,000150:    5302           35305                           CAF      DELAYEX                               
043117,000151:    5303           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
043118,000152:    5304           15261                           TCF      DLY2                                  
043119,000153: 
043120,000154:    5305           15317        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
043121,000155: 
043122,000156:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
043123,000157: 
043124,000158:    5306  E3,1400                                  EBANK=   LST1                                  
043125,000159:    5306           72467 73714  ENDTASK            -2CADR   SVCT3                                 
043126,000160: 
043127,000161:    5310           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
043128,000162:    5311           15321                           TCF      TASKOVER                              
043129,000163:    5312           15321                           TCF      TASKOVER                              
043130,000164:    5313           15314                           TCF      +1                                    
043131,000165: 
043132,000166:    5314           37675                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
043133,000167:    5315           05142                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
043134,000168:    5316  E3,1460                                  EBANK=   NBDX                                  
043135,000169:    5316           03555 14063                     2CADR    NBDONLY                               
043136,000170: 
043137,000171:    5320           15321                           TCF      TASKOVER                              
043138,000172: 
043139,000173:                                                                                                  #  BEGIN TASK INSERTION.
043140,000174: 
043141,000175: 01,3042                                           BANK     01                                    
043142,000176: 01,3042                                           COUNT*   $$/WAIT                               
043143,000177: 01,3042           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
043144,000178: 
043145,000179: 01,3043           40026                           CS       TIME3                                 
043146,000180: 01,3044           65017                           AD       BIT8                                  #  BIT 8 = OCT 200
043147,000181: 01,3045           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
043148,000182:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
043149,000183:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
043150,000184:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
043151,000185: 
043152,000186: 01,3046           66063                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
043153,000187: 01,3047           40000                           CS       A                                     #  T - T1 + 1.0 - 201
043154,000188: 
043155,000189:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
043156,000190: 
043157,000191: 01,3050           63176                           AD       OCT40201                              
043158,000192: 01,3051           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
043159,000193: 
043160,000194: 01,3052           10000                           CCS      A                                     #  TEST TD - T1 + 1
043161,000195: 
043162,000196: 01,3053           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
043163,000197: 01,3054           13116                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
043164,000198: 
043165,000199: 01,3055           13056                           NOOP                                           
043166,000200: 01,3056           40002                           CS       Q                                     
043167,000201: 
043168,000202:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
043169,000203:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
043170,000204:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
043171,000205:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
043172,000206: 
043173,000207: 01,3057           65011                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
043174,000208: 01,3060           65011                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
043175,000209: 01,3061           56026                           XCH      TIME3                                 
043176,000210: 01,3062           65010                           AD       NEGMAX                                
043177,000211: 01,3063           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
043178,000212: 01,3064           00006                           EXTEND                                         #  ZERO INDEX Q.
043179,000213: 01,3065           22007                           QXCH     7                                     #  (ZQ)
043180,000214: 
043181,000215: 01,3066           57400        WTLST4             XCH      LST1                                  
043182,000216: 01,3067           57401                           XCH      LST1       +1                         
043183,000217: 01,3070           57402                           XCH      LST1       +2                         
043184,000218: 01,3071           57403                           XCH      LST1       +3                         
043185,000219: 01,3072           57404                           XCH      LST1       +4                         
043186,000220: 01,3073           57405                           XCH      LST1       +5                         
043187,000221: 01,3074           57406                           XCH      LST1       +6                         
043188,000222: 01,3075           57407                           XCH      LST1       +7                         
043189,000223: 
043190,000224: 01,3076           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
043191,000225: 01,3077           50002                           INDEX    Q                                     
043192,000226: 01,3100           13101                           TCF      +1                                    
043193,000227: 
043194,000228: 01,3101           53411                           DXCH     LST2                                  
043195,000229: 01,3102           53413                           DXCH     LST2       +2                         
043196,000230: 01,3103           53415                           DXCH     LST2       +4                         
043197,000231: 01,3104           53417                           DXCH     LST2       +6                         
043198,000232: 01,3105           53421                           DXCH     LST2       +8D                        
043199,000233: 01,3106           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
043200,000234: 01,3107           53425                           DXCH     LST2       +12D                       
043201,000235: 01,3110           53427                           DXCH     LST2       +14D                       
043202,000236: 01,3111           53431                           DXCH     LST2       +16D                       
043203,000237: 01,3112           65306                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
043204,000238:                                                                                                  #  THE LENGTH OF THE LIST.
043205,000239: 01,3113           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
043206,000240: 01,3114           15264                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
043207,000241: 01,3115           13171                           TCF      WTABORT                               #  IT.
043208,000242: 
043209,000243: 01,3116           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
043210,000244: 01,3117           61401                           AD       LST1       +1                         
043211,000245: 01,3120           13124                           TCF      +4                                    
043212,000246: 01,3121           65026                           AD       ONE                                   
043213,000247: 01,3122           03177                           TC       WTLST2                                
043214,000248: 01,3123           00001                           OCT      1                                     
043215,000249: 
043216,000250: 01,3124           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
043217,000251: 01,3125           61402                           AD       LST1       +2                         
043218,000252: 01,3126           13132                           TCF      +4                                    
043219,000253: 01,3127           65026                           AD       ONE                                   
043220,000254: 01,3130           03177                           TC       WTLST2                                
043221,000255: 01,3131           00002                           OCT      2                                     
043222,000256: 
043223,000257: 01,3132           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
043224,000258: 01,3133           61403                           AD       LST1       +3                         
043225,000259: 01,3134           13140                           TCF      +4                                    
043226,000260: 01,3135           65026                           AD       ONE                                   
043227,000261: 01,3136           03177                           TC       WTLST2                                
043228,000262: 01,3137           00003                           OCT      3                                     
043229,000263: 
043230,000264: 01,3140           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
043231,000265: 01,3141           61404                           AD       LST1       +4                         
043232,000266: 01,3142           13146                           TCF      +4                                    
043233,000267: 01,3143           65026                           AD       ONE                                   
043234,000268: 01,3144           03177                           TC       WTLST2                                
043235,000269: 01,3145           00004                           OCT      4                                     
043236,000270: 
043237,000271: 01,3146           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
043238,000272: 01,3147           61405                           AD       LST1       +5                         
043239,000273: 01,3150           13154                           TCF      +4                                    
043240,000274: 01,3151           65026                           AD       ONE                                   
043241,000275: 01,3152           03177                           TC       WTLST2                                
043242,000276: 01,3153           00005                           OCT      5                                     
043243,000277: 
043244,000278: 01,3154           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
043245,000279: 01,3155           61406                           AD       LST1       +6                         
043246,000280: 01,3156           13162                           TCF      +4                                    
043247,000281: 01,3157           65026                           AD       ONE                                   
043248,000282: 01,3160           03177                           TC       WTLST2                                
043249,000283: 01,3161           00006                           OCT      6                                     
043250,000284: 
043251,000285: 01,3162           10000                 +4        CCS      A                                     
043252,000286: 01,3163           61407                           AD       LST1       +7                         
043253,000287: 01,3164           13170                           TCF      +4                                    
043254,000288: 01,3165           65026                           AD       ONE                                   
043255,000289: 01,3166           03177                           TC       WTLST2                                
043256,000290: 01,3167           00007                           OCT      7                                     
043257,000291: 
043258,000292: 01,3170           10000                 +4        CCS      A                                     
043259,000293: 01,3171           05713        WTABORT            TC       ABORT                                 #  NO ROOM IN THE INN.
043260,000294: 01,3172           01203                           OCT      1203                                  
043261,000295: 
043262,000296: 01,3173           65026                           AD       ONE                                   
043263,000297: 01,3174           03177                           TC       WTLST2                                
043264,000298: 01,3175           00010                           OCT      10                                    
043265,000299: 
043266,000300: 01,3176           40201        OCT40201           OCT      40201                                 
043267,000301: 
043268,000302:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
043269,000303:                                                                                                  #                                                   N           N+1
043270,000304:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
043271,000305:                                                                                                  #                                                              N+1
043272,000306:                                                                                                  #  THE LST1 ENTRY -(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
043273,000307:                                                                                                  #                    N+1  N                                 N
043274,000308:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
043275,000309:                                                                                                  #               N+1
043276,000310: 
043277,000311: 01,3177           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
043278,000312: 01,3200           50002                           INDEX    Q                                     
043279,000313: 01,3201           30000                           CAF      0                                     
043280,000314: 01,3202           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
043281,000315: 
043282,000316: 01,3203           35026                           CAF      ONE                                   
043283,000317: 01,3204           60064                           AD       WAITTEMP                              
043284,000318: 01,3205           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
043285,000319: 01,3206           27377                           ADS      LST1       -1                         #                 N
043286,000320: 
043287,000321: 01,3207           40064                           CS       WAITTEMP                              
043288,000322: 01,3210           50002                           INDEX    Q                                     
043289,000323: 01,3211           13066                           TCF      WTLST4                                
043290,000324: 
043291,000325:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
043292,000326: 
043293,000327:                                                                                                  #        C(LST1  )       =       - (T2 - T1) + 1
043294,000328:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
043295,000329:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
043296,000330:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
043297,000331:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
043298,000332: 
043299,000333:                                                                                                  #        C(LST2   )      =       2CADR TASK1
043300,000334:                                                                                                  #        C(LST2+2 )      =       2CADR TASK2
043301,000335:                                                                                                  #        C(LST2+4 )      =       2CADR TASK3
043302,000336:                                                                                                  #        C(LST2+6 )      =       2CADR TASK4
043303,000337:                                                                                                  #        C(LST2+8 )      =       2CADR TASK5
043304,000338:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
043305,000339: 
043306,000340:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
043307,000341: 
043308,000342: 01,3212           00006        T3RUPT             EXTEND                                         
043309,000343: 01,3213           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
043310,000344: 01,3214           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
043311,000345: 01,3215           00006                           EXTEND                                         
043312,000346: 01,3216           22012                           QXCH     QRUPT                                 
043313,000347: 
043314,000348: 01,3217           35007        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
043315,000349: 01,3220           57407                           XCH      LST1       +7                         
043316,000350: 01,3221           57406                           XCH      LST1       +6                         
043317,000351: 01,3222           57405                           XCH      LST1       +5                         
043318,000352: 01,3223           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
043319,000353: 01,3224           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
043320,000354: 01,3225           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
043321,000355: 01,3226           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
043322,000356: 01,3227           57400                           XCH      LST1                                  
043323,000357: 01,3230           65006                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
043324,000358: 01,3231           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
043325,000359: 01,3232           54734                           TS       RUPTAGN                               
043326,000360: 01,3233           45030                           CS       ZERO                                  
043327,000361: 01,3234           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
043328,000362: 
043329,000363: 01,3235           00006                           EXTEND                                         #  DISPATCH TASK.
043330,000364: 01,3236           45307                           DCS      ENDTASK                               
043331,000365: 01,3237           53431                           DXCH     LST2       +16D                       
043332,000366: 01,3240           53427                           DXCH     LST2       +14D                       
043333,000367: 01,3241           53425                           DXCH     LST2       +12D                       
043334,000368: 01,3242           53423                           DXCH     LST2       +10D                       
043335,000369: 01,3243           53421                           DXCH     LST2       +8D                        
043336,000370: 01,3244           53417                           DXCH     LST2       +6                         
043337,000371: 01,3245           53415                           DXCH     LST2       +4                         
043338,000372: 01,3246           53413                           DXCH     LST2       +2                         
043339,000373: 01,3247           53411                           DXCH     LST2                                  
043340,000374: 
043341,000375: 01,3250           56001                           XCH      L                                     
043342,000376: 01,3251           00006                           EXTEND                                         
043343,000377: 01,3252           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
043344,000378: 01,3253           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
043345,000379: 01,3254           52006                           DTCB                                           
043346,000380: 
043347,000381:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
043348,000382: 
043349,000383:    5321                                           BLOCK    02                                    
043350,000384:    5321                                           COUNT*   $$/WAIT                               
043351,000385:    5321           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
043352,000386:    5322           35270                           CAF      WAITBB                                
043353,000387:    5323           54006                           TS       BBANK                                 
043354,000388:    5324           13217                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
043355,000389: 
043356,000390:    5325           30016                           CA       BANKRUPT                              
043357,000391:    5326           00006                           EXTEND                                         
043358,000392:    5327           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
043359,000393: 
043360,000394:    5330           00006        RESUME             EXTEND                                         
043361,000395:    5331           22012                           QXCH     QRUPT                                 
043362,000396:    5332           30016        NOQRSM             CA       BANKRUPT                              
043363,000397:    5333           56006                           XCH      BBANK                                 
043364,000398:    5334           52011        NOQBRSM            DXCH     ARUPT                                 
043365,000399:    5335           00003                           RELINT                                         
043366,000400:    5336           50017                           RESUME                                         
043367,000401: 
043368,000402:                                                                                                  #  LONGCALL
043369,000403:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
043370,000404:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
043371,000405:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
043372,000406: 
043373,000407:                                                                                                  #  FUNCTIONAL DESCRIPTION -
043374,000408:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
043375,000409:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
043376,000410:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
043377,000411:                                                                                                  #        START
043378,000412:                                                                                                  #  CALLING SEQUENCE -
043379,000413:                                                                                                  #                EXTEND
043380,000414:                                                                                                  #                DCA     TIMELOC
043381,000415:                                                                                                  #                TC      LONGCALL
043382,000416:                                                                                                  #                2CADR   TASKTODO
043383,000417:                                                                                                  #  NORMAL EXIT MODE -
043384,000418:                                                                                                  #        1).     TC      WAITLIST
043385,000419:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
043386,000420:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
043387,000421:                                                                                                  #  ALARM OR ABORT EXIT MODE -
043388,000422:                                                                                                  #        NONE
043389,000423:                                                                                                  #  OUTPUT -
043390,000424:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
043391,000425:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
043392,000426:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
043393,000427:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
043394,000428:                                                                                                  #  ERASABLE INITIALIZATION -
043395,000429:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
043396,000430:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
043397,000431:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
043398,000432:                                                                                                  #  DEBRIS -
043399,000433:                                                                                                  #        A,Q,L
043400,000434:                                                                                                  #        LONGCADR AND LONGCADR+1
043401,000435:                                                                                                  #        LONGEXIT AND LONGEXIT+1
043402,000436:                                                                                                  #        LONGTIME AND LONGTIME+1
043403,000437:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
043404,000438: 
043405,000439:    5337                                           BLOCK    02                                    
043406,000440:    5337  E3,1400                                  EBANK=   LST1                                  
043407,000441:    5337           53165        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
043408,000442: 
043409,000443:    5340           00006                           EXTEND                                         #  OBTAIN THE 2CADR
043410,000444:    5341           50002                           NDX      Q                                     
043411,000445:    5342           30001                           DCA      0                                     
043412,000446:    5343           53161                           DXCH     LONGCADR                              
043413,000447: 
043414,000448:    5344           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
043415,000449:    5345           35350                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
043416,000450:    5346           52006                           DTCB                                           
043417,000451: 
043418,000452:    5347  E3,1400                                  EBANK=   LST1                                  
043419,000453:    5347           03255 02063  LGCL2CDR           2CADR    LNGCALL2                              
043420,000454: 
043421,000455:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
043422,000456: 
043423,000457: 01,3255                                           BANK     01                                    
043424,000458: 01,3255                                           COUNT*   $$/WAIT                               
043425,000459: 01,3255           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
043426,000460: 01,3256           35025                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
043427,000461: 01,3257           26002                           ADS      Q                                     
043428,000462: 01,3260           55434                           TS       LONGEXIT                              
043429,000463: 
043430,000464:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
043431,000465: 
043432,000466: 01,3261           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
043433,000467: 01,3262           43273                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
043434,000468: 01,3263           21165                           DAS      LONGTIME                              
043435,000469: 
043436,000470: 01,3264           11165                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
043437,000471: 01,3265           13304                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
043438,000472:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
043439,000473:                                                                                                  #  BASIC INSTRUCTIONS
043440,000474:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
043441,000475:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
043442,000476:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
043443,000477: 01,3266           13267                           NOOP                                           #  CAN:T GET HERE **********
043444,000478: 01,3267           13270                           TCF      +1                                    
043445,000479: 01,3270           11164                           CCS      LONGTIME                              
043446,000480: 01,3271           13304                           TCF      MUCHTIME                              
043447,000481: 01,3272           00000        DPBIT14            OCT      00000                                 
043448,000482: 01,3273           20000                           OCT      20000                                 
043449,000483: 
043450,000484:                                                                                                  #  LONGCALL
043451,000485: 01,3274           35011        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
043452,000486: 01,3275           27165                           ADS      LONGTIME   +1                         
043453,000487: 01,3276           05252                           TC       WAITLIST                              
043454,000488: 01,3277  E3,1400                                  EBANK=   LST1                                  
043455,000489: 01,3277           03311 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
043456,000490: 
043457,000491: 01,3301           33313        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
043458,000492: 01,3302           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
043459,000493: 01,3303           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
043460,000494: 
043461,000495: 01,3304           35011        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
043462,000496: 01,3305           05252                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
043463,000497: 01,3306  E3,1400                                  EBANK=   LST1                                  
043464,000498: 01,3306           03261 02063                     2CADR    LONGCYCL                              
043465,000499: 
043466,000500: 01,3310           13301                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
043467,000501: 
043468,000502:                                                                                                  #  *** WAITLIST TASK GETCADR ***
043469,000503: 
043470,000504: 01,3311           53161        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
043471,000505: 01,3312           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
043472,000506: 
043473,000507: 01,3313           05321        TSKOVCDR           GENADR   TASKOVER                              

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