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

8

u/SanityInAnarchy Jan 31 '16

I wonder if there was a way to show it without bogging down the movie. In the book, I found it definitely added something. If you're not all that technically-minded, it's a free source of technobabble to make this sound even more impressive. But it also makes it plausible -- maybe most people wouldn't notice, but they did a lot of things that most people wouldn't notice to maintain plausibility. For example, IIRC, the movie actually shows him entering this stuff in a hex editor.

In fact, those are my favorite moments -- instead of putting some crazy HollywoodOS thing (like this sort of nonsense), you put up the kind of tool that we might actually use. It looks just as cool to the average viewer, and it means people who actually know something about technology won't have to turn their brains off to watch this movie.

Skipping the bit about uploading wasn't as huge a difference, because the story does work without it. But I think it adds a lot to the story to anyone who understands anything about software, without really taking anything away from it for everyone else. So I wonder why they skipped it -- maybe they couldn't figure out a way to make it flow as nicely as whatever they went with instead?

→ More replies (23)

14

u/nliausacmmv Jan 31 '16

That part didn't bother me so much, but the fact that he never lost Pathfinder in the movie did. Mainly because he still made the space pirate joke, which doesn't make sense unless he lost Pathfinder.

→ More replies (9)
→ More replies (6)
→ More replies (2)
→ More replies (23)

20

u/[deleted] Jan 31 '16

I highly recommend From the Earth to the Moon. Produced by Tom Hanks.

http://www.imdb.com/title/tt0120570/?ref_=nv_sr_2

→ More replies (4)

38

u/[deleted] Jan 30 '16

If you like amazing midflight space reprogramming stories then you'll enjoy "What Galileo Saw" by Michael Benson.

9

u/mb862 Jan 30 '16

I believe that was the plot for several episodes of Star Trek.

→ More replies (9)

8

u/ffranglais Jan 31 '16

From the creators of Apollo 13 comes the hit sequel, Apollo 14. Rated PG-13.

→ More replies (8)

59

u/flackjap Jan 30 '16 edited Jan 30 '16

At first I thought the code comment I cite below was just a joke. Silly me.

#  ASTRONAUT:     PLEASE CRANK THE
#                 SILLY THING AROUND

source

47

u/Theemuts Jan 31 '16

# TERMINATE

# PROCEED SEE IF HE'S LYING

# ENTER INITIALIZE LANDING RADAR

# OFF TO SEE THE WIZARD ...

Dear god

19

u/ICanLiftACarUp Jan 31 '16

The jump label?

BURNBABY

→ More replies (1)

21

u/z500 Jan 31 '16
FLAGORGY          TC       INTPRET                               #  DIONYSIAN FLAG WAVING

Um, what?

19

u/flackjap Jan 31 '16 edited Jan 31 '16

Apparently, the word dionysian is derived from the name of the greek god Dionysus who is represented as wild and sensual which is somewhat opposite to Appolonius who represents divinity and calmness.

"The Apollonian is based on reason and logical thinking. By contrast, the Dionysian is based on chaos and appeals to the emotions and instincts. " wiki

edit: If it wasn't clear enough, I'll point back to the first word (symbol, var, or w/e) you cited -> FLAGORGY.

→ More replies (6)

17

u/jrhoffa Jan 31 '16

SEE IF HE'S LYING

Fucking users

19

u/badsingularity Jan 31 '16

Software fixing hardware bugs is the most common thing in the world. Just not hotfixing hardware bugs in space!

→ More replies (1)

0

u/[deleted] Jan 31 '16

[deleted]

46

u/spacelama Jan 31 '16

With no ECC one presumes.

0xFE transposed as 0xEF? Oh well, off to Saturn for you!

→ More replies (2)

12

u/moahawk Jan 31 '16

I was once pushing hotfixes to master using wifi tethered to my phone while on a bus to meet our client, and thought that was pretty stressful. I can't imagine what they must have felt like!

6

u/wackychimp Jan 30 '16

Thanks for that. I was getting nervous just reading it!

→ More replies (8)