Source Code

These source-code files are part of a reconstructed copy of Comanche 51, the initial release (though not the final mission release) of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software. The flown, final release was Comanche 55. The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 51, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 55, whose original source code is available. Comanche 55 source code was then modified by undoing changes known to have been made between revisions 51 and 55. The most-significant steps involved reverting changes related to the R-2 lunar potential model, the details of which were known from the previous, separate, independent reconstruction of the Apollo 10 Lunar Module software Luminary 69/2. The now-reconstructed Comanche 51 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 or Luminary 69 printouts, although the source code would likely have different page numbers in a contemporary Comanche 51 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 55. Here's a guide to some of the Apollo documentation relevant to those annotations:
Among documentation not actually referenced in the annotations, there is a short writeup about the reconstruction process in our software repository that may be helpful in understanding it from a different perspective. There's also a handy table that lists what the number of memory-words should be for each routine in Comanche 51, which could make a nice double-check; however, we've not performed that double-check ourselves.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

052809,000002:                                                                                                  ## Copyright:   Public domain.
052810,000003:                                                                                                  ## Filename:    PLANETARY_INERTIAL_ORIENTATION.agc
052811,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
052812,000005:                                                                                                  ##              It is part of the reconstructed source code for the
052813,000006:                                                                                                  ##              original release of the flight software for the Command
052814,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
052815,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
052816,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
052817,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
052818,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
052819,000012:                                                                                                  ##              reconstruction is correct.
052820,000013:                                                                                                  ## Reference:   pp. 1243-1251
052821,000014:                                                                                                  ## Assembler:   yaYUL
052822,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
052823,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
052824,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
052825,000018: 

Page 1243

052827,000020:                                                                                                  #  ..... RP-TO-R SUBROUTINE .....
052828,000021:                                                                                                  #  SUBROUTINE TO CONVERT RP (VECTOR IN PLANETARY COORDINATE SYSTEM, EITHER
052829,000022:                                                                                                  #  EARTH-FIXED OR MOON-FIXED) TO R (SAME VECTOR IN THE BASIC REF. SYSTEM)
052830,000023:                                                                                                  #        R = MT(T) * (RP + LP X RP)      MT = M MATRIX TRANSPOSE
052831,000024: 
052832,000025:                                                                                                  #  CALLING SEQUENCE
052833,000026:                                                                                                  #        L       CALL
052834,000027:                                                                                                  #        L+1             RP-TO-R
052835,000028: 
052836,000029:                                                                                                  #  SUBROUTINES USED
052837,000030:                                                                                                  #        EARTHMX, MOONMX, EARTHL
052838,000031: 
052839,000032:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
052840,000033:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
052841,000034:                                                                                                  #                IN THE MOON-FIXED COORD. SYSTEM         RADIANS B0
052842,000035: 
052843,000036:                                                                                                  #        ITEMS NECESSARY FOR SUBR. USED (SEE DESCRIPTION OF SUBR.)
052844,000037: 
052845,000038:                                                                                                  #  INPUT
052846,000039:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
052847,000040:                                                                                                  #        0-5D = RP VECTOR
052848,000041:                                                                                                  #        6-7D = TIME
052849,000042: 
052850,000043:                                                                                                  #  OUTPUT
052851,000044:                                                                                                  #        MPAC = R VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
052852,000045: 
052853,000046: 26,2000                                           SETLOC   PLANTIN                               
052854,000047: 26,2000                                           BANK                                           
052855,000048: 
052856,000049: 26,3344                                           COUNT*   $$/LUROT                              
052857,000050: 
052858,000051: 26,3344           46020        RP-TO-R            STQ      BHIZ                                  
052859,000052: 26,3345           00050                                    RPREXIT                               
052860,000053: 26,3346           55361                                    RPTORA                                
052861,000054: 26,3347           77624                           CALL                                           #  COMPUTE M MATRIX FOR MOON
052862,000055: 26,3350           55421                                    MOONMX                                #  LP=LM FOR MOON        RADIANS B0
052863,000056: 26,3351           77775                           VLOAD                                          
052864,000057: 26,3352           02012                                    504LM                                 
052865,000058: 26,3353           53235        RPTORB             VXV      VAD                                   
052866,000059: 26,3354           00001                                    504RPR                                
052867,000060: 26,3355           00001                                    504RPR                                
052868,000061: 26,3356           52105                           VXM      GOTO                                  
052869,000062: 26,3357           00025                                    MMATRIX                               #  MPAC=R=MT(T)*(RP+LPXRP)
052870,000063: 26,3360           55407                                    RPRPXXXX                              #  RESET PUSHLOC TO 0 BEFORE EXITING
052871,000064: 26,3361           77624        RPTORA             CALL                                           #  EARTH COMPUTATIONS
052872,000065: 26,3362           55573                                    EARTHMX                               #  M MATRIX B-1
052873,000066: 26,3363           77624                           CALL                                           
052874,000067: 26,3364           55625                                    EARTHL                                #  L VECTOR RADIANS B0
052875,000068: 26,3365           76521                           MXV      VSL1                                  #  LP=M(T)*L     RAD B-0
052876,000069: 26,3366           00025                                    MMATRIX                               

