Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

046901,000002:                                                                                                  ## Copyright:   Public domain.
046902,000003:                                                                                                  ## Filename:    WAITLIST.agc
046903,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
046904,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
046905,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
046906,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
046907,000008:                                                                                                  ##              that the code format has been changed to conform to the
046908,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
046909,000010:                                                                                                  ##              original YUL assembler.
046910,000011:                                                                                                  ## Reference:   pp. 1109-1124
046911,000012:                                                                                                  ## Assembler:   yaYUL
046912,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
046913,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046914,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
046915,000016:                                                                                                  ##              2017-01-28 RSB  WTIH -> WITH.
046916,000017:                                                                                                  ##              2017-02-09 RSB  Comment-text fixes identified in proofing Artemis 72
046917,000018:                                                                                                  ##              2017-02-27 RSB  Corrected WAITP00H and LONGP00H to similar POOH names.
046918,000019:                                                                                                  ##              2017-03-10 HG   Transcribed
046919,000020:                                                                                                  ##              2017-03-14 RSB  Proofed comment text via 3-way diff vs
046920,000021:                                                                                                  ##                              Luminary 99 and 131.
046921,000022:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
046922,000023:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
046923,000024:                                                                                                  ##              2017-03-19 HG   Fix value OCT 01204 -> OCT 21204
046924,000025: 

Page 1109

046926,000027:                                                                                                  #  PROGRAM DESCRIPTION                                                                     DATE - 10 OCTOBER 1966
046927,000028:                                                                                                  #  MOD NO - 2                                                                              LOG SECTION - WAITLIST
046928,000029:                                                                                                  #  MOD BY - MILLER   (DTMAX INCREASED TO 162.5 SEC)                                        ASSEMBLY SUNBURST REV 5
046929,000030:                                                                                                  #  MOD 3 BY KERNAN  (INHINT INSERTED AT WAITLIST) 2/28/68 SKIPPER REV 4
046930,000031: 
046931,000032:                                                                                                  #  MOD 4BY KERNAN (TWIDDLE IN 54)  3/28/68 SKIPPER REV 13.
046932,000033: 
046933,000034: 
046934,000035:                                                                                                  #  FUNCTIONAL DESCRIPTION -
046935,000036:                                                                                                  #          PART OF A SECTION OF PROGRAMS,-WAITLIST, TASKOVER, T3RUPT, USED  TO CALL A PROGRAM, (CALLED A TASK),
046936,000037:                                                                                                  #     WHICH IS TO BEGIN IN C(A) CENTISECONDS.  WAITLIST UPDATES TIME3, LST1 AND LST2. THE MEANING OF THESE LISTS
046937,000038:                                                                                                  #     FOLLOW.
046938,000039: 
046939,000040:                                                                                                  #                  C(TIME3)  = 16384 -(T1-T) CENTISECONDS, (T=PRESENT TIME, T1-TIME FOR TASK1)
046940,000041: 
046941,000042: 
046942,000043:                                                                                                  #                               C(LST1)    = -(T2-T1)+1
046943,000044:                                                                                                  #                               C(LST1 +1) = -(T3-T2)+1
046944,000045:                                                                                                  #                               C(LST1 +2) = -(T4-T3)+1
046945,000046:                                                                                                  #                                          .
046946,000047:                                                                                                  #                                          .
046947,000048:                                                                                                  #                               C(LST1 +6) = -(T8-T7)+1
046948,000049:                                                                                                  #                               C(LST1 +7) = -(T9-T8)+1
046949,000050: 
046950,000051:                                                                                                  #                               C(LST2)    = 2CADR OF TASK1
046951,000052:                                                                                                  #                               C(LST2 +2) = 2CADR OF TASK2
046952,000053:                                                                                                  #                                          .
046953,000054:                                                                                                  #                                          .
046954,000055:                                                                                                  #                               C(LST2 +14)= 2CADR OF TASK8
046955,000056:                                                                                                  #                               C(LST2 +16)= 2CADR OF TASK9
046956,000057: 
046957,000058:                                                                                                  #  WARNINGS -
046958,000059:                                                                                                  #  --------
046959,000060:                                                                                                  #               1) 1 <= C(A) <= 16250D (1 CENTISECOND TO 162.5 SEC)
046960,000061:                                                                                                  #               2) 9 TASKS MAXIMUM
046961,000062:                                                                                                  #               3) TASKS CALLED UNDER INTERRUPT INHIBITED
046962,000063:                                                                                                  #               4) TASKS END BY TC TASKOVER
046963,000064: 
046964,000065:                                                                                                  #  CALLING SEQUENCE -
046965,000066: 
046966,000067:                                                                                                  #               L-1    CA     DELTAT   (TIME IN CENTISECONDS TO TASK START)
046967,000068:                                                                                                  #               L      TC     WAITLIST
046968,000069:                                                                                                  #               L+1    2CADR  DESIRED TASK
046969,000070:                                                                                                  #               L+2    (MINOR OF 2CADR)
046970,000071:                                                                                                  #               L+3    RELINT          (RETURNS HERE)
046971,000072: 
046972,000073:                                                                                                  #  TWIDDLE -
046973,000074:                                                                                                  #  -------
046974,000075:                                                                                                  #               TWIDDLE IS FOR USE WHEN THE TASK BEING SET UP IS IN THE SAME EBANK AND FBANK AS THE USER.  IN
046975,000076:                                                                                                  #               SUCH CASES, IT IMPROVES UPON WAITLIST BY ELIMINATING THE NEED FOR THE BBCON HALF OF THE 2CADR,
046976,000077: 

