Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

052098,000002:                                                                                                  ## Copyright:   Public domain.
052099,000003:                                                                                                  ## Filename:    WAITLIST.agc
052100,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
052101,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
052102,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
052103,000007:                                                                                                  ## Assembler:   yaYUL
052104,000008:                                                                                                  ## Reference:   Begins on p. 1191
052105,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
052106,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
052107,000011:                                                                                                  ## Mod history: 08/28/04   RSB  Began adapting from similar Luminary131 file.
052108,000012:                                                                                                  ##              05/14/05   RSB  Corrected website reference above.
052109,000013:                                                                                                  ##              2010-10-24 JL   Indentation fixes.
052110,000014:                                                                                                  ##              2011-05-07 JL   Remove workarounds.
052111,000015:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
052112,000016:                                                                                                  ##                              original harcopy, as opposed to the PDF page
052113,000017:                                                                                                  ##                              numbers in 1701.pdf.
052114,000018:                                                                                                  ##              2017-01-20 RSB  Cross-diff'd comment text (not whitespace)
052115,000019:                                                                                                  ##                              vs the already-proofed corresponding Colossus
052116,000020:                                                                                                  ##                              237 and Comanche 55 source-code files
052117,000021:                                                                                                  ##                              and corrected errors found.
052118,000022:                                                                                                  ##              2017-02-09 RSB  Comment-text fixes identified in proofing Artemis 72
052119,000023:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
052120,000024:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
052121,000025: 
052122,000026:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
052123,000027:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
052124,000028:                                                                                                  ## document read, in part:
052125,000029:                                                                                                  ##
052126,000030:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
052127,000031:                                                                                                  ##      2021111-041.  October 28, 1968.  
052128,000032:                                                                                                  ##
052129,000033:                                                                                                  ##      This AGC program shall also be referred to as
052130,000034:                                                                                                  ##                              Colossus 1A
052131,000035:                                                                                                  ##
052132,000036:                                                                                                  ##      Prepared by
052133,000037:                                                                                                  ##                      Massachusetts Institute of Technology
052134,000038:                                                                                                  ##                      75 Cambridge Parkway
052135,000039:                                                                                                  ##                      Cambridge, Massachusetts
052136,000040:                                                                                                  ##      under NASA contract NAS 9-4065.
052137,000041:                                                                                                  ##
052138,000042:                                                                                                  ## Refer directly to the online document mentioned above for further information.
052139,000043:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
052140,000044:                                                                                                  ##
052141,000045:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
052142,000046:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
052143,000047:                                                                                                  ## source file, and then is proofed to incorporate any changes.
052144,000048: 

Page 1191

