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
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

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

Page 370

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

Page 371

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

Page 372

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

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