Page 1110

046978,000079:                                                                                                  #               SAVING A WORD.   TWIDDLE IS LIKE WAITLIST IN EVERY RESPECT EXCEPT CALLING SEQUENCE, TO WIT-
046979,000080:                                                                                                  #               L-1    CA     DELTAT
046980,000081:                                                                                                  #               L      TC     TWIDDLE
046981,000082:                                                                                                  #               L+1    ADRES  DESIRED TASK
046982,000083:                                                                                                  #               L+2    RELINT               (RETURNS HERE)
046983,000084: 
046984,000085:                                                                                                  #  NORMAL EXIT MODES -
046985,000086: 
046986,000087:                                                                                                  #               AT L+3 OF CALLING SEQUENCE
046987,000088: 
046988,000089:                                                                                                  #  ALARM OR ABORT EXIT MODES -
046989,000090: 
046990,000091:                                                                                                  #               TC      ABORT
046991,000092:                                                                                                  #               OCT     1203  (WAITLIST OVERFLOW - TOO MANY TASKS)
046992,000093: 
046993,000094:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
046994,000095: 
046995,000096:                                                                                                  #               ACCOMPLISHED BY FRESH START,--LST2,..., LST2 +16 =ENDTASK
046996,000097:                                                                                                  #                                             LST1,..., LST1 +7  =NEG1/2
046997,000098: 
046998,000099:                                                                                                  #  OUTPUT--
046999,000100: 
047000,000101:                                                                                                  #               LST1 AND LST2 UPDATED WITH NEW TASK AND ASSOCIATED TIME.
047001,000102: 
047002,000103:                                                                                                  #  DEBRIS-
047003,000104: 
047004,000105:                                                                                                  #               CENTRALS- A,Q,L
047005,000106:                                                                                                  #               OTHER   - WAITEXIT, WAITADR, WAITTEMP, WAITBANK
047006,000107:                                                                                                  #  DETAILED ANALYSIS OF TIMING-
047007,000108: 
047008,000109:                                                                                                  #          CONTROL WILL NOT BE RETURNED TO THE SPECIFIED ADDRESS (2CADR)   IN EXACTLY DELTA T CENTISECONDS.
047009,000110:                                                                                                  #     THE APPROXIMATE TIME MAY BE CALCULATED AS FOLLOWS
047010,000111: 
047011,000112:                                                                                                  #               LET TO = THE TIME OF THE TC WAITLIST
047012,000113:                                                                                                  #               LET TS = TO +147U + COUNTER INCREMENTS (SET UP TIME)
047013,000114:                                                                                                  #               LET X  = TS -(100TS)/100  (VARIANCE FROM COUNTERS)
047014,000115:                                                                                                  #               LET Y  = LENGTH OF TIME OF INHIBIT INTERRUPT AFTER T3RUPT
047015,000116:                                                                                                  #               LET Z  = LENGTH OF TIME TO PROCESS TASKS WHICH ARE DUE THIS T3RUPT BUT DISPATCHED EARLIER.
047016,000117:                                                                                                  #     (Z=0, USUALLY)
047017,000118:                                                                                                  #               LET DELTD = THE ACTUAL TIME TAKEN TO GIVE CONTROL TO 2CADR
047018,000119:                                                                                                  #            THEN   DELTD = TS+DELTA T -X +Y +Z +1.05MS* +COUNTERS*
047019,000120:                                                                                                  #     *-THE TIME TAKEN BY WAITLIST ITSELF AND THE COUNTER TICKING DURING THIS WAITLIST TIME.
047020,000121: 
047021,000122: 
047022,000123:                                                                                                  #          IN SHORT, THE ACTUAL TIME TO RETURN CONTROL TO A 2CADR IS AUGMENTED BY THE TIME TO SET UP THE TASK:S
047023,000124:                                                                                                  #     INTERRUPT, ALL COUNTERS TICKING, THE T3RUPT PROCESSING TIME, THE WAITLIST PROCESSING TIME AND THE POSSIBILITY
047024,000125:                                                                                                  #     OF OTHER TASKS INHIBITING THE INTERRUPT.
047025,000126: 
047026,000127:    5173                                           BLOCK    02                                    
047027,000128: 

Page 1111

047029,000130:    5173  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
047030,000131: 
047031,000132:    5173                                           COUNT*   $$/WAIT                               
047032,000133:    5173           00004        TWIDDLE            INHINT                                         
047033,000134:    5174           54001                           TS       L                                     #  SAVE DELAY TIME IN L
047034,000135:    5175           34733                           CA       POSMAX                                
047035,000136:    5176           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
047036,000137:    5177           30006                           CA       BBANK                                 
047037,000138:    5200           00006                           EXTEND                                         
047038,000139:    5201           04007                           ROR      SUPERBNK                              
047039,000140:    5202           56001                           XCH      L                                     

Note: The above thre statements are marked in black ink with a right open brace to the left of the statements.