052146,000050:                                                                                                  #  PROGRAM DESCRIPTION                                           DATE - 10 OCTOBER 1966
052147,000051:                                                                                                  #  MOD NO - 2                                                    LOG SECTION - WAITLIST
052148,000052:                                                                                                  #  MOD BY - MILLER       (DTMAX INCREASED TO 162.5 SEC)          ASSEMBLY SUNBURST REV 5
052149,000053:                                                                                                  #  MOD 3 BY KERNAN       (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
052150,000054:                                                                                                  #  MOD 4 BY KERNAN       (TWIDDLE IN 54) 3/28/68 SKIPPER REV 13.
052151,000055: 
052152,000056:                                                                                                  #  FUNCTIONAL DESCRIPTION -
052153,000057:                                                                                                  #        PART OF A SECTION OF PROGRAMS,- WAITLIST, TASKOVER, T3RUPT, USED TO CALL A PROGRAM, (CALLED A TASK),
052154,000058:                                                                                                  #        WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2.  THE MEANING OF THESE LISTS
052155,000059:                                                                                                  #        FOLLOW.
052156,000060: 
052157,000061:                                                                                                  #                C(TIME3) = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
052158,000062: 
052159,000063:                                                                                                  #                        C(LST1)         =       -(T2-T1)+1
052160,000064:                                                                                                  #                        C(LST1 +1)      =       -(T3-T2)+1
052161,000065:                                                                                                  #                        C(LST1 +2)      =       -(T4-T3)+1
052162,000066:                                                                                                  #                                        .
052163,000067:                                                                                                  #                                        .
052164,000068:                                                                                                  #                        C(LST1 +6)      =       -(T8-T7)+1
052165,000069:                                                                                                  #                        C(LST1 +7)      =       -(T9-T8)+1
052166,000070: 
052167,000071:                                                                                                  #                        C(LST2)         =       2CADR OF TASK1
052168,000072:                                                                                                  #                        C(LST2 +2)      =       2CADR OF TASK2
052169,000073:                                                                                                  #                                        .
052170,000074:                                                                                                  #                                        .
052171,000075:                                                                                                  #                        C(LST2 +14)     =       2CADR OF TASK8
052172,000076:                                                                                                  #                        C(LST2 +16)     =       2CADR OF TASK9
052173,000077: 
052174,000078:                                                                                                  #  WARNINGS-
052175,000079:                                                                                                  #  --------
052176,000080:                                                                                                  #        1)      1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
052177,000081:                                                                                                  #        2)      9 TASKS MAXIMUM
052178,000082:                                                                                                  #        3)      TASKS CALLED UNDER INTERRUPT INHIBITED
052179,000083:                                                                                                  #        4)      TASKS END BY TC TASKOVER
052180,000084: 
052181,000085:                                                                                                  #  CALLING SEQUENCE -
052182,000086:                                                                                                  #        L-1     CA      DELTAT  (TIME IN CENTISECONDS TO TASK START)
052183,000087:                                                                                                  #        L       TC      WAITLIST
052184,000088:                                                                                                  #        L+1     2CADR   DESIRED TASK
052185,000089:                                                                                                  #        L+2     (MINOR OF 2CADR)
052186,000090:                                                                                                  #        L+3     RELINT          (RETURNS HERE)
052187,000091: 
052188,000092:                                                                                                  #  TWIDDLE-
052189,000093:                                                                                                  #  -------
052190,000094:                                                                                                  #        TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
052191,000095:                                                                                                  #        SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1192

052193,000097:                                                                                                  #        SAVING A WORD.  TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
052194,000098:                                                                                                  #                L-1     CA      DELTAT
052195,000099:                                                                                                  #                L       TC      TWIDDLE
052196,000100:                                                                                                  #                L+1     ADRES   DESIRED TASK
052197,000101:                                                                                                  #                L+2     RELINT          (RETURNS HERE)
052198,000102: 
052199,000103:                                                                                                  #  NORMAL EXIT MODES -
052200,000104:                                                                                                  #        AT L+3 OF CALLING SEQUENCE
052201,000105: 
052202,000106:                                                                                                  #  ALARM OR ABORT EXIT MODES -
052203,000107:                                                                                                  #        TC      ABORT
052204,000108:                                                                                                  #        OCT     1203    (WAITLIST OVERFLOW - TOO MANY TASKS)
052205,000109: 
052206,000110:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
052207,000111:                                                                                                  #        ACCOMPLISHED BY FRESH START,--  LST2, ..., LST2 +16 = ENDTASK
052208,000112:                                                                                                  #                                        LST1, ..., LST1 +7  = NEG1/2
052209,000113: 
052210,000114:                                                                                                  #  OUTPUT --
052211,000115:                                                                                                  #        LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
052212,000116: 
052213,000117:                                                                                                  #  DEBRIS -
052214,000118:                                                                                                  #        CENTRALS - A,Q,L
052215,000119:                                                                                                  #        OTHER    - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
052216,000120: 
052217,000121:                                                                                                  #  DETAILED ANALYSIS OF TIMING -
052218,000122:                                                                                                  #        CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR) IN EXACTLY DELTA T CENTISECONDS.
052219,000123:                                                                                                  #        THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
052220,000124:                                                                                                  #                LET TO = THE TIME OF THE TC WAITLIST
052221,000125:                                                                                                  #                LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
052222,000126:                                                                                                  #                LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
052223,000127:                                                                                                  #                LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
052224,000128:                                                                                                  #                LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
052225,000129:                                                                                                  #                         (Z=0, USUALLY)
052226,000130:                                                                                                  #                LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
052227,000131:                                                                                                  #                        THEN DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
052228,000132:                                                                                                  #                *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
052229,000133:                                                                                                  #        IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
052230,000134:                                                                                                  #        INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
052231,000135:                                                                                                  #        OF OTHER TASKS INHIBITING THE INTERRUPT.
052232,000136: 
052233,000137:    5130                                           BLOCK    02                                    

