Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

047969,000002:                                                                                                  ## Copyright:   Public domain.
047970,000003:                                                                                                  ## Filename:    WAITLIST.agc
047971,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
047972,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
047973,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
047974,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
047975,000008:                                                                                                  ##              that the code format has been changed to conform to the
047976,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
047977,000010:                                                                                                  ##              original YUL assembler.
047978,000011:                                                                                                  ## Reference:   pp. 1115-1130
047979,000012:                                                                                                  ## Assembler:   yaYUL
047980,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
047981,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
047982,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
047983,000016:                                                                                                  ##              2016-11-18 MAS  Transcribed. Mostly just comment corrections.
047984,000017:                                                                                                  ##              2016-12-07 HG   Fix P00 -> POO
047985,000018:                                                                                                  ##              2016-12-26 RSB  Comment-text proofed using ProoferComments
047986,000019:                                                                                                  ##                              and corrected errors found.
047987,000020:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
047988,000021:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
047989,000022:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
047990,000023:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
047991,000024: 

Page 1115

047993,000026:                                                                                                  #  PROGRAM DESCRIPTION                                                                     DATE - 10 OCTOBER 1966
047994,000027:                                                                                                  #  MOD NO - 2                                                                              LOG SECTION - WAITLIST
047995,000028:                                                                                                  #  MOD BY - MILLER   (DTMAX INCREASED TO 162.5 SEC)                                        ASSEMBLY SUNBURST REV 5
047996,000029:                                                                                                  #  MOD 3 BY KERNAN  (INHINT INSERTED AT WAITLIST)  2/28/68 SKIPPER REV 4
047997,000030: 
047998,000031:                                                                                                  #  MOD 4BY KERNAN (TWIDDLE IN 54)  3/28/68 SKIPPER REV 13.
047999,000032: 
048000,000033:                                                                                                  #  FUNCTIONAL DESCRIPTION-
048001,000034:                                                                                                  #          PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED  TO CALL A PROGRAM, (CALLED A TASK),
048002,000035:                                                                                                  #     WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2. THE MEANING OF THESE LISTS
048003,000036:                                                                                                  #     FOLLOW.
048004,000037: 
048005,000038:                                                                                                  #                  C(TIME3)  = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
048006,000039: 
048007,000040: 
048008,000041:                                                                                                  #                               C(LST1)    = -(T2-T1)+1
048009,000042:                                                                                                  #                               C(LST1 +1) = -(T3-T2)+1
048010,000043:                                                                                                  #                               C(LST1 +2) = -(T4-T3)+1
048011,000044:                                                                                                  #                                          .
048012,000045:                                                                                                  #                                          .
048013,000046:                                                                                                  #                               C(LST1 +6) = -(T8-T7)+1
048014,000047:                                                                                                  #                               C(LST1 +7) = -(T9-T8)+1
048015,000048: 
048016,000049:                                                                                                  #                               C(LST2)    = 2CADR OF TASK1
048017,000050:                                                                                                  #                               C(LST2 +2) = 2CADR OF TASK2
048018,000051:                                                                                                  #                                          .
048019,000052:                                                                                                  #                                          .
048020,000053:                                                                                                  #                               C(LST2 +14)= 2CADR OF TASK8
048021,000054:                                                                                                  #                               C(LST2 +16)= 2CADR OF TASK9
048022,000055: 
048023,000056:                                                                                                  #  WARNINGS-
048024,000057:                                                                                                  #  --------
048025,000058:                                                                                                  #               1) 1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
048026,000059:                                                                                                  #               2) 9 TASKS MAXIMUM
048027,000060:                                                                                                  #               3) TASKS CALLED UNDER INTERRUPT INHIBITED
048028,000061:                                                                                                  #               4) TASKS END BY TC TASKOVER
048029,000062: 
048030,000063:                                                                                                  #  CALLING SEQUENCE-
048031,000064: 
048032,000065:                                                                                                  #               L-1    CA     DELTAT   (TIME IN CENTISECONDS TO TASK START)
048033,000066:                                                                                                  #               L      TC     WAITLIST
048034,000067:                                                                                                  #               L+1    2CADR  DESIRED TASK
048035,000068:                                                                                                  #               L+2    (MINOR OF 2CADR)
048036,000069:                                                                                                  #               L+3    RELINT          (RETURNS HERE)
048037,000070: 
048038,000071:                                                                                                  #  TWIDDLE -
048039,000072:                                                                                                  #  -------
048040,000073:                                                                                                  #               TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.   IN
048041,000074:                                                                                                  #               SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,

