Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

015896,000002:                                                                                                  ## Copyright:   Public domain.
015897,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
015898,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
015899,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
015900,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
015901,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
015902,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
015903,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
015904,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
015905,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
015906,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
015907,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
015908,000014:                                                                                                  ##              the original YUL assembler.
015909,000015:                                                                                                  ##
015910,000016:                                                                                                  ## Assembler:   yaYUL
015911,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015912,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
015913,000019:                                                                                                  ## Pages:       370-372
015914,000020:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
015915,000021:                                                                                                  ##                              Luminary131 file, using page 
015916,000022:                                                                                                  ##                              images from Luminary 1A.
015917,000023:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
015918,000024:                                                                                                  ##                              and corrected the errors found.
015919,000025:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
015920,000026:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
015921,000027: 
015922,000028:                                                                                                  ## This source code has been transcribed or otherwise adapted from
015923,000029:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
015924,000030:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015925,000031:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
015926,000032:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
015927,000033:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
015928,000034:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
015929,000035:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
015930,000036:                                                                                                  ## actually created.
015931,000037:                                                                                                  ##
015932,000038:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
015933,000039:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
015934,000040:                                                                                                  ## the listing from which it was transcribed. It has been verified to
015935,000041:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
015936,000042:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
015937,000043:                                                                                                  ##
015938,000044:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
015939,000045:                                                                                                  ##
015940,000046:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
015941,000047: 

Page 370

015943,000049: 22,3242  E5,1642                                  EBANK=   XSM                                   
015944,000050: 
015945,000051: 33,2045                                           BANK     33                                    
015946,000052: 04,2000                                           SETLOC   E/PROG                                
015947,000053: 04,2000                                           BANK                                           
015948,000054: 
015949,000055: 04,2576                                           COUNT*   $$/P07                                
015950,000056: 
015951,000057:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
015952,000058: 
015953,000059:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
015954,000060: 
015955,000061:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
015956,000062:                                                                                                  #  IS NOT POSSIBLE.
015957,000063: 
015958,000064:                                                                                                  #  THE CALLING SEQUENCE IS:
015959,000065: 
015960,000066:                                                                                                  #        TC      BANKCALL
015961,000067:                                                                                                  #        CADR    E/BKCALL
015962,000068:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
015963,000069:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
015964,000070:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
015965,000071:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
015966,000072: 
015967,000073:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
015968,000074:                                                                                                  #  OTHER EMEMORY PROGRAMS.
015969,000075: 
015970,000076:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
015971,000077: 
015972,000078: 04,2576           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
015973,000079: 04,2577           53170                           DXCH     EBUF2                                 #  SAVE DP RETURN.
015974,000080: 04,2600           25167                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
015975,000081: 04,2601           30006                           CA       BBANK                                 
015976,000082: 04,2602           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
015977,000083: 04,2603           27170                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
015978,000084: 04,2604           51167                           NDX      EBUF2                                 
015979,000085: 04,2605           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
015980,000086: 04,2606           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
015981,000087:                                                                                                  #  AND RESTORING A + L.
015982,000088: 04,2607           02613                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
015983,000089: 04,2610           02612                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
015984,000090: 04,2611           25167                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
015985,000091: 04,2612           25167                           INCR     EBUF2                                 
015986,000092: 04,2613           53170        E/SWITCH           DXCH     EBUF2                                 
015987,000093: 04,2614           52006                           DTCB                                           
015988,000094: 

Page 371

015990,000096:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
015991,000097: 
015992,000098:                                                                                                  #  THE CALLING SEQUENCE IS...
015993,000099: 
015994,000100:                                                                                                  #        RTB
015995,000101:                                                                                                  #                E/CALL
015996,000102:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
015997,000103:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
015998,000104: 
015999,000105: 04,2615           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
016000,000106: 04,2616           50001                           INDEX    L                                     
016001,000107: 04,2617           30001                           CA       L                                     #  CADR IN A.
016002,000108: 04,2620           24001                           INCR     L                                     
016003,000109: 04,2621           24001                           INCR     L                                     #  RETURN ADRES IN L.
016004,000110: 04,2622           53170                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
016005,000111: 04,2623           06037                           TC       INTPRET                               
016006,000112: 04,2624           77624                           CALL                                           
016007,000113: 04,2625           01167                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
016008,000114: 04,2626           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
016009,000115: 04,2627           23170                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
016010,000116: 04,2630           16041                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
016011,000117: 

Page 372

016013,000119:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
016014,000120: 
016015,000121:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
016016,000122: 
016017,000123:                                                                                                  #  THE CALLING SEQUENCE IS:
016018,000124: 
016019,000125:                                                                                                  #        INHINT
016020,000126:                                                                                                  #          .
016021,000127:                                                                                                  #          .
016022,000128:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
016023,000129:                                                                                                  #        TC      IBNKCALL
016024,000130:                                                                                                  #        CADR    E/JOBWAK
016025,000131:                                                                                                  #          .                     RETURNS HERE
016026,000132:                                                                                                  #          .
016027,000133:                                                                                                  #          .
016028,000134:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
016029,000135: 
016030,000136: 33,2045                                           BANK     33                                    
016031,000137: 04,2000                                           SETLOC   E/PROG                                
016032,000138: 04,2000                                           BANK                                           
016033,000139: 
016034,000140: 04,2631                                           COUNT*   $$/P07                                
016035,000141: 
016036,000142: 04,2631           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
016037,000143: 04,2632           44741                           CS       BIT11                                 
016038,000144: 04,2633           50064                           NDX      LOCCTR                                
016039,000145: 04,2634           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
016040,000146: 04,2635           00072                           TC       RUPTREG3                              #  RETURN
016041,000147: 

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