047041,000142: 
047042,000143:    5203           00004        WAITLIST           INHINT                                         
047043,000144:    5204           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
047044,000145:    5205           54061                           TS       WAITEXIT                              #  WAITEXIT.
047045,000146:    5206           00006                           EXTEND                                         
047046,000147:    5207           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
047047,000148:    5210           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
047048,000149:    5211           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
047049,000150:    5212           35220        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
047050,000151:    5213           56006                           XCH      BBANK                                 
047051,000152:    5214           13232                           TCF      WAIT2                                 
047052,000153: 
047053,000154:                                                                                                  #           RETURN TO CALLER AFTER TASK INSERTION:
047054,000155: 
047055,000156:    5215           52062        LVWTLIST           DXCH     WAITEXIT                              
047056,000157:    5216           64752                           AD       TWO                                   
047057,000158:    5217           52006                           DTCB                                           

Note: In the comment section of the above three statements a small drawing in black pen can be found made of two horizontal lines and a small circle. The lines are of similar length. The left line ends at the cicumference of the circle, the right line starts at the center of the circle similar to
                                   _ _
                                /    \
                    __________ /   ___\_________
                               \      /
                                \    /
                                  --

047068,000169:    5220  E3,1400                                  EBANK=   LST1                                  
047069,000170:    5220           02063        WAITBB             BBCON    WAIT2                                 
047070,000171: 
047071,000172:                                                                                                  #           RETURN TO CALLER +2 AFTER WAITING DT SPECIFIED AT CALLER +1.
047072,000173: 
047073,000174:    5221           50002        FIXDELAY           INDEX    Q                                     #  BOTH ROUTINES MUST BE CALLED UNDER
047074,000175:    5222           30000                           CAF      0                                     #  WAITLIST CONTROL AND TERMINATE THE TASK
047075,000176:    5223           24002                           INCR     Q                                     #  IN WHICH THEY WERE CALLED.
047076,000177: 
047077,000178:                                                                                                  #           RETURN TO CALLER +1 AFTER WAITING THE DT AS ARRIVING IN A.
047078,000179: 
047079,000180:    5224           56002        VARDELAY           XCH      Q                                     #  DT TO Q. TASK ADRES TO WAITADR.
047080,000181:    5225           54063                           TS       WAITADR                               
047081,000182:    5226           30006                           CA       BBANK                                 #  BBANK IS SAVED DURING DELAY.
047082,000183:    5227           00006                           EXTEND                                         
047083,000184:    5230           04007                           ROR      SUPERBNK                              #  ADD SBANK TO BBCON.
047084,000185:    5231           54001                           TS       L                                     
047085,000186:    5232           35235                           CAF      DELAYEX                               
047086,000187:    5233           54061                           TS       WAITEXIT                              #  GO TO TASKOVER AFTER TASK ENTRY.
047087,000188:    5234           15212                           TCF      DLY2                                  
047088,000189: 

Page 1112

047090,000191:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
047091,000192: 

Page 1113

047093,000194:                                                                                                  #  ENDTASK MUST BE ENTERED IN FIXED-FIXED SO IT IS DISTINGUISHABLE BY ITS ADRES ALONE.
047094,000195: 
047095,000196:    5236  E3,1400                                  EBANK=   LST1                                  
047096,000197:    5236           72537 73714  ENDTASK            -2CADR   SVCT3                                 
047097,000198: 
047098,000199:    5240           10076        SVCT3              CCS      FLAGWRD2                              #  DRIFT FLAG
047099,000200:    5241           15261                           TCF      TASKOVER                              
047100,000201:    5242           15261                           TCF      TASKOVER                              
047101,000202:    5243           15244                           TCF      +1                                    
047102,000203: 
047103,000204:    5244           11301        CKIMUSE            CCS      IMUCADR                               #  DON'T DO NBDONLY IF SOMEONE ELSE IS IN
047104,000205:    5245           15256                           TCF      SVCT3X                                #  IMUSTALL.
047105,000206:    5246           15251                           TCF      +3                                    
047106,000207:    5247           15256                           TCF      SVCT3X                                
047107,000208:    5250           15256                           TCF      SVCT3X                                
047108,000209: 
047109,000210:    5251           37726                 +3        CAF      PRIO35                                #  COMPENSATE FOR NBD COEFFICIENTS ONLY.
047110,000211:    5252           05072                           TC       NOVAC                                 #      ENABLE EVERY 81.93 SECONDS
047111,000212:    5253  E3,1460                                  EBANK=   NBDX                                  
047112,000213:    5253           03563 14063                     2CADR    NBDONLY                               
047113,000214:    5255           15261                           TCF      TASKOVER                              
047114,000215: 
047115,000216:    5256           05221        SVCT3X             TC       FIXDELAY                              #  DELAY MAX OF 2 TIMES FOR IMUZERO.
047116,000217:    5257           00764                           DEC      500        B-14                       
047117,000218:    5260           05240                           TC       SVCT3                                 #  CHECK DRIFT FLAG AGAIN.
047118,000219: 

Page 1114

