Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

049539,000002:                                                                                                  ## Copyright:   Public domain.
049540,000003:                                                                                                  ## Filename:    PLANETARY_INERTIAL_ORIENTATION.agc
049541,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
049542,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
049543,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
049544,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
049545,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
049546,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
049547,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
049548,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
049549,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
049550,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
049551,000014:                                                                                                  ##              the original YUL assembler.
049552,000015:                                                                                                  ##
049553,000016:                                                                                                  ## Assembler:   yaYUL
049554,000017:                                                                                                  ## Contact:     Jim Lawton <jim.lawton@gmail.com>
049555,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
049556,000019:                                                                                                  ## Pages:       1140-1148
049557,000020:                                                                                                  ## Mod history: 2009-05-28 JVL  Updated from page images.
049558,000021:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
049559,000022:                                                                                                  ##                              and corrected the errors found.
049560,000023:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
049561,000024:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
049562,000025:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
049563,000026: 
049564,000027:                                                                                                  ## This source code has been transcribed or otherwise adapted from
049565,000028:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
049566,000029:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
049567,000030:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
049568,000031:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
049569,000032:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
049570,000033:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
049571,000034:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
049572,000035:                                                                                                  ## actually created.
049573,000036:                                                                                                  ##
049574,000037:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
049575,000038:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
049576,000039:                                                                                                  ## the listing from which it was transcribed. It has been verified to
049577,000040:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
049578,000041:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
049579,000042:                                                                                                  ##
049580,000043:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
049581,000044:                                                                                                  ##
049582,000045:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
049583,000046: 

Page 1140

049585,000048:                                                                                                  #  ..... RP-TO-R SUBROUTINE .....
049586,000049:                                                                                                  #  SUBROUTINE TO CONVERT RP (VECTOR IN PLANETARY COORDINATE SYSTEM, EITHER
049587,000050:                                                                                                  #  EARTH-FIXED OR MOON-FIXED) TO R (SAME VECTOR IN THE BASIC REF. SYSTEM)
049588,000051: 
049589,000052:                                                                                                  #        R = MT(T) * (RP + LP X RP)      MT = M MATRIX TRANSPOSE
049590,000053: 
049591,000054:                                                                                                  #  CALLING SEQUENCE
049592,000055:                                                                                                  #        L       CALL
049593,000056:                                                                                                  #        L+1             RP-TO-R
049594,000057: 
049595,000058:                                                                                                  #  SUBROUTINES USED
049596,000059:                                                                                                  #        EARTHMX, MOONMX, EARTHL
049597,000060: 
049598,000061:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
049599,000062:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
049600,000063:                                                                                                  #                        IN THE MOON-FIXED COORD. SYSTEM         RADIANS B0
049601,000064: 
049602,000065:                                                                                                  #        ITEMS NECESSARY FOR SUBR. USED (SEE DESCRIPTION OF SUBR.)
049603,000066: 
049604,000067:                                                                                                  #  INPUT
049605,000068:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
049606,000069:                                                                                                  #        0-5D = RP VECTOR
049607,000070:                                                                                                  #        6-7D = TIME
049608,000071: 
049609,000072:                                                                                                  #  OUTPUT
049610,000073:                                                                                                  #        MPAC = R VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
049611,000074: 
049612,000075: 26,2000                                           SETLOC   PLANTIN1                              
049613,000076: 26,2000                                           BANK                                           
049614,000077: 
049615,000078: 26,3716                                           COUNT*   $$/LUROT                              
049616,000079: 
049617,000080: 26,3716           46020        RP-TO-R            STQ      BHIZ                                  
049618,000081: 26,3717           00050                                    RPREXIT                               
049619,000082: 26,3720           55733                                    RPTORA                                
049620,000083: 26,3721           77624                           CALL                                           #  COMPUTE M MATRIX FOR MOON
049621,000084: 26,3722           51720                                    MOONMX                                #  LP=LM FOR MOON  RADIANS B0
049622,000085: 26,3723           77775                           VLOAD                                          
049623,000086: 26,3724           02013                                    504LM                                 
049624,000087: 26,3725           53235        RPTORB             VXV      VAD                                   
049625,000088: 26,3726           00001                                    504RPR                                
049626,000089: 26,3727           00001                                    504RPR                                
049627,000090: 26,3730           52105                           VXM      GOTO                                  
049628,000091: 26,3731           00025                                    MMATRIX                               #  MPAC=R=MT(T)*(RP+LPXRP)
049629,000092: 26,3732           51706                                    RPRPXXXX                              #  RESET PUSHLOC TO 0 BEFORE EXITING
049630,000093: 26,3733           77624        RPTORA             CALL                                           #  EARTH COMPUTATIONS
049631,000094: 26,3734           55743                                    EARTHMX                               #  M MATRIX B-1
049632,000095: 26,3735           77624                           CALL                                           
049633,000096: 26,3736           15753                                    EARTHL                                #  L VECTOR RADIANS B0
049634,000097: 26,3737           76521                           MXV      VSL1                                  #  LP=M(T)*L  RAD B-0
049635,000098: 26,3740           00025                                    MMATRIX                               

