Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming It's funny.  Laugh. Moon NASA Space

Assembly Code That Took America to the Moon Now Published On GitHub (qz.com) 74

An anonymous Slashdot reader writes: "The code that took America to the moon was just published to GitHub, and it's like a 1960s time capsule," reports Quartz. Two lines of code include the comment "# TEMPORARY, I HOPE HOPE HOPE," and there's also a quote from Shakespeare's play Henry VI. In addition, the keyboard and display system program is named PINBALL_GAME_BUTTONS_AND_LIGHT, and "There's also code that appears to instruct an astronaut to 'crank the silly thing around.'"

A former NASA intern uploaded the thousands of lines of assembly code to GitHub, working from a 2003 transcription made from scans inherited by MIT from a Colorado airplane pilot, and developers are already using GitHub to submit funny issue tickets for the 40-year-old code -- for example, "Extension pack for picking up Matt Damon". Another issue complains that "A customer has had a fairly serious problem with stirring the cryogenic tanks with a circuit fault present." Because this issue succinctly describes the Apollo 13 mission in 1970, the issue has been marked "closed".

This discussion has been archived. No new comments can be posted.

Assembly Code That Took America to the Moon Now Published On GitHub

Comments Filter:
  • by Anonymous Coward

    I think This is the most amazing example of software being developed by a non-company ever.

    Margaret Hamilton ran the show.

  • "Extension pack for picking up Matt Damon" is not a link real link [github.com]
  • Ah yes, the assembly programming language.

  • by 4wdloop ( 1031398 ) on Sunday July 10, 2016 @12:31PM (#52483577)

    What did they use to develop the software? And even more interesting how did they test it? The must have had some simulators, probably both software and hardware based?

    • by Anonymous Coward

      Switches, keypads, and real programmers.

      Not the girly crap we have today.

      if a programmer freaks out at the lack of an IDE or libraries, they really are not high level programmers, but more code monleys.

      • Calling it 'girly crap' is both offensive and ignorant. Many of the people who operated and programmed those systems were WOMEN.

      • by batkiwi ( 137781 )

        I think you have the terminology 100% backwards.

        You are not really a LOW level programmer if you freak out with no IDE or libraries. If you're writing the sort of code presented here I'd say you can easily call yourself a Systems Engineer or Software Engineer (unlike 99% of the people who call themselves a Software Engineer).

        However, if you feel the need to write assembly, use code quirks to eek out 1% more performance, and write your own libraries then you have no place in modern high level software devel

        • It's not always about 1% more performance. For a lot of specialized MCU's, there is no other language. Assembly is not that difficult and for control systems, I've never seen complex code. It's always:

          start: ;; start of frame

          if overrun == 1 ; check for frame overrun

          goto frame_err

          overrun = 1

          read value1 ; read all data at start of 10ms frame

          read value 2

          ...

          read valuen

          output1 = 2*value1

          ...

          outputn = 4.17*valuen

          write output1, output2, ..., outputn

          wait for interrupt

          read radaltswitch

          if radaltsw

    • They did not even have version controll at that time!

      The main reason to develop source code control software came from the fact that the Apollo developers fucked up so often. No pun intended. They worked with back ups etc. and often stuff got lossed or mixed together wrongly.

      • by Anonymous Coward

        Well it's easy to fuck something up when you are the one doing the shit for the first time. Unless you are aware of some previous effort to send and return people from the moon. It's not like they could just access some open source libraries and copy the work done by others. The Apollo program was a very high risk endeavor. So risky that any similar effort today would never happen because any failure or loss of life would only start the witch hunt looking to place the blame on someone. The government and ge

        • Don't worry, they had a witch hunt in the 1960s when they lost 3 astronauts in the Apollo 1 fire, complete with Congress critters trying to put the brakes on the whole thing.

    • Most of the time it was probably ed-like [wikipedia.org] editor via teletype terminal [wikipedia.org].
    • by dwywit ( 1109409 )

      IIRC it was tested in a mission emulator on an IBM 360.

      I wasn't actually "recalling" real events there - I was recalling what I read on the NASA history pages.

    • My Dad worked on the Ranging Radar for the Lunar Excursion Module, so I've heard some stories.

      Data input was punched cards (duh).

      Tests included sticking a unit on the front of a missile and launching across White Sands Missile Range, then comparing the telemetry data returned with a known track mapped across a digitized re-creation of the range. Along the way they discovered the errors in the digitization when the results began claiming that the missile was travelling underground.

      One of his research projec

  • by Anonymous Coward on Sunday July 10, 2016 @12:41PM (#52483667)

    Unfortunately, with the amount of coverage that this is getting in the geek sphere, the Dunning-Kruger Effect is in full force. So far, just today, I've seen:

    - Someone trying to look into the code who had apparently never encountered a .s file before, and
    - Some (judging by his name) Indian guy who had apparently never heard of the term "attitude" in relation to flight control, and submitted a pull request to change it to "altitude".

    Idiots. Idiots everywhere.

  • good code too (Score:4, Informative)

    by phantomfive ( 622387 ) on Sunday July 10, 2016 @01:40PM (#52483965) Journal
    The mathematical sections tend to be better [github.com], well defined, well commented, and well-written code.
    • Not to mention TIG incrementals and P00H routines
    • Re:good code too (Score:4, Interesting)

      by Lumpy ( 12016 ) on Sunday July 10, 2016 @02:36PM (#52484293) Homepage

      And remember they did ALL OF THIS with integer only math and NO freaking math libraries.

      Want to drive a fre grad programmer nuts? have him convert celcius to Farenheit and Kelvin with 4 decimal places of accuracy using only integer math on an 8 bit micro, no you can not use ANY libraries at all, and you need to do it in less than 6 lines of code.

      Most shit themselves.

      • Actually likely not 'integer' but fixed point math.

        The first time I saw one creating a table with 360 entries one byte big and storing precalculated sinues values in that table (remember: 1 byte big, so 127 means '1' and 128 means '-1' and the other values are 'fractions' between -1 and +1) I told myself: WTF! That was on an 6502 around 1985 in a small math library used in a game.

        • Re: (Score:2, Insightful)

          by Anonymous Coward

          That is, indeed, a WTF; you only need to store 45 degrees, the rest can be trivially calculated from that. Also, this means you could store the precalculated table as 16-bit (or even 32-bit) integers, yielding much more accurate results, and still save space.

          This isn't really uncommon in embedded systems.

          • by Anonymous Coward

            Storing one octant is simply a memory-speed trade off, especially on 1980s 8-but home computer with no memory cache architecture.

            Storing the full circle allows faster lookup. Without knowing the design and constraints of the system, e.g. Available memory versus frequency of table lookups, it's not really fair to say that storing full circle is "WTF".

        • Re: (Score:2, Insightful)

          by Anonymous Coward

          Lame. A full circle is 256 entries, not 360.
          Allows you to add angles together without boundary check and you can easily mirror angles.
          There is no real reason to stick with 360 degrees circles, if necessary you can step up to 512.

          • I worked on a system with about a dozen different angle formats, depending on who was using the data...SAF8, SAF11, SAF13,...
        • It's commonly called scaled integer. Except with angles, then it's SAF, for scaled angle format. Wraparound @360 is handled very cleanly.
      • and you need to do it in less than 6 lines of code.

        Is that possible?

      • convert celcius to Farenheit and Kelvin with 4 decimal places of accuracy using only integer math on an 8 bit micro, no you can not use ANY libraries at all

        This is why the world loves gcc and libc :) It isn't that hard with just the "standard library," but it sure is without any library! That first little bit of help is the most valuable.

      • by ncc74656 ( 45571 ) *

        Want to drive a fre grad programmer nuts? have him convert celcius to Farenheit and Kelvin with 4 decimal places of accuracy using only integer math on an 8 bit micro, no you can not use ANY libraries at all, and you need to do it in less than 6 lines of code.

        Depends on the architecture. Try doing that in less than 6 lines when you don't have multiply or divide instructions in the CPU. You might not necessarily need to code up general-purpose multiply and divide routines (especially if you're dealing wit

      • you need to do it in less than 6 lines of code

        This is easy !
        For such short sequences of code, you can use SuperOptimization:
        https://en.wikipedia.org/wiki/... [wikipedia.org]
        I remember reading that a sequence of 7 assembly opcodes required a few weeks of computation.

      • Scaled integer math is still very common. I still use it regularly, especially with angle formats. My favorite job ever was writing a 56bit integer math package. Had to keep the precision of a 429bus after numerous operations. I never checked, but it was probably higher precision than IEEE754. Since the range of the numbers was known, some of the mantissa bits could be used for the characteristic part and it was very fast, even on low end hardware.
      • by dargaud ( 518470 )
        There's no such thing as a temperature measurement to 4 decimal places (2 at the very most, 1 is still quite optimistic). And if you have such size constraints, why the fuck would you waste it on primitive units like Fahrenheit ?!?
  • ... historical code like this also needs to exist in a "curated" version, where the only "changes" are those made by a responsible curator, with the changes consisting only of comments.

    I'd fork it myself but the honor of being the "keeper of the curated version" really should be someone with a connection to the project or, better yet, an organization like NASA, a museum, a retired-NASA-employee-association, university, or similar organization that will have the funds, manpower, and interest to keep this goi

  • print "HELLO MOON";

"There is no statute of limitations on stupidity." -- Randomly produced by a computer program called Markov3.

Working...