Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing.

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.

015122,000002:                                                                                                  ## Copyright:   Public domain.
015123,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
015124,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
015125,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
015126,000006:                                                                                                  ##              development version of the flight software for the Lunar 
015127,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
015128,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
015129,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
015130,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
015131,000011:                                                                                                  ##              Luminary 98 and 99.
015132,000012:                                                                                                  ## Reference:   pp. 370-372
015133,000013:                                                                                                  ## Assembler:   yaYUL
015134,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015135,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015136,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
015137,000017: 

Page 370

015139,000019: 22,3242  E5,1642                                  EBANK=   XSM                                   
015140,000020: 
015141,000021: 33,2045                                           BANK     33                                    
015142,000022: 04,2000                                           SETLOC   E/PROG                                
015143,000023: 04,2000                                           BANK                                           
015144,000024: 
015145,000025: 04,2576                                           COUNT*   $$/P07                                
015146,000026: 
015147,000027:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
015148,000028: 
015149,000029:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
015150,000030: 
015151,000031:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
015152,000032:                                                                                                  #  IS NOT POSSIBLE.
015153,000033: 
015154,000034:                                                                                                  #  THE CALLING SEQUENCE IS:
015155,000035: 
015156,000036:                                                                                                  #        TC      BANKCALL
015157,000037:                                                                                                  #        CADR    E/BKCALL
015158,000038:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
015159,000039:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
015160,000040:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
015161,000041:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
015162,000042: 
015163,000043:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
015164,000044:                                                                                                  #  OTHER EMEMORY PROGRAMS.
015165,000045: 
015166,000046:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
015167,000047: 
015168,000048: 04,2576           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
015169,000049: 04,2577           53170                           DXCH     EBUF2                                 #  SAVE DP RETURN.
015170,000050: 04,2600           25167                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
015171,000051: 04,2601           30006                           CA       BBANK                                 
015172,000052: 04,2602           75012                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
015173,000053: 04,2603           27170                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
015174,000054: 04,2604           51167                           NDX      EBUF2                                 
015175,000055: 04,2605           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
015176,000056: 04,2606           04622                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
015177,000057:                                                                                                  #  AND RESTORING A + L.
015178,000058: 04,2607           02613                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
015179,000059: 04,2610           02612                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
015180,000060: 04,2611           25167                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
015181,000061: 04,2612           25167                           INCR     EBUF2                                 
015182,000062: 04,2613           53170        E/SWITCH           DXCH     EBUF2                                 
015183,000063: 04,2614           52006                           DTCB                                           
015184,000064: 

Page 371

015186,000066:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
015187,000067: 
015188,000068:                                                                                                  #  THE CALLING SEQUENCE IS...
015189,000069: 
015190,000070:                                                                                                  #        RTB
015191,000071:                                                                                                  #                E/CALL
015192,000072:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
015193,000073:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
015194,000074: 
015195,000075: 04,2615           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
015196,000076: 04,2616           50001                           INDEX    L                                     
015197,000077: 04,2617           30001                           CA       L                                     #  CADR IN A.
015198,000078: 04,2620           24001                           INCR     L                                     
015199,000079: 04,2621           24001                           INCR     L                                     #  RETURN ADRES IN L.
015200,000080: 04,2622           53170                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
015201,000081: 04,2623           06037                           TC       INTPRET                               
015202,000082: 04,2624           77624                           CALL                                           
015203,000083: 04,2625           01167                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
015204,000084: 04,2626           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
015205,000085: 04,2627           23170                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
015206,000086: 04,2630           16041                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
015207,000087: 

Page 372

015209,000089:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
015210,000090: 
015211,000091:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
015212,000092: 
015213,000093:                                                                                                  #  THE CALLING SEQUENCE IS:
015214,000094: 
015215,000095:                                                                                                  #        INHINT
015216,000096:                                                                                                  #          .
015217,000097:                                                                                                  #          .
015218,000098:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
015219,000099:                                                                                                  #        TC      IBNKCALL
015220,000100:                                                                                                  #        CADR    E/JOBWAK
015221,000101:                                                                                                  #          .                     RETURNS HERE
015222,000102:                                                                                                  #          .
015223,000103:                                                                                                  #          .
015224,000104:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
015225,000105: 
015226,000106: 33,2045                                           BANK     33                                    
015227,000107: 04,2000                                           SETLOC   E/PROG                                
015228,000108: 04,2000                                           BANK                                           
015229,000109: 
015230,000110: 04,2631                                           COUNT*   $$/P07                                
015231,000111: 
015232,000112: 04,2631           05137        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
015233,000113: 04,2632           44741                           CS       BIT11                                 
015234,000114: 04,2633           50064                           NDX      LOCCTR                                
015235,000115: 04,2634           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
015236,000116: 04,2635           00072                           TC       RUPTREG3                              #  RETURN
015237,000117: 

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