Source Code

These source-code files are part of a reconstructed copy of Comanche 51, the initial release (though not the final mission release) of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software. The flown, final release was Comanche 55. The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 51, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 55, whose original source code is available. Comanche 55 source code was then modified by undoing changes known to have been made between revisions 51 and 55. The most-significant steps involved reverting changes related to the R-2 lunar potential model, the details of which were known from the previous, separate, independent reconstruction of the Apollo 10 Lunar Module software Luminary 69/2. The now-reconstructed Comanche 51 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 or Luminary 69 printouts, although the source code would likely have different page numbers in a contemporary Comanche 51 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 55. Here's a guide to some of the Apollo documentation relevant to those annotations:
Among documentation not actually referenced in the annotations, there is a short writeup about the reconstruction process in our software repository that may be helpful in understanding it from a different perspective. There's also a handy table that lists what the number of memory-words should be for each routine in Comanche 51, which could make a nice double-check; however, we've not performed that double-check ourselves.

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

051944,000002:                                                                                                  ## Copyright:   Public domain.
051945,000003:                                                                                                  ## Filename:    WAITLIST.agc
051946,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
051947,000005:                                                                                                  ##              It is part of the reconstructed source code for the
051948,000006:                                                                                                  ##              original release of the flight software for the Command
051949,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
051950,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
051951,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
051952,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
051953,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
051954,000012:                                                                                                  ##              reconstruction is correct.
051955,000013:                                                                                                  ## Reference:   pp. 1221-1235
051956,000014:                                                                                                  ## Assembler:   yaYUL
051957,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
051958,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
051959,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
051960,000018: 

Page 1221

051962,000020:                                                                                                  #  PROGRAM DESCRIPTION                                           DATE - 10 OCTOBER 1966
051963,000021:                                                                                                  #  MOD NO - 2                                                    LOG SECTION - WAITLIST
051964,000022:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)          ASSEMBLY SUNBURST REV 5
051965,000023:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
051966,000024:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
051967,000025: 
051968,000026:                                                                                                  #  FUNCTIONAL DESCRIPTION -
051969,000027:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
051970,000028:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
051971,000029:                                                                                                  #        FOLLOW.
051972,000030: 
051973,000031:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
051974,000032: 
051975,000033:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
051976,000034:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
051977,000035:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
051978,000036:                                                                                                  #                                        .
051979,000037:                                                                                                  #                                        .
051980,000038:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
051981,000039:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
051982,000040: 
051983,000041:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
051984,000042:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
051985,000043:                                                                                                  #                                        .
051986,000044:                                                                                                  #                                        .
051987,000045:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
051988,000046:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
051989,000047: 
051990,000048:                                                                                                  #  WARNINGS-
051991,000049:                                                                                                  #  --------
051992,000050:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
051993,000051:                                                                                                  #        2)      9 TASKS MAXIMUM
051994,000052:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
051995,000053:                                                                                                  #        4)      TASKS END BY TC TASKOVER
051996,000054: 
051997,000055:                                                                                                  #  CALLING SEQUENCE -
051998,000056:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
051999,000057:                                                                                                  #        L       TC      WAITLIST
052000,000058:                                                                                                  #        L+1     2CADR   DESIRED TASK
052001,000059:                                                                                                  #        L+2     (MINOR OF 2CADR)
052002,000060:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
052003,000061: 
052004,000062:                                                                                                  #  TWIDDLE-
052005,000063:                                                                                                  #  -------
052006,000064:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
052007,000065:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1222

052009,000067:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
052010,000068:                                                                                                  #                L-1     CA      DELTAT
052011,000069:                                                                                                  #                L       TC      TWIDDLE
052012,000070:                                                                                                  #                L+1     ADRES   DESIRED TASK
052013,000071:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
052014,000072: 
052015,000073:                                                                                                  #  NORMAL EXIT MODES -
052016,000074:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
052017,000075: 
052018,000076:                                                                                                  #  ALARM OR ABORT EXIT MODES -
052019,000077:                                                                                                  #        TC      ABORT
052020,000078:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
052021,000079: 
052022,000080:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
052023,000081:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
052024,000082:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
052025,000083: 
052026,000084:                                                                                                  #  OUTPUT --
052027,000085:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
052028,000086: 
052029,000087:                                                                                                  #  DEBRIS -
052030,000088:                                                                                                  #        CENTRALS - A,Q,L
052031,000089:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
052032,000090: 
052033,000091:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
052034,000092:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
052035,000093:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
052036,000094:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
052037,000095:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
052038,000096:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
052039,000097:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
052040,000098:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
052041,000099:                                                                                                  #                (Z=0, USUALLY)
052042,000100:                                                                                                  #                LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
052043,000101:                                                                                                  #        THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
052044,000102:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
052045,000103:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
052046,000104:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
052047,000105:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
052048,000106: 
052049,000107:    5235                                           BLOCK    02                                    