Page 1193

052235,000139:    5130  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
052236,000140: 
052237,000141:    5130                                           COUNT    02/WAIT                               
052238,000142: 
052239,000143:    5130           00004        TWIDDLE            INHINT                                         
052240,000144:    5131           54001                           TS       L                                     #  SAVE DELAY TIME IN L
052241,000145:    5132           34672                           CA       POSMAX                                
052242,000146:    5133           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
052243,000147:    5134           30006                           CA       BBANK                                 
052244,000148:    5135           00006                           EXTEND                                         
052245,000149:    5136           04007                           ROR      SUPERBNK                              
052246,000150:    5137           56001                           XCH      L                                     
052247,000151: 
052248,000152:    5140           00004        WAITLIST           INHINT                                         
052249,000153:    5141           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
052250,000154:    5142           54061                           TS       WAITEXIT                              #  WAITEXIT.
052251,000155:    5143           00006                           EXTEND                                         
052252,000156:    5144           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
052253,000157:    5145           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
052254,000158:    5146           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
052255,000159:    5147           35155        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
052256,000160:    5150           56006                           XCH      BBANK                                 
052257,000161:    5151           13246                           TCF      WAIT2                                 
052258,000162: 
052259,000163:                                                                                                  #  RETURN TO CALLER AFTER TASK INSERTION:
052260,000164: 
052261,000165:    5152           52062        LVWTLIST           DXCH     WAITEXIT                              
052262,000166:    5153           64711                           AD       TWO                                   
052263,000167:    5154           52006                           DTCB                                           
052264,000168: 
052265,000169:    5155  E3,1400                                  EBANK=   LST1                                  
052266,000170:    5155           02063        WAITBB             BBCON    WAIT2                                 
052267,000171: 
052268,000172:                                                                                                  #  RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
052269,000173: 
052270,000174:    5156           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
052271,000175:    5157           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
052272,000176:    5160           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
052273,000177: 
052274,000178:                                                                                                  #  RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
052275,000179: 
052276,000180:    5161           56002        VARDELAY           XCH      Q                                     #  DT TO Q.  TASK ADRES TO WAITADR.
052277,000181:    5162           54063                           TS       WAITADR                               
052278,000182:    5163           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
052279,000183:    5164           00006                           EXTEND                                         
052280,000184:    5165           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
052281,000185:    5166           54001                           TS       L                                     
052282,000186:    5167           35172                           CAF      DELAYEX                               
052283,000187:    5170           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
052284,000188:    5171           15147                           TCF      DLY2                                  
052285,000189: 

Page 1194

052287,000191:    5172           15211        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
052288,000192: 

Page 1195

052290,000194:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
052291,000195: 
052292,000196:    5173  E3,1400                                  EBANK=   LST1                                  
052293,000197:    5173           72602 73714  ENDTASK            -2CADR   SVCT3                                 
052294,000198: 
052295,000199:    5175           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
052296,000200:    5176           15213                           TCF      TASKOVER                              
052297,000201:    5177           15213                           TCF      TASKOVER                              
052298,000202:    5200           15201                           TCF      +1                                    
052299,000203: 
052300,000204:    5201           11322                           CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
052301,000205:    5202           15213                           TCF      TASKOVER                              #  IMUSTALL.
052302,000206:    5203           15206                           TCF      +3                                    
052303,000207:    5204           15213                           TCF      TASKOVER                              
052304,000208:    5205           15213                           TCF      TASKOVER                              
052305,000209: 
052306,000210:    5206           37672                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
052307,000211:    5207           05027                           TC       NOVAC                                 #        ENABLE EVERY 81.93 SECONDS
052308,000212:    5210  E3,1460                                  EBANK=   NBDX                                  
052309,000213:    5210           03542 14063                     2CADR    NBDONLY                               
052310,000214: 
052311,000215:    5212           15213                           TCF      TASKOVER                              
052312,000216: 

