Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

030181,000002:                                                                                                  ## Copyright:   Public domain.
030182,000003:                                                                                                  ## Filename:    R30.agc
030183,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
030184,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
030185,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
030186,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
030187,000008:                                                                                                  ##              that the code format has been changed to conform to the
030188,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
030189,000010:                                                                                                  ##              original YUL assembler.
030190,000011:                                                                                                  ## Reference:   pp. 714-724
030191,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030192,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
030193,000014:                                                                                                  ## Mod history: 05/24/03 RSB.   Began transcribing.
030194,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
030195,000016:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
030196,000017:                                                                                                  ##                              original harcopy, as opposed to the PDF page
030197,000018:                                                                                                  ##                              numbers in 1701.pdf.
030198,000019:                                                                                                  ##              2017-02-08 RSB  Comment-text fixes discovered while proofing Artemis 72.
030199,000020:                                                                                                  ##              2017-02-24 RSB  Proofed comment text using octopus/ProoferComments.
030200,000021:                                                                                                  ##              2017-02-28 RSB  Fixed lingering typos.
030201,000022:                                                                                                  ##              2017-03-09 RSB  Comment-text fixes noted in proofing Luminary 116.
030202,000023:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
030203,000024:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
030204,000025:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
030205,000026:                                                                                                  ##                              Luminary 99 vs Comanche 55.
030206,000027:                                                                                                  ##              2021-05-30 ABS  TICKTIFF -> TICKTFF
030207,000028: 

Page 714

030209,000030:                                                                                                  #  SUBROUTINE NAME:  V82CALL
030210,000031:                                                                                                  #  MOD NO: 0                                     DATE: 16 FEB 67
030211,000032:                                                                                                  #  MOD BY: RR BAIRNSFATHER                       LOG SECTION:  R30
030212,000033:                                                                                                  #  MOD NO: 1     MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67         SR30.1 CHANGED TO ALLOW MONITOR OPERN
030213,000034:                                                                                                  #  MOD NO: 2     MOD  BY  ALONSO                 DATE: 11 DEC 67         VB82 PROGRAM REWRITTEN
030214,000035:                                                                                                  #  MOD NO: 3     MOD  BY  ALONSO                 DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
030215,000036: 
030216,000037:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:   CALLED BY VERB 82 ENTER.  PRIORITY 10
030217,000038:                                                                                                  #  USED THROUGHOUT.              CALCULATE AND DISPLAY ORBITAL PARAMETERS
030218,000039: 
030219,000040:                                                                                                  #  1.    IF AVERAGE G IS OFF:
030220,000041:                                                                                                  #                FLASH DISPLAY V04N06.  R2 INDICATES WHICH SHIP'S STATE VECTOR IS
030221,000042:                                                                                                  #                        TO BE UPDATED.  INITIAL CHOICE IS THIS SHIP (R2=1).  ASTRONAUT
030222,000043:                                                                                                  #                        CAN CHANGE TO OTHER SHIP BY V22EXE, WHERE X NOT EQ 1.
030223,000044:                                                                                                  #                SELECTED STATE VECTOR UPDATED BY THISPREC (OTHPREC).
030224,000045:                                                                                                  #                CALLS SR30.1 (WHICH CALLS TFFCONMU + TFFRP/RA) TO CALCULATE
030225,000046:                                                                                                  #                        RPER (PERIGEE RADIUS), RAPO (APOGEE RADIUS), HPER (PERIGEE
030226,000047:                                                                                                  #                        HEIGHT ABOVE LAUNCH PAD OR LUNAR LANDING SITE), HAPO (APOGEE
030227,000048:                                                                                                  #                        HEIGHT AS ABOVE), TPER (TIME TO PERIGEE), TFF (TIME TO
030228,000049:                                                                                                  #                        INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
030229,000050:                                                                                                  #                FLASH MONITOR V16N44 (HAPO, HPER, TFF).  TFF IS -59M59S IF IT WAS
030230,000051:                                                                                                  #                        NOT COMPUTABLE, OTHERWISE IT INCREMENTS ONCE PER SECOND.
030231,000052:                                                                                                  #                        ASTRONAUT HAS OPTION TO MONITOR TPER BY KEYING IN N 32 E.
030232,000053:                                                                                                  #                        DISPLAY IS IN HMS, IS NEGATIVE (AS WAS TFF), AND INCREMENTS
030233,000054:                                                                                                  #                        ONCE PER SECOND ONLY IF TFF DISPLAY WAS -59M59S.
030234,000055:                                                                                                  #        2.      IF AVERAGE G IS ON:
030235,000056:                                                                                                  #                        CALLS SR30.1 APPROX EVERY TWO SECS.  STATE VECTOR IS ALWAYS
030236,000057:                                                                                                  #                                FOR THIS VEHICLE.  V82 DOES NOT DISTURB STATE VECTOR.  RESULTS
030237,000058:                                                                                                  #                                OF SR30.1 ARE RAPO, RPER, HAPO, HPER, TPER, TFF.
030238,000059:                                                                                                  #                        FLASH MONITOR V16N44 (HAPO, HPER, TFF).
030239,000060:                                                                                                  #        ADDENDUM:  HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
030240,000061:                                                                                                  #                ABOVE REMARKS.
030241,000062: 
030242,000063:                                                                                                  #  CALLING SEQUENCE: VERB 82 ENTER.
030243,000064: 
030244,000065:                                                                                                  #  SUBROUTINES CALLED:   SR30.1, GOXDSPF
030245,000066:                                                                                                  #                        MAYBE - THISPREC, OTHPREC, LOADTIME, DELRSPL
030246,000067: 
030247,000068:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
030248,000069: 
030249,000070:                                                                                                  #  ALARMS:  NONE
030250,000071: 
030251,000072:                                                                                                  #  OUTPUT:       HAPOX   (-29) M
030252,000073:                                                                                                  #                HPERX   (-29) M
030253,000074:                                                                                                  #                RAPO    (-29) M EARTH
030254,000075:                                                                                                  #                        (-27) M MOON
030255,000076:                                                                                                  #                RPER    (-29) M EARTH
030256,000077:                                                                                                  #                        (-27) M MOON
030257,000078:                                                                                                  #                TFF     (-28) CS        CONTAINS NEGATIVE QUANTITY
030258,000079:                                                                                                  #                -TPER   (-28) CS        CONTAINS NEGATIVE QUANTITY
030259,000080: 