Page 1223

052051,000109:    5235  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
052052,000110: 
052053,000111:    5235                                           COUNT    02/WAIT                               
052054,000112: 
052055,000113:    5235           00004        TWIDDLE            INHINT                                         
052056,000114:    5236           54001                           TS       L                                     #  SAVE DELAY TIME IN L
052057,000115:    5237           34777                           CA       POSMAX                                
052058,000116:    5240           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
052059,000117:    5241           30006                           CA       BBANK                                 
052060,000118:    5242           00006                           EXTEND                                         
052061,000119:    5243           04007                           ROR      SUPERBNK                              
052062,000120:    5244           56001                           XCH      L                                     
052063,000121: 
052064,000122:    5245           00004        WAITLIST           INHINT                                         
052065,000123:    5246           00006                           EXTEND                                         
052066,000124:    5247           65261                           BZMF     WATLST0-                              
052067,000125:    5250           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
052068,000126:    5251           54061                           TS       WAITEXIT                              #  WAITEXIT.
052069,000127:    5252           00006                           EXTEND                                         
052070,000128:    5253           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
052071,000129:    5254           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
052072,000130:    5255           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
052073,000131:    5256           35266        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
052074,000132:    5257           56006                           XCH      BBANK                                 
052075,000133:    5260           13246                           TCF      WAIT2                                 
052076,000134: 
052077,000135:    5261           05721        WATLST0-           TC       POODOO                                
052078,000136:    5262           01204                           OCT      1204                                  #  WAITLIST CALL WITH ZERO OR NEG DT
052079,000137: 
052080,000138:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
052081,000139: 
052082,000140:    5263           52062        LVWTLIST           DXCH     WAITEXIT                              
052083,000141:    5264           65016                           AD       TWO                                   
052084,000142:    5265           52006                           DTCB                                           
052085,000143: 
052086,000144:    5266  E3,1400                                  EBANK=   LST1                                  
052087,000145:    5266           02063        WAITBB             BBCON    WAIT2                                 
052088,000146: 
052089,000147:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
052090,000148: 
052091,000149:    5267           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
052092,000150:    5270           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
052093,000151:    5271           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
052094,000152: 
052095,000153:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
052096,000154: 
052097,000155:    5272           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
052098,000156:    5273           54063                           TS       WAITADR                               
052099,000157:    5274           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
052100,000158:    5275           00006                           EXTEND                                         

Page 1224

052102,000160:    5276           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
052103,000161:    5277           54001                           TS       L                                     
052104,000162:    5300           35303                           CAF      DELAYEX                               
052105,000163:    5301           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
052106,000164:    5302           15256                           TCF      DLY2                                  
052107,000165: 
052108,000166:    5303           15322        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
052109,000167: 

Page 1225

052111,000169:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
052112,000170: 
052113,000171:    5304  E3,1400                                  EBANK=   LST1                                  
052114,000172:    5304           72471 73714  ENDTASK            -2CADR   SVCT3                                 
052115,000173: 
052116,000174:    5306           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
052117,000175:    5307           15324                           TCF      TASKOVER                              
052118,000176:    5310           15324                           TCF      TASKOVER                              
052119,000177:    5311           15312                           TCF      +1                                    
052120,000178: 
052121,000179:    5312           11322                           CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
052122,000180:    5313           17717                           TCF      SVCT3X                                
052123,000181:    5314           15317                           TCF      +3                                    
052124,000182:    5315           17717                           TCF      SVCT3X                                
052125,000183:    5316           17717                           TCF      SVCT3X                                
052126,000184:    5317           37672                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
052127,000185:    5320           05134                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
052128,000186:    5321  E3,1460                                  EBANK=   NBDX                                  
052129,000187:    5321           03542 14063                     2CADR    NBDONLY                               
052130,000188: 
052131,000189:    5323           15324                           TCF      TASKOVER                              
052132,000190: 
052133,000191:    6000                                           SETLOC   FFTAG6                                
052134,000192:    6000                                           BANK                                           
052135,000193: 
052136,000194:    7717           05267        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMU ZERO
052137,000195:    7720           00764                           DEC      500        B-14                       
052138,000196:    7721           05306                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN
052139,000197: 

