Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

050741,000002:                                                                                                  ## Copyright:   Public domain.
050742,000003:                                                                                                  ## Filename:    PHASE_TABLE_MAINTENANCE.agc
050743,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
050744,000005:                                                                                                  ##              as closely as possible with available information. Sundance
050745,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
050746,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
050747,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
050748,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
050749,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
050750,000011:                                                                                                  ##              or the Sundance GSOPs.
050751,000012:                                                                                                  ## Assembler:   yaYUL
050752,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
050753,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
050754,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
050755,000016: 
050756,000017: 
050757,000018: 
050758,000019:                                                                                                  #  SUBROUTINE TO UPDATE THE PROGRAM NUMBER DISPLAY ON THE DSKY.
050759,000020: 
050760,000021: 43,3724                                           COUNT*   $$/PHASE                              
050761,000022:    5361                                           BLOCK    02                                    
050762,000023:    4000                                           SETLOC   FFTAG1                                
050763,000024:    4000                                           BANK                                           
050764,000025: 
050765,000026:    5361           50002        NEWMODEX           INDEX    Q                                     #  UPDATE MODREG. ENTRY FOR MODE IN FIXED.
050766,000027:    5362           30000                           CAF      0                                     
050767,000028:    5363           24002                           INCR     Q                                     
050768,000029: 
050769,000030:    5364           57012        NEWMODEA           XCH      MODREG                                #  ENTRY FOR MODE IN A
050770,000031:    5365           40000                           COM                                            #  IF NO CHANGE IN MODE, RETURN IMMEDIATELY
050771,000032:    5366           61012                           AD       MODREG                                
050772,000033:    5367           00006                           EXTEND                                         
050773,000034:    5370           16716                           BZF      TCQ                                   
050774,000035: 
050775,000036:    5371           35374        MMDSPLAY           CAF      +3                                    #  DISPLAY MAJOR MODE.
050776,000037:    5372           22006        PREBJUMP           LXCH     BBANK                                 #  PUTS BBANK IN L
050777,000038:    5373           14677                           TCF      BANKJUMP                              #  PUTS Q INTO A
050778,000039:    5374           20100                           CADR     SETUPDSP                              
050779,000040: 
050780,000041:                                                                                                  #  RETURN TO CALLER +3 IF MODE = THAT AT CALLER +1. OTHERWISE RETURN TO CALLER +2.
050781,000042: 
050782,000043:    5375           50002        CHECKMM            INDEX    Q                                     
050783,000044:    5376           40000                           CS       0                                     
050784,000045:    5377           61012                           AD       MODREG                                
050785,000046:    5400           00006                           EXTEND                                         
050786,000047:    5401           16715                           BZF      Q+2                                   
050787,000048:    5402           16713                           TCF      Q+1                                   #  NO MATCH
050788,000049: 
050789,000050:    5403     6716               TCQ                =        Q+2        +1                         
050790,000051: 
050791,000052: 
050792,000053: 14,3734                                           BANK     14                                    
050793,000054: 10,2000                                           SETLOC   PHASETAB                              
050794,000055: 10,2000                                           BANK                                           
050795,000056: 
050796,000057: 10,2100                                           COUNT*   $$/PHASE                              
050797,000058: 10,2100           00004        SETUPDSP           INHINT                                         
050798,000059: 10,2101           52071                           DXCH     RUPTREG1                              #  SAVE CALLER-S RETURN 2CADR
050799,000060: 10,2102           34367                           CAF      PRIO30                                #    EITHER A TASK OR JOB CAN COME TO
050800,000061: 10,2103           05142                           TC       NOVAC                                 #    NEWMODE X
050801,000062: 10,2104     1012                                  EBANK=   MODREG                                
050802,000063: 10,2104           03636 60102                     2CADR    DSPMMJOB                              
050803,000064: 
050804,000065: 10,2106           52071                           DXCH     RUPTREG1                              
050805,000066: 10,2107           00003                           RELINT                                         
050806,000067: 10,2110           52006                           DXCH     Z                                     #  RETURN
050807,000068: 
050808,000069: 10,2111  40,3636               DSPMMJOB           EQUALS   DSPMMJB                               
050809,000070: 
050810,000071: 
050811,000072:    5403                                           BLOCK    02                                    
050812,000073:    4000                                           SETLOC   FFTAG1                                
050813,000074:    4000                                           BANK                                           
050814,000075: 
050815,000076:                                                                                                  #  PHASCHNG IS THE MAIN WAY OF MAKING PHASE CHANGES FOR RESTARTS.  THERE ARE THREE FORMS OF PHASCHNG, KNOWN AS TYPE
050816,000077:                                                                                                  #  A, TYPE B, AND TYPE C. THEY ARE ALL CALLED AS FOLLOWS, WHERE OCT XXXXX CONTAINS THE PHASE INFORMATION,
050817,000078:                                                                                                  #                TC      PHASCHNG
050818,000079:                                                                                                  #                OCT     XXXXX
050819,000080:                                                                                                  #  TYPE A IS CONCERNED WITH FIXED PHASE CHANGES, THAT IS, PHASE INFORMATION THAT IS STORED PERMANENTLY.  THESE
050820,000081:                                                                                                  #  OPTIONS ARE, WHERE G STANDS FOR A GROUP AND .X FOR THE PHASE,
050821,000082:                                                                                                  #        G.0             INACTIVE, WILLNOT PERMIT A GROUP G RESTART
050822,000083:                                                                                                  #        G.1             WILL CAUSE THE LAST DISPLAY TO BE REACTIVATED, USED MAINLY IN MANNED FLIGHTS
050823,000084:                                                                                                  #        G.EVEN          A DOUBLE TABLE RESTART, CAN CAUSE ANY COMBINATION OF TWO JOBS, TASKS, AND/OR
050824,000085:                                                                                                  #                        LONGCALL TO BE RESTARTED.
050825,000086:                                                                                                  #        G.ODD NOT .1    A SINGLE TABLE RESTART, CAN CAUSE EITHER A JOB, TASK, OR LONGCALL RESTART
050826,000087: 
050827,000088:                                                                                                  #  THIS INFORMATION IS PUT INTO THE OCTAL WORD AFTER TC PHASCHNG AS FOLLOWS
050828,000089:                                                                                                  #        TL0 00P PPP PPP GGG                                               ,
050829,000090:                                                                                                  #  WHERE EACH LETTER OR NUMBER STANDS FOR A BIT.  THE G:S STAND FOR THE GROUP, OCTAL 1-7, THE P:S FOR THE PHASE,
050830,000091:                                                                                                  #  OCTAL 0 - 127.  0:S MUST BE 0.              IF ONE WISHES TO HAVE THE TBASE OF GROUP G TO BE SET AT THIS TIME,
050831,000092:                                                                                                  #  T IS SET TO 1, OTHERWISE IT IS SET TO 0.  SIMIARLY IF ONE WISHES TO SET LONGBASE, THEN L IS SET TO 1, OTHERWISE
050832,000093:                                                                                                  #  IT IS SET TO 0.  SOME EXAMPLES,
050833,000094:                                                                                                  #                TC      PHASCHNG        THIS WILL CAUSE GROUP 3 TO BE SET TO 0,
050834,000095:                                                                                                  #                OCT     00003           MAKING GROUP 3 INACTIVE
050835,000096: 
050836,000097:                                                                                                  #                TC      PHASCHNG        IF A RESTART OCCURS THIS WOULD CAUSE
050837,000098:                                                                                                  #                OCT     00012           GROUP 2 TO RESTART THE LAST DISPLAY
050838,000099: 
050839,000100:                                                                                                  #                TC      PHASCHNG        THIS SETS THE TBASE OF GROUP 4 AND IN
050840,000101:                                                                                                  #                OCT     40064           CASE OF A RESTART WOULD START UP THE TWO
050841,000102:                                                                                                  #                                        THINGS LOCATED IN THE DOUBLE 4.6 RESTART
050842,000103:                                                                                                  #                                        LOCATION
050843,000104:                                                                                                  #                TC      PHASCHNG        THIS SETS LONGBASE AND UPON A RESTART
050844,000105:                                                                                                  #                OCT     20135           CAUSES 5.13 TO BE RESTARTED (SINCE
050845,000106:                                                                                                  #                                        LONGBASE WAS SET THIS SINGLE ENTRY
050846,000107:                                                                                                  #                                        SHOULD BE A LONGCALL)
050847,000108: 
050848,000109:                                                                                                  #                TC      PHASCHNG        SINCE BOTH TBASE4 AND LONGBASE ARE SET,
050849,000110:                                                                                                  #                OCT     60124           4.12 SHOULD CONTAIN BOTH A TASK AND A
050850,000111:                                                                                                  #                                        LONGCALL TO BE RESTARTED
050851,000112: 
050852,000113:                                                                                                  #  TYPE C PHASCHNG CONTAINS THE VARIABLE TYPE OF PHASCHNG INFORMATION. INSTEAD OF THE INFORMATION BEING IN A
050853,000114:                                                                                                  #  PERMANENT FORM, ONE STORES THE DESIRED RESTART INFORMATION IN A VARIABKE LOCATION. THE BITS ARE AS FOLLOWS,
050854,000115:                                                                                                  #        TL0 1AD XXX CJW GGG
050855,000116:                                                                                                  #  WHERE EACH LETTER OR NUMBER STANDS FOR A BIT.  THE G:S STAND FOR THE GROUP, OCTAL 1 - 7.  IF THE RESTART IS TO
050856,000117:                                                                                                  #  BE BY WAITLIST, W IS SET TO 1, IF IT IS A JOB, J IS SET TO 1, IF IT IS A LONGCALL, C IS SET TO 1.  ONLY ONE OF
050857,000118:                                                                                                  #  THESE THREE BITS MAY BE SET.  X:S ARE IGNORED  1 MUST BE 1, AND 0 MUST BE 0.  AGAIN T STANDS FOR THE TBASE,
050858,000119:                                                                                                  #  AND L FOR LONGBASE.  THE BITS A AND D ARE CONCERNED WITH THE VARIABLE INFORMATION. IF D IS SET TO 1, A PRIORITY
050859,000120:                                                                                                  #  OR DELTA TIME WILL BE READ FROM THE NEXT LOCATION AFTER THE OCTAL INFORMATION, IF THIS IS TO BE INDIRECT, THAT
050860,000121:                                                                                                  #  IS, THE NAME OF A LOCATION COMT+INING THE INFORMATION (DELTA TIME ONLY), THEN THIS IS GIVEN AS THE -GENADR OF
050861,000122:                                                                                                  #  THAT LOCATION WHICH CONTAINS THE DELTA TIME.  IF THE OLD PRIORITY OR DELTA TIME IS TO BE USED, THAT WHICH IS
050862,000123:                                                                                                  #  ALREADY IN THE VARIABLE STORAGE, THEN D IS SET TO 0. NEXT THE A BIT IS USED.  IF IT IS SET TO 0, THE ADDRESS
050863,000124:                                                                                                  #  THAT WOULD BE RESTARTED DURING A RESTART IS THE NEXT LOCATION AFTER  THE PHASE INFORMATION, THAT IS, EITHER
050864,000125:                                                                                                  #  (TC PHASCHNG) +2 OR +3, DEPENDING ON WHETHER D HAD BEEN SET OR NOT.  IF A IS SET TO 1, THEN THE ADDRESS THAT
050865,000126:                                                                                                  #  WOULD BE RESTARTED IS THE 2CADR THAT IS READ FROM THE NEXT TWO LOCATIONS.  EXAMPLES,
050866,000127:                                                                                                  #        AD      TC      PHASCHNG        THIS WOULD CAUSE LOCATION AD +3 TO BE
050867,000128:                                                                                                  #        AD+1    OCT     05023           RESTARTED BY GROUP THREE WITH A PRIORITY
050868,000129:                                                                                                  #        AD+2    OCT     23000           OF 23.  NOTE UPON RETURNING IT WOULD
050869,000130:                                                                                                  #        AD+3                            ALSO GO TO AD+3
050870,000131: 
050871,000132:                                                                                                  #        AD      TC      PHASCHNG        GROUP 1 WOULD CAUSE CAUSE CALLCALL TO
050872,000133:                                                                                                  #        AD+1    OCT     27441           BE STARTED AS A LONGCALL FROM THE TIME
050873,000134:                                                                                                  #        AD+2    -GENADR DELTIME         STORED IN LONGBASE (LONGBASE WAS SET) BY
050874,000135:                                                                                                  #        AD+3    2CADR   CALLCALL        A DELTA TIME STORED IN DELTIME.  THE
050875,000136:                                                                                                  #        AD+4                            BBCON OF THE 2CADR SHOULD CONTAIN THE E
050876,000137:                                                                                                  #        AD+5                            BANK OF DELTIME.  PHASCHNG RETURNS TO
050877,000138:                                                                                                  #                                        LOCATION AD+5
050878,000139: 
050879,000140:                                                                                                  #  NOTE THAT IF A VARIABLE PRIORITY IS GIVEN FOR A JOB, THE JOB WILL BE RESTARTED AS A NOVAC IF THE PRIORITY IS
050880,000141:                                                                                                  #  NEGATIVE, AS A FINDVAC IF THE PRIORITY IS POSITIVE.
050881,000142: 
050882,000143:                                                                                                  #  TYPE B PHASCHNG IS A COMBINATION OF VARIABLE AND FIXED PHASE CHANGES. IT WILL START UP A JOB AS INDICATED
050883,000144:                                                                                                  #  BELOW AND ALSO START UP ONE FIXED RESTART, THAT IS EITHER AN G.1 OR A G.ODD OR THE FIRST ENTRY OF G.EVEN
050884,000145:                                                                                                  #  DOUBLE ENTRY.  THE BIT INFORMATION IS AS FOLLOWS,
050885,000146:                                                                                                  #        TL1 DAP PPP PPP GGG
050886,000147:                                                                                                  #  WHERE EACH LETTER OR NUMBER STANDS FOR A BIT.  THE G:S STAND FOR THE GROUP, OCTAL 1 - 7. THE P:S FOR THE FIXED
050887,000148:                                                                                                  #  PHASE INFORMATION, OCTAL 0 - 127. 1 MUST BE 1.  AND AGAIN T STANDS FOR THE TBASE AND L FOR LONGBASE. D THIS
050888,000149:                                                                                                  #  TIME STANDS ONLY FOR PRIORITY SINCE THIS WILL BE CONSIDERED A JOB, AND IT MUST BE GIVEN DIRECTLY IF GIVEN.
050889,000150:                                                                                                  #  AGAIN A STANDS FOR THE ADDRESS OF THE LOCATION TO BE RESTARTED, 1 IF THE 2CADR IS GIVEN, OR 0 IF IT IS TO BE
050890,000151:                                                                                                  #  THE NEXT LOCATION.  (THE RETURN LOCATION OF PHASCHNG) EXAMPLES,
050891,000152:                                                                                                  #        AD      TC      PHASCHNG        TBASE IS SET AND A RESTART CAUSE GROUP 3
050892,000153:                                                                                                  #        AD+1    OCT     56043           TO START THE JOB AJOBAJOB WITH PRIORITY
050893,000154:                                                                                                  #        AD+2    OCT     31000           31 AND THE FIRST ENTRY OF 3.4SPOT (WE CAN
050894,000155:                                                                                                  #        AD+3    2CADR   AJOBAJOB        ASSUME IT IS A TASK SINCE WE SET TBASE3)
050895,000156:                                                                                                  #        AD+4                            UPON RETURN FROM PHASCHNG CONTROL WOULD
050896,000157:                                                                                                  #        AD+5                            GO TO AD+5
050897,000158: 
050898,000159:                                                                                                  #        AD      TC      PHASCHNG        UPON A RESTART THE LAST DISPLAY WOULD BE
050899,000160:                                                                                                  #        AD+1    OCT     10015           RESTARTED AND A JOB WITH THE PREVIOUSLY
050900,000161:                                                                                                  #        AD+2                            STORED PRIORITY WOULD BE BEGUN AT AD+2
050901,000162:                                                                                                  #                                        BY MEANS OF GROUP 5
050902,000163:                                                                                                  #  THE NOVAC-FINDVAC CHOICE FOR JOBS HOLDS HERE ALSO - NEGATIVE PRIORITY CAUSES A NOVAC CALL, POSITIVE A FINDVAC.
050903,000164: 
050904,000165:                                                                                                  #  SUMMARY OF BITS
050905,000166:                                                                                                  #        TYPE A          TL0 00P PPP PPP GGG
050906,000167:                                                                                                  #        TYPE B          TL1 DAP PPP PPP GGG
050907,000168:                                                                                                  #        TYPE C          TL0 1AD XXX CJW GGG
050908,000169: 
050909,000170:                                                                                                  #  2PHSCHNG IS USED WHEN ONE WISHES TO START UP A GROUP OR CHANGE A GROUP WHILE UNDER THE CONTROL OF A DIFFERENT
050910,000171:                                                                                                  #  GROUP. FOR EXAMPLE, CHANGE THE PHASE OF GROUP 3 WHILE THE PORTION OF THE PROGRAM IS UNDER GROUP 5. ALL 2PHSCHNG
050911,000172:                                                                                                  #  CALLS ARE MADE IN THE FOLLOWING MANNER,
050912,000173:                                                                                                  #                TC      2PHSCHNG
050913,000174:                                                                                                  #                OCT     XXXXX
050914,000175:                                                                                                  #                OCT     YYYYY
050915,000176:                                                                                                  #  WHERE OCT XXXXX MUST BE OF TYPE A AND OCT YYYYY MAY BE OF EITHER TYPE A OR TYPE B OR TYPEC.  THERE IS ONE
050916,000177:                                                                                                  #  DIFFERENCE --- NOTE- IF LONGBASE IS TO BE SET THIS INFORMATION IS GIVEN IN THE OCT YYYYY INFORMATION, IT WILL
050917,000178:                                                                                                  #  BE DISREGARDED IF GIVEN WITH THE OCT XXXXX INFORMATION.  A COUPLE OF EXAMPLES MAY HELP,
050918,000179:                                                                                                  #        AD      TC      2PHSCHNG        SET TBASE3 AND IF A RESTART OCCURS START
050919,000180:                                                                                                  #        AD+1    OCT     40083           THE TWO ENTRIES IN 3.8 TABLE LOCATION
050920,000181:                                                                                                  #        AD+2    OCT     05025           THIS IS OF TYPE C, SET THE JOB TO BE
050921,000182:                                                                                                  #        AD+3    OCT     18000           TO BE LOCATION AD+4, WITH A PRIORITY 18,
050922,000183:                                                                                                  #        AD+4                            FOR GROUP 5 PHASE INFORMATION
050923,000184: 
050924,000185:    5403                                           COUNT*   $$/PHASE                              
050925,000186:    5403           00004        2PHSCHNG           INHINT                                         #  THE ENTRY FOR A DOUBLE PHASE CHANGE
050926,000187:    5404           50002                           NDX      Q                                     
050927,000188:    5405           30000                           CA       0                                     
050928,000189:    5406           24002                           INCR     Q                                     
050929,000190:    5407           54072                           TS       TEMPP2                                
050930,000191: 
050931,000192:    5410           75032                           MASK     OCT7                                  
050932,000193:    5411           60000                           DOUBLE                                         
050933,000194:    5412           54071                           TS       TEMPG2                                
050934,000195: 
050935,000196:    5413           30072                           CA       TEMPP2                                
050936,000197:    5414           75100                           MASK     OCT17770                              #  NEED ONLY 1770, BUT WHY GET A NEW CONST.
050937,000198:    5415           00006                           EXTEND                                         
050938,000199:    5416           75013                           MP       BIT12                                 
050939,000200:    5417           56072                           XCH      TEMPP2                                
050940,000201: 
050941,000202:    5420           75010                           MASK     BIT15                                 
050942,000203:    5421           54066                           TS       TEMPSW2                               #  INDICATES WHETHER TO SET TBASE OR NOT
050943,000204: 
050944,000205:    5422           15426                           TCF      PHASCHNG   +3                         
050945,000206: 
050946,000207:    5423           00004        PHASCHNG           INHINT                                         
050947,000208:    5424           35026                           CA       ONE                                   #  INDICATESWE CAME FROM A PHASCHNG ENTRY
050948,000209:    5425           54066                           TS       TEMPSW2                               
050949,000210: 
050950,000211:    5426           50002                           NDX      Q                                     
050951,000212:    5427           30000                           CA       0                                     
050952,000213:    5430           24002                           INCR     Q                                     
050953,000214:    5431           54065                           TS       TEMPSW                                
050954,000215: 
050955,000216:    5432           00006                           EXTEND                                         
050956,000217:    5433           35436                           DCA      ADRPCHN2                              #  OFF TO SWITCHED BANK
050957,000218:    5434           52006                           DTCB                                           
050958,000219: 
050959,000220:    5435  E3,1400                                  EBANK=   LST1                                  
050960,000221:    5435           02111 20103  ADRPCHN2           2CADR    PHSCHNG2                              
050961,000222: 
050962,000223:    5437           22073        ONEORTWO           LXCH     TEMPBBCN                              
050963,000224:    5440           22006                           LXCH     BBANK                                 
050964,000225:    5441           22073                           LXCH     TEMPBBCN                              
050965,000226: 
050966,000227:    5442           75074                           MASK     OCT14000                              #  SEE WHAT KIND OF PHASE CHANGE IT IS
050967,000228:    5443           10000                           CCS      A                                     
050968,000229:    5444           15505                           TCF      CHECKB                                #  IT IS OF TYPE :B:
050969,000230: 
050970,000231:    5445           30062                           CA       TEMPP                                 
050971,000232:    5446           75020                           MASK     BIT7                                  
050972,000233:    5447           10000                           CCS      A                                     #  SHALL WE USE THE OLD PRIORITY
050973,000234:    5450           15472                           TCF      GETPRIO                               #  NO GET A NEW PRIORITY (OR DELTA T)
050974,000235: 
050975,000236:    5451           50061        OLDPRIO            NDX      TEMPG                                 #  USE THE OLD PRIORITY (OR DELTA T)
050976,000237:    5452           31053                           CA       PHSPRDT1   -2                         
050977,000238:    5453           54070                           TS       TEMPPR                                
050978,000239: 
050979,000240:    5454           30062        CON1               CA       TEMPP                                 #  SEE IF A 2CADR IS GIVEN
050980,000241:    5455           75017                           MASK     BIT8                                  
050981,000242:    5456           10000                           CCS      A                                     
050982,000243:    5457           15476                           TCF      GETNEWNM                              
050983,000244: 
050984,000245:    5460           30002                           CA       Q                                     
050985,000246:    5461           54063                           TS       TEMPNM                                
050986,000247:    5462           30006                           CA       BB                                    
050987,000248:    5463           00006                           EXTEND                                         #  PICK UP USERS SUPERBANK
050988,000249:    5464           04007                           ROR      SUPERBNK                              
050989,000250:    5465           54064                           TS       TEMPBB                                
050990,000251: 
050991,000252:    5466           35471        TOCON2             CA       CON2ADR                               #  BACK TO SWITCHED BANK
050992,000253:    5467           22073                           LXCH     TEMPBBCN                              
050993,000254:    5470           52006                           DTCB                                           
050994,000255: 
050995,000256:    5471           02177        CON2ADR            GENADR   CON2                                  
050996,000257: 
050997,000258:    5472           50002        GETPRIO            NDX      Q                                     #  DON:T CARE IF DIRECT OR INDIRECT
050998,000259:    5473           30000                           CA       0                                     #  LEAVE THAT DECISION TO RESTARTS
050999,000260:    5474           24002                           INCR     Q                                     #  OBTAIN RETURN ADDRESS
051000,000261:    5475           15453                           TCF      CON1       -1                         
051001,000262: 
051002,000263:    5476           00006        GETNEWNM           EXTEND                                         
051003,000264:    5477           50002                           INDEX    Q                                     
051004,000265:    5500           30001                           DCA      0                                     
051005,000266:    5501           52064                           DXCH     TEMPNM                                
051006,000267:    5502           35025                           CA       TWO                                   
051007,000268:    5503           26002                           ADS      Q                                     #  OBTAIN RETURN ADDRESS
051008,000269: 
051009,000270:    5504           15466                           TCF      TOCON2                                
051010,000271: 
051011,000272:    5505     5074               OCT14000           EQUALS   PRIO14                                
051012,000273:    5505     0061               TEMPG              EQUALS   ITEMP1                                
051013,000274:    5505     0062               TEMPP              EQUALS   ITEMP2                                
051014,000275:    5505     0063               TEMPNM             EQUALS   ITEMP3                                
051015,000276:    5505     0064               TEMPBB             EQUALS   ITEMP4                                
051016,000277:    5505     0065               TEMPSW             EQUALS   ITEMP5                                
051017,000278:    5505     0066               TEMPSW2            EQUALS   ITEMP6                                
051018,000279:    5505     0070               TEMPPR             EQUALS   RUPTREG1                              
051019,000280:    5505     0071               TEMPG2             EQUALS   RUPTREG2                              
051020,000281:    5505     0072               TEMPP2             EQUALS   RUPTREG3                              
051021,000282: 
051022,000283:    5505     0073               TEMPBBCN           EQUALS   RUPTREG4                              
051023,000284:    5505  0000006               BB                 EQUALS   BBANK                                 
051024,000285: 
051025,000286: 
051026,000287: 14,3734                                           BANK     14                                    
051027,000288: 10,2000                                           SETLOC   PHASETAB                              
051028,000289: 10,2000                                           BANK                                           
051029,000290: 
051030,000291: 10,2111  E3,1436                                  EBANK=   PHSNAME1                              
051031,000292: 10,2111                                           COUNT*   $$/PHASE                              
051032,000293: 10,2111           22073        PHSCHNG2           LXCH     TEMPBBCN                              
051033,000294: 10,2112           30065                           CA       TEMPSW                                
051034,000295: 10,2113           75032                           MASK     OCT7                                  
051035,000296: 10,2114           60000                           DOUBLE                                         
051036,000297: 10,2115           54061                           TS       TEMPG                                 
051037,000298: 
051038,000299: 10,2116           30065                           CA       TEMPSW                                
051039,000300: 10,2117           75100                           MASK     OCT17770                              
051040,000301: 10,2120           00006                           EXTEND                                         
051041,000302: 10,2121           75013                           MP       BIT12                                 
051042,000303: 10,2122           54062                           TS       TEMPP                                 
051043,000304: 
051044,000305: 10,2123           30065                           CA       TEMPSW                                
051045,000306: 10,2124           74105                           MASK     OCT60000                              
051046,000307: 10,2125           56065                           XCH      TEMPSW                                
051047,000308: 10,2126           75074                           MASK     OCT14000                              
051048,000309: 10,2127           10000                           CCS      A                                     
051049,000310: 10,2130           15437                           TCF      ONEORTWO                              
051050,000311: 
051051,000312: 10,2131           30062                           CA       TEMPP                                 #  START STORING THE PHASE INFORMATION
051052,000313: 10,2132           50061                           NDX      TEMPG                                 
051053,000314: 10,2133           54751                           TS       PHASE1     -2                         
051054,000315: 
051055,000316: 10,2134           10066        BELOW1             CCS      TEMPSW2                               #  IS IT A PHASCHNG OR A 2PHSCHNG
051056,000317: 10,2135           12151                           TCF      BELOW2                                #  IT:S A PHASCHNG
051057,000318: 
051058,000319: 10,2136           12137                           TCF      +1                                    #  IT:S A 2PHSCHNG
051059,000320: 10,2137           40072                           CS       TEMPP2                                
051060,000321: 10,2140           22072                           LXCH     TEMPP2                                
051061,000322: 10,2141           50071                           NDX      TEMPG2                                
051062,000323: 10,2142           52751                           DXCH     -PHASE1    -2                         
051063,000324: 
051064,000325: 10,2143           10066                           CCS      TEMPSW2                               
051065,000326: 10,2144           12145                           NOOP                                           #  CAN:T GET HERE
051066,000327: 10,2145           12151                           TCF      BELOW2                                
051067,000328: 
051068,000329: 10,2146           40025                           CS       TIME1                                 
051069,000330: 10,2147           50071                           NDX      TEMPG2                                
051070,000331: 10,2150           55052                           TS       TBASE1     -2                         
051071,000332: 
051072,000333: 10,2151           10065        BELOW2             CCS      TEMPSW                                #  SEE IF WE SHOULD SET TBASE OR LONGBASE
051073,000334: 10,2152           12165                           TCF      BELOW3                                #  SET LONGBASE ONLY
051074,000335: 10,2153           12170                           TCF      BELOW4                                #  SET NEITHER
051075,000336: 
051076,000337: 10,2154           40025                           CS       TIME1                                 #  SET TBASE TO BEGIN WITH
051077,000338: 10,2155           50061                           NDX      TEMPG                                 
051078,000339: 10,2156           55052                           TS       TBASE1     -2                         
051079,000340: 
051080,000341: 10,2157           30065                           CA       TEMPSW                                #  SHALL WE NOW SET LONGBASE
051081,000342: 10,2160           62163                           AD       BIT14COM                              
051082,000343: 10,2161           10000                           CCS      A                                     
051083,000344: 10,2162           12163                           NOOP                                           #  ***** CANT GET HERE *****
051084,000345: 10,2163           17777        BIT14COM           OCT      17777                                 #  ***** CANT GET HERE *****
051085,000346: 10,2164           12170                           TCF      BELOW4                                #  NO WE NEED ONLY SET TBASE
051086,000347: 
051087,000348: 10,2165           00006        BELOW3             EXTEND                                         #  SET LONGBASE
051088,000349: 10,2166           30025                           DCA      TIME2                                 
051089,000350: 10,2167           53163                           DXCH     LONGBASE                              
051090,000351: 
051091,000352: 10,2170           40062        BELOW4             CS       TEMPP                                 #  AND STORE THE FINAL PART OF THE PHASE
051092,000353: 10,2171           50061                           NDX      TEMPG                                 
051093,000354: 10,2172           54750                           TS       -PHASE1    -2                         
051094,000355: 
051095,000356: 10,2173           30002                           CA       Q                                     
051096,000357: 10,2174           22073                           LXCH     TEMPBBCN                              
051097,000358: 10,2175           00003                           RELINT                                         
051098,000359: 10,2176           52006                           DTCB                                           
051099,000360: 10,2177           22073        CON2               LXCH     TEMPBBCN                              
051100,000361: 
051101,000362: 10,2200           30062                           CA       TEMPP                                 
051102,000363: 10,2201           50061                           NDX      TEMPG                                 
051103,000364: 10,2202           54751                           TS       PHASE1     -2                         
051104,000365: 
051105,000366: 10,2203           30070                           CA       TEMPPR                                
051106,000367: 10,2204           50061                           NDX      TEMPG                                 
051107,000368: 10,2205           55053                           TS       PHSPRDT1   -2                         
051108,000369: 
051109,000370: 10,2206           00006                           EXTEND                                         
051110,000371: 10,2207           30064                           DCA      TEMPNM                                
051111,000372: 10,2210           50061                           NDX      TEMPG                                 
051112,000373: 10,2211           53435                           DXCH     PHSNAME1   -2                         
051113,000374: 
051114,000375: 10,2212           12134                           TCF      BELOW1                                
051115,000376: 
051116,000377: 
051117,000378:    5505                                           BLOCK    02                                    
051118,000379:    4000                                           SETLOC   FFTAG1                                
051119,000380:    4000                                           BANK                                           
051120,000381: 
051121,000382:    5505                                           COUNT*   $$/PHASE                              
051122,000383:    5505           75013        CHECKB             MASK     BIT12                                 #  SINCE THIS IS OF TYPE B, THIS BIT SHOULD
051123,000384:    5506           10000                           CCS      A                                     #   BE HERE IF WE ARE TO GET A NEW PRIORITY
051124,000385:    5507           15472                           TCF      GETPRIO                               #  IT IS, SO GET NEW PRIORITY
051125,000386: 
051126,000387:    5510           15451                           TCF      OLDPRIO                               #  IT ISN:T, USE THE OLD PRIORITY
051127,000388: 
051128,000389:                                                                                                  #  PROGRAM DESCRIPTION: NEWPHASE                                           DATE: 11 NOV 1966
051129,000390:                                                                                                  #  MOD: 1                                                                  ASSEMBLY: SUNBURST REV
051130,000391:                                                                                                  #  MOD BY: COPPS                                                           LOG SECTION: PHASE TABLE MAINTENANCE
051131,000392:                                                                                                  #  FUNCTIONAL DESCRIPTION:
051132,000393:                                                                                                  #                NEWPHASE IS THE QUICK WAY TO MAKE A NON VARIABLE PHASE CHANGE. IT INCLUDES THE OPTION OF SETTING
051133,000394:                                                                                                  #           TBASE OF THE GROUP. IF TBASE IS TO BE SET, -C(TIME1) IS STORED IN THE TBASE TABLE AS FOLLOWS:
051134,000395: 
051135,000396:                                                                                                  #                   (L-1) TBASE0
051136,000397:                                                                                                  #                   (L)   TBASE1 (IF GROUP=1)
051137,000398:                                                                                                  #                   (L+1)
051138,000399:                                                                                                  #                   (L+2) TBASE2 (IF GROUP=2)
051139,000400:                                                                                                  #                   -----
051140,000401:                                                                                                  #                   (L+6) TBASE4 (IF GROUP=4)
051141,000402:                                                                                                  #                   (L+7)
051142,000403:                                                                                                  #                   (L+8) TBASE5 (IF GROUP=5)
051143,000404: 
051144,000405:                                                                                                  #           IN ANY CASE, THE NEGATIVE OF THE PHASE, FOLLOWED (IN THE NEXT REGISTER)  BY THE PHASE, IF STORED IN THE
051145,000406:                                                                                                  #           PHASE TABLE AS FOLLOWS:
051146,000407: 
051147,000408:                                                                                                  #                   (L)   -PHASE1 (IF GROUP=1)
051148,000409:                                                                                                  #                   (L+1) PHASE1
051149,000410:                                                                                                  #                   (L+2) -PHASE2 (IF GROUP=2)
051150,000411:                                                                                                  #                   (L+3) PHASE2
051151,000412:                                                                                                  #                   -----
051152,000413:                                                                                                  #                   (L+7) PHASE 4
051153,000414:                                                                                                  #                   (L+8) -PHASE5 (IF GROUP=5)
051154,000415:                                                                                                  #                   (L+9) PHASE5
051155,000416: 
051156,000417:                                                                                                  #  CALLING SEQUENCE:
051157,000418:                                                                                                  #                EXAMPLE IS FOR PLACING A PHASE OF FIVE INTO GROUP THREE:
051158,000419: 
051159,000420:                                                                                                  #           1) IF TBASE IS NOT TO BE SET:
051160,000421:                                                                                                  #                                          L-1      CA     FIVE
051161,000422:                                                                                                  #                                          L        TC     NEWPHASE
051162,000423:                                                                                                  #                                          L+1      OCT    00003
051163,000424: 
051164,000425:                                                                                                  #           2) IF TBASE IS TO BE SET:
051165,000426:                                                                                                  #                                          L-1      CS     FIVE
051166,000427:                                                                                                  #                                          L        TC     NEWPHASE
051167,000428:                                                                                                  #                                          L+1      OCT    00003
051168,000429: 
051169,000430:                                                                                                  #  SUBROUTINES CALLED: NONE
051170,000431: 
051171,000432:                                                                                                  #  NORMAL EXIT MODE: AT L+2 OF CALLING SEQUENCE
051172,000433: 
051173,000434:                                                                                                  #  ALARM OR ABORT EXITS: NONE
051174,000435: 
051175,000436:                                                                                                  #  OUTPUT: PHASE TABLE AND TBASE TABLE UPDATED
051176,000437: 
051177,000438:                                                                                                  #  ERASABLE INITIALIZATION REQ,D: NONE
051178,000439: 
051179,000440:                                                                                                  #  DEBRIS: A,L,TEMPG
051180,000441: 
051181,000442:                                                                                                  #  ***WARNING*** THIS PROGRAM IS TO BE PLACED IN FIXED-FIXED AND UNSWITCHED ERASABLE.
051182,000443: 
051183,000444:    4000                                           SETLOC   FFTAG1                                
051184,000445:    4000                                           BANK                                           
051185,000446: 
051186,000447:    5511                                           COUNT*   $$/PHASE                              
051187,000448:    5511           00004        NEWPHASE           INHINT                                         
051188,000449: 
051189,000450:    5512           54001                           TS       L                                     #  SAVE FOR FURTHER USE
051190,000451: 
051191,000452:    5513           50002                           NDX      Q                                     #  OBTAIN THE GROUP NUMBER
051192,000453:    5514           30000                           CA       0                                     
051193,000454:    5515           24002                           INCR     Q                                     #  OBTAIN THE RETURN ADDRESS
051194,000455:    5516           60000                           DOUBLE                                         #  SAVE THE GROUP IN A FORM USED FOR
051195,000456:    5517           54061                           TS       TEMPG                                 #  INDEXING
051196,000457: 
051197,000458:    5520           10001                           CCS      L                                     #  SEE IF WE ARE TO SET TBASE
051198,000459:    5521           15530                           TCF      +7                                    #  NO, THE DELTA T WAS POSITIVE
051199,000460:    5522           15530                           TCF      +6                                    
051200,000461: 
051201,000462:    5523           24000        NUFAZ+10           INCR     A                                     #  SET TBASE AND STORE PHASE CORRECTLY
051202,000463:    5524           54001                           TS       L                                     
051203,000464: 
051204,000465:    5525           40025                           CS       TIME1                                 #  SET TBASE
051205,000466:    5526           50061                           NDX      TEMPG                                 
051206,000467:    5527           55052                           TS       TBASE1     -2                         
051207,000468: 
051208,000469:    5530           40001                           CS       L                                     #  NOW PUT THE PHASE IN THE RIGHT TABLE LOC
051209,000470:    5531           50061                           NDX      TEMPG                                 
051210,000471:    5532           52751                           DXCH     -PHASE1    -2                         
051211,000472: 
051212,000473:    5533           00003                           RELINT                                         
051213,000474:    5534           00002                           TC       Q                                     #  NOW RETURN TO CALLER

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