Page 1244

052878,000071: 26,3367           77650                           GOTO                                           
052879,000072: 26,3370           55353                                    RPTORB                                
052880,000073: 

Page 1245

052882,000075:                                                                                                  #  ..... R-TO-RP SUBROUTINE .....
052883,000076:                                                                                                  #  SUBROUTINE TO CONVERT R (VECTOR IN REFERENCE COORD. SYSTEM) TO RP
052884,000077:                                                                                                  #  (VECTOR IN PLANETARY COORD SYSTEM) EITHER EARTH-FIXED OR MOON-FIXED
052885,000078:                                                                                                  #        RP = M(T) * (R - L X R)
052886,000079: 
052887,000080:                                                                                                  #  CALLING SEQUENCE
052888,000081:                                                                                                  #        L       CALL
052889,000082:                                                                                                  #        L+1             R-TO-RP
052890,000083: 
052891,000084:                                                                                                  #  SUBROUTINES USED
052892,000085:                                                                                                  #        EARTHMX, MOONMX, EARTHL
052893,000086: 
052894,000087:                                                                                                  #  INPUT
052895,000088:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
052896,000089:                                                                                                  #        0-5D = R VECTOR
052897,000090:                                                                                                  #        6-7D = TIME
052898,000091: 
052899,000092:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
052900,000093:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
052901,000094:                                                                                                  #                IN THE MOON-FIXED COORD. SYSTEM                 RADIANS B0
052902,000095: 
052903,000096:                                                                                                  #        ITEMS NECESSARY FOR SUBROUTINES USED (SEE DESCRIPTION OF SUBR.)
052904,000097: 
052905,000098:                                                                                                  #  OUTPUT
052906,000099:                                                                                                  #        MPAC = RP VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
052907,000100: 
052908,000101: 26,3371           46020        R-TO-RP            STQ      BHIZ                                  
052909,000102: 26,3372           00050                                    RPREXIT                               
052910,000103: 26,3373           55413                                    RTORPA                                
052911,000104: 26,3374           77624                           CALL                                           
052912,000105: 26,3375           55421                                    MOONMX                                
052913,000106: 26,3376           61375                           VLOAD    VXM                                   
052914,000107: 26,3377           02012                                    504LM                                 #  LP=LM
052915,000108: 26,3400           00025                                    MMATRIX                               
052916,000109: 26,3401           77772                           VSL1                                           #  L = MT(T)*LP          RADIANS B0
052917,000110: 26,3402           51235        RTORPB             VXV      BVSU                                  
052918,000111: 26,3403           00001                                    504RPR                                
052919,000112: 26,3404           00001                                    504RPR                                
052920,000113: 26,3405           77721                           MXV                                            #  M(T)*(R-LXR)          B-2
052921,000114: 26,3406           00025                                    MMATRIX                               
052922,000115: 26,3407           40372        RPRPXXXX           VSL1     SETPD                                 
052923,000116: 26,3410           00001                                    0D                                    
052924,000117: 26,3411           77650                           GOTO                                           
052925,000118: 26,3412           00050                                    RPREXIT                               
052926,000119: 26,3413           77624        RTORPA             CALL                                           #  EARTH COMPUTATIONS
052927,000120: 26,3414           55573                                    EARTHMX                               
052928,000121: 26,3415           77624                           CALL                                           
052929,000122: 26,3416           55625                                    EARTHL                                
052930,000123: 26,3417           77650                           GOTO                                           #  MPAC=L=(-AX,-AY,0)    RAD B-0
052931,000124: 26,3420           55402                                    RTORPB                                
052932,000125: 

