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.

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

Page 711

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

Page 712

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

Page 713

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

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

031223,000181: 
031224,000182: 

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