Source Code
These source-code files are part of a reconstructed copy of Artemis 071, the
first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
058023,000002: ## Copyright: Public domain.
058024,000003: ## Filename: INFLIGHT_ALIGNMENT_ROUTINES.agc
058025,000004: ## Purpose: A section of Artemis revision 071.
058026,000005: ## It is part of the reconstructed source code for the first
058027,000006: ## release of the flight software for the Command Module's
058028,000007: ## (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
058029,000008: ## 17. The code has been recreated from a copy of Artemis 072.
058030,000009: ## It has been adapted such that the resulting bugger words
058031,000010: ## exactly match those specified for Artemis 071 in NASA
058032,000011: ## drawing 2021154-, which gives relatively high confidence
058033,000012: ## that the reconstruction is correct.
058034,000013: ## Reference: 1354
058035,000014: ## Assembler: yaYUL
058036,000015: ## Contact: Ron Burkey <info@sandroid.org>.
058037,000016: ## Website: www.ibiblio.org/apollo/index.html
058038,000017: ## Mod history: 2019-08-14 MAS Created from Artemis 072.
058039,000018:
Page 1354 |
058041,000020:
058042,000021: 23,2000 SETLOC INFLIGHT
058043,000022: 23,2000 BANK
058044,000023:
058045,000024: 23,3240 E5,1671 EBANK= XSM
058046,000025:
058047,000026: # CALCGTA COMPUTES THE GYRO TORQUE ANGLES REQUIRED TO BRING THE STABLE MEMBER INTO THE DESIRED ORIENTATION.
058048,000027:
058049,000028: # THE INPUT IS THE DESIRED STABLE MEMBER COORDINATES REFERRED TO PRESENT STABLE MEMBER COORDINATES. THE THREE
058050,000029: # HALF-UNIT VECTORS ARE STORED AT XDC, YDC, AND ZDC.
058051,000030:
058052,000031: # THE OUTPUTS ARE THE THREE GYRO TORQUING ANGLES TO BE APPLIED TO THE Y, Z, AND X GYROS AND ARE STORED DP AT IGC,
058053,000032: # MGC, AND OGC RESPECTIVELY.
058054,000033:
058055,000034: 23,3240 COUNT* $$/INFLT
058056,000035: 23,3240 71220 CALCGTA ITA DLOAD # PUSHDOWN 00-03,16D-27D,34D-37D
058057,000036: 23,3241 00051 S2 # XDC = (XD1 XD2 XD3)
058058,000037: 23,3242 02714 XDC # YDC = (YD1 YD2 YD3)
058059,000038: 23,3243 65325 PDDL PDDL # ZDC = (ZD1 ZD2 ZD3)
058060,000039: 23,3244 15336 HI6ZEROS
058061,000040: 23,3245 02720 XDC +4
058062,000041: 23,3246 55476 DCOMP VDEF
058063,000042: 23,3247 77656 UNIT
058064,000043: 23,3250 14027 STODL ZPRIME # ZP = UNIT(-XD3 0 XD1) = (ZP1 ZP2 ZP3)
058065,000044: 23,3251 00027 ZPRIME
058066,000045:
058067,000046: 23,3252 77742 SR1
058068,000047: 23,3253 14023 STODL SINTH # SIN(IGC) = ZP1
058069,000048: 23,3254 00033 ZPRIME +4
058070,000049: 23,3255 77742 SR1
058071,000050: 23,3256 34021 STCALL COSTH # COS(IGC) = ZP3
058072,000051: 23,3257 47311 ARCTRIG
058073,000052:
058074,000053: 23,3260 16762 STODL IGC # Y GYRO TORQUING ANGLE FRACTION OF REV.
058075,000054: 23,3261 02716 XDC +2
058076,000055: 23,3262 77742 SR1
058077,000056: 23,3263 14023 STODL SINTH # SIN(MGC) = XD2
058078,000057: 23,3264 00027 ZPRIME
058079,000058:
058080,000059: 23,3265 65205 DMP PDDL
058081,000060: 23,3266 02720 XDC +4 # PD00 = (ZP1)(XD3)
058082,000061: 23,3267 00033 ZPRIME +4
058083,000062:
058084,000063: 23,3270 45205 DMP DSU
058085,000064: 23,3271 02714 XDC # MPAC = (ZP3)(XD1)
058086,000065: 23,3272 77626 STADR
058087,000066: 23,3273 43756 STCALL COSTH # COS(MGC) = MPAC - PD00
058088,000067: 23,3274 47311 ARCTRIG
058089,000068: 23,3275 26764 STOVL MGC # Z GYRO TORQUING ANGLE FRACTION OF REV.
Page 1355 |
058091,000070: 23,3276 00027 ZPRIME
058092,000071: 23,3277 77641 DOT
058093,000072: 23,3300 02730 ZDC
058094,000073: 23,3301 24021 STOVL COSTH # COS(OGC) = ZP . ZDC
058095,000074: 23,3302 00027 ZPRIME
058096,000075: 23,3303 77641 DOT
058097,000076: 23,3304 02722 YDC
058098,000077: 23,3305 34023 STCALL SINTH # SIN(OGC) = ZP . YDC
058099,000078: 23,3306 47311 ARCTRIG
058100,000079:
058101,000080: 23,3307 36760 STCALL OGC # X GYRO TORQUING ANGLE FRACTION OF REV.
058102,000081: 23,3310 00051 S2
058103,000082:
Page 1356 |
058105,000084:
058106,000085: # ARCTRIG COMPUTES AN ANGLE GIVEN THE SINE AND COSINE OF THIS ANGLE.
058107,000086:
058108,000087: # THE INPUTS ARE SIN/4 AND COS/4 STORED DP AT SINTH AND COSTH.
058109,000088:
058110,000089: # THE OUTPUT IS THE CALCULATED ANGLE BETWEEN +.5 AND -.5 REVOLUTIONS AND STORED AT THETA. THE OUTPUT IS ALSO
058111,000090: # AVAILABLE AT MPAC.
058112,000091:
058113,000092: 23,3311 51545 ARCTRIG DLOAD ABS # PUSHDOWN 16D-21D
058114,000093: 23,3312 00023 SINTH
058115,000094: 23,3313 50025 DSU BMN
058116,000095: 23,3314 07525 QTSN45 # ABS(SIN/4) - SIN(45)/4
058117,000096: 23,3315 47324 TRIG1 # IF (-45,45) OR (135,-135)
058118,000097:
058119,000098: 23,3316 72545 DLOAD SL1 # (45,135) OR (-135,-45)
058120,000099: 23,3317 00021 COSTH
058121,000100: 23,3320 75326 ACOS SIGN
058122,000101: 23,3321 00023 SINTH
058123,000102: 23,3322 00025 STORE THETA # X = ARCCOS(COS) WITH SIGN(SIN)
058124,000103: 23,3323 77616 RVQ
058125,000104:
058126,000105: 23,3324 72545 TRIG1 DLOAD SL1 # (-45,45) OR (135,-135)
058127,000106: 23,3325 00023 SINTH
058128,000107: 23,3326 77736 ASIN
058129,000108: 23,3327 14025 STODL THETA # X = ARCSIN(SIN) WITH SIGN(SIN)
058130,000109: 23,3330 00021 COSTH
058131,000110: 23,3331 77640 BMN
058132,000111: 23,3332 47335 TRIG2 # IF (135,-135)
058133,000112:
058134,000113: 23,3333 43545 DLOAD RVQ
058135,000114: 23,3334 00025 THETA # X = ARCSIN(SIN) (-45,45)
058136,000115:
058137,000116: 23,3335 75345 TRIG2 DLOAD SIGN # (135,-135)
058138,000117: 23,3336 15334 HIDPHALF
058139,000118: 23,3337 00023 SINTH
058140,000119: 23,3340 77625 DSU
058141,000120: 23,3341 00025 THETA
058142,000121: 23,3342 00025 STORE THETA # X = .5 WITH SIGN(SIN) - ARCSIN(SIN)
058143,000122: 23,3343 77616 RVQ # (+) - (+) OR (-) - (-)
058144,000123:
Page 1357 |
058146,000125: # SMNB, NBSM, AND AXISROT, WHICH USED TO APPEAR HERE, HAVE BEEN
058147,000126: # COMBINED IN A ROUTINE CALLED AX*SR*T, WHICH APPEARS AMONG THE POWERED
058148,000127: # FLIGHT SUBROUTINES.
058149,000128:
Page 1358 |
058151,000130: # CALCGA COMPUTES THE CDU DRIVING ANGLES REQUIRED TO BRING THE STABLE MEMBER INTO THE DESIRED ORIENTATION.
058152,000131:
058153,000132: # THE INPUTS ARE 1) THE NAVIGATION BASE COORDINATES REFERRED TO ANY COORDINATE SYSTEM. THE THREE HALF-UNIT
058154,000133: # VECTORS ARE STORED AT XNB, YNB, AND ZNB. 2) THE DESIRED STABLE MEMBER COORDINATES REFERRED TO THE SAME
058155,000134: # COORDINATE SYSTEM ARE STORED AT XSM, YSM, AND ZSM.
058156,000135:
058157,000136: # THE OUTPUTS ARE THE THREE CDU DRIVING ANGLES AND ARE STORED SP AT THETAD, THETAD +1, AND THETAD +2.
058158,000137:
058159,000138: 23,3344 77601 CALCGA SETPD # PUSHDOWN 00-05, 16D-21D, 34D-37D
058160,000139: 23,3345 00001 0
058161,000140: 23,3346 47375 VLOAD VXV
058162,000141: 23,3347 02714 XNB # XNB = OGA (OUTER GIMBAL AXIS)
058163,000142: 23,3350 02700 YSM # YSM = IGA (INNER GIMBAL AXIS)
058164,000143: 23,3351 41456 UNIT PUSH # PD0 = UNIT(OGA X IGA) = MGA
058165,000144:
058166,000145: 23,3352 44041 DOT ITA
058167,000146: 23,3353 02730 ZNB
058168,000147: 23,3354 00051 S2
058169,000148: 23,3355 24021 STOVL COSTH # COS(OG) = MGA . ZNB
058170,000149: 23,3356 00001 0
058171,000150: 23,3357 77641 DOT
058172,000151: 23,3360 02722 YNB
058173,000152: 23,3361 34023 STCALL SINTH # SIN(OG) = MGA . YNB
058174,000153: 23,3362 47311 ARCTRIG
058175,000154: 23,3363 26760 STOVL OGC
058176,000155: 23,3364 00001 0
058177,000156:
058178,000157: 23,3365 50235 VXV DOT # PROVISION FOR MG ANGLE OF 90 DEGREES
058179,000158: 23,3366 02714 XNB
058180,000159: 23,3367 02700 YSM
058181,000160: 23,3370 77752 SL1
058182,000161: 23,3371 24021 STOVL COSTH # COS(MG) = IGA . (MGA X OGA)
058183,000162: 23,3372 02700 YSM
058184,000163: 23,3373 77641 DOT
058185,000164: 23,3374 02714 XNB
058186,000165: 23,3375 34023 STCALL SINTH # SIN(MG) = IGA . OGA
058187,000166: 23,3376 47311 ARCTRIG
058188,000167: 23,3377 02764 STORE MGC
058189,000168:
058190,000169: 23,3400 45246 ABS DSU
058191,000170: 23,3401 07527 .166...
058192,000171: 23,3402 77644 BPL
058193,000172: 23,3403 47422 GIMLOCK1 # IF ANGLE GREATER THAN 60 DEGREES
058194,000173:
058195,000174: 23,3404 50375 CALCGA1 VLOAD DOT
058196,000175: 23,3405 02706 ZSM
058197,000176: 23,3406 00001 0
058198,000177: 23,3407 24021 STOVL COSTH # COS(IG) = ZSM . MGA
058199,000178: 23,3410 02672 XSM
Page 1359 |
058201,000180: 23,3411 45441 DOT STADR
058202,000181: 23,3412 43754 STCALL SINTH # SIN(IG) = XSM . MGA
058203,000182: 23,3413 47311 ARCTRIG
058204,000183:
058205,000184: 23,3414 26762 STOVL IGC
058206,000185: 23,3415 02760 OGC
058207,000186: 23,3416 77634 RTB
058208,000187: 23,3417 45644 V1STO2S
058209,000188: 23,3420 35310 STCALL THETAD
058210,000189: 23,3421 00051 S2
058211,000190:
058212,000191: 23,3422 77776 GIMLOCK1 EXIT
058213,000192: 23,3423 05671 TC ALARM
058214,000193: 23,3424 00401 OCT 00401
058215,000194: 23,3425 05547 TC UPFLAG # GIMBAL LOCK HAS OCCURED
058216,000195: 23,3426 00056 ADRES GLOKFAIL
058217,000196:
058218,000197: 23,3427 06006 TC INTPRET
058219,000198: 23,3430 77650 GOTO
058220,000199: 23,3431 47404 CALCGA1
058221,000200:
Page 1360 |
058223,000202:
058224,000203: # AXISGEN COMPUTES THE COORDINATES OF ONE COORDINATE SYSTEM REFERRED TO ANOTHER COORDINATE SYSTEM.
058225,000204:
058226,000205: # THE INPUTS ARE 1) THE STAR1 VECTOR REFERRED TO COORDINATE SYSTEM A STORED AT STARAD. 2) THE STAR2 VECTOR
058227,000206: # REFERRED TO COORDINATE SYSTEM A STORED AT STARAD +6. 3) THE STAR1 VECTOR REFERRED TO COORDINATE SYSTEM B STORED
058228,000207: # AT LOCATION 6 OF THE VAC AREA. 4) THE STAR2 VECTOR REFERRED TO COORDINATE SYSTEM B STORED AT LOCATION 12D OF
058229,000208: # THE VAC AREA.
058230,000209:
058231,000210: # THE OUTPUT DEFINES COORDINATE SYSTEM A REFERRED TO COORDINATE SYSTEM B. THE THREE HALF-UNIT VECTORS ARE STORED
058232,000211: # AT LOCATIONS XDC, XDC +6, XDC +12D, AND STARAD, STARAD +6, STARAD +12D.
058233,000212:
058234,000213: 23,3432 66370 AXISGEN AXT,1 SSP # PUSHDOWN 00-30D,34D-37D
058235,000214: 23,3433 02743 STARAD +6
058236,000215: 23,3434 00051 S1
058237,000216: 23,3435 02727 STARAD -6
058238,000217:
058239,000218: 23,3436 77601 SETPD
058240,000219: 23,3437 00001 0
058241,000220: 23,3440 46773 AXISGEN1 VLOAD* VXV* # 06D UA = S1
058242,000221: 23,3441 02752 STARAD +12D,1 # STARAD +00D UB = S1
058243,000222: 23,3442 02760 STARAD +18D,1
058244,000223: 23,3443 77656 UNIT # 12D VA = UNIT(S1 X S2)
058245,000224: 23,3444 06760 STORE STARAD +18D,1 # STARAD +06D VB = UNIT(S1 X S2)
058246,000225: 23,3445 77773 VLOAD*
058247,000226: 23,3446 02752 STARAD +12D,1
058248,000227:
058249,000228: 23,3447 76433 VXV* VSL1
058250,000229: 23,3450 02760 STARAD +18D,1 # 18D WA = UA X VA
058251,000230: 23,3451 06766 STORE STARAD +24D,1 # STARAD +12D WB = UB X VB
058252,000231:
058253,000232: 23,3452 77700 TIX,1
058254,000233: 23,3453 47440 AXISGEN1
058255,000234:
058256,000235: 23,3454 66160 AXC,1 SXA,1
058257,000236: 23,3455 00006 6
058258,000237: 23,3456 00036 30D
058259,000238:
058260,000239: 23,3457 66370 AXT,1 SSP
058261,000240: 23,3460 00022 18D
058262,000241: 23,3461 00051 S1
058263,000242: 23,3462 00006 6
058264,000243:
058265,000244: 23,3463 66374 AXT,2 SSP
058266,000245: 23,3464 00006 6
058267,000246: 23,3465 00052 S2
058268,000247: 23,3466 00002 2
058269,000248:
058270,000249: 23,3467 76720 AXISGEN2 XCHX,1 VLOAD*
058271,000250: 23,3470 00036 30D # X1=-6 X2=+6 X1=-6 X2=+4 X1=-6 X2=+2
058272,000251: 23,3471 00001 0,1
058273,000252:
Page 1361 |
058275,000254: 23,3472 62757 VXSC* PDVL* # J=(UA)(UB1) J=(UA)(UB2) J=(UA)(UB3)
058276,000255: 23,3473 75033 STARAD +6,2
058277,000256: 23,3474 00007 6,1
058278,000257: 23,3475 77757 VXSC*
058279,000258: 23,3476 75025 STARAD +12D,2
058280,000259: 23,3477 30031 STOVL* 24D # K=(VA)(VB1) J=(VA)(VB2) J=(VA)(VB3)
058281,000260: 23,3500 00015 12D,1
058282,000261:
058283,000262: 23,3501 53357 VXSC* VAD
058284,000263: 23,3502 75017 STARAD +18D,2 # L=(WA)(WB1) J=(WA)(WB2) J=(WA)(WB3)
058285,000264: 23,3503 76455 VAD VSL1
058286,000265: 23,3504 00031 24D
058287,000266: 23,3505 53520 XCHX,1 UNIT
058288,000267: 23,3506 00036 30D
058289,000268: 23,3507 06736 STORE XDC +18D,1 # XDC = L+J+K YDC = L+J+K ZDC = L+J+K
058290,000269:
058291,000270: 23,3510 77700 TIX,1
058292,000271: 23,3511 47512 AXISGEN3
058293,000272:
058294,000273: 23,3512 77704 AXISGEN3 TIX,2
058295,000274: 23,3513 47467 AXISGEN2
058296,000275:
058297,000276: 23,3514 77775 VLOAD
058298,000277: 23,3515 02714 XDC
058299,000278: 23,3516 26736 STOVL STARAD
058300,000279: 23,3517 02722 YDC
058301,000280: 23,3520 26744 STOVL STARAD +6
058302,000281: 23,3521 02730 ZDC
058303,000282: 23,3522 02752 STORE STARAD +12D
058304,000283:
058305,000284: 23,3523 77616 RVQ
058306,000285:
Page 1362 |
058308,000287: 23,3524 05520 26075 QTSN45 2DEC .1768
058309,000288: 23,3526 05252 25253 .166... 2DEC .1666666667
058310,000289:
Page 1363 Empty page |
058313,000292:
058314,000293:
End of include-file INFLIGHT_ALIGNMENT_ROUTINES.agc. Parent file is MAIN.agc