Page 1226

052141,000199:                                                                                                  #  BEGIN TASK INSERTION.
052142,000200: 
052143,000201: 01,3246                                           BANK     01                                    
052144,000202: 01,3246                                           COUNT    01/WAIT                               
052145,000203: 
052146,000204: 01,3246           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
052147,000205: 01,3247           40026                           CS       TIME3                                 
052148,000206: 01,3250           65010                           AD       BIT8                                  #  BIT 8 = OCT 200
052149,000207: 01,3251           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
052150,000208:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
052151,000209:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
052152,000210:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
052153,000211: 
052154,000212: 01,3252           66056                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
052155,000213: 01,3253           40000                           CS       A                                     #  T - T1 + 1.0 - 201
052156,000214: 
052157,000215:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
052158,000216: 
052159,000217: 01,3254           63402                           AD       OCT40201                              
052160,000218: 01,3255           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
052161,000219: 
052162,000220: 01,3256           10000                           CCS      A                                     #  TEST TD - T1 +1
052163,000221: 
052164,000222: 01,3257           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
052165,000223: 01,3260           13322                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
052166,000224: 
052167,000225: 01,3261           13262                           NOOP                                           
052168,000226: 01,3262           40002                           CS       Q                                     
052169,000227: 
052170,000228:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
052171,000229:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
052172,000230:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
052173,000231:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
052174,000232: 
052175,000233: 01,3263           65002                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
052176,000234: 01,3264           65002                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
052177,000235: 01,3265           56026                           XCH      TIME3                                 
052178,000236: 01,3266           65001                           AD       NEGMAX                                
052179,000237: 01,3267           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
052180,000238: 01,3270           00006                           EXTEND                                         #  ZERO INDEX Q.
052181,000239: 01,3271           22007                           QXCH     7                                     #  (ZQ)
052182,000240: 

Page 1227

052184,000242: 01,3272           57400        WTLST4             XCH      LST1                                  
052185,000243: 01,3273           57401                           XCH      LST1       +1                         
052186,000244: 01,3274           57402                           XCH      LST1       +2                         
052187,000245: 01,3275           57403                           XCH      LST1       +3                         
052188,000246: 01,3276           57404                           XCH      LST1       +4                         
052189,000247: 01,3277           57405                           XCH      LST1       +5                         
052190,000248: 01,3300           57406                           XCH      LST1       +6                         
052191,000249: 01,3301           57407                           XCH      LST1       +7                         
052192,000250: 
052193,000251: 01,3302           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
052194,000252: 01,3303           50002                           INDEX    Q                                     
052195,000253: 01,3304           13305                           TCF      +1                                    
052196,000254: 
052197,000255: 01,3305           53411                           DXCH     LST2                                  
052198,000256: 01,3306           53413                           DXCH     LST2       +2                         
052199,000257: 01,3307           53415                           DXCH     LST2       +4                         
052200,000258: 01,3310           53417                           DXCH     LST2       +6                         
052201,000259: 01,3311           53421                           DXCH     LST2       +8D                        
052202,000260: 01,3312           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
052203,000261: 01,3313           53425                           DXCH     LST2       +12D                       
052204,000262: 01,3314           53427                           DXCH     LST2       +14D                       
052205,000263: 01,3315           53431                           DXCH     LST2       +16D                       
052206,000264: 01,3316           65304                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
052207,000265:                                                                                                  #  THE LENGTH OF THE LIST.
052208,000266: 01,3317           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
052209,000267: 01,3320           15263                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
052210,000268: 01,3321           13375                           TCF      WTABORT                               #  IT.
052211,000269: 

Page 1228