047120,000221:                                                                                                  #           BEGIN TASK INSERTION.
047121,000222: 
047122,000223: 01,3232                                           BANK     01                                    
047123,000224: 01,3232                                           COUNT*   $$/WAIT                               
047124,000225: 01,3232           54062        WAIT2              TS       WAITBANK                              #  BBANK OF CALLING PROGRAM.
047125,000226: 01,3233           30002                           CA       Q                                     
047126,000227: 01,3234           00006                           EXTEND                                         
047127,000228: 01,3235           63524                           BZMF     WAITPOOH                              
047128,000229: 
047129,000230: 01,3236           40026                           CS       TIME3                                 
047130,000231: 01,3237           64744                           AD       BIT8                                  #  BIT 8 = OCT 200
047131,000232: 01,3240           10000                           CCS      A                                     #  TEST 200 - C(TIME3).  IF POSITIVE,
047132,000233:                                                                                                  #  IT MEANS THAT TIME3 OVERFLOW HAS OCCURRED PRIOR TO CS TIME3 AND THAT
047133,000234:                                                                                                  #  C(TIME3) = T - T1, INSTEAD OF 1.0 - (T1 - T).  THE FOLLOWING FOUR
047134,000235:                                                                                                  #  ORDERS SET C(A) = TD - T1 + 1 IN EITHER CASE.
047135,000236: 
047136,000237: 01,3241           66112                           AD       OCT40001                              #  OVERFLOW HAS OCCURRED.  SET C(A) =
047137,000238: 01,3242           40000                           CS       A                                     #  T - T1 + 1.0 - 201
047138,000239: 
047139,000240:                                                                                                  #  NORMAL CASE (C(A) NNZ) YIELDS SAME C(A):  -( -(1.0-(T1-T)) + 200) - 1
047140,000241: 
047141,000242: 01,3243           63371                           AD       OCT40201                              
047142,000243: 01,3244           60002                           AD       Q                                     #  RESULT = TD - T1 + 1.
047143,000244: 
047144,000245: 01,3245           10000                           CCS      A                                     #  TEST TD - T1 + 1
047145,000246: 
047146,000247: 01,3246           61400                           AD       LST1                                  #  IF TD - T1 POS, GO TO WTLST5 WITH
047147,000248: 01,3247           13311                           TCF      WTLST5                                #  C(A) = (TD - T1) + C(LST1) = TD-T2+1
047148,000249: 
047149,000250: 01,3250           13251                           NOOP                                           
047150,000251: 01,3251           40002                           CS       Q                                     
047151,000252: 
047152,000253:                                                                                                  #  NOTE THAT THIS PROGRAM SECTION IS NEVER ENTERED WHEN T-T1 G/E -1,
047153,000254:                                                                                                  #  SINCE TD-T1+1 = (TD-T) + (T-T1+1), AND DELTA T = TD-T G/E +1 .  (G/E
047154,000255:                                                                                                  #  SYMBOL MEANS GREATER THAN OR EQUAL TO).  THUS THERE NEED BE NO CON-
047155,000256:                                                                                                  #  CERN OVER A PREVIOUS OR IMMINENT OVERFLOW OF TIME3 HERE.
047156,000257: 
047157,000258: 01,3252           64736                           AD       POS1/2                                #  WHEN TD IS NEXT, FORM QUANTITY
047158,000259: 01,3253           64736                           AD       POS1/2                                #    1.0 - DELTA T = 1.0 - (TD - T)
047159,000260: 01,3254           56026                           XCH      TIME3                                 
047160,000261: 01,3255           64735                           AD       NEGMAX                                
047161,000262: 01,3256           60002                           AD       Q                                     #  1.0 - DELTAT T NOW COMPLETE.
047162,000263: 01,3257           00006                           EXTEND                                         #  ZERO INDEX Q.
047163,000264: 01,3260           22007                           QXCH     7                                     #  (ZQ)
047164,000265: 

Page 1115

047166,000267: 01,3261           57400        WTLST4             XCH      LST1                                  
047167,000268: 01,3262           57401                           XCH      LST1       +1                         
047168,000269: 01,3263           57402                           XCH      LST1       +2                         
047169,000270: 01,3264           57403                           XCH      LST1       +3                         
047170,000271: 01,3265           57404                           XCH      LST1       +4                         
047171,000272: 01,3266           57405                           XCH      LST1       +5                         
047172,000273: 01,3267           57406                           XCH      LST1       +6                         
047173,000274: 01,3270           57407                           XCH      LST1       +7                         
047174,000275: 
047175,000276: 01,3271           30063                           CA       WAITADR                               #  (MINOR PART OF TASK CADR HAS BEEN IN L.)
047176,000277: 01,3272           50002                           INDEX    Q                                     
047177,000278: 01,3273           13274                           TCF      +1                                    
047178,000279: 
047179,000280: 01,3274           53411                           DXCH     LST2                                  
047180,000281: 01,3275           53413                           DXCH     LST2       +2                         
047181,000282: 01,3276           53415                           DXCH     LST2       +4                         
047182,000283: 01,3277           53417                           DXCH     LST2       +6                         
047183,000284: 01,3300           53421                           DXCH     LST2       +8D                        
047184,000285: 01,3301           53423                           DXCH     LST2       +10D                       #  AT END, CHECK THAT C(LST2+10) IS STD
047185,000286: 01,3302           53425                           DXCH     LST2       +12D                       
047186,000287: 01,3303           53427                           DXCH     LST2       +14D                       
047187,000288: 01,3304           53431                           DXCH     LST2       +16D                       
047188,000289: 01,3305           65236                           AD       ENDTASK                               #    END ITEM, AS CHECK FOR EXCEEDING
047189,000290:                                                                                                  #    THE LENGTH OF THE LIST.
047190,000291: 01,3306           00006                           EXTEND                                         #  DUMMY TASK ADRES SHOULD BE IN FIXED-
047191,000292: 01,3307           15215                           BZF      LVWTLIST                              #  FIXED SO ITS ADRES ALONE DISTINGUISHES
047192,000293: 01,3310           13364                           TCF      WTABORT                               #  IT.
047193,000294: 