Page 1116

048043,000076:                                                                                                  #               SAVING A WORD.   TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
048044,000077: 
048045,000078:                                                                                                  #               L-1    CA     DELTAT
048046,000079:                                                                                                  #               L      TC     TWIDDLE
048047,000080:                                                                                                  #               L+1    ADRES  DESIRED TASK
048048,000081:                                                                                                  #               L+2    RELINT               (RETURNS HERE)
048049,000082: 
048050,000083:                                                                                                  #  NORMAL EXIT MODES-
048051,000084: 
048052,000085:                                                                                                  #               AT L+3 OF CALLING SEQUENCE
048053,000086: 
048054,000087:                                                                                                  #  ALARM OR ABORT EXIT MODES-
048055,000088: 
048056,000089:                                                                                                  #               TC     ABORT
048057,000090:                                                                                                  #               OCT    1203   (WAITLIST OVERFLOW - TOO MANY TASKS)
048058,000091: 
048059,000092:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
048060,000093: 
048061,000094:                                                                                                  #               ACCOMPLISHED BY FRESH START,--LST2,..., LST2 +16 =ENDTASK
048062,000095:                                                                                                  #                                             LST1,..., LST1 +7  =NEG1/2
048063,000096: 
048064,000097:                                                                                                  #  OUTPUT--
048065,000098: 
048066,000099:                                                                                                  #               LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
048067,000100: 
048068,000101:                                                                                                  #  DEBRIS-
048069,000102: 
048070,000103:                                                                                                  #               CENTRALS- A,Q,L
048071,000104:                                                                                                  #               OTHER   - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
048072,000105:                                                                                                  #  DETAILED ANALYSIS OF TIMING-
048073,000106: 
048074,000107:                                                                                                  #          CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR)   IN EXACTLY DELTA T CENTISECONDS.
048075,000108:                                                                                                  #     THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
048076,000109: 
048077,000110:                                                                                                  #               LET TO = THE TIME OF THE TC WAITLIST
048078,000111:                                                                                                  #               LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
048079,000112:                                                                                                  #               LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
048080,000113:                                                                                                  #               LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
048081,000114:                                                                                                  #               LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
048082,000115:                                                                                                  #     (Z=0, USUALLY)
048083,000116:                                                                                                  #               LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
048084,000117:                                                                                                  #            THEN   DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
048085,000118:                                                                                                  #     *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
048086,000119: 
048087,000120: 
048088,000121:                                                                                                  #          IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
048089,000122:                                                                                                  #     INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
048090,000123:                                                                                                  #     OF OTHER TASKS INHIBITING THE INTERRUPT.
048091,000124: 
048092,000125: 
048093,000126:    5175                                           BLOCK    02                                    

Page 1117