052213,000271: 01,3322           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
052214,000272: 01,3323           61401                           AD       LST1       +1                         
052215,000273: 01,3324           13330                           TCF      +4                                    
052216,000274: 01,3325           65017                           AD       ONE                                   
052217,000275: 01,3326           03403                           TC       WTLST2                                
052218,000276: 01,3327           00001                           OCT      1                                     
052219,000277: 
052220,000278: 01,3330           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
052221,000279: 01,3331           61402                           AD       LST1       +2                         
052222,000280: 01,3332           13336                           TCF      +4                                    
052223,000281: 01,3333           65017                           AD       ONE                                   
052224,000282: 01,3334           03403                           TC       WTLST2                                
052225,000283: 01,3335           00002                           OCT      2                                     
052226,000284: 
052227,000285: 01,3336           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
052228,000286: 01,3337           61403                           AD       LST1       +3                         
052229,000287: 01,3340           13344                           TCF      +4                                    
052230,000288: 01,3341           65017                           AD       ONE                                   
052231,000289: 01,3342           03403                           TC       WTLST2                                
052232,000290: 01,3343           00003                           OCT      3                                     
052233,000291: 
052234,000292: 01,3344           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
052235,000293: 01,3345           61404                           AD       LST1       +4                         
052236,000294: 01,3346           13352                           TCF      +4                                    
052237,000295: 01,3347           65017                           AD       ONE                                   
052238,000296: 01,3350           03403                           TC       WTLST2                                
052239,000297: 01,3351           00004                           OCT      4                                     
052240,000298: 
052241,000299: 01,3352           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
052242,000300: 01,3353           61405                           AD       LST1       +5                         
052243,000301: 01,3354           13360                           TCF      +4                                    
052244,000302: 01,3355           65017                           AD       ONE                                   
052245,000303: 01,3356           03403                           TC       WTLST2                                
052246,000304: 01,3357           00005                           OCT      5                                     
052247,000305: 
052248,000306: 01,3360           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
052249,000307: 01,3361           61406                           AD       LST1       +6                         
052250,000308: 01,3362           13366                           TCF      +4                                    
052251,000309: 01,3363           65017                           AD       ONE                                   
052252,000310: 01,3364           03403                           TC       WTLST2                                
052253,000311: 01,3365           00006                           OCT      6                                     
052254,000312: 

Page 1229

052256,000314: 01,3366           10000                 +4        CCS      A                                     
052257,000315: 01,3367           61407                           AD       LST1       +7                         
052258,000316: 01,3370           13374                           TCF      +4                                    
052259,000317: 01,3371           65017                           AD       ONE                                   
052260,000318: 01,3372           03403                           TC       WTLST2                                
052261,000319: 01,3373           00007                           OCT      7                                     
052262,000320: 
052263,000321: 01,3374           10000                 +4        CCS      A                                     
052264,000322: 01,3375           07755        WTABORT            TC       BAILOUT                               #  NO ROOM IN THE INN.
052265,000323: 01,3376           01203                           OCT      1203                                  
052266,000324: 
052267,000325: 01,3377           65017                           AD       ONE                                   
052268,000326: 01,3400           03403                           TC       WTLST2                                
052269,000327: 01,3401           00010                           OCT      10                                    
052270,000328: 
052271,000329: 01,3402           40201        OCT40201           OCT      40201                                 
052272,000330: 

Page 1230

052274,000332:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
052275,000333:                                                                                                  #                                                   N           N+1
052276,000334: 
052277,000335:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
052278,000336:                                                                                                  #                                                              N+1
052279,000337: 
052280,000338:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
052281,000339:                                                                                                  #                   N+1  N                                 N
052282,000340: 
052283,000341:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
052284,000342:                                                                                                  #              N+1
052285,000343: 
052286,000344: 01,3403           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
052287,000345: 01,3404           50002                           INDEX    Q                                     
052288,000346: 01,3405           30000                           CAF      0                                     
052289,000347: 01,3406           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
052290,000348: 
052291,000349: 01,3407           35017                           CAF      ONE                                   
052292,000350: 01,3410           60064                           AD       WAITTEMP                              
052293,000351: 01,3411           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
052294,000352: 01,3412           27377                           ADS      LST1       -1                         #                 N
052295,000353: 
052296,000354: 01,3413           40064                           CS       WAITTEMP                              
052297,000355: 01,3414           50002                           INDEX    Q                                     
052298,000356: 01,3415           13272                           TCF      WTLST4                                
052299,000357: 
052300,000358:                                                                                                  #  C(TIME3) = 1.0 - (T1 - T)
052301,000359: 
052302,000360:                                                                                                  #  C(LST1  ) = - (T2 - T1) + 1
052303,000361:                                                                                                  #  C(LST1+1) = - (T3 - T2) + 1
052304,000362:                                                                                                  #  C(LST1+2) = - (T4 - T3) + 1
052305,000363:                                                                                                  #  C(LST1+3) = - (T5 - T4) + 1
052306,000364:                                                                                                  #  C(LST1+4) = - (T6 - T5) + 1
052307,000365: 
052308,000366:                                                                                                  #  C(LST2   ) = 2CADR  TASK1
052309,000367:                                                                                                  #  C(LST2+2 ) = 2CADR  TASK2
052310,000368:                                                                                                  #  C(LST2+4 ) = 2CADR  TASK3
052311,000369:                                                                                                  #  C(LST2+6 ) = 2CADR  TASK4
052312,000370:                                                                                                  #  C(LST2+8 ) = 2CADR  TASK5
052313,000371:                                                                                                  #  C(LST2+10) = 2CADR  TASK6
052314,000372: 

