Source Code

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

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

021595,000002:                                                                                                  ## Copyright:   Public domain.
021596,000003:                                                                                                  ## Filename:    R30.agc
021597,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
021598,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
021599,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
021600,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
021601,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
021602,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
021603,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
021604,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
021605,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
021606,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
021607,000014:                                                                                                  ##              reconstruction is correct.
021608,000015:                                                                                                  ## Assembler:   yaYUL
021609,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021610,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021611,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
021612,000019: 
021613,000020:                                                                                                  #  SUBROUTINE NAME:  V82CALL
021614,000021:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
021615,000022:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION:  R30
021616,000023:                                                                                                  #  MOD NO: 1     MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
021617,000024:                                                                                                  #  MOD NO: 2     MOD  BY  ALONSO                 DATE: 11 DEC 67         VB82 PROGRAM REWRITTEN
021618,000025:                                                                                                  #  MOD NO: 3     MOD  BY  ALONSO                 DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
021619,000026: 
021620,000027:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:   CALLED BY VERB 82 ENTER.  PRIORITY 10
021621,000028:                                                                                                  #  USED THROUGHOUT.              CALCULATE AND DISPLAY ORBITAL PARAMETERS
021622,000029: 
021623,000030:                                                                                                  #  1.    IF AVERAGE G IS OFF:
021624,000031:                                                                                                  #                FLASH DISPLAY V04N06.  R2 INDICATES WHICH SHIP'S STATE VECTOR IS
021625,000032:                                                                                                  #                        TO BE UPDATED.  INITIAL CHOICE IS THIS SHIP (R2=1).  ASTRONAUT
021626,000033:                                                                                                  #                        CAN CHANGE TO OTHER SHIP BY V22EXE, WHERE X NOT EQ 1.
021627,000034:                                                                                                  #                SELECTED STATE VECTOR UPDATED BY THISPREC (OTHPREC).
021628,000035:                                                                                                  #                CALLS SR30.1 (WHICH CALLS TFFCONMU + TFFRP/RA) TO CALCULATE
021629,000036:                                                                                                  #                        RPER (PERIGEE RADIUS), RAPO (APOGEE RADIUS), HPER (PERIGEE
021630,000037:                                                                                                  #                        HEIGHT ABOVE LAUNCH PAD OR LUNAR LANDING SITE), HAPO (APOGEE
021631,000038:                                                                                                  #                        HEIGHT AS ABOVE), TPER (TIME TO PERIGEE), TFF (TIME TO
021632,000039:                                                                                                  #                        INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
021633,000040:                                                                                                  #                FLASH MONITOR V16N44 (HAPO, HPER, TFF).  TFF IS -59M59S IF IT WAS
021634,000041:                                                                                                  #                        NOT COMPUTABLE, OTHERWISE IT INCREMENTS ONCE PER SECOND.
021635,000042:                                                                                                  #                        ASTRONAUT HAS OPTION TO MONITOR TPER BY KEYING IN N 32 E.
021636,000043:                                                                                                  #                        DISPLAY IS IN HMS, IS NEGATIVE (AS WAS TFF), AND INCREMENTS
021637,000044:                                                                                                  #                        ONCE PER SECOND ONLY IF TFF DISPLAY WAS -59M59S.
021638,000045:                                                                                                  #        2.      IF AVERAGE G IS ON:
021639,000046:                                                                                                  #                        CALLS SR30.1 APPROX EVERY TWO SECS.  STATE VECTOR IS ALWAYS
021640,000047:                                                                                                  #                                FOR THIS VEHICLE.  V82 DOES NOT DISTURB STATE VECTOR.  RESULTS
021641,000048:                                                                                                  #                                OF SR30.1 ARE RAPO, RPER, HAPO, HPER, TPER, TFF.
021642,000049:                                                                                                  #                        FLASH MONITOR V16N44 (HAPO, HPER, TFF).
021643,000050:                                                                                                  #                        IF MODE IS P11, THEN CALL DELRSPL SO ASTRONAUT CAN MONITOR
021644,000051:                                                                                                  #                                RESULTS BY N50E.  SPLASH COMPUTATION DONE ONCE PER TWO SECS.
021645,000052:                                                                                                  #        ADDENDUM:  HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
021646,000053:                                                                                                  #                ABOVE REMARKS.
021647,000054: 
021648,000055:                                                                                                  #  CALLING SEQUENCE: VERB 82 ENTER.
021649,000056: 
021650,000057:                                                                                                  #  SUBROUTINES CALLED:   SR30.1, GOXDSPF
021651,000058:                                                                                                  #                        MAYBE - THISPREC, OTHPREC, LOADTIME, DELRSPL
021652,000059: 
021653,000060:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
021654,000061: 
021655,000062:                                                                                                  #  ALARMS:  NONE
021656,000063: 
021657,000064:                                                                                                  #  OUTPUT:       HAPOX   (-29) M
021658,000065:                                                                                                  #                HPERX   (-29) M
021659,000066:                                                                                                  #                RAPO    (-29) M EARTH
021660,000067:                                                                                                  #                        (-27) M MOON
021661,000068:                                                                                                  #                RPER    (-29) M EARTH
021662,000069:                                                                                                  #                        (-27) M MOON
021663,000070:                                                                                                  #                TFF     (-28) CS        CONTAINS NEGATIVE QUANTITY
021664,000071:                                                                                                  #                -TPER   (-28) CS        CONTAINS NEGATIVE QUANTITY
021665,000072:                                                                                                  #                RSP-RREC(-29) M         IF DELRSPL CALLED
021666,000073: 
021667,000074:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  STATE VECTOR.
021668,000075: 
021669,000076:                                                                                                  #  DEBRIS:       QPRET, RONE, VONE, TFF/RTMU, HPERMIN, RPADTEM, V82EMFLG.
021670,000077:                                                                                                  #                MAYBE:  TSTART82, V82FLAGS, TDEC1.
021671,000078: 
021672,000079: 13,2227  E4,1751                                  EBANK=   HAPOX                                 
021673,000080: 31,2332                                           BANK     31                                    
021674,000081: 23,2000                                           SETLOC   R30LOC                                
021675,000082: 23,2000                                           BANK                                           
021676,000083: 23,2332                                           COUNT*   $$/R30                                
021677,000084: 
021678,000085: 23,2332           06006        V82CALL            TC       INTPRET                               
021679,000086: 23,2333           52014                           BON      GOTO                                  
021680,000087: 23,2334           00716                                    AVEGFLAG                              
021681,000088: 23,2335           40201                                    V82GON                                #  IF AVERAGE G ON
021682,000089: 23,2336           46337                                    V82GOFF                               #  IF AVERAGE G OFF
021683,000090: 
021684,000091: 23,2337           77776        V82GOFF            EXIT                                           #  ALLOW ASTRONAUT TO SELECT VEHICLE
021685,000092: 23,2340           35032                           CAF      TWO                                   #  DESIRED FOR ORBITAL PARAMETERS
021686,000093: 23,2341           55051                           TS       OPTIONX                               
021687,000094: 23,2342           35033                           CAF      ONE                                   
021688,000095: 23,2343           55052                           TS       OPTIONX    +1                         
021689,000096: 23,2344           32410                           CAF      OPTIONVN                              #  V 04 N 06
021690,000097: 23,2345           04676                           TC       BANKCALL                              
021691,000098: 23,2346           20561                           CADR     GOXDSPF                               
021692,000099: 23,2347           05550                           TC       ENDEXT                                #  TERMINATE
021693,000100: 23,2350           02352                           TC       +2                                    #  PROCEED
021694,000101: 23,2351           02344                           TC       -5                                    #  DATA IN.  OPTIONX +1 = 1 FOR THIS VEHIC.
021695,000102:                                                                                                  #                 UNEQ 1 FOR OTHER VEHICLE.
021696,000103: 23,2352           32412                           CAF      TFFBANK                               
021697,000104: 23,2353           54003                           TS       EBANK                                 
021698,000105: 23,2354           31052                           CA       OPTIONX    +1                         
021699,000106: 23,2355           54111                           TS       OPTION82                              
021700,000107: 
021701,000108: 23,2356           35030                           CAF      BIT4                                  #  80 MS
021702,000109: 23,2357           05261                           TC       WAITLIST                              
021703,000110: 23,2360  E4,1743                                  EBANK=   TFF                                   
021704,000111: 23,2360           02551 46064                     2CADR    TICKTEST                              
021705,000112: 
021706,000113: 23,2362           00003                           RELINT                                         
021707,000114: 23,2363           35035        V82GOFLP           CAF      ZERO                                  #  MAJOR RECYCLE LOOP ENTRY
021708,000115: 23,2364           55742                           TS       V82FLAGS                              #  ZERO FLAGS FOR TICKTEST. INHIBITS
021709,000116:                                                                                                  #  DECREMENTING OF TFF AND -TPER.
021710,000117: 23,2365           35077                           CAF      PRIO7                                 
021711,000118: 23,2366           05163                           TC       FINDVAC                               #  V82GOFF1 WILL EXECUTE STATE VECTOR
021712,000119: 23,2367  E4,1743                                  EBANK=   TFF                                   #  UPDATE AND ORBIT CALCULATIONS FOR
021713,000120: 23,2367           02413 46064                     2CADR    V82GOFF1                              #  SELECTED VEHICLE ABOUT PROPER BODY.
021714,000121: 
021715,000122: 23,2371           00003                           RELINT                                         
021716,000123: 23,2372           36214        V82STALL           CAF      THREE                                 #  STALL IN THIS LOOP AND WITHOLD V 16 N 44
021717,000124: 23,2373           71742                           MASK     V82FLAGS                              #  UNTIL STATE VECTOR UPDATE SETS ONE OF
021718,000125: 23,2374           10000                           CCS      A                                     #  OUR FLAG BITS.
021719,000126: 23,2375           02402                           TC       FLAGGON                               #  EXIT FROM STALL LOOP.
021720,000127: 23,2376           35055                           CAF      1SEC                                  
021721,000128: 23,2377           04676                           TC       BANKCALL                              
021722,000129: 23,2400           01732                           CADR     DELAYJOB                              
021723,000130: 23,2401           02372                           TC       V82STALL                              
021724,000131: 
021725,000132: 23,2402           32411        FLAGGON            CAF      V16N44                                #  MONITOR HAPO,HPER,TFF.
021726,000133: 23,2403           04676                           TC       BANKCALL                              
021727,000134: 23,2404           20561                           CADR     GOXDSPF                               
021728,000135: 23,2405           05641                           TC       B5OFF                                 #  TERM THIS TELLS TICKTEST TO KILL ITSELF
021729,000136: 23,2406           05641                           TC       B5OFF                                 #  PROCEED  DITTO
021730,000137: 23,2407           02363                           TC       V82GOFLP                              #  RECYCLE  RECOMPUTE STATE VECT + DISPLAY
021731,000138: 
021732,000139: 23,2410           01014        OPTIONVN           VN       0412                                  
021733,000140: 23,2411           04054        V16N44             VN       1644                                  
021734,000141: 23,2412           02343        TFFBANK            ECADR    TFF                                   
021735,000142: 
021736,000143: 23,2413           22007        V82GOFF1           ZL                                             
021737,000144: 23,2414           35035                           CAF      ZERO                                  
021738,000145: 23,2415           53052                           DXCH     DSPTEMX                               
021739,000146: 23,2416           32472                           CAF      V06N16X                               
021740,000147: 23,2417           04676                           TC       BANKCALL                              
021741,000148: 23,2420           20561                           CADR     GOXDSPF                               
021742,000149: 23,2421           05550                           TC       ENDEXT                                
021743,000150: 23,2422           02424                           TC       +2                                    
021744,000151: 23,2423           02416                           TC       -5                                    
021745,000152: 23,2424           06006        ISTIMEOK           TC       INTPRET                               
021746,000153: 23,2425           53145                           DLOAD    BZE                                   
021747,000154: 23,2426           01052                                    DSPTEMX                               
021748,000155: 23,2427           46467                                    GETNOW                                
021749,000156: 23,2430           00041        STRTDEC1           STORE    TDEC1                                 #  TIME FOR STATE VECTOR UPDATE.
021750,000157: 23,2431           02325                           STORE    TSTART82                              #  TIME FOR INTERNAL USE.
021751,000158: 23,2432           77776                           EXIT                                           
021752,000159: 23,2433           40111                           CS       OPTION82                              #  1 FOR THIS VEHICLE, NOT 1 FOR OTHER
021753,000160: 23,2434           65033                           AD       ONE                                   
021754,000161: 23,2435           00006                           EXTEND                                         
021755,000162: 23,2436           12462                           BZF      THISSHIP                              
021756,000163: 23,2437           06006        OTHSHIP            TC       INTPRET                               
021757,000164: 23,2440           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR OTHER SHIP.
021758,000165: 23,2441           27114                                    OTHPREC                               
021759,000166: 23,2442           77775        BOTHSHIP           VLOAD                                          #  MOVE RESULTS INTO TFFCONIC STORAGE AREAS
021760,000167: 23,2443           00001                                    RATT                                  #  TO BE CALLED BY SR30.1.
021761,000168: 23,2444           26327                           STOVL    RONE                                  #  RATT AT (-29)M FOR EARTH OR MOON
021762,000169: 23,2445           00007                                    VATT                                  
021763,000170: 23,2446           02335                           STORE    VONE                                  #  VATT AT (-7)M/CS FOR EARTH OR MOON
021764,000171: 23,2447           77743                           DLOAD*                                         
021765,000172: 23,2450           71301                                    1/RTMUE,2                             #  X2 IS 0 FOR EARTH CENTERED STATE VEC
021766,000173: 23,2451           00037                           STORE    TFF/RTMU                              #  X2 IS 2 FOR MOON
021767,000174: 23,2452           77743                           DLOAD*                                         #  AS LEFT BY THISPREC OR OTHPREC.
021768,000175: 23,2453           71275                                    MINPERE,2                             
021769,000176: 23,2454           02321                           STORE    HPERMIN                               #  TFFRTMU, HPERMIN AND RPADTEM ARE ALL
021770,000177: 23,2455           46135                           SLOAD    BHIZ                                  #  EARTH/MOON PARAMETERS AS SET HERE.
021771,000178: 23,2456           00050                                    X2                                    
021772,000179: 23,2457           46503                                    EARTHPAD                              
021773,000180: 23,2460           77650                           GOTO                                           
021774,000181: 23,2461           46507                                    MOONPAD                               
021775,000182: 23,2462           06006        THISSHIP           TC       INTPRET                               
021776,000183: 23,2463           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR THIS SHIP.
021777,000184: 23,2464           27100                                    THISPREC                              
021778,000185: 23,2465           77650                           GOTO                                           
021779,000186: 23,2466           46442                                    BOTHSHIP                              
021780,000187: 23,2467           52034        GETNOW             RTB      GOTO                                  
021781,000188: 23,2470           45510                                    LOADTIME                              
021782,000189: 23,2471           46430                                    STRTDEC1                              
021783,000190: 23,2472           01420        V06N16X            VN       0616                                  
021784,000191:                                                                                                  #  THE FOLLOWING CONSTANTS ARE PAIRWISE INDEXED.  DO NOT SEPARATE PAIRS.
021785,000192: 
021786,000193: 23,2473           27533 07571  1/RTMUM            2DEC*    .45162595  E-4        B14*            
021787,000194: 23,2475           25004 06702  1/RTMUE            2DEC*    .50087529  E-5        B17*            
021788,000195: 
021789,000196: 23,2477           00001 11530  MINPERM            2DEC     10668      B-27                       #  35 KFT MIN PERIGEE HEIGHT FOR MOON(-27)M
021790,000197: 23,2501           00002 31230  MINPERE            2DEC     91440      B-29                       #  300 KFT (-29)M FOR EARTH
021791,000198: 
021792,000199: 23,2503           43145        EARTHPAD           DLOAD    CLRGO                                 #  PAD 37-B RADIUS.  SCALED AT (-29)M.
021793,000200: 23,2504           05152                                    RPAD                                  
021794,000201: 23,2505           04622                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
021795,000202: 23,2506           46513                                    BOTHPAD                               
021796,000203: 
021797,000204: 23,2507           51575        MOONPAD            VLOAD    ABVAL                                 #  COMPUTE MOON PAD RADIUS FROM RLS VECTOR.
021798,000205: 23,2510           02026                                    RLS                                   #  SCALED AT (-27)M.
021799,000206: 23,2511           77614                           SET                                            
021800,000207: 23,2512           04462                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
021801,000208: 23,2513           36323        BOTHPAD            STCALL   RPADTEM                               
021802,000209: 23,2514           46671                                    SR30.1                                #  CALCULATE ORBITAL PARAMETERS
021803,000210: 23,2515           77776                           EXIT                                           
021804,000211: 23,2516           31011                           CA       MODREG                                #  ARE WE IN POO
021805,000212: 23,2517           00006                           EXTEND                                         
021806,000213: 23,2520           12647                           BZF      CANDEL                                #  YES, DO DELRSPL
021807,000214: 23,2521           06006        SPLRET1            TC       INTPRET                               
021808,000215: 23,2522           45234                           RTB      DSU                                   
021809,000216: 23,2523           45510                                    LOADTIME                              
021810,000217: 23,2524           02325                                    TSTART82                              #  PRESENT TIME - TIME V82GOFF1 BEGAN
021811,000218: 23,2525           02325                           STORE    TSTART82                              #                 SAVE IT
021812,000219: 23,2526           53145                           DLOAD    BZE                                   #  SR30.1 SETS -TPER=0 IF HPER L/
021813,000220: 23,2527           02346                                    -TPER                                 #  HPERMIN (300 OR 35) KFT.
021814,000221: 23,2530           46541                                    TICKTFF                               #  (-TPER = 0)
021815,000222: 23,2531           43345        TICKTPER           DLOAD    DAD                                   #  (-TPER NON ZERO) TFF WAS NOT COMPUTED,
021816,000223: 23,2532           02346                                    -TPER                                 #  BUT WAS SET TO 59M59S.  DONT TICK TFF, DO
021817,000224: 23,2533           02325                                    TSTART82                              #  TICK -TPER.  DISPLAY BOTH.
021818,000225: 23,2534           02346                           STORE    -TPER                                 #  -TPER CORRECTED FOR TIME SINCE V82GOFF1
021819,000226: 23,2535           77776                           EXIT                                           #  BEGAN.
021820,000227: 
021821,000228: 23,2536           35033                           CAF      BIT1                                  
021822,000229: 23,2537           55742                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY -TPER
021823,000230: 23,2540           05233                           TC       ENDOFJOB                              
021824,000231: 
021825,000232: 23,2541           43345        TICKTFF            DLOAD    DAD                                   #  (-TPER=0) TFF WAS COMPUTED.  TICK TFF.
021826,000233: 23,2542           02344                                    TFF                                   #  DO NOT TICK -TPER.  DISPLAY TFF, BUT NOT
021827,000234: 23,2543           02325                                    TSTART82                              #  -TPER.
021828,000235: 23,2544           02344                           STORE    TFF                                   #  TFF CORRECTED FOR TIME SINCE V82GOFF1
021829,000236: 23,2545           77776                           EXIT                                           #  BEGAN.
021830,000237: 23,2546           35032                           CAF      BIT2                                  
021831,000238: 23,2547           55742                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY TFF.
021832,000239: 23,2550           05233                           TC       ENDOFJOB                              
021833,000240: 
021834,000241: 23,2551           35027        TICKTEST           CAF      BIT5                                  #  THIS WAITLIST PROGRAM PERPETUATES ITSELF
021835,000242: 23,2552           71044                           MASK     EXTVBACT                              #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
021836,000243: 23,2553           10000                           CCS      A                                     
021837,000244: 23,2554           02562                           TC       DOTICK                                
021838,000245: 23,2555           37662                           CAF      PRIO25                                
021839,000246: 23,2556           05150                           TC       NOVAC                                 #  TERMINATE V 82.  CANT CALL ENDEXT IN RUPT.
021840,000247: 23,2557     1044                                  EBANK=   EXTVBACT                              
021841,000248: 23,2557           05550 04062                     2CADR    ENDEXT                                
021842,000249: 
021843,000250: 23,2561           05340                           TC       TASKOVER                              
021844,000251: 23,2562           35055        DOTICK             CAF      1SEC                                  #  RE-REQUEST TICKTEST.
021845,000252: 23,2563           05261                           TC       WAITLIST                              
021846,000253: 23,2564  E4,1743                                  EBANK=   TFF                                   
021847,000254: 23,2564           02551 46064                     2CADR    TICKTEST                              
021848,000255: 
021849,000256: 23,2566           36214                           CAF      THREE                                 
021850,000257: 23,2567           71742                           MASK     V82FLAGS                              
021851,000258: 23,2570           50000                           INDEX    A                                     
021852,000259: 23,2571           02572                           TC       +1                                    
021853,000260: 23,2572           05340                           TC       TASKOVER                              #  IF NO FLAGBITS SET DONT CHANGE TFF OR
021854,000261:                                                                                                  #  -TPER, BUT CONTINUE LOOP.
021855,000262: 23,2573           02601                           TC       TPERTICK                              #  ONLY BIT 1 SET.  INCR -TPER BY 1 SEC.
021856,000263: 23,2574           35055        TFFTICK            CAF      1SEC                                  #  ONLY BIT 2 SET.  INCR TFF BY 1 SEC.
021857,000264: 23,2575           54001                           TS       L                                     
021858,000265: 23,2576           35035                           CAF      ZERO                                  
021859,000266: 23,2577           21744                           DAS      TFF                                   
021860,000267: 23,2600           05340                           TC       TASKOVER                              
021861,000268: 23,2601           35055        TPERTICK           CAF      1SEC                                  
021862,000269: 23,2602           54001                           TS       L                                     
021863,000270: 23,2603           35035                           CAF      ZERO                                  
021864,000271: 23,2604           21746                           DAS      -TPER                                 
021865,000272: 23,2605           05340                           TC       TASKOVER                              
021866,000273: 
021867,000274: 20,2000                                           SETLOC   R30LOC1                               
021868,000275: 20,2000                                           BANK                                           
021869,000276: 20,2201                                           COUNT*   $$/R30                                
021870,000277: 20,2201           77776        V82GON             EXIT                                           #  AVERAGE G ON.  USE CURRENT STATE VECTOR
021871,000278:                                                                                                  #  FOR ORBITAL PARAMETER CALCULATIONS.
021872,000279: 20,2202           35077                           CAF      PRIO7                                 #  LESS THAN LAMBERT
021873,000280: 20,2203           05163                           TC       FINDVAC                               #  V82GON1 WILL PERFORM ORBIT CALCULATIONS
021874,000281: 20,2204  E4,1743                                  EBANK=   TFF                                   #  ABOUT PROPER BODY APPROX ONCE PER SEC.
021875,000282: 20,2204           02606 46064                     2CADR    V82GON1                               
021876,000283: 
021877,000284: 20,2206           00003                           RELINT                                         
021878,000285: 20,2207           10067                           CCS      NEWJOB                                #  WITHOLD V16 N44 UNTIL FIRST ORBIT CALC
021879,000286: 20,2210           05200                           TC       CHANG1                                #  IS DONE.  NOTE:  V82GON1 (PRIO7, FINDVAC
021880,000287:                                                                                                  #  JOB) IS COMPLETED BEFORE V82GON (PRIO7,
021881,000288:                                                                                                  #  NOVAC JOB).
021882,000289: 20,2211           32217        V82REDSP           CAF      V16N44X                               #  MONITOR HAPO, HPER, TFF
021883,000290: 20,2212           04676                           TC       BANKCALL                              
021884,000291: 20,2213           20561                           CADR     GOXDSPF                               
021885,000292: 20,2214           05641                           TC       B5OFF                                 #  TERM THIS TELLS V82GON1 TO KILL ITSELF.
021886,000293: 20,2215           05641                           TC       B5OFF                                 #  PROC DITTO.
021887,000294: 20,2216           02211                           TC       V82REDSP                              #  RECYCLE
021888,000295: 
021889,000296: 20,2217           04054        V16N44X            VN       1644                                  
021890,000297: 
021891,000298: 23,2000                                           SETLOC   R30LOC                                
021892,000299: 23,2000                                           BANK                                           
021893,000300: 23,2606                                           COUNT*   $$/R30                                
021894,000301: 23,2606           06006        V82GON1            TC       INTPRET                               #  THIS EXEC PROGRAM PERPETUATES ITSELF
021895,000302:                                                                                                  #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
021896,000303: 23,2607           52175                           VLOAD    GOTO                                  #  HOLDS OFF CCS NEWJOB BETWEEN RN AND
021897,000304: 23,2610           01171                                    RN                                    #  VN FETCH SO RN, VN ARE FROM SAME
021898,000305: 23,2611           46612                                    NEXTLINE                              #  STATE VECTOR UPDATE.
021899,000306: 23,2612           26327        NEXTLINE           STOVL    RONE                                  #  RN AT (-29)M FOR EARTH OR MOON
021900,000307: 23,2613           01177                                    VN                                    
021901,000308: 23,2614           02335                           STORE    VONE                                  #  VN AT (-7)M/CS FOR EARTH OR MOON
021902,000309: 23,2615           52014                           BON      GOTO                                  
021903,000310: 23,2616           00315                                    AMOONFLG                              #  FLAG INDICATES BODY ABOUT WHICH ORBITAL
021904,000311: 23,2617           46621                                    MOONGON                               #  CALCULATIONS ARE TO BE PERFORMED.
021905,000312: 23,2620           46632                                    EARTHGON                              #  IF SET - MOON, IF RESET - EARTH.
021906,000313: 
021907,000314: 23,2621           71214        MOONGON            SET      DLOAD                                 
021908,000315: 23,2622           04462                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
021909,000316: 23,2623           06474                                    1/RTMUM                               #  LUNAR PARAMETERS LOADED HERE FOR SR30.1
021910,000317: 23,2624           14037                           STODL    TFF/RTMU                              
021911,000318: 23,2625           06500                                    MINPERM                               
021912,000319: 23,2626           26321                           STOVL    HPERMIN                               
021913,000320: 23,2627           02026                                    RLS                                   #  SCALED AT (-27)M.
021914,000321: 23,2630           52046                           ABVAL    GOTO                                  
021915,000322: 23,2631           46641                                    V82GON2                               
021916,000323: 23,2632           71214        EARTHGON           CLEAR    DLOAD                                 
021917,000324: 23,2633           04662                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
021918,000325: 23,2634           06476                                    1/RTMUE                               #  EARTH PARAMETERS LOADED HERE FOR SR30.1
021919,000326: 23,2635           14037                           STODL    TFF/RTMU                              
021920,000327: 23,2636           06502                                    MINPERE                               
021921,000328: 23,2637           16321                           STODL    HPERMIN                               
021922,000329: 23,2640           05152                                    RPAD                                  
021923,000330: 23,2641           36323        V82GON2            STCALL   RPADTEM                               #  COMMON CODE FOR EARTH & MOON.
021924,000331: 23,2642           46671                                    SR30.1                                
021925,000332: 23,2643           77776                           EXIT                                           
021926,000333: 23,2644           05400                           TC       CHECKMM                               
021927,000334: 23,2645           00013                           DEC      11         B-14                       
021928,000335: 23,2646           02661                           TC       V82GON3                               #  NOT IN MODE 11.
021929,000336: 23,2647           06006        CANDEL             TC       INTPRET                               #  IN MODE 11 OR 00
021930,000337: 23,2650           77624                           CALL                                           
021931,000338: 23,2651           27446                                    INTSTALL                              #  DELRSPL DOES INTWAKE
021932,000339: 23,2652           45145                           DLOAD    CALL                                  
021933,000340: 23,2653           02344                                    TFF                                   
021934,000341: 23,2654           64017                                    DELRSPL                               #  RETURN IS TO NEXT LINE (SPLRET).
021935,000342: 23,2655           77776        SPLRET             EXIT                                           
021936,000343: 
021937,000344: 23,2656           31011                           CA       MODREG                                
021938,000345: 23,2657           00006                           EXTEND                                         
021939,000346: 23,2660           12521                           BZF      SPLRET1                               
021940,000347: 23,2661           35027        V82GON3            CAF      BIT5                                  
021941,000348: 23,2662           71044                           MASK     EXTVBACT                              #  SEE IF ASTRONAUT HAS SIGNALLED TERMINATE
021942,000349: 23,2663           00006                           EXTEND                                         
021943,000350: 23,2664           15550                           BZF      ENDEXT                                #  YES, TERMINATE VB 82 LOOP
021944,000351: 23,2665           35055                           CAF      1SEC                                  
021945,000352: 23,2666           04676                           TC       BANKCALL                              #  WAIT ONE SECOND BEFORE REPEATING
021946,000353: 23,2667           01732                           CADR     DELAYJOB                              #  ORBITAL PARAMETER COMPUTATION.
021947,000354: 23,2670           02606                           TC       V82GON1                               
021948,000355: 
021949,000356:                                                                                                  #  SUBROUTINE NAME: SR30.1
021950,000357:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
021951,000358:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION: R32
021952,000359:                                                                                                  #  MOD NO: 1     MOD BY: RR BAIRNSFATHER         DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
021953,000360:                                                                                                  #  MOD NO: 2     MOD BY: RR BAIRNSFATHER         DATE: 14 APR 67         ADD OVFL CK FOR RAPO
021954,000361:                                                                                                  #  MOD NO: 3     MOD BY ALONSO                   DATE: 11 DEC 67         SUBROUTINE REWRITTEN
021955,000362:                                                                                                  #  MOD NO: 4     MOD BY ALONSO                   DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
021956,000363:                                                                                                  #  MOD NO: 5     MOD BY: RR BAIRNSFATHER         DATE: 6 AUG 68          OVFL CK FOR HAPO & HPER. VOIDS MOD #2.
021957,000364: 
021958,000365:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:  ORBITAL PARAMETERS DISPLAY FOR NOUNS 32 AND 44.
021959,000366:                                                                                                  #  SR30.1 CALLS TFFCONMU AND TFFRP/RA TO CALCULATE RPER (PERIGEE RADIUS),
021960,000367:                                                                                                  #  RAPO (APOGEE RADIUS), HPER (PERIGEE HEIGHT ABOVE LAUNCH PAD OR LUNAR
021961,000368:                                                                                                  #  LANDING SITE), HAPO (APOGEE HEIGHT AS ABOVE), TPER (TIME TO PERIGEE),
021962,000369:                                                                                                  #  TFF (TIME TO INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
021963,000370:                                                                                                  #  IF HPER IS GREATER THAN OR EQUAL TO HPERMIN, CALCULATES TPER AND STORES
021964,000371:                                                                                                  #  NEGATIVE    IN -TPER. OTHERWISE STORES +0 IN -TPER. WHENEVER TPER IS
021965,000372:                                                                                                  #  CALCULATED, TFF IS NOT COMPUTABLE AND DEFAULTS TO -59MIN 59SEC.  IF HAPO
021966,000373:                                                                                                  #  WOULD EXCEED 9999.9 NM, IT IS LIMITED TO THAT VALUE FOR DISPLAY.
021967,000374: 
021968,000375:                                                                                                  #  ADDENDUM:     HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
021969,000376:                                                                                                  #                ABOVE REMARKS.
021970,000377: 
021971,000378:                                                                                                  #  CALLING SEQUENCE:     CALL
021972,000379:                                                                                                  #                                SR30.1
021973,000380: 
021974,000381:                                                                                                  #  SUBROUTINES CALLED:   TFFCONMU, TFFRP/RA, CALCTPER, CALCTFF
021975,000382: 
021976,000383:                                                                                                  #  NORMAL EXIT MODE:     CALLING LINE +1 (STILL IN INTERPRETIVE MODE)
021977,000384: 
021978,000385:                                                                                                  #  ALARMS:       NONE
021979,000386: 
021980,000387:                                                                                                  #  OUTPUT:       RAPO    (-29) M EARTH   APOGEE RADIUS   EARTH CENTERED COORD.
021981,000388:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
021982,000389:                                                                                                  #                RPER    (-29) M EARTH   PERIGEE RADIUS  EARTH CENTERED COORD.
021983,000390:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
021984,000391:                                                                                                  #                HAPOX   (-29) M         APOGEE ALTITUDE ABOVE PAD OR LAND. SITE MAX VALUE LIMITED TO 9999.9 NM.
021985,000392:                                                                                                  #                HPERX   (-29) M         PERIGEE ALT. ABOVE PAD OR LAND. SITE    MAX VALUE LIMITED TO 9999.9 NM.
021986,000393:                                                                                                  #                TFF     (-28) CS        TIME TO 300KFT OR 35KFT ALTITUDE
021987,000394:                                                                                                  #                -TPER   (-28) CS        TIME TO PERIGEE
021988,000395: 
021989,000396:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
021990,000397:                                                                                                  #        TFF/RTMU        (+17) EARTH     RECIPROCAL OF PROPER GRAV CONSTANT FOR
021991,000398:                                                                                                  #                        (+14) MOON      EARTH OR MOON = 1/SQRT(MU).
021992,000399:                                                                                                  #        RONE            (-29) M         STATE VECTOR
021993,000400:                                                                                                  #        VONE            (-7)  M/CS      STATE VECTOR
021994,000401:                                                                                                  #        RPADTEM         (-29) M EARTH   RADIUS OF LAUNCH PAD OR LUNAR LANDING
021995,000402:                                                                                                  #                        (-27) M MOON    SITE.
021996,000403:                                                                                                  #        HPERMIN         (-29) M EARTH   (300 OR 35) KFT MINIMUM PERIGEE ALTITUDE
021997,000404:                                                                                                  #                        (-27) M MOON    ABOVE LAUNCH PAD OR LUNAR LANDING SITE.
021998,000405:                                                                                                  #        V82EMFLG        (INT SW BIT)    RESET FOR EARTH, SET FOR MOON.
021999,000406: 
022000,000407:                                                                                                  #  DEBRIS:       QPRET, PDL, S2
022001,000408: 
022002,000409: 23,2671                                           COUNT*   $$/SR30S                              
022003,000410: 
022004,000411: 23,2671           44001        SR30.1             SETPD    STQ                                   #  INITIALIZE PUSHDOWN LIST.
022005,000412: 23,2672           00001                                    0                                     
022006,000413: 23,2673           00051                                    S2                                    
022007,000414:                                                                                                  #  SR30.1 INPUT: RONE AT (-29)M EARTH/MOON
022008,000415:                                                                                                  #                VONE AT (-7)M/CS
022009,000416:                                                                                                  #  TFFCONMU, TFFRP/RA, CALCTPER AND CALCTFF
022010,000417:                                                                                                  #  CALLS REQUIRE:
022011,000418:                                                                                                  #  EARTH CENTERED (NO RESCALING REQUIRED)
022012,000419:                                                                                                  #        RONE SCALED TO B-29 M
022013,000420:                                                                                                  #        VONE SCALED TO B-7 M/CS
022014,000421:                                                                                                  #  MOON CENTERED (RESCALING REQUIRED)
022015,000422:                                                                                                  #        RONE SCALED TO B-27 M
022016,000423:                                                                                                  #        VONE SCALED TO B-5 M/CS
022017,000424: 23,2674           77214                           BOFF     VLOAD                                 
022018,000425: 23,2675           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
022019,000426: 23,2676           46705                                    TFFCALLS                              
022020,000427: 23,2677           02327                                    RONE                                  
022021,000428: 23,2700           77752                           VSL2                                           
022022,000429: 23,2701           26327                           STOVL    RONE                                  
022023,000430: 23,2702           02335                                    VONE                                  
022024,000431: 23,2703           77752                           VSL2                                           
022025,000432: 23,2704           02335                           STORE    VONE                                  
022026,000433: 23,2705           77624        TFFCALLS           CALL                                           
022027,000434: 23,2706           56761                                    TFFCONMU                              
022028,000435: 23,2707           77624                           CALL                                           #  TFFRP/RA COMPUTES RAPO,RPER.
022029,000436: 23,2710           57027                                    TFFRP/RA                              
022030,000437:                                                                                                  #  RETURNS WITH RAPO IN D(MPAC).
022031,000438: 23,2711           77625                           DSU                                            
022032,000439: 23,2712           02323                                    RPADTEM                               
022033,000440: 23,2713           64414                           BOFF     SR2R                                  #  NEED HAPO AT (-29)M FOR DISPLAY.
022034,000441:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
022035,000442:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
022036,000443: 23,2714           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
022037,000444: 23,2715           46716                                    +1                                    
022038,000445: 23,2716           77624                           CALL                                           #  IF HAPO > MAXNM, SET HAPO =9999.9 NM.
022039,000446: 23,2717           46756                                    MAXCHK                                #  OTHERWISE STORE (RAPO-RPADTEM) IN HAPO.
022040,000447: 23,2720           16352        STORHAPO           STODL    HAPOX                                 
022041,000448: 23,2721           00017                                    RPER                                  
022042,000449: 23,2722           77625                           DSU                                            
022043,000450: 23,2723           02323                                    RPADTEM                               #  GIVES HPER AT (-29)M EARTH, (-27)M MOON.
022044,000451: 23,2724           00161                           STORE    MPAC       +4                         #  SAVE THIS FOR COMPARISON TO HPERMIN.
022045,000452: 23,2725           64414                           BOFF     SR2R                                  #  NEED HPER AT (-29)M FOR DISPLAY.
022046,000453:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
022047,000454:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
022048,000455: 23,2726           04742                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
022049,000456: 23,2727           46730                                    +1                                    
022050,000457: 23,2730           77624                           CALL                                           #  IF HPER > MAXNM, SET HPER = 9999.9 NM.
022051,000458: 23,2731           46756                                    MAXCHK                                
022052,000459: 23,2732           16354        STORHPER           STODL    HPERX                                 #  STORE (RPER - RPADTEM) INTO HPERX.
022053,000460: 23,2733           00161                                    MPAC       +4                         
022054,000461: 23,2734           51025                           DSU      BPL                                   #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
022055,000462: 23,2735           02321                                    HPERMIN                               #  IF HPER L/ HPERMIN (300 OR 35) KFT,
022056,000463: 23,2736           46742                                    DOTPER                                #  THEN ZERO INTO -TPER.
022057,000464: 23,2737           52145                           DLOAD    GOTO                                  #  OTHERWISE CALCULATE TPER.
022058,000465: 23,2740           15334                                    HI6ZEROS                              
022059,000466: 23,2741           46746                                    SKIPTPER                              
022060,000467: 23,2742           45145        DOTPER             DLOAD    CALL                                  
022061,000468: 23,2743           00017                                    RPER                                  
022062,000469: 23,2744           57065                                    CALCTPER                              
022063,000470: 23,2745           77676                           DCOMP                                          #  TPER IS PUT NEG INTO -TPER.
022064,000471: 23,2746           16346        SKIPTPER           STODL    -TPER                                 
022065,000472: 23,2747           02321                                    HPERMIN                               #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
022066,000473: 23,2750           45015                           DAD      CALL                                  
022067,000474: 23,2751           02323                                    RPADTEM                               #  RPADTEM AT (-29)M FOR EARTH, (-27)M MOON
022068,000475: 23,2752           57070                                    CALCTFF                               #  GIVES 59M59S FOR TFF IF RPER G/
022069,000476: 23,2753           77676                           DCOMP                                          #  HPERMIN + RPADTEM.  (TPER WAS NON ZERO)
022070,000477: 23,2754           36344                           STCALL   TFF                                   #  OTHERWISE COMPUTES TFF.       (GOTO)
022071,000478: 23,2755           00051                                    S2                                    
022072,000479: 
022073,000480: 23,2756           51025        MAXCHK             DSU      BPL                                   #  IF C(MPAC) > 9999.9 NM, MPAC = 9999.9 NM
022074,000481: 23,2757           06766                                    MAXNM                                 
022075,000482: 23,2760           46763                                    +3                                    #  OTHERWISE C(MPAC) = B(MPAC).
022076,000483: 23,2761           43415                           DAD      RVQ                                   
022077,000484: 23,2762           06766                                    MAXNM                                 
022078,000485: 23,2763           43545                 +3        DLOAD    RVQ                                   #  (USED BY P30 - P37 ALSO)
022079,000486: 23,2764           06766                                    MAXNM                                 
022080,000487: 
022081,000488: 23,2765           01065 05603  MAXNM              2OCT     0106505603                            

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