Join 3,512 readers in helping fund MetaFilter (Hide)


Apollo 11 Source Code
July 21, 2009 8:48 AM   Subscribe

The Apollo 11 Command Module code (Comanche054) and Lunar Module code (Luminary099) have been open sourced.
posted by chunking express (47 comments total) 17 users marked this as a favorite

 
Can you imagine a beowulf cluster of those? Wait, this isn't slashdot.
posted by Tashtego at 8:53 AM on July 21, 2009 [3 favorites]


Sweet! If you need me, I'll be in the basement making my own spaceship.
posted by spilon at 8:54 AM on July 21, 2009 [2 favorites]


Does this mean we can finally have our choice of browsers in the LEM?
posted by PlusDistance at 9:01 AM on July 21, 2009 [3 favorites]


My God, it's full of comments!
posted by JohnFredra at 9:02 AM on July 21, 2009 [18 favorites]


All the comments are math though.
posted by smackfu at 9:05 AM on July 21, 2009


On this day 40 years ago, Neil Armstrong and Buzz Aldrin became the first humans to walk on the Moon.

I've always been amazed that Michael Collins hasn't brained someone over being "just" the Command Module pilot.
posted by Brandon Blatcher at 9:06 AM on July 21, 2009 [4 favorites]


I imagine Armstrong finally looking at this and nearly choking on his morning Cheerios. "'VEL TO GAIN VECTOR AT L3'??? Is that why I nearly ran out of fuel 30 seconds from the lunar surface? You assholes nearly got me killed!"
posted by Cool Papa Bell at 9:08 AM on July 21, 2009 [4 favorites]


The Virtual Apollo Guidance Computer project, which provides an open source emulator for the AGC as well as related tools has an interesting "kind and gentle overview" of the AGC and the used software. They have hunted for remaining print outs of the different software versions used in the Apollo project. Also impressive: The people spending years of their time building replicas of the original computers using 74xxx TTL logic.
posted by ltl at 9:14 AM on July 21, 2009


I've always been amazed that Michael Collins hasn't brained someone over being "just" the Command Module pilot.

Well, the guys in Apollo 9 and 10 also orbited the Moon.
posted by smackfu at 9:18 AM on July 21, 2009


"# TEMPORARY, I HOPE HOPE HOPE"

Wow.
posted by gene_machine at 9:18 AM on July 21, 2009 [6 favorites]


Well, the guys in Apollo 9 and 10 also orbited the Moon.

Apollo 9 didn't leave Earth orbit -- it was the test flight of the Lunar Module, to practice the rendezvous between the LM and the Command/Service modules after the moon landing.

You may be thinking of Apollo 8, which went 'round the moon without the LM.
posted by Cool Papa Bell at 9:22 AM on July 21, 2009 [1 favorite]


Finally! I was getting really tired of crashing modules into the lunar surface due to lack of a quality landing and guidance sequencer.

Suck it moon creatures! You got a free pass up until now, but I'm coming for you!
posted by quin at 9:24 AM on July 21, 2009 [1 favorite]


So, this is like, the cheat codes for that Lunar Lander game I used to play a lot? Sweeeeeeet. I got tired of slamming my lander into those ridiculous platforms all the time.
posted by adipocere at 9:27 AM on July 21, 2009


Brandon Blatcher: "I've always been amazed that Michael Collins hasn't brained someone over being "just" the Command Module pilot."

I bet it's because he's still glad he didn't have to come home alone.
posted by Plutor at 9:32 AM on July 21, 2009


My God, it's written in assembly language!
posted by waxboy at 9:33 AM on July 21, 2009 [2 favorites]


Well, the guys in Apollo 9 and 10 also orbited the Moon.

As pointed out before Apollo 9 didn't orbit the moon and Apollo 10 didn't land on the moon, so there was no single astronaut left behind so to speak.

Interesting note: The CM pilots of 9 and 10 both walked on the moon later, on Apollo 15 & 16. Had Michael Collins not left NASA he would have been next up in rotation to command Apollo 17, the last flight to the moon.