Page 1141

049637,000100: 26,3741           77650                           GOTO                                           
049638,000101: 26,3742           55725                                    RPTORB                                
049639,000102: 24,2000                                           SETLOC   PLANTIN                               
049640,000103: 24,2000                                           BANK                                           
049641,000104: 24,3670                                           COUNT*   $$/LUROT                              
049642,000105: 

Page 1142

049644,000107:                                                                                                  #  ..... R-TO-RP SUBROUTINE .....
049645,000108:                                                                                                  #  SUBROUTINE TO CONVERT R (VECTOR IN REFERENCE COORD. SYSTEM) TO RP
049646,000109:                                                                                                  #  (VECTOR IN PLANETARY COORD SYSTEM) EITHER EARTH-FIXED OR MOON-FIXED
049647,000110: 
049648,000111:                                                                                                  #        RP = M(T) * (R - L X R)
049649,000112: 
049650,000113:                                                                                                  #  CALLING SEQUENCE
049651,000114:                                                                                                  #        L       CALL
049652,000115:                                                                                                  #        L+1             R-TO-RP
049653,000116: 
049654,000117:                                                                                                  #  SUBROUTINES USED
049655,000118:                                                                                                  #        EARTHMX, MOONMX, EARTHL
049656,000119: 
049657,000120:                                                                                                  #  INPUT
049658,000121:                                                                                                  #        MPAC = 0 FOR EARTH, NON-ZERO FOR MOON
049659,000122:                                                                                                  #        0-5D = R VECTOR
049660,000123:                                                                                                  #        6-7D = TIME
049661,000124: 
049662,000125:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
049663,000126:                                                                                                  #                504LM = THE LIBRATION VECTOR L OF THE MOON AT TIME TIMSUBL, EXPRESSED
049664,000127:                                                                                                  #                        IN THE MOON-FIXED COORD. SYSTEM   RADIANS B0
049665,000128: 
049666,000129:                                                                                                  #        ITEMS NECESSARY FOR SUBROUTINES USED (SEE DESCRIPTION OF SUBR.)
049667,000130: 
049668,000131:                                                                                                  #  OUTPUT
049669,000132:                                                                                                  #        MPAC = RP VECTOR METERS B-29 FOR EARTH, B-27 FOR MOON
049670,000133: 
049671,000134: 24,3670           46020        R-TO-RP            STQ      BHIZ                                  
049672,000135: 24,3671           00050                                    RPREXIT                               
049673,000136: 24,3672           51712                                    RTORPA                                
049674,000137: 24,3673           77624                           CALL                                           
049675,000138: 24,3674           51720                                    MOONMX                                
049676,000139: 24,3675           61375                           VLOAD    VXM                                   
049677,000140: 24,3676           02013                                    504LM                                 #  LP=LM
049678,000141: 24,3677           00025                                    MMATRIX                               
049679,000142: 24,3700           77772                           VSL1                                           #  L = MT(T)*LP          RADIANS B0
049680,000143: 24,3701           51235        RTORPB             VXV      BVSU                                  
049681,000144: 24,3702           00001                                    504RPR                                
049682,000145: 24,3703           00001                                    504RPR                                
049683,000146: 24,3704           77721                           MXV                                            #  M(T)*(R-LXR)          B-2
049684,000147: 24,3705           00025                                    MMATRIX                               
049685,000148: 24,3706           40372        RPRPXXXX           VSL1     SETPD                                 
049686,000149: 24,3707           00001                                    0D                                    
049687,000150: 24,3710           77650                           GOTO                                           
049688,000151: 24,3711           00050                                    RPREXIT                               
049689,000152: 24,3712           77624        RTORPA             CALL                                           #  EARTH COMPUTATIONS
049690,000153: 24,3713           55743                                    EARTHMX                               
049691,000154: 24,3714           77624                           CALL                                           
049692,000155: 24,3715           15753                                    EARTHL                                
049693,000156: 24,3716           77650                           GOTO                                           #  MPAC=L=(-AX,-AY,0)    RAD B-0
049694,000157: 24,3717           51701                                    RTORPB                                
049695,000158: 

