The LM and CM had identical computers on board, each the size of ashoe box. Each contained a total storage capacity of 36K of 14-bitwords. This means total storage was roughly equal to the 64K bytesof a Commodore-64 computer. The LM's computer had a "memory cycletime" of 11.7 micro-seconds. However, virtually all cpu operationsrequired atleast 2 clock cycles making the effective memory cycletime 23.4 micro-seconds, i.e., it effectively ran at only about 43kHz (0.043 MHz)! Note that the original IBM PC-XT ran at 4.77 MHz[...] Numbers were represented using14-bit words in double-precision (i.e., 28 bits). The 15th and16th bit were for the sign of the number and for parity checking(i.e., to make sure the chips were all in sync with the clockpulses). Calculations were fixed-point (not floating-point).The on-board program, named "LUMINARY", was stored in read-onlycore-rope memory which took months to manufacture (the programfills about 10 cm of print-out). Therefore the software had to bein final form months before launch. LUMINARY version 99 landedApollo 11. Version 209 was the final version.The computer also contained a small eraseable area of about 2K 14-bit words to temporarily store variables in. The computer wasbuilt entirely out of integrated circuit NOR gates: one type ofgate for high reliablility.Allan, his friend Don Eyles, and about 300 others wrote theirprograms in the first high-order computer language, called MAC (MITAlgebraic Compiler), then compiled it BY HAND into assemblylanguage, which they typed onto punched cards (there were noterminals or text editors). Incidentally, the Shuttle's softwareis written in a language called HAL/S, named after Hal Lanning, theauthor of MAC. HAL/S is an improved version of MAC.The LUMINARY program consisted of many subprograms which werepriority driven, i.e., they took turns executing according to theirpriority. Each program would move data in and out of the verysmall eraseable area of memory (2K in size). The biggest debuggingchallenge was to keep programs from erasing, or "overlaying",another program's data at inappropriate times. If too many taskswere demanding the computer's time, it would simply delay or THROWAWAY what it had been working on, issue an alarm, and start working onthe new item.Such frightening alarms occurred during the Apollo 11 landing(first moon landing). If you listen to recordings of the landing,you will hear the Capcom say "1201 alarm" and "1202 alarm." Theastronauts' checklist had erroneously called for the astronauts toturn on the rendezvous radar before initiation of the descent.Subsequently, the program that managed the radar began demandingtoo much of the computer's spare margin of time. The power supplyfor the radar was not properly synchronized with the LM's mainpower supply. Consequently, as the two power supplies went in andout of synchronization, the rendezvous radar generated manyspurious input signals to the LM's computer. In responding to thesesignals, the computer delayed some of its guidance calculations andleft others unfinished. This situation caused the computer toissue alarms during the landing. During a normal descent, theguidance program, which brought the LM to its target landing siteusing a minimum of fuel, would issue commands once every twoseconds. Steering commands to the digital autopilot, which keptthe LM stable, were issued every 10th of a second. Although thelanding, which had an 11-minute guidance phase, was successful, afull minute's worth of guidance commands were never issued by thecomputer due to rendezvous radar![...]LUMINARY was never completely bug free. Allan told me about afascinating series of events that could have easily prevented thefirst moon landing and might have caused disaster. Allan was theprincipal designer of the LM's descent guidance program whichsteered the LM by gimballing and throttling the descent engine.Whenever the computer commanded the engine to increase or decreasethrust, the engine (and LM) reacted after a short time lag.Allan's descent program needed a routine to accurately estimate thenew thrust level, which could be accomplished by reading the"delta-V" (change in velocity) measured by the LM's accelerometers.He wrote a short routine that took into consideration, i.e.,compensated for, the engine's lag time, which TRW's "interfacecontrol document", full of useful information for the programmers,said was 0.3 seconds. It took 0.3 seconds for the LM's descentengine to achieve whatever thrust level the computer might request.The final version of the thrust routine, which was put into the LM,was written by Allan's friend Don Eyles. Eyles was sufficientlyenthusiastic about the programming challenge that he found a way ofwriting it which required compensating for only 0.2 of the 0.3seconds. The IBM 360 simulator showed Eyles' program workedbeautifully. His routine was aboard Apollos 11 and 12 whichlanded successfully. However, telemetry transmitted during thelandings later showed something to be very wrong. The engines weresurging up and down in thrust level, and were barley stable. A guyat Johnson Space Center called Allan and informed him that the LM'sengine was not a 0.3-second-lag engine afterall. It had beenimproved some time before Apollo 11's launch such as to lower thelag time to only 0.075 seconds. Correction of this item in theinterface control document had simply been overlooked. Once thisdiscrepency was discovered, the IBM 360 simulator was reprogrammedto properly simulate the actual, faster engine. Running on thesimulator, Don Eyle's thrust program, with the 0.2-secondcompensation, exhibited the surging that had occured on the realflights. But here's the most interesting fact: the simulator alsoshowed that had Allan Klumpp chose to "correct" Don Eyles' programby compensating for the full 0.3 seconds that was printed in thedocument, the LM would have been unstable and Apollo 11 would neverhave been able to land. By pure luck, Don Eyles was creative enoughto write the thrust routine in a way that kept the LM just inside thestability enveloppe and allowed successful landings!
The computer also contained a small eraseable area of about 2K 14-bit words to temporarily store variables in. The computer wasbuilt entirely out of integrated circuit NOR gates: one type ofgate for high reliablility.
LUMINARY was never completely bug free. Allan told me about afascinating series of events that could have easily prevented thefirst moon landing and might have caused disaster.
You have to give the astronaut teams credit for getting into those machines and flying them as the experimental machines they were.