Apollo 11 sourcecode on Github

5 Likes

No, thatā€™s HACKING.

We were taught PDP-8 machine language and assembly in the year 2000. I actually wrote and hand-assembled a program using pencil on paper, for a machine that I have never seen outside a museum and that was hopelessly outdated before I was born.
I believe that counts.

3 Likes

The AGC had just 72k of hand-woven rope memory ROM and just 4K of magnetic RAM to work with for the entire mission. Imagine trying to re-create this Javascript.

ā€“and no disk drive. All the programing was in ROM All the data was in RAM. And none of the RAM was persistent. When they restarted the computer during the Apollo 13 mission they had to reenter all the data with the keypad. And their lives depended on them doing it faultlessly.

2 Likes

http://svtsim.com/moonjs/agc.html and http://www.ibiblio.org/apollo/
and see also http://nassp.sourceforge.net/wiki/Main_Page
avoid open flames and sparks ~ a temporary switch to a low residue high protean diet may
also be advisable ~

And of course this means that there was no ā€œsoftwareā€ in the modern sense. The programs were quite literally hard wired into the hardware. I guess this means that each ā€œverbā€ in the program corresponded to a different set of wiring in the ROM.

I work with a guy at Digital in the 70sā€¦ He would tweak and tighten his code so the hard drive would just be completing a revolution in time for the next write or read instructionā€¦

He could also stare at page after page of a core dump when the machine crashed, and after a few minutes point to a location and say, ā€œthereā€™s the problem, that bit should be a one.ā€

1 Like

http://www.catb.org/jargon/html/story-of-mel.html

1 Like

Nice. I donā€™t think this was the same guy, but yeah, programmnig was a lot different back then. Even in the 80s, I was working on a disk drive product (8 inch hard platters), the software guys were optimizing things (it could store a sequence of 32 data requests and re-order them to optimize seek times, like re-arranging people on an elevator).

As I recall, in one routine they had inserted a number of NOP statements, to waste a few clock cycles that optimized timing elsewhere. The compiled code never worked correctly. So they hand de-compiled the code and discovered that the compiler, which was renowned for its ability to optimize, had removed all (or maybe all but one) of the NOP statements, making the code run faster, and screwing up the timing elsewhere. I believe they ended up hand compiling that section of code to get the timing correct.

I remember the Computer Science majors in college working with APL (acronym for A Programming Language). One of the goals was always to try and do the asignment in a single statement.

2 Likes

Well now son, thereā€™s compilers, and thereā€™s assemblers. The assembler does exactly what you tell it to do (or you go shoot the person who wrote it). The compiler optimizes. But thereā€™s no such thing as a NOP as a compiler directive, only at the assembly language level.

1 Like

Thatā€™s why Iā€™m a hardware engineer. :wink:
I just remember that they put an intentional delay in the code and sumthinā€™ took it out.

2 Likes

Citation needed.

C is dead? Wow, I gotta go tell the guys coding C in the office.

2 Likes

Thatā€™s why I put ā€œdeadā€ in quotesā€¦eg: very few schools/training programs are teaching it anymore. Not that it isnā€™t still being used widely.

Is that actually true though?

Hell, my alma mater was still teaching Ada until a decade ago as the primary language.

Hell, three members of my team are playing with AFL (or LibFuzzer) which is all C. One of my guys doesnā€™t even know C++, just straight C and heā€™s probably 29.

http://lcamtuf.coredump.cx/afl/

Oh I agreeā€¦we use it all over the place where I work too. Most of our legacy code is C based.

As to whether itā€™s still being taught, I have to admit that this is an assumption on my part. My last C programming course was back in 1996. I just hear anecdotally that CS courses offered now in colleges are all OO or interpretive as that is what most employers are looking for.

We struggle finding entry level programmers with any C experience.

I suspect they may be learning C++ā€¦

If only someone had asked Foxconn.

Iā€™m a hardware engineer who has written a lot of software. My favorite software debugging tool is an oscilloscope.

To bring it back on subject, my Nixie watch uses NOPs to equalize the display brightness when it does the time updating. At 8192 instructions per second, every NOP is visible in the tube brightness. But the Nixie watch, although period-correct for a 1960s moon shot, wouldnā€™t work on an Apollo flight, as the tilt sensor depends on gravity to activate the display.

1 Like

We used to have to produce prototype embedded systems using EPROM - memory which could be written and read, but could only be changed by first erasing it, shining a UV light through a little silica or alumina window over the die. In production, this was replaced with fused PROM which was one time only, or even in high volume with dedicated gates programmed directly at mask level. Now I write it, it seems really strange. But we didnā€™t think of it as ā€œhard wired into the hardware.ā€ Also, a ROM can be used to load executable RAM from I/O, which is basically how microprocessors worked since, well, a long time ago.
Rope ROM is in principle no more hard wired than PROM.

My favourite bug of all time - EPROMs started all 1s and some bits were programmed to zeros. A program had a mystery delay, and the person who investigated it turned it into an equally mystery sporadic crash. It turned out his predecessor had simply let his program fall off the end of the original 16K Eprom, whereupon it wrapped round again. This worked until someone optimised the program, leaving a kiloword or so of 0xffff which the processor duly chuntered through, hence the delay.
The guy trying to identify the problem didnā€™t realise that this was happening - trace equipment in those days was rather primitive - so he put in some debugging code which used calls through R15.
Unfortunately 0xffff wasnā€™t a no-op but an instruction which, in effect, incremented R15 and did something with it - forget what. The series of 0xffff instructions caused the processor to do random calls all over the place which resulted in catastrophic malexecution.
I was extremely proud of finding this bug and replacing it with a simple JMP XXXX. Three years later I made the exact same mistake myself and boiled away a litre of Fluorinert, the stuff which is so expensive that if you spill it on a wooden floor, you crowbar up the floor and boil off the Fluorinert.

3 Likes

Except that itā€™s made with actual wires.