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.

039509,000002:                                                                                                  ## Copyright:   Public domain.
039510,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_CM.agc
039511,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
039512,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
039513,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
039514,000007:                                                                                                  ## Assembler:   yaYUL
039515,000008:                                                                                                  ## Reference:   pp. 887-888.
039516,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
039517,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
039518,000011:                                                                                                  ## Mod history: 08/22/04 RSB.   Began transcribing.
039519,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
039520,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
039521,000014:                                                                                                  ##                              numbers in 1701.pdf.
039522,000015:                                                                                                  ##              2017-01-18 RSB  Cross-diff'd comment text (not whitespace)
039523,000016:                                                                                                  ##                              vs the already-proofed corresponding Colossus
039524,000017:                                                                                                  ##                              237 and Comanche 55 source-code files
039525,000018:                                                                                                  ##                              and corrected errors found.
039526,000019:                                                                                                  ##
039527,000020:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
039528,000021:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
039529,000022:                                                                                                  ## document read, in part:
039530,000023:                                                                                                  ##
039531,000024:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
039532,000025:                                                                                                  ##      2021111-041.  October 28, 1968.  
039533,000026:                                                                                                  ##
039534,000027:                                                                                                  ##      This AGC program shall also be referred to as
039535,000028:                                                                                                  ##                              Colossus 1A
039536,000029:                                                                                                  ##
039537,000030:                                                                                                  ##      Prepared by
039538,000031:                                                                                                  ##                      Massachusetts Institute of Technology
039539,000032:                                                                                                  ##                      75 Cambridge Parkway
039540,000033:                                                                                                  ##                      Cambridge, Massachusetts
039541,000034:                                                                                                  ##      under NASA contract NAS 9-4065.
039542,000035:                                                                                                  ##
039543,000036:                                                                                                  ## Refer directly to the online document mentioned above for further information.
039544,000037:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
039545,000038:                                                                                                  ##
039546,000039:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
039547,000040:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
039548,000041:                                                                                                  ## source file, and then is proofed to incorporate any changes.
039549,000042: 

Page 887

039551,000044: 23,3140                                           BANK     23                                    
039552,000045: 42,2000                                           SETLOC   SBAND                                 
039553,000046: 42,2000                                           BANK                                           
039554,000047: 
039555,000048: 42,3565                                           COUNT*   $$/R05                                
039556,000049: 42,3565  E4,1417                                  EBANK=   EMSALT                                
039557,000050: 
039558,000051: 42,3565           04555        SBANDANT           TC       BANKCALL                              #  V 64 E GETS US HERE
039559,000052: 42,3566           17573                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
039560,000053: 42,3567           06006                           TC       INTPRET                               
039561,000054: 42,3570           45034                           RTB      CALL                                  
039562,000055: 42,3571           45505                                    LOADTIME                              #  PICKUP CURRENT TIME SCALED B-28
039563,000056: 42,3572           47432                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
039564,000057: 42,3573           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
039565,000058: 42,3574           27045                                    CSMCONIC                              #  USING CONIC INTEGRATION
039566,000059: 42,3575           46135                           SLOAD    BHIZ                                  #  ORIGIN OF REFERENCE INERTIAL SYSTEM IS
039567,000060: 42,3576           00050                                    X2                                    #  EARTH = 0, MOON = 2
039568,000061: 42,3577           65612                                    EISOI                                 
039569,000062: 42,3600           77775                           VLOAD                                          
039570,000063: 42,3601           00001                                    RATT                                  
039571,000064: 42,3602           00003                           STORE    RCM                                   #  MOVE RATT TO PREVENT WIPEOUT
039572,000065: 42,3603           45145                           DLOAD    CALL                                  #  MOON, PUSH ON
039573,000066: 42,3604           00015                                    TAT                                   #  GET ORIGINAL TIME
039574,000067: 42,3605           54115                                    LUNPOS                                #  COMPUTE POSITION VECTOR OF MOON
039575,000068: 42,3606           57455                           VAD      VCOMP                                 #  R= -(REM+RCM) = NEG. OF S/C POS. VEC
039576,000069: 42,3607           00003                                    RCM                                   
039577,000070: 42,3610           77650                           GOTO                                           
039578,000071: 42,3611           65614                                    EISOI      +2                         
039579,000072: 42,3612           57575        EISOI              VLOAD    VCOMP                                 #  EARTH, R= -RCM
039580,000073: 42,3613           00001                                    RATT                                  
039581,000074: 42,3614           64201                           SETPD    MXV                                   #  RCS TO STABLE MEMBER- B-1X B-29X B+1
039582,000075: 42,3615           00003                                    2D                                    #  2D
039583,000076: 42,3616           01736                                    REFSMMAT                              #  STABLE MEMBER.  B-1X B-29X B+1= B-29
039584,000077: 42,3617           65372                           VSL1     PDDL                                  #  8D
039585,000078: 42,3620           15332                                    HI6ZEROS                              
039586,000079: 42,3621           24025                           STOVL    YAWANG                                #  ZERO OUT YAWANG, SET UP FOR SMNB
039587,000080: 42,3622           00003                                    RCM                                   #  TRANSFORMATION.  SM COORD.  SCALED B-29
039588,000081: 42,3623           77624                           CALL                                           
039589,000082: 42,3624           47577                                    *SMNB*                                
039590,000083: 42,3625           00003                           STORE    R                                     #  SAVE NAV. BASE COORDINATES
039591,000084: 42,3626           63256                           UNIT     PDVL                                  #  14D
039592,000085: 42,3627           00003                                    R                                     
039593,000086: 42,3630           72431                           VPROJ    VSL2                                  #  COMPUTE PROJECTION OF VECTOR INTO CM
039594,000087: 42,3631           15324                                    HIUNITZ                               #  XY-PLANE, R-(R.UZ)UZ
039595,000088: 42,3632           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF SET
039596,000089: 42,3633           00003                                    R                                     
039597,000090: 42,3634           65635                                    COVCNV                                
039598,000091: 42,3635           40056        COVCNV             UNIT     BOV                                   #  TEST OVERFLOW FOR INDICATION OF NULL
039599,000092: 42,3636           65652                                    NOADJUST                              #  VECTOR
039600,000093: 42,3637           50206                           PUSH     DOT                                   #  20D

