Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

030027,000002:                                                                                                  ## Copyright:   Public domain.
030028,000003:                                                                                                  ## Filename:    P76.agc
030029,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
030030,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
030031,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
030032,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
030033,000008:                                                                                                  ##              that the code format has been changed to conform to the
030034,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
030035,000010:                                                                                                  ##              original YUL assembler.
030036,000011:                                                                                                  ## Reference:   pp. 711-713
030037,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030038,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo
030039,000014:                                                                                                  ## Mod history: 05/24/03 RSB.   Began transcribing.
030040,000015:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
030041,000016:                                                                                                  ##                              original harcopy, as opposed to the PDF page
030042,000017:                                                                                                  ##                              numbers in 1701.pdf.
030043,000018:                                                                                                  ##              2017-02-24 RSB  Proofed comment text using octopus/ProoferComments.
030044,000019: 

Page 711

030046,000021:                                                                                                  #  1)    PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
030047,000022:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
030048,000023:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
030049,000024:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
030050,000025:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
030051,000026:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
030052,000027:                                                                                                  #        VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
030053,000028:                                                                                                  #        STATES CORRESPOND TO THE SAME TIME.
030054,000029:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
030055,000030:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
030056,000031:                                                                                                  #        EXITS BY TCF ENDOFJOB.
030057,000032:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
030058,000033:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
030059,000034:                                                                                                  #        TO REF COSYS.
030060,000035:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
030061,000036:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
030062,000037:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
030063,000038:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
030064,000039: 
030065,000040: 30,2061                                           BANK     30                                    
030066,000041: 13,2000                                           SETLOC   P76LOC                                
030067,000042: 13,2000                                           BANK                                           
030068,000043: 
030069,000044: 13,2207                                           COUNT*   $$/P76                                
030070,000045: 
030071,000046: 13,2207  E7,1441                                  EBANK=   TIG                                   
030072,000047: 
030073,000048: 13,2207           05504        P76                TC       UPFLAG                                
030074,000049: 13,2210           00031                           ADRES    TRACKFLG                              
030075,000050: 
030076,000051: 13,2211           06042                           TC       INTPRET                               
030077,000052: 13,2212           77775                           VLOAD                                          
030078,000053: 13,2213           03434                                    DELVLVC                               
030079,000054: 13,2214           02223                           STORE    DELVOV                                
030080,000055: 13,2215           77776                           EXIT                                           
030081,000056: 
030082,000057: 13,2216           32335                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
030083,000058: 13,2217           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
030084,000059: 13,2220           20477                           CADR     GOFLASH                               
030085,000060: 13,2221           12331                           TCF      ENDP76                                
030086,000061: 13,2222           02224                           TC       +2                                    #  PROCEED
030087,000062: 13,2223           02216                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
030088,000063: 13,2224           32334                           CAF      V06N84                                #  FLASH LAST DELTA V,
030089,000064: 13,2225           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
030090,000065: 13,2226           20477                           CADR     GOFLASH                               
030091,000066: 13,2227           12331                           TCF      ENDP76                                
030092,000067: 13,2230           02232                           TC       +2                                    
030093,000068: 13,2231           02224                           TC       -5                                    
030094,000069: 13,2232           06042                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE

Page 712

