<s>
The	O
Apollo	B-Application
Guidance	I-Application
Computer	I-Application
(	O
AGC	O
)	O
was	O
a	O
digital	O
computer	O
produced	O
for	O
the	O
Apollo	O
program	O
that	O
was	O
installed	O
on	O
board	O
each	O
Apollo	O
command	O
module	O
(	O
CM	O
)	O
and	O
Apollo	O
Lunar	O
Module	O
(	O
LM	O
)	O
.	O
</s>
<s>
The	O
computer	O
's	O
performance	O
was	O
comparable	O
to	O
the	O
first	O
generation	O
of	O
home	O
computers	O
from	O
the	O
late	O
1970s	O
,	O
such	O
as	O
the	O
Apple	B-Device
II	I-Device
,	O
TRS-80	B-Device
,	O
and	O
Commodore	B-Device
PET	I-Device
.	O
</s>
<s>
The	O
AGC	O
has	O
a	O
16-bit	B-Device
word	O
length	O
,	O
with	O
15	O
data	O
bits	O
and	O
one	O
parity	B-Error_Name
bit	I-Error_Name
.	O
</s>
<s>
Most	O
of	O
the	O
software	O
on	O
the	O
AGC	O
is	O
stored	O
in	O
a	O
special	O
read-only	B-Device
memory	I-Device
known	O
as	O
core	B-General_Concept
rope	I-General_Concept
memory	I-General_Concept
,	O
fashioned	O
by	O
weaving	O
wires	O
through	O
and	O
around	O
magnetic	O
cores	O
,	O
though	O
a	O
small	O
amount	O
of	O
read/write	O
core	B-General_Concept
memory	I-General_Concept
is	O
available	O
.	O
</s>
<s>
The	O
AGC	O
and	O
its	O
DSKY	O
user	B-Application
interface	I-Application
were	O
developed	O
in	O
the	O
early	O
1960s	O
for	O
the	O
Apollo	O
program	O
by	O
the	O
MIT	O
Instrumentation	O
Laboratory	O
and	O
first	O
flew	O
in	O
1966	O
.	O
</s>
<s>
Astronauts	O
manually	O
flew	O
Project	O
Gemini	O
with	O
control	B-Device
sticks	I-Device
,	O
but	O
computers	O
flew	O
most	O
of	O
Project	O
Apollo	O
except	O
briefly	O
during	O
lunar	O
landings	O
.	O
</s>
<s>
the	O
Abort	B-Device
Guidance	I-Device
System	I-Device
(	O
AGS	O
,	O
pronounced	O
ags	O
)	O
of	O
the	O
lunar	O
module	O
,	O
to	O
be	O
used	O
in	O
the	O
event	O
of	O
failure	O
of	O
the	O
LM	O
PGNCS	O
.	O
</s>
<s>
Early	O
architectural	B-General_Concept
work	I-General_Concept
came	O
from	O
J	O
.	O
H	O
.	O
Laning	O
Jr.	O
,	O
Albert	O
Hopkins	O
,	O
Richard	O
Battin	O
,	O
Ramon	O
Alonso	O
,	O
</s>
<s>
The	O
ICs	O
,	O
from	O
Fairchild	O
Semiconductor	O
,	O
were	O
implemented	O
using	O
resistor	O
–	O
transistor	O
logic	O
(	O
RTL	O
)	O
in	O
a	O
flat-pack	B-Algorithm
.	O
</s>
<s>
The	O
use	O
of	O
a	O
single	O
type	O
of	O
IC	O
(	O
the	O
dual	O
NOR3	O
)	O
throughout	O
the	O
AGC	O
avoided	O
problems	O
that	O
plagued	O
another	O
early	O
IC	O
computer	B-General_Concept
design	I-General_Concept
,	O
the	O
Minuteman	O
II	O
guidance	O
computer	O
,	O
which	O
used	O
a	O
mix	O
of	O
diode	B-General_Concept
–	I-General_Concept
transistor	I-General_Concept
logic	I-General_Concept
and	O
diode	B-General_Concept
logic	I-General_Concept
gates	O
.	O
</s>
<s>
The	O
computer	O
had	O
2048	O
words	O
of	O
erasable	O
magnetic-core	O
memory	O
and	O
36,864	O
words	O
of	O
read-only	B-Device
core	B-General_Concept
rope	I-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
The	O
memory	O
word	O
length	O
was	O
16	B-Device
bits	I-Device
:	O
15	O
bits	O
of	O
data	O
and	O
one	O
odd-parity	O
bit	O
.	O
</s>
<s>
The	O
CPU-internal	O
16-bit	B-Device
word	O
format	O
was	O
14	O
bits	O
of	O
data	O
,	O
one	O
overflow	B-Algorithm
bit	O
,	O
and	O
one	O
sign	B-Algorithm
bit	I-Algorithm
(	O
ones	O
 '	O
complement	O
representation	O
)	O
.	O
</s>
<s>
The	O
user	B-Application
interface	I-Application
to	O
the	O
AGC	O
was	O
the	O
DSKY	O
,	O
standing	O
for	O
display	O
and	O
keyboard	O
and	O
usually	O
pronounced	O
"	O
DIS-kee	O
"	O
.	O
</s>
<s>
It	O
has	O
an	O
array	O
of	O
indicator	O
lights	O
,	O
numeric	O
displays	O
,	O
and	O
a	O
calculator-style	O
keyboard	O
.	O
</s>
<s>
Each	O
digit	O
was	O
displayed	O
via	O
a	O
green	O
(	O
specified	O
as	O
530nm	O
)	O
high-voltage	O
electroluminescent	O
seven-segment	B-General_Concept
display	I-General_Concept
;	O
these	O
were	O
driven	O
by	O
electromechanical	O
relays	O
,	O
limiting	O
the	O
update	O
rate	O
.	O
</s>
<s>
Three	O
five-digit	O
signed	O
numbers	O
could	O
also	O
be	O
displayed	O
in	O
octal	O
or	O
decimal	B-Application
,	O
and	O
were	O
typically	O
used	O
to	O
display	O
vectors	O
such	O
as	O
space	O
craft	O
attitude	O
or	O
a	O
required	O
velocity	O
change	O
(	O
delta-V	B-Protocol
)	O
.	O
</s>
<s>
This	O
calculator-style	O
interface	O
was	O
the	O
first	O
of	O
its	O
kind	O
.	O
</s>
<s>
The	O
AGC	O
had	O
four	O
16-bit	B-Device
registers	O
for	O
general	O
computational	O
use	O
,	O
called	O
the	O
central	O
registers	O
:	O
</s>
<s>
There	O
were	O
also	O
four	O
locations	O
in	O
core	B-General_Concept
memory	I-General_Concept
,	O
at	O
addresses	O
20	O
–	O
23	O
,	O
dubbed	O
editing	O
locations	O
because	O
whatever	O
was	O
stored	O
there	O
would	O
emerge	O
shifted	O
or	O
rotated	O
by	O
one	O
bit	O
position	O
,	O
except	O
for	O
one	O
that	O
shifted	O
right	O
seven	O
bit	O
positions	O
,	O
to	O
extract	O
one	O
of	O
the	O
seven-bit	O
interpretive	O
op	O
.	O
</s>
<s>
B	O
:	O
General-purpose	O
buffer	O
register	B-General_Concept
,	O
also	O
used	O
to	O
pre-fetch	O
the	O
next	B-General_Concept
instruction	I-General_Concept
.	O
</s>
<s>
At	O
the	O
start	O
of	O
the	O
next	B-General_Concept
instruction	I-General_Concept
,	O
the	O
upper	O
bits	O
of	O
B	O
(	O
containing	O
the	O
next	O
op	O
.	O
</s>
<s>
The	O
instruction	B-General_Concept
format	I-General_Concept
used	O
3	O
bits	O
for	O
opcode	B-Language
,	O
and	O
12	O
bits	O
for	O
address	O
.	O
</s>
<s>
The	O
return	B-Language
address	I-Language
was	O
automatically	O
stored	O
in	O
the	O
Q	O
register	B-General_Concept
,	O
so	O
the	O
TC	O
instruction	O
could	O
be	O
used	O
for	O
subroutine	O
calls	O
.	O
</s>
<s>
The	O
A	O
register	B-General_Concept
was	O
loaded	O
with	O
data	O
retrieved	O
from	O
the	O
address	O
specified	O
by	O
the	O
instruction	O
.	O
</s>
<s>
The	O
diminished	O
absolute	O
value	O
(	O
DABS	O
)	O
of	O
the	O
data	O
was	O
then	O
computed	O
and	O
stored	O
in	O
the	O
A	O
register	B-General_Concept
.	O
</s>
<s>
The	O
final	O
step	O
in	O
CCS	O
is	O
a	O
four-way	O
skip	O
,	O
depending	O
upon	O
the	O
data	O
in	O
register	B-General_Concept
A	O
before	O
the	O
DABS	O
.	O
</s>
<s>
If	O
register	B-General_Concept
A	O
was	O
greater	O
than	O
0	O
,	O
CCS	O
skips	O
to	O
the	O
first	O
instruction	O
immediately	O
after	O
CCS	O
.	O
</s>
<s>
If	O
register	B-General_Concept
A	O
contained	O
plus	O
zero	O
,	O
CCS	O
skips	O
to	O
the	O
second	O
instruction	O
after	O
CCS	O
.	O
</s>
<s>
The	O
primary	O
purpose	O
of	O
the	O
count	O
was	O
to	O
allow	O
an	O
ordinary	O
loop	O
,	O
controlled	O
by	O
a	O
positive	O
counter	O
,	O
to	O
end	O
in	O
a	O
CCS	O
and	O
a	O
TC	O
to	O
the	O
beginning	O
of	O
the	O
loop	O
,	O
equivalent	O
to	O
an	O
IBM	B-Application
360	I-Application
's	O
BCT	O
.	O
</s>
<s>
INDEX	O
Add	O
the	O
data	O
retrieved	O
at	O
the	O
address	O
specified	O
by	O
the	O
instruction	O
to	O
the	O
next	B-General_Concept
instruction	I-General_Concept
.	O
</s>
<s>
INDEX	O
can	O
be	O
used	O
to	O
add	O
or	O
subtract	O
an	O
index	O
value	O
to	O
the	O
base	B-General_Concept
address	I-General_Concept
specified	O
by	O
the	O
operand	O
of	O
the	O
instruction	O
that	O
follows	O
INDEX	O
.	O
</s>
<s>
This	O
is	O
the	O
instruction	O
used	O
to	O
return	O
from	O
interrupts	B-Application
.	O
</s>
<s>
XCH	O
(	O
exchange	O
)	O
Exchange	O
the	O
contents	O
of	O
memory	O
with	O
the	O
contents	O
of	O
the	O
A	O
register	B-General_Concept
.	O
</s>
<s>
If	O
the	O
specified	O
memory	O
address	O
is	O
in	O
fixed	O
(	O
read-only	B-Device
)	O
memory	O
,	O
the	O
memory	O
contents	O
are	O
not	O
affected	O
,	O
and	O
this	O
instruction	O
simply	O
loads	O
register	B-General_Concept
A	O
.	O
</s>
<s>
If	O
it	O
is	O
in	O
erasable	O
memory	O
,	O
overflow	B-Algorithm
"	O
correction	O
"	O
is	O
achieved	O
by	O
storing	O
the	O
leftmost	O
of	O
the	O
16	B-Device
bits	I-Device
in	O
A	O
as	O
the	O
sign	B-Algorithm
bit	I-Algorithm
in	O
memory	O
,	O
but	O
there	O
is	O
no	O
exceptional	O
behavior	O
like	O
that	O
of	O
TS	O
.	O
</s>
<s>
CS	O
(	O
clear	O
and	O
subtract	O
)	O
Load	O
register	B-General_Concept
A	O
with	O
the	O
one	O
's	O
complement	O
of	O
the	O
data	O
referenced	O
by	O
the	O
specified	O
memory	O
address	O
.	O
</s>
<s>
TS	O
(	O
transfer	O
to	O
storage	O
)	O
Store	O
register	B-General_Concept
A	O
at	O
the	O
specified	O
memory	O
address	O
.	O
</s>
<s>
If	O
the	O
result	O
has	O
no	O
overflow	B-Algorithm
(	O
leftmost	O
2	O
bits	O
of	O
A	O
the	O
same	O
)	O
,	O
nothing	O
special	O
happens	O
;	O
if	O
there	O
is	O
overflow	B-Algorithm
(	O
those	O
2	O
bits	O
differ	O
)	O
,	O
the	O
leftmost	O
one	O
goes	O
the	O
memory	O
as	O
the	O
sign	B-Algorithm
bit	I-Algorithm
,	O
register	B-General_Concept
A	O
is	O
changed	O
to	O
+1	O
or	O
−1	O
accordingly	O
,	O
and	O
control	O
skips	O
to	O
the	O
second	O
instruction	O
following	O
the	O
TS	O
.	O
</s>
<s>
Whenever	O
overflow	B-Algorithm
is	O
a	O
possible	O
but	O
abnormal	O
event	O
,	O
the	O
TS	O
was	O
followed	O
by	O
a	O
TC	O
to	O
the	O
no-overflow	O
logic	O
;	O
when	O
it	O
is	O
a	O
normal	O
possibility	O
(	O
as	O
in	O
multi-precision	O
add/subtract	O
)	O
,	O
the	O
TS	O
is	O
followed	O
by	O
CAF	O
ZERO	O
(	O
CAF	O
=	O
XCH	O
to	O
fixed	O
memory	O
)	O
to	O
complete	O
the	O
formation	O
of	O
the	O
carry	O
( +1	O
,	O
0	O
,	O
or	O
−1	O
)	O
into	O
the	O
next	O
higher-precision	O
word	O
.	O
</s>
<s>
AD	O
(	O
add	O
)	O
Add	O
the	O
contents	O
of	O
memory	O
to	O
register	B-General_Concept
A	O
and	O
store	O
the	O
result	O
in	O
A	O
.	O
</s>
<s>
The	O
2	O
leftmost	O
bits	O
of	O
A	O
may	O
be	O
different	O
(	O
overflow	B-Algorithm
state	O
)	O
before	O
and/or	O
after	O
the	O
AD	O
.	O
</s>
<s>
The	O
fact	O
that	O
overflow	B-Algorithm
is	O
a	O
state	O
rather	O
than	O
an	O
event	O
forgives	O
limited	O
extents	O
of	O
overflow	B-Algorithm
when	O
adding	O
more	O
than	O
two	O
numbers	O
,	O
as	O
long	O
as	O
none	O
of	O
the	O
intermediate	O
totals	O
exceed	O
twice	O
the	O
capacity	O
of	O
a	O
word	O
.	O
</s>
<s>
MASK	O
Perform	O
a	O
bit-wise	O
(	O
boolean	O
)	O
and	O
of	O
memory	O
with	O
register	B-General_Concept
A	O
and	O
store	O
the	O
result	O
in	O
register	B-General_Concept
A	O
.	O
</s>
<s>
MP	O
(	O
multiply	O
)	O
Multiply	O
the	O
contents	O
of	O
register	B-General_Concept
A	O
by	O
the	O
data	O
at	O
the	O
referenced	O
memory	O
address	O
and	O
store	O
the	O
high-order	O
product	O
in	O
register	B-General_Concept
A	O
and	O
the	O
low-order	O
product	O
in	O
register	B-General_Concept
LP	O
.	O
</s>
<s>
DV	O
(	O
divide	O
)	O
Divide	O
the	O
contents	O
of	O
register	B-General_Concept
A	O
by	O
the	O
data	O
at	O
the	O
referenced	O
memory	O
address	O
.	O
</s>
<s>
Store	O
the	O
quotient	O
in	O
register	B-General_Concept
A	O
and	O
the	O
absolute	O
value	O
of	O
the	O
remainder	O
in	O
register	B-General_Concept
Q	O
.	O
</s>
<s>
Unlike	O
modern	O
machines	O
,	O
fixed-point	O
numbers	O
were	O
treated	O
as	O
fractions	O
(	O
notional	O
decimal	B-Application
point	O
just	O
to	O
right	O
of	O
the	O
sign	B-Algorithm
bit	I-Algorithm
)	O
,	O
so	O
you	O
could	O
produce	O
garbage	O
if	O
the	O
divisor	O
was	O
not	O
larger	O
than	O
the	O
dividend	O
;	O
there	O
was	O
no	O
protection	O
against	O
that	O
situation	O
.	O
</s>
<s>
SU	O
(	O
subtract	O
)	O
Subtract	O
(	O
one	O
's	O
complement	O
)	O
the	O
data	O
at	O
the	O
referenced	O
memory	O
address	O
from	O
the	O
contents	O
of	O
register	B-General_Concept
A	O
and	O
store	O
the	O
result	O
in	O
A	O
.	O
</s>
<s>
The	O
control	O
pulses	O
were	O
the	O
signals	O
which	O
did	O
the	O
actual	O
work	O
of	O
the	O
instruction	O
,	O
such	O
as	O
reading	O
the	O
contents	O
of	O
a	O
register	B-General_Concept
onto	O
the	O
bus	O
,	O
or	O
writing	O
data	O
from	O
the	O
bus	O
into	O
a	O
register	B-General_Concept
.	O
</s>
<s>
The	O
lowest	O
bank	O
(	O
bank	O
0	O
)	O
was	O
erasable	O
memory	O
(	O
RAM	B-Architecture
)	O
.	O
</s>
<s>
All	O
banks	O
above	O
bank	O
0	O
were	O
fixed	O
memory	O
(	O
ROM	B-Device
)	O
.	O
</s>
<s>
Bits	O
11	O
and	O
12	O
selected	O
the	O
bank	O
:	O
00	O
selected	O
the	O
erasable	O
memory	O
bank	O
;	O
01	O
selected	O
the	O
lowest	O
bank	O
(	O
bank	O
1	O
)	O
of	O
fixed	O
memory	O
;	O
10	O
selected	O
the	O
next	O
one	O
(	O
bank	O
2	O
)	O
;	O
and	O
11	O
selected	O
the	O
Bank	O
register	B-General_Concept
that	O
could	O
be	O
used	O
to	O
select	O
any	O
bank	O
above	O
2	O
.	O
</s>
<s>
Banks	O
1	O
and	O
2	O
were	O
called	O
fixed-fixed	O
memory	O
,	O
because	O
they	O
were	O
always	O
available	O
,	O
regardless	O
of	O
the	O
contents	O
of	O
the	O
Bank	O
register	B-General_Concept
.	O
</s>
<s>
Banks	O
3	O
and	O
above	O
were	O
called	O
fixed-switchable	O
because	O
the	O
selected	O
bank	O
was	O
determined	O
by	O
the	O
bank	O
register	B-General_Concept
.	O
</s>
<s>
The	O
AGC	O
transferred	O
data	O
to	O
and	O
from	O
memory	O
through	O
the	O
G	O
register	B-General_Concept
in	O
a	O
process	O
called	O
the	O
memory	O
cycle	O
.	O
</s>
<s>
The	O
cycle	O
began	O
at	O
timing	O
pulse	O
1	O
(	O
TP1	O
)	O
when	O
the	O
AGC	O
loaded	O
the	O
memory	O
address	O
to	O
be	O
fetched	O
into	O
the	O
S	O
register	B-General_Concept
.	O
</s>
<s>
The	O
memory	O
hardware	O
retrieved	O
the	O
data	O
word	O
from	O
memory	O
at	O
the	O
address	O
specified	O
by	O
the	O
S	O
register	B-General_Concept
.	O
</s>
<s>
Words	O
from	O
erasable	O
memory	O
were	O
deposited	O
into	O
the	O
G	O
register	B-General_Concept
by	O
timing	O
pulse	O
6	O
(	O
TP6	O
)	O
;	O
words	O
from	O
fixed	O
memory	O
were	O
available	O
by	O
timing	O
pulse	O
7	O
.	O
</s>
<s>
The	O
retrieved	O
memory	O
word	O
was	O
then	O
available	O
in	O
the	O
G	O
register	B-General_Concept
for	O
AGC	O
access	O
during	O
timing	O
pulses	O
7	O
through	O
10	O
.	O
</s>
<s>
After	O
timing	O
pulse	O
10	O
,	O
the	O
data	O
in	O
the	O
G	O
register	B-General_Concept
was	O
written	O
back	O
to	O
memory	O
.	O
</s>
<s>
If	O
the	O
AGC	O
changed	O
the	O
memory	O
word	O
in	O
the	O
G	O
register	B-General_Concept
,	O
the	O
changed	O
word	O
was	O
written	O
back	O
to	O
memory	O
after	O
timing	O
pulse	O
10	O
.	O
</s>
<s>
In	O
this	O
way	O
,	O
data	O
words	O
cycled	O
continuously	O
from	O
memory	O
to	O
the	O
G	O
register	B-General_Concept
and	O
then	O
back	O
again	O
to	O
memory	O
.	O
</s>
<s>
The	O
lower	O
15	O
bits	O
of	O
each	O
memory	O
word	O
held	O
AGC	O
instructions	O
or	O
data	O
,	O
with	O
each	O
word	O
being	O
protected	O
by	O
a	O
16th	O
odd	B-Error_Name
parity	I-Error_Name
bit	O
.	O
</s>
<s>
This	O
bit	O
was	O
set	O
to	O
1	O
or	O
0	O
by	O
a	O
parity	B-Error_Name
generator	O
circuit	O
so	O
a	O
count	O
of	O
the	O
1s	O
in	O
each	O
memory	O
word	O
would	O
always	O
produce	O
an	O
odd	O
number	O
.	O
</s>
<s>
A	O
parity	B-Error_Name
checking	I-Error_Name
circuit	O
tested	O
the	O
parity	B-Error_Name
bit	I-Error_Name
during	O
each	O
memory	O
cycle	O
;	O
if	O
the	O
bit	O
did	O
n't	O
match	O
the	O
expected	O
value	O
,	O
the	O
memory	O
word	O
was	O
assumed	O
to	O
be	O
corrupted	O
and	O
a	O
parity	B-Error_Name
alarm	O
panel	O
light	O
was	O
illuminated	O
.	O
</s>
<s>
The	O
AGC	O
had	O
five	O
vectored	O
interrupts	B-Application
:	O
</s>
<s>
Uprupt	O
was	O
generated	O
each	O
time	O
a	O
16-bit	B-Device
word	O
of	O
uplink	O
data	O
was	O
loaded	O
into	O
the	O
AGC	O
.	O
</s>
<s>
The	O
AGC	O
responded	O
to	O
each	O
interrupt	B-Application
by	O
temporarily	O
suspending	O
the	O
current	O
program	O
,	O
executing	O
a	O
short	O
interrupt	B-Application
service	O
routine	O
,	O
and	O
then	O
resuming	O
the	O
interrupted	O
program	O
.	O
</s>
<s>
Interrupts	B-Application
could	O
be	O
triggered	O
when	O
the	O
counters	O
overflowed	O
.	O
</s>
<s>
The	O
T3rupt	O
and	O
Dsrupt	O
interrupts	B-Application
were	O
produced	O
when	O
their	O
counters	O
,	O
driven	O
by	O
a	O
100Hz	O
hardware	O
clock	O
,	O
overflowed	O
after	O
executing	O
many	O
Pinc	O
subsequences	O
.	O
</s>
<s>
The	O
Uprupt	O
interrupt	B-Application
was	O
triggered	O
after	O
its	O
counter	O
,	O
executing	O
the	O
Shinc	O
subsequence	O
,	O
had	O
shifted	O
16bits	O
of	O
uplink	O
data	O
into	O
the	O
AGC	O
.	O
</s>
<s>
The	O
AGC	O
had	O
a	O
16-bit	B-Device
read	O
bus	O
and	O
a	O
16-bit	B-Device
write	O
bus	O
.	O
</s>
<s>
Data	O
transfers	O
worked	O
like	O
this	O
:	O
To	O
move	O
the	O
address	O
of	O
the	O
next	B-General_Concept
instruction	I-General_Concept
from	O
the	O
B	O
register	B-General_Concept
to	O
the	O
S	O
register	B-General_Concept
,	O
an	O
RB	O
(	O
read	O
B	O
)	O
control	O
signal	O
was	O
issued	O
;	O
this	O
caused	O
the	O
address	O
to	O
move	O
from	O
register	B-General_Concept
B	O
to	O
the	O
read	O
bus	O
,	O
and	O
then	O
to	O
the	O
write	O
bus	O
.	O
</s>
<s>
A	O
WS	O
(	O
write	O
S	O
)	O
control	O
signal	O
moved	O
the	O
address	O
from	O
the	O
write	O
bus	O
into	O
the	O
S	O
register	B-General_Concept
.	O
</s>
<s>
When	O
this	O
occurred	O
,	O
data	O
from	O
each	O
register	B-General_Concept
was	O
inclusive-ORed	O
onto	O
the	O
bus	O
.	O
</s>
<s>
Because	O
the	O
AGC	O
had	O
no	O
native	O
ability	O
to	O
do	O
a	O
logical	O
AND	O
,	O
but	O
could	O
do	O
a	O
logical	O
OR	O
through	O
the	O
bus	O
and	O
could	O
complement	O
(	O
invert	O
)	O
data	O
through	O
the	O
C	O
register	B-General_Concept
,	O
De	O
Morgan	O
's	O
theorem	O
was	O
used	O
to	O
implement	O
the	O
equivalent	O
of	O
a	O
logical	O
AND	O
.	O
</s>
<s>
AGC	O
software	O
was	O
written	O
in	O
AGC	O
assembly	B-Language
language	I-Language
and	O
stored	O
on	O
rope	B-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
The	O
bulk	O
of	O
the	O
software	O
was	O
on	O
read-only	B-Device
rope	B-General_Concept
memory	I-General_Concept
and	O
thus	O
could	O
not	O
be	O
changed	O
in	O
operation	O
,	O
but	O
some	O
key	O
parts	O
of	O
the	O
software	O
were	O
stored	O
in	O
standard	O
read-write	O
magnetic-core	O
memory	O
and	O
could	O
be	O
overwritten	O
by	O
the	O
astronauts	O
using	O
the	O
DSKY	O
interface	O
,	O
as	O
was	O
done	O
on	O
Apollo	O
14	O
.	O
</s>
<s>
A	O
simple	O
real-time	B-Operating_System
operating	I-Operating_System
system	I-Operating_System
designed	O
by	O
J	O
.	O
Halcombe	O
Laning	O
consisting	O
of	O
the	O
'	O
Exec	O
 '	O
,	O
a	O
batch	O
job-scheduling	O
using	O
cooperative	B-Operating_System
multi-tasking	I-Operating_System
,	O
and	O
an	O
interrupt-driven	O
pre-emptive	B-Operating_System
scheduler	I-Operating_System
called	O
the	O
'	O
Waitlist	O
 '	O
which	O
scheduled	O
timer-driven	O
'	O
tasks	O
 '	O
,	O
controlled	O
the	O
computer	O
.	O
</s>
<s>
The	O
AGC	O
had	O
a	O
sophisticated	O
software	O
interpreter	O
,	O
developed	O
by	O
the	O
MIT	O
Instrumentation	O
Laboratory	O
,	O
that	O
implemented	O
a	O
virtual	B-Architecture
machine	I-Architecture
with	O
more	O
complex	O
and	O
capable	O
pseudo-instructions	O
than	O
the	O
native	O
AGC	O
.	O
</s>
<s>
The	O
assembler	B-Language
,	O
named	O
YUL	O
for	O
an	O
early	O
prototype	O
Christmas	O
Computer	O
,	O
enforced	O
proper	O
transitions	O
between	O
native	O
and	O
interpreted	O
code	O
.	O
</s>
<s>
A	O
set	O
of	O
interrupt-driven	O
user	B-Application
interface	I-Application
routines	O
called	O
'	O
Pinball	O
 '	O
provided	O
keyboard	O
and	O
display	O
services	O
for	O
the	O
jobs	O
and	O
tasks	O
running	O
on	O
the	O
AGC	O
.	O
</s>
<s>
A	O
set	O
of	O
user-accessible	O
routines	O
were	O
provided	O
to	O
let	O
the	O
astronauts	O
display	O
the	O
contents	O
of	O
various	O
memory	O
locations	O
in	O
octal	O
or	O
decimal	B-Application
in	O
groups	O
of	O
1	O
,	O
2	O
,	O
or	O
3	O
registers	O
at	O
a	O
time	O
.	O
</s>
<s>
The	O
design	O
principles	O
developed	O
for	O
the	O
AGC	O
by	O
MIT	O
Instrumentation	O
Laboratory	O
,	O
directed	O
in	O
late	O
1960s	O
by	O
Charles	O
Draper	O
,	O
became	O
foundational	O
to	O
software	B-General_Concept
engineering	I-General_Concept
—	O
particularly	O
for	O
the	O
design	O
of	O
more	O
reliable	O
systems	O
that	O
relied	O
on	O
asynchronous	O
software	O
,	O
priority	O
scheduling	O
,	O
testing	O
,	O
and	O
human-in-the-loop	O
decision	O
capability	O
.	O
</s>
<s>
The	O
Apollo	B-Application
Guidance	I-Application
Computer	I-Application
software	O
influenced	O
the	O
design	O
of	O
Skylab	O
,	O
Space	O
Shuttle	O
and	O
early	O
fly-by-wire	O
fighter	O
aircraft	O
systems	O
.	O
</s>
<s>
The	O
Apollo	B-Application
Guidance	I-Application
computer	I-Application
has	O
been	O
called	O
"	O
The	O
fourth	O
astronaut	O
"	O
for	O
its	O
role	O
in	O
helping	O
the	O
three	O
astronauts	O
who	O
relied	O
on	O
it	O
Neil	O
Armstrong	O
,	O
Buzz	O
Aldrin	O
and	O
Michael	O
Collins	O
.	O
</s>
<s>
The	O
decision	O
to	O
expand	O
the	O
memory	O
and	O
instruction	B-General_Concept
set	I-General_Concept
for	O
Block	O
II	O
,	O
but	O
to	O
retain	O
the	O
Block	O
I	O
's	O
restrictive	O
three-bit	O
op	O
.	O
</s>
<s>
For	O
instance	O
,	O
an	O
INDEX	O
to	O
address	O
25	O
triggered	O
the	O
RESUME	O
instruction	O
to	O
return	O
from	O
an	O
interrupt	B-Application
.	O
</s>
<s>
Likewise	O
,	O
INDEX	O
17	O
performed	O
an	O
INHINT	O
instruction	O
(	O
inhibit	O
interrupts	B-Application
)	O
,	O
while	O
INDEX	O
16	O
reenabled	O
them	O
(	O
RELINT	O
)	O
.	O
</s>
<s>
In	O
addition	O
,	O
the	O
bank	O
register	B-General_Concept
could	O
address	O
a	O
maximum	O
of	O
32	O
kilowords	O
,	O
so	O
an	O
Sbank	O
(	O
super-bank	O
)	O
register	B-General_Concept
was	O
required	O
to	O
access	O
the	O
last	O
4	O
kilowords	O
.	O
</s>
<s>
All	O
across-bank	O
subroutine	O
calls	O
had	O
to	O
be	O
initiated	O
from	O
fixed-fixed	O
memory	O
through	O
special	O
functions	O
to	O
restore	O
the	O
original	O
bank	O
during	O
the	O
return	O
:	O
essentially	O
a	O
system	O
of	O
far	B-General_Concept
pointers	I-General_Concept
.	O
</s>
<s>
The	O
Block	O
II	O
AGC	O
also	O
has	O
the	O
EDRUPT	O
instruction	O
(	O
the	O
name	O
is	O
a	O
contraction	O
of	O
Ed	O
's	O
Interrupt	B-Application
,	O
after	O
Ed	O
Smally	O
,	O
the	O
programmer	O
who	O
requested	O
it	O
)	O
.	O
</s>
<s>
This	O
instruction	O
does	O
not	O
generate	O
an	O
interrupt	B-Application
,	O
rather	O
it	O
performs	O
two	O
actions	O
that	O
are	O
common	O
to	O
interrupt	B-Application
processing	O
.	O
</s>
<s>
The	O
first	O
action	O
,	O
inhibits	O
further	O
interrupts	B-Application
(	O
and	O
requires	O
a	O
RESUME	O
instruction	O
to	O
enable	O
them	O
again	O
)	O
.	O
</s>
<s>
In	O
the	O
second	O
action	O
,	O
the	O
ZRUPT	O
register	B-General_Concept
is	O
loaded	O
with	O
the	O
current	O
value	O
of	O
the	O
program	B-General_Concept
counter	I-General_Concept
(	O
Z	O
)	O
.	O
</s>
<s>
PGNCS	O
generated	O
unanticipated	O
warnings	O
during	O
Apollo	O
11	O
's	O
lunar	O
descent	O
,	O
with	O
the	O
AGC	O
showing	O
a	O
1202	O
alarm	O
(	O
"	O
Executive	O
overflow	B-Algorithm
-	O
NO	O
CORE	O
SETS	O
"	O
)	O
,	O
and	O
then	O
a	O
1201	O
alarm	O
(	O
"	O
Executive	O
overflow	B-Algorithm
-	O
NO	O
VAC	O
AREAS	O
"	O
)	O
.	O
</s>
<s>
The	O
cause	O
was	O
a	O
rapid	O
,	O
steady	O
stream	O
of	O
spurious	O
cycle	B-General_Concept
steals	I-General_Concept
from	O
the	O
rendezvous	O
radar	O
(	O
tracking	O
the	O
orbiting	O
command	O
module	O
)	O
,	O
intentionally	O
left	O
on	O
standby	O
during	O
the	O
descent	O
in	O
case	O
it	O
was	O
needed	O
for	O
an	O
abort	O
.	O
</s>
<s>
The	O
extra	O
6,400	O
cycle	B-General_Concept
steals	I-General_Concept
per	O
second	O
added	O
the	O
equivalent	O
of	O
13%	O
load	O
,	O
leaving	O
just	O
enough	O
time	O
for	O
all	O
scheduled	O
tasks	O
to	O
run	O
to	O
completion	O
.	O
</s>
<s>
The	O
1668	O
added	O
another	O
10%	O
to	O
the	O
processor	O
workload	O
,	O
causing	O
executive	O
overflow	B-Algorithm
and	O
a	O
1202	O
alarm	O
.	O
</s>
<s>
These	O
phantom	O
movements	O
generated	O
the	O
rapid	O
series	O
of	O
cycle	B-General_Concept
steals	I-General_Concept
.	O
</s>
<s>
J	O
.	O
Halcombe	O
Laning	O
's	O
software	O
and	O
computer	B-General_Concept
design	I-General_Concept
saved	O
the	O
Apollo	O
11	O
landing	O
mission	O
.	O
</s>
<s>
Part	O
of	O
the	O
large	O
amount	O
of	O
source	O
code	O
rescued	O
as	O
a	O
result	O
of	O
this	O
effort	O
was	O
uploaded	O
by	O
a	O
former	O
NASA	O
intern	O
to	O
GitHub	B-Application
on	O
July	O
7	O
,	O
2016	O
,	O
attracting	O
significant	O
media	O
attention	O
.	O
</s>
<s>
In	O
mid	O
2016	O
,	O
former	O
NASA	O
intern	O
,	O
Chris	O
Garry	O
,	O
uploaded	O
the	O
AGC	O
Source	O
code	O
onto	O
GitHub	B-Application
.	O
</s>
