Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

016548,000002:                                                                                                  ## Copyright:   Public domain.
016549,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
016550,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
016551,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
016552,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
016553,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
016554,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
016555,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
016556,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
016557,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
016558,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
016559,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
016560,000014:                                                                                                  ## Reference:   pp. 383-385
016561,000015:                                                                                                  ## Assembler:   yaYUL
016562,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016563,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016564,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
016565,000019: 

Page 383

016567,000021: 22,3242  E5,1642                                  EBANK=   XSM                                   
016568,000022: 
016569,000023: 33,2045                                           BANK     33                                    
016570,000024: 04,2000                                           SETLOC   E/PROG                                
016571,000025: 04,2000                                           BANK                                           
016572,000026: 
016573,000027: 04,2533                                           COUNT*   $$/P07                                
016574,000028: 
016575,000029:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
016576,000030: 
016577,000031:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
016578,000032: 
016579,000033:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
016580,000034:                                                                                                  #  IS NOT POSSIBLE.
016581,000035: 
016582,000036:                                                                                                  #  THE CALLING SEQUENCE IS:
016583,000037: 
016584,000038:                                                                                                  #        TC      BANKCALL
016585,000039:                                                                                                  #        CADR    E/BKCALL
016586,000040:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
016587,000041:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
016588,000042:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
016589,000043:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
016590,000044: 
016591,000045:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
016592,000046:                                                                                                  #  OTHER EMEMORY PROGRAMS.
016593,000047: 
016594,000048:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
016595,000049: 
016596,000050: 04,2533           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
016597,000051: 04,2534           53170                           DXCH     EBUF2                                 #  SAVE DP RETURN.
016598,000052: 04,2535           25167                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
016599,000053: 04,2536           30006                           CA       BBANK                                 
016600,000054: 04,2537           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
016601,000055: 04,2540           27170                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
016602,000056: 04,2541           51167                           NDX      EBUF2                                 
016603,000057: 04,2542           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
016604,000058: 04,2543           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
016605,000059:                                                                                                  #  AND RESTORING A + L.
016606,000060: 04,2544           02550                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
016607,000061: 04,2545           02547                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
016608,000062: 04,2546           25167                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
016609,000063: 04,2547           25167                           INCR     EBUF2                                 
016610,000064: 04,2550           53170        E/SWITCH           DXCH     EBUF2                                 
016611,000065: 04,2551           52006                           DTCB                                           
016612,000066: 

Page 384

016614,000068:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
016615,000069: 
016616,000070:                                                                                                  #  THE CALLING SEQUENCE IS...
016617,000071: 
016618,000072:                                                                                                  #        RTB
016619,000073:                                                                                                  #                E/CALL
016620,000074:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
016621,000075:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
016622,000076: 
016623,000077: 04,2552           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
016624,000078: 04,2553           50001                           INDEX    L                                     
016625,000079: 04,2554           30001                           CA       L                                     #  CADR IN A.
016626,000080: 04,2555           24001                           INCR     L                                     
016627,000081: 04,2556           24001                           INCR     L                                     #  RETURN ADRES IN L.
016628,000082: 04,2557           53170                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
016629,000083: 04,2560           06036                           TC       INTPRET                               
016630,000084: 04,2561           77624                           CALL                                           
016631,000085: 04,2562           01167                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
016632,000086: 04,2563           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
016633,000087: 04,2564           23170                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
016634,000088: 04,2565           16040                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
016635,000089: 

Page 385

016637,000091:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
016638,000092: 
016639,000093:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
016640,000094: 
016641,000095:                                                                                                  #  THE CALLING SEQUENCE IS:
016642,000096: 
016643,000097:                                                                                                  #        INHINT
016644,000098:                                                                                                  #          .
016645,000099:                                                                                                  #          .
016646,000100:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
016647,000101:                                                                                                  #        TC      IBNKCALL
016648,000102:                                                                                                  #        CADR    E/JOBWAK
016649,000103:                                                                                                  #          .                     RETURNS HERE
016650,000104:                                                                                                  #          .
016651,000105:                                                                                                  #          .
016652,000106:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
016653,000107: 
016654,000108: 33,2045                                           BANK     33                                    
016655,000109: 04,2000                                           SETLOC   E/PROG                                
016656,000110: 04,2000                                           BANK                                           
016657,000111: 
016658,000112: 04,2566                                           COUNT*   $$/P07                                
016659,000113: 
016660,000114: 04,2566           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
016661,000115: 04,2567           44741                           CS       BIT11                                 
016662,000116: 04,2570           50064                           NDX      LOCCTR                                
016663,000117: 04,2571           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
016664,000118: 04,2572           00072                           TC       RUPTREG3                              #  RETURN
016665,000119: 

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