Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

014111,000002:                                                                                                  ## Copyright:   Public domain.
014112,000003:                                                                                                  ## Filename:    R63.agc
014113,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
014114,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
014115,000006:                                                                                                  ##              although several more revisions would follow. It has been
014116,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
014117,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
014118,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
014119,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
014120,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
014121,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
014122,000013:                                                                                                  ##              rather than the original YUL assembler.
014123,000014:                                                                                                  ## Reference:   pp. 340-343
014124,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014125,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014126,000017:                                                                                                  ## Mod history: 05/06/03 RSB.   Began transcribing.
014127,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
014128,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
014129,000020:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
014130,000021:                                                                                                  ##                              numbers in 1701.pdf.
014131,000022:                                                                                                  ##              2017-01-26 RSB  Back-ported a comment-text fix from Luminary 69.
014132,000023:                                                                                                  ##              2017-02-23 RSB  Proofed comment text using octopus/ProoferComments.
014133,000024:                                                                                                  ##              2017-02-28 RSB  Fixed lingering typos.
014134,000025:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
014135,000026:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
014136,000027: 

Page 340

014138,000029:                                                                                                  #  SUBROUTINE NAME:      V89CALL
014139,000030:                                                                                                  #  MOD NO:       0                       DATE:           9 JAN 1968
014140,000031:                                                                                                  #  MOD BY:       DIGITAL DEVEL GROUP     LOG SECTION:    R63
014141,000032: 
014142,000033:                                                                                                  #  FUNCTIONAL DESCRIPTION:
014143,000034: 
014144,000035:                                                                                                  #  CALLED BY VERB 89 ENTER DURING P00.  PRIO 10 USED.  CALCULATES AND
014145,000036:                                                                                                  #  DISPLAYS FINAL FDAI BALL ANGLES TO POINT LM +X OR +Z AXIS AT CSM.
014146,000037: 
014147,000038:                                                                                                  #  1. KEY IN V 89 E ONLY IF IN PROG 00.  IF NOT IN P00, OPERATOR ERROR AND
014148,000039:                                                                                                  #  EXIT R63, OTHERWISE CONTINUE.
014149,000040: 
014150,000041:                                                                                                  #  2. IF IN P00, DO IMU STATUS CHECK ROUTINE (R02BOTH).  IF IMU ON AND ITS
014151,000042:                                                                                                  #  ORIENTATION KNOWN TO LGC, CONTINUE.
014152,000043: 
014153,000044:                                                                                                  #  3. FLASH DISPLAY V 04 N 06.  R2 INDICATES WHICH SPACECRAFT AXIS IS TO
014154,000045:                                                                                                  #  BE POINTED AT CSM.  INITIAL CHOICE IS PREFERRED (+Z) AXIS (R2=1).
014155,000046:                                                                                                  #  ASTRONAUT CAN CHANGE TO (+X) AXIS (R2 NOT =1) BY V 22 E 2 E.  CONTINUE
014156,000047:                                                                                                  #  AFTER KEYING IN PROCEED.
014157,000048: 
014158,000049:                                                                                                  #  4. BOTH VEHICLE STATE VECTORS UPDATED BY CONIC EQS.
014159,000050: 
014160,000051:                                                                                                  #  5. HALF MAGNITUDE UNIT LOS VECTOR (IN STABLE MEMBER COORDINATES) AND
014161,000052:                                                                                                  #  HALF MAGNITUDE UNIT SPACECRAFT AXIS VECTOR (IN BODY COORDINATES)
014162,000053:                                                                                                  #  PREPARED FOR VECPOINT.
014163,000054: 
014164,000055:                                                                                                  #  6. GIMBAL ANGLES FROM VECPOINT TRANSFORMED INTO FDAI BALL ANGLES BY
014165,000056:                                                                                                  #  BALLANGS.  FLASH DISPLAY V 06 N 18 AND AWAIT RESPONSE.
014166,000057: 
014167,000058:                                                                                                  #  7.    RECYCLE - RETURN TO STEP 4.
014168,000059:                                                                                                  #        TERMINATE - EXIT R63.
014169,000060:                                                                                                  #        PROCEED - RESET 3AXISFLG AND CALL R60LEM FOR ATTITUDE MANEUVER.
014170,000061: 
014171,000062:                                                                                                  #  CALLING SEQUENCE:     V 89 E.
014172,000063: 
014173,000064:                                                                                                  #  SUBROUTINES CALLED:   CHKPOOH, R02BOTH, GOXDSPF, CSMCONIC, LEMCONIC,
014174,000065:                                                                                                  #                        VECPOINT, BALLANGS, R60LEM.
014175,000066: 
014176,000067:                                                                                                  #  NORMAL EXIT MODES:    TC ENDEXT
014177,000068: 
014178,000069:                                                                                                  #  ALARMS:       1. OPERATOR ERROR IF NOT IN P00.
014179,000070:                                                                                                  #                2. PROGRAM ALARM IF IMU IS OFF.
014180,000071:                                                                                                  #                3. PROGRAM ALARM IF IMU ORIENTATION IS UNKNOWN.
014181,000072: 
014182,000073:                                                                                                  #  OUTPUT:       NONE
014183,000074: 
014184,000075:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  NONE
014185,000076: 
014186,000077:                                                                                                  #  DEBRIS:       OPTION1, +1, TDEC1, POINTVSM, SCAXIS, CPHI, CTHETA, CPSI,