Page 715

030261,000082:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  STATE VECTOR.
030262,000083: 
030263,000084:                                                                                                  #  DEBRIS:       QPRET, RONE, VONE, TFF/RTMU, HPERMIN, RPADTEM, V82EMFLG.
030264,000085:                                                                                                  #                MAYBE:  TSTART82, V82FLAGS, TDEC1.
030265,000086: 
030266,000087: 13,2347  E4,1517                                  EBANK=   HAPOX                                 
030267,000088: 31,2144                                           BANK     31                                    
030268,000089: 22,2000                                           SETLOC   R30LOC                                
030269,000090: 22,2000                                           BANK                                           
030270,000091: 22,3242                                           COUNT*   $$/R30                                
030271,000092: 
030272,000093: 22,3242           06042        V82CALL            TC       INTPRET                               
030273,000094: 22,3243           52014                           BON      GOTO                                  
030274,000095: 22,3244           03712                                    AVEGFLAG                              
030275,000096: 22,3245           45465                                    V82GON                                #  IF AVERAGE G ON
030276,000097: 22,3246           45247                                    V82GOFF                               #  IF AVERAGE G OFF
030277,000098: 
030278,000099: 22,3247           77776        V82GOFF            EXIT                                           #  ALLOW ASTRONAUT TO SELECT VEHICLE
030279,000100: 22,3250           34752                           CAF      TWO                                   #  DESIRED FOR ORBITAL PARAMETERS
030280,000101: 22,3251           55050                           TS       OPTIONX                               #  CALCULATION AND DISPLAY.
030281,000102: 22,3252           34753                           CAF      ONE                                   
030282,000103: 22,3253           55051                           TS       OPTIONX    +1                         
030283,000104: 22,3254           33316                           CAF      OPTIONVN                              #  V 04 N 06
030284,000105: 22,3255           04616                           TC       BANKCALL                              
030285,000106: 22,3256           20334                           CADR     GOXDSPF                               
030286,000107: 22,3257           05472                           TC       ENDEXT                                #  TERMINATE
030287,000108: 22,3260           03262                           TC       +2                                    #  PROCEED
030288,000109: 22,3261           03254                           TC       -5                                    #  DATA IN.  OPTION1+1 = 1 FOR THIS VEHICLE.
030289,000110:                                                                                                  #                  UNEQ 1 FOR OTHER VEHICLE.
030290,000111: 22,3262           34750                           CAF      BIT4                                  #  80 MS
030291,000112: 22,3263           05203                           TC       WAITLIST                              
030292,000113: 22,3264  E4,1540                                  EBANK=   TFF                                   
030293,000114: 22,3264           03430 44064                     2CADR    TICKTEST                              
030294,000115: 
030295,000116: 22,3266           00003                           RELINT                                         
030296,000117: 22,3267           33320        V82GOFLP           CAF      TFFBANK                               #  MAJOR RECYCLE LOOP ENTRY
030297,000118: 22,3270           54003                           TS       EBANK                                 
030298,000119: 22,3271           34755                           CAF      ZERO                                  
030299,000120: 22,3272           55537                           TS       V82FLAGS                              #  ZERO FLAGS FOR TICKTEST. INHIBITS
030300,000121:                                                                                                  #  DECREMENTING OF TFF AND -TPER.
030301,000122: 22,3273           35021                           CAF      PRIO7                                 
030302,000123: 22,3274           05105                           TC       FINDVAC                               #  V82GOFF1 WILL EXECUTE STATE VECTOR
030303,000124: 22,3275  E4,1540                                  EBANK=   TFF                                   #  UPDATE AND ORBIT CALCULATIONS FOR
030304,000125: 22,3275           03321 44064                     2CADR    V82GOFF1                              #  SELECTED VEHICLE ABOUT PROPER BODY.
030305,000126: 
030306,000127: 22,3277           00003                           RELINT                                         
030307,000128: 22,3300           36250        V82STALL           CAF      THREE                                 #  STALL IN THIS LOOP AND WITHOLD V 16 N 44

Page 716

030309,000130: 22,3301           71537                           MASK     V82FLAGS                              #  UNTIL STATE VECTOR UPDATE SETS ONE OF
030310,000131: 22,3302           10000                           CCS      A                                     #  OUR FLAG BITS.
030311,000132: 22,3303           03310                           TC       FLAGGON                               #  EXIT FROM STALL LOOP.
030312,000133: 22,3304           34777                           CAF      1SEC                                  
030313,000134: 22,3305           04616                           TC       BANKCALL                              
030314,000135: 22,3306           01736                           CADR     DELAYJOB                              
030315,000136: 22,3307           03300                           TC       V82STALL                              
030316,000137: 
030317,000138: 22,3310           33317        FLAGGON            CAF      V16N44                                #  MONITOR HAPO,HPER,TFF.
030318,000139: 22,3311           04616                           TC       BANKCALL                              
030319,000140: 22,3312           20334                           CADR     GOXDSPF                               
030320,000141: 22,3313           05563                           TC       B5OFF                                 #  TERM  THIS TELLS TICKTEST TO KILL ITSELF
030321,000142: 22,3314           05563                           TC       B5OFF                                 #  PROCEED   DITTO
030322,000143: 22,3315           03267                           TC       V82GOFLP                              #  RECYCLE   RECOMPUTE STATE VECT + DISPLAY
030323,000144: 
030324,000145: 22,3316           01014        OPTIONVN           VN       412                                   
030325,000146: 22,3317           04054        V16N44             VN       1644                                  
030326,000147: 22,3320           02140        TFFBANK            ECADR    TFF                                   
030327,000148: 
030328,000149: 22,3321           06042        V82GOFF1           TC       INTPRET                               
030329,000150: 22,3322           77634                           RTB                                            
030330,000151: 22,3323           21574                                    LOADTIME                              
030331,000152: 22,3324           00041                           STORE    TDEC1                                 #  TIME FOR STATE VECTOR UPDATE.
030332,000153: 22,3325           02205                           STORE    TSTART82                              #  TIME FOR INTERNAL USE.
030333,000154: 22,3326           77776                           EXIT                                           
030334,000155: 22,3327           41051                           CS       OPTIONX    +1                         #  1 FOR THIS VEHICLE, NOT 1 FOR OTHER.
030335,000156: 22,3330           64753                           AD       ONE                                   
030336,000157: 22,3331           00006                           EXTEND                                         
030337,000158: 22,3332           13356                           BZF      THISSHIP                              
030338,000159: 22,3333           06042        OTHSHIP            TC       INTPRET                               
030339,000160: 22,3334           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR OTHER SHIP.
030340,000161: 22,3335           27042                                    OTHPREC                               
030341,000162: 22,3336           77775        BOTHSHIP           VLOAD                                          #  MOVE RESULTS INTO TFFCONIC STORAGE AREAS
030342,000163: 22,3337           00001                                    RATT                                  #  TO BE CALLED BY SR30.1.
030343,000164: 22,3340           26207                           STOVL    RONE                                  #  RATT AT (-29)M FOR EARTH OR MOON
030344,000165: 22,3341           00007                                    VATT                                  
030345,000166: 22,3342           02215                           STORE    VONE                                  #  VATT AT (-7)M/CS FOR EARTH OR MOON
030346,000167: 22,3343           77743                           DLOAD*                                         
030347,000168: 22,3344           73774                                    1/RTMUE,2                             #  X2 IS 0 FOR EARTH CENTERED STATE VEC
030348,000169: 22,3345           00037                           STORE    TFF/RTMU                              #  X2 IS 2 FOR MOON
030349,000170: 22,3346           77743                           DLOAD*                                         #  AS LEFT BY THISPREC OR OTHPREC.
030350,000171: 22,3347           72411                                    MINPERE,2                             
030351,000172: 22,3350           02201                           STORE    HPERMIN                               #  TFFRTMU, HPERMIN AND RPADTEM ARE ALL
030352,000173: 22,3351           46135                           SLOAD    BHIZ                                  #  EARTH/MOON PARAMETERS AS SET HERE.
030353,000174: 22,3352           00050                                    X2                                    
030354,000175: 22,3353           45367                                    EARTHPAD                              
030355,000176: 22,3354           77650                           GOTO                                           
030356,000177: 22,3355           45373                                    MOONPAD                               

Page 717