048095,000128:    5175  E3,1400                                  EBANK=   LST1                                  #  TASK  LISTS IN SWITCHED E BANK.
048096,000129: 
048097,000130:    5175                                           COUNT*   $$/WAIT                               
048098,000131:    5175           00004        TWIDDLE            INHINT                                         
048099,000132:    5176           54001                           TS       L                                     #  SAVE DELAY TIME IN L
048100,000133:    5177           34724                           CA       POSMAX                                
048101,000134:    5200           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
048102,000135:    5201           30006                           CA       BBANK                                 
048103,000136:    5202           00006                           EXTEND                                         
048104,000137:    5203           04007                           ROR      SUPERBNK                              
048105,000138:    5204           56001                           XCH      L                                     
048106,000139: 
048107,000140:    5205           00004        WAITLIST           INHINT                                         
048108,000141:    5206           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
048109,000142:    5207           54061                           TS       WAITEXIT                              #  WAITEXIT.
048110,000143:    5210           00006                           EXTEND                                         
048111,000144:    5211           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
048112,000145:    5212           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
048113,000146:    5213           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
048114,000147:    5214           35222        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
048115,000148:    5215           56006                           XCH      BBANK                                 
048116,000149:    5216           13234                           TCF      WAIT2                                 
048117,000150: 
048118,000151:                                                                                                  #           RETURN TO CALLER AFTER TASK INSERTION:
048119,000152: 
048120,000153:    5217           52062        LVWTLIST           DXCH     WAITEXIT                              
048121,000154:    5220           64743                           AD       TWO                                   
048122,000155:    5221           52006                           DTCB                                           
048123,000156: 
048124,000157:    5222  E3,1400                                  EBANK=   LST1                                  
048125,000158:    5222           02063        WAITBB             BBCON    WAIT2                                 
048126,000159: 
048127,000160:                                                                                                  #           RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
048128,000161: 
048129,000162:    5223           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
048130,000163:    5224           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
048131,000164:    5225           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
048132,000165: 
048133,000166:                                                                                                  #           RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
048134,000167: 
048135,000168:    5226           56002        VARDELAY           XCH      Q                                     #  DT TO Q. TASK ADRES TO WAITADR.
048136,000169:    5227           54063                           TS       WAITADR                               
048137,000170:    5230           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
048138,000171:    5231           00006                           EXTEND                                         
048139,000172:    5232           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
048140,000173:    5233           54001                           TS       L                                     
048141,000174:    5234           35237                           CAF      DELAYEX                               
048142,000175:    5235           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
048143,000176:    5236           15214                           TCF      DLY2                                  
048144,000177: 

Page 1118

048146,000179:    5237           15261        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
048147,000180: 

Page 1119

048149,000182:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
048150,000183: 
048151,000184:    5240  E3,1400                                  EBANK=   LST1                                  
048152,000185:    5240           72535 73714  ENDTASK            -2CADR   SVCT3                                 
048153,000186: 
048154,000187:    5242           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
048155,000188:    5243           15263                           TCF      TASKOVER                              
048156,000189:    5244           15263                           TCF      TASKOVER                              
048157,000190:    5245           15246                           TCF      +1                                    
048158,000191: 
048159,000192:    5246           11301        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
048160,000193:    5247           15260                           TCF      SVCT3X                                #  IMUSTALL.
048161,000194:    5250           15253                           TCF      +3                                    
048162,000195:    5251           15260                           TCF      SVCT3X                                
048163,000196:    5252           15260                           TCF      SVCT3X                                
048164,000197: 
048165,000198:    5253           37744                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
048166,000199:    5254           05063                           TC       NOVAC                                 #      ENABLE EVERY 81.93 SECONDS
048167,000200:    5255  E3,1460                                  EBANK=   NBDX                                  
048168,000201:    5255           03625 14063                     2CADR    NBDONLY                               
048169,000202: 
048170,000203:    5257           15263                           TCF      TASKOVER                              
048171,000204: 
048172,000205:    5260           05223        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
048173,000206:    5261           00764                           DEC      500        B-14                       
048174,000207:    5262           05242                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
048175,000208: 

Page 1120