Page 1231

052316,000374:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
052317,000375: 
052318,000376: 01,3416           00006        T3RUPT             EXTEND                                         
052319,000377: 01,3417           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
052320,000378: 01,3420           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
052321,000379: 01,3421           00006                           EXTEND                                         
052322,000380: 01,3422           22012                           QXCH     QRUPT                                 
052323,000381: 
052324,000382: 01,3423           35000        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
052325,000383: 01,3424           57407                           XCH      LST1       +7                         
052326,000384: 01,3425           57406                           XCH      LST1       +6                         
052327,000385: 01,3426           57405                           XCH      LST1       +5                         
052328,000386: 01,3427           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
052329,000387: 01,3430           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
052330,000388: 01,3431           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
052331,000389: 01,3432           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
052332,000390: 01,3433           57400                           XCH      LST1                                  
052333,000391: 01,3434           64777                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
052334,000392: 01,3435           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
052335,000393: 01,3436           54734                           TS       RUPTAGN                               
052336,000394: 01,3437           45021                           CS       ZERO                                  
052337,000395: 01,3440           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
052338,000396: 
052339,000397: 01,3441           00006                           EXTEND                                         #  DISPATCH TASK.
052340,000398: 01,3442           45305                           DCS      ENDTASK                               
052341,000399: 01,3443           53431                           DXCH     LST2       +16D                       
052342,000400: 01,3444           53427                           DXCH     LST2       +14D                       
052343,000401: 01,3445           53425                           DXCH     LST2       +12D                       
052344,000402: 01,3446           53423                           DXCH     LST2       +10D                       
052345,000403: 01,3447           53421                           DXCH     LST2       +8D                        
052346,000404: 01,3450           53417                           DXCH     LST2       +6                         
052347,000405: 01,3451           53415                           DXCH     LST2       +4                         
052348,000406: 01,3452           53413                           DXCH     LST2       +2                         
052349,000407: 01,3453           53411                           DXCH     LST2                                  
052350,000408: 
052351,000409: 01,3454           56001                           XCH      L                                     
052352,000410: 01,3455           00006                           EXTEND                                         
052353,000411: 01,3456           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
052354,000412: 01,3457           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
052355,000413: 01,3460           52006                           DTCB                                           
052356,000414: 

Page 1232

052358,000416:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
052359,000417: 
052360,000418:    5324                                           BLOCK    02                                    
052361,000419:    5324                                           COUNT    02/WAIT                               
052362,000420: 
052363,000421:    5324           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
052364,000422:    5325           35266                           CAF      WAITBB                                
052365,000423:    5326           54006                           TS       BBANK                                 
052366,000424:    5327           13423                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
052367,000425: 
052368,000426:    5330           30016                           CA       BANKRUPT                              
052369,000427:    5331           00006                           EXTEND                                         
052370,000428:    5332           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
052371,000429: 
052372,000430:    5333           00006        RESUME             EXTEND                                         
052373,000431:    5334           22012                           QXCH     QRUPT                                 
052374,000432:    5335           30016        NOQRSM             CA       BANKRUPT                              
052375,000433:    5336           56006                           XCH      BBANK                                 
052376,000434:    5337           52011        NOQBRSM            DXCH     ARUPT                                 
052377,000435:    5340           00003                           RELINT                                         
052378,000436:    5341           50017                           RESUME                                         
052379,000437: 

Page 1233

