Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

031050,000002:                                                                                                  ## Copyright:   Public domain.
031051,000003:                                                                                                  ## Filename:    P76.agc
031052,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
031053,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
031054,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
031055,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
031056,000008:                                                                                                  ##              that the code format has been changed to conform to the
031057,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
031058,000010:                                                                                                  ##              original YUL assembler.
031059,000011:                                                                                                  ## Reference:   pp. 711-714
031060,000012:                                                                                                  ## Assembler:   yaYUL
031061,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
031062,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
031063,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
031064,000016:                                                                                                  ##              2016-12-01 RSB  Completed.
031065,000017:                                                                                                  ##              2016-12-01 HG   Add missing instructions for INTADR, UPDATADR
031066,000018:                                                                                                  ##                              fix operand GOTOPOOH  -> GOTOP00H
031067,000019:                                                                                                  ##              2016-12-07 HG   'unfix' and revert P00 -> POO
031068,000020:                                                                                                  ##              2016-12-11 HG   Fix operand -5 -> -6
031069,000021:                                                                                                  ##              2016-12-25 RSB  Comment-text proofed using ProoferComments
031070,000022:                                                                                                  ##                              and corrected errors found.
031071,000023: 
031072,000024: 

Page 711

031074,000026:                                                                                                  #  1) PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
031075,000027:                                                                                                  #  2) FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
031076,000028:                                                                                                  #           TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
031077,000029:                                                                                                  #           TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY  EXECUTION OF A THRUSTING MANEUVER. THE
031078,000030:                                                                                                  #           OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
031079,000031:                                                                                                  #           BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE   PROGRAM THEN INTEGRATES THE OTHER
031080,000032:                                                                                                  #  VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
031081,000033:                                                                                                  #  STATES CORRESPOND TO THE SAME TIME.
031082,000034:                                                                                                  #  3) ERASABLE INITIALIZATION REQUIRED - NONE.
031083,000035:                                                                                                  #  4) CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76 E.
031084,000036:                                                                                                  #           EXITS BY TCF ENDOFJOB.
031085,000037:                                                                                                  #  5) OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
031086,000038:                                                                                                  #           THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
031087,000039:                                                                                                  #           TO REF COSYS.
031088,000040:                                                                                                  #  6) DEBRIS - OTHER VEHICLE STATE VECTOR.
031089,000041:                                                                                                  #  7) SUBROUTINES CALLED - BANKCALL,GOXDSPF,CSMPREC (OR LEMPREC),ATOPCSM (OR ATOPLEM),INTSTALL,INTWAKE, PHASCHNG
031090,000042:                                                                                                  #           INTPRET, INTEGRVS, AND MINIRECT.
031091,000043: 
031092,000044:                                                                                                  #  8) FLAG USE - MOONFLAG,CMOONFLAG,INTYPFLG,RASFLAG, AND MARKCTR.
031093,000045: 
031094,000046: 30,2061                                           BANK     30                                    
031095,000047: 13,2000                                           SETLOC   P76LOC                                
031096,000048: 13,2000                                           BANK                                           
031097,000049: 
031098,000050: 13,2207                                           COUNT*   $$/P76                                
031099,000051: 
031100,000052: 13,2207  E7,1441                                  EBANK=   TIG                                   
031101,000053: 
031102,000054: 13,2207           31010        P76ER77            CA       MODREG                                
031103,000055: 13,2210           74744                           MASK     BIT1                                  
031104,000056: 13,2211           55235                           TS       OPTFLAG                               #  OPTFLAG = 0  CM (P76)
031105,000057: 13,2212           05506                           TC       UPFLAG                                #          = 1  LM (P77)
031106,000058: 13,2213           00031                           ADRES    TRACKFLG                              
031107,000059: 
031108,000060: 13,2214           06060                           TC       INTPRET                               
031109,000061: 13,2215           77775                           VLOAD                                          
031110,000062: 13,2216           03434                                    DELVLVC                               
031111,000063: 13,2217           01251                           STORE    DELVOV                                
031112,000064: 13,2220           77776                           EXIT                                           
031113,000065: 
031114,000066: 13,2221           32356                           CAF      V06N3376                              
031115,000067: 13,2222           04607                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
031116,000068: 13,2223           20471                           CADR     GOFLASH                               
031117,000069: 13,2224           12351                           TCF      ENDP76                                
031118,000070: 13,2225           02227                           TC       +2                                    #  PROCEED
031119,000071: 13,2226           02221                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
031120,000072: 13,2227           05355                           TC       PHASCHNG                              
031121,000073: 13,2230           04024                           OCT      04024                                 
031122,000074: 13,2231           51235                           INDEX    OPTFLAG                               
031123,000075: 13,2232           32354                           CAF      V06N84                                #  FLASH V06 N84 (OR N81), LAST DELTV,