048177,000210:                                                                                                  #           BEGIN TASK INSERTION.
048178,000211: 
048179,000212: 01,3234                                           BANK     01                                    
048180,000213: 01,3234                                           COUNT*   $$/WAIT                               
048181,000214: 01,3234           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
048182,000215: 01,3235           30002                           CA       Q                                     
048183,000216: 01,3236           00006                           EXTEND                                         
048184,000217: 01,3237           63525                           BZMF     WAITPOOH                              
048185,000218: 
048186,000219: 01,3240           40026                           CS       TIME3                                 
048187,000220: 01,3241           64735                           AD       BIT8                                  #  BIT 8 = OCT 200
048188,000221: 01,3242           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
048189,000222:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS  TIME3 AND THAT
048190,000223:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
048191,000224:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
048192,000225: 
048193,000226: 01,3243           66130                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
048194,000227: 01,3244           40000                           CS       A                                     #  T - T1 + 1.0 - 201
048195,000228: 
048196,000229:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
048197,000230: 
048198,000231: 01,3245           63373                           AD       OCT40201                              
048199,000232: 01,3246           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
048200,000233: 
048201,000234: 01,3247           10000                           CCS      A                                     #  TEST TD - T1 + 1
048202,000235: 
048203,000236: 01,3250           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
048204,000237: 01,3251           13313                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
048205,000238: 
048206,000239: 01,3252           13253                           NOOP                                           
048207,000240: 01,3253           40002                           CS       Q                                     
048208,000241: 
048209,000242:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
048210,000243:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1 .  (G/E
048211,000244:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
048212,000245:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
048213,000246: 
048214,000247: 01,3254           64727                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
048215,000248: 01,3255           64727                           AD       POS1/2                                #    1.0 - DELTA T = 1.0 - (TD - T)
048216,000249: 01,3256           56026                           XCH      TIME3                                 
048217,000250: 01,3257           64726                           AD       NEGMAX                                
048218,000251: 01,3260           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
048219,000252: 01,3261           00006                           EXTEND                                         #  ZERO INDEX Q.
048220,000253: 01,3262           22007                           QXCH     7                                     #  (ZQ)
048221,000254: 

Page 1121

048223,000256: 01,3263           57400        WTLST4             XCH      LST1                                  
048224,000257: 01,3264           57401                           XCH      LST1       +1                         
048225,000258: 01,3265           57402                           XCH      LST1       +2                         
048226,000259: 01,3266           57403                           XCH      LST1       +3                         
048227,000260: 01,3267           57404                           XCH      LST1       +4                         
048228,000261: 01,3270           57405                           XCH      LST1       +5                         
048229,000262: 01,3271           57406                           XCH      LST1       +6                         
048230,000263: 01,3272           57407                           XCH      LST1       +7                         
048231,000264: 
048232,000265: 01,3273           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
048233,000266: 01,3274           50002                           INDEX    Q                                     
048234,000267: 01,3275           13276                           TCF      +1                                    
048235,000268: 
048236,000269: 01,3276           53411                           DXCH     LST2                                  
048237,000270: 01,3277           53413                           DXCH     LST2       +2                         
048238,000271: 01,3300           53415                           DXCH     LST2       +4                         
048239,000272: 01,3301           53417                           DXCH     LST2       +6                         
048240,000273: 01,3302           53421                           DXCH     LST2       +8D                        
048241,000274: 01,3303           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2+10) IS STD
048242,000275: 01,3304           53425                           DXCH     LST2       +12D                       
048243,000276: 01,3305           53427                           DXCH     LST2       +14D                       
048244,000277: 01,3306           53431                           DXCH     LST2       +16D                       
048245,000278: 01,3307           65240                           AD       ENDTASK                               #    END ITEM, AS CHECK FOR EXCEEDING
048246,000279:                                                                                                  #    THE LENGTH OF THE LIST.
048247,000280: 01,3310           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
048248,000281: 01,3311           15217                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
048249,000282: 01,3312           13366                           TCF      WTABORT                               #  IT.
048250,000283: 

Page 1122

