Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72/3 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.

050993,000002:                                                                                                  ## Copyright:   Public domain.
050994,000003:                                                                                                  ## Filename:    WAITLIST.agc
050995,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
050996,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
050997,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
050998,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
050999,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
051000,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
051001,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
051002,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
051003,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
051004,000013:                                                                                                  ##              is correct.
051005,000014:                                                                                                  ## Assembler:   yaYUL
051006,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
051007,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
051008,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
051009,000018: 
051010,000019:                                                                                                  #  PROGRAM DESCRIPTION                                           DATE - 10 OCTOBER 1966
051011,000020:                                                                                                  #  MOD NO - 2                                                    LOG SECTION - WAITLIST
051012,000021:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)          ASSEMBLY SUNBURST REV 5
051013,000022:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
051014,000023:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
051015,000024: 
051016,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION -
051017,000026:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
051018,000027:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
051019,000028:                                                                                                  #        FOLLOW.
051020,000029: 
051021,000030:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
051022,000031: 
051023,000032:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
051024,000033:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
051025,000034:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
051026,000035:                                                                                                  #                                        .
051027,000036:                                                                                                  #                                        .
051028,000037:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
051029,000038:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
051030,000039: 
051031,000040:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
051032,000041:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
051033,000042:                                                                                                  #                                        .
051034,000043:                                                                                                  #                                        .
051035,000044:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
051036,000045:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
051037,000046: 
051038,000047:                                                                                                  #  WARNINGS-
051039,000048:                                                                                                  #  --------
051040,000049:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
051041,000050:                                                                                                  #        2)      9 TASKS MAXIMUM
051042,000051:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
051043,000052:                                                                                                  #        4)      TASKS END BY TC TASKOVER
051044,000053: 
051045,000054:                                                                                                  #  CALLING SEQUENCE -
051046,000055:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
051047,000056:                                                                                                  #        L       TC      WAITLIST
051048,000057:                                                                                                  #        L+1     2CADR   DESIRED TASK
051049,000058:                                                                                                  #        L+2     (MINOR OF 2CADR)
051050,000059:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
051051,000060: 
051052,000061:                                                                                                  #  TWIDDLE-
051053,000062:                                                                                                  #  -------
051054,000063:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
051055,000064:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
051056,000065:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
051057,000066:                                                                                                  #                L-1     CA      DELTAT
051058,000067:                                                                                                  #                L       TC      TWIDDLE
051059,000068:                                                                                                  #                L+1     ADRES   DESIRED TASK
051060,000069:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
051061,000070: 
051062,000071:                                                                                                  #  NORMAL EXIT MODES -
051063,000072:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
051064,000073: 
051065,000074:                                                                                                  #  ALARM OR ABORT EXIT MODES -
051066,000075:                                                                                                  #        TC      ABORT
051067,000076:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
051068,000077: 
051069,000078:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
051070,000079:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
051071,000080:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
051072,000081: 
051073,000082:                                                                                                  #  OUTPUT --
051074,000083:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
051075,000084: 
051076,000085:                                                                                                  #  DEBRIS -
051077,000086:                                                                                                  #        CENTRALS - A,Q,L
051078,000087:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
051079,000088: 
051080,000089:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
051081,000090:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
051082,000091:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
051083,000092:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
051084,000093:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
051085,000094:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
051086,000095:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
051087,000096:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
051088,000097:                                                                                                  #                (Z=0, USUALLY)
051089,000098:                                                                                                  #                LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
051090,000099:                                                                                                  #        THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
051091,000100:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
051092,000101:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
051093,000102:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
051094,000103:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
051095,000104: 
051096,000105:    5251                                           BLOCK    02                                    
051097,000106:    5251  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
051098,000107: 
051099,000108:    5251                                           COUNT    02/WAIT                               
051100,000109: 
051101,000110:    5251           00004        TWIDDLE            INHINT                                         
051102,000111:    5252           54001                           TS       L                                     #  SAVE DELAY TIME IN L
051103,000112:    5253           35013                           CA       POSMAX                                
051104,000113:    5254           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
051105,000114:    5255           30006                           CA       BBANK                                 
051106,000115:    5256           00006                           EXTEND                                         
051107,000116:    5257           04007                           ROR      SUPERBNK                              
051108,000117:    5260           56001                           XCH      L                                     
051109,000118: 
051110,000119:    5261           00004        WAITLIST           INHINT                                         
051111,000120:    5262           00006                           EXTEND                                         
051112,000121:    5263           65275                           BZMF     WATLST0-                              
051113,000122:    5264           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
051114,000123:    5265           54061                           TS       WAITEXIT                              #  WAITEXIT.
051115,000124:    5266           00006                           EXTEND                                         
051116,000125:    5267           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
051117,000126:    5270           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
051118,000127:    5271           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
051119,000128:    5272           35302        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
051120,000129:    5273           56006                           XCH      BBANK                                 
051121,000130:    5274           13246                           TCF      WAIT2                                 
051122,000131: 
051123,000132:    5275           05725        WATLST0-           TC       POODOO                                
051124,000133:    5276           21204                           OCT      21204                                 
051125,000134: 
051126,000135:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
051127,000136: 
051128,000137:    5277           52062        LVWTLIST           DXCH     WAITEXIT                              
051129,000138:    5300           65032                           AD       TWO                                   
051130,000139:    5301           52006                           DTCB                                           
051131,000140: 
051132,000141:    5302  E3,1400                                  EBANK=   LST1                                  
051133,000142:    5302           02063        WAITBB             BBCON    WAIT2                                 
051134,000143: 
051135,000144:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
051136,000145: 
051137,000146:    5303           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
051138,000147:    5304           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
051139,000148:    5305           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
051140,000149: 
051141,000150:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
051142,000151: 
051143,000152:    5306           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
051144,000153:    5307           54063                           TS       WAITADR                               
051145,000154:    5310           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
051146,000155:    5311           00006                           EXTEND                                         
051147,000156:    5312           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
051148,000157:    5313           54001                           TS       L                                     
051149,000158:    5314           35317                           CAF      DELAYEX                               
051150,000159:    5315           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
051151,000160:    5316           15272                           TCF      DLY2                                  
051152,000161: 
051153,000162:    5317           15336        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
051154,000163: 
051155,000164:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
051156,000165: 
051157,000166:    5320  E3,1400                                  EBANK=   LST1                                  
051158,000167:    5320           72455 73714  ENDTASK            -2CADR   SVCT3                                 
051159,000168: 
051160,000169:    5322           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
051161,000170:    5323           15340                           TCF      TASKOVER                              
051162,000171:    5324           15340                           TCF      TASKOVER                              
051163,000172:    5325           15326                           TCF      +1                                    
051164,000173: 
051165,000174:    5326           11322                           CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
051166,000175:    5327           17717                           TCF      SVCT3X                                
051167,000176:    5330           15333                           TCF      +3                                    
051168,000177:    5331           17717                           TCF      SVCT3X                                
051169,000178:    5332           17717                           TCF      SVCT3X                                
051170,000179:    5333           37672                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
051171,000180:    5334           05150                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
051172,000181:    5335  E3,1460                                  EBANK=   NBDX                                  
051173,000182:    5335           03542 14063                     2CADR    NBDONLY                               
051174,000183: 
051175,000184:    5337           15340                           TCF      TASKOVER                              
051176,000185: 
051177,000186:    6000                                           SETLOC   FFTAG6                                
051178,000187:    6000                                           BANK                                           
051179,000188: 
051180,000189:    7717           05303        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMU ZERO
051181,000190:    7720           00764                           DEC      500        B-14                       
051182,000191:    7721           05322                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN
051183,000192: 
051184,000193:                                                                                                  #  BEGIN TASK INSERTION.
051185,000194: 
051186,000195: 01,3246                                           BANK     01                                    
051187,000196: 01,3246                                           COUNT    01/WAIT                               
051188,000197: 
051189,000198: 01,3246           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
051190,000199: 01,3247           40026                           CS       TIME3                                 
051191,000200: 01,3250           65024                           AD       BIT8                                  #  BIT 8 = OCT 200
051192,000201: 01,3251           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
051193,000202:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
051194,000203:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
051195,000204:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
051196,000205: 
051197,000206: 01,3252           66056                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
051198,000207: 01,3253           40000                           CS       A                                     #  T - T1 + 1.0 - 201
051199,000208: 
051200,000209:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
051201,000210: 
051202,000211: 01,3254           63402                           AD       OCT40201                              
051203,000212: 01,3255           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
051204,000213: 
051205,000214: 01,3256           10000                           CCS      A                                     #  TEST TD - T1 +1
051206,000215: 
051207,000216: 01,3257           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
051208,000217: 01,3260           13322                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
051209,000218: 
051210,000219: 01,3261           13262                           NOOP                                           
051211,000220: 01,3262           40002                           CS       Q                                     
051212,000221: 
051213,000222:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
051214,000223:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
051215,000224:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
051216,000225:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
051217,000226: 
051218,000227: 01,3263           65016                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
051219,000228: 01,3264           65016                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
051220,000229: 01,3265           56026                           XCH      TIME3                                 
051221,000230: 01,3266           65015                           AD       NEGMAX                                
051222,000231: 01,3267           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
051223,000232: 01,3270           00006                           EXTEND                                         #  ZERO INDEX Q.
051224,000233: 01,3271           22007                           QXCH     7                                     #  (ZQ)
051225,000234: 
051226,000235: 01,3272           57400        WTLST4             XCH      LST1                                  
051227,000236: 01,3273           57401                           XCH      LST1       +1                         
051228,000237: 01,3274           57402                           XCH      LST1       +2                         
051229,000238: 01,3275           57403                           XCH      LST1       +3                         
051230,000239: 01,3276           57404                           XCH      LST1       +4                         
051231,000240: 01,3277           57405                           XCH      LST1       +5                         
051232,000241: 01,3300           57406                           XCH      LST1       +6                         
051233,000242: 01,3301           57407                           XCH      LST1       +7                         
051234,000243: 
051235,000244: 01,3302           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
051236,000245: 01,3303           50002                           INDEX    Q                                     
051237,000246: 01,3304           13305                           TCF      +1                                    
051238,000247: 
051239,000248: 01,3305           53411                           DXCH     LST2                                  
051240,000249: 01,3306           53413                           DXCH     LST2       +2                         
051241,000250: 01,3307           53415                           DXCH     LST2       +4                         
051242,000251: 01,3310           53417                           DXCH     LST2       +6                         
051243,000252: 01,3311           53421                           DXCH     LST2       +8D                        
051244,000253: 01,3312           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
051245,000254: 01,3313           53425                           DXCH     LST2       +12D                       
051246,000255: 01,3314           53427                           DXCH     LST2       +14D                       
051247,000256: 01,3315           53431                           DXCH     LST2       +16D                       
051248,000257: 01,3316           65320                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
051249,000258:                                                                                                  #  THE LENGTH OF THE LIST.
051250,000259: 01,3317           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
051251,000260: 01,3320           15277                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
051252,000261: 01,3321           13375                           TCF      WTABORT                               #  IT.
051253,000262: 
051254,000263: 01,3322           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
051255,000264: 01,3323           61401                           AD       LST1       +1                         
051256,000265: 01,3324           13330                           TCF      +4                                    
051257,000266: 01,3325           65033                           AD       ONE                                   
051258,000267: 01,3326           03403                           TC       WTLST2                                
051259,000268: 01,3327           00001                           OCT      1                                     
051260,000269: 
051261,000270: 01,3330           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
051262,000271: 01,3331           61402                           AD       LST1       +2                         
051263,000272: 01,3332           13336                           TCF      +4                                    
051264,000273: 01,3333           65033                           AD       ONE                                   
051265,000274: 01,3334           03403                           TC       WTLST2                                
051266,000275: 01,3335           00002                           OCT      2                                     
051267,000276: 
051268,000277: 01,3336           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
051269,000278: 01,3337           61403                           AD       LST1       +3                         
051270,000279: 01,3340           13344                           TCF      +4                                    
051271,000280: 01,3341           65033                           AD       ONE                                   
051272,000281: 01,3342           03403                           TC       WTLST2                                
051273,000282: 01,3343           00003                           OCT      3                                     
051274,000283: 
051275,000284: 01,3344           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
051276,000285: 01,3345           61404                           AD       LST1       +4                         
051277,000286: 01,3346           13352                           TCF      +4                                    
051278,000287: 01,3347           65033                           AD       ONE                                   
051279,000288: 01,3350           03403                           TC       WTLST2                                
051280,000289: 01,3351           00004                           OCT      4                                     
051281,000290: 
051282,000291: 01,3352           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
051283,000292: 01,3353           61405                           AD       LST1       +5                         
051284,000293: 01,3354           13360                           TCF      +4                                    
051285,000294: 01,3355           65033                           AD       ONE                                   
051286,000295: 01,3356           03403                           TC       WTLST2                                
051287,000296: 01,3357           00005                           OCT      5                                     
051288,000297: 
051289,000298: 01,3360           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
051290,000299: 01,3361           61406                           AD       LST1       +6                         
051291,000300: 01,3362           13366                           TCF      +4                                    
051292,000301: 01,3363           65033                           AD       ONE                                   
051293,000302: 01,3364           03403                           TC       WTLST2                                
051294,000303: 01,3365           00006                           OCT      6                                     
051295,000304: 
051296,000305: 01,3366           10000                 +4        CCS      A                                     
051297,000306: 01,3367           61407                           AD       LST1       +7                         
051298,000307: 01,3370           13374                           TCF      +4                                    
051299,000308: 01,3371           65033                           AD       ONE                                   
051300,000309: 01,3372           03403                           TC       WTLST2                                
051301,000310: 01,3373           00007                           OCT      7                                     
051302,000311: 
051303,000312: 01,3374           10000                 +4        CCS      A                                     
051304,000313: 01,3375           07755        WTABORT            TC       BAILOUT                               #  NO ROOM IN THE INN.
051305,000314: 01,3376           31203                           OCT      31203                                 
051306,000315: 
051307,000316: 01,3377           65033                           AD       ONE                                   
051308,000317: 01,3400           03403                           TC       WTLST2                                
051309,000318: 01,3401           00010                           OCT      10                                    
051310,000319: 
051311,000320: 01,3402           40201        OCT40201           OCT      40201                                 
051312,000321: 
051313,000322:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
051314,000323:                                                                                                  #                                                   N           N+1
051315,000324: 
051316,000325:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
051317,000326:                                                                                                  #                                                              N+1
051318,000327: 
051319,000328:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
051320,000329:                                                                                                  #                   N+1  N                                 N
051321,000330: 
051322,000331:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
051323,000332:                                                                                                  #              N+1
051324,000333: 
051325,000334: 01,3403           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
051326,000335: 01,3404           50002                           INDEX    Q                                     
051327,000336: 01,3405           30000                           CAF      0                                     
051328,000337: 01,3406           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
051329,000338: 
051330,000339: 01,3407           35033                           CAF      ONE                                   
051331,000340: 01,3410           60064                           AD       WAITTEMP                              
051332,000341: 01,3411           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
051333,000342: 01,3412           27377                           ADS      LST1       -1                         #                 N
051334,000343: 
051335,000344: 01,3413           40064                           CS       WAITTEMP                              
051336,000345: 01,3414           50002                           INDEX    Q                                     
051337,000346: 01,3415           13272                           TCF      WTLST4                                
051338,000347: 
051339,000348:                                                                                                  #  C(TIME3) = 1.0 - (T1 - T)
051340,000349: 
051341,000350:                                                                                                  #  C(LST1  ) = - (T2 - T1) + 1
051342,000351:                                                                                                  #  C(LST1+1) = - (T3 - T2) + 1
051343,000352:                                                                                                  #  C(LST1+2) = - (T4 - T3) + 1
051344,000353:                                                                                                  #  C(LST1+3) = - (T5 - T4) + 1
051345,000354:                                                                                                  #  C(LST1+4) = - (T6 - T5) + 1
051346,000355: 
051347,000356:                                                                                                  #  C(LST2   ) = 2CADR  TASK1
051348,000357:                                                                                                  #  C(LST2+2 ) = 2CADR  TASK2
051349,000358:                                                                                                  #  C(LST2+4 ) = 2CADR  TASK3
051350,000359:                                                                                                  #  C(LST2+6 ) = 2CADR  TASK4
051351,000360:                                                                                                  #  C(LST2+8 ) = 2CADR  TASK5
051352,000361:                                                                                                  #  C(LST2+10) = 2CADR  TASK6
051353,000362: 
051354,000363:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
051355,000364: 
051356,000365: 01,3416           00006        T3RUPT             EXTEND                                         
051357,000366: 01,3417           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
051358,000367: 01,3420           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
051359,000368: 01,3421           00006                           EXTEND                                         
051360,000369: 01,3422           22012                           QXCH     QRUPT                                 
051361,000370: 
051362,000371: 01,3423           35014        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
051363,000372: 01,3424           57407                           XCH      LST1       +7                         
051364,000373: 01,3425           57406                           XCH      LST1       +6                         
051365,000374: 01,3426           57405                           XCH      LST1       +5                         
051366,000375: 01,3427           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
051367,000376: 01,3430           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
051368,000377: 01,3431           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
051369,000378: 01,3432           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
051370,000379: 01,3433           57400                           XCH      LST1                                  
051371,000380: 01,3434           65013                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
051372,000381: 01,3435           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
051373,000382: 01,3436           54734                           TS       RUPTAGN                               
051374,000383: 01,3437           45035                           CS       ZERO                                  
051375,000384: 01,3440           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
051376,000385: 
051377,000386: 01,3441           00006                           EXTEND                                         #  DISPATCH TASK.
051378,000387: 01,3442           45321                           DCS      ENDTASK                               
051379,000388: 01,3443           53431                           DXCH     LST2       +16D                       
051380,000389: 01,3444           53427                           DXCH     LST2       +14D                       
051381,000390: 01,3445           53425                           DXCH     LST2       +12D                       
051382,000391: 01,3446           53423                           DXCH     LST2       +10D                       
051383,000392: 01,3447           53421                           DXCH     LST2       +8D                        
051384,000393: 01,3450           53417                           DXCH     LST2       +6                         
051385,000394: 01,3451           53415                           DXCH     LST2       +4                         
051386,000395: 01,3452           53413                           DXCH     LST2       +2                         
051387,000396: 01,3453           53411                           DXCH     LST2                                  
051388,000397: 
051389,000398: 01,3454           56001                           XCH      L                                     
051390,000399: 01,3455           00006                           EXTEND                                         
051391,000400: 01,3456           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
051392,000401: 01,3457           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
051393,000402: 01,3460           52006                           DTCB                                           
051394,000403: 
051395,000404:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
051396,000405: 
051397,000406:    5340                                           BLOCK    02                                    
051398,000407:    5340                                           COUNT    02/WAIT                               
051399,000408: 
051400,000409:    5340           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
051401,000410:    5341           35302                           CAF      WAITBB                                
051402,000411:    5342           54006                           TS       BBANK                                 
051403,000412:    5343           13423                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
051404,000413: 
051405,000414:    5344           30016                           CA       BANKRUPT                              
051406,000415:    5345           00006                           EXTEND                                         
051407,000416:    5346           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
051408,000417: 
051409,000418:    5347           00006        RESUME             EXTEND                                         
051410,000419:    5350           22012                           QXCH     QRUPT                                 
051411,000420:    5351           30016        NOQRSM             CA       BANKRUPT                              
051412,000421:    5352           56006                           XCH      BBANK                                 
051413,000422:    5353           52011        NOQBRSM            DXCH     ARUPT                                 
051414,000423:    5354           00003                           RELINT                                         
051415,000424:    5355           50017                           RESUME                                         
051416,000425: 
051417,000426:                                                                                                  #  LONGCALL
051418,000427:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
051419,000428:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
051420,000429:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
051421,000430: 
051422,000431:                                                                                                  #  FUNCTIONAL DESCRIPTION -
051423,000432:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
051424,000433:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
051425,000434:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
051426,000435:                                                                                                  #        START
051427,000436: 
051428,000437:                                                                                                  #  CALLING SEQUENCE -
051429,000438:                                                                                                  #                EXTEND
051430,000439:                                                                                                  #                DCA     TIMELOC
051431,000440:                                                                                                  #                TC      LONGCALL
051432,000441:                                                                                                  #                2CADR   TASKTODO
051433,000442: 
051434,000443:                                                                                                  #  NORMAL EXIT MODE -
051435,000444:                                                                                                  #        1).     TC      WAITLIST
051436,000445:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
051437,000446:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
051438,000447: 
051439,000448:                                                                                                  #  ALARM OR ABORT EXIT MODE -
051440,000449:                                                                                                  #        NONE
051441,000450: 
051442,000451:                                                                                                  #  OUTPUT -
051443,000452:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
051444,000453:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
051445,000454:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
051446,000455:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
051447,000456: 
051448,000457:                                                                                                  #  ERASABLE INITIALIZATION -
051449,000458:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
051450,000459:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
051451,000460:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
051452,000461: 
051453,000462:                                                                                                  #  DEBRIS -
051454,000463:                                                                                                  #        A,Q,L
051455,000464:                                                                                                  #        LONGCADR AND LONGCADR+1
051456,000465:                                                                                                  #        LONGEXIT AND LONGEXIT+1
051457,000466:                                                                                                  #        LONGTIME AND LONGTIME+1
051458,000467: 
051459,000468:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
051460,000469: 
051461,000470:    5356                                           BLOCK    02                                    
051462,000471:    5356  E3,1400                                  EBANK=   LST1                                  
051463,000472:    5356           53140        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
051464,000473: 
051465,000474:    5357           00006                           EXTEND                                         #  OBTAIN THE 2CADR
051466,000475:    5360           50002                           NDX      Q                                     
051467,000476:    5361           30001                           DCA      0                                     
051468,000477:    5362           53134                           DXCH     LONGCADR                              
051469,000478: 
051470,000479:    5363           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
051471,000480:    5364           35367                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
051472,000481:    5365           52006                           DTCB                                           
051473,000482: 
051474,000483:    5366  E3,1400                                  EBANK=   LST1                                  
051475,000484:    5366           03461 02063  LGCL2CDR           2CADR    LNGCALL2                              
051476,000485: 
051477,000486:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
051478,000487: 
051479,000488: 01,3461                                           BANK     01                                    
051480,000489: 01,3461                                           COUNT    01/WAIT                               
051481,000490: 
051482,000491: 01,3461           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
051483,000492: 01,3462           35032                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
051484,000493: 01,3463           26002                           ADS      Q                                     
051485,000494: 01,3464           55434                           TS       LONGEXIT                              
051486,000495: 
051487,000496:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
051488,000497: 
051489,000498: 01,3465           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
051490,000499: 01,3466           43477                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
051491,000500: 01,3467           21140                           DAS      LONGTIME                              
051492,000501: 
051493,000502: 01,3470           11140                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
051494,000503: 01,3471           13510                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
051495,000504:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
051496,000505:                                                                                                  #  BASIC INSTRUCTIONS
051497,000506:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
051498,000507:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
051499,000508:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
051500,000509: 01,3472           13473                           NOOP                                           #  CAN:T GET HERE    **********
051501,000510: 01,3473           13474                           TCF      +1                                    
051502,000511: 01,3474           11137                           CCS      LONGTIME                              
051503,000512: 01,3475           13510                           TCF      MUCHTIME                              
051504,000513: 01,3476           00000        DPBIT14            OCT      00000                                 
051505,000514: 01,3477           20000                           OCT      20000                                 
051506,000515: 
051507,000516:                                                                                                  #  LONGCALL
051508,000517: 01,3500           35016        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
051509,000518: 01,3501           27140                           ADS      LONGTIME   +1                         
051510,000519: 01,3502           05261                           TC       WAITLIST                              
051511,000520: 01,3503  E3,1400                                  EBANK=   LST1                                  
051512,000521: 01,3503           03515 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
051513,000522: 
051514,000523: 01,3505           33517        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
051515,000524: 01,3506           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
051516,000525: 01,3507           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
051517,000526: 
051518,000527: 01,3510           35016        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
051519,000528: 01,3511           05261                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
051520,000529: 01,3512  E3,1400                                  EBANK=   LST1                                  
051521,000530: 01,3512           03465 02063                     2CADR    LONGCYCL                              
051522,000531: 
051523,000532: 01,3514           13505                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
051524,000533: 
051525,000534:                                                                                                  #  *** WAITLIST TASK GETCADR ***
051526,000535: 
051527,000536: 01,3515           53134        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
051528,000537: 01,3516           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
051529,000538: 
051530,000539: 01,3517           05340        TSKOVCDR           GENADR   TASKOVER                              
051531,000540: 
051532,000541: 

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