Last visit was: Sat Sep 19, 2020 7:20 pm
It is currently Sat Sep 19, 2020 7:20 pm

 [ 2 posts ] 
 The Apollo Guidance Computer 
Author Message

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1442
There's a huge amount to be said about this machine. It was of course mission critical and 3 lives depended on it. It was also minimal and quirky.

Build your own:

Elsewhere, Jeff mentioned the way that indexed addressing - implemented as a form of self-modifying code - was generalised to extend the instruction set:

Dr Jefyll wrote:
nyef wrote:
Okay, how about having some way to modify the next instruction in the stream by ORing (or XORing) in some bitmask?

Cool suggestion, nyef! The Apollo Guidance Computer used a feature like this, although I'm having trouble finding the doc I read years ago which laid out the specific details.

The feature in question used addition, not ORing or XORing, but the intent was similar. Prior to execution, but subsequent to being fetched from memory, an instruction could be modified by adding a value computed at run time. It was a sanitized version of self-modifying code. IIRC the main intent was simply to implement indexed addressing. The addition was expected to modify an Address Field located in the bottom of the instruction word.

That's clever in itself, but a fascinating quirk yielded capabilities far beyond what had been originally planned. Someone realized that an addition could also or alternatively modify the Opcode Field in the top of the instruction word. Moreover, such an addition would produce an n+1 bit result -- a carry. This anomaly was recognized as an opportunity. The carry was decoded along with the original opcode bits, and the opcode space was thus doubled. A whole new set of instructions could then be defined -- instructions which were only available via this curious back door technique!


I found a little extra info:
BigEd wrote:
Excellent find Jeff! The search term you may need is "extracode" - see page 15 and page 26 of ... e/1704.pdf
and other places.
We therefore introduce a 16th bit called an extracode bit, which, when appended to the 3-bit op-code and set to 1, provides us with twice the number of instructions, giving us 16 op-codes. The extracode bit is set by an "Extend" instruction
and is reset by any instruction other than an "index" instruction.

Here's a video which might be relevant (a humorous critique?):


See also the NDX instruction at ... uction_Set

Fri Sep 20, 2013 9:02 am

Joined: Wed Jan 09, 2013 6:54 pm
Posts: 1442
There's an AGC design in HDL at

via a post on the myStorm forum, which deals with the small cheap BlackIce FPGA board from myStorm. It's a Lattice based board and as such is supported by the icestorm open source toolchain.

(For more on the AGC see also this nearby thread.)

Tue Sep 12, 2017 9:40 am
 [ 2 posts ] 

Who is online

Users browsing this forum: CCBot and 0 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software