Page 341

014188,000079:                                                                                                  #                3AXISFLG.
014189,000080: 
014190,000081: 06,3723  E4,1606                                  EBANK=   RONE                                  
014191,000082: 32,2217                                           BANK     32                                    
014192,000083: 26,2000                                           SETLOC   BAWLANGS                              
014193,000084: 26,2000                                           BANK                                           
014194,000085: 
014195,000086: 26,2022                                           COUNT*   $$/R63                                
014196,000087: 26,2022           04616        V89CALL            TC       BANKCALL                              #  IMU STATUS CHECK.  RETURNS IF ORIENTATION
014197,000088: 26,2023           11233                           CADR     R02BOTH                               #  KNOWN.  ALARMS IF NOT.
014198,000089: 26,2024           36250                           CAF      THREE                                 #  ALLOW ASTRONAUT TO SELECT DESIRED
014199,000090: 26,2025           55050                           TS       OPTIONX                               #  TRACKING ATTITUDE AXIS.
014200,000091: 26,2026           34753                           CAF      ONE                                   
014201,000092: 26,2027           55051                           TS       OPTIONX    +1                         
014202,000093: 26,2030           32117                           CAF      VB04N12                               #  V 04 N 12
014203,000094: 26,2031           04616                           TC       BANKCALL                              
014204,000095: 26,2032           20477                           CADR     GOFLASH                               
014205,000096: 26,2033           05472                           TC       ENDEXT                                #  TERMINATE
014206,000097: 26,2034           02036                           TC       +2                                    #  PROCEED
014207,000098: 26,2035           02030                           TC       -5                                    #  DATA IN.  OPTION1+1 = 1 FOR Z AXIS
014208,000099: 26,2036           06042        V89RECL            TC       INTPRET                               #                     = 2 FOR X AXIS
014209,000100: 26,2037           43234                           RTB      DAD                                   
014210,000101: 26,2040           21574                                    LOADTIME                              #  READ PRESENT TIME
014211,000102: 26,2041           14122                                    DP1MIN                                
014212,000103: 26,2042           02205                           STORE    TSTART82                              #  SAVE TIME FOR LEMCONIC CALL
014213,000104: 26,2043           34041                           STCALL   TDEC1                                 #  STORE TIME FOR CSMCONIC CALL
014214,000105: 26,2044           27065                                    CSMCONIC                              #  CSM STATE VECTOR UPDATE
014215,000106: 26,2045           77775                           VLOAD                                          #  CSMCONIC LEFT R VECTOR IN RATT
014216,000107: 26,2046           00001                                    RATT                                  
014217,000108: 26,2047           16207                           STODL    RONE                                  #  SAVE FOR LINE OF SIGHT (LOS) COMPUTATION
014218,000109: 26,2050           02205                                    TSTART82                              
014219,000110: 26,2051           34041                           STCALL   TDEC1                                 #  STORE TIME FOR LEMCONIC CALL
014220,000111: 26,2052           27077                                    LEMCONIC                              #  LEM STATE VECTOR UPDATE
014221,000112: 26,2053           52375                           VLOAD    VSU                                   #  CSM POSITION - LEM POSITION = LOS
014222,000113: 26,2054           02207                                    RONE                                  #  LOS VECTOR LEFT IN MPAC
014223,000114: 26,2055           00001                                    RATT                                  
014224,000115: 26,2056           47121                           MXV      RTB                                   #  (REFSMMAT X LOS).  TRANSFORMS LOS FROM
014225,000116: 26,2057           01734                                    REFSMMAT                              #  REFERENCE COORD TO STAB MEMB COORD.
014226,000117: 26,2060           21727                                    NORMUNIT                              
014227,000118: 26,2061           03773                           STORE    POINTVSM                              #  STORE LOS FOR VECPOINT CALL
014228,000119: 26,2062           77776                           EXIT                                           
014229,000120: 26,2063           41051                           CS       OPTIONX    +1                         #  1 FOR Z AXIS.  2 FOR X AXIS.
014230,000121: 26,2064           64753                           AD       ONE                                   
014231,000122: 26,2065           00006                           EXTEND                                         
014232,000123: 26,2066           12113                           BZF      ALINEZ                                
014233,000124: 26,2067           06042        ALINEX             TC       INTPRET                               #  X AXIS ALIGNMENT
014234,000125: 26,2070           77775                           VLOAD                                          
014235,000126: 26,2071           06522                                    UNITX                                 #  READ (.5, 0, 0)