Page 1196

052314,000218:                                                                                                  #  BEGIN TASK INSERTION.
052315,000219: 
052316,000220: 01,3246                                           BANK     01                                    
052317,000221: 01,3246                                           COUNT    01/WAIT                               
052318,000222: 
052319,000223: 01,3246           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
052320,000224: 01,3247           40026                           CS       TIME3                                 
052321,000225: 01,3250           64703                           AD       BIT8                                  #  BIT 8 = OCT 200
052322,000226: 01,3251           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
052323,000227:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
052324,000228:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
052325,000229:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
052326,000230: 
052327,000231: 01,3252           66056                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
052328,000232: 01,3253           40000                           CS       A                                     #  T - T1 + 1.0 - 201
052329,000233: 
052330,000234:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
052331,000235: 
052332,000236: 01,3254           63402                           AD       OCT40201                              
052333,000237: 01,3255           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
052334,000238: 
052335,000239: 01,3256           10000                           CCS      A                                     #  TEST TD - T1 +1
052336,000240: 
052337,000241: 01,3257           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
052338,000242: 01,3260           13322                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
052339,000243: 
052340,000244: 01,3261           13262                           NOOP                                           
052341,000245: 01,3262           40002                           CS       Q                                     
052342,000246: 
052343,000247:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
052344,000248:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1.  (G/E
052345,000249:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
052346,000250:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
052347,000251: 
052348,000252: 01,3263           64675                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
052349,000253: 01,3264           64675                           AD       POS1/2                                #        1.0 - DELTA T = 1.0 - (TD - T)
052350,000254: 01,3265           56026                           XCH      TIME3                                 
052351,000255: 01,3266           64674                           AD       NEGMAX                                
052352,000256: 01,3267           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
052353,000257: 01,3270           00006                           EXTEND                                         #  ZERO INDEX Q.
052354,000258: 01,3271           22007                           QXCH     7                                     #  (ZQ)
052355,000259: 

Page 1197

052357,000261: 01,3272           57400        WTLST4             XCH      LST1                                  
052358,000262: 01,3273           57401                           XCH      LST1       +1                         
052359,000263: 01,3274           57402                           XCH      LST1       +2                         
052360,000264: 01,3275           57403                           XCH      LST1       +3                         
052361,000265: 01,3276           57404                           XCH      LST1       +4                         
052362,000266: 01,3277           57405                           XCH      LST1       +5                         
052363,000267: 01,3300           57406                           XCH      LST1       +6                         
052364,000268: 01,3301           57407                           XCH      LST1       +7                         
052365,000269: 
052366,000270: 01,3302           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
052367,000271: 01,3303           50002                           INDEX    Q                                     
052368,000272: 01,3304           13305                           TCF      +1                                    
052369,000273: 
052370,000274: 01,3305           53411                           DXCH     LST2                                  
052371,000275: 01,3306           53413                           DXCH     LST2       +2                         
052372,000276: 01,3307           53415                           DXCH     LST2       +4                         
052373,000277: 01,3310           53417                           DXCH     LST2       +6                         
052374,000278: 01,3311           53421                           DXCH     LST2       +8D                        
052375,000279: 01,3312           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2 +10) IS STD
052376,000280: 01,3313           53425                           DXCH     LST2       +12D                       
052377,000281: 01,3314           53427                           DXCH     LST2       +14D                       
052378,000282: 01,3315           53431                           DXCH     LST2       +16D                       
052379,000283: 01,3316           65173                           AD       ENDTASK                               #  END ITEM, AS CHECK FOR EXCEEDING
052380,000284:                                                                                                  #  THE LENGTH OF THE LIST.
052381,000285: 01,3317           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
052382,000286: 01,3320           15152                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
052383,000287: 01,3321           13375                           TCF      WTABORT                               #  IT.
052384,000288: 

Page 1198