048252,000285: 01,3313           10000        WTLST5             CCS      A                                     #  TEST  TD - T2 + 1
048253,000286: 01,3314           61401                           AD       LST1       +1                         
048254,000287: 01,3315           13321                           TCF      +4                                    
048255,000288: 01,3316           64744                           AD       ONE                                   
048256,000289: 01,3317           03377                           TC       WTLST2                                
048257,000290: 01,3320           00001                           OCT      1                                     
048258,000291: 
048259,000292: 01,3321           10000                 +4        CCS      A                                     #  TEST  TD - T3 + 1
048260,000293: 01,3322           61402                           AD       LST1       +2                         
048261,000294: 01,3323           13327                           TCF      +4                                    
048262,000295: 01,3324           64744                           AD       ONE                                   
048263,000296: 01,3325           03377                           TC       WTLST2                                
048264,000297: 01,3326           00002                           OCT      2                                     
048265,000298: 
048266,000299: 01,3327           10000                 +4        CCS      A                                     #  TEST  TD - T4 + 1
048267,000300: 01,3330           61403                           AD       LST1       +3                         
048268,000301: 01,3331           13335                           TCF      +4                                    
048269,000302: 01,3332           64744                           AD       ONE                                   
048270,000303: 01,3333           03377                           TC       WTLST2                                
048271,000304: 01,3334           00003                           OCT      3                                     
048272,000305: 
048273,000306: 01,3335           10000                 +4        CCS      A                                     #  TEST  TD - T5 + 1
048274,000307: 01,3336           61404                           AD       LST1       +4                         
048275,000308: 01,3337           13343                           TCF      +4                                    
048276,000309: 01,3340           64744                           AD       ONE                                   
048277,000310: 01,3341           03377                           TC       WTLST2                                
048278,000311: 01,3342           00004                           OCT      4                                     
048279,000312: 
048280,000313: 01,3343           10000                 +4        CCS      A                                     #  TEST  TD - T6 + 1
048281,000314: 01,3344           61405                           AD       LST1       +5                         
048282,000315: 01,3345           13351                           TCF      +4                                    
048283,000316: 01,3346           64744                           AD       ONE                                   
048284,000317: 01,3347           03377                           TC       WTLST2                                
048285,000318: 01,3350           00005                           OCT      5                                     
048286,000319: 
048287,000320: 01,3351           10000                 +4        CCS      A                                     #  TEST  TD - T7 + 1
048288,000321: 01,3352           61406                           AD       LST1       +6                         
048289,000322: 01,3353           13357                           TCF      +4                                    
048290,000323: 01,3354           64744                           AD       ONE                                   
048291,000324: 01,3355           03377                           TC       WTLST2                                
048292,000325: 01,3356           00006                           OCT      6                                     
048293,000326: 

Page 1123

048295,000328: 01,3357           10000                 +4        CCS      A                                     
048296,000329: 01,3360           61407                           AD       LST1       +7                         
048297,000330: 01,3361           13365                           TCF      +4                                    
048298,000331: 01,3362           64744                           AD       ONE                                   
048299,000332: 01,3363           03377                           TC       WTLST2                                
048300,000333: 01,3364           00007                           OCT      7                                     
048301,000334: 
048302,000335: 01,3365           10000                 +4        CCS      A                                     
048303,000336: 01,3366           03374        WTABORT            TC       FILLED                                
048304,000337: 01,3367           13370                           NOOP                                           #  CAN'T GET HERE
048305,000338: 01,3370           64744                           AD       ONE                                   
048306,000339: 01,3371           03377                           TC       WTLST2                                
048307,000340: 01,3372           00010                           OCT      10                                    
048308,000341: 
048309,000342: 01,3373           40201        OCT40201           OCT      40201                                 
048310,000343: 

Page 1124

048312,000345: 01,3374           52062        FILLED             DXCH     WAITEXIT                              
048313,000346: 01,3375           05712                           TC       BAILOUT1                              #  NO ROOM IN THE INN
048314,000347: 01,3376           31203                           OCT      31203                                 
048315,000348: 

Page 1125

