Source Code

These source-code files are part of a reconstructed copy of Skylark 048, the Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.

They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to.

The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction.

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

049371,000002:                                                                                                  ## Copyright:   Public domain.
049372,000003:                                                                                                  ## Filename:    WAITLIST.agc
049373,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
049374,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
049375,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
049376,000007:                                                                                                  ##              this software are available; instead, this file was created via
049377,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
049378,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
049379,000010:                                                                                                  ##              Museum of Space History.
049380,000011:                                                                                                  ## Assembler:   yaYUL
049381,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
049382,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
049383,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
049384,000015: 
049385,000016: 
049386,000017:                                                                                                  #  PROGRAM DESCRIPTION                                                           DATE - 10 OCTOBER 1966
049387,000018:                                                                                                  #  MOD NO - 2                                                                    LOG SECTION - WAITLIST
049388,000019:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)                          ASSEMBLY SUNBURST REV 5
049389,000020:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
049390,000021:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
049391,000022: 
049392,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION-
049393,000024:                                                                                                  #        PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
049394,000025:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2. THE MEANING OF THESE LISTS
049395,000026:                                                                                                  #        FOLLOW.
049396,000027: 
049397,000028:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
049398,000029: 
049399,000030:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
049400,000031:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
049401,000032:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
049402,000033:                                                                                                  #                                        .
049403,000034:                                                                                                  #                                        .
049404,000035:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
049405,000036:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
049406,000037: 
049407,000038:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
049408,000039:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
049409,000040:                                                                                                  #                                        .
049410,000041:                                                                                                  #                                        .
049411,000042:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
049412,000043:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
049413,000044: 
049414,000045:                                                                                                  #  WARNINGS-
049415,000046:                                                                                                  #  --------
049416,000047:                                                                                                  #                1) 1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
049417,000048:                                                                                                  #                2) 9 TASKS MAXIMUM
049418,000049:                                                                                                  #                3) TASKS CALLED UNDER INTERRUPT INHIBITED
049419,000050:                                                                                                  #                4) TASKS END BY TC TASKOVER
049420,000051: 
049421,000052:                                                                                                  #  CALLING SEQUENCE-
049422,000053:                                                                                                  #  
049423,000054:                                                                                                  #                L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
049424,000055:                                                                                                  #                L       TC      WAITLIST
049425,000056:                                                                                                  #                L+1     2CADR   DESIRED TASK
049426,000057:                                                                                                  #                L+2     (MINOR OF 2CADR)
049427,000058:                                                                                                  #                L+3     RELINT          (RETURNS HERE)
049428,000059: 
049429,000060:                                                                                                  #  TWIDDLE-
049430,000061:                                                                                                  #  -------
049431,000062:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
049432,000063:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
049433,000064:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
049434,000065: 
049435,000066:                                                                                                  #                L-1     CA      DELTAT
049436,000067:                                                                                                  #                L       TC      TWIDDLE
049437,000068:                                                                                                  #                L+1     ADRES   DESIRED TASK
049438,000069:                                                                                                  #                L+2     RELINT                  (RETURNS HERE)
049439,000070: 
049440,000071:                                                                                                  #  NORMAL EXIT MODES-
049441,000072: 
049442,000073:                                                                                                  #                AT L+3 OF CALLING SEQUENCE
049443,000074: 
049444,000075:                                                                                                  #  ALARM OR ABORT EXIT MODES-
049445,000076: 
049446,000077:                                                                                                  #                TC      ABORT
049447,000078:                                                                                                  #                OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
049448,000079: 
049449,000080:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
049450,000081: 
049451,000082:                                                                                                  #                ACCOMPLISHED BY FRESH START,--LST2,...,LST2 +16 = ENDTASK
049452,000083:                                                                                                  #                                              LST1,...,LST1 +7  = NEG1/2
049453,000084: 
049454,000085:                                                                                                  #  OUTPUT--
049455,000086:                                                                                                  #                LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
049456,000087: 
049457,000088:                                                                                                  #  DEBRIS-
049458,000089: 
049459,000090:                                                                                                  #                CENTRALS - A,Q,L
049460,000091:                                                                                                  #                OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
049461,000092: 
049462,000093:                                                                                                  #  DETAILED ANALYSIS OF TIMING-
049463,000094: 
049464,000095:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
049465,000096:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
049466,000097:                                                                                                  #                        LET TO = THE TIME OF THE TC WAITLIST
049467,000098:                                                                                                  #                        LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
049468,000099:                                                                                                  #                        LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
049469,000100:                                                                                                  #                        LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
049470,000101:                                                                                                  #                        LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
049471,000102:                                                                                                  #        (Z=0, USUALLY)
049472,000103:                                                                                                  #                        LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
049473,000104:                                                                                                  #                THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
049474,000105:                                                                                                  #        *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
049475,000106: 
049476,000107:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
049477,000108:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
049478,000109:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
049479,000110: 
049480,000111:    4000                                           SETLOC   WAITF2                                
049481,000112:    4000                                           BANK                                           
049482,000113: 
049483,000114:    5235  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
049484,000115: 
049485,000116:    5235                                           COUNT*   $$/WAIT                               
049486,000117:    5235           35001        TWIDBIT1           CAF      ONE                                   
049487,000118:    5236           00004        TWIDDLE            INHINT                                         
049488,000119:    5237           54001                           TS       L                                     #  SAVE DELAY TIME IN L
049489,000120:    5240           34761                           CA       POSMAX                                
049490,000121:    5241           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
049491,000122:    5242           30006                           CA       BBANK                                 
049492,000123:    5243           00006                           EXTEND                                         
049493,000124:    5244           04007                           ROR      SUPERBNK                              
049494,000125:    5245           56001                           XCH      L                                     
049495,000126: 
049496,000127:    5246           00004        WAITLIST           INHINT                                         
049497,000128:    5247           00006                           EXTEND                                         
049498,000129:    5250           65262                           BZMF     WATLST0-                              
049499,000130:    5251           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
049500,000131:    5252           54061                           TS       WAITEXIT                              #  WAITEXIT.
049501,000132:    5253           00006                           EXTEND                                         
049502,000133:    5254           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
049503,000134:    5255           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
049504,000135:    5256           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
049505,000136:    5257           35267        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
049506,000137:    5260           56006                           XCH      BBANK                                 
049507,000138:    5261           13221                           TCF      WAIT2                                 
049508,000139: 
049509,000140:    5262           05701        WATLST0-           TC       POODOO                                
049510,000141:    5263           21204                           OCT      21204                                 
049511,000142: 
049512,000143:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
049513,000144: 
049514,000145:    5264           52062        LVWTLIST           DXCH     WAITEXIT                              
049515,000146:    5265           65000                           AD       TWO                                   
049516,000147:    5266           52006                           DTCB                                           
049517,000148: 
049518,000149:    5267  E3,1400                                  EBANK=   LST1                                  
049519,000150:    5267           02063        WAITBB             BBCON    WAIT2                                 
049520,000151: 
049521,000152:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
049522,000153: 
049523,000154:    5270           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
049524,000155:    5271           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
049525,000156:    5272           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
049526,000157: 
049527,000158:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
049528,000159: 
049529,000160:    5273           00006        VARDELAY           EXTEND                                         
049530,000161:    5274           65262                           BZMF     WATLST0-                              
049531,000162:    5275           56002                           XCH      Q                                     
049532,000163:    5276           54063                           TS       WAITADR                               
049533,000164:    5277           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
049534,000165:    5300           00006                           EXTEND                                         
049535,000166:    5301           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
049536,000167:    5302           54001                           TS       L                                     
049537,000168:    5303           35306                           CAF      DELAYEX                               
049538,000169:    5304           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
049539,000170:    5305           15257                           TCF      DLY2                                  
049540,000171: 
049541,000172:    5306           15325        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
049542,000173: 
049543,000174:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
049544,000175: 
049545,000176:    5307  E3,1400                                  EBANK=   LST1                                  
049546,000177:    5307           72466 73714  ENDTASK            -2CADR   SVCT3                                 
049547,000178: 
049548,000179:    5311           30076        SVCT3              CA       FLAGWRD2                              
049549,000180:    5312           74763                           MASK     DRFTBIT                               
049550,000181:    5313           00006                           EXTEND                                         
049551,000182:    5314           15327                           BZF      TASKOVER                              
049552,000183:    5315           11325                           CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
049553,000184:    5316           17703                           TCF      SVCT3X                                
049554,000185:    5317           15322                           TCF      +3                                    
049555,000186:    5320           17703                           TCF      SVCT3X                                
049556,000187:    5321           17703                           TCF      SVCT3X                                
049557,000188:    5322           37657                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
049558,000189:    5323           05134        NOVACADR           TC       NOVAC                                 #  ENABLE EVERY 81.93 SECONDS (=GENADR)
049559,000190:    5324  E3,1460                                  EBANK=   NBDX                                  
049560,000191:    5324           03556 14063                     2CADR    NBDONLY                               
049561,000192: 
049562,000193:    5326           05327        TSKOVCDR           TC       TASKOVER                              #  (=GENADR)
049563,000194:    6000                                           SETLOC   FFTAG6                                
049564,000195:    6000                                           BANK                                           
049565,000196: 
049566,000197:    7703                                           COUNT*   $$/WAIT                               
049567,000198:    7703           05270        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMU ZERO
049568,000199:    7704           00764        DEC500             DEC      500        B-14                       #  MUST COME AFTER SVCT3X
049569,000200:    7705           05311                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN
049570,000201: 
049571,000202:                                                                                                  #  BEGIN TASK INSERTION.
049572,000203: 
049573,000204: 01,2000                                           SETLOC   EXECB1                                
049574,000205: 01,2000                                           BANK                                           
049575,000206: 
049576,000207: 01,3221                                           COUNT*   $$/WAIT                               
049577,000208: 01,3221           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
049578,000209: 01,3222           40026                           CS       TIME3                                 
049579,000210: 01,3223           64772                           AD       BIT8                                  #  BIT 8 = OCT 200
049580,000211: 01,3224           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
049581,000212:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
049582,000213:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
049583,000214:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
049584,000215: 
049585,000216: 01,3225           66056                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
049586,000217: 01,3226           40000                           CS       A                                     #  T - T1 + 1.0 - 201
049587,000218: 
049588,000219:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
049589,000220: 
049590,000221: 01,3227           63125                           AD       OCT40201                              
049591,000222: 01,3230           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
049592,000223: 
049593,000224: 01,3231           10000                           CCS      A                                     #  TEST TD - T1 + 1
049594,000225: 
049595,000226: 01,3232           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
049596,000227: 01,3233           13275                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
049597,000228: 
049598,000229: 01,3234           13235                           NOOP                                           
049599,000230: 01,3235           40002                           CS       Q                                     
049600,000231: 
049601,000232:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
049602,000233:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
049603,000234:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
049604,000235:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
049605,000236: 
049606,000237: 01,3236           64764                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
049607,000238: 01,3237           64764                           AD       POS1/2                                #    1.0 - DELTA T = 1.0 - (TD - T)
049608,000239: 01,3240           56026                           XCH      TIME3                                 
049609,000240: 01,3241           64763                           AD       NEGMAX                                
049610,000241: 01,3242           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
049611,000242: 01,3243           00006                           EXTEND                                         #  ZERO INDEX Q.
049612,000243: 01,3244           22007                           QXCH     7                                     #  (ZQ)
049613,000244: 
049614,000245: 01,3245           57400        WTLST4             XCH      LST1                                  
049615,000246: 01,3246           57401                           XCH      LST1       +1                         
049616,000247: 01,3247           57402                           XCH      LST1       +2                         
049617,000248: 01,3250           57403                           XCH      LST1       +3                         
049618,000249: 01,3251           57404                           XCH      LST1       +4                         
049619,000250: 01,3252           57405                           XCH      LST1       +5                         
049620,000251: 01,3253           57406                           XCH      LST1       +6                         
049621,000252: 01,3254           57407                           XCH      LST1       +7                         
049622,000253: 
049623,000254: 01,3255           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
049624,000255: 01,3256           50002                           INDEX    Q                                     
049625,000256: 01,3257           13260                           TCF      +1                                    
049626,000257: 
049627,000258: 01,3260           53411                           DXCH     LST2                                  
049628,000259: 01,3261           53413                           DXCH     LST2       +2                         
049629,000260: 01,3262           53415                           DXCH     LST2       +4                         
049630,000261: 01,3263           53417                           DXCH     LST2       +6                         
049631,000262: 01,3264           53421                           DXCH     LST2       +8D                        
049632,000263: 01,3265           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2+10) IS STD
049633,000264: 01,3266           53425                           DXCH     LST2       +12D                       
049634,000265: 01,3267           53427                           DXCH     LST2       +14D                       
049635,000266: 01,3270           53431                           DXCH     LST2       +16D                       
049636,000267: 01,3271           65307                           AD       ENDTASK                               #    END ITEM, AS CHECK FOR EXCEEDING
049637,000268:                                                                                                  #    THE LENGTH OF THE LIST.
049638,000269: 01,3272           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
049639,000270: 01,3273           15264                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
049640,000271: 01,3274           13350                           TCF      WTABORT                               #  IT.
049641,000272: 
049642,000273: 01,3275           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
049643,000274: 01,3276           61401                           AD       LST1       +1                         
049644,000275: 01,3277           13303                           TCF      +4                                    
049645,000276: 01,3300           65001                           AD       ONE                                   
049646,000277: 01,3301           03355                           TC       WTLST2                                
049647,000278: 01,3302           00001                           OCT      1                                     
049648,000279: 
049649,000280: 01,3303           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
049650,000281: 01,3304           61402                           AD       LST1       +2                         
049651,000282: 01,3305           13311                           TCF      +4                                    
049652,000283: 01,3306           65001                           AD       ONE                                   
049653,000284: 01,3307           03355                           TC       WTLST2                                
049654,000285: 01,3310           00002                           OCT      2                                     
049655,000286: 
049656,000287: 01,3311           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
049657,000288: 01,3312           61403                           AD       LST1       +3                         
049658,000289: 01,3313           13317                           TCF      +4                                    
049659,000290: 01,3314           65001                           AD       ONE                                   
049660,000291: 01,3315           03355                           TC       WTLST2                                
049661,000292: 01,3316           00003                           OCT      3                                     
049662,000293: 
049663,000294: 01,3317           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
049664,000295: 01,3320           61404                           AD       LST1       +4                         
049665,000296: 01,3321           13325                           TCF      +4                                    
049666,000297: 01,3322           65001                           AD       ONE                                   
049667,000298: 01,3323           03355                           TC       WTLST2                                
049668,000299: 01,3324           00004                           OCT      4                                     
049669,000300: 
049670,000301: 01,3325           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
049671,000302: 01,3326           61405                           AD       LST1       +5                         
049672,000303: 01,3327           13333                           TCF      +4                                    
049673,000304: 01,3330           65001                           AD       ONE                                   
049674,000305: 01,3331           03355                           TC       WTLST2                                
049675,000306: 01,3332           00005                           OCT      5                                     
049676,000307: 
049677,000308: 01,3333           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
049678,000309: 01,3334           61406                           AD       LST1       +6                         
049679,000310: 01,3335           13341                           TCF      +4                                    
049680,000311: 01,3336           65001                           AD       ONE                                   
049681,000312: 01,3337           03355                           TC       WTLST2                                
049682,000313: 01,3340           00006                           OCT      6                                     
049683,000314: 
049684,000315: 01,3341           10000                 +4        CCS      A                                     
049685,000316: 01,3342           61407                           AD       LST1       +7                         
049686,000317: 01,3343           13347                           TCF      +4                                    
049687,000318: 01,3344           65001                           AD       ONE                                   
049688,000319: 01,3345           03355                           TC       WTLST2                                
049689,000320: 01,3346           00007                           OCT      7                                     
049690,000321: 
049691,000322: 01,3347           10000                 +4        CCS      A                                     
049692,000323: 01,3350           07750        WTABORT            TC       BAILOUT                               #  NO ROOM IN THE INN.
049693,000324: 01,3351           31203                           OCT      31203                                 
049694,000325: 
049695,000326: 01,3352           65001                           AD       ONE                                   
049696,000327: 01,3353           03355                           TC       WTLST2                                
049697,000328: 01,3354           00010                           OCT      10                                    
049698,000329: 
049699,000330:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT  N  IS FOR T  LE TD LE T   -1.
049700,000331:                                                                                                  #                                                     N           N+1
049701,000332: 
049702,000333:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
049703,000334:                                                                                                  #                                                              N+1
049704,000335: 
049705,000336:                                                                                                  #  THE LST1 ENTRY -(T   -T +1) IS TO BE REPLACED BY -(TD - T + 1), AND
049706,000337:                                                                                                  #                    N+1  N                                 N
049707,000338: 
049708,000339:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
049709,000340:                                                                                                  #               N+1
049710,000341: 
049711,000342: 01,3355           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
049712,000343: 01,3356           50002                           INDEX    Q                                     
049713,000344: 01,3357           30000                           CAF      0                                     
049714,000345: 01,3360           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
049715,000346: 
049716,000347: 01,3361           35001                           CAF      ONE                                   
049717,000348: 01,3362           60064                           AD       WAITTEMP                              
049718,000349: 01,3363           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
049719,000350: 01,3364           27377                           ADS      LST1       -1                         #                 N
049720,000351: 
049721,000352: 01,3365           40064                           CS       WAITTEMP                              
049722,000353: 01,3366           50002                           INDEX    Q                                     
049723,000354: 01,3367           13245                           TCF      WTLST4                                
049724,000355: 
049725,000356:                                                                                                  #  C(TIME3) = 1.0 - (T1 - T)
049726,000357: 
049727,000358:                                                                                                  #  C(LST1  ) = - (T2 - T1) + 1
049728,000359:                                                                                                  #  C(LST1+1) = - (T3 - T2) + 1
049729,000360:                                                                                                  #  C(LST1+2) = - (T4 - T3) + 1
049730,000361:                                                                                                  #  C(LST1+3) = - (T5 - T4) + 1
049731,000362:                                                                                                  #  C(LST1+4) = - (T6 - T5) + 1
049732,000363: 
049733,000364:                                                                                                  #  C(LST2   ) = 2CADR    TASK1
049734,000365:                                                                                                  #  C(LST2+2 ) = 2CADR    TASK2
049735,000366:                                                                                                  #  C(LST2+4 ) = 2CADR    TASK3
049736,000367:                                                                                                  #  C(LST2+6 ) = 2CADR    TASK4
049737,000368:                                                                                                  #  C(LST2+8 ) = 2CADR    TASK5
049738,000369:                                                                                                  #  C(LST2+10) = 2CADR    TASK6
049739,000370: 
049740,000371:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
049741,000372: 
049742,000373: 01,3370           00006        T3RUPT             EXTEND                                         
049743,000374: 01,3371           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
049744,000375: 01,3372           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
049745,000376: 01,3373           00006                           EXTEND                                         
049746,000377: 01,3374           22012                           QXCH     QRUPT                                 
049747,000378: 
049748,000379: 01,3375           34762        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
049749,000380: 01,3376           57407                           XCH      LST1       +7                         
049750,000381: 01,3377           57406                           XCH      LST1       +6                         
049751,000382: 01,3400           57405                           XCH      LST1       +5                         
049752,000383: 01,3401           57404                           XCH      LST1       +4                         #  1.  MOVE UP LST1 CONTENTS, ENTERING
049753,000384: 01,3402           57403                           XCH      LST1       +3                         #      A VALUE OF 1/2 +1 AT THE BOTTOM
049754,000385: 01,3403           57402                           XCH      LST1       +2                         #      FOR T6-T5, CORRESPONDING TO THE
049755,000386: 01,3404           57401                           XCH      LST1       +1                         #      INTERVAL 81.91 SEC FOR ENDTASK.
049756,000387: 01,3405           57400                           XCH      LST1                                  
049757,000388: 01,3406           64761                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
049758,000389: 01,3407           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
049759,000390: 01,3410           55127                           TS       RUPTAGN                               
049760,000391: 01,3411           45003                           CS       ZERO                                  
049761,000392: 01,3412           55127                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
049762,000393: 
049763,000394: 01,3413           00006                           EXTEND                                         #  DISPATCH TASK.
049764,000395: 01,3414           45310                           DCS      ENDTASK                               
049765,000396: 01,3415           53431                           DXCH     LST2       +16D                       
049766,000397: 01,3416           53427                           DXCH     LST2       +14D                       
049767,000398: 01,3417           53425                           DXCH     LST2       +12D                       
049768,000399: 01,3420           53423                           DXCH     LST2       +10D                       
049769,000400: 01,3421           53421                           DXCH     LST2       +8D                        
049770,000401: 01,3422           53417                           DXCH     LST2       +6                         
049771,000402: 01,3423           53415                           DXCH     LST2       +4                         
049772,000403: 01,3424           53413                           DXCH     LST2       +2                         
049773,000404: 01,3425           53411                           DXCH     LST2                                  
049774,000405: 
049775,000406: 01,3426           56001                           XCH      L                                     
049776,000407: 01,3427           00006                           EXTEND                                         
049777,000408: 01,3430           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
049778,000409: 01,3431           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
049779,000410: 01,3432           52006                           DTCB                                           
049780,000411: 
049781,000412:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
049782,000413: 
049783,000414:    4000                                           SETLOC   WAITF2                                
049784,000415:    4000                                           BANK                                           
049785,000416: 
049786,000417:    5327                                           COUNT*   $$/WAIT                               
049787,000418:    5327           11127        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
049788,000419:    5330           35267                           CAF      WAITBB                                
049789,000420:    5331           54006                           TS       BBANK                                 
049790,000421:    5332           13375                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
049791,000422: 
049792,000423:    5333           30016        SUPERRSM           CA       BANKRUPT                              
049793,000424:    5334           00006                           EXTEND                                         
049794,000425:    5335           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
049795,000426: 
049796,000427:    5336           00006        RESUME             EXTEND                                         
049797,000428:    5337           22012                           QXCH     QRUPT                                 
049798,000429:    5340           30016        NOQRSM             CA       BANKRUPT                              
049799,000430:    5341           56006                 +1        XCH      BBANK                                 
049800,000431:    5342           52011        NOQBRSM            DXCH     ARUPT                                 
049801,000432:    5343           00003                           RELINT                                         
049802,000433:    5344           50017                           RESUME                                         
049803,000434: 
049804,000435:                                                                                                  #  LONGCALL
049805,000436:                                                                                                  #  PROGRAM DESCRIPTION                                         DATE- 17 MARCH 1967
049806,000437:                                                                                                  #  PROGRAM WRITTEN BY W.H. VANDEVER                           LOG SECTION WAITLIST
049807,000438:                                                                                                  #  MOD BY- R. MELANSON TO ADD DOCUMENTATION              ASSEMBLY SUNDISK REV. 100
049808,000439: 
049809,000440:                                                                                                  #  FUNCTIONAL DESCRIPTION-
049810,000441:                                                                                                  #  LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
049811,000442:                                                                                                  #  IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
049812,000443:                                                                                                  #  A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
049813,000444:                                                                                                  #  START
049814,000445: 
049815,000446:                                                                                                  #  CALLING SEQUENCE-
049816,000447:                                                                                                  #                                EXTEND
049817,000448:                                                                                                  #                                DCA     TIMELOC
049818,000449:                                                                                                  #                                TC      LONGCALL
049819,000450:                                                                                                  #                                2CADR   TASKTODO
049820,000451: 
049821,000452:                                                                                                  #  NORMAL EXIT MODE-
049822,000453:                                                                                                  #        1). TC    WAITLIST
049823,000454:                                                                                                  #        2). DTCB  (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
049824,000455:                                                                                                  #        3). DTCB  (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
049825,000456: 
049826,000457:                                                                                                  #  ALARM OR ABORT EXIT MODE-
049827,000458:                                                                                                  #        NONE
049828,000459: 
049829,000460:                                                                                                  #  OUTPUT-
049830,000461:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
049831,000462:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
049832,000463:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
049833,000464:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
049834,000465: 
049835,000466:                                                                                                  #  ERASABLE INITIALIZATION-
049836,000467:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
049837,000468:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
049838,000469:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
049839,000470: 
049840,000471:                                                                                                  #  DEBRIS-
049841,000472:                                                                                                  #        A,Q,L
049842,000473:                                                                                                  #        LONGCADR AND LONGCADR+1
049843,000474:                                                                                                  #        LONGEXIT AND LONGEXIT+1
049844,000475:                                                                                                  #        LONGTIME AND LONGTIME+1
049845,000476: 
049846,000477:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
049847,000478: 
049848,000479:    4000                                           SETLOC   WAITF2                                
049849,000480:    4000                                           BANK                                           
049850,000481: 
049851,000482:    5345                                           COUNT*   $$/WAIT                               
049852,000483:    5345  E3,1400                                  EBANK=   LST1                                  
049853,000484:    5345           53275        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
049854,000485: 
049855,000486:    5346           00006                           EXTEND                                         #  OBTAIN THE 2CADR
049856,000487:    5347           50002                           NDX      Q                                     
049857,000488:    5350           30001                           DCA      0                                     
049858,000489:    5351           53271                           DXCH     LONGCADR                              
049859,000490: 
049860,000491:    5352           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
049861,000492:    5353           35356                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
049862,000493:    5354           52006                           DTCB                                           
049863,000494: 
049864,000495:    5355  E3,1400                                  EBANK=   LST1                                  
049865,000496:    5355           03433 02063  LGCL2CDR           2CADR    LNGCALL2                              
049866,000497: 
049867,000498:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
049868,000499: 
049869,000500: 01,2000                                           SETLOC   EXECB1                                
049870,000501: 01,2000                                           BANK                                           
049871,000502: 
049872,000503: 01,3433                                           COUNT*   $$/WAIT                               
049873,000504: 01,3433           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
049874,000505: 01,3434           35000                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
049875,000506: 01,3435           26002                           ADS      Q                                     
049876,000507: 01,3436           55434                           TS       LONGEXIT                              
049877,000508: 
049878,000509: 01,3437           11274        LGCLNGTM           CCS      LONGTIME                              #  TEST FOR NEG. TIME
049879,000510: 01,3440           13446                           TCF      LONGCYCL                              #  HI-ORDER POS...OK
049880,000511: 01,3441           13443                           TCF      +2                                    #           ZERO..TEST LO-ORDER
049881,000512: 01,3442           15262                           TCF      WATLST0-                              #           NEG...POODOO
049882,000513: 01,3443           31275                           CA       LONGTIME   +1                         #           ZERO..TEST LO-ORDER
049883,000514: 01,3444           00006                           EXTEND                                         
049884,000515: 01,3445           65262                           BZMF     WATLST0-                              #  LO-ORDER ZERO/NEG...POODOO
049885,000516: 
049886,000517:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
049887,000518: 
049888,000519: 01,3446           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
049889,000520: 01,3447           43460                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
049890,000521: 01,3450           21275                           DAS      LONGTIME                              
049891,000522: 
049892,000523: 01,3451           11275                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
049893,000524: 01,3452           13470                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
049894,000525:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
049895,000526:                                                                                                  #  BASIC INSTRUCTIONS
049896,000527:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
049897,000528:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
049898,000529:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
049899,000530: 01,3453           13454                           NOOP                                           #  CAN:T GET HERE        **********
049900,000531: 01,3454           13455                           TCF      +1                                    
049901,000532: 01,3455           11274                           CCS      LONGTIME                              
049902,000533: 01,3456           13470                           TCF      MUCHTIME                              
049903,000534: 01,3457           00000        DPBIT14            OCT      00000                                 
049904,000535: 01,3460           20000                           OCT      20000                                 
049905,000536: 
049906,000537:                                                                                                  #  LONGCALL
049907,000538: 01,3461           34764        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA T FOR WAITLIST
049908,000539: 01,3462           27275                           ADS      LONGTIME   +1                         
049909,000540: 01,3463           05236                           TC       TWIDDLE                               
049910,000541: 01,3464           03150                           ADRES    GETCADR                               #  THE ENTRY TO OUR LONGCADR
049911,000542: 01,3465           35326        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
049912,000543: 01,3466           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
049913,000544: 01,3467           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
049914,000545: 
049915,000546: 01,3470           34764        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
049916,000547: 01,3471           05246        WTLTCADR           TC       WAITLIST                              #  SET UP ANOTHER CYCLE THRU HERE (=GENADR)
049917,000548: 01,3472  E3,1400                                  EBANK=   LST1                                  
049918,000549: 01,3472           03446 02063                     2CADR    LONGCYCL                              
049919,000550: 
049920,000551: 01,3474           13465                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY

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