Source Code

These source code files are an attempted reconstruction of Sundance revision 306, 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
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. 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.

043142,000002:                                                                                                  ## Copyright:   Public domain.
043143,000003:                                                                                                  ## Filename:    WAITLIST.agc
043144,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
043145,000005:                                                                                                  ##              as closely as possible with available information. Sundance
043146,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
043147,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
043148,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
043149,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
043150,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
043151,000011:                                                                                                  ##              or the Sundance GSOPs.
043152,000012:                                                                                                  ## Assembler:   yaYUL
043153,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043154,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043155,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
043156,000016:                                                                                                  ##              2020-07-29 MAS  Added CKIMUSE and SVCT3X to SVCT3.
043157,000017: 
043158,000018: 
043159,000019:                                                                                                  #  PROGRAM DESCRIPTION                                                           DATE - 10 OCTOBER 1966
043160,000020:                                                                                                  #  MOD NO - 2                                                                    LOG SECTION - WAITLIST
043161,000021:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)                          ASSEMBLY SUNBURST REV 5
043162,000022:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
043163,000023:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
043164,000024: 
043165,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION -
043166,000026:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
043167,000027:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
043168,000028:                                                                                                  #        FOLLOW.
043169,000029: 
043170,000030:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
043171,000031: 
043172,000032:                                                                                                  #                        C(LST1)    = -(T2-T1)+1
043173,000033:                                                                                                  #                        C(LST1 +1) = -(T3-T2)+1
043174,000034:                                                                                                  #                        C(LST1 +2) = -(T4-T3)+1
043175,000035:                                                                                                  #                                   .
043176,000036:                                                                                                  #                                   .
043177,000037:                                                                                                  #                        C(LST1 +6) = -(T8-T7)+1
043178,000038:                                                                                                  #                        C(LST1 +7) = -(T9-T8)+1
043179,000039: 
043180,000040:                                                                                                  #                        C(LST2)    = 2CADR OF TASK1
043181,000041:                                                                                                  #                        C(LST2 +2) = 2CADR OF TASK2
043182,000042:                                                                                                  #                                   .
043183,000043:                                                                                                  #                                   .
043184,000044:                                                                                                  #                        C(LST2 +14)= 2CADR OF TASK8
043185,000045:                                                                                                  #                        C(LST2 +16)= 2CADR OF TASK9
043186,000046: 
043187,000047:                                                                                                  #  WARNINGS -
043188,000048:                                                                                                  #  --------
043189,000049:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
043190,000050:                                                                                                  #        2)      9 TASKS MAXIMUM
043191,000051:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
043192,000052:                                                                                                  #        4)      TASKS END BY TC TASKOVER
043193,000053: 
043194,000054:                                                                                                  #  CALLING SEQUENCE -
043195,000055:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
043196,000056:                                                                                                  #        L       TC      WAITLIST
043197,000057:                                                                                                  #        L+1     2CADR   DESIRED TASK
043198,000058:                                                                                                  #        L+2     (MINOR OF 2CADR)
043199,000059:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
043200,000060: 
043201,000061:                                                                                                  #  TWIDDLE -
043202,000062:                                                                                                  #  -------
043203,000063:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
043204,000064:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
043205,000065:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
043206,000066:                                                                                                  #                L-1     CA      DELTAT
043207,000067:                                                                                                  #                L       TC      TWIDDLE
043208,000068:                                                                                                  #                L+1     ADRES   DESIRED TASK
043209,000069:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
043210,000070: 
043211,000071:                                                                                                  #  NORMAL EXIT MODES -
043212,000072:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
043213,000073: 
043214,000074:                                                                                                  #  ALARM OR ABORT EXIT MODES -
043215,000075:                                                                                                  #        TC      ABORT
043216,000076:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
043217,000077: 
043218,000078:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
043219,000079:                                                                                                  #        ACCOMPLISHED BY FRESH START,--LST2, ..., LST2 +16 = ENDTASK
043220,000080:                                                                                                  #                                      LST1, ..., LST1 +7  = NEG1/2
043221,000081: 
043222,000082:                                                                                                  #  OUTPUT --
043223,000083:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
043224,000084: 
043225,000085:                                                                                                  #  DEBRIS -
043226,000086:                                                                                                  #        CENTRALS - A,Q,L
043227,000087:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
043228,000088: 
043229,000089:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
043230,000090:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
043231,000091:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
043232,000092:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
043233,000093:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
043234,000094:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
043235,000095:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
043236,000096:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
043237,000097:                                                                                                  #                         (Z=0, USUALLY)
043238,000098:                                                                                                  #                LET DELTD  = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
043239,000099:                                                                                                  #                THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
043240,000100:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
043241,000101:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
043242,000102:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
043243,000103:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
043244,000104: 
043245,000105:    5243                                           BLOCK    02                                    
043246,000106:    5243  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
043247,000107: 
043248,000108:    5243                                           COUNT*   $$/WAIT                               
043249,000109:    5243           54001        TWIDDLE            TS       L                                     #  SAVE DELAY TIME IN L
043250,000110:    5244           35006                           CA       POSMAX                                
043251,000111:    5245           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
043252,000112:    5246           30006                           CA       BBANK                                 
043253,000113:    5247           00006                           EXTEND                                         
043254,000114:    5250           04007                           ROR      SUPERBNK                              
043255,000115:    5251           56001                           XCH      L                                     
043256,000116: 
043257,000117:    5252           00004        WAITLIST           INHINT                                         
043258,000118:    5253           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
043259,000119:    5254           54061                           TS       WAITEXIT                              #  WAITEXIT.
043260,000120:    5255           00006                           EXTEND                                         
043261,000121:    5256           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
043262,000122:    5257           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
043263,000123:    5260           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
043264,000124:    5261           35270        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
043265,000125:    5262           56006                           XCH      BBANK                                 
043266,000126:    5263           13042                           TCF      WAIT2                                 
043267,000127: 
043268,000128:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
043269,000129: 
043270,000130:    5264           30062        LVWTLIST           CA       WAITBANK                              
043271,000131:    5265           54006                           TS       BBANK                                 
043272,000132:    5266           50061                           INDEX    WAITEXIT                              
043273,000133:    5267           00002                           TC       2                                     
043274,000134: 
043275,000135:    5270  E3,1400                                  EBANK=   LST1                                  
043276,000136:    5270           02063        WAITBB             BBCON    WAIT2                                 
043277,000137: 
043278,000138:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
043279,000139: 
043280,000140:    5271           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
043281,000141:    5272           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
043282,000142:    5273           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
043283,000143: 
043284,000144:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
043285,000145: 
043286,000146:    5274           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
043287,000147:    5275           54063                           TS       WAITADR                               
043288,000148:    5276           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
043289,000149:    5277           00006                           EXTEND                                         
043290,000150:    5300           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
043291,000151:    5301           54001                           TS       L                                     
043292,000152:    5302           35305                           CAF      DELAYEX                               
043293,000153:    5303           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
043294,000154:    5304           15261                           TCF      DLY2                                  
043295,000155: 
043296,000156:    5305           15327        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
043297,000157: 
043298,000158:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
043299,000159: 
043300,000160:    5306  E3,1400                                  EBANK=   LST1                                  
043301,000161:    5306           72467 73714  ENDTASK            -2CADR   SVCT3                                 
043302,000162: 
043303,000163:    5310           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
043304,000164:    5311           15331                           TCF      TASKOVER                              
043305,000165:    5312           15331                           TCF      TASKOVER                              
043306,000166:    5313           15314                           TCF      +1                                    
043307,000167: 

