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.

043454,000002:                                                                                                  ## Copyright:   Public domain.
043455,000003:                                                                                                  ## Filename:    MYSUBS.agc
043456,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
043457,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
043458,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
043459,000007:                                                                                                  ## Assembler:   yaYUL
043460,000008:                                                                                                  ## Reference:   Begins on p. 970.
043461,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043462,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
043463,000011:                                                                                                  ## Mod history: 08/25/04 RSB.   Began transcribing.
043464,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
043465,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
043466,000014:                                                                                                  ##                              numbers in 1701.pdf.
043467,000015:                                                                                                  ##              2017-01-15 RSB  Comment-text proofed by 3-way diff'ing vs
043468,000016:                                                                                                  ##                              Colossus 237 and Comanche 55.  No differences
043469,000017:                                                                                                  ##                              were found, so no corrections were made.
043470,000018:                                                                                                  ##
043471,000019:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
043472,000020:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
043473,000021:                                                                                                  ## document read, in part:
043474,000022:                                                                                                  ##
043475,000023:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
043476,000024:                                                                                                  ##      2021111-041.  October 28, 1968.  
043477,000025:                                                                                                  ##
043478,000026:                                                                                                  ##      This AGC program shall also be referred to as
043479,000027:                                                                                                  ##                              Colossus 1A
043480,000028:                                                                                                  ##
043481,000029:                                                                                                  ##      Prepared by
043482,000030:                                                                                                  ##                      Massachusetts Institute of Technology
043483,000031:                                                                                                  ##                      75 Cambridge Parkway
043484,000032:                                                                                                  ##                      Cambridge, Massachusetts
043485,000033:                                                                                                  ##      under NASA contract NAS 9-4065.
043486,000034:                                                                                                  ##
043487,000035:                                                                                                  ## Refer directly to the online document mentioned above for further information.
043488,000036:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
043489,000037:                                                                                                  ##
043490,000038:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
043491,000039:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
043492,000040:                                                                                                  ## source file, and then is proofed to incorporate any changes.
043493,000041: 

Page 970

043495,000043: 20,3565                                           BANK     20                                    
043496,000044: 21,2000                                           SETLOC   MYSUBS                                
043497,000045: 21,2000                                           BANK                                           
043498,000046: 
043499,000047: 21,2026     0154                                  EBANK=   MPAC                                  
043500,000048: 21,2026     4767               SPCOS1             EQUALS   SPCOS                                 
043501,000049: 21,2026     4770               SPSIN1             EQUALS   SPSIN                                 
043502,000050: 21,2026     4767               SPCOS2             EQUALS   SPCOS                                 
043503,000051: 21,2026     4770               SPSIN2             EQUALS   SPSIN                                 
043504,000052: 21,2026                                           COUNT    21/DAPMS                              
043505,000053: 
043506,000054:                                                                                                  #  ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
043507,000055: 
043508,000056: 21,2026           55512        SMALLMP            TS       KMPTEMP                               #  A(X+Y)
043509,000057: 21,2027           00006                           EXTEND                                         
043510,000058: 21,2030           71511                           MP       KMPAC      +1                         
043511,000059: 21,2031           55511                           TS       KMPAC      +1                         #  AY
043512,000060: 21,2032           34714                           CAF      ZERO                                  
043513,000061: 21,2033           57510                           XCH      KMPAC                                 
043514,000062: 21,2034           00006                           EXTEND                                         
043515,000063: 21,2035           71512                           MP       KMPTEMP                               #  AX
043516,000064: 21,2036           21511                           DAS      KMPAC                                 #  AX+AY
043517,000065: 21,2037           00002                           TC       Q                                     
043518,000066: 
043519,000067:                                                                                                  #  SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
043520,000068:                                                                                                  #  A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
043521,000069:                                                                                                  #  RESULT IS PLACED IN KMPAC.  TIMING = 6 MCT (22 MCT ON OVERFLOW)
043522,000070: 
043523,000071: 21,2040           21511        DPADD              DAS      KMPAC                                 
043524,000072: 21,2041           00006                           EXTEND                                         
043525,000073: 21,2042           12057                           BZF      TSK        +1                         #  NO OVERFLOW
043526,000074: 21,2043           11510                           CCS      KMPAC                                 
043527,000075: 21,2044           12060                           TCF      DPADD+                                #  + OVERFLOW
043528,000076: 21,2045           12047                           TCF      +2                                    
043529,000077: 21,2046           12062                           TCF      DPADD-                                #  - OVERFLOW
043530,000078: 21,2047           11511                           CCS      KMPAC      +1                         
043531,000079: 21,2050           12065                           TCF      DPADD2+                               #  UPPER = 0, LOWER +
043532,000080: 21,2051           12053                           TCF      +2                                    
043533,000081: 21,2052           40000                           COM                                            #  UPPER = 0, LOWER -
043534,000082: 21,2053           64672                           AD       POSMAX                                #  LOWER = 0, A = 0
043535,000083: 21,2054           55511                           TS       KMPAC      +1                         #  CAN NOT OVERFLOW
043536,000084: 21,2055           34672                           CA       POSMAX                                #  UPPER WAS = 0
043537,000085: 21,2056           55510        TSK                TS       KMPAC                                 
043538,000086: 21,2057           00002                           TC       Q                                     
043539,000087: 
043540,000088: 21,2060           64674        DPADD+             AD       NEGMAX                                #  KMPAC GREATER THAN 0
043541,000089: 21,2061           12056                           TCF      TSK                                   
043542,000090: 

Page 971

043544,000092: 21,2062           40000        DPADD-             COM                                            
043545,000093: 21,2063           64672                           AD       POSMAX                                #  KMPAC LESS THAN 0
043546,000094: 21,2064           12056                           TCF      TSK                                   
043547,000095: 
043548,000096: 21,2065           64674        DPADD2+            AD       NEGMAX                                #  CAN NOT OVERFLOW
043549,000097: 21,2066           55511                           TS       KMPAC      +1                         
043550,000098: 21,2067           34674                           CA       NEGMAX                                #  UPPER WAS = 0
043551,000099: 21,2070           12056                           TCF      TSK                                   
043552,000100: 

Page 972 This page is empty.

043555,000103: 

End of include-file MYSUBS.agc.  Parent file is MAIN.agc