Page 1246

052934,000127:                                                                                                  #  ..... MOONMX SUBROUTINE .....
052935,000128:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE MOON
052936,000129: 
052937,000130:                                                                                                  #  CALLING SEQUENCE
052938,000131:                                                                                                  #        L       CALL
052939,000132:                                                                                                  #        L+1             MOONMX
052940,000133: 
052941,000134:                                                                                                  #  SUBROUTINES USED
052942,000135:                                                                                                  #        NEWANGLE
052943,000136: 
052944,000137:                                                                                                  #  INPUT
052945,000138:                                                                                                  #        6-7D = TIME
052946,000139: 
052947,000140:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
052948,000141:                                                                                                  #                BSUBO, BDOT
052949,000142:                                                                                                  #                TIMSUBO, NODIO, NODDOT, FSUBO, FDOT
052950,000143:                                                                                                  #                COSI = COS(I)   B-1
052951,000144:                                                                                                  #                SINI = SIN(I)   B-1
052952,000145:                                                                                                  #                I IS THE ANGLE BETWEEN THE MEAN LUNAR EQUATORIAL PLANE AND THE
052953,000146:                                                                                                  #                PLANE OF THE ECLIPTIC (1 DEGREE 32.1 MINUTES)
052954,000147: 
052955,000148:                                                                                                  #  OUTPUT
052956,000149:                                                                                                  #        MMATRIX = 3X3 M MATRIX          B-1 (STORED IN VAC AREA)
052957,000150: 
052958,000151: 26,3421           40220        MOONMX             STQ      SETPD                                 
052959,000152: 26,3422           00051                                    EARTHMXX                              
052960,000153: 26,3423           00011                                    8D                                    
052961,000154: 26,3424           77770                           AXT,1                                          #  B REQUIRES SL 0, SL 5 IN NEWANGLE
052962,000155: 26,3425           00005                                    5                                     
052963,000156: 26,3426           65345                           DLOAD    PDDL                                  #  PD 10D        8-9D=BSUBO
052964,000157: 26,3427           15655                                    BSUBO                                 #                10-11D=BDOT
052965,000158: 26,3430           15647                                    BDOT                                  
052966,000159: 26,3431           45006                           PUSH     CALL                                  #  PD 12D
052967,000160: 26,3432           55546                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= B   REVS B0
052968,000161: 26,3433           71406                           PUSH     COS                                   #  PD 10D
052969,000162: 26,3434           14041                           STODL    COB                                   #  PD 8D         COS(B) B-1
052970,000163: 26,3435           77756                           SIN                                            #                SIN(B) B-1
052971,000164: 26,3436           14043                           STODL    SOB                                   #                SETUP INPUT FOR NEWANGLE
052972,000165: 26,3437           15653                                    FSUBO                                 #                        8-9D=FSUBO
052973,000166: 26,3440           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=FDOT
052974,000167: 26,3441           15645                                    FDOT                                  
052975,000168: 26,3442           45170                           AXT,1    CALL                                  #  F REQUIRES SL 1, SL 6 IN NEWANGLE
052976,000169: 26,3443           00004                                    4                                     
052977,000170: 26,3444           55546                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= F REVS B0
052978,000171: 26,3445           14027                           STODL    AVECTR     +2                         #  SAVE F TEMP
052979,000172: 26,3446           15651                                    NODIO                                 #                        8-9D=NODIO
052980,000173: 26,3447           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=NODDOT
052981,000174: 26,3450           15643                                    NODDOT                                #                        MPAC=T
052982,000175: 26,3451           45170                           AXT,1    CALL                                  #  NODE REQUIRES SL 0, SL 5 IN NEWANGLE
052983,000176: 26,3452           00005                                    5                                     
052984,000177: 26,3453           55546                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= NODI REVS B0

