Source Code
![]() |
This is the source-code for the Apollo 9 Command Module's Guidance Computer.
These files were derived originally from the scan from MIT's Dibner Institute's
now-discontinued website titled "History of Recent Science and Technology", which
in turn was originally created by Gary Neff, though his high-quality scans were
unfortunately reduced in legibility when presented online.
The markings on the front of the
printout imply that it was the original AGC developer Norm Brodeur's copy.
A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original
AGC developer Fred Martin. The source code was transcribed from
those images by Ron Burkey. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041 20'35 OCT. 28,1968Note that the date is the date of the printout, not the date of the program revision. |
018229,000002: ## Copyright: Public domain.
018230,000003: ## Filename: SYSTEM_TEST_STANDARD_LEAD_INS.agc
018231,000004: ## Purpose: Part of the source code for Colossus, build 249.
018232,000005: ## It is part of the source code for the Command Module's (CM)
018233,000006: ## Apollo Guidance Computer (AGC), for Apollo 9.
018234,000007: ## Assembler: yaYUL
018235,000008: ## Reference: pp. 413-415.
018236,000009: ## Contact: Ron Burkey <info@sandroid.org>.
018237,000010: ## Website: www.ibiblio.org/apollo.
018238,000011: ## Mod history: 08/07/04 RSB. Adapted from similar Luminary 131 file.
018239,000012: ## 2017-01-06 RSB Page numbers now agree with those on the
018240,000013: ## original harcopy, as opposed to the PDF page
018241,000014: ## numbers in 1701.pdf.
018242,000015: ## 2017-01-20 RSB Cross-diff'd comment text (not whitespace)
018243,000016: ## vs the already-proofed corresponding Colossus
018244,000017: ## 237 and Comanche 55 source-code files
018245,000018: ## and corrected errors found.
018246,000019: ##
018247,000020: ## The contents of the "Colossus249" files, in general, are transcribed
018248,000021: ## from a scanned copy of the program listing. Notations on this
018249,000022: ## document read, in part:
018250,000023: ##
018251,000024: ## Assemble revision 249 of AGC program Colossus by NASA
018252,000025: ## 2021111-041. October 28, 1968.
018253,000026: ##
018254,000027: ## This AGC program shall also be referred to as
018255,000028: ## Colossus 1A
018256,000029: ##
018257,000030: ## Prepared by
018258,000031: ## Massachusetts Institute of Technology
018259,000032: ## 75 Cambridge Parkway
018260,000033: ## Cambridge, Massachusetts
018261,000034: ## under NASA contract NAS 9-4065.
018262,000035: ##
018263,000036: ## Refer directly to the online document mentioned above for further information.
018264,000037: ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
018265,000038: ##
018266,000039: ## In some cases, where the source code for Luminary 131 overlaps that of
018267,000040: ## Colossus 249, this code is instead copied from the corresponding Luminary 131
018268,000041: ## source file, and then is proofed to incorporate any changes.
018269,000042:
![]() |
Page 413 |
018271,000044: 22,3310 E5,1671 EBANK= XSM
018272,000045:
018273,000046: 33,2000 BANK 33
018274,000047: 04,2000 SETLOC E/PROG
018275,000048: 04,2000 BANK
018276,000049:
018277,000050: 04,2557 COUNT* $$/P07
018278,000051:
018279,000052: # SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018280,000053:
018281,000054: # E/BKCALL FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018282,000055:
018283,000056: # THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED. LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018284,000057: # IS NOT POSSIBLE.
018285,000058:
018286,000059: # THE CALLING SEQUENCE IS:
018287,000060:
018288,000061: # TC BANKCALL
018289,000062: # CADR E/BKCALL
018290,000063: # CADR ROUTINE WHERE YOU WANT TO GO IN FIXED.
018291,000064: # RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018292,000065: # RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018293,000066: # RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018294,000067:
018295,000068: # THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018296,000069: # OTHER EMEMORY PROGRAMS.
018297,000070:
018298,000071: # A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018299,000072:
018300,000073: 04,2557 52134 E/BKCALL DXCH BUF2 # SAVE A,L AND GET DP RETURN.
018301,000074: 04,2560 52365 DXCH EBUF2 # SAVE DP RETURN.
018302,000075: 04,2561 24364 INCR EBUF2 # RETURN +1 BECAUSE DOUBLE CADR.
018303,000076: 04,2562 30006 CA BBANK
018304,000077: 04,2563 74747 MASK LOW10 # GET CURRENT EBANK. (SBANK SOMEDAY)
018305,000078: 04,2564 26365 ADS EBUF2 +1 # FORM BBCON. (WAS FBANK)
018306,000079: 04,2565 50364 NDX EBUF2
018307,000080: 04,2566 27777 CA 0 -1 # GET CADR OF ROUTINE.
018308,000081: 04,2567 04561 TC SWCALL # GO TO ROUTINE, SETTING Q TO SWRETURN
018309,000082: # AND RESTORING A + L.
018310,000083: 04,2570 02574 TC +4 # TX Q, V34, OR BAD STALL RETURN.
018311,000084: 04,2571 02573 TC +2 # PROCEED OR GOOD STALL RETURN.
018312,000085: 04,2572 24364 INCR EBUF2 # ENTER OR RECYCLE RETURN.
018313,000086: 04,2573 24364 INCR EBUF2
018314,000087: 04,2574 52365 E/SWITCH DXCH EBUF2
018315,000088: 04,2575 52006 DTCB
018316,000089:
![]() |
Page 414 |
018318,000091: # E/CALL FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018319,000092:
018320,000093: # THE CALLING SEQUENCE IS...
018321,000094:
018322,000095: # RTB
018323,000096: # E/CALL
018324,000097: # CADR ROUTINE THE INTERPRETIVE SUBROUTINE YOU WANT.
018325,000098: # RETURNS HERE IN INTERPRETIVE.
018326,000099:
018327,000100: 04,2576 22164 E/CALL LXCH LOC # ADRES -1 OF CADR.
018328,000101: 04,2577 50001 INDEX L
018329,000102: 04,2600 30001 CA L # CADR IN A.
018330,000103: 04,2601 24001 INCR L
018331,000104: 04,2602 24001 INCR L # RETURN ADRES IN L.
018332,000105: 04,2603 52365 DXCH EBUF2 # STORE CADR AND RETURN.
018333,000106: 04,2604 06006 TC INTPRET
018334,000107: 04,2605 77624 CALL
018335,000108: 04,2606 00364 EBUF2 # INDIRECTLY EXECUTE ROUTINE. IT MUST
018336,000109: 04,2607 77776 EXIT # LEAVE VIA RVQ OR EQUIVALENT.
018337,000110: 04,2610 22365 LXCH EBUF2 +1 # PICK UP RETURN.
018338,000111: 04,2611 16010 TCF INTPRET +2 # SET LOC AND RETURB TO CALLER
018339,000112:
![]() |
Page 415 |
018341,000114: # E/JOBWAK FOR WAKING UP ERASABLE MEMORY JOBS.
018342,000115:
018343,000116: # THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018344,000117:
018345,000118: # THE CALLING SEQUENCE IS:
018346,000119:
018347,000120: # INHINT
018348,000121: # .
018349,000122: # .
018350,000123: # CA WAKEADR ADDRESS OF SLEEPING JOB
018351,000124: # TC IBNKCALL
018352,000125: # CADR E/JOBWAK
018353,000126: # . RETURNS HERE
018354,000127: # .
018355,000128: # .
018356,000129: # RELINT IF YOU DID AN INHINT.
018357,000130:
018358,000131: 33,2000 BANK 33
018359,000132: 04,2000 SETLOC E/PROG
018360,000133: 04,2000 BANK
018361,000134:
018362,000135: 04,2612 COUNT* $$/P07
018363,000136:
018364,000137: 04,2612 05074 E/JOBWAK TC JOBWAKE # ARRIVE IWTH ADRES IN A.
018365,000138: 04,2613 44700 CS BIT11
018366,000139: 04,2614 50064 NDX LOCCTR
018367,000140: 04,2615 26164 ADS LOC # KNOCK FIXED MEMORY BIT OUT OF ADRES.
018368,000141: 04,2616 00072 TC RUPTREG3 # RETURN
018369,000142:
018370,000143: # THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018371,000144: # PRELAUNCH ALIGN. THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018372,000145:
018373,000146: 33,2000 BANK 33
018374,000147: 33,2000 SETLOC TESTLEAD
018375,000148: 33,2000 BANK
018376,000149:
018377,000150: 33,2000 COUNT 33/COMST
018378,000151:
018379,000152: 33,2000 E5,1425 EBANK= QPLACE
018380,000153:
018381,000154: 33,2000 03425 COMPVER TC GCOMPVER # MUST BE 33,2000.
018382,000155:
018383,000156: 33,2001 03132 GTSCPSS1 TC GTSCPSS # MUST BE AT 33,2001
018384,000157:
018385,000158: 33,2002 05243 REDO TC NEWMODEX # DISPLAY MM 07.
018386,000159: 33,2003 00007 MM 07 B-14 # FALL INTO IMUTEST
018387,000160:
End of include-file SYSTEM_TEST_STANDARD_LEAD_INS.agc. Parent file is MAIN.agc