Source Code

This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure!

042740,000002:                                                                                                  ## Copyright:   Public domain.
042741,000003:                                                                                                  ## Filename:    INTER-BANK_COMMUNICATION.agc
042742,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
042743,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
042744,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
042745,000007:                                                                                                  ## Assembler:   yaYUL
042746,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042747,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
042748,000010:                                                                                                  ## Pages:       998-1001
042749,000011:                                                                                                  ## Mod history: 2009-05-24 RSB  Adapted from the corresponding 
042750,000012:                                                                                                  ##                              Luminary131 file, using page 
042751,000013:                                                                                                  ##                              images from Luminary 1A.
042752,000014:                                                                                                  ##              2011-05-08 JL   Removed workaround.
042753,000015:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
042754,000016:                                                                                                  ##                              and corrected the errors found.
042755,000017:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
042756,000018:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
042757,000019:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
042758,000020:                                                                                                  ##                              Luminary 99 vs Comanche 55.
042759,000021: 

Page 998

042761,000023:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED TO CALL A SUBROUTINE IN ANOTHER BANK. IN THE BANKCALL VERSION, THE
042762,000024:                                                                                                  #  CADR OF THE SUBROUTINE IMMEDIATELY FOLLOWS THE TC BANKCALL INSTRUCTION, WITH C(A) AND C(L) PRESERVED.
042763,000025: 
042764,000026:    4616                                           BLOCK    02                                    
042765,000027:    4616                                           COUNT*   $$/BANK                               
042766,000028:    4616           52134        BANKCALL           DXCH     BUF2                                  #  SAVE INCOMING A,L.
042767,000029:    4617           50002                           INDEX    Q                                     #  PICK UP CADR.
042768,000030:    4620           30000                           CA       0                                     
042769,000031:    4621           24002                           INCR     Q                                     #  SO WE RETURN TO THE LOC. AFTER THE CADR.
042770,000032: 
042771,000033:                                                                                                  #  SWCALL IS  IDENTICAL TO BANKCALL, EXCEPT THAT THE CADR ARRIVES IN A.
042772,000034: 
042773,000035:    4622           54001        SWCALL             TS       L                                     
042774,000036:    4623           22004                           LXCH     FBANK                                 #  SWITCH BANKS, SAVING RETURN.
042775,000037:    4624           75012                           MASK     LOW10                                 #  GET SUB-ADDRESS OF CADR.
042776,000038:    4625           56002                           XCH      Q                                     #  A,L NOW CONTAINS DP RETURN.
042777,000039:    4626           52134                           DXCH     BUF2                                  #  RESTORING INPUTS IF THIS IS A BANKCALL.
042778,000040:    4627           50002                           INDEX    Q                                     
042779,000041:    4630           02000                           TC       10000                                 #  SETTING Q TO SWRETURN.
042780,000042: 
042781,000043:    4631           56134        SWRETURN           XCH      BUF2       +1                         #  COMES HERE TO RETURN TO CALLER. C(A,L)
042782,000044:    4632           56004                           XCH      FBANK                                 #  ARE PRESERVED FOR RETURN.
042783,000045:    4633           56134                           XCH      BUF2       +1                         
042784,000046:    4634           00133                           TC       BUF2                                  
042785,000047: 
042786,000048:                                                                                                  #  THE FOLLOWING ROUTINE CAN BE USED AS A UNILATERAL JUMP WITH C(A,L) PRESERVED AND THE CADR IMMEDIATELY
042787,000049:                                                                                                  #  FOLLOWING THE TC POSTJUMP INSTRUCTION.
042788,000050: 
042789,000051:    4635           56002        POSTJUMP           XCH      Q                                     #  SAVE INCOMING C(A).
042790,000052:    4636           50000                           INDEX    A                                     #  GET CADR.
042791,000053:    4637           30000                           CA       0                                     
042792,000054: 
042793,000055:                                                                                                  #  BANKJUMP IS THE SAME AS POSTJUMP, EXCEPT THAT THE CADR ARRIVES IN A.
042794,000056: 
042795,000057:    4640           54004        BANKJUMP           TS       FBANK                                 
042796,000058:    4641           75012                           MASK     LOW10                                 
042797,000059:    4642           56002                           XCH      Q                                     #  RESTORING INPUT C(A) IF THIS WAS A
042798,000060:    4643           50002        Q+10000            INDEX    Q                                     #  POSTJUMP.
042799,000061:    4644           12000        PRIO12             TCF      10000                                 #  PRIO12 = TCF  10000 = 12000
042800,000062: 

Page 999