052386,000290: 01,3322           10000        WTLST5             CCS      A                                     #  TEST TD - T2 + 1
052387,000291: 01,3323           61401                           AD       LST1       +1                         
052388,000292: 01,3324           13330                           TCF      +4                                    
052389,000293: 01,3325           64712                           AD       ONE                                   
052390,000294: 01,3326           03403                           TC       WTLST2                                
052391,000295: 01,3327           00001                           OCT      1                                     
052392,000296: 
052393,000297: 01,3330           10000                 +4        CCS      A                                     #  TEST TD - T3 + 1
052394,000298: 01,3331           61402                           AD       LST1       +2                         
052395,000299: 01,3332           13336                           TCF      +4                                    
052396,000300: 01,3333           64712                           AD       ONE                                   
052397,000301: 01,3334           03403                           TC       WTLST2                                
052398,000302: 01,3335           00002                           OCT      2                                     
052399,000303: 
052400,000304: 01,3336           10000                 +4        CCS      A                                     #  TEST TD - T4 + 1
052401,000305: 01,3337           61403                           AD       LST1       +3                         
052402,000306: 01,3340           13344                           TCF      +4                                    
052403,000307: 01,3341           64712                           AD       ONE                                   
052404,000308: 01,3342           03403                           TC       WTLST2                                
052405,000309: 01,3343           00003                           OCT      3                                     
052406,000310: 
052407,000311: 01,3344           10000                 +4        CCS      A                                     #  TEST TD - T5 + 1
052408,000312: 01,3345           61404                           AD       LST1       +4                         
052409,000313: 01,3346           13352                           TCF      +4                                    
052410,000314: 01,3347           64712                           AD       ONE                                   
052411,000315: 01,3350           03403                           TC       WTLST2                                
052412,000316: 01,3351           00004                           OCT      4                                     
052413,000317: 
052414,000318: 01,3352           10000                 +4        CCS      A                                     #  TEST TD - T6 + 1
052415,000319: 01,3353           61405                           AD       LST1       +5                         
052416,000320: 01,3354           13360                           TCF      +4                                    
052417,000321: 01,3355           64712                           AD       ONE                                   
052418,000322: 01,3356           03403                           TC       WTLST2                                
052419,000323: 01,3357           00005                           OCT      5                                     
052420,000324: 
052421,000325: 01,3360           10000                 +4        CCS      A                                     #  TEST TD - T7 + 1
052422,000326: 01,3361           61406                           AD       LST1       +6                         
052423,000327: 01,3362           13366                           TCF      +4                                    
052424,000328: 01,3363           64712                           AD       ONE                                   
052425,000329: 01,3364           03403                           TC       WTLST2                                
052426,000330: 01,3365           00006                           OCT      6                                     
052427,000331: 

Page 1199

052429,000333: 01,3366           10000                 +4        CCS      A                                     
052430,000334: 01,3367           61407                           AD       LST1       +7                         
052431,000335: 01,3370           13374                           TCF      +4                                    
052432,000336: 01,3371           64712                           AD       ONE                                   
052433,000337: 01,3372           03403                           TC       WTLST2                                
052434,000338: 01,3373           00007                           OCT      7                                     
052435,000339: 
052436,000340: 01,3374           10000                 +4        CCS      A                                     
052437,000341: 01,3375           05604        WTABORT            TC       BAILOUT                               #  NO ROOM IN THE INN.
052438,000342: 01,3376           01203                           OCT      1203                                  
052439,000343: 
052440,000344: 01,3377           64712                           AD       ONE                                   
052441,000345: 01,3400           03403                           TC       WTLST2                                
052442,000346: 01,3401           00010                           OCT      10                                    
052443,000347: 
052444,000348: 01,3402           40201        OCT40201           OCT      40201                                 
052445,000349: 

Page 1200