Page 1116

047195,000296: 01,3311           10000        WTLST5             CCS      A                                     #  TEST   TD - T2 + 1
047196,000297: 01,3312           61401                           AD       LST1       +1                         
047197,000298: 01,3313           13317                           TCF      +4                                    
047198,000299: 01,3314           64753                           AD       ONE                                   
047199,000300: 01,3315           03375                           TC       WTLST2                                
047200,000301: 01,3316           00001                           OCT      1                                     
047201,000302: 
047202,000303: 01,3317           10000                 +4        CCS      A                                     #  TEST   TD - T3 + 1
047203,000304: 01,3320           61402                           AD       LST1       +2                         
047204,000305: 01,3321           13325                           TCF      +4                                    
047205,000306: 01,3322           64753                           AD       ONE                                   
047206,000307: 01,3323           03375                           TC       WTLST2                                
047207,000308: 01,3324           00002                           OCT      2                                     
047208,000309: 
047209,000310: 01,3325           10000                 +4        CCS      A                                     #  TEST   TD - T4 + 1
047210,000311: 01,3326           61403                           AD       LST1       +3                         
047211,000312: 01,3327           13333                           TCF      +4                                    
047212,000313: 01,3330           64753                           AD       ONE                                   
047213,000314: 01,3331           03375                           TC       WTLST2                                
047214,000315: 01,3332           00003                           OCT      3                                     
047215,000316: 
047216,000317: 01,3333           10000                 +4        CCS      A                                     #  TEST   TD - T5 + 1
047217,000318: 01,3334           61404                           AD       LST1       +4                         
047218,000319: 01,3335           13341                           TCF      +4                                    
047219,000320: 01,3336           64753                           AD       ONE                                   
047220,000321: 01,3337           03375                           TC       WTLST2                                
047221,000322: 01,3340           00004                           OCT      4                                     
047222,000323: 
047223,000324: 01,3341           10000                 +4        CCS      A                                     #  TEST   TD - T6 + 1
047224,000325: 01,3342           61405                           AD       LST1       +5                         
047225,000326: 01,3343           13347                           TCF      +4                                    
047226,000327: 01,3344           64753                           AD       ONE                                   
047227,000328: 01,3345           03375                           TC       WTLST2                                
047228,000329: 01,3346           00005                           OCT      5                                     
047229,000330: 
047230,000331: 01,3347           10000                 +4        CCS      A                                     #  TEST   TD - T7 + 1
047231,000332: 01,3350           61406                           AD       LST1       +6                         
047232,000333: 01,3351           13355                           TCF      +4                                    
047233,000334: 01,3352           64753                           AD       ONE                                   
047234,000335: 01,3353           03375                           TC       WTLST2                                
047235,000336: 01,3354           00006                           OCT      6                                     
047236,000337: 

Page 1117

047238,000339: 01,3355           10000                 +4        CCS      A                                     
047239,000340: 01,3356           61407                           AD       LST1       +7                         
047240,000341: 01,3357           13363                           TCF      +4                                    
047241,000342: 01,3360           64753                           AD       ONE                                   
047242,000343: 01,3361           03375                           TC       WTLST2                                
047243,000344: 01,3362           00007                           OCT      7                                     
047244,000345: 
047245,000346: 01,3363           10000                 +4        CCS      A                                     
047246,000347: 01,3364           03372        WTABORT            TC       FILLED                                
047247,000348: 01,3365           13366                           NOOP                                           #  CAN'T GET HERE
047248,000349: 01,3366           64753                           AD       ONE                                   
047249,000350: 01,3367           03375                           TC       WTLST2                                
047250,000351: 01,3370           00010                           OCT      10                                    
047251,000352: 
047252,000353: 01,3371           40201        OCT40201           OCT      40201                                 
047253,000354: 

Page 1118

047255,000356: 01,3372           52062        FILLED             DXCH     WAITEXIT                              
047256,000357: 01,3373           05706                           TC       BAILOUT1                              #  NO ROOM IN THE INN
047257,000358: 01,3374           31203                           OCT      31203                                 
047258,000359: 

Page 1119