042802,000064:                                                                                                  #  THE FOLLOWING ROUTINE GETS THE RETURN CADR SAVED BY SWCALL OR BANKCALL AND LEAVES IT IN A.
042803,000065: 
042804,000066:    4645           35012        MAKECADR           CAF      LOW10                                 
042805,000067:    4646           70133                           MASK     BUF2                                  
042806,000068:    4647           60134                           AD       BUF2       +1                         
042807,000069:    4650           00002                           TC       Q                                     
042808,000070: 
042809,000071:    4651           54135        SUPDACAL           TS       MPTEMP                                
042810,000072:    4652           56004                           XCH      FBANK                                 #  SET FBANK FOR DATA.
042811,000073:    4653           00006                           EXTEND                                         
042812,000074:    4654           04007                           ROR      SUPERBNK                              #  SAVE FBANK IN BITS 15-11, AND
042813,000075:    4655           56135                           XCH      MPTEMP                                #  SUPERBANK IN BITS 7-5.
042814,000076:    4656           75012                           MASK     LOW10                                 
042815,000077:    4657           56001                           XCH      L                                     #  SAVE REL. ADR. IN BANK, FETCH SUPERBITS.
042816,000078:    4660           00004                           INHINT                                         #  BECAUSE RUPT DOES NOT SAVE SUPERBANK.
042817,000079:    4661           00006                           EXTEND                                         
042818,000080:    4662           01007                           WRITE    SUPERBNK                              #  SET SUPERBANK FOR DATA.
042819,000081:    4663           50001                           INDEX    L                                     
042820,000082:    4664           32000                           CA       10000                                 #  PINBALL (FIX MEM DISP) PREVENTS DCA HERE
042821,000083:    4665           56135                           XCH      MPTEMP                                #  SAVE 1ST WD, FETCH OLD FBANK AND SBANK.
042822,000084:    4666           00006                           EXTEND                                         
042823,000085:    4667           01007                           WRITE    SUPERBNK                              #  RESTORE SUPERBANK.
042824,000086:    4670           00003                           RELINT                                         
042825,000087:    4671           54004                           TS       FBANK                                 #  RESTORE FBANK.
042826,000088:    4672           30135                           CA       MPTEMP                                #  RECOVER FIRST WORD OF DATA.
042827,000089:    4673           00002                           RETURN                                         #  24 WDS. DATACALL 516 MU, SUPDACAL 432 MU
042828,000090: 

Page 1000

042830,000092:                                                                                                  #  THE FOLLOWING ROUTINES ARE IDENTICAL TO BANKCALL AND SWCALL EXCEPT THAT THEY ARE USED IN INTERRUPT.
042831,000093: 
042832,000094:    4674           52073        IBNKCALL           DXCH     RUPTREG3                              #  USES RUPTREG3,4 FOR DP RETURN ADDRESS.
042833,000095:    4675           50002                           INDEX    Q                                     
042834,000096:    4676           30000                           CAF      0                                     
042835,000097:    4677           24002                           INCR     Q                                     
042836,000098: 
042837,000099:    4700           54001        ISWCALLL           TS       L                                     
042838,000100:    4701           22004                           LXCH     FBANK                                 
042839,000101:    4702           75012                           MASK     LOW10                                 
042840,000102:    4703           56002                           XCH      Q                                     
042841,000103:    4704           52073                           DXCH     RUPTREG3                              
042842,000104:    4705           50002                           INDEX    Q                                     
042843,000105:    4706           02000                           TC       10000                                 
042844,000106: 
042845,000107:    4707           56073        ISWRETRN           XCH      RUPTREG4                              
042846,000108:    4710           56004                           XCH      FBANK                                 
042847,000109:    4711           56073                           XCH      RUPTREG4                              
042848,000110:    4712           00072                           TC       RUPTREG3                              
042849,000111: 
042850,000112:                                                                                                  #  2. USPRCADR ACCESSES INTERPRETIVE CODING IN OTHER THAN THE USER'S FBANK.  THE CALLING SEQUENCE IS AS FOLLOWS:
042851,000113:                                                                                                  #        L       TC      USPRCADR
042852,000114:                                                                                                  #        L+1     CADR    INTPRETX        INTPRETX IS THE INTERPRETIVE CODING
042853,000115:                                                                                                  #                                        RETURN IS TO L+2
042854,000116: 
042855,000117:    4713           54164        USPRCADR           TS       LOC                                   #  SAVE A
042856,000118:    4714           34744                           CA       BIT8                                  
042857,000119:    4715           54023                           TS       EDOP                                  #  EXIT INSTRUCTION TO EDOP
042858,000120:    4716           30006                           CA       BBANK                                 
042859,000121:    4717           54165                           TS       BANKSET                               #  USER'S BBANK TO BANKSET
042860,000122:    4720           50002                           INDEX    Q                                     
042861,000123:    4721           30000                           CA       0                                     
042862,000124:    4722           54004                           TS       FBANK                                 #  INTERPRETIVE BANK TO FBANK
042863,000125:    4723           75012                           MASK     LOW10                                 #  YIELDS INTERPRETIVE RELATIVE ADDRESS
042864,000126:    4724           56002                           XCH      Q                                     #  INTERPRETIVE ADDRESS TO Q, FETCHING L+1
042865,000127:    4725           56164                           XCH      LOC                                   #  L+1 TO LOC, RETRIEVING ORIGINAL A
042866,000128:    4726           14643                           TCF      Q+10000                               
042867,000129: 

