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.

021897,000002:                                                                                                  ## Copyright:   Public domain.
021898,000003:                                                                                                  ## Filename:    P76.agc
021899,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
021900,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
021901,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
021902,000007:                                                                                                  ## Assembler:   yaYUL
021903,000008:                                                                                                  ## Reference:   pp. 502-504.
021904,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021905,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
021906,000011:                                                                                                  ## Mod history: 08/12/04 RSB.   Adapted from corresponding Luminary131
021907,000012:                                                                                                  ##                              file.
021908,000013:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
021909,000014:                                                                                                  ##                              original harcopy, as opposed to the PDF page
021910,000015:                                                                                                  ##                              numbers in 1701.pdf.
021911,000016:                                                                                                  ##              2017-01-18 RSB  Cross-diff'd comment text (not whitespace)
021912,000017:                                                                                                  ##                              vs the already-proofed corresponding Colossus
021913,000018:                                                                                                  ##                              237 and Comanche 55 source-code files
021914,000019:                                                                                                  ##                              and corrected errors found.
021915,000020:                                                                                                  ##
021916,000021:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
021917,000022:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
021918,000023:                                                                                                  ## document read, in part:
021919,000024:                                                                                                  ##
021920,000025:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
021921,000026:                                                                                                  ##      2021111-041.  October 28, 1968.  
021922,000027:                                                                                                  ##
021923,000028:                                                                                                  ##      This AGC program shall also be referred to as
021924,000029:                                                                                                  ##                              Colossus 1A
021925,000030:                                                                                                  ##
021926,000031:                                                                                                  ##      Prepared by
021927,000032:                                                                                                  ##                      Massachusetts Institute of Technology
021928,000033:                                                                                                  ##                      75 Cambridge Parkway
021929,000034:                                                                                                  ##                      Cambridge, Massachusetts
021930,000035:                                                                                                  ##      under NASA contract NAS 9-4065.
021931,000036:                                                                                                  ##
021932,000037:                                                                                                  ## Refer directly to the online document mentioned above for further information.
021933,000038:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
021934,000039:                                                                                                  ##
021935,000040:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
021936,000041:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
021937,000042:                                                                                                  ## source file, and then is proofed to incorporate any changes.
021938,000043: 

Page 502

021940,000045:                                                                                                  #  1)    PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
021941,000046:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
021942,000047:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
021943,000048:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
021944,000049:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
021945,000050:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
021946,000051:                                                                                                  #        VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
021947,000052:                                                                                                  #        STATES CORRESPOND TO THE SAME TIME.
021948,000053:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
021949,000054:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
021950,000055:                                                                                                  #        EXITS BY TCF ENDOFJOB.
021951,000056:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
021952,000057:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
021953,000058:                                                                                                  #        TO REF COSYS.
021954,000059:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
021955,000060:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
021956,000061:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
021957,000062:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
021958,000063: 
021959,000064: 30,2000                                           BANK     30                                    
021960,000065: 13,2000                                           SETLOC   P76LOC                                
021961,000066: 13,2000                                           BANK                                           
021962,000067: 
021963,000068: 13,2036                                           COUNT*   $$/P76                                
021964,000069: 
021965,000070: 13,2036  E7,1412                                  EBANK=   TIG                                   
021966,000071: 
021967,000072: 13,2036           05435        P76                TC       UPFLAG                                
021968,000073: 13,2037           00031                           ADRES    TRACKFLG                              
021969,000074: 
021970,000075: 13,2040           32163                           CAF      V06N84                                #  FLASH LAST DELTA V,
021971,000076: 13,2041           04555                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021972,000077: 13,2042           20624                           CADR     GOFLASH                               
021973,000078: 13,2043           12155                           TCF      ENDP76                                
021974,000079: 13,2044           02046                           TC       +2                                    #  PROCEED
021975,000080: 13,2045           02040                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
021976,000081: 13,2046           32164                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
021977,000082: 13,2047           04555                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021978,000083: 13,2050           20624                           CADR     GOFLASH                               
021979,000084: 13,2051           12155                           TCF      ENDP76                                
021980,000085: 13,2052           02054                           TC       +2                                    
021981,000086: 13,2053           02046                           TC       -5                                    
021982,000087: 13,2054           06006                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE
021983,000088: 13,2055           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
021984,000089: 13,2056           03413                                    TIG                                   
021985,000090: 13,2057           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
021986,000091: 13,2060           27036                                    OTHPREC                               
021987,000092: 13,2061           53575        COMPMAT            VLOAD    UNIT                                  
021988,000093: 13,2062           00001                                    RATT                                  

Page 503

