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,1968
Note that the date is the date of the printout, not the date of the program revision.

045053,000002:                                                                                                  ## Copyright:   Public domain.
045054,000003:                                                                                                  ## Filename:    RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc
045055,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
045056,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
045057,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
045058,000007:                                                                                                  ## Assembler:   yaYUL
045059,000008:                                                                                                  ## Reference:   Starts on p. 1008
045060,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
045061,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
045062,000011:                                                                                                  ## Mod history: 08/26/04 RSB.   Began transcribing.
045063,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
045064,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
045065,000014:                                                                                                  ##                              numbers in 1701.pdf.
045066,000015:                                                                                                  ##              2017-01-18 RSB  Cross-diff'd comment text (not whitespace)
045067,000016:                                                                                                  ##                              vs the already-proofed corresponding Colossus
045068,000017:                                                                                                  ##                              237 and Comanche 55 source-code files
045069,000018:                                                                                                  ##                              but no errors found.
045070,000019:                                                                                                  ##
045071,000020:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
045072,000021:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
045073,000022:                                                                                                  ## document read, in part:
045074,000023:                                                                                                  ##
045075,000024:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
045076,000025:                                                                                                  ##      2021111-041.  October 28, 1968.  
045077,000026:                                                                                                  ##
045078,000027:                                                                                                  ##      This AGC program shall also be referred to as
045079,000028:                                                                                                  ##                              Colossus 1A
045080,000029:                                                                                                  ##
045081,000030:                                                                                                  ##      Prepared by
045082,000031:                                                                                                  ##                      Massachusetts Institute of Technology
045083,000032:                                                                                                  ##                      75 Cambridge Parkway
045084,000033:                                                                                                  ##                      Cambridge, Massachusetts
045085,000034:                                                                                                  ##      under NASA contract NAS 9-4065.
045086,000035:                                                                                                  ##
045087,000036:                                                                                                  ## Refer directly to the online document mentioned above for further information.
045088,000037:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
045089,000038:                                                                                                  ##
045090,000039:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
045091,000040:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
045092,000041:                                                                                                  ## source file, and then is proofed to incorporate any changes.
045093,000042: 

Page 1008

045095,000044:                                                                                                  #  CALCULATION OF  AMGB, AMBG  ONCE EVERY SECOND
045096,000045: 
045097,000046:                                                                                                  #        AMGB =  1       SIN(PSI)                0
045098,000047:                                                                                                  #                0       COS(PSI)COS(PHI)        SIN(PHI)
045099,000048:                                                                                                  #                0       -COS(PSI)SIN(PHI)       COS(PHI)
045100,000049: 
045101,000050:                                                                                                  #        AMBG =  1       -TAN(PSI)COS(PHI)       TAN(PSI)SIN(PHI)
045102,000051:                                                                                                  #                0       COS(PHI)/COS(PSI)       -SIN(PHI)/COS(PSI)
045103,000052:                                                                                                  #                0       SIN(PHI)                COS(PHI)
045104,000053: 
045105,000054:                                                                                                  #  WHERE PHI AND PSI ARE CDU ANGLES
045106,000055: 
045107,000056: 20,3565                                           BANK     20                                    
045108,000057: 22,2000                                           SETLOC   DAPS8                                 
045109,000058: 22,2000                                           BANK                                           
045110,000059: 
045111,000060: 22,3444                                           COUNT*   $$/DAPEX                              
045112,000061: 22,3444  E6,1510                                  EBANK=   KMPAC                                 
045113,000062: 22,3444           30102        AMBGUPDT           CA       FLAGWRD6                              #  CHECK FOR RCS AUTOPILOT
045114,000063: 22,3445           00006                           EXTEND                                         
045115,000064: 22,3446           65112                           BZMF     ENDOFJOB                              #  BIT15 = 0, BIT14 = 1
045116,000065: 22,3447           74675                           MASK     BIT14                                 #  IF NOT RCS, EXIT
045117,000066: 22,3450           00006                           EXTEND                                         
045118,000067: 22,3451           15112                           BZF      ENDOFJOB                              #  TO PROTECT TVC DAP ON SWITCHOVER
045119,000068: 
045120,000069: 22,3452           30034                           CA       CDUZ                                  
045121,000070: 22,3453           04770                           TC       SPSIN2                                
045122,000071: 22,3454           55640                           TS       AMGB1                                 #  CALCULATE AMGB
045123,000072: 22,3455           30034                           CA       CDUZ                                  
045124,000073: 22,3456           04767                           TC       SPCOS2                                
045125,000074: 22,3457           55645                           TS       CAPSI                                 #  MUST CHECK FOR GIMBAL LOCK
045126,000075: 22,3460           33504                           CAF      QUADANGL                              #  = 7.25  DEGREES JET QUAD ANGULAR OFFSET
045127,000076: 22,3461           00006                           EXTEND                                         
045128,000077: 22,3462           20032                           MSU      CDUX                                  
045129,000078: 22,3463           40000                           COM                                            #  CDUX - 7.25 DEG
045130,000079: 22,3464           04767                           TC       SPCOS1                                
045131,000080: 22,3465           55644                           TS       AMGB8                                 
045132,000081: 22,3466           00006                           EXTEND                                         
045133,000082: 22,3467           71645                           MP       CAPSI                                 
045134,000083: 22,3470           55641                           TS       AMGB4                                 
045135,000084: 22,3471           33504                           CAF      QUADANGL                              
045136,000085: 22,3472           00006                           EXTEND                                         
045137,000086: 22,3473           20032                           MSU      CDUX                                  
045138,000087: 22,3474           40000                           COM                                            #  CDUX - 7.25 DEG
045139,000088: 22,3475           04770                           TC       SPSIN1                                
045140,000089: 22,3476           55642                           TS       AMGB5                                 
045141,000090: 22,3477           00006                           EXTEND                                         
045142,000091: 22,3500           71645                           MP       CAPSI                                 
045143,000092: 22,3501           40000                           COM                                            

Page 1009

045145,000094: 22,3502           55643                           TS       AMGB7                                 
045146,000095: 22,3503           15112                           TCF      ENDOFJOB                              
045147,000096: 22,3504           01224        QUADANGL           DEC      660        B-14                       #  = 7.25 DEGREES
045148,000097: 

End of include-file RCS-CSM_DAP_EXECUTIVE_PROGRAMS.agc.  Parent file is MAIN.agc