052381,000439:                                                                                                  #  LONGCALL
052382,000440:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
052383,000441:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
052384,000442:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
052385,000443: 
052386,000444:                                                                                                  #  FUNCTIONAL DESCRIPTION -
052387,000445:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
052388,000446:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
052389,000447:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
052390,000448:                                                                                                  #        START
052391,000449: 
052392,000450:                                                                                                  #  CALLING SEQUENCE -
052393,000451:                                                                                                  #                EXTEND
052394,000452:                                                                                                  #                DCA     TIMELOC
052395,000453:                                                                                                  #                TC      LONGCALL
052396,000454:                                                                                                  #                2CADR   TASKTODO
052397,000455: 
052398,000456:                                                                                                  #  NORMAL EXIT MODE -
052399,000457:                                                                                                  #        1).     TC      WAITLIST
052400,000458:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
052401,000459:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
052402,000460: 
052403,000461:                                                                                                  #  ALARM OR ABORT EXIT MODE -
052404,000462:                                                                                                  #        NONE
052405,000463: 
052406,000464:                                                                                                  #  OUTPUT -
052407,000465:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
052408,000466:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
052409,000467:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
052410,000468:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
052411,000469: 
052412,000470:                                                                                                  #  ERASABLE INITIALIZATION -
052413,000471:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
052414,000472:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
052415,000473:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
052416,000474: 
052417,000475:                                                                                                  #  DEBRIS -
052418,000476:                                                                                                  #        A,Q,L
052419,000477:                                                                                                  #        LONGCADR AND LONGCADR+1
052420,000478:                                                                                                  #        LONGEXIT AND LONGEXIT+1
052421,000479:                                                                                                  #        LONGTIME AND LONGTIME+1
052422,000480: 
052423,000481:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
052424,000482: 
052425,000483:    5342                                           BLOCK    02                                    
052426,000484:    5342  E3,1400                                  EBANK=   LST1                                  
052427,000485:    5342           53140        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
052428,000486: 
052429,000487:    5343           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1234

052431,000489:    5344           50002                           NDX      Q                                     
052432,000490:    5345           30001                           DCA      0                                     
052433,000491:    5346           53134                           DXCH     LONGCADR                              
052434,000492: 
052435,000493:    5347           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
052436,000494:    5350           35353                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
052437,000495:    5351           52006                           DTCB                                           
052438,000496: 
052439,000497:    5352  E3,1400                                  EBANK=   LST1                                  
052440,000498:    5352           03461 02063  LGCL2CDR           2CADR    LNGCALL2                              
052441,000499: 
052442,000500:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
052443,000501: 
052444,000502: 01,3461                                           BANK     01                                    
052445,000503: 01,3461                                           COUNT    01/WAIT                               
052446,000504: 
052447,000505: 01,3461           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
052448,000506: 01,3462           35016                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
052449,000507: 01,3463           26002                           ADS      Q                                     
052450,000508: 01,3464           55434                           TS       LONGEXIT                              
052451,000509: 
052452,000510:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
052453,000511: 
052454,000512: 01,3465           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
052455,000513: 01,3466           43477                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
052456,000514: 01,3467           21140                           DAS      LONGTIME                              
052457,000515: 
052458,000516: 01,3470           11140                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
052459,000517: 01,3471           13510                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
052460,000518:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
052461,000519:                                                                                                  #  BASIC INSTRUCTIONS
052462,000520:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
052463,000521:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
052464,000522:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
052465,000523: 01,3472           13473                           NOOP                                           #  CAN:T GET HERE    **********
052466,000524: 01,3473           13474                           TCF      +1                                    
052467,000525: 01,3474           11137                           CCS      LONGTIME                              
052468,000526: 01,3475           13510                           TCF      MUCHTIME                              
052469,000527: 01,3476           00000        DPBIT14            OCT      00000                                 
052470,000528: 01,3477           20000                           OCT      20000                                 
052471,000529: 
052472,000530:                                                                                                  #  LONGCALL
052473,000531: 01,3500           35002        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
052474,000532: 01,3501           27140                           ADS      LONGTIME   +1                         
052475,000533: 01,3502           05245                           TC       WAITLIST                              
052476,000534: 01,3503  E3,1400                                  EBANK=   LST1                                  
052477,000535: 01,3503           03515 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
052478,000536: 
052479,000537: 01,3505           33517        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS

Page 1235

052481,000539: 01,3506           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
052482,000540: 01,3507           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
052483,000541: 
052484,000542: 01,3510           35002        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
052485,000543: 01,3511           05245                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
052486,000544: 01,3512  E3,1400                                  EBANK=   LST1                                  
052487,000545: 01,3512           03465 02063                     2CADR    LONGCYCL                              
052488,000546: 
052489,000547: 01,3514           13505                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
052490,000548: 
052491,000549:                                                                                                  #  *** WAITLIST TASK GETCADR ***
052492,000550: 
052493,000551: 01,3515           53134        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
052494,000552: 01,3516           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
052495,000553: 
052496,000554: 01,3517           05324        TSKOVCDR           GENADR   TASKOVER                              
052497,000555: 
052498,000556: 

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