Source Code
These source-code files were transcribed from scans made from Don Eyles's personal
copy of BURST120 (SUNBURST 120). They were scanned at archive.org's Boston
facility, and the scanning was sponsored by Mike Stewart. 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 in ALL-CAPS, whereas
comments added later in transcription are in Mixed-Case. 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 BURST120 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:YUL SYSTEM FOR AGC: REVISION 0 OF PROGRAM BURST120 BY NASA 2021106-031 DEC 7, 1967 THIS LISTING IS A COPY OF A VERSION OF THE PROGRAM INTENDED FOR USE IN THE ON-BOARD PRIMARY GUIDANCE COMPUTER IN THE UNMANNED FLIGHT OF APOLLO LUNAR MODULE 1 --- THE AS206 MISSION.Note that the date is the date of the printout, not the date of the program revision. |
027897,000002: ## Copyright: Public domain.
027898,000003: ## Filename: GIMBAL_LOCK_AVOIDANCE.agc
027899,000004: ## Purpose: A module for revision 0 of BURST120 (Sunburst). It
027900,000005: ## is part of the source code for the Lunar Module's
027901,000006: ## (LM) Apollo Guidance Computer (AGC) for Apollo 5.
027902,000007: ## Assembler: yaYUL
027903,000008: ## Contact: Ron Burkey <info@sandroid.org>.
027904,000009: ## Website: www.ibiblio.org/apollo/index.html
027905,000010: ## Mod history: 2016-09-30 RSB Created draft version.
027906,000011: ## 2016-10-22 MAS Transcribed.
027907,000012: ## 2016-10-31 RSB Typos.
027908,000013: ## 2016-11-01 RSB More typos.
027909,000014: ## 2016-12-06 RSB Comments proofed using octopus/ProoferComments,
027910,000015: ## changes made.
027911,000016: ## 2017-06-13 RSB Corrected typos discovered while transcribing
027912,000017: ## Sunburst 37.
027913,000018:
Page 661 |
027915,000020: # DETECTING GIMBAL LOCK
027916,000021: 34,3006 51545 LOCSKIRT DLOAD ABS
027917,000022: 34,3007 01624 COF
027918,000023: 34,3010 51025 DSU BPL # IF (ABS(COF )-CNGL) POS, GO TO NOGIMLOC
027919,000024: 34,3011 30442 CNGL # 0
027920,000025: 34,3012 71437 NOGIMLOC
027921,000026: 34,3013 41345 DLOAD DMP
027922,000027: 34,3014 01624 COF
027923,000028: 34,3015 01630 COF +4
027924,000029: 34,3016 65352 SL1 PDDL
027925,000030: 34,3017 01624 COF
027926,000031: 34,3020 72405 DMP SL1
027927,000032: 34,3021 01626 COF +2
027928,000033: 34,3022 63525 PDDL DSQ
027929,000034: 34,3023 01624 COF
027930,000035: 34,3024 55552 SL1 VDEF # 2
027931,000036: 34,3025 01602 STORE K1 # V1 = (COF , COF COF , COF COF ) $2
027932,000037: 34,3026 53276 VCOMP VAD # 0 0 1 0 2
027933,000038: 34,3027 30414 HALFA # -
027934,000039: 34,3030 15610 STODL K2 # V2 = ((1-V1 ), -V1 , -V1 ) $2
027935,000040: 34,3031 01626 COF +2 # 0 1 2
027936,000041: 34,3032 65276 DCOMP PDDL
027937,000042: 34,3033 01630 COF +4
027938,000043: 34,3034 55525 PDDL VDEF # -
027939,000044: 34,3035 30416 NIL # V3 = (0, COF , -COF )
027940,000045: 34,3036 25616 STOVL K3 # 2 1
027941,000046: 34,3037 01544 MIS +6 # - -
027942,000047: 34,3040 01635 STORE IG # IG = MIS $2
027943,000048: 34,3041 76521 MXV VSL1 # 3
027944,000049: 34,3042 01602 K1 # - - - -
027945,000050: 34,3043 15602 STODL P21 # (P21, D21, G21) = (V1, V2, V3) IG $2
027946,000051: 34,3044 01606 G21
027947,000052: 34,3045 65316 DSQ PDDL
027948,000053: 34,3046 01604 D21
027949,000054: 34,3047 43316 DSQ DAD
027950,000055: 34,3050 77766 SQRT # 2 2
027951,000056: 34,3051 01647 STORE RAD # RAD = SQRT(D21 D21 + G21 G21)
027952,000057: 34,3052 50025 DSU BMN
027953,000058: 34,3053 30440 SNGLCD # IF (RAD-SNGLCD) NEG, GO TO NOGIMLOC
027954,000059: 34,3054 71437 NOGIMLOC
027955,000060: 34,3055 51145 DLOAD BPL
027956,000061: 34,3056 01606 G21
027957,000062: 34,3057 71066 OKG21
027958,000063: 34,3060 57575 VLOAD VCOMP # IF G21 IS NEG ...
027959,000064: 34,3061 01635 IG # - -
027960,000065: 34,3062 15635 STODL IG # IG =-IG, RAD =-RAD
027961,000066: 34,3063 01647 RAD
027962,000067: 34,3064 77676 DCOMP
027963,000068: 34,3065 01647 STORE RAD
027964,000069:
Page 662 |
027966,000071: 34,3066 43345 OKG21 DLOAD DAD # IF G21 IS POS....
027967,000072: 34,3067 01602 P21
027968,000073: 34,3070 01647 RAD # IF (ABS(P21+RAD)-SD) NEG, GO NOGIMLOC
027969,000074: 34,3071 51400 BOV ABS
027970,000075: 34,3072 71076 CBMCALC
027971,000076: 34,3073 50025 DSU BMN # CBM = D21/RAD $2
027972,000077: 34,3074 30430 SD
027973,000078: 34,3075 71437 NOGIMLOC
027974,000079: 34,3076 70545 CBMCALC DLOAD SR1
027975,000080: 34,3077 01604 D21
027976,000081: 34,3100 44271 DDV BDSU
027977,000082: 34,3101 01647 RAD
027978,000083: 34,3102 01645 CAM
027979,000084: 34,3103 71244 BPL DLOAD
027980,000085: 34,3104 71437 NOGIMLOC
027981,000086: 34,3105 01574 MFI +12D
027982,000087: 34,3106 65325 PDDL PDDL
027983,000088: 34,3107 01566 MFI +6
027984,000089: 34,3110 01560 MFI # -
027985,000090: 34,3111 76466 VDEF VSL1 # OGF = (MFI , MFI , MFI ) $2
027986,000091: 34,3112 15616 STODL OGF # 0 3 6
027987,000092: 34,3113 01616 OGF
027988,000093: 34,3114 50015 DAD BMN
027989,000094: 34,3115 30442 CNGL # IF ((OGF ) + CNGL) NEG, GO TO ALTE
027990,000095: 34,3116 71134 ALTE # 0
027991,000096: 34,3117 47375 VLOAD VXV
027992,000097: 34,3120 30414 HALFA
027993,000098: 34,3121 01616 OGF
027994,000099: 34,3122 77656 UNIT
027995,000100: 34,3123 25560 STOVL E1 # E1 = UNIT(OGI X OGF)
027996,000101: 34,3124 01616 OGF
027997,000102: 34,3125 53455 VAD UNIT
027998,000103: 34,3126 30414 HALFA
027999,000104: 34,3127 77650 GOTO
028000,000105: 34,3130 71150 STORE2 # E2 = UNIT(OGI X OGF)
028001,000106: 34,3131 52175 SETE1 VLOAD GOTO
028002,000107: 34,3132 30420 NIL +2
028003,000108: 34,3133 71141 STOREE1 # E1 = (0,0,1)
028004,000109: 34,3134 47375 ALTE VLOAD VXV
028005,000110: 34,3135 30414 HALFA
028006,000111: 34,3136 01616 OGF
028007,000112: 34,3137 40056 UNIT BOV
028008,000113: 34,3140 71131 SETE1
028009,000114: 34,3141 01560 STOREE1 STORE E1
028010,000115: 34,3142 77635 VXV
028011,000116: 34,3143 30414 HALFA
028012,000117: 34,3144 47315 PDVL VXV
028013,000118: 34,3145 01616 OGF
028014,000119: 34,3146 01560 E1
028015,000120: 34,3147 53455 VAD UNIT # E2 = UNIT(E1 X OGI + OGF X E1)
028016,000121:
Page 663 |
028018,000123: 34,3150 77626 STORE2 STADR # - - -
028019,000124: 34,3151 76211 STORE E2 # E2 = UNIT(OGI + OGF) $2
028020,000125: 34,3152 50201 SETPD DOT
028021,000126: 34,3153 00001 0
028022,000127: 34,3154 01635 IG # - -
028023,000128: 34,3155 41552 SL1 PUSH # PD0 K2 $2
028024,000129: 34,3156 72516 DSQ SL1
028025,000130: 34,3157 50315 PDVL DOT # PD2 (K2 K2) $2
028026,000131: 34,3160 01560 E1
028027,000132: 34,3161 01635 IG
028028,000133: 34,3162 41552 SL1 PUSH # PD4 K1 $2
028029,000134: 34,3163 72516 DSQ SL1
028030,000135: 34,3164 45325 PDDL DSU # PD6 (K1 K1) $2
028031,000136: 34,3165 30436 K4SQ # = COS(D)COS(D) $2
028032,000137: 34,3166 00007 6
028033,000138: 34,3167 63406 PUSH DSQ # PD8 D1 $2
028034,000139: 34,3170 41325 PDDL DMP # PD10 (D1 D1) $4
028035,000140: 34,3171 01566 E2 # (K5)
028036,000141: 34,3172 30432 K3S1 # SIN(D) $1
028037,000142: 34,3173 62405 DMP SL2
028038,000143: 34,3174 00001 0 # K2
028039,000144: 34,3175 63525 PDDL DSQ # PD12 2 K2 K3 K5 $2
028040,000145: 34,3176 01566 E2
028041,000146: 34,3177 44352 SL1 BDSU # K5K5 $2 PUSH UP 2 K2 K3 K5 $2
028042,000147: 34,3200 43225 DSU DAD
028043,000148: 34,3201 00003 2
028044,000149: 34,3202 00007 6
028045,000150: 34,3203 63406 PUSH DSQ # PD12 D2 $2
028046,000151: 34,3204 41325 PDDL DMP # PD14 (D2 D2) $4
028047,000152: 34,3205 01566 E2
028048,000153: 34,3206 30432 K3S1
028049,000154: 34,3207 41421 BDSU PUSH
028050,000155: 34,3210 00001 0 # PD16 B1 $2
028051,000156: 34,3211 77605 DMP
028052,000157: 34,3212 00005 4 # B1 K1 $4
028053,000158: 34,3213 41552 SL1 PUSH # PD18 B1 K1 $2
028054,000159: 34,3214 65316 DSQ PDDL # PD22 B1 B1 K1 K1 $4
028055,000160: 34,3215 00011 8D
028056,000161: 34,3216 41405 DMP PUSH # PD22 D1 D2 $4
028057,000162: 34,3217 00015 12D
028058,000163: 34,3220 45221 BDSU DSU
028059,000164: 34,3221 00025 20D
028060,000165: 34,3222 00013 10D # RSQ $4
028061,000166: 34,3223 41366 SQRT DMP
028062,000167: 34,3224 00023 18D
028063,000168: 34,3225 70525 PDDL SR1 # PD24 RADICAL $8
028064,000169: 34,3226 00017 14D
028065,000170: 34,3227 72525 PDDL SL1 # PD26 (D2 D2) $8
028066,000171: 34,3230 00025 20D # 4(B1 B1 K1 K1) $8
028067,000172: 34,3231 77615 DAD # PUSH UP FOR (D2 D2) $8
Page 664 |
028069,000174: 34,3232 70525 PDDL SR1 # PD26 DENOMR (D2 D2)
028070,000175: 34,3233 00027 22D
028071,000176: 34,3234 41421 BDSU PUSH # PD28 NUM
028072,000177: 34,3235 00025 20D
028073,000178: 34,3236 56215 DAD DDV # NUM
028074,000179: 34,3237 00031 24D # + RADICAL
028075,000180: 34,3240 00033 26D # DENOM
028076,000181: 34,3241 60404 BOVB SR2
028077,000182: 34,3242 73501 SIGNMPAC
028078,000183: 34,3243 01610 STORE C2SQP # $4
028079,000184: 34,3244 77766 SQRT
028080,000185: 34,3245 15614 STODL C2PP # $2
028081,000186: 34,3246 00031 24D # NUM
028082,000187: 34,3247 56221 BDSU DDV # PUSH UP FOR NUM, DENOM
028083,000188: 34,3250 60404 BOVB SR2
028084,000189: 34,3251 73501 SIGNMPAC
028085,000190: 34,3252 01612 STORE C2SQM # $4
028086,000191: 34,3253 77766 SQRT
028087,000192: 34,3254 15616 STODL C2MP # $2
028088,000193: 34,3255 30426 QUARTA # 1 $4
028089,000194: 34,3256 75425 DSU SQRT
028090,000195: 34,3257 01610 C2SQP
028091,000196: 34,3260 15620 STODL C1PP # $2
028092,000197: 34,3261 30426 QUARTA
028093,000198: 34,3262 75425 DSU SQRT
028094,000199: 34,3263 01612 C2SQM
028095,000200: 34,3264 01622 STORE C1MP # $2
028096,000201: 34,3265 66370 AXT,1 SSP
028097,000202: 34,3266 00004 4
028098,000203: 34,3267 00051 S1
028099,000204: 34,3270 00002 2
028100,000205: 34,3271 71201 NORM SETPD DLOAD
028101,000206: 34,3272 00023 18D
028102,000207: 34,3273 00021 16D # B1 $2
028103,000208: 34,3274 65203 DMP* PDDL # PD18 = -Q $4
028104,000209: 34,3275 01620 C2PP +4,1
028105,000210: 34,3276 01566 E2
028106,000211: 34,3277 40716 DSQ DMP*
028107,000212: 34,3300 01614 C2SQP +4,1
028108,000213: 34,3301 44312 SL2 BDSU
028109,000214: 34,3302 30426 QUARTA
028110,000215: 34,3303 41366 SQRT DMP
028111,000216: 34,3304 30434 K4 # PD20 = -R $4
028112,000217: 34,3305 40725 PDDL DMP*
028113,000218: 34,3306 00005 4 # K1 $2
028114,000219: 34,3307 01624 C1PP +4,1
028115,000220: 34,3310 65246 ABS PDDL # PD22 AC1 $4
028116,000221: 34,3311 00023 18D # -Q
028117,000222: 34,3312 57415 DAD DCOMP
028118,000223: 34,3313 00025 20D # -R
Page 665 |
028120,000225: 34,3314 45325 PDDL DSU # PD24 ANSW1 = Q + R $4
028121,000226: 34,3315 00023 18D # -Q
028122,000227: 34,3316 00025 20D # +R
028123,000228: 34,3317 41476 DCOMP PUSH # PD26 ANSW2 = Q - R $4
028124,000229: 34,3320 45246 ABS DSU
028125,000230: 34,3321 00027 22D # AC1
028126,000231: 34,3322 65246 ABS PDDL # PD28 ABS(ABS(ANSW2) -AC1)
028127,000232: 34,3323 00031 24D # ANSW1
028128,000233: 34,3324 45246 ABS DSU
028129,000234: 34,3325 00027 22D # AC1
028130,000235: 34,3326 45246 ABS DSU # ABS(ABS(ANSW1)-AC1)
028131,000236: 34,3327 71244 BPL DLOAD
028132,000237: 34,3330 71353 CKSGNAN2
028133,000238: 34,3331 00031 24D # ANSW1
028134,000239: 34,3332 71244 SIGNANSW BPL DLOAD
028135,000240: 34,3333 71345 SAMEASK1
028136,000241: 34,3334 00005 4 # K1
028137,000242: 34,3335 70640 BMN DLOAD*
028138,000243: 34,3336 71342 OKC2
028139,000244: 34,3337 01620 C2PP +4,1
028140,000245: 34,3340 77676 OPPSGNC2 DCOMP
028141,000246: 34,3341 05620 STORE C2PP +4,1
028142,000247: 34,3342 52100 OKC2 TIX,1 GOTO
028143,000248: 34,3343 71271 NORM
028144,000249: 34,3344 71356 OUTCYCLE
028145,000250: 34,3345 51145 SAMEASK1 DLOAD BPL
028146,000251: 34,3346 00005 4 # K1
028147,000252: 34,3347 71342 OKC2
028148,000253: 34,3350 52143 DLOAD* GOTO
028149,000254: 34,3351 01620 C2PP +4,1
028150,000255: 34,3352 71340 OPPSGNC2
028151,000256: 34,3353 52145 CKSGNAN2 DLOAD GOTO
028152,000257: 34,3354 00033 26D # ANSW2
028153,000258: 34,3355 71332 SIGNANSW
028154,000259: 34,3356 77201 OUTCYCLE SETPD VLOAD
028155,000260: 34,3357 00001 0
028156,000261: 34,3360 01624 COF # - -
028157,000262: 34,3361 63241 DOT PDVL # PD0 U1 = COF.E1
028158,000263: 34,3362 01560 E1
028159,000264: 34,3363 01624 COF # - -
028160,000265: 34,3364 41441 DOT PUSH # PD2 U2 = COF.E2
028161,000266: 34,3365 01566 E2
028162,000267: # PICK THE NEW U WHICH IS CLOSEST TO THE OLD U
028163,000268: 34,3366 41370 AXT,1 DMP
028164,000269: 34,3367 00000 0
028165,000270: 34,3370 01614 C2PP
028166,000271: 34,3371 41325 PDDL DMP # PD4 U2 C2(0)
028167,000272: 34,3372 01620 C1PP
028168,000273: 34,3373 00001 0 # U1 C1(0)
028169,000274: 34,3374 51415 DAD ABS
Page 666 |
028171,000276: 34,3375 41325 PDDL DMP # PD4 ABS(U1 C1(0) + U2 C2(0))
028172,000277: 34,3376 00003 2
028173,000278: 34,3377 01616 C2MP
028174,000279: 34,3400 41325 PDDL DMP # PD6 U2 C2(1)
028175,000280: 34,3401 00001 0
028176,000281: 34,3402 01622 C1MP # PUSH UP U2 C2(1)
028177,000282: 34,3403 51415 DAD ABS # ABS(U1 C1(1) + U2 C2(1))
028178,000283: 34,3404 77625 DSU # PUSH UP 4
028179,000284: 34,3405 74040 BMN AXC,1
028180,000285: 34,3406 71410 JZERO
028181,000286: 34,3407 00002 2
028182,000287: 34,3410 74343 JZERO DLOAD* VXSC
028183,000288: 34,3411 01620 C1PP,1
028184,000289: 34,3412 01560 E1
028185,000290: 34,3413 74323 PDDL* VXSC
028186,000291: 34,3414 01614 C2PP,1
028187,000292: 34,3415 01566 E2
028188,000293: 34,3416 77655 VAD
028189,000294: 34,3417 77656 UNIT # NEW COF - -
028190,000295: 34,3420 01624 STORE COF # COF = C1 E1 + C2 E2
028191,000296: # NEW MANEUVER ANGLE IS
028192,000297: 34,3421 63545 DLOAD DSQ
028193,000298: 34,3422 01624 COF
028194,000299: 34,3423 44352 SL1 BDSU # 2
028195,000300: 34,3424 30414 HALFA # (1 - COF ) $2
028196,000301: 34,3425 63525 PDDL DSQ # 0
028197,000302: 34,3426 01566 E2
028198,000303: 34,3427 56221 BDSU DDV # 2
028199,000304: 34,3430 30426 QUARTA # (1 - K5 ) $4
028200,000305: 34,3431 75542 SR1 SQRT
028201,000306: 34,3432 72536 ARCSIN SL1
028202,000307: 34,3433 01643 STORE AM
028203,000308: 34,3434 77614 CLRGO # STATE SWITCH NO. 31
028204,000309: 34,3435 01221 31D # 0(OFF) = MANEUVER WENT THRU GIMBAL LOCK
028205,000310: 34,3436 71441 WCALC # 1(ON) = MANEUVER DID NOT GO THRU GIMLOCK
028206,000311: 34,3437 77614 NOGIMLOC SET
028207,000312: 34,3440 01061 31D
028208,000313: 34,3441 70740 WCALC LXC,1 DLOAD*
028209,000314: 34,3442 01652 RATEINDX # CHOOSE THE DESIRED MANEUVER RATE
028210,000315: 34,3443 31465 ARATE,1 # FROM A LIST OF FOUR
028211,000316: 34,3444 45002 SR4 CALL # COMPUTE THE INCREMENTAL ROTATION MATRIX
028212,000317: 34,3445 70564 DELCOMP # DEL CORRESPONDING TO A 1 SEC ROTATION
028213,000318: # ABOUT COF
028214,000319: 34,3446 74343 DLOAD* VXSC
028215,000320: 34,3447 31465 ARATE,1
028216,000321: 34,3450 01624 COF
028217,000322: 34,3451 15635 STODL BRATE # COMPONENT MANEUVER RATES 45 DEG/SEC
028218,000323: 34,3452 01643 AM
028219,000324: 34,3453 55605 DMP DDV*
028220,000325: 34,3454 31475 ANGLTIME
Page 667 |
028222,000327: 34,3455 31465 ARATE,1
028223,000328: 34,3456 77661 SR
028224,000329: 34,3457 20606 5
028225,000330: 34,3460 01645 STORE TM # MANEUVER EXECUTION TIME SCALED AS T2
028226,000331: 34,3461 77614 SETGO # STATE SWITCH NO. 32
028227,000332: 34,3462 01022 32D # 0(OFF) = CONTINUE MANEUVER
028228,000333: 34,3463 71477 NEWDELHI +1 # 1(ON) = START MANEUVER
028229,000334:
028230,000335:
028231,000336: # THE FOUR SELECTABLE FREE FALL MANEUVER RATES SELECTED BY
028232,000337: # LOADING RATEINDX WITH 0,2,4,6, RESPECTIVELY
028233,000338:
028234,000339:
028235,000340: 34,3464 00554 02660 ARATE 2DEC .0222222222 # =.5 DEG/SEC $ 22.5DEG/SEC
028236,000341:
028237,000342: 34,3466 02660 13301 2DEC .0888888888 # = 2 DEG/SEC $ 22.5DEG/SEC
028238,000343:
028239,000344: 34,3470 07070 34344 2DEC .2222222222 # = 5 DEG/SEC $ 22.5DEG/SEC
028240,000345:
028241,000346: 34,3472 16161 30707 2DEC .4444444444 # =10 DEG/SEC $ 22.5DEG/SEC
028242,000347:
028243,000348: 34,3474 00003 04000 ANGLTIME 2DEC .0001907349 # = 100B-19 FUDGE FACTOR TO CONVERT
028244,000349: # MANEUVER ANGLE TO MANEUVER TIME
End of include-file GIMBAL_LOCK_AVOIDANCE.agc. Parent file is MAIN.agc