047260,000361:                                                                                                  #  THE ENTRY TO WTLST2 JUST PRECEDING OCT  N  IS FOR T  LE TD LE T   -1.
047261,000362:                                                                                                  #                                                     N           N+1
047262,000363: 
047263,000364:                                                                                                  #  (LE MEANS LESS THAN OR EQUAL TO).  AT ENTRY, C(A) = -(TD - T   + 1)
047264,000365:                                                                                                  #                                                              N+1
047265,000366: 
047266,000367:                                                                                                  #  THE LST1 ENTRY -(T   - T +1) IS TO BE REPLACED BY -(TD - T  + 1), AND
047267,000368:                                                                                                  #                    N+1   N                                 N
047268,000369: 
047269,000370:                                                                                                  #  THE ENTRY -(T   - TD + 1) IS TO BE INSERTED IMMEDIATELY FOLLOWING.
047270,000371:                                                                                                  #               N+1
047271,000372: 
047272,000373: 01,3375           54064        WTLST2             TS       WAITTEMP                              #      C(A) = -(TD - T   + 1)
047273,000374: 01,3376           50002                           INDEX    Q                                     
047274,000375: 01,3377           30000                           CAF      0                                     
047275,000376: 01,3400           54002                           TS       Q                                     #  INDEX VALUE INTO Q.
047276,000377: 
047277,000378: 01,3401           34753                           CAF      ONE                                   
047278,000379: 01,3402           60064                           AD       WAITTEMP                              
047279,000380: 01,3403           50002                           INDEX    Q                                     #  C(A) = -(TD - T ) + 1.
047280,000381: 01,3404           27377                           ADS      LST1       -1                         #                 N
047281,000382: 
047282,000383: 01,3405           40064                           CS       WAITTEMP                              
047283,000384: 01,3406           50002                           INDEX    Q                                     
047284,000385: 01,3407           13261                           TCF      WTLST4                                
047285,000386: 
047286,000387:                                                                                                  #  C(TIME3) = 1.0 - (T1 - T)
047287,000388: 
047288,000389:                                                                                                  #  C(LST1  ) = - (T2 - T1) + 1
047289,000390:                                                                                                  #  C(LST1+1) = - (T3 - T2) + 1
047290,000391:                                                                                                  #  C(LST1+2) = - (T4 - T3) + 1
047291,000392:                                                                                                  #  C(LST1+3) = - (T5 - T4) + 1
047292,000393:                                                                                                  #  C(LST1+4) = - (T6 - T5) + 1
047293,000394: 
047294,000395:                                                                                                  #  C(LST2   ) = 2CADR TASK1
047295,000396:                                                                                                  #  C(LST2+2 ) = 2CADR TASK2
047296,000397:                                                                                                  #  C(LST2+4 ) = 2CADR TASK3
047297,000398:                                                                                                  #  C(LST2+6 ) = 2CADR TASK4
047298,000399:                                                                                                  #  C(LST2+8 ) = 2CADR TASK5
047299,000400:                                                                                                  #  C(LST2+10) = 2CADR TASK6
047300,000401: 

Page 1120

047302,000403:                                                                                                  #           ENTERS HERE ON T3 RUPT TO DISPATCH WAITLISTED TASK.
047303,000404: 
047304,000405: 01,3410           00006        T3RUPT             EXTEND                                         
047305,000406: 01,3411           04007                           ROR      SUPERBNK                              #  READ CURRENT SUPERBANK VALUE AND
047306,000407: 01,3412           54016                           TS       BANKRUPT                              #  SAVE WITH E AND F BANK VALUES.
047307,000408: 01,3413           00006                           EXTEND                                         
047308,000409: 01,3414           22012                           QXCH     QRUPT                                 
047309,000410: 
047310,000411: 01,3415           34734        T3RUPT2            CAF      NEG1/2                                #  DISPATCH WAITLIST TASK.
047311,000412: 01,3416           57407                           XCH      LST1       +7                         
047312,000413: 01,3417           57406                           XCH      LST1       +6                         
047313,000414: 01,3420           57405                           XCH      LST1       +5                         
047314,000415: 01,3421           57404                           XCH      LST1       +4                         #  1.  MOVE UP LST1 CONTENTS, ENTERING
047315,000416: 01,3422           57403                           XCH      LST1       +3                         #      A VALUE OF 1/2 +1 AT THE BOTTOM
047316,000417: 01,3423           57402                           XCH      LST1       +2                         #      FOR T6-T5, CORRESPONDING TO THE
047317,000418: 01,3424           57401                           XCH      LST1       +1                         #      INTERVAL 81.91 SEC FOR ENDTASK.
047318,000419: 01,3425           57400                           XCH      LST1                                  
047319,000420: 01,3426           64733                           AD       POSMAX                                #  2. SET T3 = 1.0 - T2 -T USING LIST 1.
047320,000421: 01,3427           26026                           ADS      TIME3                                 #  SO T3 WONT TICK DURING UPDATE.
047321,000422: 01,3430           54332                           TS       RUPTAGN                               
047322,000423: 01,3431           44755                           CS       ZERO                                  
047323,000424: 01,3432           54332                           TS       RUPTAGN                               #  SETS RUPTAGN TO +1 ON OVERFLOW.
047324,000425: 
047325,000426: 01,3433           00006                           EXTEND                                         #  DISPATCH TASK.
047326,000427: 01,3434           45237                           DCS      ENDTASK                               
047327,000428: 01,3435           53431                           DXCH     LST2       +16D                       
047328,000429: 01,3436           53427                           DXCH     LST2       +14D                       
047329,000430: 01,3437           53425                           DXCH     LST2       +12D                       
047330,000431: 01,3440           53423                           DXCH     LST2       +10D                       
047331,000432: 01,3441           53421                           DXCH     LST2       +8D                        
047332,000433: 01,3442           53417                           DXCH     LST2       +6                         
047333,000434: 01,3443           53415                           DXCH     LST2       +4                         
047334,000435: 01,3444           53413                           DXCH     LST2       +2                         
047335,000436: 01,3445           53411                           DXCH     LST2                                  
047336,000437: 
047337,000438: 01,3446           56001                           XCH      L                                     
047338,000439: 01,3447           00006                           EXTEND                                         
047339,000440: 01,3450           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FROM BBCON OF 2CADR
047340,000441: 01,3451           56001                           XCH      L                                     #  RESTORE TO L FOR DXCH Z.
047341,000442: 01,3452           52006                           DTCB                                           
047342,000443: 

Page 1121