030358,000179: 22,3356           06042        THISSHIP           TC       INTPRET                               
030359,000180: 22,3357           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR THIS SHIP.
030360,000181: 22,3360           27056                                    THISPREC                              
030361,000182: 22,3361           77650                           GOTO                                           
030362,000183: 22,3362           45336                                    BOTHSHIP                              
030363,000184: 
030364,000185:                                                                                                  #  THE FOLLOWING CONSTANTS ARE PAIRWISE INDEXED.  DO NOT SEPARATE PAIRS.
030365,000186: 
030366,000187: 22,3363           00001 11530  MINPERM            2DEC     10668      B-27                       #  35 KFT MIN PERIGEE HEIGHT FOR MOON(-27)M
030367,000188: 22,3365           00002 31230  MINPERE            2DEC     91440      B-29                       #  300 KFT (-29)M FOR EARTH
030368,000189: 
030369,000190: 22,3367           43145        EARTHPAD           DLOAD    CLRGO                                 #  PAD 37-B RADIUS.  SCALED AT (-29)M.
030370,000191: 22,3370           06340                                    RPAD                                  
030371,000192: 22,3371           03635                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
030372,000193: 22,3372           45377                                    BOTHPAD                               
030373,000194: 
030374,000195: 22,3373           51575        MOONPAD            VLOAD    ABVAL                                 #  COMPUTE MOON PAD RADIUS FROM RLS VECTOR.
030375,000196: 22,3374           02023                                    RLS                                   #  SCALED AT (-27)M.
030376,000197: 22,3375           77614                           SET                                            
030377,000198: 22,3376           03475                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
030378,000199: 22,3377           36203        BOTHPAD            STCALL   RPADTEM                               
030379,000200: 22,3400           45551                                    SR30.1                                #  CALCULATE ORBITAL PARAMETERS
030380,000201: 22,3401           45234                           RTB      DSU                                   
030381,000202: 22,3402           21574                                    LOADTIME                              
030382,000203: 22,3403           02205                                    TSTART82                              #  PRESENT TIME - TIME V82GOFF1 BEGAN
030383,000204: 22,3404           02205                           STORE    TSTART82                              #                 SAVE IT
030384,000205: 22,3405           53145                           DLOAD    BZE                                   #  SR30.1 SETS -TPER=0 IF HPER L/
030385,000206: 22,3406           02143                                    -TPER                                 #  HPERMIN (300 OR 35) KFT.
030386,000207: 22,3407           45420                                    TICKTFF                               #  (-TPER = 0)
030387,000208: 22,3410           43345        TICKTPER           DLOAD    DAD                                   #  (-TPER NON ZERO) TFF WAS NOT COMPUTED,
030388,000209: 22,3411           02143                                    -TPER                                 #  BUT WAS SET TO 59M59S.  DONT TICK TFF, DO
030389,000210: 22,3412           02205                                    TSTART82                              #  TICK -TPER.  DISPLAY BOTH.
030390,000211: 22,3413           02143                           STORE    -TPER                                 #  -TPER CORRECTED FOR TIME SINCE V82GOFF1
030391,000212: 22,3414           77776                           EXIT                                           #  BEGAN.
030392,000213: 22,3415           34753                           CAF      BIT1                                  
030393,000214: 22,3416           55537                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY -TPER
030394,000215: 22,3417           05155                           TC       ENDOFJOB                              
030395,000216: 
030396,000217: 22,3420           43345        TICKTFF            DLOAD    DAD                                   #  (-TPER=0) TFF WAS COMPUTED.  TICK TFF.
030397,000218: 22,3421           02141                                    TFF                                   #  DO NOT TICK -TPER.  DISPLAY TFF, BUT NOT
030398,000219: 22,3422           02205                                    TSTART82                              #  -TPER.
030399,000220: 22,3423           02141                           STORE    TFF                                   #  TFF CORRECTED FOR TIME SINCE V82GOFF1
030400,000221: 22,3424           77776                           EXIT                                           #  BEGAN.
030401,000222: 22,3425           34752                           CAF      BIT2                                  
030402,000223: 22,3426           55537                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY TFF.
030403,000224: 22,3427           05155                           TC       ENDOFJOB                              
030404,000225: 

Page 718