Page 1247

052986,000179: 26,3454           71406                           PUSH     COS                                   #  PD 10D        8-9D= NODI REVS B0
052987,000180: 26,3455           77606                           PUSH                                           #  PD 12D        10-11D= COS(NODI) B-1
052988,000181: 26,3456           00025                           STORE    AVECTR                                
052989,000182: 26,3457           76405                           DMP      SL1R                                  
052990,000183: 26,3460           00041                                    COB                                   #                        COS(NODI) B-1
052991,000184: 26,3461           14035                           STODL    BVECTR     +2                         #  PD 10D  20-25D=AVECTR=COB*SIN(NODI)
052992,000185: 26,3462           76405                           DMP      SL1R                                  #                        SOB*SIN(NODI)
052993,000186: 26,3463           00043                                    SOB                                   
052994,000187: 26,3464           14037                           STODL    BVECTR     +4                         #  PD 8D
052995,000188: 26,3465           41556                           SIN      PUSH                                  #  PD 10D                -SIN(NODI) B-1
052996,000189: 26,3466           77676                           DCOMP                                          #          26-31D=BVECTR=COB*COS(NODI)
052997,000190: 26,3467           14033                           STODL    BVECTR                                #  PD 8D                 SOB*COS(NODI)
052998,000191: 26,3470           00027                                    AVECTR     +2                         #  MOVE F FROM TEMP LOC. TO 504F
052999,000192: 26,3471           14007                           STODL    504F                                  
053000,000193: 26,3472           76405                           DMP      SL1R                                  
053001,000194: 26,3473           00041                                    COB                                   
053002,000195: 26,3474           14027                           STODL    AVECTR     +2                         
053003,000196: 26,3475           00011                                    SINNODI                               #  8-9D=SIN(NODI) B-1
053004,000197: 26,3476           76405                           DMP      SL1R                                  
053005,000198: 26,3477           00043                                    SOB                                   
053006,000199: 26,3500           14031                           STODL    AVECTR     +4                         #                        0
053007,000200: 26,3501           15335                                    HI6ZEROS                              #        8-13D= CVECTR=  -SOB B-1
053008,000201: 26,3502           57525                           PDDL     DCOMP                                 #  PD 10D                COB
053009,000202: 26,3503           00043                                    SOB                                   
053010,000203: 26,3504           63325                           PDDL     PDVL                                  #  PD 12D THEN PD 14D
053011,000204: 26,3505           00041                                    COB                                   
053012,000205: 26,3506           00033                                    BVECTR                                
053013,000206: 26,3507           63361                           VXSC     PDVL                                  #  PD 20D        BVECTR*SINI B-2
053014,000207: 26,3510           15641                                    SINI                                  
053015,000208: 26,3511           00011                                    CVECTR                                
053016,000209: 26,3512           53361                           VXSC     VAD                                   #  PD 14D        CVECTR*COSI B-2
053017,000210: 26,3513           15637                                    COSI                                  
053018,000211: 26,3514           77772                           VSL1                                           
053019,000212: 26,3515           24041                           STOVL    MMATRIX    +12D                       #  PD 8D  M2=BVECTR*SINI+CVECTR*COSI B-1
053020,000213: 26,3516           63361                           VXSC     PDVL                                  #  PD 14D
053021,000214: 26,3517           15641                                    SINI                                  #                CVECTR*SINI B-2
053022,000215: 26,3520           00033                                    BVECTR                                
053023,000216: 26,3521           52361                           VXSC     VSU                                   #  PD 8D         BVECTR*COSI B-2
053024,000217: 26,3522           15637                                    COSI                                  
053025,000218: 26,3523           65372                           VSL1     PDDL                                  #  PD 14D
053026,000219: 26,3524           00007                                    504F                                  #  8-13D=DVECTR=BVECTR*COSI-CVECTR*SINI B-1
053027,000220: 26,3525           74346                           COS      VXSC                                  
053028,000221: 26,3526           00011                                    DVECTR                                
053029,000222: 26,3527           73525                           PDDL     SIN                                   #  PD 20D  14-19D= DVECTR*COSF B-2
053030,000223: 26,3530           00007                                    504F                                  
053031,000224: 26,3531           52361                           VXSC     VSU                                   #  PD 14D        AVECTR*SINF B-2
053032,000225: 26,3532           00025                                    AVECTR                                
053033,000226: 26,3533           77772                           VSL1                                           
053034,000227: 26,3534           14033                           STODL    MMATRIX    +6                         #  M1= AVECTR*SINF-DVECTR*COSF B-1
053035,000228: 26,3535           00007                                    504F                                  