Page 1143

049697,000160:                                                                                                  #  ..... MOONMX SUBROUTINE .....
049698,000161:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE MOON
049699,000162: 
049700,000163:                                                                                                  #  CALLING SEQUENCE
049701,000164:                                                                                                  #        L       CALL
049702,000165:                                                                                                  #        L+1             MOONMX
049703,000166: 
049704,000167:                                                                                                  #  SUBROUTINES USED
049705,000168:                                                                                                  #        NEWANGLE
049706,000169: 
049707,000170:                                                                                                  #  INPUT
049708,000171:                                                                                                  #        6-7D = TIME
049709,000172: 
049710,000173:                                                                                                  #        ITEMS AVAILABLE FROM LAUNCH DATA
049711,000174:                                                                                                  #                BSUBO, BDOT
049712,000175:                                                                                                  #                TIMSUBO, NODIO, NODDOT, FSUBO, FDOT
049713,000176:                                                                                                  #                COSI = COS(I)   B-1
049714,000177:                                                                                                  #                SINI = SIN(I)   B-1
049715,000178:                                                                                                  #                  I IS THE ANGLE BETWEEN THE MEAN LUNAR EQUATORIAL PLANE AND THE
049716,000179:                                                                                                  #                  PLANE OF THE ECLIPTIC (1 DEGREE 32.1 MINUTES)
049717,000180: 
049718,000181:                                                                                                  #  OUTPUT
049719,000182:                                                                                                  #        MMATRIX = 3X3 M MATRIX B-1      (STORED IN VAC AREA)
049720,000183: 
049721,000184: 24,3720           40220        MOONMX             STQ      SETPD                                 
049722,000185: 24,3721           00051                                    EARTHMXX                              
049723,000186: 24,3722           00011                                    8D                                    
049724,000187: 24,3723           77770                           AXT,1                                          #  B REQUIRES SL 0, SL 5 IN NEWANGLE
049725,000188: 24,3724           00005                                    5                                     
049726,000189: 24,3725           65345                           DLOAD    PDDL                                  #  PD 10D        8-9D=BSUBO
049727,000190: 24,3726           14017                                    BSUBO                                 #                10-11D=BDOT
049728,000191: 24,3727           14011                                    BDOT                                  
049729,000192: 24,3730           45006                           PUSH     CALL                                  #  PD 12D
049730,000193: 24,3731           53743                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= B   REVS B0
049731,000194: 24,3732           71406                           PUSH     COS                                   #  PD 10D
049732,000195: 24,3733           14041                           STODL    COB                                   #  PD 8D         COS(B) B-1
049733,000196: 24,3734           77756                           SIN                                            #                SIN(B) B-1
049734,000197: 24,3735           14043                           STODL    SOB                                   #  SETUP INPUT FOR NEWANGLE
049735,000198: 24,3736           14015                                    FSUBO                                 #                        8-9D=FSUBO
049736,000199: 24,3737           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=FDOT
049737,000200: 24,3740           14007                                    FDOT                                  
049738,000201: 24,3741           45170                           AXT,1    CALL                                  #  F REQUIRES SL 1, SL 6 IN NEWANGLE
049739,000202: 24,3742           00004                                    4                                     
049740,000203: 24,3743           53743                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= F REVS B0
049741,000204: 24,3744           14027                           STODL    AVECTR     +2                         #  SAVE F TEMP
049742,000205: 24,3745           14013                                    NODIO                                 #                        8-9D=NODIO
049743,000206: 24,3746           41525                           PDDL     PUSH                                  #  PD 10D THEN 12D       10-11D=NODDOT
049744,000207: 24,3747           14005                                    NODDOT                                #                        MPAC=T
049745,000208: 24,3750           45170                           AXT,1    CALL                                  #  NODE REQUIRES SL 0, SL 5 IN NEWANGLE
049746,000209: 24,3751           00005                                    5                                     
049747,000210: 24,3752           53743                                    NEWANGLE                              #  EXIT WITH PD 8D AND MPAC= NODI REVS B0