030406,000227: 22,3430           34747        TICKTEST           CAF      BIT5                                  #  THIS WAITLIST PROGRAM PERPETUATES ITSELF
030407,000228: 22,3431           71043                           MASK     EXTVBACT                              #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
030408,000229: 22,3432           10000                           CCS      A                                     
030409,000230: 22,3433           03441                           TC       DOTICK                                
030410,000231: 22,3434           37716                           CAF      PRIO25                                
030411,000232: 22,3435           05072                           TC       NOVAC                                 #  TERMINATE V 82.  CANT CALL ENDEXT IN RUPT.
030412,000233: 22,3436     1043                                  EBANK=   EXTVBACT                              
030413,000234: 22,3436           05472 04062                     2CADR    ENDEXT                                
030414,000235: 
030415,000236: 22,3440           05261                           TC       TASKOVER                              
030416,000237: 22,3441           34777        DOTICK             CAF      1SEC                                  #  RE-REQUEST TICKTEST.
030417,000238: 22,3442           05203                           TC       WAITLIST                              
030418,000239: 22,3443  E4,1540                                  EBANK=   TFF                                   
030419,000240: 22,3443           03430 44064                     2CADR    TICKTEST                              
030420,000241: 
030421,000242: 22,3445           36250                           CAF      THREE                                 
030422,000243: 22,3446           71537                           MASK     V82FLAGS                              
030423,000244: 22,3447           50000                           INDEX    A                                     
030424,000245: 22,3450           03451                           TC       +1                                    
030425,000246: 22,3451           05261                           TC       TASKOVER                              #  IF NO FLAGBITS SET DONT CHANGE TFF OR
030426,000247:                                                                                                  #  -TPER, BUT CONTINUE LOOP.
030427,000248: 22,3452           03460                           TC       TPERTICK                              #  ONLY BIT 1 SET.  INCR -TPER BY 1 SEC.
030428,000249: 22,3453           34777        TFFTICK            CAF      1SEC                                  #  ONLY BIT 2 SET.  INCR TFF BY 1 SEC.
030429,000250: 22,3454           54001                           TS       L                                     
030430,000251: 22,3455           34755                           CAF      ZERO                                  
030431,000252: 22,3456           21541                           DAS      TFF                                   
030432,000253: 22,3457           05261                           TC       TASKOVER                              
030433,000254: 22,3460           34777        TPERTICK           CAF      1SEC                                  
030434,000255: 22,3461           54001                           TS       L                                     
030435,000256: 22,3462           34755                           CAF      ZERO                                  
030436,000257: 22,3463           21543                           DAS      -TPER                                 
030437,000258: 22,3464           05261                           TC       TASKOVER                              
030438,000259: 

Page 719

030440,000261: 22,3465           77776        V82GON             EXIT                                           #  AVERAGE G ON.  USE CURRENT STATE VECTOR
030441,000262:                                                                                                  #  FOR ORBITAL PARAMETER CALCULATIONS.
030442,000263: 22,3466           35021                           CAF      PRIO7                                 #  LESS THAN LAMBERT
030443,000264: 22,3467           05105                           TC       FINDVAC                               #  V82GON1 WILL PERFORM ORBIT CALCULATIONS
030444,000265: 22,3470  E4,1540                                  EBANK=   TFF                                   #  ABOUT PROPER BODY APPROX ONCE PER SEC.
030445,000266: 22,3470           03503 44064                     2CADR    V82GON1                               
030446,000267: 
030447,000268: 22,3472           00003                           RELINT                                         
030448,000269: 22,3473           10067                           CCS      NEWJOB                                #  WITHOLD V16 N44 UNTIL FIRST ORBIT CALC
030449,000270: 22,3474           05122                           TC       CHANG1                                #  IS DONE.  NOTE:  V82GON1 (PRIO7, FINDVAC
030450,000271:                                                                                                  #  JOB) IS COMPLETED BEFORE V82GON (PRIO7,
030451,000272:                                                                                                  #  NOVAC JOB).
030452,000273: 22,3475           33317        V82REDSP           CAF      V16N44                                #  MONITOR HAPO, HPER, TFF
030453,000274: 22,3476           04616                           TC       BANKCALL                              
030454,000275: 22,3477           20334                           CADR     GOXDSPF                               
030455,000276: 22,3500           05563                           TC       B5OFF                                 #  TERM THIS TELLS V82GON1 TO KILL ITSELF.
030456,000277: 22,3501           05563                           TC       B5OFF                                 #  PROC DITTO.
030457,000278: 22,3502           03475                           TC       V82REDSP                              #  RECYCLE
030458,000279: 
030459,000280: 22,3503           06042        V82GON1            TC       INTPRET                               #  THIS EXEC PROGRAM PERPETUATES ITSELF
030460,000281:                                                                                                  #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
030461,000282: 22,3504           52175                           VLOAD    GOTO                                  #  HOLDS OFF CCS NEWJOB BETWEEN RN AND
030462,000283: 22,3505           01220                                    RN                                    #  VN FETCH SO RN, VN ARE FROM SAME
030463,000284: 22,3506           45507                                    NEXTLINE                              #  STATE VECTOR UPDATE.
030464,000285: 22,3507           26207        NEXTLINE           STOVL    RONE                                  #  RN AT (-29)M FOR EARTH OR MOON
030465,000286: 22,3510           01226                                    VN                                    
030466,000287: 22,3511           02215                           STORE    VONE                                  #  VN AT (-7)M/CS FOR EARTH OR MOON
030467,000288: 22,3512           52014                           BON      GOTO                                  
030468,000289: 22,3513           04304                                    MOONTHIS                              #  FLAG INDICATES BODY ABOUT WHICH ORBITAL
030469,000290: 22,3514           45516                                    MOONGON                               #  CALCULATIONS ARE TO BE PERFORMED.
030470,000291: 22,3515           45527                                    EARTHGON                              #  IF SET - MOON , IF RESET - EARTH.
030471,000292: 
030472,000293: 22,3516           71214        MOONGON            SET      DLOAD                                 
030473,000294: 22,3517           03475                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
030474,000295: 22,3520           04001                                    1/RTMUM                               #  LUNAR PARAMETERS LOADED HERE FOR SR30.1
030475,000296: 22,3521           14037                           STODL    TFF/RTMU                              
030476,000297: 22,3522           05364                                    MINPERM                               
030477,000298: 22,3523           26201                           STOVL    HPERMIN                               
030478,000299: 22,3524           02023                                    RLS                                   #  SCALED AT (-27)M.
030479,000300: 22,3525           52046                           ABVAL    GOTO                                  
030480,000301: 22,3526           45536                                    V82GON2                               
030481,000302: 22,3527           71214        EARTHGON           CLEAR    DLOAD                                 
030482,000303: 22,3530           03675                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
030483,000304: 22,3531           04003                                    1/RTMUE                               #  EARTH PARAMETERS LOADED HERE FOR SR30.1
030484,000305: 22,3532           14037                           STODL    TFF/RTMU                              
030485,000306: 22,3533           05366                                    MINPERE                               
030486,000307: 22,3534           16201                           STODL    HPERMIN                               
030487,000308: 22,3535           06340                                    RPAD                                  
030488,000309: 22,3536           36203        V82GON2            STCALL   RPADTEM                               #  COMMON CODE FOR EARTH & MOON.
030489,000310: 22,3537           45551                                    SR30.1                                