048317,000350:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT  N  IS FOR T  LE TD LE T   -1.
048318,000351:                                                                                                  #                                                     N           N+1
048319,000352: 
048320,000353:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
048321,000354:                                                                                                  #                                                              N+1
048322,000355: 
048323,000356:                                                                                                  #  THE LST1 ENTRY -(T   - T +1) IS TO BE REPLACED BY -(TD - T + 1), AND
048324,000357:                                                                                                  #                    N+1   N                                 N
048325,000358: 
048326,000359:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
048327,000360:                                                                                                  #               N+1
048328,000361: 
048329,000362: 01,3377           54064        WTLST2             TS       WAITTEMP                              #      C(A) = -(TD - T   + 1)
048330,000363: 01,3400           50002                           INDEX    Q                                     
048331,000364: 01,3401           30000                           CAF      0                                     
048332,000365: 01,3402           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
048333,000366: 
048334,000367: 01,3403           34744                           CAF      ONE                                   
048335,000368: 01,3404           60064                           AD       WAITTEMP                              
048336,000369: 01,3405           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
048337,000370: 01,3406           27377                           ADS      LST1       -1                         #                 N
048338,000371: 
048339,000372: 01,3407           40064                           CS       WAITTEMP                              
048340,000373: 01,3410           50002                           INDEX    Q                                     
048341,000374: 01,3411           13263                           TCF      WTLST4                                
048342,000375: 
048343,000376:                                                                                                  #  C(TIME3) = 1.0 - (T1 - T)
048344,000377: 
048345,000378:                                                                                                  #  C(LST1  ) = - (T2 - T1) + 1
048346,000379:                                                                                                  #  C(LST1+1) = - (T3 - T2) + 1
048347,000380:                                                                                                  #  C(LST1+2) = - (T4 - T3) + 1
048348,000381:                                                                                                  #  C(LST1+3) = - (T5 - T4) + 1
048349,000382:                                                                                                  #  C(LST1+4) = - (T6 - T5) + 1
048350,000383: 
048351,000384:                                                                                                  #  C(LST2   ) = 2CADR  TASK1
048352,000385:                                                                                                  #  C(LST2+2 ) = 2CADR  TASK2
048353,000386:                                                                                                  #  C(LST2+4 ) = 2CADR  TASK3
048354,000387:                                                                                                  #  C(LST2+6 ) = 2CADR  TASK4
048355,000388:                                                                                                  #  C(LST2+8 ) = 2CADR  TASK5
048356,000389:                                                                                                  #  C(LST2+10) = 2CADR  TASK6
048357,000390: 

Page 1126

048359,000392:                                                                                                  #           ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
048360,000393: 
048361,000394: 01,3412           00006        T3RUPT             EXTEND                                         
048362,000395: 01,3413           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
048363,000396: 01,3414           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
048364,000397: 01,3415           00006                           EXTEND                                         
048365,000398: 01,3416           22012                           QXCH     QRUPT                                 
048366,000399: 
048367,000400: 01,3417           34725        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
048368,000401: 01,3420           57407                           XCH      LST1       +7                         
048369,000402: 01,3421           57406                           XCH      LST1       +6                         
048370,000403: 01,3422           57405                           XCH      LST1       +5                         
048371,000404: 01,3423           57404                           XCH      LST1       +4                         #  1.  MOVE UP LST1 CONTENTS, ENTERING
048372,000405: 01,3424           57403                           XCH      LST1       +3                         #      A VALUE OF 1/2 +1 AT THE BOTTOM
048373,000406: 01,3425           57402                           XCH      LST1       +2                         #      FOR T6-T5, CORRESPONDING TO THE
048374,000407: 01,3426           57401                           XCH      LST1       +1                         #      INTERVAL 81.91 SEC FOR ENDTASK.
048375,000408: 01,3427           57400                           XCH      LST1                                  
048376,000409: 01,3430           64724                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 -T USING LIST 1.
048377,000410: 01,3431           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
048378,000411: 01,3432           54332                           TS       RUPTAGN                               
048379,000412: 01,3433           44746                           CS       ZERO                                  
048380,000413: 01,3434           54332                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
048381,000414: 
048382,000415: 01,3435           00006                           EXTEND                                         #  DISPATCH TASK.
048383,000416: 01,3436           45241                           DCS      ENDTASK                               
048384,000417: 01,3437           53431                           DXCH     LST2       +16D                       
048385,000418: 01,3440           53427                           DXCH     LST2       +14D                       
048386,000419: 01,3441           53425                           DXCH     LST2       +12D                       
048387,000420: 01,3442           53423                           DXCH     LST2       +10D                       
048388,000421: 01,3443           53421                           DXCH     LST2       +8D                        
048389,000422: 01,3444           53417                           DXCH     LST2       +6                         
048390,000423: 01,3445           53415                           DXCH     LST2       +4                         
048391,000424: 01,3446           53413                           DXCH     LST2       +2                         
048392,000425: 01,3447           53411                           DXCH     LST2                                  
048393,000426: 
048394,000427: 01,3450           56001                           XCH      L                                     
048395,000428: 01,3451           00006                           EXTEND                                         
048396,000429: 01,3452           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
048397,000430: 01,3453           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
048398,000431: 01,3454           52006                           DTCB                                           
048399,000432: 

Page 1127

