Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

001360,000002:                                                                                                  ## Copyright:   Public domain.
001361,000003:                                                                                                  ## Filename:    INPUT_OUTPUT_CHANNEL_BIT_DESCRIPTIONS.agc
001362,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
001363,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
001364,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
001365,000007:                                                                                                  ##              No original listings of this program are available;
001366,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
001367,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
001368,000010:                                                                                                  ## Assembler:   yaYUL
001369,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
001370,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
001371,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
001372,000014: 
001373,000015: 
001374,000016:                                                                                                  #  *** CHANNEL DESCRIPTIONSF WORDS ARE ALLOCATED IN ERASABLE ASSIGNMENTS ***
001375,000017: 
001376,000018:                                                                                                  #      CHANNEL 1     IDENTICAL TO COMPUTER REGISTER L (0001)
001377,000019: 
001378,000020: 
001379,000021:                                                                                                  #      CHANNEL 2     IDENTICAL TO COMPUTER REGISTER Q (0002)
001380,000022: 
001381,000023: 
001382,000024:                                                                                                  #      CHANNEL 3     HISCALAR; INPUT CHANNEL; MOST SIGNIFICANT 14 BITS FROM 33 STAGE BINARY COUNTER. SCALE
001383,000025:                                                                                                  #                    FACTOR IS B23 IN CSEC, SO MAX VALUE ABOUT 23.3 HOURS AND LEAST SIGNIFICANT BIT 5.12 SECS.
001384,000026: 
001385,000027: 
001386,000028:                                                                                                  #      CHANNEL 4     LOSCALAR; INPUT CHANNEL; NEXT MOST SIGNIFICANT 14 BITS FROM THE 33 STAGE BINARY COUNTER
001387,000029:                                                                                                  #                    ASSOCIATED WITH CHANNEL 3. SCALE FACTOR IS B9 IN  CSEC. SO MAX VAL IS 5.12 SEC AND LEAST
001388,000030:                                                                                                  #                    SIGNIFICANT BIT IS 1/3200 SEC. SCALE FACTOR OF D.P. WORD WITH CHANNEL 3 IS B23 CSEC.
001389,000031: 
001390,000032: 
001391,000033:                                                                                                  #      CHANNEL 5     PYJETS; OUTPUT CHANNEL; PITCH RCS JET CONTROL.   (REACTION CONTROL SYSTEM) USES BITS 1-8.
001392,000034: 
001393,000035: 
001394,000036:                                                                                                  #      CHANNEL 6     ROLLJETS; OUTPUT CHANNEL; ROLL RCS JET CONTROL.   (REACTION CONTROL SYSTEM) USES BIT 1-8.
001395,000037: 
001396,000038: 
001397,000039:                                                                                                  #      CHANNEL 7     SUPERBNK; OUTPUT CHANNEL; NOT RESET BY RESTART;   FIXED EXTENSION BITS USED TO SELECT THE
001398,000040:                                                                                                  #                    APPROPRIATE FIXED MEMORY BANK IF FBANK IS 30 OCTAL OR MORE. USES BITS 5-7.
001399,000041: 
001400,000042: 
001401,000043:                                                                                                  #      CHANNEL 10    OUTO; OUTPUT CHANNEL; REGISTER USED TO TRANSMIT   LATCHING-RELAY DRIVING INFORMATION FOR
001402,000044:                                                                                                  #                    THE DISPLAY SYSTEM. BITS 15-12 ARE SET TO THE ROW NUMBER (1-14 OCTAL) OF THE RELAY TO BE
001403,000045:                                                                                                  #                    CHANGED AND BITS 11-1 CONTAIN THE REQUIRED SETTINGS FOR THE RELAYS IN THE ROW.
001404,000046: 
001405,000047: 
001406,000048:                                                                                                  #      CHANNEL 11    DSALMOUT; OUTPUT CHANNEL; REGISTER WHOSE BITS ARE USED FOR ENGINE ON-OFF CONTROL AND TO
001407,000049:                                                                                                  #                    DRIVE INDIVIDUAL INDICATORS OF THE DISPLAY SYSTEM. BITS 1-7 ARE A RELAYS.
001408,000050: 
001409,000051:                                                                                                  #        BIT 1       ISS WARNING
001410,000052: 
001411,000053:                                                                                                  #        BIT 2       LIGHT COMPUTER ACTIVITY LAMP
001412,000054: 
001413,000055:                                                                                                  #        BIT 3       LIGHT UPLINK ACTIVITY LAMP
001414,000056: 
001415,000057:                                                                                                  #        BIT 4       LIGHT TEMP CAUTION LAMP
001416,000058: 
001417,000059:                                                                                                  #        BIT 5       LIGHT KEYBOARD RELEASE LAMP
001418,000060: 
001419,000061:                                                                                                  #        BIT 6       FLASH VERB AND NOUN LAMPS
001420,000062: 
001421,000063:                                                                                                  #        BIT 7       LIGHT OPERATOR ERROR LAMP
001422,000064: 
001423,000065: 
001424,000066:                                                                                                  #        BIT 8       SPARE
001425,000067: 
001426,000068:                                                                                                  #        BIT 9       TEST CONNECTOR OUTBIT
001427,000069: 
001428,000070:                                                                                                  #        BIT 10      CAUTION RESET
001429,000071: 
001430,000072:                                                                                                  #        BIT 11      SPARE
001431,000073: 
001432,000074:                                                                                                  #        BIT 12      SPARE
001433,000075: 
001434,000076:                                                                                                  #        BIT 13      ENGINE ON
001435,000077: 
001436,000078:                                                                                                  #        BIT 14      ENGINE OFF
001437,000079: 
001438,000080:                                                                                                  #        BIT 15      SPARE
001439,000081: 
001440,000082: 
001441,000083:                                                                                                  #      CHANNEL 12    CHAN12; OUTPUT CHANNEL; BITS USED TO DRIVE NAVIGATION AND SPAECRAFT HARDWARE
001442,000084: 
001443,000085:                                                                                                  #        BIT 1       ZERO RR CDU; CDU'S GIVE RRADAR INFORMATION FOR LM
001444,000086: 
001445,000087:                                                                                                  #        BIT 2       ENABLE CDU RADAR ERROR COUNTERS
001446,000088: 
001447,000089:                                                                                                  #        BIT 3       NOT USED
001448,000090: 
001449,000091:                                                                                                  #        BIT 4       COARSE ALIGN ENABLE OF IMU
001450,000092: 
001451,000093:                                                                                                  #        BIT 5       ZERO IMU CDU'S
001452,000094: 
001453,000095:                                                                                                  #        BIT 6       ENABLE IMU ERROR COUNTER, CDU ERROR COUNTER.
001454,000096: 
001455,000097:                                                                                                  #        BIT 7       SPARE
001456,000098: 
001457,000099:                                                                                                  #        BIT 8       DISPLAY INERTIAL DATA
001458,000100: 
001459,000101:                                                                                                  #        BIT 9       -PITCH GIMBAL TRIM (BELL MOTION) DESCENT ENGINE
001460,000102: 
001461,000103:                                                                                                  #        BIT 10      +PITCH GIMBAL TRIM (BELL MOTION) DESCENT ENGINE
001462,000104: 
001463,000105:                                                                                                  #        BIT 11      -ROLL GIMBAL TRIM (BELL MOTION) DESCENT ENGINE
001464,000106: 
001465,000107:                                                                                                  #        BIT 12      +ROLL GIMBAL TRIM (BELL MOTION) DESCENT ENGINE
001466,000108: 
001467,000109:                                                                                                  #        BIT 13      LR POSITION 2 COMMAND
001468,000110: 
001469,000111:                                                                                                  #        BIT 14      ENABLE RENDESVOUS RADAR LOCK-ON;AUTO ANGLE TRACK'G
001470,000112: 
001471,000113:                                                                                                  #        BIT 15      ISS TURN ON DELAY COMPLETE
001472,000114: 
001473,000115: 
001474,000116:                                                                                                  #      CHANNEL 13    CHAN13; OUTPUT CHANNEL
001475,000117: 
001476,000118:                                                                                                  #        BIT 1       RADAR C         PROPER SETTING OF THE A,B,C MATRIX
001477,000119:                                                                                                  #        BIT 2       RADAR B         SELECTS CERTAIN RADAR
001478,000120:                                                                                                  #        BIT 3       RADAR A         PARAMETERS TO BE READ.
001479,000121: 
001480,000122:                                                                                                  #        BIT 4       RADAR ACTIVITY
001481,000123: 
001482,000124:                                                                                                  #        BIT 5       NOT USED (CONNECTS AN ALTERNATE INPUT TO UPLINK)
001483,000125: 
001484,000126:                                                                                                  #        BIT 6       BLOCK INPUTS TO UPLINK CELL
001485,000127: 
001486,000128:                                                                                                  #        BIT 7       DOWNLINK TELEMETRY WORD ORDER CODE BIT
001487,000129: 
001488,000130:                                                                                                  #        BIT 8       RHC COUNTER ENABLE (READ HAND CONTROLLER ANGLES)
001489,000131: 
001490,000132:                                                                                                  #        BIT 9       START RHC READ INTO COUNTERS IF BIT 8 SET
001491,000133: 
001492,000134:                                                                                                  #        BIT 10      TEST ALARMS, TEST DSKY LIGHTS
001493,000135: 
001494,000136:                                                                                                  #        BIT 11      ENABLE STANDBY
001495,000137: 
001496,000138:                                                                                                  #        BIT 12      RESET TRAP 31-A    ALWAYS APPEAR TO BE SET TO 0
001497,000139: 
001498,000140:                                                                                                  #        BIT 13      RESET TRAP 31-B    ALWAYS APPEAR TO BE SET TO 0
001499,000141: 
001500,000142:                                                                                                  #        BIT 14      RESET TRAP 32      ALWAYS APPEAR TO BE SET TO 0
001501,000143: 
001502,000144:                                                                                                  #        BIT 15      ENABLE T6 RUPT
001503,000145: 
001504,000146: 
001505,000147:                                                                                                  #      CHANNEL 14    CHAN14; OUTPUT CHANNEL; USED TO CONTROL COMPUTER COUNTER CELLS (CDU,GYRO,SPACECRAFT FUNC.
001506,000148: 
001507,000149:                                                                                                  #        BIT 1       OUTLINK ACTIVITY (NOT USED)
001508,000150: 
001509,000151:                                                                                                  #        BIT 2       ALTITUDE RATE OR ALTITIDE SELECTOR
001510,000152: 
001511,000153:                                                                                                  #        BIT 3       ALTITUDE METER ACTIVITY
001512,000154: 
001513,000155:                                                                                                  #        BIT 4       THRUST DRIVE ACTIVITY FOR DESCENT ENGINE
001514,000156: 
001515,000157:                                                                                                  #        BIT 5       SPARE
001516,000158: 
001517,000159:                                                                                                  #        BIT 6       GYRO ENABLE POWER FOR PULSES
001518,000160: 
001519,000161:                                                                                                  #        BIT 7       GYRO SELECT B    PAIR OF BITS IDENTIFIES AXIS OF -
001520,000162:                                                                                                  #        BIT 8       GYRO SELECT A    GYRO SYSTEM TO BE TORQUED.
001521,000163: 
001522,000164:                                                                                                  #        BIT 9       GYRO TORQUING COMMAND IN NEGATIVE DIRECTION
001523,000165: 
001524,000166: 
001525,000167:                                                                                                  #        BIT 10      GYRO ACTIVITY
001526,000168: 
001527,000169:                                                                                                  #        BIT 11      DRIVE CDU S
001528,000170: 
001529,000171:                                                                                                  #        BIT 12      DRIVE CDU T
001530,000172: 
001531,000173:                                                                                                  #        BIT 13      DRIVE CDU Z
001532,000174: 
001533,000175:                                                                                                  #        BIT 14      DRIVE CDU Y
001534,000176: 
001535,000177:                                                                                                  #        BIT 15      DRIVE CDU X
001536,000178: 
001537,000179: 
001538,000180:                                                                                                  #      CHANNEL 15    MNKEYIN; INPUT CHANNEL;KEY CODE INPUT FROM KEYBOARD OF DSKY, SENSED BY PROGRAM WHEN
001539,000181:                                                                                                  #                    PROGRAM INTERRUPT #5 IS RECEIVED. USES BITS 5-1
001540,000182: 
001541,000183: 
001542,000184:                                                                                                  #      CHANNEL 16    NAVKEYIN; INPUT CHANNEL; OPTICS MARK INFORMATION AND NAVIGA ION PANEL DSKY (CM) OR THRUST
001543,000185:                                                                                                  #                    CONTROL (LM) SENSED BY PROGRAM WHEN PROGRAM INTER-RUPT #6 IS RECEIVED. USES BITS 3-7 ONLY.
001544,000186: 
001545,000187:                                                                                                  #        BIT 1       NOT ASSIGNED
001546,000188: 
001547,000189:                                                                                                  #        BIT 2       NOT ASSIGNED
001548,000190: 
001549,000191:                                                                                                  #        BIT 3       OPTICS X-AXIS MARK SIGNAL FOR ALIGN OPTICAL TSCOPE
001550,000192: 
001551,000193:                                                                                                  #        BIT 4       OPTICS Y-AXIS MARK SIGNAL FOR AOT
001552,000194: 
001553,000195:                                                                                                  #        BIT 5       OPTICS MARK REJECT SIGNAL
001554,000196: 
001555,000197:                                                                                                  #        BIT 6       DESCENT+ ; CREW DESIRED SLOWING RATE OF DESCENT
001556,000198: 
001557,000199:                                                                                                  #        BIT 7       DESCENT- ; CREW DESIRED SPEEDING UP RATE OF D'CENT
001558,000200: 
001559,000201: 
001560,000202:                                                                                                  #      NOTE: ALL BITS IN CHANNELS 30-33 ARE INVERTED AS SENSED BY THE PROGRAM, SO THAT A VALUE OF ZERO MEANS
001561,000203:                                                                                                  #      THAT THE INDICATED SIGNAL IS PRESENT.
001562,000204: 
001563,000205: 
001564,000206:                                                                                                  #      CHANNEL 30    INPUT CHANNEL
001565,000207: 
001566,000208:                                                                                                  #        BIT 1       ABORT WITH DESCENT STAGE
001567,000209: 
001568,000210:                                                                                                  #        BIT 2       STAGE VERIFY SIGNAL
001569,000211: 
001570,000212:                                                                                                  #        BIT 3       ENGINE ARMED SIGNAL
001571,000213: 
001572,000214:                                                                                                  #        BIT 4       ABORT WITH ASCENT ENGINE STAGE
001573,000215: 
001574,000216:                                                                                                  #        BIT 5       AUTO THROTTLE; COMPUTER CONTROL OF DESCENT ENGINE
001575,000217: 
001576,000218:                                                                                                  #        BIT 6       DISPLAY INERTIAL DATA
001577,000219: 
001578,000220:                                                                                                  #        BIT 7       RR CDU FAIL
001579,000221: 
001580,000222:                                                                                                  #        BIT 8       SPARE
001581,000223: 
001582,000224:                                                                                                  #        BIT 9       IMU OPERATE WITH NO MALFUNCTION
001583,000225: 
001584,000226:                                                                                                  #        BIT 10      LM COMPUTER (NOT AGS) HAS CONTROL OF LM
001585,000227: 
001586,000228:                                                                                                  #        BIT 11      IMU CAGE COMMAND TO DRIVE IMU GIMBAL ANGLES TO 0.
001587,000229: 
001588,000230:                                                                                                  #        BIT 12      IMU CDU FAIL (MALFUNCTION OF IMU CDU,S)
001589,000231: 
001590,000232:                                                                                                  #        BIT 13      IMU FAIL (MALFUNCTION OF IMU STABILIZATION LOOPS)
001591,000233: 
001592,000234:                                                                                                  #        BIT 14      ISS TURN ON REQUESTED
001593,000235: 
001594,000236:                                                                                                  #        BIT 15      TEMPERATURE OF STABLE MEMBER WITHIN DESIGN LIMITS
001595,000237: 
001596,000238: 
001597,000239:                                                                                                  #      CHANNEL 31    INPUT CHANNEL; BITS ASSOCIATED WITH THE ATTITUDE  CONTROLLER, TRANSLATIONAL CONTROLLER,
001598,000240:                                                                                                  #                    AND SPACECRAFT ATTITUDE CONTROL; USED BY RCS DAP
001599,000241: 
001600,000242:                                                                                                  #        BIT 1       ROTATION (BY RHC) COMMANDED IN POSITIVE PITCH DIRECTION; MUST BE IN MINIMUM IMPULSE MODE.
001601,000243:                                                                                                  #                    ALSO POSITIVE ELEVATION CHANGE FOR LANDING POINT  DESIGNATOR
001602,000244: 
001603,000245:                                                                                                  #        BIT 2       AS BIT 1 EXCEPT NEGATIVE PITCH AND ELEVATION
001604,000246: 
001605,000247:                                                                                                  #        BIT 3       ROTATION (BY RHC) COMMANDED IN POSITIVE YAW DIRECTION; MUST BE IN MINUMUM IMPULSE MODE.
001606,000248: 
001607,000249:                                                                                                  #        BIT 4       AS BIT 3 EXCEPT NEGATIVE YAW
001608,000250: 
001609,000251:                                                                                                  #        BIT 5       ROTATION (BY RHC) COMMANDED IN POSITIVE ROLL DIRECTION; MUST BE IN MINIMUM IMPULSE MODE.
001610,000252:                                                                                                  #                    ALSO POSITIVE AZIMUTH CHANGE FOR LANDING POINT DESIGNATOR
001611,000253: 
001612,000254:                                                                                                  #        BIT 6       AS BIT 5 EXCEPT NEGATIVE ROLL AND AZIMUTH
001613,000255: 
001614,000256:                                                                                                  #        BIT 7       TRANSLATION IN +X DIRECTION COMMANDED BY THC
001615,000257: 
001616,000258:                                                                                                  #        BIT 8       TRANSLATION IN -X DIRECTION COMMANDED BY THC
001617,000259: 
001618,000260:                                                                                                  #        BIT 9       TRANSLATION IN +Y DIRECTION COMMANDED BY THC
001619,000261: 
001620,000262:                                                                                                  #        BIT 10      TRANSLATION IN -Y DIRECTION COMMANDED BY THC
001621,000263: 
001622,000264:                                                                                                  #        BIT 11      TRANSLATION IN +Z DIRECTION COMMANDED BY THC
001623,000265: 
001624,000266:                                                                                                  #        BIT 12      TRANSLATION IN -Z DIRECTION COMMANDED BY THC
001625,000267: 
001626,000268: 
001627,000269:                                                                                                  #        BIT 13      ATTITUDE HOLD MODE ON SCS MODE CONTROL SWITCH
001628,000270: 
001629,000271:                                                                                                  #        BIT 14      AUTO STABILIZATION OF ATTITUDE ON SCS MODE SWITCH
001630,000272: 
001631,000273:                                                                                                  #        BIT 15      ATTITUDE CONTROL OUT OF DETENT (RHC NOT IN NEUTRAL
001632,000274: 
001633,000275: 
001634,000276:                                                                                                  #      CHANNEL 32       INPUT CHANNEL.
001635,000277: 
001636,000278:                                                                                                  #        BIT 1          THRUSTERS 2 & 4 DISABLED BY CREW
001637,000279: 
001638,000280:                                                                                                  #        BIT 2          THRUSTERS 5 & 8 DISABLED BY CREW
001639,000281: 
001640,000282:                                                                                                  #        BIT 3          THRUSTERS 1 & 3 DISABLED BY CREW
001641,000283: 
001642,000284:                                                                                                  #        BIT 4          THRUSTERS 6 & 7 DISABLED BY CREW
001643,000285: 
001644,000286:                                                                                                  #        BIT 5          THRUSTERS 14 & 16 DISABLED BY CREW
001645,000287: 
001646,000288:                                                                                                  #        BIT 6          THRUSTERS 13 & 15 DISABLED BY CREW
001647,000289: 
001648,000290:                                                                                                  #        BIT 7          THRUSTERS 9  & 12 DISABLED BY CREW
001649,000291: 
001650,000292:                                                                                                  #        BIT 8          THRUSTERS 10 & 11 DISABLED BY CREW
001651,000293: 
001652,000294:                                                                                                  #        BIT 9          DESCENT ENGINE GIMBALS DISABLED BY CREW
001653,000295: 
001654,000296:                                                                                                  #        BIT 10         APPARENT DESCENT ENGINE GIMBAL FAILURE
001655,000297: 
001656,000298:                                                                                                  #        BIT 14      INDICATES PROCEED KEY IS DEPRESSED
001657,000299: 
001658,000300: 
001659,000301:                                                                                                  #      CHANNEL 33    CHAN33; INPUT CHANNEL; FOR HARDWARE STATUS AND COMMAND INFORMATION. BITS 15-11 ARE FLIP-
001660,000302:                                                                                                  #                    FLOP BITS RESET BY A CHANNEL "WRITE" COMMAND THAT ARE RESET BY A RESTART & BY T4RUPT LOOP.
001661,000303: 
001662,000304:                                                                                                  #        BIT 1       SPARE
001663,000305: 
001664,000306:                                                                                                  #        BIT 2       RR AUTO-POWER ON
001665,000307: 
001666,000308:                                                                                                  #        BIT 3       RR RANGE LOW SCALE
001667,000309: 
001668,000310:                                                                                                  #        BIT 4       RR DATA GOOD
001669,000311: 
001670,000312:                                                                                                  #        BIT 5       LR RANGE DATA GOOD
001671,000313: 
001672,000314:                                                                                                  #        BIT 6       LR POS1
001673,000315: 
001674,000316:                                                                                                  #        BIT 7       LR POS2
001675,000317: 
001676,000318: 
001677,000319:                                                                                                  #        BIT 8       LR VEL DATA GOOD
001678,000320: 
001679,000321:                                                                                                  #        BIT 9       LR RANGE LOW SCALE
001680,000322: 
001681,000323:                                                                                                  #        BIT 10      BLOCK UPLINK INPUT
001682,000324: 
001683,000325:                                                                                                  #        BIT 11      UPLINK TOO FAST
001684,000326: 
001685,000327:                                                                                                  #        BIT 12      DOWNLINK TOO FAST
001686,000328: 
001687,000329:                                                                                                  #        BIT 13      PIPA FAIL
001688,000330: 
001689,000331:                                                                                                  #        BIT 14      WARNING OF REPEATED ALARMS: RESTART,COUNTER FAIL, VOLTAGE FAIL,AND SCALAR DOUBLE.
001690,000332: 
001691,000333:                                                                                                  #        BIT 15      LGC OSCILLATOR STOPPED
001692,000334: 
001693,000335: 
001694,000336:                                                                                                  #      CHANNEL 34    DNT M1; OUTPUT CHANNEL; DOWNLINK 1  FIRST OF TWO WORDS SERIALIZATION.
001695,000337:                                                                                                  #      CHANNEL 35    DNT M2; OUTPUT CHANNEL DOWNLINK 2 SOCOND OF TWO   WORDS SERIALIZATION.

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