Source Code

These source-code files are part of a reconstructed copy of Luminary 163, the first (unflown) release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 163 listing would be different.

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.

016016,000002:                                                                                                  ## Copyright:   Public domain.
016017,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
016018,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
016019,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
016020,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
016021,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
016022,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
016023,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
016024,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
016025,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
016026,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
016027,000013:                                                                                                  ##              that the reconstruction is correct.
016028,000014:                                                                                                  ## Reference:   pp. 375-377
016029,000015:                                                                                                  ## Assembler:   yaYUL
016030,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016031,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016032,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
016033,000019: 

Page 375

016035,000021: 22,3242  E5,1642                                  EBANK=   XSM                                   
016036,000022: 
016037,000023: 33,2117                                           BANK     33                                    
016038,000024: 04,2000                                           SETLOC   E/PROG                                
016039,000025: 04,2000                                           BANK                                           
016040,000026: 
016041,000027: 04,2570                                           COUNT*   $$/P07                                
016042,000028: 
016043,000029:                                                                                                  #           SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
016044,000030: 
016045,000031:                                                                                                  #  E/BKCALL   FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
016046,000032: 
016047,000033:                                                                                                  #           THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
016048,000034:                                                                                                  #  IS NOT POSSIBLE.
016049,000035: 
016050,000036:                                                                                                  #           THE CALLING SEQUENCE IS:
016051,000037: 
016052,000038:                                                                                                  #                                                   TC     BANKCALL
016053,000039:                                                                                                  #                                                   CADR   E/BKCALL
016054,000040:                                                                                                  #                                                   CADR   ROUTINE         WHERE YOU WANT TO GO IN FIXED.
016055,000041:                                                                                                  #                                                   RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
016056,000042:                                                                                                  #                                                   RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
016057,000043:                                                                                                  #                                                   RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
016058,000044: 
016059,000045:                                                                                                  #           THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
016060,000046:                                                                                                  #  OTHER EMEMORY PROGRAMS.
016061,000047: 
016062,000048:                                                                                                  #           A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
016063,000049: 
016064,000050: 04,2570           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
016065,000051: 04,2571           53167                           DXCH     EBUF2                                 #  SAVE DP RETURN.
016066,000052: 04,2572           25166                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
016067,000053: 04,2573           30006                           CA       BBANK                                 
016068,000054: 04,2574           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
016069,000055: 04,2575           27167                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
016070,000056: 04,2576           51166                           NDX      EBUF2                                 
016071,000057: 04,2577           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
016072,000058: 04,2600           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
016073,000059:                                                                                                  #  AND RESTORING A + L.
016074,000060: 04,2601           02605                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
016075,000061: 04,2602           02604                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
016076,000062: 04,2603           25166                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
016077,000063: 04,2604           25166                           INCR     EBUF2                                 
016078,000064: 04,2605           53167        E/SWITCH           DXCH     EBUF2                                 
016079,000065: 04,2606           52006                           DTCB                                           
016080,000066: 

Page 376

016082,000068:                                                                                                  #  E/CALL          FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
016083,000069: 
016084,000070:                                                                                                  #           THE CALLING SEQUENCE IS...
016085,000071: 
016086,000072:                                                                                                  #                                                   RTB
016087,000073:                                                                                                  #                                                          E/CALL
016088,000074:                                                                                                  #                                                   CADR   ROUTINE         THE INTERPRETIVE SUBROUTINE YOU WANT.
016089,000075:                                                                                                  #                                                                          RETURNS HERE IN INTERPRETIVE.
016090,000076: 
016091,000077: 04,2607           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
016092,000078: 04,2610           50001                           INDEX    L                                     
016093,000079: 04,2611           30001                           CA       L                                     #  CADR IN A.
016094,000080: 04,2612           24001                           INCR     L                                     
016095,000081: 04,2613           24001                           INCR     L                                     #  RETURN ADRES IN L.
016096,000082: 04,2614           53167                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
016097,000083: 04,2615           06042                           TC       INTPRET                               
016098,000084: 04,2616           77624                           CALL                                           
016099,000085: 04,2617           01166                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
016100,000086: 04,2620           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
016101,000087: 04,2621           23167                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
016102,000088: 04,2622           16044                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
016103,000089: 

Page 377

016105,000091:                                                                                                  #  E/JOBWAK        FOR WAKING UP ERASABLE MEMORY JOBS.
016106,000092: 
016107,000093:                                                                                                  #           THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
016108,000094: 
016109,000095:                                                                                                  #           THE CALLING SEQUENCE IS:
016110,000096: 
016111,000097:                                                                                                  #                                                   INHINT
016112,000098:                                                                                                  #                                                     .
016113,000099:                                                                                                  #                                                     .
016114,000100:                                                                                                  #                                                   CA     WAKEADR         ADDRESS OF SLEEPING JOB
016115,000101:                                                                                                  #                                                   TC     IBNKCALL
016116,000102:                                                                                                  #                                                   CADR   E/JOBWAK
016117,000103:                                                                                                  #                                                     .                    RETURNS HERE
016118,000104:                                                                                                  #                                                     .
016119,000105:                                                                                                  #                                                     .
016120,000106:                                                                                                  #                                                   RELINT                 IF YOU DID AN INHINT.
016121,000107: 
016122,000108: 33,2117                                           BANK     33                                    
016123,000109: 04,2000                                           SETLOC   E/PROG                                
016124,000110: 04,2000                                           BANK                                           
016125,000111: 
016126,000112: 04,2623                                           COUNT*   $$/P07                                
016127,000113: 
016128,000114: 04,2623           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
016129,000115: 04,2624           44741                           CS       BIT11                                 
016130,000116: 04,2625           50064                           NDX      LOCCTR                                
016131,000117: 04,2626           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
016132,000118: 04,2627           00072                           TC       RUPTREG3                              #  RETURN
016133,000119: 

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