Page 1248

053037,000230: 26,3536           74356                           SIN      VXSC                                  #  PD 8D
053038,000231: 26,3537           71525                           PDDL     COS                                   #  PD 14D  8-13D=DVECTR*SINF B-2
053039,000232: 26,3540           00007                                    504F                                  
053040,000233: 26,3541           53361                           VXSC     VAD                                   #  PD 8D         AVECTR*COSF B-2
053041,000234: 26,3542           00025                                    AVECTR                                
053042,000235: 26,3543           57572                           VSL1     VCOMP                                 
053043,000236: 26,3544           34025                           STCALL   MMATRIX                               #  M0= -(AVECTR*COSF+DVECTR*SINF) B-1
053044,000237: 26,3545           00051                                    EARTHMXX                              
053045,000238: 
053046,000239:                                                                                                  #  COMPUTE X=X0+(XDOT)(T+T0)
053047,000240:                                                                                                  #  8-9D= XO (REVS B-0), PUSHLOC SET AT 12D
053048,000241:                                                                                                  #  10-11D=XDOT (REVS/CSEC) SCALED B+23 FOR WEARTH,B+28 FOR NODDOT AND BDOT
053049,000242:                                                                                                  #                        AND B+27 FOR FDOT
053050,000243:                                                                                                  #  X1=DIFFERENCE IN 23 AND SCALING OF XDOT, =0 FOR WEARTH, 5 FOR NODDOT AND
053051,000244:                                                                                                  #                                        BDOT AND 4 FOR FDOT
053052,000245:                                                                                                  #  6-7D=T (CSEC B-28), TIMSUBO= (CSEC B-42 TRIPLE PREC.)
053053,000246: 
053054,000247: 26,3546           54345        NEWANGLE           DLOAD    SR                                    #  ENTER PD 12D
053055,000248: 26,3547           00007                                    6D                                    
053056,000249: 26,3550           20617                                    14D                                   
053057,000250: 26,3551           72371                           TAD      TLOAD                                 #  CHANGE MODE TO TP
053058,000251: 26,3552           01707                                    TIMSUBO                               
053059,000252: 26,3553           00155                                    MPAC                                  
053060,000253: 26,3554           14017                           STODL    TIMSUBM                               #  T+T0 CSEC B-42
053061,000254: 26,3555           00020                                    TIMSUBM    +1                         
053062,000255: 26,3556           77605                           DMP                                            #  PD 10D        MULT BY XDOT IN 10-11D
053063,000256: 26,3557           43257                           SL*      DAD                                   #  PD 8D         ADD XO IN 8-9D AFTER SHIFTING
053064,000257: 26,3560           20206                                    5,1                                   #                SUCH THAT SCALING IS B-0
053065,000258: 26,3561           67206                           PUSH     SLOAD                                 #  PD 10D  SAVE PARTIAL (X0+XDOT*T) IN 8-9D
053066,000259: 26,3562           00017                                    TIMSUBM                               
053067,000260: 26,3563           41261                           SL       DMP                                   
053068,000261: 26,3564           20212                                    9D                                    
053069,000262: 26,3565           00013                                    10D                                   #  XDOT
053070,000263: 26,3566           43257                           SL*      DAD                                   #  PD 8D         SHIFT SUCH THAT THIS PART OF X
053071,000264: 26,3567           20213                                    10D,1                                 #                IS SCALED REVS/CSEC B-0
053072,000265: 26,3570           77600                           BOV                                            #  TURN OFF OVERFLOW IF SET BY SHIFT
053073,000266: 26,3571           55572                                    +1                                    #  INSTRUCTION BEFORE EXITING
053074,000267: 26,3572           77616                           RVQ                                            #  MPAC=X= X0+(XDOT)(T+T0)       REVS B0
053075,000268: 

