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.

019771,000002:                                                                                                  ## Copyright:   Public domain.
019772,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM.agc
019773,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
019774,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
019775,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
019776,000007:                                                                                                  ## Assembler:   yaYUL
019777,000008:                                                                                                  ## Reference:   pp. 449-451.
019778,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
019779,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
019780,000011:                                                                                                  ## Mod history: 08/11/04 RSB.   Began transcribing.
019781,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
019782,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
019783,000014:                                                                                                  ##                              numbers in 1701.pdf.
019784,000015:                                                                                                  ##              2017-01-14 RSB  Cross-diff'd comment text (not whitespace)
019785,000016:                                                                                                  ##                              vs the already-proofed corresponding Colossus
019786,000017:                                                                                                  ##                              237 and Comanche 55 source-code files
019787,000018:                                                                                                  ##                              and corrected errors found.
019788,000019:                                                                                                  ##
019789,000020:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
019790,000021:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
019791,000022:                                                                                                  ## document read, in part:
019792,000023:                                                                                                  ##
019793,000024:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
019794,000025:                                                                                                  ##      2021111-041.  October 28, 1968.  
019795,000026:                                                                                                  ##
019796,000027:                                                                                                  ##      This AGC program shall also be referred to as
019797,000028:                                                                                                  ##                              Colossus 1A
019798,000029:                                                                                                  ##
019799,000030:                                                                                                  ##      Prepared by
019800,000031:                                                                                                  ##                      Massachusetts Institute of Technology
019801,000032:                                                                                                  ##                      75 Cambridge Parkway
019802,000033:                                                                                                  ##                      Cambridge, Massachusetts
019803,000034:                                                                                                  ##      under NASA contract NAS 9-4065.
019804,000035:                                                                                                  ##
019805,000036:                                                                                                  ## Refer directly to the online document mentioned above for further information.
019806,000037:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
019807,000038:                                                                                                  ##
019808,000039:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
019809,000040:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
019810,000041:                                                                                                  ## source file, and then is proofed to incorporate any changes.
019811,000042: 

Page 449

019813,000044:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM    P21
019814,000045: 
019815,000046:                                                                                                  #  PROGRAM DESCRIPTION
019816,000047:                                                                                                  #        MOD NO - 1
019817,000048:                                                                                                  #        MOD BY - N. M. NEVILLE
019818,000049: 
019819,000050:                                                                                                  #  FUNCTIONAL DECRIPTION-
019820,000051:                                                                                                  #        TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
019821,000052:                                                                                                  #        THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
019822,000053: 
019823,000054:                                                                                                  #  CALLING SEQUENCE-
019824,000055:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
019825,000056: 
019826,000057:                                                                                                  #  SUBROUTINES CALLED-
019827,000058:                                                                                                  #        GOPERF4
019828,000059:                                                                                                  #        GOFLASH
019829,000060:                                                                                                  #        THISPREC
019830,000061:                                                                                                  #        OTHPREC
019831,000062:                                                                                                  #        LAT-LONG
019832,000063: 
019833,000064:                                                                                                  #  NORMAL EXIT MODES-
019834,000065:                                                                                                  #        ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
019835,000066: 
019836,000067:                                                                                                  #  ALARM OR ABORT EXIT MODES-
019837,000068:                                                                                                  #        NONE
019838,000069: 
019839,000070:                                                                                                  #  OUTPUT-
019840,000071:                                                                                                  #        OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
019841,000072:                                                                                                  #        COMPUTED
019842,000073:                                                                                                  #                OPTION CODE     00002
019843,000074:                                                                                                  #                THIS            00001
019844,000075:                                                                                                  #                OTHER           00002
019845,000076:                                                                                                  #        DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS, MINUTES, SECONDS
019846,000077:                                                                                                  #        DECIMAL DISPLAY OF LAT,LONG,ALT
019847,000078: 
019848,000079:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
019849,000080:                                                                                                  #        AX0             2DEC    4.652459653 E-5 RADIANS         %68-69 CONSTANTS"
019850,000081:                                                                                                  #        -AY0            2DEC    2.147535898 E-5 RADIANS
019851,000082:                                                                                                  #        AZ0             2DEC    .7753206164     REVOLUTIONS
019852,000083:                                                                                                  #        FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
019853,000084:                                                                                                  #        504LM           2DEC    -2.700340600 E-5 RADIANS
019854,000085:                                                                                                  #        504LM _2        2DEC    -7.514128400 E-4 RADIANS
019855,000086:                                                                                                  #        504LM _4        2DEC    _2.553198641 E-4 RADIANS
019856,000087:                                                                                                  #        NONE
019857,000088: 
019858,000089:                                                                                                  #  DEBRIS

Page 450