047344,000445:                                                                                                  #           RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
047345,000446: 
047346,000447:    5261                                           BLOCK    02                                    
047347,000448:    5261                                           COUNT*   $$/WAIT                               
047348,000449:    5261           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
047349,000450:    5262           35220                           CAF      WAITBB                                
047350,000451:    5263           54006                           TS       BBANK                                 
047351,000452:    5264           13415                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
047352,000453: 
047353,000454:    5265           30016                           CA       BANKRUPT                              
047354,000455:    5266           00006                           EXTEND                                         
047355,000456:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
047356,000457: 
047357,000458:    5270           00006        RESUME             EXTEND                                         
047358,000459:    5271           22012                           QXCH     QRUPT                                 
047359,000460:    5272           30016        NOQRSM             CA       BANKRUPT                              
047360,000461:    5273           56006                           XCH      BBANK                                 
047361,000462:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
047362,000463:    5275           00003                           RELINT                                         
047363,000464:    5276           50017                           RESUME                                         
047364,000465: 

Page 1122

047366,000467:                                                                                                  #  LONGCALL
047367,000468: 
047368,000469:                                                                                                  #  PROGRAM DESCRIPTION                                  DATE- 17 MARCH 1967
047369,000470:                                                                                                  #  PROGRAM WRITTEN BY W.H. VANDEVER                    LOG SECTION WAITLIST
047370,000471:                                                                                                  #  MOD BY- R. MELANSON TO ADD DOCUMENTATION       ASSEMBLY SUNDISK REV. 100
047371,000472: 
047372,000473:                                                                                                  #  FUNCTIONAL DESCRIPTION-
047373,000474:                                                                                                  #  LONGCALL IS CALLED WITH THE DELTA TIME ARRIVING IN A,L SCALED AS TIME2,TIME1 WITH THE 2CADR OF THE TASK
047374,000475:                                                                                                  #  IMMEDIATELY FOLLOWING THE TC LONGCALL.  FOR EXAMPLE, IT MIGHT BE DONE AS FOLLOWS WHERE TIMELOC IS THE NAME OF
047375,000476:                                                                                                  #  A DP REGISTER CONTAINING A DELTA TIME AND WHERE TASKTODO IS THE NAME OF THE LOCATION AT WHICH LONGCALL IS TO
047376,000477:                                                                                                  #  START
047377,000478: 
047378,000479:                                                                                                  #  CALLING SEQUENCE-
047379,000480:                                                                                                  #                                                   EXTEND
047380,000481:                                                                                                  #                                                   DCA    TIMELOC
047381,000482:                                                                                                  #                                                   TC     LONGCALL
047382,000483:                                                                                                  #                                                   2CADR  TASKTODO
047383,000484: 
047384,000485:                                                                                                  #  NORMAL EXIT MODE-
047385,000486:                                                                                                  #     1). TC    WAITLIST
047386,000487:                                                                                                  #     2). DTCB  (TO L+3 OF CALLING ROUTINE 1ST PASS THRU LONGCYCL)
047387,000488:                                                                                                  #     3). DTCB  (TO TASKOVER ON SUBSEQUENT PASSES THRU LONGCYCL)
047388,000489: 
047389,000490:                                                                                                  #  ALARM OR ABORT EXIT MODE-
047390,000491:                                                                                                  #     NONE
047391,000492: 
047392,000493:                                                                                                  #  OUTPUT-
047393,000494:                                                                                                  #     LONGTIME AND LONGTIME+1 = DELTA TIME
047394,000495:                                                                                                  #     LONGEXIT AND LONGEXIT+1 = RETURN 2CADR
047395,000496:                                                                                                  #     LONGCADR AND LONGCADR+1 = TASK 2CADR
047396,000497:                                                                                                  #     A = SINGLE PRECISION TIME FOR WAITLIST
047397,000498: 
047398,000499:                                                                                                  #  ERASABLE INITIALIZATION-
047399,000500:                                                                                                  #     A = MOST SIGNIFICANT PART OF DELTA TIME
047400,000501:                                                                                                  #     L = LEAST SIGNIFICANT PART OF DELTA TIME
047401,000502:                                                                                                  #     Q = ADDRESS OF 2CADR TASK VALUE
047402,000503: 
047403,000504:                                                                                                  #  DEBRIS-
047404,000505:                                                                                                  #     A,Q,L
047405,000506:                                                                                                  #     LONGCADR AND LONGCADR+1
047406,000507:                                                                                                  #     LONGEXIT AND LONGEXIT+1
047407,000508:                                                                                                  #     LONGTIME AND LONGTIME+1
047408,000509: 
047409,000510:                                                                                                  #  *** THE FOLLOWING IS TO BE IN FIXED-FIXED AND UNSWITCHED ERRASIBLE ***
047410,000511: 
047411,000512:    5277                                           BLOCK    02                                    
047412,000513:    5277  E3,1400                                  EBANK=   LST1                                  
047413,000514:    5277           53153        LONGCALL           DXCH     LONGTIME                              #  OBTAIN THE DELTA TIME
047414,000515: 
047415,000516:    5300           00006                           EXTEND                                         #  OBTAIN THE 2CADR
047416,000517: 

Page 1123