048401,000434:                                                                                                  #           RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
048402,000435: 
048403,000436:    5263                                           BLOCK    02                                    
048404,000437:    5263                                           COUNT*   $$/WAIT                               
048405,000438:    5263           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
048406,000439:    5264           35222                           CAF      WAITBB                                
048407,000440:    5265           54006                           TS       BBANK                                 
048408,000441:    5266           13417                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
048409,000442: 
048410,000443:    5267           30016                           CA       BANKRUPT                              
048411,000444:    5270           00006                           EXTEND                                         
048412,000445:    5271           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
048413,000446: 
048414,000447:    5272           00006        RESUME             EXTEND                                         
048415,000448:    5273           22012                           QXCH     QRUPT                                 
048416,000449:    5274           30016        NOQRSM             CA       BANKRUPT                              
048417,000450:    5275           56006                           XCH      BBANK                                 
048418,000451:    5276           52011        NOQBRSM            DXCH     ARUPT                                 
048419,000452:    5277           00003                           RELINT                                         
048420,000453:    5300           50017                           RESUME                                         
048421,000454: 

Page 1128

048423,000456:                                                                                                  #  LONGCALL
048424,000457: 
048425,000458:                                                                                                  #  PROGRAM DESCRIPTION                                  DATE- 17 MARCH 1967
048426,000459:                                                                                                  #  PROGRAM WRITTEN BY W.H. VANDEVER                    LOG SECTION WAITLIST
048427,000460:                                                                                                  #  MOD BY- R. MELANSON TO ADD DOCUMENTATION       ASSEMBLY SUNDISK REV. 100
048428,000461: 
048429,000462:                                                                                                  #  FUNCTIONAL DESCRIPTION-
048430,000463:                                                                                                  #  LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
048431,000464:                                                                                                  #  IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
048432,000465:                                                                                                  #  A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
048433,000466:                                                                                                  #  START
048434,000467: 
048435,000468:                                                                                                  #  CALLING SEQUENCE-
048436,000469:                                                                                                  #                                                   EXTEND
048437,000470:                                                                                                  #                                                   DCA    TIMELOC
048438,000471:                                                                                                  #                                                   TC     LONGCALL
048439,000472:                                                                                                  #                                                   2CADR  TASKTODO
048440,000473: 
048441,000474:                                                                                                  #  NORMAL EXIT MODE-
048442,000475:                                                                                                  #     1). TC    WAITLIST
048443,000476:                                                                                                  #     2). DTCB  (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
048444,000477:                                                                                                  #     3). DTCB  (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
048445,000478: 
048446,000479:                                                                                                  #  ALARM OR ABORT EXIT MODE-
048447,000480:                                                                                                  #     NONE
048448,000481: 
048449,000482:                                                                                                  #  OUTPUT-
048450,000483:                                                                                                  #     LONGTIME AND LONGTIME+1 = DELTA TIME
048451,000484:                                                                                                  #     LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
048452,000485:                                                                                                  #     LONGCADR AND LONGCADR+1 = TASK 2CADR
048453,000486:                                                                                                  #     A = SINGLE PRECISION TIME FOR WAITLIST
048454,000487: 
048455,000488:                                                                                                  #  ERASABLE INITIALIZATION-
048456,000489:                                                                                                  #     A = MOST SIGNIFICANT PART OF DELTA TIME
048457,000490:                                                                                                  #     L = LEAST SIGNIFICANT PART OF DELTA TIME
048458,000491:                                                                                                  #     Q = ADDRESS OF 2CADR TASK VALUE
048459,000492: 
048460,000493:                                                                                                  #  DEBRIS-
048461,000494:                                                                                                  #     A,Q,L
048462,000495:                                                                                                  #     LONGCADR AND LONGCADR+1
048463,000496:                                                                                                  #     LONGEXIT AND LONGEXIT+1
048464,000497:                                                                                                  #     LONGTIME AND LONGTIME+1
048465,000498: 
048466,000499:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
048467,000500: 
048468,000501:    5301                                           BLOCK    02                                    
048469,000502:    5301  E3,1400                                  EBANK=   LST1                                  
048470,000503:    5301           53153        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
048471,000504: 
048472,000505:    5302           00006                           EXTEND                                         #  OBTAIN THE 2CADR

