Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

030130,000002:                                                                                                  ## Copyright:   Public domain.
030131,000003:                                                                                                  ## Filename:    P76.agc
030132,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
030133,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
030134,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
030135,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
030136,000008:                                                                                                  ##              that the code format has been changed to conform to the
030137,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
030138,000010:                                                                                                  ##              original YUL assembler.
030139,000011:                                                                                                  ## Reference:   pp. 709-711
030140,000012:                                                                                                  ## Assembler:   yaYUL
030141,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030142,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
030143,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
030144,000016:                                                                                                  ##              2017-02-10 RRB  Updated for Luminary 116.
030145,000017:                                                                                                  ##              2017-03-01 RSB  Proofed comment text by diff vs Luminary 131
030146,000018:                                                                                                  ##                              and fixed error found.
030147,000019:                                                                                                  ##              2017-03-13 HG   Remove operand modifier CAF V06N84 +1 --> CAF V06N84
030148,000020: 

Page 709

030150,000022:                                                                                                  #  1) PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
030151,000023:                                                                                                  #  2) FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
030152,000024:                                                                                                  #           TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
030153,000025:                                                                                                  #           TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY  EXECUTION OF A THRUSTING MANEUVER. THE
030154,000026:                                                                                                  #           OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
030155,000027:                                                                                                  #           BEEN TRANSFORMED FROM LV TO REF COSYS). USING INTEGRVS, THE    PROGRAM THEN INTEGRATES THE OTHER
030156,000028:                                                                                                  #  VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
030157,000029:                                                                                                  #  STATES CORRESPOND TO THE SAME TIME.
030158,000030:                                                                                                  #  3) ERASABLE INITIALIZATION REQUIRED - NONE.
030159,000031:                                                                                                  #  4) CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
030160,000032:                                                                                                  #           EXITS BY TCF ENDOFJOB.
030161,000033:                                                                                                  #  5) OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
030162,000034:                                                                                                  #           THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
030163,000035:                                                                                                  #           TO REF COSYS.
030164,000036:                                                                                                  #  6) DEBRIS - OTHER VEHICLE STATE VECTOR.
030165,000037:                                                                                                  #  7) SUBROUTINES CALLED - BANKCALL,GOXDSPF,CSMPREC (OR LEMPREC),ATOPCSM (OR ATOPLEM),INTSTALL,INTWAKE, PHASCHNG
030166,000038:                                                                                                  #            INTPRET, INTEGRVS, AND MINIRECT.
030167,000039: 
030168,000040:                                                                                                  #  8) FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
030169,000041: 
030170,000042: 30,2061                                           BANK     30                                    
030171,000043: 13,2000                                           SETLOC   P76LOC                                
030172,000044: 13,2000                                           BANK                                           
030173,000045: 
030174,000046: 13,2207                                           COUNT*   $$/P76                                
030175,000047: 
030176,000048: 13,2207  E7,1441                                  EBANK=   TIG                                   
030177,000049: 
030178,000050: 13,2207           05504        P76                TC       UPFLAG                                
030179,000051: 13,2210           00031                           ADRES    TRACKFLG                              
030180,000052: 
030181,000053: 13,2211           06042                           TC       INTPRET                               
030182,000054: 13,2212           77775                           VLOAD                                          
030183,000055: 13,2213           03434                                    DELVLVC                               
030184,000056: 13,2214           02223                           STORE    DELVOV                                
030185,000057: 13,2215           77776                           EXIT                                           
030186,000058: 
030187,000059: 13,2216           32337                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
030188,000060: 13,2217           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
030189,000061: 13,2220           20477                           CADR     GOFLASH                               
030190,000062: 13,2221           12333                           TCF      ENDP76                                
030191,000063: 13,2222           02224                           TC       +2                                    #  PROCEED
030192,000064: 13,2223           02216                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
030193,000065: 13,2224           32336                           CAF      V06N84                                #  FLASH LAST DELTA V,
030194,000066: 13,2225           04616                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
030195,000067: 13,2226           20477                           CADR     GOFLASH                               
030196,000068: 13,2227           12333                           TCF      ENDP76                                
030197,000069: 13,2230           02232                           TC       +2                                    
030198,000070: 13,2231           02224                           TC       -5                                    
030199,000071: 13,2232           06042                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE

Page 710

