Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 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.

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

Page 1140

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

Page 1141

049653,000100: 26,3741           77650                           GOTO                                           
049654,000101: 26,3742           55725                                    RPTORB                                
049655,000102: 24,2000                                           SETLOC   PLANTIN                               
049656,000103: 24,2000                                           BANK                                           
049657,000104: 24,3670                                           COUNT*   $$/LUROT                              
049658,000105: 

Page 1142

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

Page 1143

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

Page 1144

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

Page 1145

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

Page 1146

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

Page 1147

049915,000362:                                                                                                  #  ..... EARTHL SUBROUTINE .....
049916,000363:                                                                                                  #  SUBROUTINE TO COMPUTE L VECTOR FOR EARTH
049917,000364: 
049918,000365:                                                                                                  #  CALLING SEQUENCE
049919,000366:                                                                                                  #        L       CALL
049920,000367:                                                                                                  #        L+1             EARTHL
049921,000368: 
049922,000369:                                                                                                  #  INPUT
049923,000370:                                                                                                  #        AXO,AYO SET AT LAUNCH TIME WITH AYO IMMEDIATELY FOLLOWING AXO IN CORE
049924,000371: 
049925,000372:                                                                                                  #  OUTPUT
049926,000373:                                                                                                  #                -AX
049927,000374:                                                                                                  #        MPAC=   -AY     RADIANS B-0
049928,000375:                                                                                                  #                  0
049929,000376: 
049930,000377: 06,3753                                           BANK     06                                    
049931,000378: 06,2000                                           SETLOC   EARTHLOC                              
049932,000379: 06,2000                                           BANK                                           
049933,000380: 06,3753                                           COUNT*   $$/LUROT                              
049934,000381: 
049935,000382: 06,3753           57545        EARTHL             DLOAD    DCOMP                                 
049936,000383: 06,3754           01716                                    AXO                                   
049937,000384: 06,3755           14017                           STODL    504LPL                                
049938,000385: 06,3756           01714                                    -AYO                                  
049939,000386: 06,3757           14021                           STODL    504LPL     +2                         
049940,000387: 06,3760           24007                                    LO6ZEROS                              
049941,000388: 06,3761           24023                           STOVL    504LPL     +4                         
049942,000389: 06,3762           00017                                    504LPL                                
049943,000390: 06,3763           77616                           RVQ                                            
049944,000391: 

Page 1148

049946,000393:                                                                                                  #  CONSTANTS AND ERASABLE ASSIGNMENTS
049947,000394: 
049948,000395: 06,3764  12,2004               1B1                =        DP1/2                                 #  1  SCALED B-1
049949,000396: 06,3764  0000050               RPREXIT            =        S1                                    #  R-TO-RP AND RP-TO-R SUBR EXIT
049950,000397: 06,3764  0000051               EARTHMXX           =        S2                                    #  EARTHMX, MOONMX SUBR. EXITS
049951,000398: 06,3764                        504RPR             =        0D                                    #  6 REGS        R OR RP VECTOR
049952,000399: 06,3764                        SINNODI            =        8D                                    #  2             SIN(NODI)
049953,000400: 06,3764                        DVECTR             =        8D                                    #  6             D VECTOR MOON
049954,000401: 06,3764                        CVECTR             =        8D                                    #  6             C VECTR MOON
049955,000402: 06,3764                        504AZ              =        18D                                   #  2             AZ
049956,000403: 06,3764                        TIMSUBM            =        14D                                   #  3             TIME SUB M (MOON) T+T0 IN GETAZ
049957,000404: 06,3764                        504LPL             =        14D                                   #  6             L OR LP VECTOR
049958,000405: 06,3764                        AVECTR             =        20D                                   #  6             A VECTOR (MOON)
049959,000406: 06,3764                        BVECTR             =        26D                                   #  6             B VECTOR (MOON)
049960,000407: 06,3764                        MMATRIX            =        20D                                   #  18            M MATRIX
049961,000408: 06,3764                        COB                =        32D                                   #  2             COS(B) B-1
049962,000409: 06,3764                        SOB                =        34D                                   #  2             SIN(B) B-1
049963,000410: 06,3764                        504F               =        6D                                    #  2             F(MOON)
049964,000411: 

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