030096,000071: 13,2233           43145                           DLOAD    SET                                   
030097,000072: 13,2234           03442                                    TIG                                   
030098,000073: 13,2235           01076                                    NODOFLAG                              
030099,000074: 13,2236           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
030100,000075: 13,2237           27042                                    OTHPREC                               
030101,000076: 13,2240           53575        COMPMAT            VLOAD    UNIT                                  
030102,000077: 13,2241           00001                                    RATT                                  
030103,000078: 13,2242           77676                           VCOMP                                          #  U(-R)
030104,000079: 13,2243           00031                           STORE    24D                                   #  U(-R) TO 24D
030105,000080: 13,2244           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
030106,000081: 13,2245           00007                                    VATT                                  
030107,000082: 13,2246           00023                           STORE    18D                                   
030108,000083: 13,2247           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
030109,000084: 13,2250           00031                                    24D                                   
030110,000085: 13,2251           24015                           STOVL    12D                                   
030111,000086: 13,2252           02223                                    DELVOV                                
030112,000087: 13,2253           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
030113,000088: 13,2254           00015                                    12D                                   
030114,000089: 13,2255           77655                           VAD                                            
030115,000090: 13,2256           00007                                    VATT                                  
030116,000091: 13,2257           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
030117,000092: 13,2260           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
030118,000093: 13,2261           27410                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
030119,000094: 13,2262           77624                           CALL                                           
030120,000095: 13,2263           26336                                    P76SUB1                               
030121,000096: 13,2264           53775                           VLOAD    VSR*                                  
030122,000097: 13,2265           00007                                    6                                     
030123,000098: 13,2266           57176                                    0,2                                   
030124,000099: 13,2267           25543                           STOVL    VCV                                   
030125,000100: 13,2270           00001                                    RATT                                  
030126,000101: 13,2271           77657                           VSR*                                           
030127,000102: 13,2272           57176                                    0,2                                   
030128,000103: 13,2273           15535                           STODL    RCV                                   
030129,000104: 13,2274           03442                                    TIG                                   
030130,000105: 13,2275           01517                           STORE    TET                                   
030131,000106: 13,2276           71214                           CLEAR    DLOAD                                 
030132,000107: 13,2277           01673                                    INTYPFLG                              
030133,000108: 13,2300           01643                                    TETTHIS                               
030134,000109: 13,2301           34041        INTOTHIS           STCALL   TDEC1                                 
030135,000110: 13,2302           27106                                    INTEGRVS                              
030136,000111: 13,2303           77624                           CALL                                           
030137,000112: 13,2304           27410                                    INTSTALL                              
030138,000113: 13,2305           77775                           VLOAD                                          
030139,000114: 13,2306           00017                                    RATT1                                 
030140,000115: 13,2307           01503                           STORE    RRECT                                 
030141,000116: 13,2310           15535                           STODL    RCV                                   
030142,000117: 13,2311           00015                                    TAT                                   
030143,000118: 13,2312           25517                           STOVL    TET                                   
030144,000119: 13,2313           00025                                    VATT1                                 
030145,000120: 13,2314           77624                           CALL                                           

Page 713

030147,000122: 13,2315           27705                                    MINIRECT                              
030148,000123: 13,2316           77776                           EXIT                                           
030149,000124: 13,2317           05353                           TC       PHASCHNG                              
030150,000125: 13,2320           04024                           OCT      04024                                 
030151,000126: 
030152,000127: 13,2321           06042                           TC       INTPRET                               
030153,000128: 13,2322           45014                           SET      CALL                                  
030154,000129: 13,2323           05070                                    REINTFLG                              
030155,000130: 13,2324           26660                                    ATOPOTH                               
030156,000131: 13,2325           77624                           CALL                                           
030157,000132: 13,2326           27417                                    INTWAKE0                              
030158,000133: 13,2327           77414        OUT                CLEAR    EXIT                                  #  ALLOW V37.  NO NEED TO CLEAR NODOFLAG AT
030159,000134: 13,2330           01276                                    NODOFLAG                              #  ENDP76 SINCE FLAG NOT SET WHEN DISPLAY
030160,000135:                                                                                                  #  RESPONSES TRANSFER THERE FROM P76+.
030161,000136: 13,2331           34755        ENDP76             CAF      ZERO                                  
030162,000137: 13,2332           55462                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
030163,000138: 13,2333           16001                           TCF      GOTOPOOH                              
030164,000139: 
030165,000140: 13,2334           01524        V06N84             NV       0684                                  
030166,000141: 13,2335           01441                           NV       0633                                  
030167,000142: 13,2336           43174        P76SUB1            AXT,2    SET                                   
030168,000143: 13,2337           00002                                    2                                     
030169,000144: 13,2340           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
030170,000145: 13,2341           77014                           BON      AXT,2                                 
030171,000146: 13,2342           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
030172,000147: 13,2343           00052                                    QPRET                                 
030173,000148: 13,2344           00000                                    0                                     
030174,000149: 13,2345           43414                           CLEAR    RVQ                                   
030175,000150: 13,2346           00263                                    MOONFLAG                              
030176,000151: 
030177,000152: 
030178,000153: 

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