052447,000351:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT N IS FOR T  LE TD LE T   -1.
052448,000352:                                                                                                  #                                                   N           N+1
052449,000353:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
052450,000354:                                                                                                  #                                                              N+1
052451,000355:                                                                                                  #  THE LST1 ENTRY-(T   -T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
052452,000356:                                                                                                  #                   N+1  N                                 N
052453,000357:                                                                                                  #  THE ENTRY-(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
052454,000358:                                                                                                  #              N+1
052455,000359: 
052456,000360: 01,3403           54064        WTLST2             TS       WAITTEMP                              #  C(A) = -(TD - T + 1)
052457,000361: 01,3404           50002                           INDEX    Q                                     
052458,000362: 01,3405           30000                           CAF      0                                     
052459,000363: 01,3406           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
052460,000364: 
052461,000365: 01,3407           34712                           CAF      ONE                                   
052462,000366: 01,3410           60064                           AD       WAITTEMP                              
052463,000367: 01,3411           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
052464,000368: 01,3412           27377                           ADS      LST1       -1                         #                 N
052465,000369: 
052466,000370: 01,3413           40064                           CS       WAITTEMP                              
052467,000371: 01,3414           50002                           INDEX    Q                                     
052468,000372: 01,3415           13272                           TCF      WTLST4                                
052469,000373: 
052470,000374:                                                                                                  #        C(TIME3)        =       1.0 - (T1 - T)
052471,000375: 
052472,000376:                                                                                                  #        C(LST1)         =       - (T2 - T1) + 1
052473,000377:                                                                                                  #        C(LST1+1)       =       - (T3 - T2) + 1
052474,000378:                                                                                                  #        C(LST1+2)       =       - (T4 - T3) + 1
052475,000379:                                                                                                  #        C(LST1+3)       =       - (T5 - T4) + 1
052476,000380:                                                                                                  #        C(LST1+4)       =       - (T6 - T5) + 1
052477,000381: 
052478,000382:                                                                                                  #        C(LST2)         =       2CADR TASK1
052479,000383:                                                                                                  #        C(LST2+2)       =       2CADR TASK2
052480,000384:                                                                                                  #        C(LST2+4)       =       2CADR TASK3
052481,000385:                                                                                                  #        C(LST2+6)       =       2CADR TASK4
052482,000386:                                                                                                  #        C(LST2+8)       =       2CADR TASK5
052483,000387:                                                                                                  #        C(LST2+10)      =       2CADR TASK6
052484,000388: 

Page 1201

052486,000390:                                                                                                  #  ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
052487,000391: 
052488,000392: 01,3416           00006        T3RUPT             EXTEND                                         
052489,000393: 01,3417           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
052490,000394: 01,3420           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
052491,000395: 01,3421           00006                           EXTEND                                         
052492,000396: 01,3422           22012                           QXCH     QRUPT                                 
052493,000397: 
052494,000398: 01,3423           34673        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
052495,000399: 01,3424           57407                           XCH      LST1       +7                         
052496,000400: 01,3425           57406                           XCH      LST1       +6                         
052497,000401: 01,3426           57405                           XCH      LST1       +5                         
052498,000402: 01,3427           57404                           XCH      LST1       +4                         #  1. MOVE UP LST1 CONTENTS, ENTERING
052499,000403: 01,3430           57403                           XCH      LST1       +3                         #     A VALUE OF 1/2 +1 AT THE BOTTOM
052500,000404: 01,3431           57402                           XCH      LST1       +2                         #     FOR T6-T5, CORRESPONDING TO THE
052501,000405: 01,3432           57401                           XCH      LST1       +1                         #     INTERVAL 81.91 SEC FOR ENDTASK.
052502,000406: 01,3433           57400                           XCH      LST1                                  
052503,000407: 01,3434           64672                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 - T USING LIST 1.
052504,000408: 01,3435           26026                           ADS      TIME3                                 #     SO T3 WONT TICK DURING UPDATE.
052505,000409: 01,3436           54734                           TS       RUPTAGN                               
052506,000410: 01,3437           44714                           CS       ZERO                                  
052507,000411: 01,3440           54734                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
052508,000412: 
052509,000413: 01,3441           00006                           EXTEND                                         #  DISPATCH TASK.
052510,000414: 01,3442           45174                           DCS      ENDTASK                               
052511,000415: 01,3443           53431                           DXCH     LST2       +16D                       
052512,000416: 01,3444           53427                           DXCH     LST2       +14D                       
052513,000417: 01,3445           53425                           DXCH     LST2       +12D                       
052514,000418: 01,3446           53423                           DXCH     LST2       +10D                       
052515,000419: 01,3447           53421                           DXCH     LST2       +8D                        
052516,000420: 01,3450           53417                           DXCH     LST2       +6                         
052517,000421: 01,3451           53415                           DXCH     LST2       +4                         
052518,000422: 01,3452           53413                           DXCH     LST2       +2                         
052519,000423: 01,3453           53411                           DXCH     LST2                                  
052520,000424: 
052521,000425: 01,3454           56001                           XCH      L                                     
052522,000426: 01,3455           00006                           EXTEND                                         
052523,000427: 01,3456           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
052524,000428: 01,3457           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
052525,000429: 01,3460           52006                           DTCB                                           
052526,000430: 

