Source Code

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

The reconstruction began with reconstructed source code for Luminary 178. Changes between revision 173 and 178 were backed out, as described by Luminary memo 167 (revision 1). 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 173 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.

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

Page 375

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

Page 376

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

Page 377

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

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