This is the code in the Apollo Guidance Computer for Apollo 11.

It’s part of the LUMINARY sofware, which ran on the AGC on the Lunar Module. It’s meant to check if the landing radar is pointed toward the lunar surface - because the LM went through several orientations, the landing radar could be pointed to the front or the side or down. You’re landing on the Moon. Point it down.

Point is, you have to verify user input. Even if your users are the most meticulous and highly trained individuals in history. You have to see if they’re lying. So you get to the BURNBABY.

Browse the code in GitHub - this code is in THE_LUNAR_LANDING.agc

    • ChaoticNeutralCzech@feddit.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      44 minutes ago

      I know what P00 is, that’s program 00 or the root process of the computer. Terminating the subprocess hands control back to P00, which is why the processor is instructed to GOTOP00H.

    • RamenJunkie@midwest.social
      link
      fedilink
      English
      arrow-up
      6
      ·
      2 hours ago

      I know people hate AI, but I fed the OP pic to Claude and asked it to explain the code and maybe gice modern comparisons to something like Python.


      This is AGC (Apollo Guidance Computer) assembly code from the lunar module’s landing radar routines. Let me walk through it:


      P63SPOT3 — “Is the antenna in position yet?”

      CA   BIT6
      EXTEND
      RAND CHAN33
      EXTEND
      BZF  P63SPOT4
      

      Reads a hardware channel (CHAN33) to check the state of the landing radar antenna. BZF means “Branch if Zero” — if the antenna bit is already set, skip ahead.

      if radar_channel_33 & BIT6 == 0:
          goto("P63SPOT4")
      

      “Nope, not there yet — bug the astronaut”

      CAF  CODE500
      TC   BANKCALL
      CADR GOPERF1
      

      Loads error code 500 and calls GOPERF1 — this triggers a crew alert, literally asking the astronaut to manually crank the antenna into position. The comment says it all: “PLEASE CRANK THE SILLY THING AROUND”

      display_alert(code=500, message="Antenna not in position, please fix manually")
      await_crew_response()
      

      “Did they fix it or bail?”

      TCF  GOTOPOOH  # TERMINATE
      TCF  P63SPOT3  # PROCEED — SEE IF HE'S LYING
      

      Two possible outcomes: crew hits terminate (GOTOPOOH — yes, really), or hits proceed and the code loops back to P63SPOT3 to check again. “See if he’s lying” is the actual comment, meaning: verify they actually moved it.

      if crew_pressed == "terminate":
          goto("GOTOPOOH")
      else:
          goto("P63SPOT3")  # trust but verify
      

      P63SPOT4 — “Okay, antenna’s good, initialize radar”

      TC   BANKCALL
      CADR SETPOS1
      

      Calls SETPOS1 to initialize the landing radar into position 1.

      bankcall(SETPOS1)  # configure radar for landing approach
      

      “And we’re off”

      TC   POSTJUMP
      CADR BURNBABY
      

      BURNBABY. That’s the actual name of the burn routine. Jumps to the powered descent initiation — the engine ignition sequence for landing.

      goto("BURNBABY")  # 🔥 start the descent burn
      

      The whole thing is basically: check hardware → nag human if needed → loop until fixed → initialize systems → light the engine. Written by people with a great sense of humor under enormous pressure, in 4KB of RAM.