Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

015553,000002:                                                                                                  ## Copyright:   Public domain.
015554,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
015555,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
015556,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
015557,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
015558,000007:                                                                                                  ## Assembler:   yaYUL
015559,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015560,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
015561,000010:                                                                                                  ## Pages:       370-372
015562,000011:                                                                                                  ## Mod history: 2009-05-17 RSB  Adapted from the corresponding 
015563,000012:                                                                                                  ##                              Luminary131 file, using page 
015564,000013:                                                                                                  ##                              images from Luminary 1A.
015565,000014:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
015566,000015:                                                                                                  ##                              and corrected the errors found.
015567,000016:                                                                                                  ##              2017-03-07 RSB  Comment-text fixes noted in proofing Luminary 116.
015568,000017: 
015569,000018:                                                                                                  ## This source code has been transcribed or otherwise adapted from
015570,000019:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
015571,000020:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
015572,000021:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
015573,000022:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
015574,000023:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
015575,000024:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
015576,000025:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
015577,000026:                                                                                                  ## actually created.
015578,000027:                                                                                                  ##
015579,000028:                                                                                                  ## Notations on the hardcopy document read, in part:
015580,000029:                                                                                                  ##
015581,000030:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
015582,000031:                                                                                                  ##      16:27 JULY 14, 1969 
015583,000032: 

Page 370

015585,000034: 22,3242  E5,1642                                  EBANK=   XSM                                   
015586,000035: 
015587,000036: 33,2045                                           BANK     33                                    
015588,000037: 04,2000                                           SETLOC   E/PROG                                
015589,000038: 04,2000                                           BANK                                           
015590,000039: 
015591,000040: 04,2576                                           COUNT*   $$/P07                                
015592,000041: 
015593,000042:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
015594,000043: 
015595,000044:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
015596,000045: 
015597,000046:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
015598,000047:                                                                                                  #  IS NOT POSSIBLE.
015599,000048: 
015600,000049:                                                                                                  #  THE CALLING SEQUENCE IS:
015601,000050: 
015602,000051:                                                                                                  #        TC      BANKCALL
015603,000052:                                                                                                  #        CADR    E/BKCALL
015604,000053:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
015605,000054:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
015606,000055:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
015607,000056:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
015608,000057: 
015609,000058:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
015610,000059:                                                                                                  #  OTHER EMEMORY PROGRAMS.
015611,000060: 
015612,000061:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
015613,000062: 
015614,000063: 04,2576           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
015615,000064: 04,2577           53170                           DXCH     EBUF2                                 #  SAVE DP RETURN.
015616,000065: 04,2600           25167                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
015617,000066: 04,2601           30006                           CA       BBANK                                 
015618,000067: 04,2602           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
015619,000068: 04,2603           27170                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
015620,000069: 04,2604           51167                           NDX      EBUF2                                 
015621,000070: 04,2605           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
015622,000071: 04,2606           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
015623,000072:                                                                                                  #  AND RESTORING A + L.
015624,000073: 04,2607           02613                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
015625,000074: 04,2610           02612                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
015626,000075: 04,2611           25167                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
015627,000076: 04,2612           25167                           INCR     EBUF2                                 
015628,000077: 04,2613           53170        E/SWITCH           DXCH     EBUF2                                 
015629,000078: 04,2614           52006                           DTCB                                           
015630,000079: 

Page 371

015632,000081:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
015633,000082: 
015634,000083:                                                                                                  #  THE CALLING SEQUENCE IS...
015635,000084: 
015636,000085:                                                                                                  #        RTB
015637,000086:                                                                                                  #                E/CALL
015638,000087:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
015639,000088:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
015640,000089: 
015641,000090: 04,2615           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
015642,000091: 04,2616           50001                           INDEX    L                                     
015643,000092: 04,2617           30001                           CA       L                                     #  CADR IN A.
015644,000093: 04,2620           24001                           INCR     L                                     
015645,000094: 04,2621           24001                           INCR     L                                     #  RETURN ADRES IN L.
015646,000095: 04,2622           53170                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
015647,000096: 04,2623           06037                           TC       INTPRET                               
015648,000097: 04,2624           77624                           CALL                                           
015649,000098: 04,2625           01167                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
015650,000099: 04,2626           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
015651,000100: 04,2627           23170                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
015652,000101: 04,2630           16041                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
015653,000102: 

Page 372

015655,000104:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
015656,000105: 
015657,000106:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
015658,000107: 
015659,000108:                                                                                                  #  THE CALLING SEQUENCE IS:
015660,000109: 
015661,000110:                                                                                                  #        INHINT
015662,000111:                                                                                                  #          .
015663,000112:                                                                                                  #          .
015664,000113:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
015665,000114:                                                                                                  #        TC      IBNKCALL
015666,000115:                                                                                                  #        CADR    E/JOBWAK
015667,000116:                                                                                                  #          .                     RETURNS HERE
015668,000117:                                                                                                  #          .
015669,000118:                                                                                                  #          .
015670,000119:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
015671,000120: 
015672,000121: 33,2045                                           BANK     33                                    
015673,000122: 04,2000                                           SETLOC   E/PROG                                
015674,000123: 04,2000                                           BANK                                           
015675,000124: 
015676,000125: 04,2631                                           COUNT*   $$/P07                                
015677,000126: 
015678,000127: 04,2631           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
015679,000128: 04,2632           44741                           CS       BIT11                                 
015680,000129: 04,2633           50064                           NDX      LOCCTR                                
015681,000130: 04,2634           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
015682,000131: 04,2635           00072                           TC       RUPTREG3                              #  RETURN
015683,000132: 

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