Page 1202

052528,000432:                                                                                                  #  RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
052529,000433: 
052530,000434:    5213                                           BLOCK    02                                    
052531,000435:    5213                                           COUNT    02/WAIT                               
052532,000436: 
052533,000437:    5213           10734        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
052534,000438:    5214           35155                           CAF      WAITBB                                
052535,000439:    5215           54006                           TS       BBANK                                 
052536,000440:    5216           13423                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
052537,000441: 
052538,000442:    5217           30016                           CA       BANKRUPT                              
052539,000443:    5220           00006                           EXTEND                                         
052540,000444:    5221           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
052541,000445: 
052542,000446:    5222           00006        RESUME             EXTEND                                         
052543,000447:    5223           22012                           QXCH     QRUPT                                 
052544,000448:    5224           30016        NOQRSM             CA       BANKRUPT                              
052545,000449:    5225           56006                           XCH      BBANK                                 
052546,000450:    5226           52011        NOQBRSM            DXCH     ARUPT                                 
052547,000451:    5227           00003                           RELINT                                         
052548,000452:    5230           50017                           RESUME                                         
052549,000453: 

Page 1203

052551,000455:                                                                                                  #  LONGCALL
052552,000456:                                                                                                  #  PROGRAM DESCRIPTION                           DATE - 17 MARCH 1967
052553,000457:                                                                                                  #  PROGRAM WRITTEN BY W.H.VANDEVER               LOG SECTION WAITLIST
052554,000458:                                                                                                  #  MOD BY - R. MELANSON TO ADD DOCUMENTATION     ASSEMBLY SUNDISK REV. 100
052555,000459: 
052556,000460:                                                                                                  #  FUNCTIONAL DESCRIPTION -
052557,000461:                                                                                                  #        LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
052558,000462:                                                                                                  #        IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
052559,000463:                                                                                                  #        A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
052560,000464:                                                                                                  #        START
052561,000465:                                                                                                  #  CALLING SEQUENCE -
052562,000466:                                                                                                  #                EXTEND
052563,000467:                                                                                                  #                DCA     TIMELOC
052564,000468:                                                                                                  #                TC      LONGCALL
052565,000469:                                                                                                  #                2CADR   TASKTODO
052566,000470:                                                                                                  #  NORMAL EXIT MODE -
052567,000471:                                                                                                  #        1).     TC      WAITLIST
052568,000472:                                                                                                  #        2).     DTCB    (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
052569,000473:                                                                                                  #        3).     DTCB    (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
052570,000474:                                                                                                  #  ALARM OR ABORT EXIT MODE -
052571,000475:                                                                                                  #        NONE
052572,000476:                                                                                                  #  OUTPUT -
052573,000477:                                                                                                  #        LONGTIME AND LONGTIME+1 = DELTA TIME
052574,000478:                                                                                                  #        LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
052575,000479:                                                                                                  #        LONGCADR AND LONGCADR+1 = TASK 2CADR
052576,000480:                                                                                                  #        A = SINGLE PRECISION TIME FOR WAITLIST
052577,000481:                                                                                                  #  ERASABLE INITIALIZATION -
052578,000482:                                                                                                  #        A = MOST SIGNIFICANT PART OF DELTA TIME
052579,000483:                                                                                                  #        L = LEAST SIGNIFICANT PART OF DELTA TIME
052580,000484:                                                                                                  #        Q = ADDRESS OF 2CADR TASK VALUE
052581,000485:                                                                                                  #  DEBRIS -
052582,000486:                                                                                                  #        A,Q,L
052583,000487:                                                                                                  #        LONGCADR AND LONGCADR+1
052584,000488:                                                                                                  #        LONGEXIT AND LONGEXIT+1
052585,000489:                                                                                                  #        LONGTIME AND LONGTIME+1
052586,000490:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
052587,000491: 
052588,000492:    5231                                           BLOCK    02                                    
052589,000493:    5231  E3,1400                                  EBANK=   LST1                                  
052590,000494:    5231           53140        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
052591,000495: 
052592,000496:    5232           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1204