021990,000095: 13,2063           77676                           VCOMP                                          #  U(-R)
021991,000096: 13,2064           00031                           STORE    24D                                   #  U(-R) TO 24D
021992,000097: 13,2065           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
021993,000098: 13,2066           00007                                    VATT                                  
021994,000099: 13,2067           00023                           STORE    18D                                   
021995,000100: 13,2070           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
021996,000101: 13,2071           00031                                    24D                                   
021997,000102: 13,2072           24015                           STOVL    12D                                   
021998,000103: 13,2073           03540                                    DELVOV                                
021999,000104: 13,2074           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
022000,000105: 13,2075           00015                                    12D                                   
022001,000106: 13,2076           77655                           VAD                                            
022002,000107: 13,2077           00007                                    VATT                                  
022003,000108: 13,2100           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
022004,000109: 13,2101           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
022005,000110: 13,2102           27371                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
022006,000111: 13,2103           77624                           CALL                                           
022007,000112: 13,2104           26165                                    P76SUB1                               
022008,000113: 13,2105           53775                           VLOAD    VSR*                                  
022009,000114: 13,2106           00007                                    6                                     
022010,000115: 13,2107           57176                                    0,2                                   
022011,000116: 13,2110           25543                           STOVL    VCV                                   
022012,000117: 13,2111           00001                                    RATT                                  
022013,000118: 13,2112           77657                           VSR*                                           
022014,000119: 13,2113           57176                                    0,2                                   
022015,000120: 13,2114           15535                           STODL    RCV                                   
022016,000121: 13,2115           03413                                    TIG                                   
022017,000122: 13,2116           01517                           STORE    TET                                   
022018,000123: 13,2117           71214                           CLEAR    DLOAD                                 
022019,000124: 13,2120           01673                                    INTYPFLG                              
022020,000125: 13,2121           01571                                    TETTHIS                               
022021,000126: 13,2122           34041        INTOTHIS           STCALL   TDEC1                                 
022022,000127: 13,2123           27066                                    INTEGRVS                              
022023,000128: 13,2124           77624                           CALL                                           
022024,000129: 13,2125           27371                                    INTSTALL                              
022025,000130: 13,2126           77775                           VLOAD                                          
022026,000131: 13,2127           00017                                    RATT1                                 
022027,000132: 13,2130           01503                           STORE    RRECT                                 
022028,000133: 13,2131           15535                           STODL    RCV                                   
022029,000134: 13,2132           00015                                    TAT                                   
022030,000135: 13,2133           25517                           STOVL    TET                                   
022031,000136: 13,2134           00025                                    VATT1                                 
022032,000137: 13,2135           77624                           CALL                                           
022033,000138: 13,2136           23360                                    MINIRECT                              
022034,000139: 13,2137           77776                           EXIT                                           
022035,000140: 13,2140           05301                           TC       PHASCHNG                              
022036,000141: 13,2141           04024                           OCT      04024                                 
022037,000142: 
022038,000143: 13,2142           05435                           TC       UPFLAG                                
022039,000144: 13,2143           00236                           ADRES    REINTFLG                              

Page 504

022041,000146: 
022042,000147: 13,2144           06006                           TC       INTPRET                               
022043,000148: 13,2145           77624                           CALL                                           
022044,000149: 13,2146           26711                                    ATOPOTH                               
022045,000150: 13,2147           77531                           SSP      EXIT                                  
022046,000151: 13,2150           00053                                    QPRET                                 
022047,000152: 13,2151           26154                                    OUT                                   
022048,000153: 13,2152           04555                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
022049,000154: 13,2153           27426                           CADR     INTWAKE1                              
022050,000155: 13,2154           77776        OUT                EXIT                                           
022051,000156: 13,2155           34714        ENDP76             CAF      ZERO                                  
022052,000157: 13,2156           55126                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
022053,000158: 13,2157           55125                           TS       VHFCNT                                
022054,000159: 
022055,000160: 13,2160           37716                           CAF      NEGONE                                
022056,000161: 13,2161           55734                           TS       MRKBUF2                               #  INVALIDATE MARK BUFFER
022057,000162: 
022058,000163: 13,2162           14106                           TCF      GOTOPOOH                              
022059,000164: 
022060,000165: 13,2163           01524        V06N84             NV       0684                                  
022061,000166: 13,2164           01441                           NV       0633                                  
022062,000167: 13,2165           43174        P76SUB1            AXT,2    SET                                   
022063,000168: 13,2166           00002                                    2                                     
022064,000169: 13,2167           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
022065,000170: 13,2170           77014                           BON      AXT,2                                 
022066,000171: 13,2171           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
022067,000172: 13,2172           00052                                    QPRET                                 
022068,000173: 13,2173           00000                                    0                                     
022069,000174: 13,2174           43414                           CLEAR    RVQ                                   
022070,000175: 13,2175           00263                                    MOONFLAG                              
022071,000176: 
022072,000177: 
022073,000178: 
022074,000179: 
022075,000180: 

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