Source Code

These source-code files are part of a reconstructed copy of Skylark 048, the Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.

They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to.

The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction.

Since only binary dumps (rather than listings) of Skylark are available as source material, all comments and labels are approximate. They have been taken from the Programmed Guidance Equations or other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

054880,000002:                                                                                                  ## Copyright:   Public domain.
054881,000003:                                                                                                  ## Filename:    TIME_OF_FREE_FALL.agc
054882,000004:                                                                                                  ## Purpose:     A section of Skylark revision 048.
054883,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer (AGC)
054884,000006:                                                                                                  ##              for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
054885,000007:                                                                                                  ##              this software are available; instead, this file was created via
054886,000008:                                                                                                  ##              disassembly of dumps of the core rope modules actually flown on
054887,000009:                                                                                                  ##              Skylab-2. Access to these modules was provided by the New Mexico
054888,000010:                                                                                                  ##              Museum of Space History.
054889,000011:                                                                                                  ## Assembler:   yaYUL
054890,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
054891,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
054892,000014:                                                                                                  ## Mod history: 2023-09-04 MAS  Created from Artemis 072.
054893,000015: 
054894,000016: 
054895,000017:                                                                                                  #  THE TFF SUBROUTINES MAY BE USED IN EITHER EARTH OR MOON CENTERED COORDINATES. THE TFF ROUTINES NEVER
054896,000018:                                                                                                  #  KNOW WHICH ORIGIN APPLIES. IT IS THE USER WHO KNOWS, AND WHO SUPPLIES  RONE, VONE AND 1/SQRT(MU)  AT THE
054897,000019:                                                                                                  #  APPROPRIATE SCALE LEVEL FOR THE PROPER PRIMARY BODY.
054898,000020: 
054899,000021:                                                                                                  #        EARTH ORIGIN    POSITION        -29     METERS
054900,000022:                                                                                                  #                        VELOCITY        -7      METERS/CENTISECOND
054901,000023:                                                                                                  #                        1/SQRT(MU)      +17     SQRT(CS SQ/METERS CUBED)
054902,000024: 
054903,000025:                                                                                                  #        MOON ORIGIN     POSITION        -27     METERS
054904,000026:                                                                                                  #                        VELOCITY        -5      METERS/CENTISECONDS
054905,000027:                                                                                                  #                        1/SQRT(MU)      +14     SQRT(CS SQ/METERS CUBED)
054906,000028: 
054907,000029:                                                                                                  #  ALL DATA PROVIDED TO AND RECEIVED FROM ANY TFF SUBROUTINE WILL BE AT ONE OF THE LEVELS ABOVE. IN ALL CASES,
054908,000030:                                                                                                  #  THE FREE FALL TIME IS RETURNED IN CENTISECONDS AT (-28). PROGRAM TFF/CONIC WILL GENERATE VONE/RTMU AND
054909,000031:                                                                                                  #  LEAVE IT IN VONE' AT (+10) IF EARTH ORIGIN AND (+9) IF MOON ORIGIN.
054910,000032: 
054911,000033:                                                                                                  #  THE USER MUST STORE THE STATE VECTOR IN  RONE, VONE  AND MU  IN THE FORM 1/SQRT(MU) IN TFF/RTMU
054912,000034:                                                                                                  #  AT THE PROPER SCALE BEFORE CALLING TFF/CONIC. SINCE  RONE, VONE  ARE IN THE EXTENDED VERB STORAGE AREA,
054913,000035:                                                                                                  #  THE USER MUST ALSO LOCK OUT THE EXTENDED VERBS, AND RELEASE THEM WHEN FINISHED.
054914,000036: 
054915,000037:                                                                                                  #  PROGRAMS CALC/TFF AND CALC/TPER ASSUME THAT THE TERMINAL RADIUS IS LESS THAN THE PRESENT
054916,000038:                                                                                                  #  RADIUS. THIS RESTRICTION CAN BE REMOVED BY A 15 W CODING CHANGE, BUT AT PRESENT IT IS NOT DEEMED NECESSARY.
054917,000039: 
054918,000040:                                                                                                  #  THE FOLLOWING ERASABLE QUANTITIES ARE USED BY THE TFF ROUTINES, AND ARE LOCATED IN THE PUSH LIST.
054919,000041: 
054920,000042:                                                                                                  #                                        BELOW   E:  IS USED FOR EARTH ORIGIN SCALE
054921,000043:                                                                                                  #                                                M:  IS USED FOR MOON  ORIGIN SCALE
054922,000044: 
054923,000045:                                                                                                  # TFFSW          =       119D    BIT1    0 = CALCTFF             1 = CALCTPER
054924,000046: 23,3751                        TFFDELQ            =        10D                                   #        Q2-Q1                   E: (-16)  M: (-15)
054925,000047: 23,3751                        RMAG1              =        12D                                   #        ABVAL(RN)  M            E: (-29)  M: (-27)
054926,000048:                                                                                                  # RPER           =       14D             PERIGEE RADIUS  M       E: (-29)  M: (-27)
054927,000049: 23,3751                        TFFQ1              =        14D                                   #        R.V / SQRT(MUE)         E: (-16)  M: (-15)
054928,000050:                                                                                                  # SDELF/2                                SIN(THETA) /2
054929,000051: 23,3751                        CDELF/2            =        14D                                   #        COS(THETA) /2
054930,000052:                                                                                                  # RAPO           =       16D             APOGEE RADIUS  M        E: (-29)  M: (-27)
054931,000053: 23,3751                        NRTERM             =        16D                                   #        TERMINAL RADIUS M       E: (-29+NR)
054932,000054:                                                                                                  #                                M: (-27+NR)
054933,000055: 23,3751                        RTERM              =        18D                                   #        TERMINAL RADIUS  M      E: (-29)  M: (-27)
054934,000056: 23,3751                        TFFVSQ             =        20D                                   #        -(V SQUARED/MU)  1/M    E: (20)   M: (18)
054935,000057: 23,3751                        TFF1/ALF           =        22D                                   #        SEMI MAJ AXIS  M        E: (-22-2 NA)
054936,000058:                                                                                                  #                                M: (-20-2 NA)
054937,000059: 23,3751                        TFFRTALF           =        24D                                   #        SQRT(ALFA)              E: (10+NA) M: (9+NA)
054938,000060: 23,3751                        TFFALFA            =        26D                                   #        ALFA  1/M               E: (26-NR) M: (24-NR)
054939,000061: 23,3751                        TFFNP              =        28D                                   #        SEMI LATUS RECTUM  M    E: (-38+2 NR)
054940,000062:                                                                                                  #                                M: (-36+2 NR)
054941,000063: 23,3751                        TFF/RTMU           =        30D                                   #        1/SQRT(MU)              E: (17)   M: (14)
054942,000064: 23,3751                        NRMAG              =        32D                                   #        PRESENT RADIUS  M       E: (-29+NR)
054943,000065:                                                                                                  #                                M: (-27+NR)
054944,000066: 23,3751                        TFFX               =        34D                                   
054945,000067: 23,3751                        TFFTEM             =        36D                                   #        TEMPORARY
054946,000068: 
054947,000069:                                                                                                  #                REGISTERS S1, S2 ARE UNTOUCHED BY ANY TFF SUBROUTINE
054948,000070:                                                                                                  #                INDEX REGISTERS X1, X2 ARE USED BY ALL TFF SUBROUTINES. THEY ARE ESTAB-
054949,000071:                                                                                                  #                LISHED IN TFF/CONIC AND MUST BE PRESERVED BETWEEN CALLS TO SUBSEQUENT
054950,000072:                                                                                                  #                SUBROUTINES.
054951,000073:                                                                                                  #                -NR                             C(X1) = NORM COUNT OF RMAG
054952,000074:                                                                                                  #                -NA                             C(X2) = NORM COUNT OF SQRT(ABS(ALFA))
054953,000075: 
054954,000076: 
054955,000077:                                                                                                  #  SUBROUTINE NAME:      TFFCONIC                                        DATE:  01.29.67
054956,000078:                                                                                                  #  MOD NO:  0                                                            LOG SECTION:  TIME OF FREE FALL
054957,000079:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
054958,000080:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67
054959,000081:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 21 NOV 67         ADD MOON MU.
054960,000082:                                                                                                  #  MOD NO:  3    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
054961,000083: 
054962,000084:                                                                                                  #  FUNCTIONAL DESCRIPTION:       THIS SUBROUTINE IS CALLED TO COMPUTE THOSE CONIC PARAMETERS REQUIRED BY THE TFF
054963,000085:                                                                                                  #        SUBROUTINES AND TO ESTABLISH THEM IN THE PUSH LIST AREA. THE PARAMETERS ARE LISTED UNDER OUTPUT.
054964,000086:                                                                                                  #        THE EQUATIONS ARE
054965,000087:                                                                                                  #                -   -  -
054966,000088:                                                                                                  #                H = RN*VN                       ANGULAR MOMENTUM
054967,000089:                                                                                                  #                      - -
054968,000090:                                                                                                  #                LCP = H.H / MU                  SEMI LATUS RECTUM
054969,000091:                                                                                                  #                              -  -
054970,000092:                                                                                                  #                ALFA = 2/RN - VN.VN / MU        RECIPROCAL SEMI MAJ AXIS, SIGNED
054971,000093: 
054972,000094:                                                                                                  #        AND ALFA IS POS FOR ELLIPTIC ORBITS
054973,000095:                                                                                                  #                     0  FOR PARABOLIC ORBITS
054974,000096:                                                                                                  #                    NEG FOR HYPERBOLIC ORBITS.
054975,000097:                                                                                                  #        SUBROUTINE ALSO COMPUTES AND SAVES RMAG.
054976,000098: 
054977,000099:                                                                                                  #  CALLING SEQUENCE:
054978,000100:                                                                                                  #        TFFCONIC  EXPECTS CALLER TO ENTER WITH CORRECT GRAVITATIONAL CONSTANT IN MPAC, IN THE FORM
054979,000101:                                                                                                  #        1/SQRT(MU). PROGRAM WILL SAVE IN  TFF/RTMU  . THE SCALE IS DETERMINED BY WHETHER EARTH OR MOON
054980,000102:                                                                                                  #        ORIGIN IS USED. THE CALLER MUST LOCK OUT THE EXTENDED VERBS BEFORE PROVIDING STATE VECTOR IN RONE,
054981,000103:                                                                                                  #        VONE  AT PROPER SCALE. THE EXTENDED VERBS MUST BE RESTORED WHEN THE CALLER IS FINISHED USING THE
054982,000104:                                                                                                  #        TFF ROUTINES.
054983,000105: 
054984,000106:                                                                                                  #        ENTRY POINT  TFFCONMU  EXPECTS THAT  TFF/RTMU  IS ALREADY LOADED.
054985,000107: 
054986,000108:                                                                                                  #        TO SPECIFY MU:  DLOAD   CALL                    IF MU ALREADY STORED:   CALL
054987,000109:                                                                                                  #                                YOURMU          1/RTMU  E: (17)  M: (14)                TFFCONMU
054988,000110:                                                                                                  #                                TFFCONIC
054989,000111: 
054990,000112:                                                                                                  #        PUSHLOC = PDL+0, ARBITRARY IF LEQ 18D
054991,000113: 
054992,000114:                                                                                                  #  SUBROUTINES CALLED:  NONE
054993,000115: 
054994,000116:                                                                                                  #  NORMAL EXIT MODES:  RVQ
054995,000117: 
054996,000118:                                                                                                  #  ALARMS:  NONE
054997,000119: 
054998,000120:                                                                                                  #  OUTPUT:       THE FOLLOWING ARE STORED IN THE PUSH LIST AREA.
054999,000121:                                                                                                  #                RMAG1           E:(-29) M:(-27) M  RN, PRESENT RADIUS LENGTH.
055000,000122:                                                                                                  #                NRMAG           E: (-29+NR)     M  RMAG, NORMALIZED
055001,000123:                                                                                                  #                                M: (-27+NR)
055002,000124:                                                                                                  #                X1                              -NR, NORM COUNT
055003,000125:                                                                                                  #                TFFNP           E: (-38+2NR)    M  LCP, SEMI LATUS RECTUM, WEIGHTED BY NR.      FOR VGAMCALC
055004,000126:                                                                                                  #                                M: (-36+2NR)
055005,000127:                                                                                                  #                TFF/RTMU        E:(17)  M:(14)  1/SQRT(MU)
055006,000128:                                                                                                  #                TFFVSQ          E:(20)  M:(18)  1/M  -(V SQ/MU):  PRESENT VELOCITY, NORMLIZED.  FOR VGAMCALC
055007,000129:                                                                                                  #                TFFALFA         E: (26-NR)      1/M  ALFA, WEIGHTED BY NR
055008,000130:                                                                                                  #                                M: (24-NR)
055009,000131:                                                                                                  #                TFFRTALF        E: (10+NA)      SQRT(ALFA), NORMALIZED
055010,000132:                                                                                                  #                                M: (9+NA)
055011,000133:                                                                                                  #                X2                              -NA, NORM COUNT
055012,000134:                                                                                                  #                TFF1/ALF        E: (-22-2NA)    SIGNED SEMI MAJ AXIS, WEIGHTED BY NA
055013,000135:                                                                                                  #                                M: (-20-2NA)
055014,000136:                                                                                                  #                PUSHLOC AT PDL+0
055015,000137:                                                                                                  #                THE FOLLOWING IS STORED IN GENERAL ERASABLE
055016,000138:                                                                                                  #                VONE'           E:(10)  M:(9)   V/RT(MU), NORMALIZED VELOCITY
055017,000139: 
055018,000140:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
055019,000141:                                                                                                  #                RONE            E:(-29) M:(-27) M       STATE VECTOR    LEFT BY CALLER
055020,000142:                                                                                                  #                VONE            E:(-7)  M:(-5)  M/CS    STATE VECTOR    LEFT BY CALLER
055021,000143:                                                                                                  #                TFF/RTMU        E:(17)  M:(14)  1/RT(CS SQ/M CUBE)      IF ENTER VIA  TFFCONMU.
055022,000144: 
055023,000145:                                                                                                  #  DEBRIS:       QPRET,          PDL+0 ... PDL+3
055024,000146: 
055025,000147: 27,2000                                           SETLOC   TOF-FF                                
055026,000148: 27,2000                                           BANK                                           
055027,000149: 
055028,000150: 27,3055                                           COUNT*   $$/TFF                                
055029,000151: 
055030,000152: 27,3055           00037        TFFCONIC           STORE    TFF/RTMU                              #  1/SQRT(MU)            E: (17)  M: (14)
055031,000153: 
055032,000154: 27,3056           53575        TFFCONMU           VLOAD    UNIT                                  #  COME HERE WITH TFFRTMU LOADED.
055033,000155: 27,3057           02210                                    RONE                                  #  SAVED RN.  M          E: (-29)  M: (-27)
055034,000156: 27,3060           77725                           PDDL                                           #  UR/2 TO PDL+0, +5
055035,000157: 27,3061           00045                                    36D                                   #  MAGNITUDE
055036,000158: 27,3062           00015                           STORE    RMAG1                                 #  M     E: (-29)  M: (-27)
055037,000159: 
055038,000160: 27,3063           77701                           NORM                                           
055039,000161: 27,3064           00047                                    X1                                    #  -NR
055040,000162: 27,3065           24041                           STOVL    NRMAG                                 #  RMAG  M       E: (-29+NR)  M: (-27+NR)
055041,000163: 27,3066           02216                                    VONE                                  #  SAVED VN.  M/CS       E: (-7)  M: (-5)
055042,000164: 27,3067           77761                           VXSC                                           
055043,000165: 27,3070           00037                                    TFF/RTMU                              #  E: (17)  M: (14)
055044,000166: 27,3071           02226                           STORE    VONE'                                 #  VN/SQRT(MU)  E:(10)  M:(9)
055045,000167: 
055046,000168: 27,3072           47361                           VXSC     VXV                                   
055047,000169: 27,3073           00041                                    NRMAG                                 #  E: (-29+NR)  M: (-27+NR)
055048,000170:                                                                                                  #  UR/2 FROM PDL
055049,000171: 27,3074           47572                           VSL1     VSQ                                   #  BEFORE:  E:(-19+NR)  M:(-18+NR)
055050,000172: 27,3075           14035                           STODL    TFFNP                                 #  LC P  M  E:(-38+2NR)  M:(-36+2NR)
055051,000173:                                                                                                  #  SAVE ALSO FOR VGAMCALC
055052,000174: 27,3076           15174                                    TFF1/4                                
055053,000175: 27,3077           63271                           DDV      PDVL                                  #  (2/RMAG)  1/M  E:(26-NR)  M:(24-NR)
055054,000176: 27,3100           00041                                    NRMAG                                 #  RMAG  M   E:(-29+NR)  M:(-27+NR)
055055,000177: 27,3101           02226                                    VONE'                                 #  SAVED VN.   E: (10)   M: (9)
055056,000178: 27,3102           57436                           VSQ      DCOMP                                 #  KEEP MPAC+2 HONEST FOR SQRT.
055057,000179: 27,3103           00025                           STORE    TFFVSQ                                #  -(V SQ/MU)  E:(20)  M:(18)
055058,000180:                                                                                                  #  SAVE FOR VGAMCALC
055059,000181: 27,3104           43257                           SR*      DAD                                   
055060,000182: 27,3105           20573                                    0          -6,1                       #  GET -VSQ/MU  E:(26-NR)  M:(24-NR)
055061,000183: 27,3106           77626                           STADR                                          
055062,000184:                                                                                                  #  2/RMAG  FROM PDL+2
055063,000185: 27,3107           77744                           STORE    TFFALFA                               #  ALFA  1/M  E:(26-NR)  M:(24-NR)
055064,000186: 27,3110           41457                           SL*      PUSH                                  #  TEMP SAVE ALFA  E:(20)  M:(18)
055065,000187: 27,3111           20173                                    0          -6,1                       
055066,000188: 27,3112           75446                           ABS      SQRT                                  #  E:(10)  M:(9)
055067,000189: 27,3113           77701                           NORM                                           
055068,000190: 27,3114           00050                                    X2                                    #  X2 = -NA
055069,000191: 27,3115           00031                           STORE    TFFRTALF                              #  SQRT( ABS(ALFA) )  E:(10+NA)  M:(9+NA)
055070,000192: 27,3116           75316                           DSQ      SIGN                                  #  NOT SO ACCURATE, BUT OK
055071,000193:                                                                                                  #  ALFA FROM PDL+2  E:(20)  M:(18)
055072,000194: 27,3117           55254                           BZE      BDDV                                  #  SET 1/ALFA =0, TO SHOW SMALL ALFA
055073,000195: 27,3120           57122                                    +2                                    
055074,000196: 27,3121           15174                                    TFF1/4                                
055075,000197: 27,3122           00027                 +2        STORE    TFF1/ALF                              #  1/ALFA  E:(-22-2 NA)  M:(-20-2 NA)
055076,000198: 27,3123           77616        DUMPCNIC           RVQ                                            
055077,000199: 
055078,000200:                                                                                                  #                        39 W
055079,000201: 
055080,000202: 
055081,000203:                                                                                                  #  SUBROUTINE NAME:      TFFRP/RA                                        DATE: 01.17.67
055082,000204:                                                                                                  #  MOD NO:  0                                                            LOG SECTION:  TIME OF FREE FALL
055083,000205:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
055084,000206:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 11 APR 67
055085,000207:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
055086,000208:                                                                                                  #                                                                        ALSO IMPROVE ACCURACY OF RAPO.
055087,000209: 
055088,000210:                                                                                                  #  FUNCTIONAL DESCRIPTION:       USED BY CALCTPER AND TFF DISPLAYS TO CALCULATE PERIGEE RADIUS AND ALSO
055089,000211:                                                                                                  #        APOGEE RADIUS FOR A GENERAL CONIC.
055090,000212:                                                                                                  #        PROGRAM GIVES PERIGEE RADIUS AS         APOGEE RADIUS IS GIVEN BY
055091,000213:                                                                                                  #                RP = P /(1+E)                           RA = (1+E) / ALFA
055092,000214:                                                                                                  #        WHERE    2
055093,000215:                                                                                                  #                E  = 1 - P ALFA
055094,000216:                                                                                                  #        IF RA IS NEGATIVE OR SHOWS DIVIDE OVERFLOW, THEN RA = POSMAX BECAUSE
055095,000217:                                                                                                  #                1. APOGEE RADIUS IS NOT MEANINGFUL FOR HYPERBOLA
055096,000218:                                                                                                  #                2. APOGEE RADIUS IS NOT DEFINED FOR PARABOLA
055097,000219:                                                                                                  #                3. APOGEE RADIUS EXCEEDS THE SCALING FOR ELLIPSE.
055098,000220: 
055099,000221:                                                                                                  #        THIS SUBROUTINE REQUIRES THE SIGNED RECIPROCAL SEMI MAJ AXIS, ALFA, AND SEMI LATUS RECTUM AS DATA.
055100,000222: 
055101,000223:                                                                                                  #  CALLING SEQUENCE:     CALL
055102,000224:                                                                                                  #                                TFFRP/RA
055103,000225: 
055104,000226:                                                                                                  #        PUSHLOC = PDL+0, ARBITRARY IF LEQ 10D
055105,000227:                                                                                                  #        C(MPAC) UNSPECIFIED
055106,000228: 
055107,000229:                                                                                                  #  SUBROUTINES CALLED:   NONE
055108,000230: 
055109,000231:                                                                                                  #  NORMAL EXIT MODE:     RVQ
055110,000232:                                                                                                  #        IF ELLIPSE, WITHIN NORMAL SCALING, RAPO IS CORRECT.
055111,000233:                                                                                                  #        OTHERWISE, RAPO = POSMAX.
055112,000234: 
055113,000235:                                                                                                  #  ALARMS:       NONE
055114,000236: 
055115,000237:                                                                                                  #  OUTPUT:       STORED IN PUSH LIST AREA. SCALE OF OUTPUT AGREES WITH DATA SUPPLIED TO  TFF/CONIC.
055116,000238:                                                                                                  #        RPER    E:(-29)  M:(-27)        M       PERIGEE RADIUS                  DESTROYED BY CALCTFF/CALCTPER, TFFTRIG.
055117,000239:                                                                                                  #        RAPO    E:(-29)  M:(-27)        M       APOGEE RADIUS                   WILL BE DESTROYED BY CALCTFF/CALCTPER
055118,000240:                                                                                                  #        PUSHLOC AT PDL+0
055119,000241: 
055120,000242:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
055121,000243:                                                                                                  #        TFFALFA E:(26-NR)               M       1/SEMI MAJ AXIS                 LEFT BY TFFCONIC
055122,000244:                                                                                                  #                M:(24-NR)
055123,000245:                                                                                                  #        TFFNP   E:(-38+2NR)             M       LC P, SEMI LATUS RECTUM         LEFT BY TFFCONIC
055124,000246:                                                                                                  #                M:(-36+2NR)
055125,000247:                                                                                                  #        X1                              -NR, NORM COUNT OF RMAG                 LEFT BY TFFCONIC
055126,000248:                                                                                                  #        X2                              -NA, NORM COUNT OF ALFA                 LEFT BY TFFCONIC
055127,000249: 
055128,000250:                                                                                                  #  DEBRIS:       QPRET, PDL+0 ... PDL+1
055129,000251: 
055130,000252: 27,3124                        RAPO               =        16D                                   #  APOGEE RADIUS  M  E:(-29)  M:(-27)
055131,000253: 27,3124                        RPER               =        14D                                   #  PERIGEE RADIUS  M  E:(-29)  M:(-27)
055132,000254: 
055133,000255: 27,3124           41345        TFFRP/RA           DLOAD    DMP                                   
055134,000256: 27,3125           00033                                    TFFALFA                               #  ALFA  1/M     E:(26-NR)  M:(24-NR)
055135,000257: 27,3126           00035                                    TFFNP                                 #  LC P  M       E:(-38+2NR)  M:(-36+2NR)
055136,000258: 27,3127           57457                           SR*      DCOMP                                 #  ALFA P (-12+NR)
055137,000259: 27,3130           20571                                    0          -8D,1                      #  ALFA P (-4)
055138,000260: 27,3131           51415                           DAD      ABS                                   #  (DCOMP GIVES VALID TP RESULT FOR SQRT)
055139,000261:                                                                                                  #  (ABS PROTECTS SQRT IF E IS VERY NEAR 0)
055140,000262: 27,3132           17464                                    DP2(-4)                               
055141,000263: 27,3133           43366                           SQRT     DAD                                   #  E SQ = (1- P ALFA)    (-4)
055142,000264: 27,3134           15174                                    TFF1/4                                
055143,000265: 27,3135           55206                           PUSH     BDDV                                  #  (1+E)  (-2)  TO PDL+0
055144,000266: 27,3136           00035                                    TFFNP                                 #  LCP  M        E:(-38+2NR)  M:(-36+2NR)
055145,000267: 27,3137           53657                           SR*      SR*                                   #  (DOES SR THEN SL TO AVOID OVFL)
055146,000268: 27,3140           20601                                    0,1                                   #  X1=-NR
055147,000269: 27,3141           20572                                    0          -7,1                       #  (EFFECTIVE SL)
055148,000270: 27,3142           14017                           STODL    RPER                                  #  PERIGEE RADIUS  M     E:(-29)  M:(-27)
055149,000271:                                                                                                  #  (1+E)  (-2)  FROM PDL+0
055150,000272: 27,3143           41005                           DMP      BOVB                                  
055151,000273: 27,3144           00027                                    TFF1/ALF                              #  E:(-22-2NA)  M:(-20-2NA)
055152,000274: 27,3145           57450                                    TCDANZIG                              #  CLEAR OVFIND, IF ON.
055153,000275: 27,3146           53654                           BZE      SL*                                   
055154,000276: 27,3147           57156                                    MAXRA                                 #  SET POSMAX, IF ALFA=0
055155,000277: 27,3150           57603                                    0          -5,2                       #  -5+NA
055156,000278: 27,3151           40057                           SL*      BOV                                   
055157,000279: 27,3152           57576                                    0,2                                   
055158,000280: 27,3153           57156                                    MAXRA                                 #  SET POSMAX IF OVFL.
055159,000281: 27,3154           77644                           BPL                                            #  CONTINUE WITH VALID RAPO.
055160,000282: 27,3155           57160                                    +3                                    
055161,000283: 27,3156           77745        MAXRA              DLOAD                                          #  RAPO CALC IS NOT VALID. SET RAPO =
055162,000284: 27,3157           15212                                    NEARONE                               #  POSMAX AS A TAG.
055163,000285: 27,3160           00021                 +3        STORE    RAPO                                  #  APOGEE RADIUS  M  E:(-29)  M:(-27)
055164,000286: 27,3161           77616        DUMPRPRA           RVQ                                            
055165,000287: 
055166,000288:                                                                                                  #                        30 W
055167,000289: 
055168,000290: 
055169,000291:                                                                                                  #  SUBROUTINE NAME:      CALCTPER / CALCTFF                              DATE:  01.29.67
055170,000292:                                                                                                  #  MOD NO:  0                                                            LOG SECTION:  TIME OF FREE FALL
055171,000293:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
055172,000294:                                                                                                  #  MOD NO:  1    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 67
055173,000295:                                                                                                  #  MOD NO:  2    MOD BY:  RR BAIRNSFATHER        DATE: 14 APR 67
055174,000296:                                                                                                  #  MOD NO:  3    MOD BY:  RR BAIRNSFATHER        DATE: 8 JUL 67          NEAR EARTH MUE AND NEG TFF (GONEPAST)
055175,000297:                                                                                                  #  MOD NO:  4    MOD BY:  RR BAIRNSFATHER        DATE: 21 NOV 67         ADD VARIABLE MU.
055176,000298:                                                                                                  #  MOD NO:  5    MOD BY:  RR BAIRNSFATHER        DATE: 21 MAR 68         ACCEPT DIFFERENT EARTH/MOON SCALES
055177,000299: 
055178,000300:                                                                                                  #  FUNCTIONAL DESCRIPTION:       PROGRAM CALCULATES THE FREE-FALL TIME OF FLIGHT FROM PRESENT POSITION  RN  AND
055179,000301:                                                                                                  #        VELOCITY  VN  TO A RADIUS LENGTH SPECIFIED BY  RTERM  , SUPPLIED BY THE USER. THE POSITION VECTOR
055180,000302:                                                                                                  #        RN  MAY BE ON EITHER SIDE OF THE CONIC, BUT  RTERM  IS CONSIDERED ON THE INBOUND SIDE.
055181,000303:                                                                                                  #        THE EQUATIONS ARE
055182,000304: 
055183,000305:                                                                                                  #                Q2 = -SQRT(RTERM (2-RTERM ALFA) - LCP)  (INBOUND SIDE)) LEQ +- LCE/SQRT(ALFA)
055184,000306:                                                                                                  #                     -  -
055185,000307:                                                                                                  #                Q1 = RN.VN / SQRT(MU)                                   LEQ +- LCE/SQRT(ALFA)
055186,000308: 
055187,000309:                                                                                                  #                Z = NUM / DEN                                           LEQ +- 1/SQRT(ALFA)
055188,000310: 
055189,000311:                                                                                                  #        WHERE, IF INBOUND
055190,000312:                                                                                                  #                NUM = RTERM - RN                                        LEQ +- 2 LCE/ALFA
055191,000313:                                                                                                  #                DEN = Q2+Q1                                             LEQ +- 2 LCE/SQRT(ALFA)
055192,000314: 
055193,000315:                                                                                                  #        AND, IF OUTBOUND
055194,000316:                                                                                                  #                NUM = Q2-Q1                                             LEQ +- 2 LCE/SQRT(ALFA)
055195,000317:                                                                                                  #                DEN = 2 - ALFA (RTERM + RN) .                           LEQ +- 2 LCE
055196,000318: 
055197,000319:                                                                                                  #        IF      ALFA ZZ < 1.0           (FOR ALL CONICS EXCEPT ELLIPSES HAVING ABS(DEL ECC ANOM) G 90 DEG)
055198,000320: 
055199,000321:                                                                                                  #        THEN    X = ALFA Z Z
055200,000322:                                                                                                  #        AND     TFF = (RTERM +RN -2 ZZ T(X) ) Z/SQRT(MU)
055201,000323: 
055202,000324:                                                                                                  #                EXCEPT  IF ALFA PNZ, AND IF TFF NEG,
055203,000325:                                                                                                  #                THEN    TFF = 2 PI /(ALFA SQRT(ALFA)) + TFF
055204,000326: 
055205,000327:                                                                                                  #        OR      IF ALFA ZZ GEQ 1.0      (FOR ELLIPSES HAVING ABS(DEL ECC ANOM) GEQ 90 DEG)
055206,000328: 
055207,000329:                                                                                                  #        THEN    X = 1/ALFA Z Z
055208,000330:                                                                                                  #        AND     TFF = (PI/SQRT(ALFA) -Q2 +Q1 +2(X T(X) -1) /ALFA Z) /ALFA SQRT(MU)
055209,000331: 
055210,000332:                                                                                                  #        WHERE   T(X) IS A POLYNOMIAL APPROXIMATION TO THE SERIES
055211,000333:                                                                                                  #                             2      3             2
055212,000334:                                                                                                  #                1/3 - X/5 + X /7 - X /9 ...     (X  < 1.0)
055213,000335: 
055214,000336:                                                                                                  #  CALLING SEQUENCE:     TIME TO RTERM                   TIME TO PERIGEE
055215,000337:                                                                                                  #                        CALL                            CALL
055216,000338:                                                                                                  #                                CALCTFF                         CALCTPER
055217,000339:                                                                                                  #                        C(MPAC) = TERMNL RAD M          C(MPAC) = PERIGEE RAD M
055218,000340:                                                                                                  #        FOR EITHER, E: (-29)    M: (-27)
055219,000341:                                                                                                  #        FOR EITHER, PUSHLOC = PDL+0 , ARBITRARY IF LEQ 8D.
055220,000342: 
055221,000343:                                                                                                  #  SUBROUTINES CALLED:   T(X), VIA RTB
055222,000344: 
055223,000345:                                                                                                  #  NORMAL EXIT MODE:     RVQ
055224,000346:                                                                                                  #        HOWEVER, PROGRAM EXITS WITH ONE OF THE FOLLOWING VALUES FOR TFF (-28) CS IN MPAC. USER MUST STORE.
055225,000347:                                                                                                  #                A. TFF = FLIGHT TIME. NORMAL CASE FOR POSITIVE FLIGHT TIME LESS THAN ONE ORBITAL PERIOD.
055226,000348:                                                                                                  #                B. (THIS OPTION IS NO LONGER USED.)
055227,000349:                                                                                                  #                C. TFF = POSMAX.  THIS INDICATES THAT THE CONIC FROM THE PRESENT POSITION WILL NOT RETURN TO
055228,000350:                                                                                                  #                   THE SPECIFIED ALTITUDE.  ALSO INDICATES OUTBOUND PARABOLA OR HYPERBOLA.
055229,000351: 
055230,000352:                                                                                                  #  OUTPUT:       C(MPAC)         (-28) CS        TIME OF FLIGHT, OR TIME TO PERIGEE
055231,000353:                                                                                                  #                TFFX            (0)             X,                                      LEFT FOR ENTRY DISPLAY TFF ROUTINES
055232,000354:                                                                                                  #                NRTERM          E: (-29+NR)     M  RTERM, WEIGHTED BY NR                LEFT FOR ENTRY DISPLAY TFF ROUTINES
055233,000355:                                                                                                  #                                M: (-27+NR)
055234,000356:                                                                                                  #                TFFTEM          E: (-59+2NR)    LCP Z Z SGN(SDELF)                      LEFT FOR ENTRY DISPLAY TFF ROUTINES
055235,000357:                                                                                                  #                                M: (-55+2NR)    LCP /ALFA SGN(SDELF)                    LEFT FOR ENTRY DISPLAY TFF ROUTINES
055236,000358:                                                                                                  #                NOTE:   TFFTEM = PDL 36D AND WILL BE DESTROYED BY .:UNIT:.
055237,000359:                                                                                                  #                RMAG1           E:(-29) M:(-27) PDL 12 NOT TOUCHED.
055238,000360:                                                                                                  #                TFFQ1           E:(-16) M:(-15) PDL 14D
055239,000361:                                                                                                  #                TFFDELQ         E:(-16) M:(-15) PDL 10D
055240,000362:                                                                                                  #                PUSHLOC AT PDL+0
055241,000363: 
055242,000364:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
055243,000365:                                                                                                  #                RONE            E:(-29) M:(-27) M  STATE VECTOR                         LEFT BY USER
055244,000366:                                                                                                  #                VONE'           E:(+10) M:(+9)  VN/SQRT(MU)                             LEFT BY TFF/CONIC
055245,000367:                                                                                                  #                RMAG1           E:(-29) M:(-27) PRESENT RADIUS, M                       LEFT BY TFFCONIC
055246,000368:                                                                                                  #                C(MPAC)         E:(-29) M:(-27) RTERM, TERMINAL RADIUS LENGTH, M        LEFT BY USER
055247,000369: 
055248,000370:                                                                                                  #                THE FOLLOWING ARE STORED IN THE PUSH LIST AREA.
055249,000371:                                                                                                  #                TFF/RTMU        E:(17) M:(14)   1/SQRT(MU)                              LEFT BY TFFCONIC.
055250,000372:                                                                                                  #                NRMAG           E: (-29+NR)     M  RMAG, NORMALIZED                     LEFT BY TFFCONIC
055251,000373:                                                                                                  #                                M: (-27+NR)
055252,000374:                                                                                                  #                X1                              -NR, NORM COUNT                         LEFT BY TFFCONIC
055253,000375:                                                                                                  #                TFFNP           E: (-38+2NR)    M  LCP, SEMI LATUS RECTUM, WEIGHT NR    LEFT BY TFFCONIC
055254,000376:                                                                                                  #                                M: (-36+2NR)
055255,000377:                                                                                                  #                TFFALFA         E: (26-NR)      1/M  ALFA, WEIGHT NR                    LEFT BY TFFCONIC
055256,000378:                                                                                                  #                                M: (24-NR)
055257,000379:                                                                                                  #                TFFRTALF        E:(10+NA)       SQRT(ALFA), NORMALIZED                  LEFT BY TFFCONIC
055258,000380:                                                                                                  #                                M:(9+NA)
055259,000381:                                                                                                  #                X2                              -NA, NORM COUNT                         LEFT BY TFFCONIC
055260,000382:                                                                                                  #                TFF1/ALF        E: (-22-2NA)    SIGNED SEMIMAJ AXIS, WEIGHTED BY NA     LEFT BY TFFCONIC
055261,000383:                                                                                                  #                                M: (-20-2NA)
055262,000384: 
055263,000385:                                                                                                  #  DEBRIS:       QPRET, PDL+0 ... PDL+3
055264,000386:                                                                                                  #                RTERM           E:(-29) M:(-27) RTERM, TERMINAL RADIUS LENGTH
055265,000387:                                                                                                  #                RAPO            E:(-29) M:(-27) PDL 16D (=NRTERM)
055266,000388:                                                                                                  #                RPER            E:(-29) M:(-27) PDL 14D (=TFFQ1)
055267,000389: 
055268,000390: 27,3162           77614        CALCTPER           SETGO                                          #  ENTER WITH RPER IN MPAC
055269,000391: 27,3163           03436                                    TFFSW                                 
055270,000392: 27,3164           57167                                    +3                                    
055271,000393: 27,3165           77614        CALCTFF            CLEAR                                          #  ENTER WITH RTERM IN MPAC
055272,000394: 27,3166           03676                                    TFFSW                                 
055273,000395: 27,3167           00023                 +3        STORE    RTERM                                 #  E: (-29)  M: (-27)
055274,000396: 27,3170           77657                           SL*                                            
055275,000397: 27,3171           20201                                    0,1                                   #  X1=-NR
055276,000398: 27,3172           00021                           STORE    NRTERM                                #  RTERM  E: (-29+NR)  M: (-27+NR)
055277,000399: 27,3173           44205                           DMP      BDSU                                  
055278,000400: 27,3174           00033                                    TFFALFA                               #  ALFA  E: (26-NR)  M: (24-NR)
055279,000401: 27,3175           15174                                    TFF1/4                                
055280,000402: 27,3176           41206                           PUSH     DMP                                   #  (2-ALFA RTERM)  (-3)  TO PDL+0
055281,000403: 27,3177           00021                                    NRTERM                                #  E: (-29+NR)  M: (-27+NR)
055282,000404: 27,3200           53725                           PDDL     SR*                                   #  RTERM(2-ALFA RTERM) TO PDL+2
055283,000405:                                                                                                  #  E: (-32+NR)  M: (-30+NR)
055284,000406: 27,3201           00035                                    TFFNP                                 #  LC P  E:(-38+2NR)  M:(-36+2NR)
055285,000407: 27,3202           20573                                    0          -6,1                       #  X1 = -NR
055286,000408: 27,3203           43276                           DCOMP    DAD                                   #  DUE TO SHIFTS, KEEP PRECISION FOR SQRT
055287,000409:                                                                                                  #  RTERM(2-ALFA RTERM) FROM PDL +2
055288,000410:                                                                                                  #  E: (-32+NR)  M: (-30+NR)
055289,000411: 27,3204           77657                           SR*                                            #  LEAVE  E: (-32)  M: (-30)
055290,000412: 27,3205           20601                                    0,1                                   #  X1 = -NR
055291,000413: 27,3206           71214                           BOFF     DLOAD                                 #  CHECK TFF /TPER SWITCH
055292,000414: 27,3207           03756                                    TFFSW                                 
055293,000415: 27,3210           57212                                    +2                                    #  IF TFF, CONTINUE
055294,000416: 27,3211           15204                                    TFFZEROS                              #  IF TPER, SET Q2 = 0
055295,000417: 27,3212           75440                 +2        BMN      SQRT                                  #  E: (-16)  M: (-15)
055296,000418: 
055297,000419: 27,3213           57345                                    MAXTFF1                               #  NO FREE FALL CONIC TO RTERM FROM HERE
055298,000420:                                                                                                  #  RESET PDL, SET TFF=POSMAX, AND EXIT.
055299,000421: 
055300,000422: 27,3214           41076                           DCOMP    BOVB                                  #  RT IS ON INBOUND SIDE.  ASSURE OVFIND=0
055301,000423: 27,3215           57450                                    TCDANZIG                              #  ANY PORT IN A STORM.
055302,000424: 27,3216           24045                           STOVL    TFFTEM                                #  Q2  E: (-16)  M: (-15)
055303,000425: 27,3217           02226                                    VONE'                                 #  VN/SQRT(MU)  E: (10)  M: (9)
055304,000426: 27,3220           52441                           DOT      SL3                                   
055305,000427: 27,3221           02210                                    RONE                                  #  SAVED RN.  E: (-29)  M: (-27)
055306,000428: 27,3222           00017                           STORE    TFFQ1                                 #  Q1, SAVE FOR GONEPAST TEST.
055307,000429:                                                                                                  #  E: (-16)  M: (-15)
055308,000430: 27,3223           44240                           BMN      BDSU                                  
055309,000431: 27,3224           57245                                    INBOUND                               #  USE ALTERNATE Z
055310,000432: 27,3225           00045                                    TFFTEM                                #  Q2  E: (-16)  M: (-15)
055311,000433: 
055312,000434:                                                                                                  #  OUTBOUND Z CALC CONTINUES HERE
055313,000435: 
055314,000436: 27,3226           14043                           STODL    TFFX                                  #  NUM=Q2-Q1  E: (-16)  M: (-15)
055315,000437: 27,3227           00033                                    TFFALFA                               #  ALFA  E: (26-NR)  M: (24-NR)
055316,000438: 27,3230           44205                           DMP      BDSU                                  
055317,000439: 27,3231           00041                                    NRMAG                                 #  RMAG  E: (-29+NR) M: (-27+NR)
055318,000440:                                                                                                  #  (2-RTERM ALFA)  (-3) FROM PDL+0
055319,000441: 27,3232           51406        SAVEDEN            PUSH     ABS                                   #  DEN TO PDL+0  E: (-3) OR (-16)
055320,000442:                                                                                                  #                M: (-3) OR (-15)
055321,000443: 27,3233           40015                           DAD      BOV                                   #  INDETERMINANCY TEST
055322,000444: 27,3234           17456                                    LIM(-22)                              #  =1.0-B(-22)
055323,000445: 27,3235           57256                                    TFFXTEST                              #  GO IF DEN >/= B(-22)
055324,000446: 27,3236           65345                           DLOAD    PDDL                                  #  SET DEN=0 OTHERWISE
055325,000447: 27,3237           15204                                    TFFZEROS                              
055326,000448:                                                                                                  #  XCH ZERO WITH PDL+0
055327,000449: 27,3240           57545                           DLOAD    DCOMP                                 
055328,000450: 27,3241           00033                                    TFFALFA                               #  ALFA  E: (26-NR)  M: (24-NR)
055329,000451: 27,3242           71240                           BMN      DLOAD                                 #  FOR TPER:  Z INDET AT DELE/2=0 AND 90.
055330,000452: 27,3243           57352                                    TFFEL1                                #  ASSUME 90, AND LEAVE 0 IN PDL: 1/Z=D/N
055331,000453: 
055332,000454:                                                                                                  #  Z INDET. AT PERIGEE FOR PARAB OR HYPERB.
055333,000455: 27,3244           77616        DUMPTFF1           RVQ                                            #  RETURN TFF =0
055334,000456: 
055335,000457:                                                                                                  #  INBOUND Z CALC CONTINUES HERE
055336,000458: 27,3245           77745        INBOUND            DLOAD                                          #  RESET PDL+0
055337,000459: 27,3246           45345                           DLOAD    DSU                                   #  ALTERNATE Z CALC
055338,000460: 27,3247           00023                                    RTERM                                 #  E: (-29)  M: (-27)
055339,000461: 27,3250           00015                                    RMAG1                                 #  E: (-29)  M: (-27)
055340,000462: 27,3251           14043                           STODL    TFFX                                  #  NUM=RTERM-RN  E: (-29)  M: (-27)
055341,000463: 27,3252           00045                                    TFFTEM                                #  Q2  E: (-16)  M: (-15)
055342,000464: 27,3253           52015                           DAD      GOTO                                  
055343,000465: 27,3254           00017                                    TFFQ1                                 #  Q1  E: (-16)  M:(-15)
055344,000466: 27,3255           57232                                    SAVEDEN                               #  DEN = Q2+Q1  E: (-16)  M: (-15)
055345,000467: 
055346,000468: 27,3256           65215        TFFXTEST           DAD      PDDL                                  #   (ABS(DEN) TO PDL+2)) E: (-3) OR (-16)
055347,000469:                                                                                                  #                        M: (-3) OR (-15)
055348,000470: 27,3257           17460                                    DP(-22)                               #  RESTORE ABS(DEN) TO MPAC
055349,000471: 27,3260           00043                                    TFFX                                  #  NUM  E:(-16) OR (-29)  M:(-15) OR (-27)
055350,000472: 27,3261           53605                           DMP      SR*                                   
055351,000473: 27,3262           00031                                    TFFRTALF                              #  SQRT(ALFA)  E: (10+NA)  M: (9+NA)
055352,000474: 27,3263           57201                                    0          -3,2                       #  X2=-NA
055353,000475: 27,3264           77671                           DDV                                            #  C(MPAC) =NUM SQRT(ALFA)       E:(-3) OR (-16)
055354,000476:                                                                                                  #                                M:(-3) OR (-15)
055355,000477:                                                                                                  #  ABS(DEN) FROM PDL+2   E:(-3) OR (-16)
055356,000478:                                                                                                  #                        M:(-3) OR (-15)
055357,000479: 27,3265           40145                           DLOAD    BOV                                   #  (THE DLOAD IS SHARED WITH TFFELL)
055358,000480: 27,3266           00043                                    TFFX                                  #  NUM  E: (-16) OR (-29)  M:(-15) OR (-27)
055359,000481: 27,3267           57350                                    TFFELL                                #  USE EQN FOR DELE GEQ 90, LEQ -90
055360,000482: 
055361,000483:                                                                                                  #  OTHERWISE, CONTINUE FOR GENERAL CONIC FOR TFF EQN
055362,000484: 
055363,000485: 27,3270           45471                           DDV      STADR                                 
055364,000486:                                                                                                  #  DEN FROM PDL+0        E: (-3) OR (-16)
055365,000487:                                                                                                  #                        M: (-3) OR (-15)
055366,000488: 27,3271           77732                           STORE    TFFTEM                                #  Z  SAVE FOR SIGN OF SDELF.
055367,000489:                                                                                                  #  E: (-13)  M: (-12)
055368,000490: 27,3272           63406                           PUSH     DSQ                                   #  Z TO PDL+0
055369,000491: 27,3273           41206                           PUSH     DMP                                   #  Z SQ TO PDL+2  E: (-26)  M: (-24)
055370,000492: 27,3274           00035                                    TFFNP                                 #  LC P  E: (-38+2NR)  M: (-36+2NR)
055371,000493: 27,3275           75261                           SL       SIGN                                  
055372,000494: 27,3276           20206                                    5                                     
055373,000495: 27,3277           00045                                    TFFTEM                                #  AFFIX SIGN FOR SDELF (ENTRY DISPLAY)
055374,000496: 27,3300           14045                           STODL    TFFTEM                                #  P ZSQ  E: (-59+2NR)  M: (-55+2NR)
055375,000497:                                                                                                  #  (ARG IS USED IN TFF/TRIG)
055376,000498:                                                                                                  #  ZSQ FROM PDL+2  E: (-26)  M: (-24)
055377,000499: 27,3301           41206                           PUSH     DMP                                   #  RESTORE PUSH LOC
055378,000500: 27,3302           00033                                    TFFALFA                               #  ALFA  E: (26-NR)  M: (24-NR)
055379,000501: 27,3303           77657                           SL*                                            
055380,000502: 27,3304           20201                                    0,1                                   #  X1=-NR
055381,000503: 27,3305           00043                           STORE    TFFX                                  #  X
055382,000504: 27,3306           41234                           RTB      DMP                                   
055383,000505: 27,3307           57432                                    T(X)                                  #   POLY
055384,000506:                                                                                                  #  ZSQ FROM PDL+2  E: (-26)  M: (-24)
055385,000507: 27,3310           44302                           SR2      BDSU                                  #  2 ZSQ T(X)  E: (-29)  M: (-27)
055386,000508: 27,3311           00023                                    RTERM                                 #  RTERM  E: (-29)  M: (-27)
055387,000509: 27,3312           41215                           DAD      DMP                                   
055388,000510: 27,3313           00015                                    RMAG1                                 #  E: (-29)  M: (-27)
055389,000511:                                                                                                  #  Z FROM PDL+0  E: (-13)  M: (-12)
055390,000512: 27,3314           51042                           SR3      BPL                                   #  TFF SQRT(MU)  E: (-45)  M: (-42)
055391,000513: 27,3315           57336                                    ENDTFF                                #  (NO PUSH UP)
055392,000514: 27,3316           75206                           PUSH     SIGN                                  #  TFF SQRT(MU)  TO PDL+0
055393,000515: 27,3317           00017                                    TFFQ1                                 #  Q1 FOR GONEPAST TEST
055394,000516: 27,3320           71244                           BPL      DLOAD                                 #  GONE PAST ?
055395,000517: 27,3321           57342                                    NEGTFF                                #  YES. TFF < 0.
055396,000518: 27,3322           00027                                    TFF1/ALF                              #  1/ALFA  E: (-22-2NA)  M: (-20-2NA)
055397,000519: 27,3323           51076                           DCOMP    BPL                                   #  ALFA > 0 ?
055398,000520: 27,3324           57342                                    NEGTFF                                #  NO. TFF IS NEGATIVE.
055399,000521: 
055400,000522:                                                                                                  #  CORRECT FOR ORBITAL PERIOD.
055401,000523: 
055402,000524: 27,3325           77676                           DCOMP                                          #  YES.  CORRECT FOR ORB PERIOD.
055403,000525: 27,3326           56205                           DMP      DDV                                   
055404,000526: 27,3327           17454                                    PI/16                                 #  2 PI (-5)
055405,000527: 27,3330           00031                                    TFFRTALF                              #  SQRT(ALFA)  E: (10+NA)  M: (9+NA)
055406,000528: 27,3331           53657                           SL*      SL*                                   
055407,000529: 27,3332           57602                                    0          -4,2                       #  X2=-NA
055408,000530: 27,3333           57602                                    0          -4,2                       
055409,000531: 27,3334           43257                           SL*      DAD                                   
055410,000532: 27,3335           57576                                    0,2                                   
055411,000533:                                                                                                  #  TFF SQRT(MU) FROM PDL+0       E:(-45) M:(-42)
055412,000534: 27,3336           40005        ENDTFF             DMP      BOV                                   #  TFF SQRT(MU) IN MPAC          E:(-45) M:(-42)
055413,000535: 27,3337           00037                                    TFF/RTMU                              #  E: (17)  M: (14)
055414,000536: 27,3340           57346                                    MAXTFF                                #  SET POSMAX IF OVFL.
055415,000537: 
055416,000538: 27,3341           77616        DUMPTFF2           RVQ                                            #  RETURN TFF    (-28) CS IN MPAC.
055417,000539: 
055418,000540: 27,3342           77745        NEGTFF             DLOAD                                          
055419,000541:                                                                                                  #  TFF SQRT(MU) FROM PDL+0, NEGATIVE.
055420,000542: 27,3343           77650                           GOTO                                           
055421,000543: 27,3344           57336                                    ENDTFF                                
055422,000544: 
055423,000545: 27,3345           77745        MAXTFF1            DLOAD                                          #  RESET PDL
055424,000546: 27,3346           43545        MAXTFF             DLOAD    RVQ                                   
055425,000547: 27,3347           15212                                    NEARONE                               
055426,000548: 
055427,000549:                                                                                                  #  TIME OF FLIGHT ELLIPSE WHEN DEL (ECCENTRIC ANOM) GEQ 90 AND LEQ -90.
055428,000550: 
055429,000551:                                                                                                  #  NUM FROM TFFX.        E: (-16) OR (-29)
055430,000552:                                                                                                  #                        M: (-15) OR (-27)
055431,000553: 27,3350           77712        TFFELL             SL2                                            #  NUM  E:(-14) OR (-27)  M:(-13) OR (-25)
055432,000554: 27,3351           41465                           BDDV     PUSH                                  #  TEMP SAVE D/N IN PDL+0
055433,000555:                                                                                                  #  DEN FROM PDL+0  E:(-3)/( 16)  M:(-3)/(-15)
055434,000556:                                                                                                  #  N/D TO PDL+0  E: (11)  M: (10)
055435,000557: 27,3352           45345        TFFEL1             DLOAD    DSU                                   #  (ENTER WITH D/N=0 IN PDL+0)
055436,000558: 27,3353           00045                                    TFFTEM                                #  Q2  E: (-16)  M: (-15)
055437,000559: 27,3354           00017                                    TFFQ1                                 #  Q1  E: (-16)  M: (-15)
055438,000560: 27,3355           14013                           STODL    TFFDELQ                               #  Q2-Q1  E: (-16)  M: (-15)
055439,000561:                                                                                                  #  D/N FROM PDL+0
055440,000562: 27,3356           77626                           STADR                                          
055441,000563: 27,3357           77732                           STORE    TFFTEM                                #  D/N  E: (11)  M: (10)
055442,000564: 27,3360           53605                           DMP      SL*                                   
055443,000565: 27,3361           00027                                    TFF1/ALF                              #  1/ALFA  E: (-22-2NA)  M: (-20-2NA)
055444,000566: 27,3362           57576                                    0,2                                   #  1/ALFA Z  E: (-11-NA)  M: (-10-NA)
055445,000567: 27,3363           41206                           PUSH     DMP                                   #  TO PDL+0
055446,000568: 27,3364           00045                                    TFFTEM                                #  1/Z  E: (11)  M: (10)
055447,000569: 27,3365           41057                           SL*      BOVB                                  
055448,000570: 27,3366           57576                                    0,2                                   #  X2= -NA
055449,000571: 27,3367           45742                                    SIGNMPAC                              #  IN CASE X= 1.0, CONTINUE
055450,000572: 27,3370           00043                           STORE    TFFX                                  #  X=1/ALFA ZSQ
055451,000573: 27,3371           41234                           RTB      DMP                                   
055452,000574: 27,3372           57432                                    T(X)                                  #  POLY
055453,000575: 27,3373           00043                                    TFFX                                  
055454,000576: 27,3374           45242                           SR3      DSU                                   
055455,000577: 27,3375           17462                                    DP2(-3)                               
055456,000578: 27,3376           41405                           DMP      PUSH                                  #  2(X T(X)-1) /Z ALFA   E: (-15-NA)
055457,000579:                                                                                                  #                        M: (-14-NA)
055458,000580:                                                                                                  #  1/ALFA Z FROM PDL+0   E: (-11-NA)
055459,000581:                                                                                                  #                        M: (-10-NA)
055460,000582: 27,3377           41345                           DLOAD    DMP                                   #  GET SIGN FOR SDELF
055461,000583: 27,3400           00045                                    TFFTEM                                #  1/Z  E: (11)  M: (10)
055462,000584: 27,3401           00015                                    RMAG1                                 #  E: (-29)  M: (-27)
055463,000585: 27,3402           43312                           SL2      DAD                                   
055464,000586: 27,3403           00017                                    TFFQ1                                 #  Q1  E: (-16)  M: (-15)
055465,000587: 27,3404           14045                           STODL    TFFTEM                                #  (Q1+R 1/Z) =SGN OF SDELF  E:(-16) M:(-15
055466,000588: 27,3405           00035                                    TFFNP                                 #  LC P  E: (-38+2NR)  M: (-36+2NR)
055467,000589: 27,3406           53605                           DMP      SL*                                   #  CALC FOR ARG FOR TFF/TRIG.
055468,000590: 27,3407           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA)  M:(-20-2NA)
055469,000591: 27,3410           57575                                    1,2                                   #  X2=-NA
055470,000592: 27,3411           53765                           SIGN     SL*                                   
055471,000593: 27,3412           00045                                    TFFTEM                                #  AFFIX SIGN FOR SDELF
055472,000594: 27,3413           57576                                    0,2                                   
055473,000595: 27,3414           14045                           STODL    TFFTEM                                #  P/ALFA  E:(-59+2NR)  M:(-55+2NR)
055474,000596:                                                                                                  #  (ARG FOR USE IN TFF/TRIG)
055475,000597: 27,3415           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA)  M:(-20-2NA)
055476,000598: 27,3416           41366                           SQRT     DMP                                   
055477,000599: 27,3417           17454                                    PI/16                                 #  PI (-4)
055478,000600: 27,3420           77615                           DAD                                            
055479,000601:                                                                                                  #  2(XT(X)-1)/Z ALFA FROM PDL    E:(-15-NA)
055480,000602:                                                                                                  #                                M:(-14-NA)
055481,000603: 27,3421           45257                           SL*      DSU                                   
055482,000604: 27,3422           57577                                    0          -1,2                       
055483,000605: 27,3423           00013                                    TFFDELQ                               #  Q2-Q1  E: (-16)  M: (-15)
055484,000606: 27,3424           53605                           DMP      SL*                                   
055485,000607: 27,3425           00027                                    TFF1/ALF                              #  1/ALFA  E:(-22-2NA)  M:(-20-2NA)
055486,000608: 27,3426           57601                                    0          -3,2                       
055487,000609: 27,3427           52057                           SL*      GOTO                                  
055488,000610: 27,3430           57602                                    0          -4,2                       
055489,000611: 27,3431           57336                                    ENDTFF                                #  TFF SQRT(MU) IN MPAC E:(-45) M:(-42)
055490,000612: 
055491,000613: 
055492,000614:                                                                                                  #  PROGRAM NAME:         T(X)                                            DATE:  01.17.67
055493,000615:                                                                                                  #  MOD NO:  0                                                            LOG SECTION:  TIME OF FREE FALL
055494,000616:                                                                                                  #  MOD BY:  RR BAIRNSFATHER
055495,000617: 
055496,000618:                                                                                                  #  FUNCTIONAL DESCRIPTION:       THE POLYNOMIAL T(X) IS USED BY TIME OF FLIGHT SUBROUTINES  CALCTFF AND
055497,000619:                                                                                                  #        CALCTPER TO APPROXIMATE THE SERIES
055498,000620:                                                                                                  #                           2     3
055499,000621:                                                                                                  #                1/3 -X/5 +X /7 -X /9 ...
055500,000622: 
055501,000623:                                                                                                  #        WHERE   X = ALFA Z Z            IF ALFA Z Z LEQ 1
055502,000624:                                                                                                  #                X = 1/(ALFA Z Z)        IF ALFA Z Z  G  1
055503,000625: 
055504,000626:                                                                                                  #        ALSO    X IS NEG FOR HYPERBOLIC ORBITS
055505,000627:                                                                                                  #                X = 0 FOR PARABOLIC ORBITS
055506,000628:                                                                                                  #                X IS POSITIVE FOR ELLIPTIC ORBITS
055507,000629:                                                                                                  #        FOR FLIGHT 278, THE POLYNOMIAL T(X) IS FITTED OVER THE RANGE  (0,+1)  AND HAS A MAXIMUM
055508,000630:                                                                                                  #        DEVIATION FROM THE SERIES OF  2 E-5   (T(X) IS A CHEBYCHEV TYPE FIT AND WAS OBTAINED USING
055509,000631:                                                                                                  #        MAC PROGRAM AUTCURFIT294RRB AND IS VALID TO THE SAME TOLERANCE OVER THE RANGE  (-.08,+1). )
055510,000632: 
055511,000633:                                                                                                  #  CALLING SEQUENCE:     RTB
055512,000634:                                                                                                  #                                T(X)
055513,000635:                                                                                                  #        C(MPAC) = X
055514,000636: 
055515,000637:                                                                                                  #  SUBROUTINES CALLED:  NONE
055516,000638: 
055517,000639:                                                                                                  #  NORMAL EXIT MODE:    TC DANZIG
055518,000640: 
055519,000641:                                                                                                  #  ALARMS:  NONE
055520,000642: 
055521,000643:                                                                                                  #  OUTPUT:  C(MPAC) = T(X)
055522,000644: 
055523,000645:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:
055524,000646:                                                                                                  #        C(MPAC) = X
055525,000647: 
055526,000648:                                                                                                  #  DEBRIS:  NONE
055527,000649: 
055528,000650: 27,3432           07171        T(X)               TC       POLY                                  
055529,000651: 27,3433           00004                           DEC      4          B-14                       #  N-1
055530,000652: 27,3434           12525 12525                     2DEC     3.333333333 E-1                        
055531,000653: 27,3436           71463 57703                     2DEC*    -1.999819135 E-1*                       
055532,000654: 27,3440           04423 17645                     2DEC*    1.418148467 E-1*                       
055533,000655: 27,3442           74604 43667                     2DEC*    -1.01310997 E-1*                       
055534,000656: 27,3444           01626 37256                     2DEC*    5.609004986 E-2*                       
055535,000657: 27,3446           77404 52071                     2DEC*    -1.536156925 E-2*                       
055536,000658: 
055537,000659: 27,3450           06030        ENDT(X)            TC       DANZIG                                
055538,000660: 
055539,000661: 27,3451  27,3450               TCDANZIG           =        ENDT(X)                               
055540,000662: 
055541,000663:                                                                                                  #  TFF CONSTANTS
055542,000664: 
055543,000665: 27,2000                                           SETLOC   TOF-FF1                               
055544,000666: 27,2000                                           BANK                                           
055545,000667: 
055546,000668: 27,3451                                           COUNT*   $$/TFF                                
055547,000669:                                                                                                  #                                                NOTE _  NOTE _ ADJUSTED MUE FOR NEAR EARTH TRAJ.
055548,000670: 
055549,000671: 
055550,000672:                                                                                                  # MUE            =       3.990815471 E10         M CUBE/CS SQ
055551,000673:                                                                                                  # RTMUE          =       1.997702549 E5 B-18*    MODIFIED EARTH MU
055552,000674: 
055553,000675: 27,3451           24775 30424  1/RTMU             2DEC*    .5005750271 E-5        B17*            #  MODIFIED EARTH MU
055554,000676: 
055555,000677:                                                                                                  #                                                NOTE _  NOTE _ ADJUSTED MUE FOR NEAR EARTH TRAJ.
055556,000678:                                                                                                  # MUM            =       4.902778 E8             M CUBE/CS SQ
055557,000679:                                                                                                  # RTMUM          2DEC*   2.21422176 E4 B-18*
055558,000680: 27,3453           06220 37553  PI/16              2DEC     3.141592653 B-4                        
055559,000681: 27,3455           37777 37700  LIM(-22)           2OCT     3777737700                            #  1.0 -B(-22)
055560,000682: 27,3457           00000 00100  DP(-22)            2OCT     0000000100                            #  B(-22)
055561,000683: 27,3461           04000 00000  DP2(-3)            2DEC     1          B-3                        
055562,000684: 27,3463           02000 00000  DP2(-4)            2DEC     1          B-4                        #  1/16
055563,000685: 
055564,000686:                                                                                                  #  RPAD1         2DEC    6373338 B-29            M (-29) = 20 909 901.57 FT
055565,000687: 27,3465  22,3373               RPAD1              =        RPAD                                  
055566,000688: 27,3465  26,3211               NEARONE            EQUALS   DPPOSMAX                              
055567,000689: 27,3465  26,3203               TFFZEROS           EQUALS   HI6ZEROS                              
055568,000690: 27,3465  26,3173               TFF1/4             EQUALS   HIDP1/4                               

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