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.

030000,000002:                                                                                                  ## Copyright:   Public domain.
030001,000003:                                                                                                  ## Filename:    P76.agc
030002,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
030003,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
030004,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
030005,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
030006,000008:                                                                                                  ##              that the code format has been changed to conform to the
030007,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
030008,000010:                                                                                                  ##              original YUL assembler.
030009,000011:                                                                                                  ## Reference:   pp. 711-713
030010,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030011,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo
030012,000014:                                                                                                  ## Mod history: 05/24/03 RSB.   Began transcribing.
030013,000015:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
030014,000016:                                                                                                  ##                              original harcopy, as opposed to the PDF page
030015,000017:                                                                                                  ##                              numbers in 1701.pdf.
030016,000018:                                                                                                  ##              2017-02-24 RSB  Proofed comment text using octopus/ProoferComments.
030017,000019: 

Page 711

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

Page 712

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

Page 713

030120,000122: 13,2315           27705                                    MINIRECT                              
030121,000123: 13,2316           77776                           EXIT                                           
030122,000124: 13,2317           05353                           TC       PHASCHNG                              
030123,000125: 13,2320           04024                           OCT      04024                                 
030124,000126: 
030125,000127: 13,2321           06042                           TC       INTPRET                               
030126,000128: 13,2322           45014                           SET      CALL                                  
030127,000129: 13,2323           05070                                    REINTFLG                              
030128,000130: 13,2324           26660                                    ATOPOTH                               
030129,000131: 13,2325           77624                           CALL                                           
030130,000132: 13,2326           27417                                    INTWAKE0                              
030131,000133: 13,2327           77414        OUT                CLEAR    EXIT                                  #  ALLOW V37.  NO NEED TO CLEAR NODOFLAG AT
030132,000134: 13,2330           01276                                    NODOFLAG                              #  ENDP76 SINCE FLAG NOT SET WHEN DISPLAY
030133,000135:                                                                                                  #  RESPONSES TRANSFER THERE FROM P76+.
030134,000136: 13,2331           34755        ENDP76             CAF      ZERO                                  
030135,000137: 13,2332           55462                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
030136,000138: 13,2333           16001                           TCF      GOTOPOOH                              
030137,000139: 
030138,000140: 13,2334           01524        V06N84             NV       0684                                  
030139,000141: 13,2335           01441                           NV       0633                                  
030140,000142: 13,2336           43174        P76SUB1            AXT,2    SET                                   
030141,000143: 13,2337           00002                                    2                                     
030142,000144: 13,2340           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
030143,000145: 13,2341           77014                           BON      AXT,2                                 
030144,000146: 13,2342           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
030145,000147: 13,2343           00052                                    QPRET                                 
030146,000148: 13,2344           00000                                    0                                     
030147,000149: 13,2345           43414                           CLEAR    RVQ                                   
030148,000150: 13,2346           00263                                    MOONFLAG                              
030149,000151: 
030150,000152: 
030151,000153: 

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