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.

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

Page 887

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

Page 888

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

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