Page 342

014237,000128: 26,2072           37765        V89CALL1           STCALL   SCAXIS                                #  STORE SELECTED ALIGNMENT AXIS
014238,000129: 26,2073           56040                                    VECPOINT                              #  PUTS DESIRED GIM ANG (OG,IG,MG) IN TMPAC
014239,000130: 26,2074           00322                           STORE    CPHI                                  #  STORE GIMBAL ANGLES FOR BALLANGS CALL.
014240,000131: 26,2075           77776                           EXIT                                           
014241,000132: 26,2076           04616                           TC       BANKCALL                              
014242,000133: 26,2077           54272                           CADR     BALLANGS                              #  PUTS DESIRED BALL ANGLES IN FDAIX,Y,Z
014243,000134: 26,2100           32120                           CAF      VB06N18                               #  V 06 N 18
014244,000135: 26,2101           04616                           TC       BANKCALL                              #  NOUN 18 REFERS TO FDAIX,Y,Z
014245,000136: 26,2102           20477                           CADR     GOFLASH                               
014246,000137: 26,2103           05472                           TC       ENDEXT                                #  TERMINATE
014247,000138: 26,2104           02106                           TC       +2                                    #  PROCEED
014248,000139: 26,2105           02036                           TC       V89RECL                               #  RECYCLE
014249,000140: 26,2106           05516                           TC       DOWNFLAG                              #  RESET 3 AXIS FLAG
014250,000141: 26,2107           00124                           ADRES    3AXISFLG                              #  RESET BIT6 FLAG WORD 5
014251,000142: 26,2110           04616                           TC       BANKCALL                              #  PERFORMS LEM MANEUVER TO ALIGN SELECTED
014252,000143: 26,2111           54123                           CADR     R60LEM                                #  SPACECRAFT AXIS TO CSM.
014253,000144: 26,2112           15472                           TCF      ENDEXT                                #  TERMINATE R63
014254,000145: 
014255,000146: 26,2113           06042        ALINEZ             TC       INTPRET                               #  Z AXIS ALIGNMENT
014256,000147: 26,2114           52175                           VLOAD    GOTO                                  
014257,000148: 26,2115           06516                                    UNITZ                                 #  READ (0, 0, .5)
014258,000149: 26,2116           54072                                    V89CALL1                              
014259,000150: 
014260,000151: 26,2117           01014        VB04N12            VN       412                                   
014261,000152: 26,2120           01422        VB06N18            VN       0618                                  

Page 343

014263,000154: 26,2121           00000 13560  DP1MIN             2DEC     6000       B-28                       
014264,000155: 

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