The CM of Apollo 8 was supposed to land on the moon with Apollo 13, but...
posted by Brandon Blatcher at 9:40 AM on July 21, 2009


Command Module code (Comanche054) and Lunar Module code (Luminary099) have been transcribed from scanned images....

Significantly more impressive and awesome than the basic programs I would transcribe from Electronic Fun with Computers and Games.
posted by Cat Pie Hurts at 9:45 AM on July 21, 2009


Plutor: "I bet it's because he's still glad he didn't have to come home alone."

Wow, it's hard to imagine how much that would have sucked. And how likely a scenario it was, there are probably hundreds of ways that the lunar module could have failed to hook up with the command module.
posted by octothorpe at 9:47 AM on July 21, 2009


Sweet! If you need me, I'll be in the basement making my own spaceship.

Don't forget the repair manual.
posted by Thorzdad at 10:05 AM on July 21, 2009


It's funny to see the way the comments are different between each of the releases. The writer(s) of the Lunar Module Code seems to have a greater sense of humor (or less seriousness) than the ones who wrote the other two.
posted by azarbayejani at 10:08 AM on July 21, 2009


From Plutor's linked article...

Neil Armstrong’s demise into the life of a hermit...

Hermit? Dude became an aeronautics professor at Cincinnati. He's on a bunch of companies. He was on the Challenger commission. He appeared in print ads for General Motors.

He's certainly no Paris Hilton. But hermit? Nahhh.
posted by Cool Papa Bell at 10:09 AM on July 21, 2009 [2 favorites]


Wow, it's hard to imagine how much that would have sucked.

Nixon had a speech ready for the "astronauts left behind" scenario.
posted by Cool Papa Bell at 10:10 AM on July 21, 2009 [1 favorite]


How to build the Apollo Guidance Computer for 3000 dollars
It cost NASA $150,000 back in the day.
posted by azarbayejani at 10:19 AM on July 21, 2009


Plutor: "I bet it's because he's still glad he didn't have to come home alone."

Word. I can't find much about it, but -- according to Michael Collins' Wikipedia article, he wrote a book containing "18 different rendezvous schemes for different scenarios including where the LM didn't land, or launched too early or too late". Making sure he got Armstrong and Aldrin back to Earth was definitely top of the list for Collins.

Well, I'm off to pepper my non-critical source with I HOPE HOPE HOPE comments which no one will ever read...
posted by Kikkoman at 10:25 AM on July 21, 2009


As pointed out before Apollo 9 didn't orbit the moon and Apollo 10 didn't land on the moon, so there was no single astronaut left behind so to speak.

Yes. Apollo 8 was changed when it became apparent that the LEM wouldn't be ready in time for the launch -- it was set to be the D mission*, testing the CM/SM/LM in low earth orbit. Without a LEM, it couldn't do that, and NASA felt that merely flying another C mission wasn't really worth the cost. (The C mission had already flown as AS-205/Apollo 7)

So, a new mission was added to test navigation and mission preparation -- a combination of a C mission and aspects of the F mission, which was CM/SM/LM in Lunar Orbit. It would also replace the E mission, which was SM/CM/LEM in High Earth Orbit.

So, they flew the E mission, extended (though they called it a C-prime mission in planning) as AS-503/Apollo 8, and went around the moon. The former Apollo 8 mission was flown as AS-504/Apollo 9, completing the D test. AS-505/Apollo 10 completed the aspects of the F test that Apollo 8 couldn't test (because it didn't have a LM to test them with) and that paved the way for the first G mission -- SA-506/Apollo 11..