047418,000519:    5301           50002                           NDX      Q                                     
047419,000520:    5302           30001                           DCA      0                                     
047420,000521:    5303           53147                           DXCH     LONGCADR                              
047421,000522: 
047422,000523:    5304           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
047423,000524:    5305           35310                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
047424,000525:    5306           52006                           DTCB                                           
047425,000526: 
047426,000527:    5307  E3,1400                                  EBANK=   LST1                                  
047427,000528:    5307           03453 02063  LGCL2CDR           2CADR    LNGCALL2                              
047428,000529: 
047429,000530:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
047430,000531: 
047431,000532: 01,3453                                           BANK     01                                    
047432,000533: 01,3453                                           COUNT*   $$/WAIT                               
047433,000534: 01,3453           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
047434,000535: 01,3454           34752                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
047435,000536: 01,3455           26002                           ADS      Q                                     
047436,000537: 01,3456           55434                           TS       LONGEXIT                              
047437,000538: 
047438,000539: 01,3457           31152                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
047439,000540: 01,3460           10000                           CCS      A                                     
047440,000541: 01,3461           13467                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
047441,000542: 01,3462           13464                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
047442,000543: 01,3463           13522                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
047443,000544: 01,3464           31153                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
047444,000545: 01,3465           00006                           EXTEND                                         
047445,000546: 01,3466           63522                           BZMF     LONGPOOH                              #  BAD DELTA-TIME.  ABORT

Note: The above statement (opcode to the end of operand) is undelined with red ink The generated address (01,3466) and the generated octal code (6 3522) including parity (1) are circled in red (single "circle")

047448,000549: 
047449,000550:                                                                                                  #           *** WAITLIST TASK LONGCYCL ***
047450,000551: 01,3467           00006        LONGCYCL           EXTEND                                         #  CAN WE SUCCESFULLY TAKE ABOUT 1.25
047451,000552: 01,3470           43501                           DCS      DPBIT14                               #  MINUTES OFF OF LONGTIME
047452,000553: 01,3471           21153                           DAS      LONGTIME                              
047453,000554: 
047454,000555: 01,3472           11153                           CCS      LONGTIME   +1                         #  THE REASONIBG BEHIND THIS PART IS
047455,000556: 01,3473           13512                           TCF      MUCHTIME                              #  INVOLVED, TAKING INTO ACCOUNT THAT THE
047456,000557:                                                                                                  #  WORDS MAY NOT BE SIGNED CORRECTED (DP
047457,000558:                                                                                                  #  BASIC INSTRUCTIONS
047458,000559:                                                                                                  #  DO NOT SIGN CORRECT) AND THAT WE SUBTRAC
047459,000560:                                                                                                  #  TED BIT14 (1 OVER HALF THE POS. VALUE
047460,000561:                                                                                                  #  REPRESENTIBLE IN SINGLE WORD)
047461,000562: 01,3474           13475                           NOOP                                           #  CAN:T GET HERE    **********
047462,000563: 01,3475           13476                           TCF      +1                                    
047463,000564: 01,3476           11152                           CCS      LONGTIME                              
047464,000565: 01,3477           13512                           TCF      MUCHTIME                              
047465,000566: 01,3500           00000        DPBIT14            OCT      00000                                 
047466,000567: 01,3501           20000                           OCT      20000                                 
047467,000568: 
047468,000569:                                                                                                  #  LONGCALL
047469,000570: 

Page 1124

047471,000572: 01,3502           34736        LASTTIME           CA       BIT14                                 #  GET BACK THE CORRECT DELTA TFOR WAITLIST
047472,000573: 01,3503           27153                           ADS      LONGTIME   +1                         
047473,000574: 01,3504           05203                           TC       WAITLIST                              
047474,000575: 01,3505  E3,1400                                  EBANK=   LST1                                  
047475,000576: 01,3505           03517 02063                     2CADR    GETCADR                               #  THE ENTRY TO OUR LONGCADR
047476,000577: 
047477,000578: 01,3507           33521        LONGRTRN           CA       TSKOVCDR                              #  SET IT UP SO THAT ONLY THE FIRST EXIT IS
047478,000579: 01,3510           53435                           DXCH     LONGEXIT                              #  TO THE CALLER OF LONGCALL
047479,000580: 01,3511           52006                           DTCB                                           #  THE REST ARE TO TASKOVER
047480,000581: 
047481,000582: 01,3512           34736        MUCHTIME           CA       BIT14                                 #  WE HAVE OVER OUR ABOUT 1.25 MINUTES
047482,000583: 01,3513           05203                           TC       WAITLIST                              #  SO SET UP FOR ANOTHER CYCLE THROUGH HERE
047483,000584: 01,3514  E3,1400                                  EBANK=   LST1                                  
047484,000585: 01,3514           03467 02063                     2CADR    LONGCYCL                              
047485,000586: 
047486,000587: 01,3516           13507                           TCF      LONGRTRN                              #  NOW EXIT PROPERLY
047487,000588: 
047488,000589:                                                                                                  #           *** WAITLIST TASK  GETCADR ***
047489,000590: 01,3517           53147        GETCADR            DXCH     LONGCADR                              #  GET THE LONGCALL THAT WE WISHED TO START
047490,000591: 01,3520           52006                           DTCB                                           #  AND TRANSFER CONTROL TO IT
047491,000592: 
047492,000593: 01,3521           05261        TSKOVCDR           GENADR   TASKOVER                              
047493,000594: 01,3522           53435        LONGPOOH           DXCH     LONGEXIT                              
047494,000595: 01,3523           13525                           TCF      +2                                    
047495,000596: 01,3524           52062        WAITPOOH           DXCH     WAITEXIT                              
047496,000597: 01,3525           05716                 +2        TC       POODOO1                               
047497,000598: 01,3526           21204                           OCT      21204                                 

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