Page 720

030491,000312: 22,3540           77776                           EXIT                                           
030492,000313: 22,3541           34747        V82GON3            CAF      BIT5                                  
030493,000314: 22,3542           71043                           MASK     EXTVBACT                              #  SEE IF ASTRONAUT HAS SIGNALLED TERMINATE
030494,000315: 22,3543           00006                           EXTEND                                         
030495,000316: 22,3544           15472                           BZF      ENDEXT                                #  YES, TERMINATE VB 82 LOOP
030496,000317: 22,3545           34777                           CAF      1SEC                                  
030497,000318: 22,3546           04616                           TC       BANKCALL                              #  WAIT ONE SECOND BEFORE REPEATING
030498,000319: 22,3547           01736                           CADR     DELAYJOB                              #  ORBITAL PARAMETER COMPUTATION.
030499,000320: 22,3550           03503                           TC       V82GON1                               
030500,000321: 
030501,000322: 22,3551  22,3541               SPLRET             =        V82GON3                               
030502,000323: 

Page 721

030504,000325:                                                                                                  #  SUBROUTINE NAME: SR30.1
030505,000326:                                                                                                  #  MOD NO: 0                                                             DATE: 16 FEB 67
030506,000327:                                                                                                  #  MOD BY: RR BAIRNSFATHER                                               LOG SECTION: R32
030507,000328:                                                                                                  #  MOD NO: 1     MOD BY: RR BAIRNSFATHER DATE: 11 APR 67                 SR30.1 CHANGED TO ALLOW MONITOR OPERN
030508,000329:                                                                                                  #  MOD NO: 2     MOD BY: RR BAIRNSFATHER DATE: 14 APR 67                 ADD OVFL CK FOR RAPO
030509,000330:                                                                                                  #  MOD NO: 3     MOD BY ALONSO                   DATE: 11 DEC 67         SUBROUTINE REWRITTEN
030510,000331:                                                                                                  #  MOD NO: 4     MOD BY ALONSO                   DATE: 26 MAR 68         PROG MOD TO HANDLE DIF EARTH/MOON SCALE
030511,000332:                                                                                                  #  MOD NO: 5     MOD BY: RR BAIRNSFATHER DATE: 6 AUG 68                  OVFL CK FOR HAPO & HPER. VOIDS MOD #2.
030512,000333: 
030513,000334:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:  ORBITAL PARAMETERS DISPLAY FOR NOUNS 32 AND 44.
030514,000335:                                                                                                  #  SR30.1 CALLS TFFCONMU AND TFFRP/RA TO CALCULATE RPER (PERIGEE RADIUS),
030515,000336:                                                                                                  #  RAPO (APOGEE RADIUS), HPER (PERIGEE HEIGHT ABOVE LAUNCH PAD OR LUNAR
030516,000337:                                                                                                  #  LANDING SITE), HAPO (APOGEE HEIGHT AS ABOVE), TPER (TIME TO PERIGEE),
030517,000338:                                                                                                  #  TFF (TIME TO INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
030518,000339:                                                                                                  #  IF HPER IS GREATER THAN OR EQUAL TO HPERMIN, CALCULATES TPER AND STORES
030519,000340:                                                                                                  #  NEGATIVE   IN -TPER.  OTHERWISE STORES +0 IN -TPER.  WHENEVER TPER IS
030520,000341:                                                                                                  #  CALCULATED, TFF IS NOT COMPUTABLE AND DEFAULTS TO -59MIN 59SEC.  IF HAPO
030521,000342:                                                                                                  #  WOULD EXCEED 9999.9 NM, IT IS LIMITED TO THAT VALUE FOR DISPLAY.
030522,000343: 
030523,000344:                                                                                                  #  ADDENDUM:     HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
030524,000345:                                                                                                  #                ABOVE REMARKS.
030525,000346: 
030526,000347:                                                                                                  #  CALLING SEQUENCE:     CALL
030527,000348:                                                                                                  #                                SR30.1
030528,000349: 
030529,000350:                                                                                                  #  SUBROUTINES CALLED:   TFFCONMU, TFFRP/RA, CALCTPER, CALCTFF
030530,000351: 
030531,000352:                                                                                                  #  NORMAL EXIT MODE:     CALLING LINE +1 (STILL IN INTERPRETIVE MODE)
030532,000353: 
030533,000354:                                                                                                  #  ALARMS:       NONE
030534,000355: 
030535,000356:                                                                                                  #  OUTPUT:       RAPO    (-29) M EARTH   APOGEE RADIUS   EARTH CENTERED COORD.
030536,000357:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
030537,000358:                                                                                                  #                RPER    (-29) M EARTH   PERIGEE RADIUS  EARTH CENTERED COORD.
030538,000359:                                                                                                  #                        (-27) M MOON                    MOON CENTERED COORD.
030539,000360:                                                                                                  #                HAPOX   (-29) M         APOGEE ALTITUDE ABOVE PAD OR LAND. SITE MAX VALUE LIMITED TO 9999.9 NM.
030540,000361:                                                                                                  #                HPERX   (-29) M         PERIGEE ALT. ABOVE PAD OR LAND. SITE    MAX VALUE LIMITED TO 9999.9 NM.
030541,000362:                                                                                                  #                TFF     (-28) CS        TIME TO 300KFT OR 35KFT ALTITUDE
030542,000363:                                                                                                  #                -TPER   (-28) CS        TIME TO PERIGEE
030543,000364: 
030544,000365:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
030545,000366:                                                                                                  #        TFF/RTMU        (+17) EARTH     RECIPROCAL OF PROPER GRAV CONSTANT FOR
030546,000367:                                                                                                  #                        (+14) MOON      EARTH OR MOON = 1/SQRT(MU).
030547,000368:                                                                                                  #        RONE            (-29) M         STATE VECTOR
030548,000369:                                                                                                  #        VONE            (-7) M/CS       STATE VECTOR
030549,000370:                                                                                                  #        RPADTEM         (-29) M EARTH   RADIUS OF LAUNCH PAD OR LUNAR LANDING
030550,000371:                                                                                                  #                        (-27) M MOON    SITE.
030551,000372:                                                                                                  #        HPERMIN         (-29) M EARTH   (300 OR 35) KFT MINIMUM PERIGEE ALTITUDE
030552,000373:                                                                                                  #                        (-27) M MOON    ABOVE LAUNCH PAD OR LUNAR LANDING SITE.
030553,000374:                                                                                                  #        V82EMFLG        (INT SW BIT)    RESET FOR EARTH, SET FOR MOON.
030554,000375: 
030555,000376:                                                                                                  #  DEBRIS:       QPRET, PDL, S2
030556,000377: 