Page 1144

049749,000212: 24,3753           71406                           PUSH     COS                                   #  PD 10D        8-9D= NODI REVS B0
049750,000213: 24,3754           77606                           PUSH                                           #  PD 12D        10-11D= COS(NODI) B-1
049751,000214: 24,3755           00025                           STORE    AVECTR                                
049752,000215: 24,3756           76405                           DMP      SL1R                                  
049753,000216: 24,3757           00041                                    COB                                   #                         COS(NODI) B-1
049754,000217: 24,3760           14035                           STODL    BVECTR     +2                         #  PD 10D  20-25D=AVECTR= COB*SIN(NODI)
049755,000218: 24,3761           76405                           DMP      SL1R                                  #                         SOB*SIN(NODI)
049756,000219: 24,3762           00043                                    SOB                                   
049757,000220: 24,3763           14037                           STODL    BVECTR     +4                         #  PD 8D
049758,000221: 24,3764           41556                           SIN      PUSH                                  #  PD 10D                -SIN(NODI) B-1
049759,000222: 24,3765           77676                           DCOMP                                          #          26-31D=BVECTR= COB*COS(NODI)
049760,000223: 24,3766           14033                           STODL    BVECTR                                #  PD 8D                  SOB*COS(NODI)
049761,000224: 24,3767           00027                                    AVECTR     +2                         #  MOVE F FROM TEMP LOC. TO 504F
049762,000225: 24,3770           14007                           STODL    504F                                  
049763,000226: 24,3771           76405                           DMP      SL1R                                  
049764,000227: 24,3772           00041                                    COB                                   
049765,000228: 24,3773           77650                           GOTO                                           
049766,000229: 24,3774           53671                                    MOONMXA                               
049767,000230: 
049768,000231: 25,3671                                           BANK     25                                    
049769,000232: 25,2000                                           SETLOC   PLANTIN3                              
049770,000233: 25,2000                                           BANK                                           
049771,000234: 25,3671                                           COUNT*   $$/LUROT                              
049772,000235: 
049773,000236: 25,3671           14027        MOONMXA            STODL    AVECTR     +2                         
049774,000237: 25,3672           00011                                    SINNODI                               #  8-9D=SIN(NODI) B-1
049775,000238: 25,3673           76405                           DMP      SL1R                                  
049776,000239: 25,3674           00043                                    SOB                                   
049777,000240: 25,3675           14031                           STODL    AVECTR     +4                         #                         0
049778,000241: 25,3676           06522                                    HI6ZEROS                              #        8-13D= CVECTR= -SOB  B-1
049779,000242: 25,3677           57525                           PDDL     DCOMP                                 #  PD 10D                COB
049780,000243: 25,3700           00043                                    SOB                                   
049781,000244: 25,3701           63325                           PDDL     PDVL                                  #  PD 12D THEN PD 14D
049782,000245: 25,3702           00041                                    COB                                   
049783,000246: 25,3703           00033                                    BVECTR                                
049784,000247: 25,3704           63361                           VXSC     PDVL                                  #  PD 20D        BVECTR*SINI  B-2
049785,000248: 25,3705           14003                                    SINI                                  
049786,000249: 25,3706           00011                                    CVECTR                                
049787,000250: 25,3707           53361                           VXSC     VAD                                   #  PD 14D        CVECTR*COSI  B-2
049788,000251: 25,3710           14001                                    COSI                                  
049789,000252: 25,3711           77772                           VSL1                                           
049790,000253: 25,3712           24041                           STOVL    MMATRIX    +12D                       #  PD 8D  M2=BVECTR*SINI+CVECTR*COSI  B-1
049791,000254: 25,3713           63361                           VXSC     PDVL                                  #  PD 14D
049792,000255: 25,3714           14003                                    SINI                                  #                CVECTR*SINI  B-2
049793,000256: 25,3715           00033                                    BVECTR                                
049794,000257: 25,3716           52361                           VXSC     VSU                                   #  PD 8D         BVECTR*COSI  B-2
049795,000258: 25,3717           14001                                    COSI                                  
049796,000259: 25,3720           65372                           VSL1     PDDL                                  #  PD 14D
049797,000260: 25,3721           00007                                    504F                                  #  8-13D=DVECTR=BVECTR*COSI-CVECTR*SINI  B-1
049798,000261: 25,3722           74346                           COS      VXSC                                  

