Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

022267,000002:                                                                                                  ## Copyright:   Public domain.
022268,000003:                                                                                                  ## Filename:    R31.agc
022269,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
022270,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM) 
022271,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for 
022272,000007:                                                                                                  ##              Apollo 15-17.
022273,000008:                                                                                                  ## Assembler:   yaYUL
022274,000009:                                                                                                  ## Contact:     Hartmuth Gutsche <hgutsche@xplornet.com>
022275,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
022276,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
022277,000012:                                                                                                  ## Mod history: 2009-09-20 HG   Adapted from corresponding Comanche 055 file.
022278,000013:                                                                                                  ##              2009-09-21 JL   Fixed minor typos. 
022279,000014:                                                                                                  ##              2010-01-26 JL   Updated header comments.
022280,000015:                                                                                                  ##              2010-01-31 JL   Fixed page number.
022281,000016:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
022282,000017:                                                                                                  ##              2017-02-08 RSB  Proofed comment text by diff'ing vs Comanche 55
022283,000018:                                                                                                  ##                              and/or octopus/ProoferComments as most-appropriate.
022284,000019: 

Page 507

022286,000021: 31,2000                                           SETLOC   R31                                   
022287,000022: 31,2000                                           BANK                                           
022288,000023: 
022289,000024: 31,2000                                           COUNT*   $$/R3134                              
022290,000025: 31,2000           35045        R31CALL            CAF      PRIO3                                 
022291,000026: 31,2001           05135                           TC       FINDVAC                               
022292,000027: 31,2002  E4,1760                                  EBANK=   SUBEXIT                               
022293,000028: 31,2002           02031 62064                     2CADR    V83CALL                               
022294,000029: 
022295,000030: 31,2004           04636        DSPDELAY           TC       BANKCALL                              
022296,000031: 31,2005           01730                           CADR     1SECDELY                              
022297,000032: 31,2006           31247                           CA       EXTVBACT                              
022298,000033: 31,2007           74755                           MASK     BIT12                                 
022299,000034: 31,2010           00006                           EXTEND                                         
022300,000035: 31,2011           12004                           BZF      DSPDELAY                              
022301,000036: 
022302,000037: 31,2012           30105        DISPN5X            CA       FLAGWRD9                              #  TEST R31FLAG (IN SUNDANCE R31FLAG WILL
022303,000038: 31,2013           74765                           MASK     R31FLBIT                              #  ALWAYS BE SET AS R34 DOES NOT EXIST
022304,000039: 31,2014           00006                           EXTEND                                         
022305,000040: 31,2015           12020                           BZF      +3                                    
022306,000041: 31,2016           32135                           CAF      V16N54                                #  R31    USE NOUN 54
022307,000042: 31,2017           02021                           TC       +2                                    
022308,000043: 31,2020           32136                           CAF      V16N53                                #  R34    USE NOUN 53
022309,000044: 31,2021           04636                           TC       BANKCALL                              
022310,000045: 31,2022           20576                           CADR     GOMARKF                               
022311,000046: 31,2023           05626                           TC       B5OFF                                 
022312,000047: 31,2024           05626                           TC       B5OFF                                 
022313,000048: 31,2025           12012                           TCF      DISPN5X                               
022314,000049: 
022315,000050: 31,2026           06006        V83                TC       INTPRET                               
022316,000051: 31,2027           77650                           GOTO                                           
022317,000052: 31,2030           62177                                    HAVEBASE                              #  INTEG STATE VECTORS
022318,000053: 31,2031           06006        V83CALL            TC       INTPRET                               
022319,000054: 31,2032           77650                           GOTO                                           
022320,000055: 31,2033           62146                                    STATEXTP                              #  EXTRAPOLATE STATE VECTORS
022321,000056: 31,2034           52375        COMPDISP           VLOAD    VSU                                   
022322,000057: 31,2035           00001                                    RATT                                  
022323,000058: 31,2036           02320                                    RONE                                  
022324,000059: 31,2037           51406                           PUSH     ABVAL                                 #  RATT-RONE TO 0D               PD= 6
022325,000060: 31,2040           02312                           STORE    RANGE                                 #  METERS B-29
022326,000061: 31,2041           77301                           NORM     VLOAD                                 
022327,000062: 31,2042           00047                                    X1                                    #  RATT-RONE                     PD= 0
022328,000063: 31,2043           77762                           VSR1                                           
022329,000064: 31,2044           53457                           VSL*     UNIT                                  
022330,000065: 31,2045           20201                                    0,1                                   
022331,000066: 31,2046           52315                           PDVL     VSU                                   #  UNIT(LOS) TO 0D               PD= 6
022332,000067: 31,2047           00007                                    VATT                                  
022333,000068: 31,2050           02326                                    VONE                                  
022334,000069: 31,2051           77641                           DOT                                            #  (VATT-VONE).UNIT(LOS)         PD= 0

Page 508

022336,000071: 31,2052           77752                           SL1                                            
022337,000072: 31,2053           36314                           STCALL   RRATE                                 #  RANGE RATE M/CS B-7
022338,000073: 31,2054           47530                                    CDUTRIG                               #  TO INITIALIZE FOR *NBSM*
022339,000074: 31,2055           77624                           CALL                                           
022340,000075: 31,2056           62317                                    R34LOS                                #  NOTE. PDL MUST = 0.
022341,000076: 31,2057           53575        R34ANG             VLOAD    UNIT                                  
022342,000077: 31,2060           02320                                    RONE                                  
022343,000078: 31,2061           77715                           PDVL                                           #  UR TO 0D                      PD= 6
022344,000079: 31,2062           15334                                    THISAXIS                              #  UNITX FOR CM, UNITZ FOR LM
022345,000080: 31,2063           77214                           BON      VLOAD                                 #  CHK R31FLAG. ON=R31 THETA, OFF=R34 PHI
022346,000081: 31,2064           04713                                    R31FLAG                               
022347,000082: 31,2065           62067                                    +2                                    #        R31-THETA
022348,000083: 31,2066           00015                                    12D                                   
022349,000084: 31,2067           77624                           CALL                                           
022350,000085: 31,2070           47647                                    *NBSM*                                
022351,000086: 31,2071           41505                           VXM      PUSH                                  #  UXORZ TO 6D                   PD=12D
022352,000087: 31,2072           01734                                    REFSMMAT                              
022353,000088: 31,2073           72431                           VPROJ    VSL2                                  
022354,000089: 31,2074           00001                                    0D                                    
022355,000090: 31,2075           53445                           BVSU     UNIT                                  
022356,000091: 31,2076           00007                                    6D                                    
022357,000092: 31,2077           47315                           PDVL     VXV                                   #  UP/2 TO 12D                   PD=18D
022358,000093: 31,2100           02320                                    RONE                                  
022359,000094: 31,2101           02326                                    VONE                                  
022360,000095: 31,2102           47256                           UNIT     VXV                                   
022361,000096: 31,2103           02320                                    RONE                                  
022362,000097: 31,2104           63241                           DOT      PDVL                                  #  SIGN TO 12D, UP/2 TO MPAC     PD=18D
022363,000098: 31,2105           00015                                    12D                                   
022364,000099: 31,2106           50372                           VSL1     DOT                                   #  UP.UXORZ
022365,000100: 31,2107           00007                                    6D                                    
022366,000101: 31,2110           72565                           SIGN     SL1                                   
022367,000102: 31,2111           00015                                    12D                                   
022368,000103: 31,2112           77726                           ACOS                                           
022369,000104: 31,2113           26316                           STOVL    RTHETA                                
022370,000105: 31,2114           02320                                    RONE                                  
022371,000106: 31,2115           51041                           DOT      BPL                                   
022372,000107: 31,2116           00007                                    6D                                    
022373,000108: 31,2117           62124                                    +5                                    
022374,000109: 31,2120           44345                           DLOAD    BDSU                                  #  IF UXORZ.R NEG, RTHETA = 1 - RTHETA
022375,000110: 31,2121           02316                                    RTHETA                                
022376,000111: 31,2122           15344                                    DPPOSMAX                              
022377,000112: 31,2123           02316                           STORE    RTHETA                                #  RTHETA BETWEEN 0 AND 1 REV.
022378,000113: 31,2124           77776                 +5        EXIT                                           
022379,000114: 31,2125           34764                           CAF      BIT5                                  #  HAVE WE BEEN ANSWERED
022380,000115: 31,2126           71247                           MASK     EXTVBACT                              
022381,000116: 31,2127           00006                           EXTEND                                         
022382,000117: 31,2130           12137                           BZF      ISITP79                               
022383,000118: 
022384,000119: 31,2131           41247                           CS       EXTVBACT                              
022385,000120: 31,2132           74755                           MASK     BIT12                                 

Page 509

022387,000122: 31,2133           27247                           ADS      EXTVBACT                              
022388,000123: 
022389,000124: 31,2134           12026                           TCF      V83                                   
022390,000125: 31,2135           04066        V16N54             VN       1654                                  
022391,000126: 31,2136           04065        V16N53             VN       1653                                  
022392,000127: 31,2137           05354        ISITP79            TC       CHECKMM                               
022393,000128: 31,2140           00117                           MM       79         B-14                       
022394,000129: 31,2141           15524                           TCF      ENDEXT                                #  NO, DIE
022395,000130: 
022396,000131: 31,2142           05527                           TC       CLEARMRK                              
022397,000132: 31,2143           05561                           TC       DOWNFLAG                              
022398,000133: 31,2144           00226                           ADRES    PCMANFLG                              
022399,000134: 31,2145           14103                           TCF      GOTOPOOH                              
022400,000135: 

Page 510

022402,000137:                                                                                                  #  STATEXTP DOES AN INITIAL PRECISION EXTRAPOLATION OF THE
022403,000138:                                                                                                  #  LEM STATE VECTOR TO PRESENT TIME OR TO PIPTIME IF AV G
022404,000139:                                                                                                  #  IS ON AND SAVES AS BASE VECTOR. IF AV G IS ON RN + VN
022405,000140:                                                                                                  #  ARE USED AS THE CM STATE VECTOR AND THE INITIAL R RDOT
022406,000141:                                                                                                  #  RTHETA ARE COMPUTED WITH NO FURTHER INTEGRATION. IF AV
022407,000142:                                                                                                  #  G IS OFF A PRECISION EXTRAPOLATION IS MADE OF THE CM
022408,000143:                                                                                                  #  STATE VECTOR TO PRESENT TIME AND.....
022409,000144:                                                                                                  #    THE CM + LM STATE VECTORS ARE INTEGRATED TO PRES TIME
022410,000145:                                                                                                  #    USING PRECISION OR CONIC AS SURFFLAG IS SET OR CLEAR.
022411,000146:                                                                                                  #    IF AV G IS ON THEN SUBSEQUENT PASSES WILL PROVIDE
022412,000147:                                                                                                  #    USE OF RN + VN AS CM STATE VECTOR AND THE LM STATE
022413,000148:                                                                                                  #    VECTOR WILL BE PRECISION INTEGRATED USING LEMPREC
022414,000149:                                                                                                  #    IF SURFFLAG IS SET.
022415,000150:                                                                                                  #      CM STATE VECTOR RONE VONE + LM STATE VECTOR RATT
022416,000151:                                                                                                  #      VATT ARE USED IN COMPUTING R RDOT RTHETA.
022417,000152: 
022418,000153: 31,2146           43034        STATEXTP           RTB      BOF                                   #  INITIAL INTEGRATION
022419,000154: 31,2147           51751                                    LOADTIME                              
022420,000155: 31,2150           03751                                    V37FLAG                               
022421,000156: 31,2151           62154                                    BOTHGO                                #  AV G OFF, USE PRESENT TIME
022422,000157: 31,2152           77624                           CALL                                           
022423,000158: 31,2153           62301                                    GETRVN                                #       ON,  USE RN, VN, PIPTIME
022424,000159: 31,2154           02334        BOTHGO             STORE    BASETIME                              
022425,000160: 31,2155           34041                           STCALL   TDEC1                                 
022426,000161: 31,2156           27161                                    LEMPREC                               
022427,000162: 31,2157           77775                           VLOAD                                          #  BASE VECTOR, LM
022428,000163: 31,2160           00017                                    RATT1                                 
022429,000164: 31,2161           26224                           STOVL    BASEOTP                               #    POS.
022430,000165: 31,2162           00025                                    VATT1                                 
022431,000166: 31,2163           02240                           STORE    BASEOTV                               #    VEL.
022432,000167: 31,2164           71214                           BON      DLOAD                                 
022433,000168: 31,2165           03711                                    V37FLAG                               
022434,000169: 31,2166           62034                                    COMPDISP                              #  COMPUTE R RDOT RTHETA FROM
022435,000170:                                                                                                  #  RONE(RN) VONE(VN) RATT+VATT(LEMPREC)
022436,000171: 31,2167           00015                                    TAT                                   
022437,000172: 31,2170           34041                           STCALL   TDEC1                                 
022438,000173: 31,2171           27145                                    CSMPREC                               
022439,000174: 31,2172           77775                           VLOAD                                          #  BASE VECTOR, CM
022440,000175: 31,2173           00017                                    RATT1                                 
022441,000176: 31,2174           26254                           STOVL    BASETHP                               #   POS.
022442,000177: 31,2175           00025                                    VATT1                                 
022443,000178: 31,2176           02262                           STORE    BASETHV                               #   VEL.
022444,000179: 31,2177           47014        HAVEBASE           BON      RTB                                   #  SUBSEQUENT INTEGRATIONS
022445,000180: 31,2200           03711                                    V37FLAG                               
022446,000181: 31,2201           62264                                    GETRVN5                               
022447,000182: 31,2202           51751                                    LOADTIME                              
022448,000183: 31,2203           34041                           STCALL   TDEC1                                 #  AV G OFF. SET INTEG. OF CM
022449,000184: 31,2204           27516                                    INTSTALL                              
022450,000185: 31,2205           43175                           VLOAD    CLEAR                                 
022451,000186: 31,2206           02254                                    BASETHP                               

Page 511

022453,000188: 31,2207           00263                                    MOONFLAG                              
022454,000189: 31,2210           25535                           STOVL    RCV                                   
022455,000190: 31,2211           02262                                    BASETHV                               
022456,000191: 31,2212           15543                           STODL    VCV                                   
022457,000192: 31,2213           02334                                    BASETIME                              
022458,000193: 31,2214           43014                           BOF      SET                                   #  GET APPROPRIATE MOONFLAG SETTING
022459,000194: 31,2215           04343                                    MOONTHIS                              
022460,000195: 31,2216           62220                                    +2                                    
022461,000196: 31,2217           00063                                    MOONFLAG                              
022462,000197: 31,2220           77614                           CLEAR                                          
022463,000198: 31,2221           01673                                    INTYPFLG                              
022464,000199: 31,2222           43014                           BON      SET                                   
022465,000200: 31,2223           04307                                    SURFFLAG                              
022466,000201: 31,2224           62226                                    +2                                    #  PREC. IF LM DOWN
022467,000202: 31,2225           01473                                    INTYPFLG                              #  CONIC IF LM NOT DOWN
022468,000203: 31,2226           35517                           STCALL   TET                                   
022469,000204: 31,2227           27211                                    INTEGRVS                              #  INTEGRATION --- AT LAST---
022470,000205: 31,2230           77775                           VLOAD                                          
022471,000206: 31,2231           00001                                    RATT                                  
022472,000207: 31,2232           26320                           STOVL    RONE                                  
022473,000208: 31,2233           00007                                    VATT                                  
022474,000209: 31,2234           16326                           STODL    VONE                                  #  GET SET FOR CONIC EXTRAP.,OTHER
022475,000210: 31,2235           00015                                    TAT                                   
022476,000211: 31,2236           45014                           BON      CALL                                  
022477,000212: 31,2237           04307                                    SURFFLAG                              
022478,000213: 31,2240           62275                                    GETRVN6                               #  LEMPREC IF LM DOWN
022479,000214: 31,2241           27516                                    INTSTALL                              #  LEMCONIC IF NOT DOWN
022480,000215: 31,2242           77614                           SET                                            
022481,000216: 31,2243           01473                                    INTYPFLG                              
022482,000217: 31,2244           00041        OTHINT             STORE    TDEC1                                 #  ENTERED IF AV G ON TO INTEG LM
022483,000218: 31,2245           43175                           VLOAD    CLEAR                                 
022484,000219: 31,2246           02224                                    BASEOTP                               
022485,000220: 31,2247           00263                                    MOONFLAG                              
022486,000221: 31,2250           25535                           STOVL    RCV                                   
022487,000222: 31,2251           02240                                    BASEOTV                               
022488,000223: 31,2252           15543                           STODL    VCV                                   
022489,000224: 31,2253           02334                                    BASETIME                              
022490,000225: 31,2254           43014                           BOF      SET                                   
022491,000226: 31,2255           04343                                    MOONTHIS                              
022492,000227: 31,2256           62260                                    +2                                    
022493,000228: 31,2257           00063                                    MOONFLAG                              
022494,000229: 31,2260           35517                           STCALL   TET                                   
022495,000230: 31,2261           27211                                    INTEGRVS                              
022496,000231: 31,2262           77650                           GOTO                                           
022497,000232: 31,2263           62034                                    COMPDISP                              #  COMPUTE R RDOT RTHETA         
022498,000233: 31,2264           77624        GETRVN5            CALL                                           #  AV G ON
022499,000234: 31,2265           62301                                    GETRVN                                
022500,000235: 31,2266           45014                           BON      CALL                                  
022501,000236: 31,2267           04307                                    SURFFLAG                              
022502,000237: 31,2270           62275                                    GETRVN6                               #  LM DOWN, LMPREC

Page 512

022504,000239: 31,2271           27516                                    INTSTALL                              
022505,000240: 31,2272           52014                           CLEAR    GOTO                                  #  INTEGRVS (PREC) IF LM NOT DOWN
022506,000241: 31,2273           01673                                    INTYPFLG                              
022507,000242: 31,2274           62244                                    OTHINT                                
022508,000243: 31,2275           34041        GETRVN6            STCALL   TDEC1                                 
022509,000244: 31,2276           27161                                    LEMPREC                               
022510,000245: 31,2277           77650                           GOTO                                           
022511,000246: 31,2300           62034                                    COMPDISP                              #  COMPUTE R RDOT RTHETA
022512,000247: 31,2301           77620        GETRVN             STQ                                            
022513,000248: 31,2302           00000                                    0D                                    
022514,000249: 31,2303           52175                           VLOAD    GOTO                                  #  AV G ON, RONE = RN  VONE = VN
022515,000250: 31,2304           01030                                    RN                                    #   AND USE PIPTIME
022516,000251: 31,2305           62306                                    +1                                    
022517,000252: 31,2306           36320                           STCALL   RONE                                  
022518,000253: 31,2307           62310                                    +1                                    
022519,000254: 31,2310           52175                           VLOAD    GOTO                                  
022520,000255: 31,2311           01036                                    VN                                    
022521,000256: 31,2312           62313                                    +1                                    
022522,000257: 31,2313           16326                           STODL    VONE                                  
022523,000258: 31,2314           01044                                    PIPTIME                               
022524,000259: 31,2315           77650                           GOTO                                           
022525,000260: 31,2316           00000                                    0D                                    
022526,000261: 31,2000                                           SETLOC   R34                                   
022527,000262: 31,2000                                           BANK                                           
022528,000263: 31,2317                                           COUNT*   $$/R3134                              
022529,000264: 31,2317           77776        R34LOS             EXIT                                           
022530,000265: 31,2320           30036                           CA       CDUS                                  
022531,000266: 31,2321           50120                           INDEX    FIXLOC                                
022532,000267: 31,2322           54011                           TS       9D                                    
022533,000268: 31,2323           30035                           CA       CDUT                                  
022534,000269: 31,2324           50120                           INDEX    FIXLOC                                
022535,000270: 31,2325           54013                           TS       11D                                   
022536,000271: 31,2326           30120                           CA       FIXLOC                                
022537,000272: 31,2327           66211                           AD       SIX                                   
022538,000273: 31,2330           40000                           COM                                            
022539,000274: 31,2331           50120                           INDEX    FIXLOC                                
022540,000275: 31,2332           54046                           TS       X1                                    
022541,000276: 31,2333           06006                           TC       INTPRET                               
022542,000277: 31,2334           77624                           CALL                                           
022543,000278: 31,2335           46000                                    SXTNB                                 
022544,000279: 31,2336           34015                           STCALL   12D                                   
022545,000280: 31,2337           62057                                    R34ANG                                

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