Page 722

030558,000379: 22,3551                                           COUNT*   $$/SR30S                              
030559,000380: 
030560,000381: 22,3551           44001        SR30.1             SETPD    STQ                                   #  INITIALIZE PUSHDOWN LIST.
030561,000382: 22,3552           00001                                    0                                     
030562,000383: 22,3553           00051                                    S2                                    
030563,000384:                                                                                                  #  SR30.1 INPUT: RONE AT (-29)M EARTH/MOON
030564,000385:                                                                                                  #                VONE AT (-7)M/CS
030565,000386:                                                                                                  #  TFFCONMU, TFFRP/RA, CALCTPER AND CALCTFF
030566,000387:                                                                                                  #  CALLS REQUIRE:
030567,000388:                                                                                                  #  EARTH CENTERED (NO RESCALING REQUIRED)
030568,000389:                                                                                                  #        RONE SCALED TO B-29 M
030569,000390:                                                                                                  #        VONE SCALED TO B-7 M/CS
030570,000391:                                                                                                  #  MOON CENTERED (RESCALING REQUIRED)
030571,000392:                                                                                                  #        RONE SCALED TO B-27 M
030572,000393:                                                                                                  #        VONE SCALED TO B-5 M/CS
030573,000394: 22,3554           77214                           BOFF     VLOAD                                 
030574,000395: 22,3555           03755                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
030575,000396: 22,3556           45565                                    TFFCALLS                              
030576,000397: 22,3557           02207                                    RONE                                  
030577,000398: 22,3560           77752                           VSL2                                           
030578,000399: 22,3561           26207                           STOVL    RONE                                  
030579,000400: 22,3562           02215                                    VONE                                  
030580,000401: 22,3563           77752                           VSL2                                           
030581,000402: 22,3564           02215                           STORE    VONE                                  
030582,000403: 22,3565           77624        TFFCALLS           CALL                                           
030583,000404: 22,3566           57362                                    TFFCONMU                              
030584,000405: 22,3567           77624                           CALL                                           #  TFFRP/RA COMPUTES RAPO,RPER.
030585,000406: 22,3570           57430                                    TFFRP/RA                              
030586,000407:                                                                                                  #  RETURNS WITH RAPO IN D(MPAC).
030587,000408: 22,3571           77625                           DSU                                            
030588,000409: 22,3572           02203                                    RPADTEM                               
030589,000410: 22,3573           64414                           BOFF     SR2R                                  #  NEED HAPO AT (-29)M FOR DISPLAY.
030590,000411:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
030591,000412:                                                                                                  #   IF EARTH CENTERED ALREADY AT (-29)M.
030592,000413: 22,3574           03755                                    V82EMFLG                              #   OFF FOR EARTH  , ON FOR MOON.
030593,000414: 22,3575           45576                                    +1                                    
030594,000415: 22,3576           77624                           CALL                                           #  IF HAPO > MAXNM, SET HAPO =9999.9 NM.
030595,000416: 22,3577           45636                                    MAXCHK                                #  OTHERWISE STORE (RAPO-RPADTEM) IN HAPO.
030596,000417: 22,3600           16120        STORHAPO           STODL    HAPOX                                 
030597,000418: 22,3601           00017                                    RPER                                  
030598,000419: 22,3602           77625                           DSU                                            
030599,000420: 22,3603           02203                                    RPADTEM                               #  GIVES HPER AT (-29)M EARTH, (-27)M MOON.
030600,000421: 22,3604           00161                           STORE    MPAC       +4                         #  SAVE THIS FOR COMPARISON TO HPERMIN.
030601,000422: 22,3605           64414                           BOFF     SR2R                                  #  NEED HPER AT (-29)M FOR DISPLAY.
030602,000423:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
030603,000424:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
030604,000425: 22,3606           03755                                    V82EMFLG                              #  OFF FOR EARTH, ON FOR MOON.
030605,000426: 22,3607           45610                                    +1                                    
030606,000427: 22,3610           77624                           CALL                                           #  IF HPER > MAXNM, SET HPER = 9999.9 NM.
030607,000428: 22,3611           45636                                    MAXCHK                                

