Source Code
![]() |
These source-code files were transcribed from scans made from Don Eyles's personal
copy of Luminary 069. They were scanned at archive.org's Boston
facility, and the scanning was sponsored by Onno Hommes. The code was transcribed
from these scans by a team of volunteers who are referenced in the program
comments. Comments from the original source code are prefixed with a single '#' symbol,
whereas comments added later are prefixed by "##" or "###". In some cases, where
similar code blocks exist in previously-transcribed AGC programs (primarily
Luminary 99, from Apollo 11) those code blocks were used as a starting point and
then corrected to agree with the Luminary 69 scans. The full scans are available
at the Virtual AGC
project's collection at archive.org, while more-convenient reduced-size (but reduced-quality)
images are available at
the main Virtual AGC website. Report any errors noted by creating an
issue report at the Virtual AGC
project's GitHub repository. Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011 19:02 NOV. 25,1968Note that the date is the date of the printout, not the date of the program revision. |
043304,000002: ## Copyright: Public domain.
043305,000003: ## Filename: LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc
043306,000004: ## Purpose: The main source file for Luminary revision 069.
043307,000005: ## It is part of the source code for the original release
043308,000006: ## of the flight software for the Lunar Module's (LM) Apollo
043309,000007: ## Guidance Computer (AGC) for Apollo 10. The actual flown
043310,000008: ## version was Luminary 69 revision 2, which included a
043311,000009: ## newer lunar gravity model and only affected module 2.
043312,000010: ## This file is intended to be a faithful transcription, except
043313,000011: ## that the code format has been changed to conform to the
043314,000012: ## requirements of the yaYUL assembler rather than the
043315,000013: ## original YUL assembler.
043316,000014: ## Reference: pp. 979-982
043317,000015: ## Assembler: yaYUL
043318,000016: ## Contact: Ron Burkey <info@sandroid.org>.
043319,000017: ## Website: www.ibiblio.org/apollo/index.html
043320,000018: ## Mod history: 2016-12-13 MAS Created from Luminary 99.
043321,000019: ## 2016-12-18 MAS Updated from comment-proofed Luminary 99 version.
043322,000020: ## 2017-01-04 RRB Updated for Luminary 69. Notes on handwritted notations in Luminary 99
043323,000021: ## were retained and marked as being from Lum99.
043324,000022: ## 2017-01-28 RSB Proofed comment text using octopus/prooferComments
043325,000023: ## and fixed errors found.
043326,000024:
![]() |
Page 979 |
043328,000026: # NAME - LSPOS - LOCATE SUN AND MOON DATE - 25 OCT 67
043329,000027: # MOD NO.1
043330,000028: # MOD BY NEVILLE ASSEMBLY SUNDANCE
043331,000029:
043332,000030: # FUNCTIONAL DESCRIPTION
043333,000031:
043334,000032: # COMPUTES UNIT POSITION VECTOR OF THE SUN AND MOON IN THE BASIC REFERENCE SYSTEM. THE SUN VECTOR S IS
043335,000033: # LOCATED VIA TWO ANGLES. THE FIRST ANGLE(OBLIQUITY) IS THE ANGLE BETWEEN THE EARTH EQUATOR AND THE ECLIPTIC. THE
043336,000034: # SECOND ANGLE IS THE LONGITUDE OF THE SUN MEASURED IN THE ECLIPTIC.
043337,000035: # THE POSITION VECTOR OF THE SUN IS
043338,000036: # -
043339,000037: # S = (COS(LOS), COS(OBL)*SIN(LOS), SIN(OBL)*SIN(LOS)), WHERE
043340,000038:
043341,000039: # LOS = LOS +LOS *T-(C *SIN(2PI*T)/365.24 +C *COS(2PI*T)/365.24)
043342,000040: # 0 R 0 1
043343,000041: # LOS (RAD) IS THE LONGITUDE OF THE SUN FOR MIDNIGHT JUNE 30TH OF THE PARTICULAR YEAR.
043344,000042: # 0
043345,000043: # LOS (RAD/DAY) IS THE MEAN RATE FOR THE PARTICULAR YEAR.
043346,000044: # R
043347,000045:
043348,000046: # LOS AND LOS ARE STORED AS LOSC AND LOSR IN RATESP.
043349,000047: # 0 R
043350,000048: # COS(OBL) AND SIN(OBL) ARE STORED IN THE MATRIX KONMAT.
043351,000049: # T, TIME MEASURED IN DAYS (24 HOURS), IS STORED IN TIMEP.
043352,000050: # C AND C ARE FUDGE FACTORS TO MINIMIZE THE DEVIATION. THEY ARE STORED AS ONE CONSTANT (CMOD), SINCE
043353,000051: # 0 1 2 2 1/2
043354,000052: # C *SIN(X)+C *COS(X) CAN BE WRITTEN AS (C +C ) *SIN(X+PHI), WHERE PHI=ARCTAN(C /C ).
043355,000053: # 0 1 0 1 1 0
043356,000054:
043357,000055: # THE MOON IS LOCATED VIA FOUR ANGLES, THE FIRST IS THE OBLIQUITY. THE SECOND IS THE MEAN LONGITUDE OF THE MOON,
043358,000056: # MEASURED IN THE ECLIPTIC FROM THE MEAN EQUINOX TO THE MEAN ASCENDING NODE OF THE LUNAR ORBIT, AND THEN ALONG THE
043359,000057: # ORBIT. THE THIRD ANGLE IS THE ANGLE BETWEEN THE ECLIPTIC AND THE LUNAR ORBIT. THE FOURTH ANGLE IS THE LONGITUDE
043360,000058: # OF THE NODE OF THE MOON, MEASURED IN THE LUNAR ORBIT. LET THESE ANGLES BE OBL,LOM,IM, AND LON RESPECTIVELY.
043361,000059:
043362,000060: # THE SIMPLIFIED POSITION VECTOR OF THE MOON IS
043363,000061: # -
043364,000062: # M=(COS(LOM), COS(OBL)*SIN(LOM)-SIN(OBL)*SIN(IM)*SIN(LOM-LON), SIN(OBL)*SIN(LOM)+COS(OBL)*SIN(IM)*SIN(LOM-LON))
043365,000063:
043366,000064: # WHERE
043367,000065: # LOM=LOM +LOM *T-(A *SIN 2PI*T/27.5545+A *COS(2PI*T/27.5545)+B *SIN 2PI*T/32+B *COS(2PI*T/32)), AND
043368,000066: # 0 R 0 1 0 1
043369,000067: # LON=LON +LON
043370,000068: # 0 R
043371,000069: # A , A , B AND B ARE STORED AS AMOD AND BMOD (SEE DESCRIPTION OF CMOD, ABOVE). COS(OBL), SIN(OBL)*SIN(IM),
043372,000070: # 0 1 0 1
043373,000071: # SIN(OBL), AND COS(OBL)*SIN(IM) ARE STORED IN KONMAT AS K1, K2, K3 AND K4, RESPECTIVELY. LOM , LOM , LON , LON
043374,000072: # ARE STORED AS LOM0, LOMR, LON0, AND LONR IN RATESP. 0 R 0 R
043375,000073: # THE THREE PHIS ARE STORED AS AARG, BARG, AND CARG(SUN). ALL CONSTANTS ARE UPDATED BY YEAR.
043376,000074:
043377,000075: # CALLING SEQUENCE
![]() |
Page 980 |
043379,000077: # CALL LSPOS. RETURN IS VIA CPRET.
043380,000078:
043381,000079: # ALARMS OR ABORTS
043382,000080: # NONE
043383,000081:
043384,000082: # ERASABLE INITIALIZATION REQUIRED
043385,000083: # TEPHEM - TIME FROM MIDNIGHT 1 JULY PRECEDING THE LAUNCH TO THE TIME OF THE LAUNCH (WHEN THE AGC CLOCK WENT
043386,000084: # TO ZERO). TEPHEM IS TP WITH UNITS OF CENTI-SECONDS.
043387,000085:
043388,000086: # TIME2 AND TIME1 ARE IN MPAC AND MPAC +1 WHEN PROGRAM IS CALLED.
043389,000087:
043390,000088: # OUTPUT
043391,000089: # UNIT POSITIONAL VECTOR OF SUN IN VSUN. (SCALED B-1)
043392,000090: # UNIT POSITIONAL VECTOR OF MOON IN VMOON. (SCALED B-1)
043393,000091:
043394,000092: # SUBROUTINES USED
043395,000093: # NONE
043396,000094:
043397,000095: # DEBRIS
043398,000096: # CURRENT CORE SET, WORK AREA AND FREEFLAG
043399,000097:
043400,000098: 04,2750 BANK 04
043401,000099: 15,2000 SETLOC EPHEM
043402,000100: 15,2000 BANK
043403,000101:
043404,000102: 15,3663 E5,1714 EBANK= VSUN
043405,000103: 15,3663 COUNT* $$/EPHEM
043406,000104: 15,3663 15,3663 LUNPOS EQUALS LSPOS
043407,000105:
043408,000106: 15,3663 54201 LSPOS SETPD SR
043409,000107: 15,3664 00001 0
043410,000108: 15,3665 20617 14D # TP
043411,000109: 15,3666 56371 TAD DDV
![]() |
In Lum99, the hand-written notation "in centisec B 42" appears to the right. |
043413,000111: 15,3667 01707 TEPHEM # TIME OF LAUNCH
043414,000112: 15,3670 12024 CSTODAY # 24 HOURS-8640000 CENTI-SECS/DAY B-33
![]() |
In Lum99, the hand-written notation "@ B 9 = 512 days" appears to the right. |
043416,000114: 15,3671 00031 STORE TIMEP # T IN DAYS
![]() |
In Lum99, the hand-written notation "∴ granularity ≈ 0.164 sec" appears to the right. |
043418,000116: 15,3672 77170 AXT,1 AXT,2
043419,000117: 15,3673 00000 0
043420,000118: 15,3674 00000 0
043421,000119: 15,3675 77614 CLEAR
043422,000120: 15,3676 00274 FREEFLAG # SWITCH BIT
043423,000121: 15,3677 77745 POSITA DLOAD
043424,000122: 15,3700 12004 KONMAT +2 # ZEROS
043425,000123: 15,3701 00027 STORE GTMP
043426,000124: 15,3702 40745 POSITB DLOAD DMP*
043427,000125: 15,3703 00031 TIMEP # T
043428,000126: 15,3704 12050 VAL67 +4,1 # 1/27 OR 1/32 OR 1/365
![]() |
Page 981 |
043430,000128: 15,3705 42661 SL DAD*
043431,000129: 15,3706 20211 8D
043432,000130: 15,3707 12046 VAL67 +2,1 # AARG
043433,000131: 15,3710 40756 SIN DMP* # SIN(T/27+PHI) OR T/32 OR T/365
043434,000132: 15,3711 12044 VAL67,1 # (A0**2+A1**2)**1/2 SIN(X+PHIA)
043435,000133: 15,3712 62015 DAD INCR,1 # PLUS
043436,000134: 15,3713 00027 GTMP # (B0**2+B1**2)**1/2 SIN(X+PHIB)
043437,000135: 15,3714 77771 DEC -6 B-14
043438,000136: 15,3715 00027 STORE GTMP # OR (C0**2+C1**2)**1/2 SIN(X+PHIC)
043439,000137: 15,3716 77614 BOFSET
043440,000138: 15,3717 00054 FREEFLAG
043441,000139: 15,3720 33702 POSITB
043442,000140: 15,3721 40745 POSITD DLOAD DMP*
043443,000141: 15,3722 00031 TIMEP # T
043444,000142: 15,3723 65747 RATESP,2 # LOMR,LOSR,LONR
043445,000143: 15,3724 42661 SL DAD*
043446,000144: 15,3725 20206 5D
043447,000145: 15,3726 65741 RATESP +6,2 # LOMO,LOSO,LONO
043448,000146: 15,3727 77625 DSU
043449,000147: 15,3730 00027 GTMP
043450,000148: 15,3731 10021 STORE STMP,2 # LOM,LOS,LON
043451,000149: 15,3732 63135 SLOAD INCR,2
043452,000150: 15,3733 00050 X2
043453,000151: 15,3734 77775 DEC -2 B-14
043454,000152: 15,3735 53015 DAD BZE
043455,000153: 15,3736 12026 RCB-13 # PLUS 2
043456,000154: 15,3737 33767 POSITE # 2ND
043457,000155: 15,3740 77644 BPL
043458,000156: 15,3741 33677 POSITA # 1ST
043459,000157: 15,3742 45345 POSITF DLOAD DSU # 3RD
043460,000158: 15,3743 00021 STMP # LOM
043461,000159: 15,3744 00025 STMP +4 # LON
043462,000160: 15,3745 65356 SIN PDDL # SIN(LOM-LON)
043463,000161: 15,3746 00021 STMP
043464,000162: 15,3747 65356 SIN PDDL # SIN LOM
043465,000163: 15,3750 00021 STMP
043466,000164: 15,3751 55546 COS VDEF # COS LOM
043467,000165: 15,3752 53521 MXV UNIT
043468,000166: 15,3753 12002 KONMAT # K1,K2,K3,K4,
043469,000167: 15,3754 02723 STORE VMOON
043470,000168: 15,3755 65345 DLOAD PDDL
043471,000169: 15,3756 12004 KONMAT +2 # ZERO
043472,000170: 15,3757 00023 STMP +2
043473,000171: 15,3760 65356 SIN PDDL # SIN LOS
043474,000172: 15,3761 00023 STMP +2
043475,000173: 15,3762 55546 COS VDEF # COS LOS
043476,000174: 15,3763 53521 MXV UNIT
043477,000175: 15,3764 12002 KONMAT
043478,000176: 15,3765 02715 STORE VSUN
043479,000177: 15,3766 77616 RVQ
![]() |
Page 982 |
043481,000179: 15,3767 77745 POSITE DLOAD
043482,000180: 15,3770 12004 KONMAT +2 # ZEROS
043483,000181: 15,3771 00027 STORE GTMP
043484,000182: 15,3772 77650 GOTO
043485,000183: 15,3773 33721 POSITD
043486,000184: 15,3774 77616 LUNVEL RVQ # TO FOOL INTEGRATION
043487,000185: 05,2000 SETLOC EPHEM1
043488,000186: 05,2000 BANK
043489,000187:
043490,000188: 05,3430 COUNT* $$/EPHEM
043491,000189: 05,3430 STMP EQUALS 16D
043492,000190:
043493,000191: 05,3430 GTMP EQUALS 22D
043494,000192:
043495,000193: 05,3430 TIMEP EQUALS 24D
043496,000194:
End of include-file LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc. Parent file is MAIN.agc