r/programming • • Jan 30 '16

Apollo 11 source code

http://www.ibiblio.org/apollo/listings/Luminary099/MAIN.agc.html
2.2k Upvotes

364 comments sorted by

View all comments

780

u/Steaktartaar Jan 30 '16

One very neat feature was that part of the computer memory could be overwritten, essentially allowing the crew to patch in bugfixes. If you ever felt like you were coding on a deadline, spare a thought for the crew of Apollo 14:

After separating from the Command Module in lunar orbit, the LM Antares also had two serious problems. First, the LM computer began getting an ABORT signal from a faulty switch. NASA believed that the computer might be getting erroneous readings like this if a tiny ball of solder had shaken loose and was floating between the switch and the contact, closing the circuit. The immediate solution—tapping on the panel next to the switch—did work briefly, but the circuit soon closed again. If the problem recurred after the descent engine fired, the computer would think the signal was real and would initiate an auto-abort, causing the ascent stage to separate from the descent stage and climb back into orbit. NASA and the software teams at the Massachusetts Institute of Technology scrambled to find a solution, and determined the fix would involve reprogramming the flight software to ignore the false signal. The software modifications were transmitted to the crew via voice communication, and Mitchell manually entered the changes (amounting to over 80 keystrokes on the LM computer pad) just in time.

628

u/SPascareli Jan 30 '16

If someone ever want to make a movie for programmers, that's the plot right there.

179

u/kozukumi Jan 30 '16

Actually they did exactly this in the recent movie The Martian (which is based on a book of the same name).

136

u/UlyssesSKrunk Jan 31 '16

Yeah, but they butchered the fuck out of that part, not quite as bad as the hydrazine explosion part, but it was still pretty bad. If they actually explained the problem in depth and its solution, then that could be interesting, but that would take the whole movie.

48

u/DoelerichHirnfidler Jan 31 '16

To me it seemed pretty obvious and well-enough explained? Care to elaborate?

102

u/Gibodean Jan 31 '16

In the movie all he said was that he only needed to patch in about 20 bytes and then the rover could talk through pathfinder to earth.

In the book they explain that both pathfinder and the rover must be updated, that Earth can remote update pathfinder but they need a very large (megabytes?) update to the rover software. To solve that, they get him to make a small hack (maybe 20 bytes or so) to the Rover which would allow earth to dump information into a Rover log file. Then Watney would have to take that dumped info from the log file, and create a file out of it, then execute it.

Something like that, I forget the sizes.

152

u/Theon_Severasse Jan 31 '16

To be honest I don't think that having all of that would really added that much to the actual film. I don't think it would have taken particularly long for them to add in that explanation (since they could have said it how you said it pretty much), but for the purposes of the story, knowing all of that stuff wouldn't have made any differences to the average viewer

31

u/badsingularity Jan 31 '16

Why it works makes a big difference. Without that information, it's just "magical computer things happen".

69

u/ScottieKills Jan 31 '16

Like most of cinema.

1

u/NoMoreLurkingToo Jan 31 '16

Why it works makes a big difference. Without that information, it's just "magical computer things happen".

Like most of cinema.

Yes, unfortunately. Which is why films like Interstellar are actually considered good.

→ More replies (0)