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.

027696,000002:                                                                                                  ## Copyright:   Public domain.
027697,000003:                                                                                                  ## Filename:    R30.agc
027698,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
027699,000005:                                                                                                  ##              as closely as possible with available information. Sundance
027700,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
027701,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
027702,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
027703,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
027704,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
027705,000011:                                                                                                  ##              or the Sundance GSOPs.
027706,000012:                                                                                                  ## Assembler:   yaYUL
027707,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027708,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027709,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
027710,000016:                                                                                                  ##              2021-05-30 ABS  TICKTIFF -> TICKTFF
027711,000017: 
027712,000018: 
027713,000019: 
027714,000020:                                                                                                  #  SUBROUTINE NAME:  V82CALL
027715,000021:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
027716,000022:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION:  R30
027717,000023:                                                                                                  #  MOD NO: 1     MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
027718,000024:                                                                                                  #  MOD NO: 2     MOD BY  ALONSO                  DATE: 11 DEC 67         VB82 PROGRAM REWRITTEN
027719,000025:                                                                                                  #  MOD NO: 3     MOD BY  ALONSO                  DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
027720,000026: 
027721,000027:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:   CALLED BY VERB 82 ENTER.  PRIORITY 10
027722,000028:                                                                                                  #  USED THROUGHOUT.              CALCULATE AND DISPLAY ORBITAL PARAMETERS
027723,000029: 
027724,000030:                                                                                                  #  1.    IF AVERAGE G IS OFF:
027725,000031:                                                                                                  #                FLASH DISPLAY V04N06.  R2 INDICATES WHICH SHIP'S STATE VECTOR IS
027726,000032:                                                                                                  #                        TO BE UPDATED.  INITIAL CHOICE IS THIS SHIP (R2=1).  ASTRONAUT
027727,000033:                                                                                                  #                        CAN CHANGE TO OTHER SHIP BY V22EXE, WHERE X NOT EQ 1.
027728,000034:                                                                                                  #                SELECTED STATE VECTOR UPDATED BY THISPREC (OTHPREC).
027729,000035:                                                                                                  #                CALLS SR30.1 (WHICH CALLS TFFCONMU + TFFRP/RA) TO CALCULATE
027730,000036:                                                                                                  #                        RPER (PERIGEE RADIUS), RAPO (APOGEE RADIUS), HPER (PERIGEE
027731,000037:                                                                                                  #                        HEIGHT ABOVE LAUNCH PAD OR LUNAR LANDING SITE), HAPO (APOGEE
027732,000038:                                                                                                  #                        HEIGHT AS ABOVE), TPER (TIME TO PERIGEE), TFF (TIME TO
027733,000039:                                                                                                  #                        INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
027734,000040:                                                                                                  #                FLASH MONITOR V16N44 (HAPO, HPER, TFF).  TFF IS -59M59S IF IT WAS
027735,000041:                                                                                                  #                        NOT COMPUTABLE, OTHERWISE IT INCREMENTS ONCE PER SECOND.
027736,000042:                                                                                                  #                        ASTRONAUT HAS OPTION TO MONITOR TPER BY KEYING IN N 32 E.
027737,000043:                                                                                                  #                        DISPLAY IS IN HMS, IS NEGATIVE (AS WAS TFF), AND INCREMENTS
027738,000044:                                                                                                  #                        ONCE PER SECOND ONLY IF TFF DISPLAY WAS -59M59S.
027739,000045:                                                                                                  #        2.      IF AVERAGE G IS ON:
027740,000046:                                                                                                  #                        CALLS SR30.1 APPROX EVERY TWO SECS.  STATE VECTOR IS ALWAYS
027741,000047:                                                                                                  #                                FOR THIS VEHICLE.  V82 DOES NOT DISTURB STATE VECTOR.  RESULTS
027742,000048:                                                                                                  #                                OF SR30.1 ARE RAPO, RPER, HAPO, HPER, TPER, TFF.
027743,000049:                                                                                                  #                        FLASH MONITOR V16N44 (HAPO, HPER, TFF).
027744,000050:                                                                                                  #        ADDENDUM:  HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
027745,000051:                                                                                                  #                ABOVE REMARKS.
027746,000052: 
027747,000053:                                                                                                  #  CALLING SEQUENCE: VERB 82 ENTER.
027748,000054: 
027749,000055:                                                                                                  #  SUBROUTINES CALLED:   SR30.1, GOXDSPF
027750,000056:                                                                                                  #                        MAYBE - THISPREC, OTHPREC, LOADTIME, DELRSPL
027751,000057: 
027752,000058:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
027753,000059: 
027754,000060:                                                                                                  #  ALARMS:  NONE
027755,000061: 
027756,000062:                                                                                                  #  OUTPUT:       HAPOX   (-29) M
027757,000063:                                                                                                  #                HPERX   (-29) M
027758,000064:                                                                                                  #                RAPO    (-29) M EARTH
027759,000065:                                                                                                  #                        (-27) M MOON
027760,000066:                                                                                                  #                RPER    (-29) M EARTH
027761,000067:                                                                                                  #                        (-27) M MOON
027762,000068:                                                                                                  #                TFF     (-28) CS        CONTAINS NEGATIVE QUANTITY
027763,000069:                                                                                                  #                -TPER   (-28) CS        CONTAINS NEGATIVE QUANTITY
027764,000070: 
027765,000071:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  STATE VECTOR.
027766,000072: 
027767,000073:                                                                                                  #  DEBRIS:       QPRET, RONE, VONE, TFF/RTMU, HPERMIN, RPADTEM, V82EMFLG.
027768,000074:                                                                                                  #                MAYBE:  TSTART82, V82FLAGS, TDEC1.
027769,000075: 
027770,000076: 13,2323  E4,1521                                  EBANK=   HAPOX                                 
027771,000077: 31,2000                                           BANK     31                                    
027772,000078: 22,2000                                           SETLOC   R30LOC                                
027773,000079: 22,2000                                           BANK                                           
027774,000080: 22,3236                                           COUNT*   $$/R30                                
027775,000081: 
027776,000082: 22,3236           06014        V82CALL            TC       INTPRET                               
027777,000083: 22,3237           52014                           BON      GOTO                                  
027778,000084: 22,3240           03712                                    AVEGFLAG                              
027779,000085: 22,3241           45472                                    V82GON                                #  IF AVERAGE G ON
027780,000086: 22,3242           45243                                    V82GOFF                               #  IF AVERAGE G OFF
027781,000087: 
027782,000088: 22,3243           77776        V82GOFF            EXIT                                           #  ALLOW ASTRONAUT TO SELECT VEHICLE
027783,000089: 22,3244           35025                           CAF      TWO                                   #  DESIRED FOR ORBITAL PARAMETERS
027784,000090: 22,3245           55155                           TS       OPTION1                               #  CALCULATION AND DISPLAY.
027785,000091: 22,3246           35026                           CAF      ONE                                   
027786,000092: 22,3247           55156                           TS       OPTION1    +1                         
027787,000093: 22,3250           33315                           CAF      OPTIONVN                              #  V 04 N 06
027788,000094: 22,3251           04655                           TC       BANKCALL                              
027789,000095: 22,3252           20226                           CADR     GOXDSPF                               
027790,000096: 22,3253           05564                           TC       ENDEXT                                #  TERMINATE
027791,000097: 22,3254           03256                           TC       +2                                    #  PROCEED
027792,000098: 22,3255           03250                           TC       -5                                    #  DATA IN.  OPTION1+1 = 1 FOR THIS VEHICLE.
027793,000099:                                                                                                  #                UNEQ 1 FOR OTHER VEHICLE.
027794,000100: 22,3256           00004                           INHINT                                         
027795,000101: 22,3257           35023                           CAF      BIT4                                  #  80 MS
027796,000102: 22,3260           05252                           TC       WAITLIST                              
027797,000103: 22,3261  E4,1542                                  EBANK=   TFF                                   
027798,000104: 22,3261           03435 44064                     2CADR    TICKTEST                              
027799,000105: 
027800,000106: 22,3263           00003                           RELINT                                         
027801,000107: 22,3264           33317        V82GOFLP           CAF      TFFBANK                               #  MAJOR RECYCLE LOOP ENTRY
027802,000108: 22,3265           54003                           TS       EBANK                                 
027803,000109: 22,3266           35030                           CAF      ZERO                                  
027804,000110: 22,3267           55541                           TS       V82FLAGS                              #  ZERO FLAGS FOR TICKTEST. INHIBITS
027805,000111:                                                                                                  #  DECREMENTING OF TFF AND -TPER.
027806,000112: 22,3270           00004                           INHINT                                         
027807,000113: 22,3271           35012                           CAF      PRIO10                                
027808,000114: 22,3272           05155                           TC       FINDVAC                               #  V82GOFF1 WILL EXECUTE STATE VECTOR
027809,000115: 22,3273  E4,1542                                  EBANK=   TFF                                   #  UPDATE AND ORBIT CALCULATIONS FOR
027810,000116: 22,3273           03320 44064                     2CADR    V82GOFF1                              #  SELECTED VEHICLE ABOUT PROPER BODY.
027811,000117: 
027812,000118: 22,3275           00003                           RELINT                                         
027813,000119: 22,3276           36221        V82STALL           CAF      THREE                                 #  STALL IN THIS LOOP AND WITHOLD V 16 N 44
027814,000120: 22,3277           71541                           MASK     V82FLAGS                              #  UNTIL STATE VECTOR UPDATE SETS ONE OF
027815,000121: 22,3300           10000                           CCS      A                                     #  OUR FLAG BITS.
027816,000122: 22,3301           03306                           TC       FLAGGON                               #  EXIT FROM STALL LOOP.
027817,000123: 22,3302           35047                           CAF      1SEC                                  
027818,000124: 22,3303           04655                           TC       BANKCALL                              
027819,000125: 22,3304           01732                           CADR     DELAYJOB                              
027820,000126: 22,3305           03276                           TC       V82STALL                              
027821,000127: 
027822,000128: 22,3306           07766        FLAGGON            TC       SETXDSP                               
027823,000129: 22,3307           33316                           CAF      V16N44                                #  MONITOR HAPO,HPER,TFF.
027824,000130: 22,3310           04655                           TC       BANKCALL                              
027825,000131: 22,3311           20226                           CADR     GOXDSPF                               
027826,000132: 22,3312           05645                           TC       B5OFF                                 #  TERM  THIS TELLS TICKTEST TO KILL ITSELF
027827,000133: 22,3313           05645                           TC       B5OFF                                 #  PROCEED   DITTO
027828,000134: 22,3314           03264                           TC       V82GOFLP                              #  RECYCLE   RECOMPUTE STATE VECT + DISPLAY
027829,000135: 
027830,000136: 22,3315           01006        OPTIONVN           VN       406                                   
027831,000137: 22,3316           04054        V16N44             VN       1644                                  
027832,000138: 22,3317           02142        TFFBANK            ECADR    TFF                                   
027833,000139: 
027834,000140: 22,3320           06014        V82GOFF1           TC       INTPRET                               
027835,000141: 22,3321           77634                           RTB                                            
027836,000142: 22,3322           21454                                    LOADTIME                              
027837,000143: 22,3323           00041                           STORE    TDEC1                                 #  TIME FOR STATE VECTOR UPDATE.
027838,000144: 22,3324           02213                           STORE    TSTART82                              #  TIME FOR INTERNAL USE.
027839,000145: 22,3325           77776                           EXIT                                           
027840,000146: 22,3326           41156                           CS       OPTION1    +1                         #  1 FOR THIS VEHICLE, NOT 1 FOR OTHER.
027841,000147: 22,3327           65026                           AD       ONE                                   
027842,000148: 22,3330           00006                           EXTEND                                         
027843,000149: 22,3331           13357                           BZF      THISSHIP                              
027844,000150: 22,3332           06014        OTHSHIP            TC       INTPRET                               
027845,000151: 22,3333           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR OTHER SHIP.
027846,000152: 22,3334           27014                                    OTHPREC                               
027847,000153: 22,3335           77775        BOTHSHIP           VLOAD                                          #  MOVE RESULTS INTO TFFCONIC STORAGE AREAS
027848,000154: 22,3336           00001                                    RATT                                  #  TO BE CALLED BY SR30.1.
027849,000155: 22,3337           02215                           STORE    RONE                                  #  RATT AT (-29)M FOR EARTH OR MOON
027850,000156: 22,3340           77656                           UNIT                                           
027851,000157: 22,3341           25760                           STOVL    UNITR                                 
027852,000158: 22,3342           00007                                    VATT                                  
027853,000159: 22,3343           02223                           STORE    VONE                                  #  VATT AT (-7)M/CS FOR EARTH OR MOON
027854,000160: 22,3344           77743                           DLOAD*                                         
027855,000161: 22,3345           72410                                    RTMUE,2                               #  X2 IS 0 FOR EARTH CENTERED STATE VEC
027856,000162: 22,3346           00037                           STORE    TFF/RTMU                              #  X2 IS 2 FOR MOON
027857,000163: 22,3347           77743                           DLOAD*                                         #  AS LEFT BY THISPREC OR OTHPREC.
027858,000164: 22,3350           72404                                    MINPERE,2                             
027859,000165: 22,3351           02207                           STORE    HPERMIN                               #  TFFRTMU, HPERMIN AND RPADTEM ARE ALL
027860,000166: 22,3352           46135                           SLOAD    BHIZ                                  #  EARTH/MOON PARAMETERS AS SET HERE.
027861,000167: 22,3353           00050                                    X2                                    
027862,000168: 22,3354           45374                                    EARTHPAD                              
027863,000169: 22,3355           77650                           GOTO                                           
027864,000170: 22,3356           45377                                    MOONPAD                               
027865,000171: 22,3357           06014        THISSHIP           TC       INTPRET                               
027866,000172: 22,3360           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR THIS SHIP.
027867,000173: 22,3361           27030                                    THISPREC                              
027868,000174: 22,3362           77650                           GOTO                                           
027869,000175: 22,3363           45335                                    BOTHSHIP                              
027870,000176: 
027871,000177:                                                                                                  #  THE FOLLOWING CONSTANTS ARE PAIRWISE INDEXED.  DO NOT SEPARATE PAIRS.
027872,000178: 22,3364           02547 34337  RTMUM              2DEC*    2.21422176 E4         B-18*           
027873,000179: 22,3366           30276 04773  RTMUE              2DEC*    1.996504951 E5         B-18*           
027874,000180: 
027875,000181: 22,3370           00000 12326  MINPERM            2DEC     10668      B-29                       #  35 KFT MIN PERIGEE HEIGHT FOR MOON(-29)M
027876,000182: 
027877,000183: 22,3372           00002 31230  MINPERE            2DEC     91440      B-29                       #  300 KFT (-29)M FOR EARTH
027878,000184: 
027879,000185: 22,3374           52145        EARTHPAD           DLOAD    GOTO                                  #  PAD 37-B RADIUS.  SCALED AT (-29)M.
027880,000186: 22,3375           06105                                    RPAD                                  
027881,000187: 22,3376           45402                                    BOTHPAD                               
027882,000188: 
027883,000189: 22,3377           51575        MOONPAD            VLOAD    ABVAL                                 #  COMPUTE MOON PAD RADIUS FROM RLS VECTOR.
027884,000190: 22,3400           02025                                    RLS                                   #  SCALED AT (-27)M.
027885,000191: 22,3401           77722                           SR2R                                           
027886,000192: 22,3402           02211        BOTHPAD            STORE    RPADTEM                               
027887,000193: 22,3403           77624                           CALL                                           
027888,000194: 22,3404           45572                                    SR30.1                                #  CALCULATE ORBITAL PARAMETERS
027889,000195: 22,3405           77634                           RTB                                            
027890,000196: 22,3406           21454                                    LOADTIME                              
027891,000197: 22,3407           77625                           DSU                                            
027892,000198: 22,3410           02213                                    TSTART82                              #  PRESENT TIME - TIME V82GOFF1 BEGAN
027893,000199: 22,3411           02213                           STORE    TSTART82                              #                  SAVE IT
027894,000200: 22,3412           53145                           DLOAD    BZE                                   #  SR30.1 SETS -TPER=0 IF HPER L/
027895,000201: 22,3413           02145                                    -TPER                                 #  HPERMIN (300 OR 35) KFT.
027896,000202: 22,3414           45425                                    TICKTFF                               #  (-TPER = 0)
027897,000203: 22,3415           43345        TICKTPER           DLOAD    DAD                                   #  (-TPER NON ZERO) TFF WAS NOT COMPUTED,
027898,000204: 22,3416           02145                                    -TPER                                 #  BUT WAS SET TO 59M59S.  DONT TICK TFF, DO
027899,000205: 22,3417           02213                                    TSTART82                              #  TICK -TPER.  DISPLAY BOTH.
027900,000206: 22,3420           02145                           STORE    -TPER                                 #  -TPER CORRECTED FOR TIME SINCE V82GOFF1
027901,000207: 22,3421           77776                           EXIT                                           #  BEGAN.
027902,000208: 22,3422           35026                           CAF      BIT1                                  
027903,000209: 22,3423           55541                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY -TPER
027904,000210: 22,3424           05225                           TC       ENDOFJOB                              
027905,000211: 
027906,000212: 22,3425           43345        TICKTFF            DLOAD    DAD                                   #  (-TPER=0) TFF WAS COMPUTED.  TICK TFF.
027907,000213: 22,3426           02143                                    TFF                                   #  DO NOT TICK -TPER.  DISPLAY TFF, BUT NOT
027908,000214: 22,3427           02213                                    TSTART82                              #  -TPER.
027909,000215: 22,3430           02143                           STORE    TFF                                   #  TFF CORRECTED FOR TIME SINCE V82GOFF1
027910,000216: 22,3431           77776                           EXIT                                           #  BEGAN.
027911,000217: 22,3432           35025                           CAF      BIT2                                  
027912,000218: 22,3433           55541                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY TFF.
027913,000219: 22,3434           05225                           TC       ENDOFJOB                              
027914,000220: 
027915,000221: 22,3435           35022        TICKTEST           CAF      BIT5                                  #  THIS WAITLIST PROGRAM PERPETUATES ITSELF
027916,000222: 22,3436           71045                           MASK     EXTVBACT                              #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
027917,000223: 22,3437           10000                           CCS      A                                     
027918,000224: 22,3440           03446                           TC       DOTICK                                
027919,000225: 22,3441           37665                           CAF      PRIO25                                
027920,000226: 22,3442           05142                           TC       NOVAC                                 #  TERMINATE V 82.  CANT CALL ENDEXT IN RUPT.
027921,000227: 22,3443     1045                                  EBANK=   EXTVBACT                              
027922,000228: 22,3443           05564 04062                     2CADR    ENDEXT                                
027923,000229: 
027924,000230: 22,3445           05331                           TC       TASKOVER                              
027925,000231: 22,3446           35047        DOTICK             CAF      1SEC                                  #  RE-REQUEST TICKTEST.
027926,000232: 22,3447           05252                           TC       WAITLIST                              
027927,000233: 22,3450  E4,1542                                  EBANK=   TFF                                   
027928,000234: 22,3450           03435 44064                     2CADR    TICKTEST                              
027929,000235: 
027930,000236: 22,3452           36221                           CAF      THREE                                 
027931,000237: 22,3453           71541                           MASK     V82FLAGS                              
027932,000238: 22,3454           50000                           INDEX    A                                     
027933,000239: 22,3455           03456                           TC       +1                                    
027934,000240: 22,3456           05331                           TC       TASKOVER                              #  IF NO FLAGBITS SET DONT CHANGE TFF OR
027935,000241:                                                                                                  #  -TPER, BUT CONTINUE LOOP.
027936,000242: 22,3457           03465                           TC       TPERTICK                              #  ONLY BIT 1 SET.  INCR -TPER BY 1 SEC.
027937,000243: 22,3460           35047        TFFTICK            CAF      1SEC                                  #  ONLY BIT 2 SET.  INCR TFF BY 1 SEC.
027938,000244: 22,3461           54001                           TS       L                                     
027939,000245: 22,3462           35030                           CAF      ZERO                                  
027940,000246: 22,3463           21543                           DAS      TFF                                   
027941,000247: 22,3464           05331                           TC       TASKOVER                              
027942,000248: 22,3465           35047        TPERTICK           CAF      1SEC                                  
027943,000249: 22,3466           54001                           TS       L                                     
027944,000250: 22,3467           35030                           CAF      ZERO                                  
027945,000251: 22,3470           21545                           DAS      -TPER                                 
027946,000252: 22,3471           05331                           TC       TASKOVER                              
027947,000253: 
027948,000254: 22,3472           77776        V82GON             EXIT                                           #  AVERAGE G ON.  USE CURRENT STATE VECTOR
027949,000255: 22,3473           00004                           INHINT                                         #  FOR ORBITAL PARAMETER CALCULATIONS.
027950,000256: 22,3474           35071                           CAF      PRIO7                                 #  LESS THAN LAMBERT
027951,000257: 22,3475           05155                           TC       FINDVAC                               #  V82GON1 WILL PERFORM ORBIT CALCULATIONS
027952,000258: 22,3476  E4,1542                                  EBANK=   TFF                                   #  ABOUT PROPER BODY APPROX ONCE PER SEC.
027953,000259: 22,3476           03513 44064                     2CADR    V82GON1                               
027954,000260: 
027955,000261: 22,3500           00003                           RELINT                                         
027956,000262: 22,3501           35047                           CAF      1SEC                                  #  WITHOLD V16 N44 UNTIL FIRST ORBIT CALC
027957,000263: 22,3502           04655                           TC       BANKCALL                              #  IS DONE.  NOTE:  V82GON1 (PRIO7, FINDVAC
027958,000264: 22,3503           01732                           CADR     DELAYJOB                              #  JOB) IS COMPLETED BEFORE V82GON (PRIO7,
027959,000265: 22,3504           07766                           TC       SETXDSP                               #  NOVAC JOB).
027960,000266: 22,3505           33316        V82REDSP           CAF      V16N44                                #  MONITOR HAPO, HPER, TFF
027961,000267: 22,3506           04655                           TC       BANKCALL                              
027962,000268: 22,3507           20226                           CADR     GOXDSPF                               
027963,000269: 22,3510           05645                           TC       B5OFF                                 #  TERM THIS TELLS V82GON1 TO KILL ITSELF.
027964,000270: 22,3511           05645                           TC       B5OFF                                 #  PROC DITTO.
027965,000271: 22,3512           03505                           TC       V82REDSP                              #  RECYCLE
027966,000272: 
027967,000273: 22,3513           06014        V82GON1            TC       INTPRET                               #  THIS EXEC PROGRAM PERPETUATES ITSELF
027968,000274:                                                                                                  #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
027969,000275: 22,3514           52175                           VLOAD    GOTO                                  #  HOLDS OFF CCS NEWJOB BETWEEN RN AND
027970,000276: 22,3515           01220                                    RN                                    #  VN FETCH SO RN, VN ARE FROM SAME
027971,000277: 22,3516           45517                                    NEXTLINE                              #  STATE VECTOR UPDATE.
027972,000278: 22,3517           26215        NEXTLINE           STOVL    RONE                                  #  RN AT (-29)M FOR EARTH OR MOON
027973,000279: 22,3520           01226                                    VN                                    
027974,000280: 22,3521           02223                           STORE    VONE                                  #  VN AT (-7)M/CS FOR EARTH OR MOON
027975,000281: 22,3522           52014                           BON      GOTO                                  
027976,000282: 22,3523           04304                                    MOONTHIS                              #  FLAG INDICATES BODY ABOUT WHICH ORBITAL
027977,000283: 22,3524           45526                                    MOONGON                               #  CALCULATIONS ARE TO BE PERFORMED.
027978,000284: 22,3525           45540                                    EARTHGON                              #  IF SET - MOON, IF RESET - EARTH.
027979,000285: 
027980,000286: 22,3526           77745        MOONGON            DLOAD                                          
027981,000287: 22,3527           05365                                    RTMUM                                 #  LUNAR PARAMETERS LOADED HERE FOR SR30.1
027982,000288: 22,3530           14037                           STODL    TFF/RTMU                              
027983,000289: 22,3531           05371                                    MINPERM                               
027984,000290: 22,3532           02207                           STORE    HPERMIN                               
027985,000291: 22,3533           51575                           VLOAD    ABVAL                                 
027986,000292: 22,3534           02025                                    RLS                                   #  SCALED AT (-27)M.
027987,000293: 22,3535           77722                           SR2R                                           
027988,000294: 22,3536           77650                           GOTO                                           
027989,000295: 22,3537           45546                                    V82GON2                               
027990,000296: 22,3540           77745        EARTHGON           DLOAD                                          
027991,000297: 22,3541           05367                                    RTMUE                                 #  EARTH PARAMETERS LOADED HERE FOR SR30.1
027992,000298: 22,3542           14037                           STODL    TFF/RTMU                              
027993,000299: 22,3543           05373                                    MINPERE                               
027994,000300: 22,3544           16207                           STODL    HPERMIN                               
027995,000301: 22,3545           06105                                    RPAD                                  
027996,000302: 22,3546           02211        V82GON2            STORE    RPADTEM                               #  COMMON CODE FOR EARTH & MOON.
027997,000303: 22,3547           77624                           CALL                                           
027998,000304: 22,3550           45572                                    SR30.1                                
027999,000305: 22,3551           77776                           EXIT                                           
028000,000306: 22,3552           05375                           TC       CHECKMM                               
028001,000307: 22,3553           00013                           DEC      11         B-14                       
028002,000308: 22,3554           03562                           TC       V82GON3                               
028003,000309: 22,3555           06014                           TC       INTPRET                               
028004,000310: 22,3556           45145                           DLOAD    CALL                                  
028005,000311: 22,3557           02143                                    TFF                                   
028006,000312: 22,3560           45561                                    V82GON3    -1                         
028007,000313: 22,3561           77776                           EXIT                                           
028008,000314: 22,3562           35022        V82GON3            CAF      BIT5                                  
028009,000315: 22,3563           71045                           MASK     EXTVBACT                              #  SEE IF ASTRONAUT HAS SIGNALLED TERMINATE
028010,000316: 22,3564           00006                           EXTEND                                         
028011,000317: 22,3565           15564                           BZF      ENDEXT                                #  YES, TERMINATE VB 82 LOOP
028012,000318: 22,3566           35047                           CAF      1SEC                                  
028013,000319: 22,3567           04655                           TC       BANKCALL                              #  WAIT ONE SECOND BEFORE REPEATING
028014,000320: 22,3570           01732                           CADR     DELAYJOB                              #  ORBITAL PARAMETER COMPUTATION.
028015,000321: 22,3571           03513                           TC       V82GON1                               
028016,000322: 
028017,000323: 22,3572  22,3562               SPLRET             =        V82GON3                               
028018,000324: 
028019,000325:                                                                                                  #  SUBROUTINE NAME: SR30.1
028020,000326:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
028021,000327:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION: R32
028022,000328:                                                                                                  #  MOD NO: 1     MOD BY: RR BAIRNSFATHER         DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
028023,000329:                                                                                                  #  MOD NO: 2     MOD BY: RR BAIRNSFATHER         DATE: 14 APR 67         ADD OVFL CK FOR RAPO
028024,000330:                                                                                                  #  MOD NO: 3     MOD BY ALONSO                   DATE: 11 DEC 67         SUBROUTINE REWRITTEN
028025,000331:                                                                                                  #  MOD NO: 4     MOD BY ALONSO                   DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
028026,000332:                                                                                                  #  MOD NO: 5     MOD BY: RR BAIRNSFATHER         DATE: 6 AUG 68          OVFL CK FOR HAPO & HPER. VOIDS MOD #2.
028027,000333: 
028028,000334:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:  ORBITAL PARAMETERS DISPLAY FOR NOUNS 32 AND 44.
028029,000335:                                                                                                  #  SR30.1 CALLS TFFCONMU AND TFFRP/RA TO CALCULATE RPER (PERIGEE RADIUS),
028030,000336:                                                                                                  #  RAPO (APOGEE RADIUS), HPER (PERIGEE HEIGHT ABOVE LAUNCH PAD OR LUNAR
028031,000337:                                                                                                  #  LANDING SITE), HAPO (APOGEE HEIGHT AS ABOVE), TPER (TIME TO PERIGEE),
028032,000338:                                                                                                  #  TFF (TIME TO INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
028033,000339:                                                                                                  #  IF HPER IS GREATER THAN OR EQUAL TO HPERMIN, CALCULATES TPER AND STORES
028034,000340:                                                                                                  #  NEGATIVE IN -TPER.  OTHERWISE STORES +0 IN -TPER.  WHENEVER TPER IS
028035,000341:                                                                                                  #  CALCULATED, TFF IS NOT COMPUTABLE AND DEFAULTS TO -59MIN 59SEC.  IF HAPO
028036,000342:                                                                                                  #  WOULD EXCEED 9999.9 NM, IT IS LIMITED TO THAT VALUE FOR DISPLAY.
028037,000343: 
028038,000344:                                                                                                  #  ADDENDUM:     HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
028039,000345:                                                                                                  #                ABOVE REMARKS.
028040,000346: 
028041,000347:                                                                                                  #  CALLING SEQUENCE:     CALL
028042,000348:                                                                                                  #                                SR30.1
028043,000349: 
028044,000350:                                                                                                  #  SUBROUTINES CALLED:   TFFCONMU, TFFRP/RA, CALCTPER, CALCTFF
028045,000351: 
028046,000352:                                                                                                  #  NORMAL EXIT MODE:     CALLING LINE +1 (STILL IN INTERPRETIVE MODE)
028047,000353: 
028048,000354:                                                                                                  #  ALARMS:       NONE
028049,000355: 
028050,000356:                                                                                                  #  OUTPUT:       RAPO    (-29) M EARTH   APOGEE RADIUS   EARTH CENTERED COORD.
028051,000357:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
028052,000358:                                                                                                  #                RPER    (-29) M EARTH   PERIGEE RADIUS  EARTH CENTERED COORD.
028053,000359:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
028054,000360:                                                                                                  #                HAPOX   (-29) M         APOGEE ALTITUDE ABOVE PAD OR LAND. SITE MAX VALUE LIMITED TO 9999.9 NM.
028055,000361:                                                                                                  #                HPERX   (-29) M         PERIGEE ALT. ABOVE PAD OR LAND. SITE    MAX VALUE LIMITED TO 9999.9 NM.
028056,000362:                                                                                                  #                TFF     (-28) CS        TIME TO 300KFT OR 35KFT ALTITUDE
028057,000363:                                                                                                  #                -TPER   (-28) CS        TIME TO PERIGEE
028058,000364: 
028059,000365:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
028060,000366:                                                                                                  #        TFF/RTMU        (+17) EARTH     RECIPROCAL OF PROPER GRAV CONSTANT FOR
028061,000367:                                                                                                  #                        (+14) MOON      EARTH OR MOON = 1/SQRT(MU).
028062,000368:                                                                                                  #        RONE            (-29) M         STATE VECTOR
028063,000369:                                                                                                  #        VONE            (-7)  M/CS      STATE VECTOR
028064,000370:                                                                                                  #        RPADTEM         (-29) M EARTH   RADIUS OF LAUNCH PAD OR LUNAR LANDING
028065,000371:                                                                                                  #                        (-27) M MOON    SITE.
028066,000372:                                                                                                  #        HPERMIN         (-29) M EARTH   (300 OR 35) KFT MINIMUM PERIGEE ALTITUDE
028067,000373:                                                                                                  #                        (-27) M MOON    ABOVE LAUNCH PAD OR LUNAR LANDING SITE.
028068,000374:                                                                                                  #        V82EMFLG        (INT SW BIT)    RESET FOR EARTH, SET FOR MOON.
028069,000375: 
028070,000376:                                                                                                  #  DEBRIS:       QPRET, PDL, S2
028071,000377: 
028072,000378: 22,3572                                           COUNT*   $$/SR30S                              
028073,000379: 
028074,000380: 22,3572           44001        SR30.1             SETPD    STQ                                   #  INITIALIZE PUSHDOWN LIST.
028075,000381: 22,3573           00001                                    0                                     
028076,000382: 22,3574           00051                                    S2                                    
028077,000383:                                                                                                  #  SR30.1 INPUT: RONE AT (-29)M EARTH/MOON
028078,000384:                                                                                                  #                VONE AT (-7)M/CS
028079,000385:                                                                                                  #  TFFCONMU, TFFRP/RA, CALCTPER AND CALCTFF
028080,000386:                                                                                                  #  CALLS REQUIRE:
028081,000387:                                                                                                  #  EARTH CENTERED (NO RESCALING REQUIRED)
028082,000388:                                                                                                  #        RONE SCALED TO B-29 M
028083,000389:                                                                                                  #        VONE SCALED TO B-7  M/CS
028084,000390:                                                                                                  #  MOON CENTERED (RESCALING REQUIRED)
028085,000391:                                                                                                  #        RONE SCALED TO B-27 M
028086,000392:                                                                                                  #        VONE SCALED TO B-5  M/CS
028087,000393: 22,3575           77624                           CALL                                           
028088,000394: 22,3576           57314                                    TFFCONMU                              
028089,000395: 22,3577           77624                           CALL                                           #  TFFRP/RA COMPUTES RAPO,RPER.
028090,000396: 22,3600           57360                                    TFFRP/RA                              
028091,000397:                                                                                                  #  RETURNS WITH RAPO IN D(MPAC).
028092,000398: 22,3601           40015                           DAD      BOV                                   
028093,000399: 22,3602           14423                                    1BITDP                                
028094,000400: 22,3603           45637                                    MAXCHK                                
028095,000401: 22,3604           45345                           DLOAD    DSU                                   
028096,000402: 22,3605           00021                                    RAPO                                  
028097,000403: 22,3606           02211                                    RPADTEM                               
028098,000404: 22,3607           16122        STORHAPO           STODL    HAPOX                                 
028099,000405: 22,3610           00017                                    RPER                                  
028100,000406: 22,3611           77625                           DSU                                            
028101,000407: 22,3612           02211                                    RPADTEM                               #  GIVES HPER AT (-29)M EARTH, (-27)M MOON.
028102,000408: 22,3613           02124        STORHPER           STORE    HPERX                                 #  STORE (RPER - RPADTEM) INTO HPERX.
028103,000409: 22,3614           51025                           DSU      BPL                                   #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
028104,000410: 22,3615           02207                                    HPERMIN                               #  IF HPER L/ HPERMIN (300 OR 35) KFT,
028105,000411: 22,3616           45622                                    DOTPER                                #  THEN ZERO INTO -TPER.
028106,000412: 22,3617           52145                           DLOAD    GOTO                                  #  OTHERWISE CALCULATE TPER.
028107,000413: 22,3620           06233                                    HI6ZEROS                              
028108,000414: 22,3621           45626                                    SKIPTPER                              
028109,000415: 22,3622           45145        DOTPER             DLOAD    CALL                                  
028110,000416: 22,3623           00017                                    RPER                                  
028111,000417: 22,3624           57412                                    CALCTPER                              
028112,000418: 22,3625           77676                           DCOMP                                          #  TPER IS PUT NEG INTO -TPER.
028113,000419: 22,3626           16145        SKIPTPER           STODL    -TPER                                 
028114,000420: 22,3627           02207                                    HPERMIN                               #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
028115,000421: 22,3630           45015                           DAD      CALL                                  
028116,000422: 22,3631           02211                                    RPADTEM                               #  RPADTEM AT (-29)M FOR EARTH, (-27)M MOON
028117,000423: 22,3632           57415                                    CALCTFF                               #  GIVES 59M59S FOR TFF IF RPER G/
028118,000424: 22,3633           77676                           DCOMP                                          #  HPERMIN + RPADTEM.  (TPER WAS NON ZERO)
028119,000425: 22,3634           02143                           STORE    TFF                                   #  OTHERWISE COMPUTES TFF.       (GOTO)
028120,000426: 22,3635           77650                           GOTO                                           
028121,000427: 22,3636           00051                                    S2                                    
028122,000428: 
028123,000429: 22,3637           52145        MAXCHK             DLOAD    GOTO                                  #  IF C(MPAC) > 9999.9 NM, MPAC = 9999.9 NM
028124,000430: 22,3640           05643                                    MAXNM                                 
028125,000431: 22,3641           45607                                    STORHAPO                              
028126,000432: 
028127,000433: 22,3642           01065 05603  MAXNM              2OCT     01065      05603                      
028128,000434: 
028129,000435: 

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