Page 712

031125,000077: 13,2233           04607                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
031126,000078: 13,2234           20471                           CADR     GOFLASH                               
031127,000079: 13,2235           12351                           TCF      ENDP76                                
031128,000080: 13,2236           02240                           TC       +2                                    
031129,000081: 13,2237           02231                           TC       -6                                    #  STORE DATA & REPEAT FLASHING DSP
031130,000082: 13,2240           06060                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE
031131,000083: 13,2241           43145                           DLOAD    SET                                   
031132,000084: 13,2242           03442                                    TIG                                   
031133,000085: 13,2243           01076                                    NODOFLAG                              
031134,000086: 13,2244           00041                           STORE    TDEC1                                 
031135,000087: 13,2245           77711                           CCALL                                          
031136,000088: 13,2246           01236                                    OPTFLAG                               
031137,000089: 13,2247           26357                                    INTADR                                
031138,000090: 13,2250           53575        COMPMAT            VLOAD    UNIT                                  
031139,000091: 13,2251           00001                                    RATT                                  
031140,000092: 13,2252           77676                           VCOMP                                          #  U(-R)
031141,000093: 13,2253           00031                           STORE    24D                                   #  U(-R) TO 24D
031142,000094: 13,2254           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
031143,000095: 13,2255           00007                                    VATT                                  
031144,000096: 13,2256           00023                           STORE    18D                                   
031145,000097: 13,2257           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
031146,000098: 13,2260           00031                                    24D                                   
031147,000099: 13,2261           00015                           STORE    12D                                   
031148,000100: 13,2262           46135                           SLOAD    BHIZ                                  
031149,000101: 13,2263           01236                                    OPTFLAG                               
031150,000102: 13,2264           26270                                    +4                                    
031151,000103: 13,2265           77775                           VLOAD                                          
031152,000104: 13,2266           03434                                    DELVLVC                               #  FROM CM
031153,000105: 13,2267           01251                           STORE    DELVOV                                
031154,000106: 13,2270           77775                           VLOAD                                          
031155,000107: 13,2271           01251                                    DELVOV                                #  FROM LM
031156,000108: 13,2272           76505        DVTRANS            VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
031157,000109: 13,2273           00015                                    12D                                   
031158,000110: 13,2274           77655                           VAD                                            
031159,000111: 13,2275           00007                                    VATT                                  
031160,000112: 13,2276           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
031161,000113: 13,2277           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
031162,000114: 13,2300           27447                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
031163,000115: 13,2301           77624                           CALL                                           
031164,000116: 13,2302           26363                                    P76SUB1                               
031165,000117: 13,2303           53775                           VLOAD    VSR*                                  
031166,000118: 13,2304           00007                                    6                                     
031167,000119: 13,2305           57176                                    0,2                                   
031168,000120: 13,2306           25543                           STOVL    VCV                                   
031169,000121: 13,2307           00001                                    RATT                                  
031170,000122: 13,2310           77657                           VSR*                                           
031171,000123: 13,2311           57176                                    0,2                                   
031172,000124: 13,2312           15535                           STODL    RCV                                   
031173,000125: 13,2313           03442                                    TIG                                   
031174,000126: 13,2314           01517                           STORE    TET                                   

