Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. 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 178 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.

016057,000002:                                                                                                  ## Copyright:   Public domain.
016058,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
016059,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
016060,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
016061,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
016062,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
016063,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
016064,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
016065,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
016066,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
016067,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
016068,000013:                                                                                                  ##              that the reconstruction is correct.
016069,000014:                                                                                                  ## Reference:   pp. 375-377
016070,000015:                                                                                                  ## Assembler:   yaYUL
016071,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016072,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016073,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
016074,000019: 

Page 375

016076,000021: 22,3242  E5,1642                                  EBANK=   XSM                                   
016077,000022: 
016078,000023: 33,2113                                           BANK     33                                    
016079,000024: 04,2000                                           SETLOC   E/PROG                                
016080,000025: 04,2000                                           BANK                                           
016081,000026: 
016082,000027: 04,2570                                           COUNT*   $$/P07                                
016083,000028: 
016084,000029:                                                                                                  #           SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
016085,000030: 
016086,000031:                                                                                                  #  E/BKCALL   FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
016087,000032: 
016088,000033:                                                                                                  #           THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
016089,000034:                                                                                                  #  IS NOT POSSIBLE.
016090,000035: 
016091,000036:                                                                                                  #           THE CALLING SEQUENCE IS:
016092,000037: 
016093,000038:                                                                                                  #                                                   TC     BANKCALL
016094,000039:                                                                                                  #                                                   CADR   E/BKCALL
016095,000040:                                                                                                  #                                                   CADR   ROUTINE         WHERE YOU WANT TO GO IN FIXED.
016096,000041:                                                                                                  #                                                   RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
016097,000042:                                                                                                  #                                                   RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
016098,000043:                                                                                                  #                                                   RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
016099,000044: 
016100,000045:                                                                                                  #           THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
016101,000046:                                                                                                  #  OTHER EMEMORY PROGRAMS.
016102,000047: 
016103,000048:                                                                                                  #           A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
016104,000049: 
016105,000050: 04,2570           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
016106,000051: 04,2571           53167                           DXCH     EBUF2                                 #  SAVE DP RETURN.
016107,000052: 04,2572           25166                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
016108,000053: 04,2573           30006                           CA       BBANK                                 
016109,000054: 04,2574           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
016110,000055: 04,2575           27167                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
016111,000056: 04,2576           51166                           NDX      EBUF2                                 
016112,000057: 04,2577           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
016113,000058: 04,2600           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
016114,000059:                                                                                                  #  AND RESTORING A + L.
016115,000060: 04,2601           02605                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
016116,000061: 04,2602           02604                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
016117,000062: 04,2603           25166                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
016118,000063: 04,2604           25166                           INCR     EBUF2                                 
016119,000064: 04,2605           53167        E/SWITCH           DXCH     EBUF2                                 
016120,000065: 04,2606           52006                           DTCB                                           
016121,000066: 

Page 376

016123,000068:                                                                                                  #  E/CALL          FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
016124,000069: 
016125,000070:                                                                                                  #           THE CALLING SEQUENCE IS...
016126,000071: 
016127,000072:                                                                                                  #                                                   RTB
016128,000073:                                                                                                  #                                                          E/CALL
016129,000074:                                                                                                  #                                                   CADR   ROUTINE         THE INTERPRETIVE SUBROUTINE YOU WANT.
016130,000075:                                                                                                  #                                                                          RETURNS HERE IN INTERPRETIVE.
016131,000076: 
016132,000077: 04,2607           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
016133,000078: 04,2610           50001                           INDEX    L                                     
016134,000079: 04,2611           30001                           CA       L                                     #  CADR IN A.
016135,000080: 04,2612           24001                           INCR     L                                     
016136,000081: 04,2613           24001                           INCR     L                                     #  RETURN ADRES IN L.
016137,000082: 04,2614           53167                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
016138,000083: 04,2615           06042                           TC       INTPRET                               
016139,000084: 04,2616           77624                           CALL                                           
016140,000085: 04,2617           01166                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
016141,000086: 04,2620           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
016142,000087: 04,2621           23167                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
016143,000088: 04,2622           16044                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
016144,000089: 

Page 377

016146,000091:                                                                                                  #  E/JOBWAK        FOR WAKING UP ERASABLE MEMORY JOBS.
016147,000092: 
016148,000093:                                                                                                  #           THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
016149,000094: 
016150,000095:                                                                                                  #           THE CALLING SEQUENCE IS:
016151,000096: 
016152,000097:                                                                                                  #                                                   INHINT
016153,000098:                                                                                                  #                                                     .
016154,000099:                                                                                                  #                                                     .
016155,000100:                                                                                                  #                                                   CA     WAKEADR         ADDRESS OF SLEEPING JOB
016156,000101:                                                                                                  #                                                   TC     IBNKCALL
016157,000102:                                                                                                  #                                                   CADR   E/JOBWAK
016158,000103:                                                                                                  #                                                     .                    RETURNS HERE
016159,000104:                                                                                                  #                                                     .
016160,000105:                                                                                                  #                                                     .
016161,000106:                                                                                                  #                                                   RELINT                 IF YOU DID AN INHINT.
016162,000107: 
016163,000108: 33,2113                                           BANK     33                                    
016164,000109: 04,2000                                           SETLOC   E/PROG                                
016165,000110: 04,2000                                           BANK                                           
016166,000111: 
016167,000112: 04,2623                                           COUNT*   $$/P07                                
016168,000113: 
016169,000114: 04,2623           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
016170,000115: 04,2624           44741                           CS       BIT11                                 
016171,000116: 04,2625           50064                           NDX      LOCCTR                                
016172,000117: 04,2626           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
016173,000118: 04,2627           00072                           TC       RUPTREG3                              #  RETURN
016174,000119: 

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