019860,000091:                                                                                                  #        CENTRALS-A,Q,L
019861,000092:                                                                                                  #        OTHER-THOSE USED BY THE ABOVE LISTED SUBROUTINES
019862,000093:                                                                                                  #        SEE LEMPREC, LAT-LONG
019863,000094: 
019864,000095: 33,3772  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
019865,000096: 
019866,000097: 33,3772                                           BANK     33                                    
019867,000098: 37,2000                                           SETLOC   P20S                                  
019868,000099: 37,2000                                           BANK                                           
019869,000100: 
019870,000101: 37,2001  E4,1715                                  EBANK=   P21TIME                               
019871,000102: 37,2001                                           COUNT    24/P21                                
019872,000103: 
019873,000104: 37,2001           34712        PROG21             CAF      ONE                                   
019874,000105: 37,2002           55132                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
019875,000106: 37,2003           34711                           CAF      BIT2                                  #  OPTION 2
019876,000107: 37,2004           04555                           TC       BANKCALL                              
019877,000108: 37,2005           20761                           CADR     GOPERF4                               
019878,000109: 37,2006           04106                           TC       GOTOPOOH                              #  TERMINATE
019879,000110: 37,2007           02011                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
019880,000111: 37,2010           02003                           TC       -5                                    #  R2 LOADED THROUGH DSKY
019881,000112: 37,2011           32102        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
019882,000113: 37,2012           04555                           TC       BANKCALL                              
019883,000114: 37,2013           20624                           CADR     GOFLASH                               
019884,000115: 37,2014           04106                           TC       GOTOPOOH                              #  TERM
019885,000116: 37,2015           02017                           TC       +2                                    #  PROCEED VALUES OK
019886,000117: 37,2016           02011                           TC       -5                                    #  TIME LOADED THROUGH DSKY
019887,000118: 37,2017           06006                           TC       INTPRET                               
019888,000119: 37,2020           77745                           DLOAD                                          
019889,000120: 37,2021           01046                                    DSPTEM1                               
019890,000121: 37,2022           02316                           STORE    P21TIME                               
019891,000122: 37,2023           45335                           SLOAD    DSU                                   
019892,000123: 37,2024           01133                                    OPTION2                               
019893,000124: 37,2025           36100                                    P21ONENN                              
019894,000125: 37,2026           71230                           BHIZ     DLOAD                                 
019895,000126: 37,2027           76042                                    P21PROG2                              #  VEHICLE TO BE INTEGRATED IS LEM
019896,000127: 37,2030           02316                                    P21TIME                               #  VEHICLE TO BE INTEGRATED IS CSM
019897,000128: 37,2031           34041                           STCALL   TDEC1                                 #  INTEGRATE TO TIME SPECIFIED IN TDEC
019898,000129: 37,2032           27036                                    OTHPREC                               #  ADJUST UNITS FOR LAT-LONG ROUTINE
019899,000130: 37,2033           46135        P21PROGA           SLOAD    BHIZ                                  
019900,000131: 37,2034           00050                                    X2                                    
019901,000132: 37,2035           76050                                    P21PROG3                              
019902,000133: 37,2036           43175                           VLOAD    SETGO                                 
019903,000134: 37,2037           00001                                    RATT                                  
019904,000135: 37,2040           01423                                    LUNAFLAG                              
019905,000136: 37,2041           76053                                    P21PROG4                              
019906,000137: 37,2042           77745        P21PROG2           DLOAD                                          
019907,000138: 37,2043           02316                                    P21TIME                               
019908,000139: 37,2044           34041                           STCALL   TDEC1                                 
019909,000140: 37,2045           27022                                    THISPREC                              

Page 451

019911,000142: 37,2046           77650                           GOTO                                           
019912,000143: 37,2047           76033                                    P21PROGA                              
019913,000144: 37,2050           43175        P21PROG3           VLOAD    CLEAR                                 
019914,000145: 37,2051           00001                                    RATT                                  
019915,000146: 37,2052           01663                                    LUNAFLAG                              
019916,000147: 37,2053           16152        P21PROG4           STODL    ALPHAV                                
019917,000148: 37,2054           00015                                    TAT                                   
019918,000149: 37,2055           45014                           CLEAR    CALL                                  
019919,000150: 37,2056           00662                                    ERADFLAG                              
019920,000151: 37,2057           26322                                    LAT-LONG                              
019921,000152: 37,2060           77776                           EXIT                                           
019922,000153: 37,2061           32101                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
019923,000154: 37,2062           04555                           TC       BANKCALL                              #  LAT,LONG = 1/2 REVS B0
019924,000155: 37,2063           20624                           CADR     GOFLASH                               #  ALT = KM B14
019925,000156: 37,2064           04106                           TC       GOTOPOOH                              #  TERM
019926,000157: 37,2065           04106                           TC       GOTOPOOH                              
019927,000158: 37,2066           06006                           TC       INTPRET                               #  V32E RECYCLE
019928,000159: 37,2067           43345                           DLOAD    DAD                                   
019929,000160: 37,2070           02316                                    P21TIME                               
019930,000161: 37,2071           36076                                    600SEC                                #  600 SECONDS OR 10 MIN
019931,000162: 37,2072           01046                           STORE    DSPTEM1                               
019932,000163: 37,2073           77634                           RTB                                            
019933,000164: 37,2074           76011                                    P21PROG1                              
019934,000165: 
019935,000166: 37,2075           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
019936,000167: 37,2077           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
019937,000168: 37,2100           00000                           OCT      00000                                 #  TO BE INTEGRATED
019938,000169: 
019939,000170: 37,2101           01453        V06N43             VN       00643                                 
019940,000171: 37,2102           01442        V6N34              VN       00634                                 
019941,000172: 

End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc.  Parent file is MAIN.agc