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.

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

Page 1109

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

Page 1110

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

Page 1111

047044,000130:    5173  E3,1400                                  EBANK=   LST1                                  #  TASK LISTS IN SWITCHED E BANK.
047045,000131: 
047046,000132:    5173                                           COUNT*   $$/WAIT                               
047047,000133:    5173           00004        TWIDDLE            INHINT                                         
047048,000134:    5174           54001                           TS       L                                     #  SAVE DELAY TIME IN L
047049,000135:    5175           34733                           CA       POSMAX                                
047050,000136:    5176           26002                           ADS      Q                                     #  CREATING OVERFLOW AND Q-1 IN Q
047051,000137:    5177           30006                           CA       BBANK                                 
047052,000138:    5200           00006                           EXTEND                                         
047053,000139:    5201           04007                           ROR      SUPERBNK                              
047054,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.

047056,000142: 
047057,000143:    5203           00004        WAITLIST           INHINT                                         
047058,000144:    5204           56002                           XCH      Q                                     #  SAVE DELTA T IN Q AND RETURN IN
047059,000145:    5205           54061                           TS       WAITEXIT                              #  WAITEXIT.
047060,000146:    5206           00006                           EXTEND                                         
047061,000147:    5207           50061                           INDEX    WAITEXIT                              #  IF TWIDDLING, THE TS SKIPS TO HERE
047062,000148:    5210           30001                           DCA      0                                     #  PICK UP 2CADR OF TASK.
047063,000149:    5211           54063                 -1        TS       WAITADR                               #  BBCON WILL REMAIN IN L
047064,000150:    5212           35220        DLY2               CAF      WAITBB                                #  ENTRY FROM FIXDELAY AND VARDELAY.
047065,000151:    5213           56006                           XCH      BBANK                                 
047066,000152:    5214           13232                           TCF      WAIT2                                 
047067,000153: 
047068,000154:                                                                                                  #           RETURN TO CALLER AFTER TASK INSERTION:
047069,000155: 
047070,000156:    5215           52062        LVWTLIST           DXCH     WAITEXIT                              
047071,000157:    5216           64752                           AD       TWO                                   
047072,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
                                   _ _
                                /    \
                    __________ /   ___\_________
                               \      /
                                \    /
                                  --

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

Page 1112

047105,000191:    5235           15257        DELAYEX            TCF      TASKOVER   -2                         #  RETURNS TO TASKOVER
047106,000192: 

Page 1113

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

Page 1114

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

Page 1115

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

Page 1116

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

Page 1117

047253,000339: 01,3355           10000                 +4        CCS      A                                     
047254,000340: 01,3356           61407                           AD       LST1       +7                         
047255,000341: 01,3357           13363                           TCF      +4                                    
047256,000342: 01,3360           64753                           AD       ONE                                   
047257,000343: 01,3361           03375                           TC       WTLST2                                
047258,000344: 01,3362           00007                           OCT      7                                     
047259,000345: 
047260,000346: 01,3363           10000                 +4        CCS      A                                     
047261,000347: 01,3364           03372        WTABORT            TC       FILLED                                
047262,000348: 01,3365           13366                           NOOP                                           #  CAN'T GET HERE
047263,000349: 01,3366           64753                           AD       ONE                                   
047264,000350: 01,3367           03375                           TC       WTLST2                                
047265,000351: 01,3370           00010                           OCT      10                                    
047266,000352: 
047267,000353: 01,3371           40201        OCT40201           OCT      40201                                 
047268,000354: 

Page 1118

047270,000356: 01,3372           52062        FILLED             DXCH     WAITEXIT                              
047271,000357: 01,3373           05706                           TC       BAILOUT1                              #  NO ROOM IN THE INN
047272,000358: 01,3374           31203                           OCT      31203                                 
047273,000359: 

Page 1119

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

Page 1120

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

Page 1121

047359,000445:                                                                                                  #           RETURN, AFTER EXECUTION OF T3 OVERFLOW TASK:
047360,000446: 
047361,000447:    5261                                           BLOCK    02                                    
047362,000448:    5261                                           COUNT*   $$/WAIT                               
047363,000449:    5261           10332        TASKOVER           CCS      RUPTAGN                               #  IF +1 RETURN TO T3RUPT, IF -0 RESUME.
047364,000450:    5262           35220                           CAF      WAITBB                                
047365,000451:    5263           54006                           TS       BBANK                                 
047366,000452:    5264           13415                           TCF      T3RUPT2                               #  DISPATCH NEXT TASK IF IT WAS DUE.
047367,000453: 
047368,000454:    5265           30016                           CA       BANKRUPT                              
047369,000455:    5266           00006                           EXTEND                                         
047370,000456:    5267           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK BEFORE RESUME IS DONE
047371,000457: 
047372,000458:    5270           00006        RESUME             EXTEND                                         
047373,000459:    5271           22012                           QXCH     QRUPT                                 
047374,000460:    5272           30016        NOQRSM             CA       BANKRUPT                              
047375,000461:    5273           56006                           XCH      BBANK                                 
047376,000462:    5274           52011        NOQBRSM            DXCH     ARUPT                                 
047377,000463:    5275           00003                           RELINT                                         
047378,000464:    5276           50017                           RESUME                                         
047379,000465: 

Page 1122

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

Page 1123

047433,000519:    5301           50002                           NDX      Q                                     
047434,000520:    5302           30001                           DCA      0                                     
047435,000521:    5303           53147                           DXCH     LONGCADR                              
047436,000522: 
047437,000523:    5304           00006                           EXTEND                                         #  NOW GO TO THE APPROPRIATE SWITCHED BANK
047438,000524:    5305           35310                           DCA      LGCL2CDR                              #  FOR THE REST OF LONGCALL
047439,000525:    5306           52006                           DTCB                                           
047440,000526: 
047441,000527:    5307  E3,1400                                  EBANK=   LST1                                  
047442,000528:    5307           03453 02063  LGCL2CDR           2CADR    LNGCALL2                              
047443,000529: 
047444,000530:                                                                                                  #  *** THE FOLLOWING MAY BE IN A SWITCHED BANK, INCLUDING ITS ERASABLE ***
047445,000531: 
047446,000532: 01,3453                                           BANK     01                                    
047447,000533: 01,3453                                           COUNT*   $$/WAIT                               
047448,000534: 01,3453           23435        LNGCALL2           LXCH     LONGEXIT   +1                         #  SAVE THE CORRECT BB FOR RETURN
047449,000535: 01,3454           34752                           CA       TWO                                   #  OBTAIN THE RETURN ADDRESS
047450,000536: 01,3455           26002                           ADS      Q                                     
047451,000537: 01,3456           55434                           TS       LONGEXIT                              
047452,000538: 
047453,000539: 01,3457           31152                           CA       LONGTIME                              #  CHECK FOR LEGITIMATE DELTA-TIME
047454,000540: 01,3460           10000                           CCS      A                                     
047455,000541: 01,3461           13467                           TCF      LONGCYCL                              #  HI-ORDER OK --> ALL IS OK.
047456,000542: 01,3462           13464                           TCF      +2                                    #  HI-ORDER ZERO --> CHECK LO-ORDER.
047457,000543: 01,3463           13522                           TCF      LONGPOOH                              #  HI-ORDER NEG. --> NEG. DT
047458,000544: 01,3464           31153                 +2        CA       LONGTIME   +1                         #  CHECK LO-ORDER FOR ZERO OR NEGATIVE.
047459,000545: 01,3465           00006                           EXTEND                                         
047460,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")

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

Page 1124

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

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