052594,000498:    5233           50002                           NDX      Q                                     
052595,000499:    5234           30001                           DCA      0                                     
052596,000500:    5235           53134                           DXCH     LONGCADR                              
052597,000501: 
052598,000502:    5236           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
052599,000503:    5237           35242                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
052600,000504:    5240           52006                           DTCB                                           
052601,000505: 
052602,000506:    5241  E3,1400                                  EBANK=   LST1                                  
052603,000507:    5241           03461 02063  LGCL2CDR           2CADR    LNGCALL2                              
052604,000508: 
052605,000509:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
052606,000510: 
052607,000511: 01,3461                                           BANK     01                                    
052608,000512: 01,3461                                           COUNT    01/WAIT                               
052609,000513: 
052610,000514: 01,3461           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
052611,000515: 01,3462           34711                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
052612,000516: 01,3463           26002                           ADS      Q                                     
052613,000517: 01,3464           55434                           TS       LONGEXIT                              
052614,000518: 
052615,000519:                                                                                                  #  *** WAITLIST TASK LONGCYCL ***
052616,000520: 
052617,000521: 01,3465           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
052618,000522: 01,3466           43477                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
052619,000523: 01,3467           21140                           DAS      LONGTIME                              
052620,000524: 
052621,000525: 01,3470           11140                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
052622,000526: 01,3471           13510                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
052623,000527:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
052624,000528:                                                                                                  #  BASIC INSTRUCTIONS
052625,000529:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
052626,000530:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
052627,000531:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
052628,000532: 01,3472           13473                           NOOP                                           #  CAN:T GET HERE    **********
052629,000533: 01,3473           13474                           TCF      +1                                    
052630,000534: 01,3474           11137                           CCS      LONGTIME                              
052631,000535: 01,3475           13510                           TCF      MUCHTIME                              
052632,000536: 01,3476           00000        DPBIT14            OCT      00000                                 
052633,000537: 01,3477           20000                           OCT      20000                                 
052634,000538: 
052635,000539:                                                                                                  #  LONGCALL
052636,000540: 01,3500           34675        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
052637,000541: 01,3501           27140                           ADS      LONGTIME   +1                         
052638,000542: 01,3502           05140                           TC       WAITLIST                              
052639,000543: 01,3503  E3,1400                                  EBANK=   LST1                                  
052640,000544: 01,3503           03515 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
052641,000545: 
052642,000546: 01,3505           33517        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS

Page 1205

052644,000548: 01,3506           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
052645,000549: 01,3507           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
052646,000550: 
052647,000551: 01,3510           34675        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
052648,000552: 01,3511           05140                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
052649,000553: 01,3512  E3,1400                                  EBANK=   LST1                                  
052650,000554: 01,3512           03465 02063                     2CADR    LONGCYCL                              
052651,000555: 
052652,000556: 01,3514           13505                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
052653,000557: 
052654,000558:                                                                                                  #  *** WAITLIST TASK GETCADR ***
052655,000559: 
052656,000560: 01,3515           53134        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
052657,000561: 01,3516           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
052658,000562: 
052659,000563: 01,3517           05213        TSKOVCDR           GENADR   TASKOVER                              

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