Page 723

030609,000430: 22,3612           16122        STORHPER           STODL    HPERX                                 #  STORE (RPER - RPADTEM) INTO HPERX.
030610,000431: 22,3613           00161                                    MPAC       +4                         
030611,000432: 22,3614           51025                           DSU      BPL                                   #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
030612,000433: 22,3615           02201                                    HPERMIN                               #  IF HPER L/ HPERMIN (300 OR 35) KFT,
030613,000434: 22,3616           45622                                    DOTPER                                #  THEN ZERO INTO -TPER.
030614,000435: 22,3617           52145                           DLOAD    GOTO                                  #  OTHERWISE CALCULATE TPER.
030615,000436: 22,3620           06524                                    HI6ZEROS                              
030616,000437: 22,3621           45626                                    SKIPTPER                              
030617,000438: 22,3622           45145        DOTPER             DLOAD    CALL                                  
030618,000439: 22,3623           00017                                    RPER                                  
030619,000440: 22,3624           57466                                    CALCTPER                              
030620,000441: 22,3625           77676                           DCOMP                                          #  TPER IS PUT NEG INTO -TPER.
030621,000442: 22,3626           16143        SKIPTPER           STODL    -TPER                                 
030622,000443: 22,3627           02201                                    HPERMIN                               #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
030623,000444: 22,3630           45015                           DAD      CALL                                  
030624,000445: 22,3631           02203                                    RPADTEM                               #  RPADTEM AT (-29)M FOR EARTH, (-27)M MOON
030625,000446: 22,3632           57471                                    CALCTFF                               #  GIVES 59M59S FOR TFF IF RPER G/
030626,000447: 22,3633           77676                           DCOMP                                          #  HPERMIN + RPADTEM.  (TPER WAS NON ZERO)
030627,000448: 22,3634           36141                           STCALL   TFF                                   #  OTHERWISE COMPUTES TFF.       (GOTO)
030628,000449: 22,3635           00051                                    S2                                    
030629,000450: 
030630,000451: 22,3636           51025        MAXCHK             DSU      BPL                                   #  IF C(MPAC) > 9999.9 NM, MPAC = 9999.9 NM
030631,000452: 22,3637           05646                                    MAXNM                                 
030632,000453: 22,3640           45643                                    +3                                    #  OTHERWISE C(MPAC) = B(MPAC).
030633,000454: 22,3641           43415                           DAD      RVQ                                   
030634,000455: 22,3642           05646                                    MAXNM                                 
030635,000456: 22,3643           43545                 +3        DLOAD    RVQ                                   #  (USED BY P30 - P37 ALSO)
030636,000457: 22,3644           05646                                    MAXNM                                 
030637,000458: 
030638,000459: 22,3645           01065 05603  MAXNM              2OCT     0106505603                            
030639,000460: 

Page 724
Empty page.

030642,000463: 

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