Page 1145

049800,000263: 25,3723           00011                                    DVECTR                                
049801,000264: 25,3724           73525                           PDDL     SIN                                   #  PD 20D  14-19D= DVECTR*COSF  B-2
049802,000265: 25,3725           00007                                    504F                                  
049803,000266: 25,3726           52361                           VXSC     VSU                                   #  PD 14D          AVECTR*SINF  B-2
049804,000267: 25,3727           00025                                    AVECTR                                
049805,000268: 25,3730           77772                           VSL1                                           
049806,000269: 25,3731           14033                           STODL    MMATRIX    +6                         #  M1= AVECTR*SINF-DVECTR*COSF  B-1
049807,000270: 25,3732           00007                                    504F                                  
049808,000271: 25,3733           74356                           SIN      VXSC                                  #  PD 8D
049809,000272: 25,3734           71525                           PDDL     COS                                   #  PD 14D  8-13D=DVECTR*SINF B-2
049810,000273: 25,3735           00007                                    504F                                  
049811,000274: 25,3736           53361                           VXSC     VAD                                   #  PD 8D         AVECTR*COSF B-2
049812,000275: 25,3737           00025                                    AVECTR                                
049813,000276: 25,3740           57572                           VSL1     VCOMP                                 
049814,000277: 25,3741           34025                           STCALL   MMATRIX                               #  M0= -(AVECTR*COSF+DVECTR*SINF)  B-1
049815,000278: 25,3742           00051                                    EARTHMXX                              
049816,000279: 
049817,000280:                                                                                                  #  COMPUTE X=X0+(XDOT)(T+T0)
049818,000281:                                                                                                  #  8-9D= XO (REVS B-0), PUSHLOC SET AT 12D
049819,000282:                                                                                                  #  10-11D=XDOT (REVS/CSEC) SCALED B+23 FOR WEARTH,B+28 FOR NODDOT AND BDOT
049820,000283:                                                                                                  #                        AND B+27 FOR FDOT
049821,000284:                                                                                                  #   X1=DIFFERENCE IN 23 AND SCALING OF XDOT, =0 FOR WEARTH, 5 FOR NODDOT AND
049822,000285:                                                                                                  #                                        BDOT AND 4 FOR FDOT
049823,000286:                                                                                                  #  6-7D=T (CSEC B-28), TIMSUBO= (CSEC B-42 TRIPLE PREC.)
049824,000287: 
049825,000288: 25,3743           54345        NEWANGLE           DLOAD    SR                                    #  ENTER PD 12D
049826,000289: 25,3744           00007                                    6D                                    
049827,000290: 25,3745           20617                                    14D                                   
049828,000291: 25,3746           72371                           TAD      TLOAD                                 #  CHANGE MODE TO TP
049829,000292: 25,3747           01707                                    TIMSUBO                               
049830,000293: 25,3750           00155                                    MPAC                                  
049831,000294: 25,3751           14017                           STODL    TIMSUBM                               #  T+T0 CSEC B-42
049832,000295: 25,3752           00020                                    TIMSUBM    +1                         
049833,000296: 25,3753           77605                           DMP                                            #  PD 10D        MULT BY XDOT IN 10-11D
049834,000297: 25,3754           43257                           SL*      DAD                                   #  PD 8D         ADD XO IN 8-9D AFTER SHIFTING
049835,000298: 25,3755           20206                                    5,1                                   #                SUCH THAT SCALING IS B-0
049836,000299: 25,3756           67206                           PUSH     SLOAD                                 #  PD 10D  SAVE PARTIAL (X0+XDOT*T) IN 8-9D
049837,000300: 25,3757           00017                                    TIMSUBM                               
049838,000301: 25,3760           41261                           SL       DMP                                   
049839,000302: 25,3761           20212                                    9D                                    
049840,000303: 25,3762           00013                                    10D                                   #  XDOT
049841,000304: 25,3763           43257                           SL*      DAD                                   #  PD 8D         SHIFT SUCH THAT THIS PART OF X
049842,000305: 25,3764           20213                                    10D,1                                 #                IS SCALED REVS/CSEC B-0
049843,000306: 25,3765           77600                           BOV                                            #  TURN OFF OVERFLOW IF SET BY SHIFT
049844,000307: 25,3766           53767                                    +1                                    #  INSTRUCTION BEFORE EXITING
049845,000308: 25,3767           77616                           RVQ                                            #  MPAC=X= X0+(XDOT)(T+T0)  REVS B0
049846,000309: 