030201,000073: 13,2233           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
030202,000074: 13,2234           03442                                    TIG                                   
030203,000075: 13,2235           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
030204,000076: 13,2236           27044                                    OTHPREC                               
030205,000077: 13,2237           53575        COMPMAT            VLOAD    UNIT                                  
030206,000078: 13,2240           00001                                    RATT                                  
030207,000079: 13,2241           77676                           VCOMP                                          #  U(-R)
030208,000080: 13,2242           00031                           STORE    24D                                   #  U(-R) TO 24D
030209,000081: 13,2243           53435                           VXV      UNIT                                  #  U(-R)XV = U(VXR)
030210,000082: 13,2244           00007                                    VATT                                  
030211,000083: 13,2245           00023                           STORE    18D                                   
030212,000084: 13,2246           53435                           VXV      UNIT                                  #  U(VXR)XU(-R) = U((RXV) XR)
030213,000085: 13,2247           00031                                    24D                                   
030214,000086: 13,2250           24015                           STOVL    12D                                   
030215,000087: 13,2251           02223                                    DELVOV                                
030216,000088: 13,2252           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
030217,000089: 13,2253           00015                                    12D                                   
030218,000090: 13,2254           77655                           VAD                                            
030219,000091: 13,2255           00007                                    VATT                                  
030220,000092: 13,2256           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
030221,000093: 13,2257           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
030222,000094: 13,2260           27412                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
030223,000095: 13,2261           77624                           CALL                                           
030224,000096: 13,2262           26340                                    P76SUB1                               
030225,000097: 13,2263           53775                           VLOAD    VSR*                                  
030226,000098: 13,2264           00007                                    6                                     
030227,000099: 13,2265           57176                                    0,2                                   
030228,000100: 13,2266           25543                           STOVL    VCV                                   
030229,000101: 13,2267           00001                                    RATT                                  
030230,000102: 13,2270           77657                           VSR*                                           
030231,000103: 13,2271           57176                                    0,2                                   
030232,000104: 13,2272           15535                           STODL    RCV                                   
030233,000105: 13,2273           03442                                    TIG                                   
030234,000106: 13,2274           01517                           STORE    TET                                   
030235,000107: 13,2275           71214                           CLEAR    DLOAD                                 
030236,000108: 13,2276           01673                                    INTYPFLG                              
030237,000109: 13,2277           01643                                    TETTHIS                               
030238,000110: 13,2300           34041        INTOTHIS           STCALL   TDEC1                                 
030239,000111: 13,2301           27110                                    INTEGRVS                              
030240,000112: 13,2302           77624                           CALL                                           
030241,000113: 13,2303           27412                                    INTSTALL                              
030242,000114: 13,2304           77775                           VLOAD                                          
030243,000115: 13,2305           00017                                    RATT1                                 
030244,000116: 13,2306           01503                           STORE    RRECT                                 
030245,000117: 13,2307           15535                           STODL    RCV                                   
030246,000118: 13,2310           00015                                    TAT                                   
030247,000119: 13,2311           25517                           STOVL    TET                                   
030248,000120: 13,2312           00025                                    VATT1                                 
030249,000121: 13,2313           77624                           CALL                                           
030250,000122: 13,2314           27707                                    MINIRECT                              

Page 711

030252,000124: 13,2315           77776                           EXIT                                           
030253,000125: 13,2316           05353                           TC       PHASCHNG                              
030254,000126: 13,2317           04024                           OCT      04024                                 
030255,000127: 
030256,000128: 13,2320           05504                           TC       UPFLAG                                
030257,000129: 13,2321           00236                           ADRES    REINTFLG                              
030258,000130: 
030259,000131: 13,2322           06042                           TC       INTPRET                               
030260,000132: 13,2323           77624                           CALL                                           
030261,000133: 13,2324           26662                                    ATOPOTH                               
030262,000134: 13,2325           77531                           SSP      EXIT                                  
030263,000135: 13,2326           00053                                    QPRET                                 
030264,000136: 13,2327           26332                                    OUT                                   
030265,000137: 13,2330           04616                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
030266,000138: 13,2331           27443                           CADR     INTWAKE1                              
030267,000139: 13,2332           77776        OUT                EXIT                                           
030268,000140: 13,2333           34755        ENDP76             CAF      ZERO                                  
030269,000141: 13,2334           55462                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
030270,000142: 13,2335           16001                           TCF      GOTOPOOH                              
030271,000143: 
030272,000144: 13,2336           01524        V06N84             NV       0684                                  
030273,000145: 13,2337           01441                           NV       0633                                  
030274,000146: 13,2340           43174        P76SUB1            AXT,2    SET                                   
030275,000147: 13,2341           00002                                    2                                     
030276,000148: 13,2342           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
030277,000149: 13,2343           77014                           BON      AXT,2                                 
030278,000150: 13,2344           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
030279,000151: 13,2345           00052                                    QPRET                                 
030280,000152: 13,2346           00000                                    0                                     
030281,000153: 13,2347           43414                           CLEAR    RVQ                                   
030282,000154: 13,2350           00263                                    MOONFLAG                              
030283,000155: 
030284,000156: 
030285,000157: 

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