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.

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

Page 370

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

Page 371

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

Page 372

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

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