Code that powered space missions

Posts
2,665
Likes
3,543
The link has a typo in it, so doesn’t work. Here’s the fixed version:

https://medium.com/geekculture/the-...on-is-full-of-comedy-and-heroism-7eb4f71b36d0

I’m going to call a little BS on this, based on experience. I have an undergraduate degree in Aerospace Engineering from the University of Texas, and several of my professors worked on the moon missions in orbital mechanics. We worked with some of the code they had written for the early moon missions and it had absolutely no comments, used single character variable names, and had a minimum of spaces. Why? Because memory storage on the computers on the spacecraft was minuscule - we’re talking bytes and not kilobytes. Remember, even in the 1990s the computers on the space shuttles were so old and obsolete that astronauts took PCs with them for more complex calculations.

This code may have been written by MIT engineers working in Massachusetts on their bigger computers, and I’m sure they took the liberty of adding those humorous comments. But I can guarantee you all that extraneous stuff was scrubbed by NASA before it was compiled and put onto the spacecraft.
Edited:
 
Posts
1,615
Likes
3,854
The link has a typo in it, so doesn’t work. Here’s the fixed version:

https://medium.com/geekculture/the-...on-is-full-of-comedy-and-heroism-7eb4f71b36d0

I’m going to call a little BS on this, based on experience. I have an undergraduate degree in Aerospace Engineering from the University of Texas, and several of my professors worked on the moon missions in orbital mechanics. We worked with some of the code they had written for the early moon missions and it had absolutely no comments, used single character variable names, and had a minimum of spaces. Why? Because memory storage on the computers on the spacecraft was minuscule - we’re talking bytes and not kilobytes. Remember, even in the 1990s the computers on the space shuttles were so old and obsolete that astronauts took PCs with them for more complex calculations.

This code may have been written by MIT engineers working in Massachusetts on their bigger computers, and I’m sure they took the liberty of adding those humorous comments. But I can guarantee you all that extraneous stuff was scrubbed by NASA before it was compiled and put onto the spacecraft.
So now comments are not shedded by compilers and take up memory on on-board systems? I don't remember this from my engineering days, but I only worked on Fortran scientific computing (space trajectory modeling).
 
Posts
5,480
Likes
52,393
Here's an excerpt from a relatively recent interview with Margaret Hamilton (pictured above). In the interview, she speaks about how she realized that there needed to be some "foolproofness" built into the flight control software. Then she mentions a "mistake" one of the Apollo 11 astronauts made during the descent phase of the landing, by putting a particular switch in an incorrect position which caused the infamous recurring computer alarms.

I wish I could find where I saw/heard a recent interview with Buzz Aldrin, but in the interview, he appears to confess something that he'd never mentioned publicly before: during the descent, he intentionally switched on the radar system (which was not standard procedure for the descent phase) that was used for rendezvous and docking, out of fear that if there was a sudden landing abort he wouldn't be able to find his way back to the Command Module. Aldrin seemed convinced that this is what overloaded the LEM's flight computer (and was in fact the mistake that Hamilton speaks of).



p.s. I got a little misty-eyed when I saw Ms. Hamilton receive the Presidental Medal of Freedom, and when I saw the caliber of the other recipients at the ceremony.
Then I remembered when Rush Limbaugh received the same award ::facepalm1::
Edited:
 
Posts
2,665
Likes
3,543
So now comments are not shedded by compilers and take up memory on on-board systems? I don't remember this from my engineering days, but I only worked on Fortran scientific computing (space trajectory modeling).

From my understanding it wasn't the compiled code that was the problem, but the storage space required for the uncompiled code. And I'm just going by what I remember my professors telling us in the class, but it made sense to me. And it was specifically for code used onboard the spacecraft, not the code used on ground systems.
 
Posts
3,499
Likes
8,764
From my understanding it wasn't the compiled code that was the problem, but the storage space required for the uncompiled code. And I'm just going by what I remember my professors telling us in the class, but it made sense to me. And it was specifically for code used onboard the spacecraft, not the code used on ground systems.
Doesn't that imply that the compiler would have been on spacecraft computer? That makes no sense to me. Cross-compilers must have existed at the time to compile and assemble on the ground computers.

In my first serious software project in the mid 1970s we would have to have a project meeting when someone wanted to add a new field to the database. To fit it into memory it had to be controlled to the word in size and it was a case of finding something that could come out before anything else could go in. Disks were just not fast enough at time, although the db would be flushed to disk at every opportunity. Amazingly our 3D CAD programs are still in use nearly 50 years later, very successfully too 😀
 
Posts
792
Likes
915
I’m going to call a little BS on this, based on experience.

...the code they had written for the early moon missions and it had absolutely no comments, used single character variable names, and had a minimum of spaces. Why? Because memory storage on the computers on the spacecraft was minuscule - we’re talking bytes and not kilobytes....

But I can guarantee you all that extraneous stuff was scrubbed by NASA before it was compiled and put onto the spacecraft.

Sorry, but I'm calling BS on your BS. I have no experience with Apollo Flight Computer code but I do have a masters in Software Engineering and I can assure you that no comments or variable names made it into memory on any computer of the time.

The code was written in assembly language and it was the assembler's job to turn reasonably readable mnemonics into actual machine language. Numbers are assigned locations in memory (today in the Data segment, back then in RAM for variables or ROM for constants). Operators are also turned into numbers to go in memory (today in the Text segment, back then in ROM). It was the assembler's job to keep track of where variables were stored so that all references pointed to the correct place, but these references were represented by numbers, usually operands for the operators in question.

None of the alphabetic content in the source listing survived the assembler; the output is nothing but a list of numbers, with some limited information for the loader, like "this block goes here".

An interesting note is that ROM in the AGC was organized as groups of address and data lines connected by ferrite cores (little transformers) where an address line either did or didn't have a core at an intersection with a data line. Since all the lines were parallel, it appeared as a rope with a sprinkling of cores. These were hand wired per instructions in a table; a very tedious and exacting job. Any constants had to be included in this coding so you can imagine the cost of a mistake or need for a correction.

BTW, the assembler noted above is a computer program that turns source into the file of numbers and loader instructions. In this case, the loader instructions became the recipe that the rope wirers followed. Much different than today where the loader is part of the operating system.
Edited: