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.

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

Page 507

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

Page 508

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

Page 509

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

Page 510

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

Page 511

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

Page 512

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

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