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.

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

Page 502

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

Page 503

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

Page 504

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

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