Page 1129

048474,000507:    5303           50002                           NDX      Q                                     
048475,000508:    5304           30001                           DCA      0                                     
048476,000509:    5305           53147                           DXCH     LONGCADR                              
048477,000510: 
048478,000511:    5306           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
048479,000512:    5307           35312                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
048480,000513:    5310           52006                           DTCB                                           
048481,000514: 
048482,000515:    5311  E3,1400                                  EBANK=   LST1                                  
048483,000516:    5311           03455 02063  LGCL2CDR           2CADR    LNGCALL2                              
048484,000517: 
048485,000518:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
048486,000519: 
048487,000520: 01,3455                                           BANK     01                                    
048488,000521: 01,3455                                           COUNT*   $$/WAIT                               
048489,000522: 01,3455           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
048490,000523: 01,3456           34743                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
048491,000524: 01,3457           26002                           ADS      Q                                     
048492,000525: 01,3460           55434                           TS       LONGEXIT                              
048493,000526: 
048494,000527: 01,3461           31152                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
048495,000528: 01,3462           10000                           CCS      A                                     
048496,000529: 01,3463           13471                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
048497,000530: 01,3464           13466                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
048498,000531: 01,3465           13523                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
048499,000532: 01,3466           31153                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
048500,000533: 01,3467           00006                           EXTEND                                         
048501,000534: 01,3470           63523                           BZMF     LONGPOOH                              #  BAD DELTA-TIME.  ABORT
048502,000535: 
048503,000536:                                                                                                  #           *** WAITLIST TASK LONGCYCL ***
048504,000537: 01,3471           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
048505,000538: 01,3472           43503                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
048506,000539: 01,3473           21153                           DAS      LONGTIME                              
048507,000540: 
048508,000541: 01,3474           11153                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
048509,000542: 01,3475           13513                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
048510,000543:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
048511,000544:                                                                                                  #  BASIC INSTRUCTIONS
048512,000545:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
048513,000546:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
048514,000547:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
048515,000548: 01,3476           13477                           NOOP                                           #  CAN:T GET HERE    **********
048516,000549: 01,3477           13500                           TCF      +1                                    
048517,000550: 01,3500           11152                           CCS      LONGTIME                              
048518,000551: 01,3501           13513                           TCF      MUCHTIME                              
048519,000552: 01,3502           00000        DPBIT14            OCT      00000                                 
048520,000553: 01,3503           20000                           OCT      20000                                 
048521,000554:                                                                                                  #  LONGCALL
048522,000555: 

Page 1130

048524,000557: 01,3504           34727        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
048525,000558: 01,3505           27153                           ADS      LONGTIME   +1                         
048526,000559: 01,3506           05175                           TC       TWIDDLE                               
048527,000560: 01,3507  E3,1400                                  EBANK=   LST1                                  
048528,000561: 01,3507           03520                           ADRES    GETCADR                               
048529,000562: 01,3510           33522        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
048530,000563: 01,3511           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
048531,000564: 01,3512           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
048532,000565: 
048533,000566: 01,3513           34727        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
048534,000567: 01,3514           05205                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
048535,000568: 01,3515  E3,1400                                  EBANK=   LST1                                  
048536,000569: 01,3515           03471 02063                     2CADR    LONGCYCL                              
048537,000570: 
048538,000571: 
048539,000572: 01,3517           13510                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
048540,000573: 
048541,000574:                                                                                                  #           *** WAITLIST TASK GETCADR ***
048542,000575: 01,3520           53147        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
048543,000576: 01,3521           15167                           TCF      SUPDXCHZ                              #  AND TRANSFER CONTROL
048544,000577: 01,3522           05263        TSKOVCDR           GENADR   TASKOVER                              
048545,000578: 01,3523           53435        LONGPOOH           DXCH     LONGEXIT                              
048546,000579: 01,3524           13526                           TCF      +2                                    
048547,000580: 01,3525           52062        WAITPOOH           DXCH     WAITEXIT                              
048548,000581: 01,3526           05722                 +2        TC       POODOO1                               
048549,000582: 01,3527           21204                           OCT      21204                                 

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