Page 1249

053077,000270:                                                                                                  #  ..... EARTHMX SUBROUTINE .....
053078,000271:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE EARTH
053079,000272: 
053080,000273:                                                                                                  #  CALLING SEQUENCE
053081,000274:                                                                                                  #        L       CALL
053082,000275:                                                                                                  #        L+1             EARTHMX
053083,000276: 
053084,000277:                                                                                                  #  SUBROUTINES USED
053085,000278:                                                                                                  #        NEWANGLE
053086,000279: 
053087,000280:                                                                                                  #  INPUT
053088,000281:                                                                                                  #        INPUT AVAILABLE FROM LAUNCH DATA        AZO REVS B-0
053089,000282:                                                                                                  #                                                TEPHEM CSEC B-42
053090,000283:                                                                                                  #        6-7D= TIME CSEC B-28
053091,000284: 
053092,000285:                                                                                                  #  OUTPUT
053093,000286:                                                                                                  #        MMATRIX= 3X3 M MATRIX B-1 (STORED IN VAC AREA)
053094,000287: 
053095,000288: 26,3573           40220        EARTHMX            STQ      SETPD                                 #  SET 8-9D=AZO
053096,000289: 26,3574           00051                                    EARTHMXX                              
053097,000290: 26,3575           00011                                    8D                                    #  10-11D=WEARTH
053098,000291: 26,3576           77770                           AXT,1                                          #  FOR SL 5, AND SL 10 IN NEWANGLE
053099,000292: 26,3577           00000                                    0                                     
053100,000293: 26,3600           65345                           DLOAD    PDDL                                  #  LEAVING PD SET AT 12D FOR NEWANGLE
053101,000294: 26,3601           01712                                    AZO                                   
053102,000295: 26,3602           15657                                    WEARTH                                
053103,000296: 26,3603           45006                           PUSH     CALL                                  
053104,000297: 26,3604           55546                                    NEWANGLE                              
053105,000298: 26,3605           41401                           SETPD    PUSH                                  #  18-19D=504AZ
053106,000299: 26,3606           00023                                    18D                                   #                         COS(AZ)   SIN(AZ)     0
053107,000300: 26,3607           65346                           COS      PDDL                                  #  20-37D=  MMATRIX=     -SIN(AZ)   COS(AZ)     0    B-1
053108,000301: 26,3610           00023                                    504AZ                                 #                            0         0        1
053109,000302: 26,3611           65356                           SIN      PDDL                                  
053110,000303: 26,3612           15335                                    HI6ZEROS                              
053111,000304: 26,3613           73525                           PDDL     SIN                                   
053112,000305: 26,3614           00023                                    504AZ                                 
053113,000306: 26,3615           65276                           DCOMP    PDDL                                  
053114,000307: 26,3616           00023                                    504AZ                                 
053115,000308: 26,3617           63346                           COS      PDVL                                  
053116,000309: 26,3620           15335                                    HI6ZEROS                              
053117,000310: 26,3621           41525                           PDDL     PUSH                                  
053118,000311: 26,3622           15333                                    HIDPHALF                              
053119,000312: 26,3623           77650                           GOTO                                           
053120,000313: 26,3624           00051                                    EARTHMXX                              
053121,000314: 

Page 1250