Page 1146

049848,000311:                                                                                                  #  ..... EARTHMX SUBROUTINE .....
049849,000312:                                                                                                  #  SUBROUTINE TO COMPUTE THE TRANSFORMATION MATRIX M FOR THE EARTH
049850,000313: 
049851,000314:                                                                                                  #  CALLING SEQUENCE
049852,000315:                                                                                                  #        L       CALL
049853,000316:                                                                                                  #        L+1             EARTHMX
049854,000317: 
049855,000318:                                                                                                  #  SUBROUTINES USED
049856,000319:                                                                                                  #        NEWANGLE
049857,000320: 
049858,000321:                                                                                                  #  INPUT
049859,000322:                                                                                                  #        INPUT AVAILABLE FROM LAUNCH DATA        AZO  REVS B-0
049860,000323:                                                                                                  #                                                TEPHEM  CSEC B-42
049861,000324:                                                                                                  #        6-7D= TIME CSEC B-28
049862,000325: 
049863,000326:                                                                                                  #  OUTPUT
049864,000327:                                                                                                  #        MMATRIX= 3X3 M MATRIX B-1       (STORED IN VAC AREA)
049865,000328: 
049866,000329: 26,3743                                           BANK     26                                    
049867,000330: 26,2000                                           SETLOC   PLANTIN1                              
049868,000331: 26,2000                                           BANK                                           
049869,000332: 26,3743                                           COUNT*   $$/LUROT                              
049870,000333: 
049871,000334: 26,3743           40220        EARTHMX            STQ      SETPD                                 #  SET 8-9D=AZO
049872,000335: 26,3744           00051                                    EARTHMXX                              
049873,000336: 26,3745           00011                                    8D                                    #  10-11D=WEARTH
049874,000337: 26,3746           77770                           AXT,1                                          #  FOR SL 5, AND SL 10 IN NEWANGLE
049875,000338: 26,3747           00000                                    0                                     
049876,000339: 26,3750           65345                           DLOAD    PDDL                                  #  LEAVING PD SET AT 12D FOR NEWANGLE
049877,000340: 26,3751           01712                                    AZO                                   
049878,000341: 26,3752           14021                                    WEARTH                                
049879,000342: 26,3753           45006                           PUSH     CALL                                  
049880,000343: 26,3754           53743                                    NEWANGLE                              
049881,000344: 26,3755           41401                           SETPD    PUSH                                  #  18-19D=504AZ
049882,000345: 26,3756           00023                                    18D                                   #                         COS(AZ)   SIN(AZ)     0
049883,000346: 26,3757           65346                           COS      PDDL                                  #  20-37D=  MMATRIX=     -SIN(AZ)   COS(AZ)     0    B-1
049884,000347: 26,3760           00023                                    504AZ                                 #                            0         0        1
049885,000348: 26,3761           65356                           SIN      PDDL                                  
049886,000349: 26,3762           06522                                    HI6ZEROS                              
049887,000350: 26,3763           73525                           PDDL     SIN                                   
049888,000351: 26,3764           00023                                    504AZ                                 
049889,000352: 26,3765           65276                           DCOMP    PDDL                                  
049890,000353: 26,3766           00023                                    504AZ                                 
049891,000354: 26,3767           63346                           COS      PDVL                                  
049892,000355: 26,3770           06522                                    HI6ZEROS                              
049893,000356: 26,3771           41525                           PDDL     PUSH                                  
049894,000357: 26,3772           06520                                    HIDPHALF                              
049895,000358: 26,3773           77650                           GOTO                                           
049896,000359: 26,3774           00051                                    EARTHMXX                              
049897,000360: 

