Source Code

These source-code files are part of a reconstructed copy of Comanche 67, the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 12.

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 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.

021390,000002:                                                                                                  ## Copyright:   Public domain.
021391,000003:                                                                                                  ## Filename:    R30.agc
021392,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
021393,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
021394,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
021395,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
021396,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
021397,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
021398,000010:                                                                                                  ##              other AGC programs.
021399,000011:                                                                                                  ## Assembler:   yaYUL
021400,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021401,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021402,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
021403,000015:                                                                                                  ##              2024-05-13 MAS  Updated for Comanche 067.
021404,000016: 
021405,000017:                                                                                                  #  SUBROUTINE NAME:  V82CALL
021406,000018:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
021407,000019:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION:  R30
021408,000020:                                                                                                  #  MOD NO: 1     MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
021409,000021:                                                                                                  #  MOD NO: 2     MOD  BY  ALONSO                 DATE: 11 DEC 67         VB82 PROGRAM REWRITTEN
021410,000022:                                                                                                  #  MOD NO: 3     MOD  BY  ALONSO                 DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
021411,000023: 
021412,000024:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:   CALLED BY VERB 82 ENTER.  PRIORITY 10
021413,000025:                                                                                                  #  USED THROUGHOUT.              CALCULATE AND DISPLAY ORBITAL PARAMETERS
021414,000026: 
021415,000027:                                                                                                  #  1.    IF AVERAGE G IS OFF:
021416,000028:                                                                                                  #                FLASH DISPLAY V04N06.  R2 INDICATES WHICH SHIP'S STATE VECTOR IS
021417,000029:                                                                                                  #                        TO BE UPDATED.  INITIAL CHOICE IS THIS SHIP (R2=1).  ASTRONAUT
021418,000030:                                                                                                  #                        CAN CHANGE TO OTHER SHIP BY V22EXE, WHERE X NOT EQ 1.
021419,000031:                                                                                                  #                SELECTED STATE VECTOR UPDATED BY THISPREC (OTHPREC).
021420,000032:                                                                                                  #                CALLS SR30.1 (WHICH CALLS TFFCONMU + TFFRP/RA) TO CALCULATE
021421,000033:                                                                                                  #                        RPER (PERIGEE RADIUS), RAPO (APOGEE RADIUS), HPER (PERIGEE
021422,000034:                                                                                                  #                        HEIGHT ABOVE LAUNCH PAD OR LUNAR LANDING SITE), HAPO (APOGEE
021423,000035:                                                                                                  #                        HEIGHT AS ABOVE), TPER (TIME TO PERIGEE), TFF (TIME TO
021424,000036:                                                                                                  #                        INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
021425,000037:                                                                                                  #                FLASH MONITOR V16N44 (HAPO, HPER, TFF).  TFF IS -59M59S IF IT WAS
021426,000038:                                                                                                  #                        NOT COMPUTABLE, OTHERWISE IT INCREMENTS ONCE PER SECOND.
021427,000039:                                                                                                  #                        ASTRONAUT HAS OPTION TO MONITOR TPER BY KEYING IN N 32 E.
021428,000040:                                                                                                  #                        DISPLAY IS IN HMS, IS NEGATIVE (AS WAS TFF), AND INCREMENTS
021429,000041:                                                                                                  #                        ONCE PER SECOND ONLY IF TFF DISPLAY WAS -59M59S.
021430,000042:                                                                                                  #        2.      IF AVERAGE G IS ON:
021431,000043:                                                                                                  #                        CALLS SR30.1 APPROX EVERY TWO SECS.  STATE VECTOR IS ALWAYS
021432,000044:                                                                                                  #                                FOR THIS VEHICLE.  V82 DOES NOT DISTURB STATE VECTOR.  RESULTS
021433,000045:                                                                                                  #                                OF SR30.1 ARE RAPO, RPER, HAPO, HPER, TPER, TFF.
021434,000046:                                                                                                  #                        FLASH MONITOR V16N44 (HAPO, HPER, TFF).
021435,000047:                                                                                                  #                        IF MODE IS P11, THEN CALL DELRSPL SO ASTRONAUT CAN MONITOR
021436,000048:                                                                                                  #                                RESULTS BY N50E.  SPLASH COMPUTATION DONE ONCE PER TWO SECS.
021437,000049:                                                                                                  #        ADDENDUM:  HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
021438,000050:                                                                                                  #                ABOVE REMARKS.
021439,000051: 
021440,000052:                                                                                                  #  CALLING SEQUENCE: VERB 82 ENTER.
021441,000053: 
021442,000054:                                                                                                  #  SUBROUTINES CALLED:   SR30.1, GOXDSPF
021443,000055:                                                                                                  #                        MAYBE - THISPREC, OTHPREC, LOADTIME, DELRSPL
021444,000056: 
021445,000057:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
021446,000058: 
021447,000059:                                                                                                  #  ALARMS:  NONE
021448,000060: 
021449,000061:                                                                                                  #  OUTPUT:       HAPOX   (-29) M
021450,000062:                                                                                                  #                HPERX   (-29) M
021451,000063:                                                                                                  #                RAPO    (-29) M EARTH
021452,000064:                                                                                                  #                        (-27) M MOON
021453,000065:                                                                                                  #                RPER    (-29) M EARTH
021454,000066:                                                                                                  #                        (-27) M MOON
021455,000067:                                                                                                  #                TFF     (-28) CS        CONTAINS NEGATIVE QUANTITY
021456,000068:                                                                                                  #                -TPER   (-28) CS        CONTAINS NEGATIVE QUANTITY
021457,000069:                                                                                                  #                RSP-RREC(-29) M         IF DELRSPL CALLED
021458,000070: 
021459,000071:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  STATE VECTOR.
021460,000072: 
021461,000073:                                                                                                  #  DEBRIS:       QPRET, RONE, VONE, TFF/RTMU, HPERMIN, RPADTEM, V82EMFLG.
021462,000074:                                                                                                  #                MAYBE:  TSTART82, V82FLAGS, TDEC1.
021463,000075: 
021464,000076: 13,2231  E4,1751                                  EBANK=   HAPOX                                 
021465,000077: 31,2332                                           BANK     31                                    
021466,000078: 23,2000                                           SETLOC   R30LOC                                
021467,000079: 23,2000                                           BANK                                           
021468,000080: 23,2332                                           COUNT*   $$/R30                                
021469,000081: 
021470,000082: 23,2332           06006        V82CALL            TC       INTPRET                               
021471,000083: 23,2333           52014                           BON      GOTO                                  
021472,000084: 23,2334           00716                                    AVEGFLAG                              
021473,000085: 23,2335           40201                                    V82GON                                #  IF AVERAGE G ON
021474,000086: 23,2336           46337                                    V82GOFF                               #  IF AVERAGE G OFF
021475,000087: 
021476,000088: 23,2337           77776        V82GOFF            EXIT                                           #  ALLOW ASTRONAUT TO SELECT VEHICLE
021477,000089: 23,2340           35032                           CAF      TWO                                   #  DESIRED FOR ORBITAL PARAMETERS
021478,000090: 23,2341           55051                           TS       OPTIONX                               
021479,000091: 23,2342           35033                           CAF      ONE                                   
021480,000092: 23,2343           55052                           TS       OPTIONX    +1                         
021481,000093: 23,2344           32410                           CAF      OPTIONVN                              #  V 04 N 06
021482,000094: 23,2345           04676                           TC       BANKCALL                              
021483,000095: 23,2346           20561                           CADR     GOXDSPF                               
021484,000096: 23,2347           05550                           TC       ENDEXT                                #  TERMINATE
021485,000097: 23,2350           02352                           TC       +2                                    #  PROCEED
021486,000098: 23,2351           02344                           TC       -5                                    #  DATA IN.  OPTIONX +1 = 1 FOR THIS VEHIC.
021487,000099:                                                                                                  #                 UNEQ 1 FOR OTHER VEHICLE.
021488,000100: 23,2352           32412                           CAF      TFFBANK                               
021489,000101: 23,2353           54003                           TS       EBANK                                 
021490,000102: 23,2354           31052                           CA       OPTIONX    +1                         
021491,000103: 23,2355           54111                           TS       OPTION82                              
021492,000104: 
021493,000105: 23,2356           35030                           CAF      BIT4                                  #  80 MS
021494,000106: 23,2357           05261                           TC       WAITLIST                              
021495,000107: 23,2360  E4,1743                                  EBANK=   TFF                                   
021496,000108: 23,2360           02551 46064                     2CADR    TICKTEST                              
021497,000109: 
021498,000110: 23,2362           00003                           RELINT                                         
021499,000111: 23,2363           35035        V82GOFLP           CAF      ZERO                                  #  MAJOR RECYCLE LOOP ENTRY
021500,000112: 23,2364           55742                           TS       V82FLAGS                              #  ZERO FLAGS FOR TICKTEST. INHIBITS
021501,000113:                                                                                                  #  DECREMENTING OF TFF AND -TPER.
021502,000114: 23,2365           35077                           CAF      PRIO7                                 
021503,000115: 23,2366           05163                           TC       FINDVAC                               #  V82GOFF1 WILL EXECUTE STATE VECTOR
021504,000116: 23,2367  E4,1743                                  EBANK=   TFF                                   #  UPDATE AND ORBIT CALCULATIONS FOR
021505,000117: 23,2367           02413 46064                     2CADR    V82GOFF1                              #  SELECTED VEHICLE ABOUT PROPER BODY.
021506,000118: 
021507,000119: 23,2371           00003                           RELINT                                         
021508,000120: 23,2372           36214        V82STALL           CAF      THREE                                 #  STALL IN THIS LOOP AND WITHOLD V 16 N 44
021509,000121: 23,2373           71742                           MASK     V82FLAGS                              #  UNTIL STATE VECTOR UPDATE SETS ONE OF
021510,000122: 23,2374           10000                           CCS      A                                     #  OUR FLAG BITS.
021511,000123: 23,2375           02402                           TC       FLAGGON                               #  EXIT FROM STALL LOOP.
021512,000124: 23,2376           35055                           CAF      1SEC                                  
021513,000125: 23,2377           04676                           TC       BANKCALL                              
021514,000126: 23,2400           01732                           CADR     DELAYJOB                              
021515,000127: 23,2401           02372                           TC       V82STALL                              
021516,000128: 
021517,000129: 23,2402           32411        FLAGGON            CAF      V16N44                                #  MONITOR HAPO,HPER,TFF.
021518,000130: 23,2403           04676                           TC       BANKCALL                              
021519,000131: 23,2404           20561                           CADR     GOXDSPF                               
021520,000132: 23,2405           05641                           TC       B5OFF                                 #  TERM THIS TELLS TICKTEST TO KILL ITSELF
021521,000133: 23,2406           05641                           TC       B5OFF                                 #  PROCEED  DITTO
021522,000134: 23,2407           02363                           TC       V82GOFLP                              #  RECYCLE  RECOMPUTE STATE VECT + DISPLAY
021523,000135: 
021524,000136: 23,2410           01014        OPTIONVN           VN       0412                                  
021525,000137: 23,2411           04054        V16N44             VN       1644                                  
021526,000138: 23,2412           02343        TFFBANK            ECADR    TFF                                   
021527,000139: 
021528,000140: 23,2413           22007        V82GOFF1           ZL                                             
021529,000141: 23,2414           35035                           CAF      ZERO                                  
021530,000142: 23,2415           53052                           DXCH     DSPTEMX                               
021531,000143: 23,2416           32472                           CAF      V06N16X                               
021532,000144: 23,2417           04676                           TC       BANKCALL                              
021533,000145: 23,2420           20561                           CADR     GOXDSPF                               
021534,000146: 23,2421           05550                           TC       ENDEXT                                
021535,000147: 23,2422           02424                           TC       +2                                    
021536,000148: 23,2423           02416                           TC       -5                                    
021537,000149: 23,2424           06006        ISTIMEOK           TC       INTPRET                               
021538,000150: 23,2425           53145                           DLOAD    BZE                                   
021539,000151: 23,2426           01052                                    DSPTEMX                               
021540,000152: 23,2427           46467                                    GETNOW                                
021541,000153: 23,2430           00041        STRTDEC1           STORE    TDEC1                                 #  TIME FOR STATE VECTOR UPDATE.
021542,000154: 23,2431           02325                           STORE    TSTART82                              #  TIME FOR INTERNAL USE.
021543,000155: 23,2432           77776                           EXIT                                           
021544,000156: 23,2433           40111                           CS       OPTION82                              #  1 FOR THIS VEHICLE, NOT 1 FOR OTHER
021545,000157: 23,2434           65033                           AD       ONE                                   
021546,000158: 23,2435           00006                           EXTEND                                         
021547,000159: 23,2436           12462                           BZF      THISSHIP                              
021548,000160: 23,2437           06006        OTHSHIP            TC       INTPRET                               
021549,000161: 23,2440           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR OTHER SHIP.
021550,000162: 23,2441           27115                                    OTHPREC                               
021551,000163: 23,2442           77775        BOTHSHIP           VLOAD                                          #  MOVE RESULTS INTO TFFCONIC STORAGE AREAS
021552,000164: 23,2443           00001                                    RATT                                  #  TO BE CALLED BY SR30.1.
021553,000165: 23,2444           26327                           STOVL    RONE                                  #  RATT AT (-29)M FOR EARTH OR MOON
021554,000166: 23,2445           00007                                    VATT                                  
021555,000167: 23,2446           02335                           STORE    VONE                                  #  VATT AT (-7)M/CS FOR EARTH OR MOON
021556,000168: 23,2447           77743                           DLOAD*                                         
021557,000169: 23,2450           71301                                    1/RTMUE,2                             #  X2 IS 0 FOR EARTH CENTERED STATE VEC
021558,000170: 23,2451           00037                           STORE    TFF/RTMU                              #  X2 IS 2 FOR MOON
021559,000171: 23,2452           77743                           DLOAD*                                         #  AS LEFT BY THISPREC OR OTHPREC.
021560,000172: 23,2453           71275                                    MINPERE,2                             
021561,000173: 23,2454           02321                           STORE    HPERMIN                               #  TFFRTMU, HPERMIN AND RPADTEM ARE ALL
021562,000174: 23,2455           46135                           SLOAD    BHIZ                                  #  EARTH/MOON PARAMETERS AS SET HERE.
021563,000175: 23,2456           00050                                    X2                                    
021564,000176: 23,2457           46503                                    EARTHPAD                              
021565,000177: 23,2460           77650                           GOTO                                           
021566,000178: 23,2461           46507                                    MOONPAD                               
021567,000179: 23,2462           06006        THISSHIP           TC       INTPRET                               
021568,000180: 23,2463           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR THIS SHIP.
021569,000181: 23,2464           27101                                    THISPREC                              
021570,000182: 23,2465           77650                           GOTO                                           
021571,000183: 23,2466           46442                                    BOTHSHIP                              
021572,000184: 23,2467           52034        GETNOW             RTB      GOTO                                  
021573,000185: 23,2470           45510                                    LOADTIME                              
021574,000186: 23,2471           46430                                    STRTDEC1                              
021575,000187: 23,2472           01420        V06N16X            VN       0616                                  
021576,000188:                                                                                                  #  THE FOLLOWING CONSTANTS ARE PAIRWISE INDEXED.  DO NOT SEPARATE PAIRS.
021577,000189: 
021578,000190: 23,2473           27533 07571  1/RTMUM            2DEC*    .45162595  E-4        B14*            
021579,000191: 23,2475           25004 06702  1/RTMUE            2DEC*    .50087529  E-5        B17*            
021580,000192: 
021581,000193: 23,2477           00001 11530  MINPERM            2DEC     10668      B-27                       #  35 KFT MIN PERIGEE HEIGHT FOR MOON(-27)M
021582,000194: 23,2501           00002 31230  MINPERE            2DEC     91440      B-29                       #  300 KFT (-29)M FOR EARTH
021583,000195: 
021584,000196: 23,2503           43145        EARTHPAD           DLOAD    CLRGO                                 #  PAD 37-B RADIUS.  SCALED AT (-29)M.
021585,000197: 23,2504           05152                                    RPAD                                  
021586,000198: 23,2505           04622                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
021587,000199: 23,2506           46513                                    BOTHPAD                               
021588,000200: 
021589,000201: 23,2507           51575        MOONPAD            VLOAD    ABVAL                                 #  COMPUTE MOON PAD RADIUS FROM RLS VECTOR.
021590,000202: 23,2510           02026                                    RLS                                   #  SCALED AT (-27)M.
021591,000203: 23,2511           77614                           SET                                            
021592,000204: 23,2512           04462                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
021593,000205: 23,2513           36323        BOTHPAD            STCALL   RPADTEM                               
021594,000206: 23,2514           46671                                    SR30.1                                #  CALCULATE ORBITAL PARAMETERS
021595,000207: 23,2515           77776                           EXIT                                           
021596,000208: 23,2516           31011                           CA       MODREG                                #  ARE WE IN POO
021597,000209: 23,2517           00006                           EXTEND                                         
021598,000210: 23,2520           12647                           BZF      CANDEL                                #  YES, DO DELRSPL
021599,000211: 23,2521           06006        SPLRET1            TC       INTPRET                               
021600,000212: 23,2522           45234                           RTB      DSU                                   
021601,000213: 23,2523           45510                                    LOADTIME                              
021602,000214: 23,2524           02325                                    TSTART82                              #  PRESENT TIME - TIME V82GOFF1 BEGAN
021603,000215: 23,2525           02325                           STORE    TSTART82                              #                 SAVE IT
021604,000216: 23,2526           53145                           DLOAD    BZE                                   #  SR30.1 SETS -TPER=0 IF HPER L/
021605,000217: 23,2527           02346                                    -TPER                                 #  HPERMIN (300 OR 35) KFT.
021606,000218: 23,2530           46541                                    TICKTFF                               #  (-TPER = 0)
021607,000219: 23,2531           43345        TICKTPER           DLOAD    DAD                                   #  (-TPER NON ZERO) TFF WAS NOT COMPUTED,
021608,000220: 23,2532           02346                                    -TPER                                 #  BUT WAS SET TO 59M59S.  DONT TICK TFF, DO
021609,000221: 23,2533           02325                                    TSTART82                              #  TICK -TPER.  DISPLAY BOTH.
021610,000222: 23,2534           02346                           STORE    -TPER                                 #  -TPER CORRECTED FOR TIME SINCE V82GOFF1
021611,000223: 23,2535           77776                           EXIT                                           #  BEGAN.
021612,000224: 
021613,000225: 23,2536           35033                           CAF      BIT1                                  
021614,000226: 23,2537           55742                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY -TPER
021615,000227: 23,2540           05233                           TC       ENDOFJOB                              
021616,000228: 
021617,000229: 23,2541           43345        TICKTFF            DLOAD    DAD                                   #  (-TPER=0) TFF WAS COMPUTED.  TICK TFF.
021618,000230: 23,2542           02344                                    TFF                                   #  DO NOT TICK -TPER.  DISPLAY TFF, BUT NOT
021619,000231: 23,2543           02325                                    TSTART82                              #  -TPER.
021620,000232: 23,2544           02344                           STORE    TFF                                   #  TFF CORRECTED FOR TIME SINCE V82GOFF1
021621,000233: 23,2545           77776                           EXIT                                           #  BEGAN.
021622,000234: 23,2546           35032                           CAF      BIT2                                  
021623,000235: 23,2547           55742                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY TFF.
021624,000236: 23,2550           05233                           TC       ENDOFJOB                              
021625,000237: 
021626,000238: 23,2551           35027        TICKTEST           CAF      BIT5                                  #  THIS WAITLIST PROGRAM PERPETUATES ITSELF
021627,000239: 23,2552           71044                           MASK     EXTVBACT                              #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
021628,000240: 23,2553           10000                           CCS      A                                     
021629,000241: 23,2554           02562                           TC       DOTICK                                
021630,000242: 23,2555           37662                           CAF      PRIO25                                
021631,000243: 23,2556           05150                           TC       NOVAC                                 #  TERMINATE V 82.  CANT CALL ENDEXT IN RUPT.
021632,000244: 23,2557     1044                                  EBANK=   EXTVBACT                              
021633,000245: 23,2557           05550 04062                     2CADR    ENDEXT                                
021634,000246: 
021635,000247: 23,2561           05340                           TC       TASKOVER                              
021636,000248: 23,2562           35055        DOTICK             CAF      1SEC                                  #  RE-REQUEST TICKTEST.
021637,000249: 23,2563           05261                           TC       WAITLIST                              
021638,000250: 23,2564  E4,1743                                  EBANK=   TFF                                   
021639,000251: 23,2564           02551 46064                     2CADR    TICKTEST                              
021640,000252: 
021641,000253: 23,2566           36214                           CAF      THREE                                 
021642,000254: 23,2567           71742                           MASK     V82FLAGS                              
021643,000255: 23,2570           50000                           INDEX    A                                     
021644,000256: 23,2571           02572                           TC       +1                                    
021645,000257: 23,2572           05340                           TC       TASKOVER                              #  IF NO FLAGBITS SET DONT CHANGE TFF OR
021646,000258:                                                                                                  #  -TPER, BUT CONTINUE LOOP.
021647,000259: 23,2573           02601                           TC       TPERTICK                              #  ONLY BIT 1 SET.  INCR -TPER BY 1 SEC.
021648,000260: 23,2574           35055        TFFTICK            CAF      1SEC                                  #  ONLY BIT 2 SET.  INCR TFF BY 1 SEC.
021649,000261: 23,2575           54001                           TS       L                                     
021650,000262: 23,2576           35035                           CAF      ZERO                                  
021651,000263: 23,2577           21744                           DAS      TFF                                   
021652,000264: 23,2600           05340                           TC       TASKOVER                              
021653,000265: 23,2601           35055        TPERTICK           CAF      1SEC                                  
021654,000266: 23,2602           54001                           TS       L                                     
021655,000267: 23,2603           35035                           CAF      ZERO                                  
021656,000268: 23,2604           21746                           DAS      -TPER                                 
021657,000269: 23,2605           05340                           TC       TASKOVER                              
021658,000270: 
021659,000271: 20,2000                                           SETLOC   R30LOC1                               
021660,000272: 20,2000                                           BANK                                           
021661,000273: 20,2201                                           COUNT*   $$/R30                                
021662,000274: 20,2201           77776        V82GON             EXIT                                           #  AVERAGE G ON.  USE CURRENT STATE VECTOR
021663,000275:                                                                                                  #  FOR ORBITAL PARAMETER CALCULATIONS.
021664,000276: 20,2202           35077                           CAF      PRIO7                                 #  LESS THAN LAMBERT
021665,000277: 20,2203           05163                           TC       FINDVAC                               #  V82GON1 WILL PERFORM ORBIT CALCULATIONS
021666,000278: 20,2204  E4,1743                                  EBANK=   TFF                                   #  ABOUT PROPER BODY APPROX ONCE PER SEC.
021667,000279: 20,2204           02606 46064                     2CADR    V82GON1                               
021668,000280: 
021669,000281: 20,2206           00003                           RELINT                                         
021670,000282: 20,2207           10067                           CCS      NEWJOB                                #  WITHOLD V16 N44 UNTIL FIRST ORBIT CALC
021671,000283: 20,2210           05200                           TC       CHANG1                                #  IS DONE.  NOTE:  V82GON1 (PRIO7, FINDVAC
021672,000284:                                                                                                  #  JOB) IS COMPLETED BEFORE V82GON (PRIO7,
021673,000285:                                                                                                  #  NOVAC JOB).
021674,000286: 20,2211           32217        V82REDSP           CAF      V16N44X                               #  MONITOR HAPO, HPER, TFF
021675,000287: 20,2212           04676                           TC       BANKCALL                              
021676,000288: 20,2213           20561                           CADR     GOXDSPF                               
021677,000289: 20,2214           05641                           TC       B5OFF                                 #  TERM THIS TELLS V82GON1 TO KILL ITSELF.
021678,000290: 20,2215           05641                           TC       B5OFF                                 #  PROC DITTO.
021679,000291: 20,2216           02211                           TC       V82REDSP                              #  RECYCLE
021680,000292: 
021681,000293: 20,2217           04054        V16N44X            VN       1644                                  
021682,000294: 
021683,000295: 23,2000                                           SETLOC   R30LOC                                
021684,000296: 23,2000                                           BANK                                           
021685,000297: 23,2606                                           COUNT*   $$/R30                                
021686,000298: 23,2606           06006        V82GON1            TC       INTPRET                               #  THIS EXEC PROGRAM PERPETUATES ITSELF
021687,000299:                                                                                                  #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
021688,000300: 23,2607           52175                           VLOAD    GOTO                                  #  HOLDS OFF CCS NEWJOB BETWEEN RN AND
021689,000301: 23,2610           01171                                    RN                                    #  VN FETCH SO RN, VN ARE FROM SAME
021690,000302: 23,2611           46612                                    NEXTLINE                              #  STATE VECTOR UPDATE.
021691,000303: 23,2612           26327        NEXTLINE           STOVL    RONE                                  #  RN AT (-29)M FOR EARTH OR MOON
021692,000304: 23,2613           01177                                    VN                                    
021693,000305: 23,2614           02335                           STORE    VONE                                  #  VN AT (-7)M/CS FOR EARTH OR MOON
021694,000306: 23,2615           52014                           BON      GOTO                                  
021695,000307: 23,2616           00315                                    AMOONFLG                              #  FLAG INDICATES BODY ABOUT WHICH ORBITAL
021696,000308: 23,2617           46621                                    MOONGON                               #  CALCULATIONS ARE TO BE PERFORMED.
021697,000309: 23,2620           46632                                    EARTHGON                              #  IF SET - MOON, IF RESET - EARTH.
021698,000310: 
021699,000311: 23,2621           71214        MOONGON            SET      DLOAD                                 
021700,000312: 23,2622           04462                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
021701,000313: 23,2623           06474                                    1/RTMUM                               #  LUNAR PARAMETERS LOADED HERE FOR SR30.1
021702,000314: 23,2624           14037                           STODL    TFF/RTMU                              
021703,000315: 23,2625           06500                                    MINPERM                               
021704,000316: 23,2626           26321                           STOVL    HPERMIN                               
021705,000317: 23,2627           02026                                    RLS                                   #  SCALED AT (-27)M.
021706,000318: 23,2630           52046                           ABVAL    GOTO                                  
021707,000319: 23,2631           46641                                    V82GON2                               
021708,000320: 23,2632           71214        EARTHGON           CLEAR    DLOAD                                 
021709,000321: 23,2633           04662                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
021710,000322: 23,2634           06476                                    1/RTMUE                               #  EARTH PARAMETERS LOADED HERE FOR SR30.1
021711,000323: 23,2635           14037                           STODL    TFF/RTMU                              
021712,000324: 23,2636           06502                                    MINPERE                               
021713,000325: 23,2637           16321                           STODL    HPERMIN                               
021714,000326: 23,2640           05152                                    RPAD                                  
021715,000327: 23,2641           36323        V82GON2            STCALL   RPADTEM                               #  COMMON CODE FOR EARTH & MOON.
021716,000328: 23,2642           46671                                    SR30.1                                
021717,000329: 23,2643           77776                           EXIT                                           
021718,000330: 23,2644           05400                           TC       CHECKMM                               
021719,000331: 23,2645           00013                           DEC      11         B-14                       
021720,000332: 23,2646           02661                           TC       V82GON3                               #  NOT IN MODE 11.
021721,000333: 23,2647           06006        CANDEL             TC       INTPRET                               #  IN MODE 11 OR 00
021722,000334: 23,2650           77624                           CALL                                           
021723,000335: 23,2651           27452                                    INTSTALL                              #  DELRSPL DOES INTWAKE
021724,000336: 23,2652           45145                           DLOAD    CALL                                  
021725,000337: 23,2653           02344                                    TFF                                   
021726,000338: 23,2654           64017                                    DELRSPL                               #  RETURN IS TO NEXT LINE (SPLRET).
021727,000339: 23,2655           77776        SPLRET             EXIT                                           
021728,000340: 
021729,000341: 23,2656           31011                           CA       MODREG                                
021730,000342: 23,2657           00006                           EXTEND                                         
021731,000343: 23,2660           12521                           BZF      SPLRET1                               
021732,000344: 23,2661           35027        V82GON3            CAF      BIT5                                  
021733,000345: 23,2662           71044                           MASK     EXTVBACT                              #  SEE IF ASTRONAUT HAS SIGNALLED TERMINATE
021734,000346: 23,2663           00006                           EXTEND                                         
021735,000347: 23,2664           15550                           BZF      ENDEXT                                #  YES, TERMINATE VB 82 LOOP
021736,000348: 23,2665           35055                           CAF      1SEC                                  
021737,000349: 23,2666           04676                           TC       BANKCALL                              #  WAIT ONE SECOND BEFORE REPEATING
021738,000350: 23,2667           01732                           CADR     DELAYJOB                              #  ORBITAL PARAMETER COMPUTATION.
021739,000351: 23,2670           02606                           TC       V82GON1                               
021740,000352: 
021741,000353:                                                                                                  #  SUBROUTINE NAME: SR30.1
021742,000354:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
021743,000355:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION: R32
021744,000356:                                                                                                  #  MOD NO: 1     MOD BY: RR BAIRNSFATHER         DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
021745,000357:                                                                                                  #  MOD NO: 2     MOD BY: RR BAIRNSFATHER         DATE: 14 APR 67         ADD OVFL CK FOR RAPO
021746,000358:                                                                                                  #  MOD NO: 3     MOD BY ALONSO                   DATE: 11 DEC 67         SUBROUTINE REWRITTEN
021747,000359:                                                                                                  #  MOD NO: 4     MOD BY ALONSO                   DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
021748,000360:                                                                                                  #  MOD NO: 5     MOD BY: RR BAIRNSFATHER         DATE: 6 AUG 68          OVFL CK FOR HAPO & HPER. VOIDS MOD #2.
021749,000361: 
021750,000362:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:  ORBITAL PARAMETERS DISPLAY FOR NOUNS 32 AND 44.
021751,000363:                                                                                                  #  SR30.1 CALLS TFFCONMU AND TFFRP/RA TO CALCULATE RPER (PERIGEE RADIUS),
021752,000364:                                                                                                  #  RAPO (APOGEE RADIUS), HPER (PERIGEE HEIGHT ABOVE LAUNCH PAD OR LUNAR
021753,000365:                                                                                                  #  LANDING SITE), HAPO (APOGEE HEIGHT AS ABOVE), TPER (TIME TO PERIGEE),
021754,000366:                                                                                                  #  TFF (TIME TO INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
021755,000367:                                                                                                  #  IF HPER IS GREATER THAN OR EQUAL TO HPERMIN, CALCULATES TPER AND STORES
021756,000368:                                                                                                  #  NEGATIVE    IN -TPER. OTHERWISE STORES +0 IN -TPER. WHENEVER TPER IS
021757,000369:                                                                                                  #  CALCULATED, TFF IS NOT COMPUTABLE AND DEFAULTS TO -59MIN 59SEC.  IF HAPO
021758,000370:                                                                                                  #  WOULD EXCEED 9999.9 NM, IT IS LIMITED TO THAT VALUE FOR DISPLAY.
021759,000371: 
021760,000372:                                                                                                  #  ADDENDUM:     HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
021761,000373:                                                                                                  #                ABOVE REMARKS.
021762,000374: 
021763,000375:                                                                                                  #  CALLING SEQUENCE:     CALL
021764,000376:                                                                                                  #                                SR30.1
021765,000377: 
021766,000378:                                                                                                  #  SUBROUTINES CALLED:   TFFCONMU, TFFRP/RA, CALCTPER, CALCTFF
021767,000379: 
021768,000380:                                                                                                  #  NORMAL EXIT MODE:     CALLING LINE +1 (STILL IN INTERPRETIVE MODE)
021769,000381: 
021770,000382:                                                                                                  #  ALARMS:       NONE
021771,000383: 
021772,000384:                                                                                                  #  OUTPUT:       RAPO    (-29) M EARTH   APOGEE RADIUS   EARTH CENTERED COORD.
021773,000385:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
021774,000386:                                                                                                  #                RPER    (-29) M EARTH   PERIGEE RADIUS  EARTH CENTERED COORD.
021775,000387:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
021776,000388:                                                                                                  #                HAPOX   (-29) M         APOGEE ALTITUDE ABOVE PAD OR LAND. SITE MAX VALUE LIMITED TO 9999.9 NM.
021777,000389:                                                                                                  #                HPERX   (-29) M         PERIGEE ALT. ABOVE PAD OR LAND. SITE    MAX VALUE LIMITED TO 9999.9 NM.
021778,000390:                                                                                                  #                TFF     (-28) CS        TIME TO 300KFT OR 35KFT ALTITUDE
021779,000391:                                                                                                  #                -TPER   (-28) CS        TIME TO PERIGEE
021780,000392: 
021781,000393:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
021782,000394:                                                                                                  #        TFF/RTMU        (+17) EARTH     RECIPROCAL OF PROPER GRAV CONSTANT FOR
021783,000395:                                                                                                  #                        (+14) MOON      EARTH OR MOON = 1/SQRT(MU).
021784,000396:                                                                                                  #        RONE            (-29) M         STATE VECTOR
021785,000397:                                                                                                  #        VONE            (-7)  M/CS      STATE VECTOR
021786,000398:                                                                                                  #        RPADTEM         (-29) M EARTH   RADIUS OF LAUNCH PAD OR LUNAR LANDING
021787,000399:                                                                                                  #                        (-27) M MOON    SITE.
021788,000400:                                                                                                  #        HPERMIN         (-29) M EARTH   (300 OR 35) KFT MINIMUM PERIGEE ALTITUDE
021789,000401:                                                                                                  #                        (-27) M MOON    ABOVE LAUNCH PAD OR LUNAR LANDING SITE.
021790,000402:                                                                                                  #        V82EMFLG        (INT SW BIT)    RESET FOR EARTH, SET FOR MOON.
021791,000403: 
021792,000404:                                                                                                  #  DEBRIS:       QPRET, PDL, S2
021793,000405: 
021794,000406: 23,2671                                           COUNT*   $$/SR30S                              
021795,000407: 
021796,000408: 23,2671           44001        SR30.1             SETPD    STQ                                   #  INITIALIZE PUSHDOWN LIST.
021797,000409: 23,2672           00001                                    0                                     
021798,000410: 23,2673           00051                                    S2                                    
021799,000411:                                                                                                  #  SR30.1 INPUT: RONE AT (-29)M EARTH/MOON
021800,000412:                                                                                                  #                VONE AT (-7)M/CS
021801,000413:                                                                                                  #  TFFCONMU, TFFRP/RA, CALCTPER AND CALCTFF
021802,000414:                                                                                                  #  CALLS REQUIRE:
021803,000415:                                                                                                  #  EARTH CENTERED (NO RESCALING REQUIRED)
021804,000416:                                                                                                  #        RONE SCALED TO B-29 M
021805,000417:                                                                                                  #        VONE SCALED TO B-7 M/CS
021806,000418:                                                                                                  #  MOON CENTERED (RESCALING REQUIRED)
021807,000419:                                                                                                  #        RONE SCALED TO B-27 M
021808,000420:                                                                                                  #        VONE SCALED TO B-5 M/CS
021809,000421: 23,2674           77214                           BOFF     VLOAD                                 
021810,000422: 23,2675           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
021811,000423: 23,2676           46705                                    TFFCALLS                              
021812,000424: 23,2677           02327                                    RONE                                  
021813,000425: 23,2700           77752                           VSL2                                           
021814,000426: 23,2701           26327                           STOVL    RONE                                  
021815,000427: 23,2702           02335                                    VONE                                  
021816,000428: 23,2703           77752                           VSL2                                           
021817,000429: 23,2704           02335                           STORE    VONE                                  
021818,000430: 23,2705           77624        TFFCALLS           CALL                                           
021819,000431: 23,2706           56761                                    TFFCONMU                              
021820,000432: 23,2707           77624                           CALL                                           #  TFFRP/RA COMPUTES RAPO,RPER.
021821,000433: 23,2710           57027                                    TFFRP/RA                              
021822,000434:                                                                                                  #  RETURNS WITH RAPO IN D(MPAC).
021823,000435: 23,2711           77625                           DSU                                            
021824,000436: 23,2712           02323                                    RPADTEM                               
021825,000437: 23,2713           64414                           BOFF     SR2R                                  #  NEED HAPO AT (-29)M FOR DISPLAY.
021826,000438:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
021827,000439:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
021828,000440: 23,2714           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
021829,000441: 23,2715           46716                                    +1                                    
021830,000442: 23,2716           77624                           CALL                                           #  IF HAPO > MAXNM, SET HAPO =9999.9 NM.
021831,000443: 23,2717           46756                                    MAXCHK                                #  OTHERWISE STORE (RAPO-RPADTEM) IN HAPO.
021832,000444: 23,2720           16352        STORHAPO           STODL    HAPOX                                 
021833,000445: 23,2721           00017                                    RPER                                  
021834,000446: 23,2722           77625                           DSU                                            
021835,000447: 23,2723           02323                                    RPADTEM                               #  GIVES HPER AT (-29)M EARTH, (-27)M MOON.
021836,000448: 23,2724           00161                           STORE    MPAC       +4                         #  SAVE THIS FOR COMPARISON TO HPERMIN.
021837,000449: 23,2725           64414                           BOFF     SR2R                                  #  NEED HPER AT (-29)M FOR DISPLAY.
021838,000450:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
021839,000451:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
021840,000452: 23,2726           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
021841,000453: 23,2727           46730                                    +1                                    
021842,000454: 23,2730           77624                           CALL                                           #  IF HPER > MAXNM, SET HPER = 9999.9 NM.
021843,000455: 23,2731           46756                                    MAXCHK                                
021844,000456: 23,2732           16354        STORHPER           STODL    HPERX                                 #  STORE (RPER - RPADTEM) INTO HPERX.
021845,000457: 23,2733           00161                                    MPAC       +4                         
021846,000458: 23,2734           51025                           DSU      BPL                                   #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
021847,000459: 23,2735           02321                                    HPERMIN                               #  IF HPER L/ HPERMIN (300 OR 35) KFT,
021848,000460: 23,2736           46742                                    DOTPER                                #  THEN ZERO INTO -TPER.
021849,000461: 23,2737           52145                           DLOAD    GOTO                                  #  OTHERWISE CALCULATE TPER.
021850,000462: 23,2740           15334                                    HI6ZEROS                              
021851,000463: 23,2741           46746                                    SKIPTPER                              
021852,000464: 23,2742           45145        DOTPER             DLOAD    CALL                                  
021853,000465: 23,2743           00017                                    RPER                                  
021854,000466: 23,2744           57065                                    CALCTPER                              
021855,000467: 23,2745           77676                           DCOMP                                          #  TPER IS PUT NEG INTO -TPER.
021856,000468: 23,2746           16346        SKIPTPER           STODL    -TPER                                 
021857,000469: 23,2747           02321                                    HPERMIN                               #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
021858,000470: 23,2750           45015                           DAD      CALL                                  
021859,000471: 23,2751           02323                                    RPADTEM                               #  RPADTEM AT (-29)M FOR EARTH, (-27)M MOON
021860,000472: 23,2752           57070                                    CALCTFF                               #  GIVES 59M59S FOR TFF IF RPER G/
021861,000473: 23,2753           77676                           DCOMP                                          #  HPERMIN + RPADTEM.  (TPER WAS NON ZERO)
021862,000474: 23,2754           36344                           STCALL   TFF                                   #  OTHERWISE COMPUTES TFF.       (GOTO)
021863,000475: 23,2755           00051                                    S2                                    
021864,000476: 
021865,000477: 23,2756           51025        MAXCHK             DSU      BPL                                   #  IF C(MPAC) > 9999.9 NM, MPAC = 9999.9 NM
021866,000478: 23,2757           06766                                    MAXNM                                 
021867,000479: 23,2760           46763                                    +3                                    #  OTHERWISE C(MPAC) = B(MPAC).
021868,000480: 23,2761           43415                           DAD      RVQ                                   
021869,000481: 23,2762           06766                                    MAXNM                                 
021870,000482: 23,2763           43545                 +3        DLOAD    RVQ                                   #  (USED BY P30 - P37 ALSO)
021871,000483: 23,2764           06766                                    MAXNM                                 
021872,000484: 
021873,000485: 23,2765           01065 05603  MAXNM              2OCT     0106505603                            

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