Page 713

031176,000128: 13,2315           71214                           CLEAR    DLOAD                                 
031177,000129: 13,2316           01673                                    INTYPFLG                              
031178,000130: 13,2317           01643                                    TETTHIS                               
031179,000131: 13,2320           34041        INTOTHIS           STCALL   TDEC1                                 
031180,000132: 13,2321           27145                                    INTEGRVS                              
031181,000133: 13,2322           77624                           CALL                                           
031182,000134: 13,2323           27447                                    INTSTALL                              
031183,000135: 13,2324           77775                           VLOAD                                          
031184,000136: 13,2325           00017                                    RATT1                                 
031185,000137: 13,2326           01503                           STORE    RRECT                                 
031186,000138: 13,2327           15535                           STODL    RCV                                   
031187,000139: 13,2330           00015                                    TAT                                   
031188,000140: 13,2331           25517                           STOVL    TET                                   
031189,000141: 13,2332           00025                                    VATT1                                 
031190,000142: 13,2333           77624                           CALL                                           
031191,000143: 13,2334           27734                                    MINIRECT                              
031192,000144: 13,2335           77776                           EXIT                                           
031193,000145: 13,2336           05355                           TC       PHASCHNG                              
031194,000146: 13,2337           04024                           OCT      04024                                 
031195,000147: 
031196,000148: 13,2340           06060                           TC       INTPRET                               
031197,000149: 13,2341           62214                           SET      CCALL                                 
031198,000150: 13,2342           05070                                    REINTFLG                              
031199,000151: 13,2343           01236                                    OPTFLAG                               
031200,000152: 13,2344           26361                                    UPDATADR                              
031201,000153: 13,2345           77624                           CALL                                           
031202,000154: 13,2346           27456                                    INTWAKE0                              
031203,000155: 13,2347           77414        OUT                CLEAR    EXIT                                  #  ALLOW V37.  NO NEED TO CLEAR NODOFLAG AT
031204,000156: 13,2350           01276                                    NODOFLAG                              #   ENDP76 SINCE FLAG NOT SET WHEN DISPLAY
031205,000157:                                                                                                  #   RESPONSES TRANSFER THERE FROM P76+.
031206,000158: 13,2351           34746        ENDP76             CAF      ZERO                                  
031207,000159: 13,2352           55462                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
031208,000160: 13,2353           16001                           TCF      GOTOPOOH                              
031209,000161: 
031210,000162: 13,2354           01524        V06N84             NV       0684                                  
031211,000163: 13,2355           01521                           NV       0681                                  
031212,000164: 13,2356           01441        V06N3376           NV       0633                                  
031213,000165: 13,2357           27101        INTADR             CADR     OTHPREC                               
031214,000166: 13,2360           27115                           CADR     THISPREC                              
031215,000167: 13,2361           26717        UPDATADR           CADR     ATOPOTH                               
031216,000168: 13,2362           26772                           CADR     ATOPTHIS                              
031217,000169: 13,2363           43174        P76SUB1            AXT,2    SET                                   
031218,000170: 13,2364           00002                                    2                                     
031219,000171: 13,2365           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
031220,000172: 13,2366           77014                           BON      AXT,2                                 
031221,000173: 13,2367           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
031222,000174: 13,2370           00052                                    QPRET                                 
031223,000175: 13,2371           00000                                    0                                     
031224,000176: 13,2372           43414                           CLEAR    RVQ                                   
031225,000177: 13,2373           00263                                    MOONFLAG                              
031226,000178: 

Page 714 This page is completely blank in the original assembly-listing hardcopy.

031229,000181: 
031230,000182: 

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