Page 1147

049899,000362:                                                                                                  #  ..... EARTHL SUBROUTINE .....
049900,000363:                                                                                                  #  SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
049901,000364: 
049902,000365:                                                                                                  #  CALLING SEQUENCE
049903,000366:                                                                                                  #        L       CALL
049904,000367:                                                                                                  #        L+1             EARTHL
049905,000368: 
049906,000369:                                                                                                  #  INPUT
049907,000370:                                                                                                  #        AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
049908,000371: 
049909,000372:                                                                                                  #  OUTPUT
049910,000373:                                                                                                  #                -AX
049911,000374:                                                                                                  #        MPAC=   -AY     RADIANS B-0
049912,000375:                                                                                                  #                  0
049913,000376: 
049914,000377: 06,3753                                           BANK     06                                    
049915,000378: 06,2000                                           SETLOC   EARTHLOC                              
049916,000379: 06,2000                                           BANK                                           
049917,000380: 06,3753                                           COUNT*   $$/LUROT                              
049918,000381: 
049919,000382: 06,3753           57545        EARTHL             DLOAD    DCOMP                                 
049920,000383: 06,3754           01716                                    AXO                                   
049921,000384: 06,3755           14017                           STODL    504LPL                                
049922,000385: 06,3756           01714                                    -AYO                                  
049923,000386: 06,3757           14021                           STODL    504LPL     +2                         
049924,000387: 06,3760           24007                                    LO6ZEROS                              
049925,000388: 06,3761           24023                           STOVL    504LPL     +4                         
049926,000389: 06,3762           00017                                    504LPL                                
049927,000390: 06,3763           77616                           RVQ                                            
049928,000391: 

Page 1148

049930,000393:                                                                                                  #  CONSTANTS AND ERASABLE ASSIGNMENTS
049931,000394: 
049932,000395: 06,3764  12,2004               1B1                =        DP1/2                                 #  1  SCALED B-1
049933,000396: 06,3764  0000050               RPREXIT            =        S1                                    #  R-TO-RP AND RP-TO-R SUBR EXIT
049934,000397: 06,3764  0000051               EARTHMXX           =        S2                                    #  EARTHMX, MOONMX SUBR. EXITS
049935,000398: 06,3764                        504RPR             =        0D                                    #  6 REGS        R OR RP VECTOR
049936,000399: 06,3764                        SINNODI            =        8D                                    #  2             SIN(NODI)
049937,000400: 06,3764                        DVECTR             =        8D                                    #  6             D VECTOR MOON
049938,000401: 06,3764                        CVECTR             =        8D                                    #  6             C VECTR MOON
049939,000402: 06,3764                        504AZ              =        18D                                   #  2             AZ
049940,000403: 06,3764                        TIMSUBM            =        14D                                   #  3             TIME SUB M (MOON) T+T0 IN GETAZ
049941,000404: 06,3764                        504LPL             =        14D                                   #  6             L OR LP VECTOR
049942,000405: 06,3764                        AVECTR             =        20D                                   #  6             A VECTOR (MOON)
049943,000406: 06,3764                        BVECTR             =        26D                                   #  6             B VECTOR (MOON)
049944,000407: 06,3764                        MMATRIX            =        20D                                   #  18            M MATRIX
049945,000408: 06,3764                        COB                =        32D                                   #  2             COS(B) B-1
049946,000409: 06,3764                        SOB                =        34D                                   #  2             SIN(B) B-1
049947,000410: 06,3764                        504F               =        6D                                    #  2             F(MOON)
049948,000411: 

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