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.

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

Page 709

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

Page 710

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

Page 711

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

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