Source Code
![]() |
This is the source-code for the Apollo 9 Command Module's Guidance Computer.
These files were derived originally from the scan from MIT's Dibner Institute's
now-discontinued website titled "History of Recent Science and Technology", which
in turn was originally created by Gary Neff, though his high-quality scans were
unfortunately reduced in legibility when presented online.
The markings on the front of the
printout imply that it was the original AGC developer Norm Brodeur's copy.
A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original
AGC developer Fred Martin. The source code was transcribed from
those images by Ron Burkey. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041 20'35 OCT. 28,1968Note that the date is the date of the printout, not the date of the program revision. |
033103,000002: ## Copyright: Public domain.
033104,000003: ## Filename: LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc
033105,000004: ## Purpose: Part of the source code for Colossus, build 249.
033106,000005: ## It is part of the source code for the Command Module's (CM)
033107,000006: ## Apollo Guidance Computer (AGC), for Apollo 9.
033108,000007: ## Assembler: yaYUL
033109,000008: ## Reference: pp. 739-742.
033110,000009: ## Contact: Ron Burkey <info@sandroid.org>.
033111,000010: ## Website: www.ibiblio.org/apollo.
033112,000011: ## Mod history: 08/22/04 RSB. Split off from P51-P53.agc.
033113,000012: ## 2017-01-06 RSB Page numbers now agree with those on the
033114,000013: ## original harcopy, as opposed to the PDF page
033115,000014: ## numbers in 1701.pdf.
033116,000015: ## 2017-01-15 RSB Cross-diff'd comment text (not whitespace)
033117,000016: ## vs the already-proofed corresponding Colossus
033118,000017: ## 237 and Comanche 55 source-code files
033119,000018: ## and corrected errors found. There were no
033120,000019: ## differences between the comment text in the
033121,000020: ## different versions after these corrections.
033122,000021: ##
033123,000022: ## The contents of the "Colossus249" files, in general, are transcribed
033124,000023: ## from a scanned copy of the program listing. Notations on this
033125,000024: ## document read, in part:
033126,000025: ##
033127,000026: ## Assemble revision 249 of AGC program Colossus by NASA
033128,000027: ## 2021111-041. October 28, 1968.
033129,000028: ##
033130,000029: ## This AGC program shall also be referred to as
033131,000030: ## Colossus 1A
033132,000031: ##
033133,000032: ## Prepared by
033134,000033: ## Massachusetts Institute of Technology
033135,000034: ## 75 Cambridge Parkway
033136,000035: ## Cambridge, Massachusetts
033137,000036: ## under NASA contract NAS 9-4065.
033138,000037: ##
033139,000038: ## Refer directly to the online document mentioned above for further information.
033140,000039: ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
033141,000040: ##
033142,000041: ## In some cases, where the source code for Luminary 131 overlaps that of
033143,000042: ## Colossus 249, this code is instead copied from the corresponding Luminary 131
033144,000043: ## source file, and then is proofed to incorporate any changes.
033145,000044:
![]() |
Page 739 |
033147,000046: # LUNAR AND SOLAR EPHEMERIDES SUBROUTINES
033148,000047:
033149,000048: # FUNCTIONAL DESCRIPTION
033150,000049:
033151,000050: # THESE SUBROUTINES ARE USED TO DETERMINE THE POSITION AND VELOCITY
033152,000051: # VECTORS OF THE SUN AND THE MOON RELATIVE TO THE EARTH AT THE
033153,000052: # SPECIFIED GROUND ELAPSED TIME INPUT BY THE USER.
033154,000053:
033155,000054: # THE POSITION OF THE MOON IS STORED IN THE COMPUTER IN THE FORM OF
033156,000055: # A NINTH DEGREE POLYNOMIAL APPROXIMATION WHICH IS VALID OVER A 15
033157,000056: # DAY INTERVAL BEGINNING SHORTLY BEFORE LAUNCH. THEREFORE THE TIME
033158,000057: # INPUT BY THE USER SHOULD FALL WITHIN THIS 15 DAY INTERVAL.
033159,000058:
033160,000059: # LSPOS COMPUTES THE POSITION VECTORS OF THE SUN AND THE MOON.
033161,000060:
033162,000061: # LUNPOS COMPUTES THE POSITION VECTOR OF THE MOON.
033163,000062:
033164,000063: # LUNVEL COMPUTES THE VELOCITY VECTOR OF THE MOON.
033165,000064:
033166,000065: # SOLPOS COMPUTES THE POSITION VECTOR OF THE SUN.
033167,000066:
033168,000067: # CALLING SEQUENCE
033169,000068:
033170,000069: # DLOAD CALL
033171,000070: # TIME GROUND ELAPSED TIME
033172,000071: # SUBROUTINE LSPOS OR LUNPOS OR LUNVEL OR SOLPOS
033173,000072:
033174,000073: # INPUT
033175,000074:
033176,000075: # 1) SPECIFIED GROUND ELAPSED TIME IN CS X B-28 LOADED IN MPAC.
033177,000076:
033178,000077: # 2) TIMEMO - TIME AT THE CENTER OF THE RANGE OVER WHICH THE LUNAR
033179,000078: # POSITION POLYNOMIAL IS VALID IN CS X B-42.
033180,000079:
033181,000080: # 3) VECOEM - VECTOR COEFFICIENTS OF THE LUNAR POSITION POLYNOMIAL
033182,000081: # LOADED IN DESCENDING SEQUENCE IN METERS/CS**N X B-2
033183,000082:
033184,000083: # 4) RESO - POSITION VECTOR OF THE SUN RELATIVE TO THE EARTH AT
033185,000084: # TIMEMO IN METERS X B-38.
033186,000085:
033187,000086: # 5) VESO - VELOCITY VECTOR OF THE SUN RELATIVE TO THE EARTH AT
033188,000087: # TIMEMO IN METERS/CS X B-9.
033189,000088: #
033190,000089: # 6) OMEGAES - ANGULAR VELOCITY OF THE VECTOR RESO AT TIMEMO IN
033191,000090: # REV/CS X B+26.
033192,000091:
033193,000092: # ALL EXCEPT THE FIRST INPUT ARE INCLUDED IN THE PRE-LAUNCH
033194,000093: # ERASABLE DATA LOAD.
033195,000094:
033196,000095: # OUTPUT - LSPOS
![]() |
Page 740 |
033198,000097:
033199,000098: # 1) 2D OF VAC AREA CONTAINS THE POSITION VECTOR OF THE SUN RELATIVE
033200,000099: # TO THE EARTH AT TIME INPUT BY THE USER IN METERS X B-38.
033201,000100:
033202,000101: # 2) MPAC CONTAINS THE POSITION VECTOR OF THE MOON RELATIVE TO THE
033203,000102: # EARTH AT TIME INPUT BY THE USER IN METERS X B-29.
033204,000103:
033205,000104: # OUTPUT - LUNPOS
033206,000105:
033207,000106: # MPAC CONTAINS THE POSITION VECTOR OF THE MOON RELATIVE TO THE
033208,000107: # EARTH AT THE TIME INPUT BY USER IN METERS X B-29.
033209,000108:
033210,000109: # OUTPUT - LUNVEL
033211,000110:
033212,000111: # MPAC CONTAINS THE VELOCITY VECTOR OF THE MOON RELATIVE TO THE
033213,000112: # EARTH AT TIME INPUT BY THE USER IN METERS/CS X B-7.
033214,000113:
033215,000114: # OUTPUT - SOLPOS
033216,000115:
033217,000116: # MPAC CONTAINS THE POSITION VECTOR OF THE SUN RELATIVE TO THE EARTH
033218,000117: # AT TIME INPUT BY THE USER IN METERS X B-38.
033219,000118:
033220,000119: # SUBROUTINES USED
033221,000120:
033222,000121: # NONE
033223,000122:
033224,000123: # REMARKS
033225,000124:
033226,000125: # THE VAC AREA IS USED FOR STORAGE OF INTERMEDIATE AND FINAL RESULTS
033227,000126: # OF COMPUTATIONS.
033228,000127:
033229,000128: # S1, X1 AND X2 ARE USED BY THESE SUBROUTINES.
033230,000129:
033231,000130: # PRELAUNCH ERASABLE DATA LOAD ARE ONLY ERASABLE STORAGE USED BY
033232,000131: # THESE SUBROUTINES.
033233,000132:
033234,000133: # RESTARTS DURING OPERATION OF THESE SUBROUTINES MUST BE HANDLED BY
033235,000134: # THE USER.
033236,000135:
033237,000136: 36,2502 BANK 36
033238,000137: 26,2000 SETLOC EPHEM
033239,000138: 26,2000 BANK
033240,000139:
033241,000140: 26,2110 COUNT* $$/EPHEM
033242,000141: 26,2110 E7,1777 EBANK= END-E7
033243,000142:
033244,000143: 26,2110 77774 LSPOS AXT,2 # COMPUTES POSITION VECTORS OF BOTH THE
033245,000144: 26,2111 54161 RESA # SUN AND THE MOON. THE POSITION VECTOR
033246,000145: 26,2112 52170 AXT,1 GOTO # OF THE SUN IS STORED IN 2D OF THE VAC
033247,000146: 26,2113 54143 RES # AREA. THE POSITION VECTOR OF THE MOON
033248,000147: 26,2114 54126 LSTIME # IS STORED IN MPAC.
033249,000148: 26,2115 52170 LUNPOS AXT,1 GOTO # COMPUTES THE POSITION VECTOR OF THE MOON
033250,000149: 26,2116 54162 REM # AND STORES IT IN MPAC.
033251,000150: 26,2117 54126 LSTIME
![]() |
Page 741 |
033253,000152: 26,2120 52170 LUNVEL AXT,1 GOTO # COMPUTES THE VELOCITY VECTOR OF THE MOON
033254,000153: 26,2121 54173 VEM # AND STORES IT IN MPAC.
033255,000154: 26,2122 54126 LSTIME
033256,000155: 26,2123 76020 SOLPOS STQ AXT,1 # COMPUTES THE POSITION VECTOR OF THE SUN
033257,000156: 26,2124 00047 X2 # AND STORES IT IN MPAC.
033258,000157: 26,2125 54143 RES
033259,000158: 26,2126 54201 LSTIME SETPD SR
033260,000159: 26,2127 00001 0D
033261,000160: 26,2130 20617 14D
033262,000161: 26,2131 57571 TAD DCOMP
033263,000162: 26,2132 01707 TEPHEM
033264,000163: 26,2133 57571 TAD DCOMP
033265,000164: 26,2134 02034 TIMEMO
033266,000165: 26,2135 66261 SL SSP
033267,000166: 26,2136 20221 16D
033268,000167: 26,2137 00051 S1
033269,000168: 26,2140 00006 6D
033270,000169: 26,2141 77650 GOTO
033271,000170: 26,2142 00046 X1
033272,000171: 26,2143 41206 RES PUSH DMP # PD -2
033273,000172: 26,2144 02147 OMEGAES
033274,000173: 26,2145 71406 PUSH COS # PD -4
033275,000174: 26,2146 65361 VXSC PDDL # PD -8
033276,000175: 26,2147 02133 RESO
033277,000176: 26,2150 63356 SIN PDVL # PD-10
033278,000177: 26,2151 02133 RESO
033279,000178: 26,2152 53406 PUSH UNIT # PD-16
033280,000179: 26,2153 53435 VXV UNIT
033281,000180: 26,2154 02141 VESO
033282,000181: 26,2155 76435 VXV VSL1 # PD-10
033283,000182: 26,2156 53361 VXSC VAD # PD-02
033284,000183: 26,2157 52172 VSL1 GOTO # RES IN METERS X B-38 IN MPAC.
033285,000184: 26,2160 00047 X2
033286,000185: 26,2161 14003 RESA STODL 2D # RES IN METERS X B-38 IN 2D OF VAC. PD -0
033287,000186: 26,2162 63370 REM AXT,1 PDVL # PD -2
033288,000187: 26,2163 00066 54D
033289,000188: 26,2164 02037 VECOEM
033290,000189: 26,2165 52761 REMA VXSC VAD*
033291,000190: 26,2166 00001 0D
033292,000191: 26,2167 02133 VECOEM +60D,1
033293,000192: 26,2170 72500 TIX,1 VSL2 # REM IN METERS X B-29 IN MPAC.
033294,000193: 26,2171 54165 REMA
033295,000194: 26,2172 77616 RVQ
033296,000195: 26,2173 65370 VEM AXT,1 PDDL # PD -2
033297,000196: 26,2174 00060 48D
033298,000197: 26,2175 14214 NINEB4
033299,000198: 26,2176 74206 PUSH VXSC # PD -4
033300,000199: 26,2177 02037 VECOEM
033301,000200: 26,2200 77761 VEMA VXSC
033302,000201: 26,2201 00001 0D
![]() |
Page 742 |
033304,000203: 26,2202 14005 STODL 4D # PD -2
033305,000204: 26,2203 41425 DSU PUSH # PD -4
033306,000205: 26,2204 14216 ONEB4
033307,000206: 26,2205 53357 VXSC* VAD
033308,000207: 26,2206 02125 VECOEM +54D,1
033309,000208: 26,2207 00005 4D
033310,000209: 26,2210 72500 TIX,1 VSL2 # VEM IN METERS/CS X B-7 IN MPAC.
033311,000210: 26,2211 54200 VEMA
033312,000211: 26,2212 77616 RVQ
033313,000212: 26,2213 22000 00000 NINEB4 2DEC 9.0 B-4
033314,000213: 26,2215 02000 00000 ONEB4 2DEC 1.0 B-4
033315,000214:
033316,000215:
033317,000216:
End of include-file LUNAR_AND_SOLAR_EPHEMERIDES_SUBROUTINES.agc. Parent file is MAIN.agc