* The missions.
A- Unmanned CM/SM test, flown as AS-202 and AS-504/Apollo 4
B- Unmanned LM test, flown as AS-204*/Apollo 5
C- Manned CM/SM in LEO, attempted as AS-204 (later named Apollo 1), flown as AS-207/Apollo 5
D- Manned CM/SM/LM in LEO, flown as AS-504/Apollo 9
E- Manned CM/SM/LM in High orbit, flown (modified) as AS-503/Apollo 8
F- Manned CM/SM/LM in Lunar orbite, flown as AS-505/Apollo 10
G- Manned CM/SM/LM, Lunar Landing, flown as AS-506/Apollo 11, AS-507/Apollo 12 and AS-509/Apollo 14, attempted as AS-508/Apollo 13
H- Long duration lunar landing, flown as AS-510/Apollo 15, AS-511/Apollo 16 and AS-512/Apollo 17
posted by eriko at 10:30 AM on July 21, 2009 [1 favorite]


1202
posted by seanmpuckett at 10:33 AM on July 21, 2009


Where's the Mac version? Just kidding...
posted by Blazecock Pileon at 10:45 AM on July 21, 2009 [1 favorite]


CAN'T TC DANZIG AFTER PHASCHNG.
Of course you can phone Danzig after Fasching! Silly Americans thinking they know everything about European telecommunications systems...
posted by PontifexPrimus at 10:54 AM on July 21, 2009


Great article from Don Eyles: "Tales from the Apollo 11 Guidance Computer". Two bugs just about killed them en route.
posted by anthill at 11:03 AM on July 21, 2009 [1 favorite]


The code is shorter than either the GPL or Apache software license text!
posted by bottlebrushtree at 11:09 AM on July 21, 2009


Can somebody just post a binary? TIA!
posted by asusu at 11:12 AM on July 21, 2009


Somebody has to say it: Assembly FTW!
posted by smcdow at 11:37 AM on July 21, 2009


Eh, can't use it, doesn't work IE6.
posted by Brandon Blatcher at 11:44 AM on July 21, 2009


Oh man, the user interface on the LM was incredibly painful...

about five minutes into the burn Aldrin keyed in Verb 16 Noun 68 — a request to monitor a noun whose third register showed the difference between the altitude sensed by the radar and the computed altitude. ... Then [the system programmers listening in on Mission Control] heard the words "program alarm". In Cambridge we looked at each other. Onboard, Aldrin saw the PROG light go on and the display switch back to Verb 06 Noun 63. He quickly keyed in Verb 90 Noun 50.

This puts "Top 10 unhelpful error messages" to shame. Ah well, they did the best they knew how.
posted by anthill at 11:46 AM on July 21, 2009 [3 favorites]


Buzz Aldrin Punches Bart Sibrel
posted by KokuRyu at 11:51 AM on July 21, 2009


I just saw a printout of this at the MIT Museum a few days ago. Or maybe it was something else Apollo-related. A bit stack of computer printer paper, in any case. Those were the days.
posted by DU at 12:00 PM on July 21, 2009


As pointed out before Apollo 9 didn't orbit the moon and Apollo 10 didn't land on the moon, so there was no single astronaut left behind so to speak.

Well...technically true. Apollo 10 was a complete dress-rehearsal of the landing without an actual landing. They did pilot the LM down near the lunar surface, at one point coming as close as 15km from the surface. They also tested the separation of the ascent and descent stages of the LM (crashing the descent stage into the moon.) So, had something gone wrong during the test of the LM, there very well could have been a "single astronaut" situation.

Happily, that's all historical what-iffery.
posted by Thorzdad at 12:03 PM on July 21, 2009


		TS	WCHPHASE
		TC	BANKCALL	# TEMPORARY, I HOPE HOPE HOPE
		CADR	STOPRATE	# TEMPORARY, I HOPE HOPE HOPE
		TC	DOWNFLAG	# PERMIT X-AXIS OVERRIDE
When I'm an astronaut, the rule is going to be "We're not launching until all instances of the word 'hope' have been addressed in the source code"
posted by 0xFCAF at 1:00 PM on July 21, 2009 [7 favorites]


# TEMPORARY, I HOPE HOPE HOPE