This block of five instructions, as well as the three at SVCT3X, were very likely added in Sundance 302.

043310,000170:    5314           11306        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
043311,000171:    5315           15326                           TCF      SVCT3X                                #  IMUSTALL.
043312,000172:    5316           15321                           TCF      +3                                    
043313,000173:    5317           15326                           TCF      SVCT3X                                
043314,000174:    5320           15326                           TCF      SVCT3X                                
043315,000175: 
043316,000176:    5321           37675                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
043317,000177:    5322           05142                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
043318,000178:    5323  E3,1460                                  EBANK=   NBDX                                  
043319,000179:    5323           03555 14063                     2CADR    NBDONLY                               
043320,000180: 
043321,000181:    5325           15331                           TCF      TASKOVER                              
043322,000182: 
043323,000183:    5326           05271        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
043324,000184:    5327           00764                           DEC      500        B-14                       
043325,000185:    5330           05310                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
043326,000186: 
043327,000187:                                                                                                  #  BEGIN TASK INSERTION.
043328,000188: 
043329,000189: 01,3042                                           BANK     01                                    
043330,000190: 01,3042                                           COUNT*   $$/WAIT                               
043331,000191: 01,3042           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
043332,000192: 
043333,000193: 01,3043           40026                           CS       TIME3                                 
043334,000194: 01,3044           65017                           AD       BIT8                                  #  BIT 8 = OCT 200
043335,000195: 01,3045           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
043336,000196:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
043337,000197:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
043338,000198:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
043339,000199: 
043340,000200: 01,3046           66063                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
043341,000201: 01,3047           40000                           CS       A                                     #  T - T1 + 1.0 - 201
043342,000202: 
043343,000203:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
043344,000204: 
043345,000205: 01,3050           63176                           AD       OCT40201                              
043346,000206: 01,3051           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
043347,000207: 
043348,000208: 01,3052           10000                           CCS      A                                     #  TEST TD - T1 + 1
043349,000209: 
043350,000210: 01,3053           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
043351,000211: 01,3054           13116                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
043352,000212: 
043353,000213: 01,3055           13056                           NOOP                                           
043354,000214: 01,3056           40002                           CS       Q                                     
043355,000215: 
043356,000216:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
043357,000217:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
043358,000218:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
043359,000219:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
043360,000220: 
043361,000221: 01,3057           65011                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
043362,000222: 01,3060           65011                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
043363,000223: 01,3061           56026                           XCH      TIME3                                 
043364,000224: 01,3062           65010                           AD       NEGMAX                                
043365,000225: 01,3063           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
043366,000226: 01,3064           00006                           EXTEND                                         #  ZERO INDEX Q.
043367,000227: 01,3065           22007                           QXCH     7                                     #  (ZQ)
043368,000228: 
043369,000229: 01,3066           57400        WTLST4             XCH      LST1                                  
043370,000230: 01,3067           57401                           XCH      LST1       +1                         
043371,000231: 01,3070           57402                           XCH      LST1       +2                         
043372,000232: 01,3071           57403                           XCH      LST1       +3                         
043373,000233: 01,3072           57404                           XCH      LST1       +4                         
043374,000234: 01,3073           57405                           XCH      LST1       +5                         
043375,000235: 01,3074           57406                           XCH      LST1       +6                         
043376,000236: 01,3075           57407                           XCH      LST1       +7                         
043377,000237: 
043378,000238: 01,3076           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
043379,000239: 01,3077           50002                           INDEX    Q                                     
043380,000240: 01,3100           13101                           TCF      +1                                    
043381,000241: 
043382,000242: 01,3101           53411                           DXCH     LST2                                  
043383,000243: 01,3102           53413                           DXCH     LST2       +2                         
043384,000244: 01,3103           53415                           DXCH     LST2       +4                         
043385,000245: 01,3104           53417                           DXCH     LST2       +6                         
043386,000246: 01,3105           53421                           DXCH     LST2       +8D                        
043387,000247: 01,3106           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
043388,000248: 01,3107           53425                           DXCH     LST2       +12D                       
043389,000249: 01,3110           53427                           DXCH     LST2       +14D                       
043390,000250: 01,3111           53431                           DXCH     LST2       +16D                       
043391,000251: 01,3112           65306                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
043392,000252:                                                                                                  #  THE LENGTH OF THE LIST.
043393,000253: 01,3113           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
043394,000254: 01,3114           15264                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
043395,000255: 01,3115           13171                           TCF      WTABORT                               #  IT.
043396,000256: 
043397,000257: 01,3116           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
043398,000258: 01,3117           61401                           AD       LST1       +1                         
043399,000259: 01,3120           13124                           TCF      +4                                    
043400,000260: 01,3121           65026                           AD       ONE                                   
043401,000261: 01,3122           03177                           TC       WTLST2                                
043402,000262: 01,3123           00001                           OCT      1                                     
043403,000263: 
043404,000264: 01,3124           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
043405,000265: 01,3125           61402                           AD       LST1       +2                         
043406,000266: 01,3126           13132                           TCF      +4                                    
043407,000267: 01,3127           65026                           AD       ONE                                   
043408,000268: 01,3130           03177                           TC       WTLST2                                
043409,000269: 01,3131           00002                           OCT      2                                     
043410,000270: 
043411,000271: 01,3132           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
043412,000272: 01,3133           61403                           AD       LST1       +3                         
043413,000273: 01,3134           13140                           TCF      +4                                    
043414,000274: 01,3135           65026                           AD       ONE                                   
043415,000275: 01,3136           03177                           TC       WTLST2                                
043416,000276: 01,3137           00003                           OCT      3                                     
043417,000277: 
043418,000278: 01,3140           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
043419,000279: 01,3141           61404                           AD       LST1       +4                         
043420,000280: 01,3142           13146                           TCF      +4                                    
043421,000281: 01,3143           65026                           AD       ONE                                   
043422,000282: 01,3144           03177                           TC       WTLST2                                
043423,000283: 01,3145           00004                           OCT      4                                     
043424,000284: 
043425,000285: 01,3146           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
043426,000286: 01,3147           61405                           AD       LST1       +5                         
043427,000287: 01,3150           13154                           TCF      +4                                    
043428,000288: 01,3151           65026                           AD       ONE                                   
043429,000289: 01,3152           03177                           TC       WTLST2                                
043430,000290: 01,3153           00005                           OCT      5                                     
043431,000291: 
043432,000292: 01,3154           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
043433,000293: 01,3155           61406                           AD       LST1       +6                         
043434,000294: 01,3156           13162                           TCF      +4                                    
043435,000295: 01,3157           65026                           AD       ONE                                   
043436,000296: 01,3160           03177                           TC       WTLST2                                
043437,000297: 01,3161           00006                           OCT      6                                     
043438,000298: 
043439,000299: 01,3162           10000                 +4        CCS      A                                     
043440,000300: 01,3163           61407                           AD       LST1       +7                         
043441,000301: 01,3164           13170                           TCF      +4                                    
043442,000302: 01,3165           65026                           AD       ONE                                   
043443,000303: 01,3166           03177                           TC       WTLST2                                
043444,000304: 01,3167           00007                           OCT      7                                     
043445,000305: 
043446,000306: 01,3170           10000                 +4        CCS      A                                     
043447,000307: 01,3171           05716        WTABORT            TC       ABORT                                 #  NO ROOM IN THE INN.
043448,000308: 01,3172           01203                           OCT      1203                                  
043449,000309: 
043450,000310: 01,3173           65026                           AD       ONE                                   
043451,000311: 01,3174           03177                           TC       WTLST2                                
043452,000312: 01,3175           00010                           OCT      10                                    
043453,000313: 
043454,000314: 01,3176           40201        OCT40201           OCT      40201                                 
043455,000315: 
043456,000316:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
043457,000317:                                                                                                  #                                                   N           N+1
043458,000318:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
043459,000319:                                                                                                  #                                                              N+1
043460,000320:                                                                                                  #  THE LST1 ENTRY -(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
043461,000321:                                                                                                  #                    N+1  N                                 N
043462,000322:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
043463,000323:                                                                                                  #               N+1
043464,000324: 
043465,000325: 01,3177           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
043466,000326: 01,3200           50002                           INDEX    Q                                     
043467,000327: 01,3201           30000                           CAF      0                                     
043468,000328: 01,3202           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
043469,000329: 
043470,000330: 01,3203           35026                           CAF      ONE                                   
043471,000331: 01,3204           60064                           AD       WAITTEMP                              
043472,000332: 01,3205           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
043473,000333: 01,3206           27377                           ADS      LST1       -1                         #                 N
043474,000334: 
043475,000335: 01,3207           40064                           CS       WAITTEMP                              
043476,000336: 01,3210           50002                           INDEX    Q                                     
043477,000337: 01,3211           13066                           TCF      WTLST4                                
043478,000338: 
043479,000339:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
043480,000340: 
043481,000341:                                                                                                  #        C(LST1  )       =       - (T2 - T1) + 1
043482,000342:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
043483,000343:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
043484,000344:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
043485,000345:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
043486,000346: 
043487,000347:                                                                                                  #        C(LST2   )      =       2CADR TASK1
043488,000348:                                                                                                  #        C(LST2+2 )      =       2CADR TASK2
043489,000349:                                                                                                  #        C(LST2+4 )      =       2CADR TASK3
043490,000350:                                                                                                  #        C(LST2+6 )      =       2CADR TASK4
043491,000351:                                                                                                  #        C(LST2+8 )      =       2CADR TASK5
043492,000352:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
043493,000353: 
043494,000354:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
043495,000355: 
043496,000356: 01,3212           00006        T3RUPT             EXTEND                                         
043497,000357: 01,3213           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
043498,000358: 01,3214           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
043499,000359: 01,3215           00006                           EXTEND                                         
043500,000360: 01,3216           22012                           QXCH     QRUPT                                 
043501,000361: 
043502,000362: 01,3217           35007        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
043503,000363: 01,3220           57407                           XCH      LST1       +7                         
043504,000364: 01,3221           57406                           XCH      LST1       +6                         
043505,000365: 01,3222           57405                           XCH      LST1       +5                         
043506,000366: 01,3223           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
043507,000367: 01,3224           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
043508,000368: 01,3225           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
043509,000369: 01,3226           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
043510,000370: 01,3227           57400                           XCH      LST1                                  
043511,000371: 01,3230           65006                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
043512,000372: 01,3231           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
043513,000373: 01,3232           54734                           TS       RUPTAGN                               
043514,000374: 01,3233           45030                           CS       ZERO                                  
043515,000375: 01,3234           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
043516,000376: 
043517,000377: 01,3235           00006                           EXTEND                                         #  DISPATCH TASK.
043518,000378: 01,3236           45307                           DCS      ENDTASK                               
043519,000379: 01,3237           53431                           DXCH     LST2       +16D                       
043520,000380: 01,3240           53427                           DXCH     LST2       +14D                       
043521,000381: 01,3241           53425                           DXCH     LST2       +12D                       
043522,000382: 01,3242           53423                           DXCH     LST2       +10D                       
043523,000383: 01,3243           53421                           DXCH     LST2       +8D                        
043524,000384: 01,3244           53417                           DXCH     LST2       +6                         
043525,000385: 01,3245           53415                           DXCH     LST2       +4                         
043526,000386: 01,3246           53413                           DXCH     LST2       +2                         
043527,000387: 01,3247           53411                           DXCH     LST2                                  
043528,000388: 
043529,000389: 01,3250           56001                           XCH      L                                     
043530,000390: 01,3251           00006                           EXTEND                                         
043531,000391: 01,3252           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
043532,000392: 01,3253           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
043533,000393: 01,3254           52006                           DTCB                                           
043534,000394: 
043535,000395:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
043536,000396: 
043537,000397:    5331                                           BLOCK    02                                    
043538,000398:    5331                                           COUNT*   $$/WAIT                               
043539,000399:    5331           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
043540,000400:    5332           35270                           CAF      WAITBB                                
043541,000401:    5333           54006                           TS       BBANK                                 
043542,000402:    5334           13217                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
043543,000403: 
043544,000404:    5335           30016                           CA       BANKRUPT                              
043545,000405:    5336           00006                           EXTEND                                         
043546,000406:    5337           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
043547,000407: 
043548,000408:    5340           00006        RESUME             EXTEND                                         
043549,000409:    5341           22012                           QXCH     QRUPT                                 
043550,000410:    5342           30016        NOQRSM             CA       BANKRUPT                              
043551,000411:    5343           56006                           XCH      BBANK                                 
043552,000412:    5344           52011        NOQBRSM            DXCH     ARUPT                                 
043553,000413:    5345           00003                           RELINT                                         
043554,000414:    5346           50017                           RESUME                                         
043555,000415: 
043556,000416:                                                                                                  #  LONGCALL
043557,000417:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
043558,000418:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
043559,000419:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
043560,000420: 
043561,000421:                                                                                                  #  FUNCTIONAL DESCRIPTION -
043562,000422:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
043563,000423:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
043564,000424:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
043565,000425:                                                                                                  #        START
043566,000426:                                                                                                  #  CALLING SEQUENCE -
043567,000427:                                                                                                  #                EXTEND
043568,000428:                                                                                                  #                DCA     TIMELOC
043569,000429:                                                                                                  #                TC      LONGCALL
043570,000430:                                                                                                  #                2CADR   TASKTODO
043571,000431:                                                                                                  #  NORMAL EXIT MODE -
043572,000432:                                                                                                  #        1).     TC      WAITLIST
043573,000433:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
043574,000434:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
043575,000435:                                                                                                  #  ALARM OR ABORT EXIT MODE -
043576,000436:                                                                                                  #        NONE
043577,000437:                                                                                                  #  OUTPUT -
043578,000438:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
043579,000439:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
043580,000440:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
043581,000441:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
043582,000442:                                                                                                  #  ERASABLE INITIALIZATION -
043583,000443:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
043584,000444:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
043585,000445:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
043586,000446:                                                                                                  #  DEBRIS -
043587,000447:                                                                                                  #        A,Q,L
043588,000448:                                                                                                  #        LONGCADR AND LONGCADR+1
043589,000449:                                                                                                  #        LONGEXIT AND LONGEXIT+1
043590,000450:                                                                                                  #        LONGTIME AND LONGTIME+1
043591,000451:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
043592,000452: 
043593,000453:    5347                                           BLOCK    02                                    
043594,000454:    5347  E3,1400                                  EBANK=   LST1                                  
043595,000455:    5347           53165        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
043596,000456: 
043597,000457:    5350           00006                           EXTEND                                         #  OBTAIN THE 2CADR
043598,000458:    5351           50002                           NDX      Q                                     
043599,000459:    5352           30001                           DCA      0                                     
043600,000460:    5353           53161                           DXCH     LONGCADR                              
043601,000461: 
043602,000462:    5354           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
043603,000463:    5355           35360                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
043604,000464:    5356           52006                           DTCB                                           
043605,000465: 
043606,000466:    5357  E3,1400                                  EBANK=   LST1                                  
043607,000467:    5357           03255 02063  LGCL2CDR           2CADR    LNGCALL2                              
043608,000468: 
043609,000469:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
043610,000470: 
043611,000471: 01,3255                                           BANK     01                                    
043612,000472: 01,3255                                           COUNT*   $$/WAIT                               
043613,000473: 01,3255           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
043614,000474: 01,3256           35025                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
043615,000475: 01,3257           26002                           ADS      Q                                     
043616,000476: 01,3260           55434                           TS       LONGEXIT                              
043617,000477: 
043618,000478:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
043619,000479: 
043620,000480: 01,3261           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
043621,000481: 01,3262           43273                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
043622,000482: 01,3263           21165                           DAS      LONGTIME                              
043623,000483: 
043624,000484: 01,3264           11165                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
043625,000485: 01,3265           13304                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
043626,000486:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
043627,000487:                                                                                                  #  BASIC INSTRUCTIONS
043628,000488:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
043629,000489:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
043630,000490:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
043631,000491: 01,3266           13267                           NOOP                                           #  CAN:T GET HERE **********
043632,000492: 01,3267           13270                           TCF      +1                                    
043633,000493: 01,3270           11164                           CCS      LONGTIME                              
043634,000494: 01,3271           13304                           TCF      MUCHTIME                              
043635,000495: 01,3272           00000        DPBIT14            OCT      00000                                 
043636,000496: 01,3273           20000                           OCT      20000                                 
043637,000497: 
043638,000498:                                                                                                  #  LONGCALL
043639,000499: 01,3274           35011        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
043640,000500: 01,3275           27165                           ADS      LONGTIME   +1                         
043641,000501: 01,3276           05252                           TC       WAITLIST                              
043642,000502: 01,3277  E3,1400                                  EBANK=   LST1                                  
043643,000503: 01,3277           03311 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
043644,000504: 
043645,000505: 01,3301           33313        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
043646,000506: 01,3302           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
043647,000507: 01,3303           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
043648,000508: 
043649,000509: 01,3304           35011        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
043650,000510: 01,3305           05252                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
043651,000511: 01,3306  E3,1400                                  EBANK=   LST1                                  
043652,000512: 01,3306           03261 02063                     2CADR    LONGCYCL                              
043653,000513: 
043654,000514: 01,3310           13301                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
043655,000515: 
043656,000516:                                                                                                  #  *** WAITLIST TASK GETCADR ***
043657,000517: 
043658,000518: 01,3311           53161        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
043659,000519: 01,3312           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
043660,000520: 
043661,000521: 01,3313           05331        TSKOVCDR           GENADR   TASKOVER                              

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