Page 1001

042869,000131:                                                                                                  #  THERE ARE FOUR POSSIBLE SETTINGS FOR CHANNEL 07.  (CHANNEL 07 CONTAINS THE SUPERBANK SETTING.)
042870,000132: 
042871,000133:                                                                                                  #                                        PSEUDO-FIXED      OCTAL PSEUDO
042872,000134:                                                                                                  #  SUPERBANK     SETTING S-REG. VALUE    BANK NUMBERS      ADDRESSES
042873,000135:                                                                                                  #  ----------    ------- ------------     ------------      ------------
042874,000136:                                                                                                  #  SUPERBANK 3     0XX    2000 - 3777       30 - 37       70000 - 107777         (WHERE XX CAN BE ANYTHING AND
042875,000137:                                                                                                  #                                                                                WILL USUALLY BE SEEN AS 11)
042876,000138:                                                                                                  #  SUPERBANK 4     100    2000 - 3777       40 - 47      110000 - 127777         (AS FAR AS IT CAN BE SEEN,
042877,000139:                                                                                                  #                                                                                ONLY BANKS 40-43 WILL EVER BE
042878,000140:                                                                                                  #                                                                                AND ARE PRESENTLY AVAILABLE)
042879,000141:                                                                                                  #  SUPERBANK 5     101    2000 - 3777       50 - 57      130000 - 147777         (PRESENTLY NOT AVAILABLE TO
042880,000142:                                                                                                  #                                                                                THE USER)
042881,000143:                                                                                                  #  SUPERBANK 6     110    2000 - 3777       60 - 67      150000 - 167777         (PRESENTLY NOT AVAILABLE TO
042882,000144:                                                                                                  #                                                                                THE USER)
042883,000145:                                                                                                  #  *** THIS ROUTINE MAY BE CALLED BY ANY PROGRAM LOCATED IN BANKS 00 - 27.  I.E., NO PROGRAM LIVING IN ANY
042884,000146:                                                                                                  #  SUPERBANK SHOULD USE SUPERSW. ***
042885,000147: 
042886,000148:                                                                                                  #  SUPERSW MAY BE CALLED IN THIS FASHION:
042887,000149:                                                                                                  #        CAF     ABBCON          WHERE  --  ABBCON   BBCON  SOMETHIN --
042888,000150:                                                                                                  #        TCR     SUPERSW         (THE SUPERBNK BITS ARE IN THE BBCON)
042889,000151:                                                                                                  #        ...       ...
042890,000152:                                                                                                  #         .         .
042891,000153:                                                                                                  #         .         .
042892,000154:                                                                                                  #  OR IN THIS FASHION:
042893,000155:                                                                                                  #        CAF     SUPERSET        WHERE SUPERSET IS ONE OF THE FOUR AVAILABLE
042894,000156:                                                                                                  #        TCR     SUPERSW         SUPERBANK BIT CONSTANTS:
042895,000157:                                                                                                  #        ...       ...                                   SUPER011 OCTAL  60
042896,000158:                                                                                                  #         .         .                                    SUPER100 OCTAL 100
042897,000159:                                                                                                  #         .         .                                    SUPER101 OCTAL 120
042898,000160:                                                                                                  #                                                        SUPER110 OCTAL 140
042899,000161: 
042900,000162:    4727           00006        SUPERSW            EXTEND                                         
042901,000163:    4730           01007                           WRITE    SUPERBNK                              #  WRITE BITS 7-6-5 OF THE ACCUMULATOR INTO
042902,000164:                                                                                                  #  CHANNEL 07
042903,000165:    4731           00002                           TC       Q                                     #  TC TO INSTRUCTION FOLLOWING
042904,000166:                                                                                                  #        TC SUPERSW
042905,000167: 

End of include-file INTER-BANK_COMMUNICATION.agc.  Parent file is MAIN.agc