Ground Control, please hope me!
posted by davejay at 1:30 PM on July 21, 2009


The raw image of HOPE HOPE HOPE
posted by smackfu at 1:45 PM on July 21, 2009


smackfu, thanks for the raw.

Now, you're all forgetting

YES: ALL'S WELL.

Phew.
posted by Laotic at 2:10 PM on July 21, 2009


0xFCAF: "When I'm an astronaut, the rule is going to be "We're not launching until all instances of the word 'hope' have been addressed in the source code""
Checkin 8831 / plutor / 2009-07-21 17:31:11

177,178c177,178
<> TC      BANKCALL        # NOT A BUG, A FEATURE
> CADR    STOPRATE        # NOT A BUG, A FEATURE
posted by Plutor at 2:32 PM on July 21, 2009 [2 favorites]


Why does it say Comanche054 but link to Comanche055?
posted by paladin at 3:12 PM on July 21, 2009


		TC	INTPRETX
		VLOAD	UNIT
			LAND
		STODL	CG
			TTF/8
		DMP*	VXSC
			GAINBRAK,1	# NUMERO MYSTERIOSO
			ANGTERM
More wow.

OTOH, that may be a reference to it being line 666 of the code?
posted by ROU_Xenophobe at 3:38 PM on July 21, 2009


I'm torn.

On the one hand, I feel a strong compulsion to spend the rest of the afternoon studying the Apollo source code until I can actually follow it.

On the other hand, the source code of the Apollo missions is guaranteed to be not one iota more inherently interesting than all the other code I have to read.
posted by Netzapper at 3:44 PM on July 21, 2009 [1 favorite]


Perhaps the "TEMPORARY, I HOPE HOPE HOPE" comment is saying that that state is temporary unless something bad has happened, rather than that that bit of code is temporary?

Like:

if (plummetingTowardsTheFireySun) //temporary I hope
posted by markr at 4:06 AM on July 22, 2009 [1 favorite]


markr, I think you're right.

[Please note, this is educated supposition. I could do better with more study, of course. But frankly, this source code is entirely too peculiar to want to beat my head on anymore right now (seamlessly intermixed assembler instructions and interpreter directives? weird).]

The subroutine in which the HOPE comments appears seems to be an interrupt handler responsible for properly intermixing manual throttle control and the attitude-hold switch with what the maneuver expects to be doing. So, the autopilot is taking you down in the LEM, and you decide it's wrong and you're going to fast, you can blip the throttle a little bit and this routine will properly mix that throttle input into the overall maneuver.

The actual lines we're looking at are:
TC	BANKCALL	# TEMPORARY, I HOPE HOPE HOPE
CADR	STOPRATE	# TEMPORARY, I HOPE HOPE HOPE
These two instructions actually make up a single directive. The TC BANKCALL transfers control to a subroutine called BANKCALL, which allows calling a subroutine stored in the other (non-active) memory bank. The next line (CADR) specifies which subroutine that should be. In this case, the routine is STOPRATE.

STOPRATE appears to inform the system to stop sending autopilot commands to adjust the roll rate of the craft.

So, in my one-hour analysis of this, I think it works kinda like this:

The LEM is on an autopilot-controlled descent to the lunar surface. For whatever reason, you hit the attitude hold switch (why? do I look like Neil?). At that moment, the current maneuver is suspended, and the rotational rate of the spacecraft is held. Or maybe it actually fires additional attitude jets to zero out rotation (implementing the attitude hold itself, in essence)--I'm not sure, as it doesn't quite say, and I haven't yet installed an AGC in the LEM out back.

It is this pause in rotational maneuvering that our author is hoping will be temporary. Since, if it isn't temporary, it's unlikely that the craft will be in the proper orientation for touchdown.
posted by Netzapper at 5:42 AM on July 22, 2009 [5 favorites]


« Older The Coming Insurrection (pdf) (in French) by the I...  |  8-bit Weezer.... Newer »


This thread has been archived and is closed to new comments