053123,000316:                                                                                                  #  ..... EARTHL SUBROUTINE .....
053124,000317:                                                                                                  #  SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
053125,000318: 
053126,000319:                                                                                                  #  CALLING SEQUENCE
053127,000320:                                                                                                  #        L       CALL
053128,000321:                                                                                                  #        L+1             EARTHL
053129,000322: 
053130,000323:                                                                                                  #  INPUT
053131,000324:                                                                                                  #        AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
053132,000325: 
053133,000326:                                                                                                  #  OUTPUT
053134,000327:                                                                                                  #                -AX
053135,000328:                                                                                                  #        MPAC=   -AY     RADIANS B-0
053136,000329:                                                                                                  #                  0
053137,000330: 
053138,000331: 26,3625           57545        EARTHL             DLOAD    DCOMP                                 
053139,000332: 26,3626           01716                                    AXO                                   
053140,000333: 26,3627           14017                           STODL    504LPL                                
053141,000334: 26,3630           01714                                    -AYO                                  
053142,000335: 26,3631           14021                           STODL    504LPL     +2                         
053143,000336: 26,3632           15335                                    HI6ZEROS                              
053144,000337: 26,3633           24023                           STOVL    504LPL     +4                         
053145,000338: 26,3634           00017                                    504LPL                                
053146,000339: 26,3635           77616                           RVQ                                            
053147,000340: 

Page 1251

053149,000342:                                                                                                  #  CONSTANTS AND ERASABLE ASSIGNMENTS
053150,000343: 
053151,000344: 26,3636  04,3563               1B1                =        DP1/2                                 #  1 SCALED B-1
053152,000345: 26,3636           17775 02052  COSI               2DEC     .99964173  B-1                        #  COS(5521.5 SEC) B-1
053153,000346: 
053154,000347: 26,3640           00333 10374  SINI               2DEC     .02676579  B-1                        #  SIN(5521.5 SEC) B-1
053155,000348: 
053156,000349: 26,3642  0000050               RPREXIT            =        S1                                    #  R-TO-RP AND RP-TO-R SUBR EXIT
053157,000350: 26,3642  0000051               EARTHMXX           =        S2                                    #  EARTHMX, MOONMX SUBR. EXITS
053158,000351: 26,3642                        504RPR             =        0D                                    #  6 REGS        R OR RP VECTOR
053159,000352: 26,3642                        SINNODI            =        8D                                    #  2             SIN(NODI)
053160,000353: 26,3642                        DVECTR             =        8D                                    #  6             D VECTOR MOON
053161,000354: 26,3642                        CVECTR             =        8D                                    #  6             C VECTR MOON
053162,000355: 26,3642                        504AZ              =        18D                                   #  2             AZ
053163,000356: 26,3642                        TIMSUBM            =        14D                                   #  3             TIME SUB M (MOON) T+T0 IN GETAZ
053164,000357: 26,3642                        504LPL             =        14D                                   #  6             L OR LP VECTOR
053165,000358: 26,3642                        AVECTR             =        20D                                   #  6             A VECTOR (MOON)
053166,000359: 26,3642                        BVECTR             =        26D                                   #  6             B VECTOR (MOON)
053167,000360: 26,3642                        MMATRIX            =        20D                                   #  18            M MATRIX
053168,000361: 26,3642                        COB                =        32D                                   #  2             COS(B) B-1
053169,000362: 26,3642                        SOB                =        34D                                   #  2             SIN(B) B-1
053170,000363: 26,3642                        504F               =        6D                                    #  2             F(MOON)
053171,000364: 26,3642           77665 42175  NODDOT             2DEC     -.457335121 E-2                        #  REVS/CSEC B+28=-1.07047011 E-8  RAD/SEC
053172,000365: 
053173,000366: 26,3644           22211 00625  FDOT               2DEC     .570863327                            #  REVS/CSEC B+27= 2.67240410 E-6  RAD/SEC
053174,000367: 
053175,000368: 26,3646           77777 77767  BDOT               2DEC     -3.07500686 E-8                        #  REVS/CSEC B+28=-7.19757301 E-14 RAD/SEC
053176,000369: 
053177,000370: 26,3650           37436 01613  NODIO              2DEC     .986209434                            #  REVS B-0      = 6.19653663041   RAD
053178,000371: 
053179,000372: 26,3652           32417 32160  FSUBO              2DEC     .829090536                            #  REVS B-0      = 5.20932947829   RAD
053180,000373: 
053181,000374: 26,3654           02052 35552  BSUBO              2DEC     .0651201393                            #  REVS B-0      = 0.40916190299   RAD
053182,000375: 
053183,000376: 26,3656           37116 32523  WEARTH             2DEC     .973561595                            #  REVS/CSEC B+23= 7.29211494 E-5  RAD/SEC
053184,000377: 

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