Page 888

039602,000095: 42,3640           15330                                    HIUNITX                               #  COMPUTE YAW ANGLE = ACOS (URP.UX)
039603,000096: 42,3641           65552                           SL1      ACOS                                  #  REVOLUTIONS SCALED B0
039604,000097: 42,3642           50315                           PDVL     DOT                                   #  22D YAWANG
039605,000098: 42,3643           00017                                    URP                                   
039606,000099: 42,3644           15326                                    HIUNITY                               #  COMPUTE FOLLOWING- URP.UY
039607,000100: 42,3645           51152                           SL1      BPL                                   #  POSITIVE
039608,000101: 42,3646           65652                                    NOADJUST                              #  YES, 0-180 DEGREES
039609,000102: 42,3647           45345                           DLOAD    DSU                                   #  NO, 181-360 DEGREES 20D
039610,000103: 42,3650           15340                                    DPPOSMAX                              #  COMPUTE 2 PI MINUS YAW ANGLE
039611,000104: 42,3651           77606                           PUSH                                           #  22D YAWANG
039612,000105: 42,3652           50375        NOADJUST           VLOAD    DOT                                   #  COMPUTE PITCH ANGLE
039613,000106: 42,3653           00011                                    UR                                    #  ACOS (UR.UZ) - PI/2
039614,000107: 42,3654           15324                                    HIUNITZ                               
039615,000108: 42,3655           65552                           SL1      ACOS                                  #  REVOLUTIONS B0
039616,000109: 42,3656           77625                           DSU                                            
039617,000110: 42,3657           15322                                    HIDP1/4                               
039618,000111: 42,3660           16321                           STODL    RHOSB                                 
039619,000112: 42,3661           00025                                    YAWANG                                
039620,000113: 42,3662           02323                           STORE    GAMMASB                               #  PATCH FOR CHECKOUT
039621,000114: 42,3663           77776                           EXIT                                           
039622,000115: 42,3664           31044                           CA       EXTVBACT                              #  IS BIT 5 STILL ON
039623,000116: 42,3665           74706                           MASK     BIT5                                  
039624,000117: 42,3666           00006                           EXTEND                                         
039625,000118: 42,3667           15423                           BZF      ENDEXT                                #  NO, WE HAVE BEEN ANSWERED
039626,000119: 42,3670           33704                           CAF      V06N51                                #  DISPLAY ANGLES
039627,000120: 42,3671           04555                           TC       BANKCALL                              
039628,000121: 42,3672           20504                           CADR     GOMARKFR                              
039629,000122: 42,3673           05514                           TC       B5OFF                                 #  TERMINATE
039630,000123: 42,3674           05514                           TC       B5OFF                                 
039631,000124: 42,3675           05112                           TC       ENDOFJOB                              #  RECYCLE
039632,000125: 42,3676           34710                           CAF      BIT3                                  #  IMMEDIATE RETURN
039633,000126: 42,3677           05415                           TC       BLANKET                               #  BLANK R3
039634,000127: 42,3700           34712                           CAF      BIT1                                  #  DELAY MINIMUM TIME TO ALLOW DISPLAY IN
039635,000128: 42,3701           04555                           TC       BANKCALL                              
039636,000129: 42,3702           01732                           CADR     DELAYJOB                              
039637,000130: 42,3703           13567                           TCF      SBANDANT   +2                         
039638,000131: 42,3704           01463        V06N51             VN       0651                                  
039639,000132: 42,3705                        RCM                EQUALS   2D                                    
039640,000133: 42,3705                        UR                 EQUALS   8D                                    
039641,000134: 42,3705                        URP                EQUALS   14D                                   
039642,000135: 42,3705                        YAWANG             EQUALS   20D                                   
039643,000136: 42,3705                        PITCHANG           EQUALS   22D                                   
039644,000137: 42,3705  0000002               R                  EQUALS   RCM                                   
039645,000138: 

End of include-file S-BAND_ANTENNA_FOR_CM.agc.  Parent file is MAIN.agc