Source Code

These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
This means that source code does not represent a specific historical revision of Sundance, but rather a mixture of the three released versions. Nonetheless, it is capable of flying the whole Apollo 9 mission. This source code matches the binary dumps, as closely as feasible, but 100% match is not possible, due mostly to changes in memory addresses at which code and variables were allocated in different revisions of Sundance. Refer to this list of explanations for each binary mismatch.

Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

038529,000002:                                                                                                  ## Copyright:   Public domain.
038530,000003:                                                                                                  ## Filename:    DOWN-TELEMETRY_PROGRAM.agc
038531,000004:                                                                                                  ## Purpose:     A section of a reconstructed, mixed version of Sundance
038532,000005:                                                                                                  ##              It is part of the reconstructed source code for the Lunar
038533,000006:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
038534,000007:                                                                                                  ##              No original listings of this program are available;
038535,000008:                                                                                                  ##              instead, this file was created via disassembly of dumps
038536,000009:                                                                                                  ##              of various revisions of Sundance core rope modules.
038537,000010:                                                                                                  ## Assembler:   yaYUL
038538,000011:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
038539,000012:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
038540,000013:                                                                                                  ## Mod history: 2020-06-17 MAS  Created from Luminary 69.
038541,000014:                                                                                                  ##              2021-05-30 ABS  Removed WO1 symbol not present in Luminary 69.
038542,000015: 
038543,000016:                                                                                                  ## Sundance 292
038544,000017: 
038545,000018:                                                                                                  #  PROGRAM NAME - DOWN TELEMETRY PROGRAM
038546,000019:                                                                                                  #  MOD NO. - 0           TO COMPLETELY REWRITE THE DOWN TELEMETRY PROGRAM AND DOWNLINK ERASABLE DUMP PROGRAM FOR THE
038547,000020:                                                                                                  #                        PURPOSE OF SAVING APPROXIMATELY 150 WORDS OF CORE STORAGE.
038548,000021:                                                                                                  #                        THIS CHANGE REQUIRES AN ENTIRELY NEW METHOD OF SPECIFYING DOWNLINK LISTS.REFER TO DOWNLINK
038549,000022:                                                                                                  #                        LISTS LOG SECTION FOR MORE DETAILS. HOWEVER THIS CHANGE WILL NOT AFFECT THE GROUND PROCESSING
038550,000023:                                                                                                  #                        OF DOWN TELEMETRY DATA.
038551,000024:                                                                                                  #  MOD BY - KILROY, SMITH, DEWITT
038552,000025:                                                                                                  #  DATE - 02OCT67
038553,000026:                                                                                                  #  AUTHORS - KILROY, SMITH, DEWITT, DEWOLF, FAGIN
038554,000027:                                                                                                  #  LOG SECTION - DOWN-TELEMETRY PROGRAM
038555,000028: 
038556,000029:                                                                                                  #  FUNCTIONAL DESCRIPTION - THIS ROUTINE IS INITIATED BY TELEMETRY END
038557,000030:                                                                                                  #        PULSE FROM THE DOWNLINK TELEMETRY CONVERTER. THIS PULSE OCCURS
038558,000031:                                                                                                  #        AT 50 TIMES PER SEC (EVERY 20 MS) THEREFORE DODOWNTM IS
038559,000032:                                                                                                  #        EXECUTED AT THESE RATES. THIS ROUTINE SELECTS THE APPROPRIATE
038560,000033:                                                                                                  #        AGC DATA TO BE TRANSMITTED DOWNLINK AND LOADS IT INTO OUTPUT
038561,000034:                                                                                                  #        CHANNELS 34 AND 35. THE INFORMATION IS THEN GATED OUT FROM THE
038562,000035:                                                                                                  #        LGC IN SERIAL FASHION.
038563,000036:                                                                                                  #        THIS PROGRAM IS CODED FOR A 2 SECOND DOWNLIST. SINCE DOWNRUPTS
038564,000037:                                                                                                  #        OCCUR EVERY 20 MS AND 2 AGC COMPUTER WORDS CAN BE PLACED IN
038565,000038:                                                                                                  #        CHANNELS 34 AND 35 DURING EACH DOWNRUPT THE PROGRAM IS CAPABLE
038566,000039:                                                                                                  #        OF SENDING 200 AGC WORDS EVERY 2 SECONDS.
038567,000040:                                                                                                  #  CALLING SEQUENCE - NONE
038568,000041:                                                                                                  #        PROGRAM IS ENTERED VIA TCF DODOWNTM WHICH IS EXECUTED AS A
038569,000042:                                                                                                  #        RESULT OF A DOWNRUPT. CONTROL IS RETURNED VIA TCF RESUME WHICH
038570,000043:                                                                                                  #        IN EFFECT IS A RESUME.
038571,000044:                                                                                                  #  SUBROUTINES CALLED - NONE
038572,000045:                                                                                                  #  NORMAL EXIT MODE - TCF RESUME
038573,000046:                                                                                                  #  ALARM OR ABORT EXIT MODE - NONE
038574,000047:                                                                                                  #  RESTART PROTECTION:
038575,000048:                                                                                                  #        ON A FRESH START AND RESTART THE 'STARTSUB' SUBROUTINE WILL INITIALIZE THE DOWNLIST POINTER (ACTUALLY
038576,000049:                                                                                                  #        DNTMGOTO) TO THE BEGINNING OF THE CURRENT DOWNLIST (I.E. CURRENT CONTENTS OF DNLSTADR). THIS HAS THE
038577,000050:                                                                                                  #        EFFECT OF IGNORING THE REMAINDER OF THE DOWNLIST WHICH THE DOWN-TELEMETRY PROGRAM WAS WORKING ON WHEN
038578,000051:                                                                                                  #        THE RESTART (OR FRESH START) OCCURRED AND RESUME DOWN TELEMETRY FROM THE BEGINNING OF THE CURRENT
038579,000052:                                                                                                  #        DOWNLIST.
038580,000053:                                                                                                  #        ALSO OF INTEREST IS THE FACT THAT ON A RESTART THE AGC WILL ZERO DOWNLINK CHANNELS 13, 34 AND 35.
038581,000054:                                                                                                  #  DOWNLINK LIST SELECTION:
038582,000055:                                                                                                  #        THE APPROPRIATE DOWNLINK LISTS ARE SELECTED BY THE FOLLOWING:
038583,000056:                                                                                                  #        1.      FRESH START
038584,000057:                                                                                                  #        2.      V37EXXE WHERE XX = THE MAJOR MODE BEING SELECTED.
038585,000058:                                                                                                  #        3.      UPDATE PROGRAM (P27)
038586,000059:                                                                                                  #        4.      NON-V37 SELECTABLE TYPE PROGRAMS (E.G. AGS INITIALIZATION (SUNDANCE, LUMINARY) AND P61-P62
038587,000060:                                                                                                  #                TRANSITION (COLOSSUS) ETC.).
038588,000061:                                                                                                  #  DOWNLINK LIST RULES AND LIMITATIONS:
038589,000062:                                                                                                  #        READ SECTION(S) WHICH FOLLOW 'DEBRIS' WRITEUP.
038590,000063:                                                                                                  #  OUTPUT - EVERY 2 SECONDS 100 DOUBLE PRECISION WORDS (I.E. 200 LGC
038591,000064:                                                                                                  #        COMPUTER WORDS) ARE TRANSMITTED VIA DOWNLINK.
038592,000065:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED - NONE
038593,000066:                                                                                                  #        'DNTMGOTO' AND 'DNLSTADR' ARE INITIALIZED BY THE FRESH START PROGRAM.
038594,000067:                                                                                                  #  DEBRIS (ERASABLE LOCATIONS DESTROYED BY THIS PROGRAM) -
038595,000068:                                                                                                  #        LDATALST,DNTMBUFF TO DNTMBUFF +21D,TMINDEX,DNQ.
038596,000069: 


This page is empty

038598,000071: 
038599,000072:                                                                                                  #  DODOWNTM IS ENTERED EVERY 20 MS BY AN INTERRUPT TRIGGERED BY THE
038600,000073:                                                                                                  #  RECEIPT OF AN ENDPULSE FROM THE SPACECRAFT TELEMETRY PROGRAMMER.
038601,000074: 
038602,000075:                                                                                                  #  NOTES REGARDING DOWNLINK LISTS ASSOCIATED WITH THIS PROGRAM:
038603,000076:                                                                                                  #  1.    DOWNLISTS. - DOWNLISTS MUST BE COMPILED IN THE SAME BANK AS THE
038604,000077:                                                                                                  #        DOWN-TELEMETRY PROGRAM. THIS IS DONE FOR EASE OF CODING, FASTER
038605,000078:                                                                                                  #        EXECUTION.
038606,000079:                                                                                                  #  2.    EACH DOWNLINK LIST CONSISTS OF A CONTROL LIST AND A NUMBER OF
038607,000080:                                                                                                  #        SUBLISTS.
038608,000081:                                                                                                  #  3.    A SUBLIST REFERS TO A SNAPSHOT OR DATA COMMON TO THE SAME OR OTHER
038609,000082:                                                                                                  #        DOWNLINK LISTS.  ANY SUBLIST CONTAINING COMMON DATA NEEDS TO BE
038610,000083:                                                                                                  #        CODED ONLY ONCE FOR THE APPLICABLE DOWNLINK LISTS.
038611,000084:                                                                                                  #  4.    SNAPSHOT SUBLISTS REFER SPECIFICALLY TO HOMOGENOUS DATA WHICH MUST BE
038612,000085:                                                                                                  #        SAVED IN A BUFFER DURING ONE DOWNRUPT.
038613,000086:                                                                                                  #  5.    THE 1DNADR FOR THE 1ST WORD OF SNAPSHOT DATA IS FOUND AT THE END
038614,000087:                                                                                                  #        OF EACH SNAPSHOT SUBLIST, SINCE THE PROGRAM CODING SENDS THIS DP WORD
038615,000088:                                                                                                  #        IMMEDIATELY AFTER STORING THE OTHERS IN THE SNAPSHOT BUFFER.
038616,000089:                                                                                                  #  6.    ALL LISTS ARE COMBINATIONS OF CODED ERASABLE ADDRESS CONSTANTS
038617,000090:                                                                                                  #        CREATED FOR THE DOWNLIST PROGRAM.
038618,000091:                                                                                                  #        A.      1DNADR                  1-WORD DOWNLIST ADDRESS.
038619,000092:                                                                                                  #                SAME AS ECADR, BUT USED WHEN THE WORD ADDRESSED IS THE LEFT
038620,000093:                                                                                                  #                HALF OF A DOUBLE-PRECISION WORD FOR DOWN TELEMETRY.
038621,000094:                                                                                                  #        B.      2DNADR - 6DNADR         N-WORD DOWNLIST ADDRESS, N = 2 - 6.
038622,000095:                                                                                                  #                SAME AS 1DNADR, BUT WITH THE 4 UNUSED BITS OF THE ECADR FORMAT
038623,000096:                                                                                                  #                FILLED IN WITH 0001-0101.  USED TO POINT TO A LIST OF N DOUBLE-
038624,000097:                                                                                                  #                PRECISION WORDS, STORED CONSECUTIVELY, FOR DOWN TELEMETRY.
038625,000098:                                                                                                  #        C.      DNCHAN                  DOWNLIST CHANNEL ADDRESS.
038626,000099:                                                                                                  #                SAME AS 1DNADR, BUT WITH PREFIX BITS 0111.  USED TO POINT TO
038627,000100:                                                                                                  #                A PAIR OF CHANNELS FOR DOWN TELEMETRY.
038628,000101:                                                                                                  #        D.      DNPTR                   DOWN TELEMETRY SUBLIST POINTER.
038629,000102:                                                                                                  #                SAME AS CAF BUT TAGGED AS A CONSTANT. USED IN CONTROL LIST TO POINT TO A SUBLIST.
038630,000103:                                                                                                  #                CAUTION--- A DNPTR CANNOT BE USED IN A SUBLIST.
038631,000104:                                                                                                  #  7.    THE WORD ORDER CODE IS SET TO ZERO AT THE BEGINNING OF EACH DOWNLIST (I.E. CONTROL LIST) AND WHEN
038632,000105:                                                                                                  #        A '1DNADR TIME2' IS DETECTED IN THE CONTROL LIST (ONLY).
038633,000106:                                                                                                  #  8.    IN THE SNAPSHOT SUBLIST ONLY, THE DNADR'S CANNOT POINT TO THE FIRST WORD OF ANY EBANK.
038634,000107: 
038635,000108:                                                                                                  #  DOWNLINK LIST RESTRICTIONS:
038636,000109:                                                                                                  #    (THE FOLLOWING POINTS MAY BE LISTED ELSEWHERE BUT ARE LISTED HERE SO IT IS CLEAR THAT THESE THINGS CANNOT BE
038637,000110:                                                                                                  #    DONE)
038638,000111:                                                                                                  #  1.    SNAPSHOT DOWNLIST:
038639,000112:                                                                                                  #        (A) CANNOT CONTAIN THE FOLLOWING ECADRS (I.E. 1DNADR'S): 0, 400, 1000, 1400, 2000, 2400, 3000, 3400.
038640,000113:                                                                                                  #        (B) CAN CONTAIN ONLY 1DNADR'S
038641,000114:                                                                                                  #  2.    ALL DOWNLINKED DATA (EXCEPT CHANNELS) IS PICKED UP BY A <DCA<SO DOWNLINK LISTS CANNOT CONTAIN THE
038642,000115:                                                                                                  #        EQUIVALENT OF THE FOLLOWING ECADRS (I.E. IDNADRS): 377, 777, 1377, 1777, 2377, 27777, 3377, 3777.
038643,000116:                                                                                                  #        (NOTE: THE TERM EQUIVALENT ' MEANT THAT THE IDNADR TO 6DNADR WILL BE PROCESSED LIKE 1 TO 6 ECADRS)
038644,000117:                                                                                                  #  3.    CONTROL LISTS AND SUBLISTS CANNOT HAVE ENTRIES = OCTAL 00000 OR OCTAL 77777
038645,000118:                                                                                                  #  4.    THE '1DNADR TIME2' WHICH WILL CAUSE THE DOWNLINK PROGRAM TO SET THE WORDER CODE TO 3 MUST APPEAR IN THE
038646,000119:                                                                                                  #        CONTROL SECTION OF THE DOWNLIST.
038647,000120: 
038648,000121:                                                                                                  #  5.    'DNCHAN 0' CANNOT BE USED.
038649,000122: 
038650,000123:                                                                                                  #  6.    'DNPTR 0' CANNOT BE USED.
038651,000124: 
038652,000125:                                                                                                  #  7.    DNPTR CANNOT APPEAR IN A SUBLIST.
038653,000126: 
038654,000127:                                                                                                  #  EBANK SETTINGS
038655,000128:                                                                                                  #        IN THE PROCESS OF SETTING THE EBANK (WHEN PICKING UP DOWNLINK DATA) THE DOWN TELEMETRY PROGRAM PUTS
038656,000129:                                                                                                  #        'GARBAGE' INTO BITS15-12 OF EBANK. HUGH BLAIR-SMITH WARNS US THAT BITS15-12 OF EBANK MAY BECOME
038657,000130:                                                                                                  #        SIGNIFICANT SOMEDAY IN THE FUTURE. IF/WHEN THAT HAPPENS, THE PROGRAM SHOULD INSURE (BY MASKING ETC.)
038658,000131:                                                                                                  #        THAT BITS15-12 OF EBANK ARE ZERO.
038659,000132: 
038660,000133:                                                                                                  #  INITIALIZATION REQUIRED - TO INTERRUPT CURRENT LIST AND START A NEW ONE..
038661,000134:                                                                                                  #        1. ADRES OF DOWNLINK LIST INTO DNLSTADR
038662,000135:                                                                                                  #        2. NEGONE INTO SUBLIST
038663,000136:                                                                                                  #        3. NEGONE INTO DNECADR
038664,000137: 
038665,000138: 22,3644                                           BANK     22                                    
038666,000139: 05,2000                                           SETLOC   DOWNTELM                              
038667,000140: 05,2000                                           BANK                                           
038668,000141: 
038669,000142: 05,3146     0340                                  EBANK=   DNTMBUFF                              
038670,000143: 
038671,000144: 05,3146                                           COUNT*   $$/DPROG                              
038672,000145: 05,3146           54016        DODOWNTM           TS       BANKRUPT                              
038673,000146: 05,3147           00006                           EXTEND                                         
038674,000147: 05,3150           22012                           QXCH     QRUPT                                 #  SAVE Q
038675,000148: 05,3151           35020                           CA       BIT7                                  #  SET WORD ORDER CODE TO 1. EXCEPTION- AT
038676,000149: 05,3152           00006                           EXTEND                                         #  THE BEGINNING OF EACH LIST THE WORD
038677,000150: 05,3153           05013                           WOR      CHAN13                                #  CODE WILL BE SET BACK TO 0.
038678,000151: 05,3154           00335                           TC       DNTMGOTO                              #  GO TO APPROPRIATE PHASE OF PROGRAM
038679,000152: 
038680,000153: 05,3155           37721        DNPHASE1           CA       NEGONE                                #  INITIALIZE ALL CONTROL WORDS
038681,000154: 05,3156           54337                           TS       SUBLIST                               #  WORDS TO MINUS ONE
038682,000155: 05,3157           54336                           TS       DNECADR                               
038683,000156: 05,3160           33301                           CA       LDNPHAS2                              #  SET DNTMGOTO =O ALL SUBSEQUENT DOWNRUPTS
038684,000157: 05,3161           54335                           TS       DNTMGOTO                              #  GO TO DNPHASE2
038685,000158: 05,3162           13175                           TCF      1STLIST                               
038686,000159: 05,3163           10336        DNPHASE2           CCS      DNECADR                               #  SENDING OF DATA IN PROGRESS
038687,000160: 05,3164           03314        DODNADR            TC       FETCH2WD                              #  YES - THEN FETCH THE NEXT 2 SP WORDS
038688,000161: 05,3165           77753        MINTIME2           -1DNADR  TIME2                                 #  NEGATIVE OF TIME2 1DNADR
038689,000162: 05,3166           13167                           TCF      +1                                    #  (ECADR OF 3776 + 74001 = 77777)
038690,000163: 
038691,000164: 05,3167           10337                           CCS      SUBLIST                               #  IS THE SUBLIST IN CONTROL
038692,000165: 05,3170           13327                           TCF      NEXTINSL                              #  YES
038693,000166: 05,3171           74001        DNADRDCR           OCT      74001                                 #  DNADR COUNT AND ECADR DECREMENTER
038694,000167: 
038695,000168: 05,3172           10334        CHKLIST            CCS      CTLIST                                #  IT WILL BE NEGATIVE AT END OF LIST
038696,000169: 05,3173           13204                           TCF      NEXTINCL                              
038697,000170: 05,3174           13201                           TCF      NEWLIST                               
038698,000171: 05,3175           35030        1STLIST            CAF      ZERO                                  
038699,000172: 05,3176           54334                           TS       CTLIST                                
038700,000173: 05,3177           40332                           CS       DNLSTCOD                              
038701,000174: 05,3200           13417                           TCF      SENDID     +3                         
038702,000175: 05,3201           50332        NEWLIST            INDEX    DNLSTCOD                              
038703,000176: 05,3202           32260                           CA       DNTABLE                               #  INITIALIZE CTLIST WITH
038704,000177: 05,3203           54334                           TS       CTLIST                                #    STARTING ADDRESS OF NEW LIST
038705,000178: 05,3204           50334        NEXTINCL           INDEX    CTLIST                                
038706,000179: 05,3205           30000                           CA       0                                     
038707,000180: 05,3206           10000                           CCS      A                                     
038708,000181: 05,3207           24334                           INCR     CTLIST                                #  SET POINTER TO PICK UP NEXT CTLIST WORD
038709,000182: 05,3210           13214                           TCF      +4                                    #  ON NEXT ENTRY TO PROG.  (A SHOULD NOT =0)
038710,000183: 05,3211           56334                           XCH      CTLIST                                #  SET CTLIST TO NEGATIVE AND PLACE(CODING)
038711,000184: 05,3212           40000                           COM                                            #  UNCOMPLEMENTED DNADR INTO A.    (FOR LA)
038712,000185: 05,3213           56334                           XCH      CTLIST                                #                                  (ST IN )
038713,000186: 05,3214           24000                 +4        INCR     A                                     #                                  (CTLIST)
038714,000187: 05,3215           54336                           TS       DNECADR                               #  SAVE DNADR
038715,000188: 05,3216           63165                           AD       MINTIME2                              #  TEST FOR TIME2 (NEG. OF ECADR)
038716,000189: 05,3217           10000                           CCS      A                                     
038717,000190: 05,3220           13224                           TCF      SETWO      +1                         #  DON'T SET WORD ORDER CODE
038718,000191: 05,3221           47777        MINB1314           OCT      47777                                 #  MINUS BIT 13 AND 14 (CAN'T GET HERE)
038719,000192: 05,3222           13224                           TCF      SETWO      +1                         #  DON'T SET WORD ORDER CODE
038720,000193: 05,3223           03246        SETWO              TC       WOZERO                                #  GO SET WORD ORDER CODE TO ZERO.
038721,000194: 05,3224           30336                 +1        CA       DNECADR                               #  RELOAD A WITH THE DNADR.
038722,000195: 05,3225           63221                 +2        AD       MINB1314                              #  IS THIS A REGULAR DNADR?
038723,000196: 05,3226           00006                           EXTEND                                         
038724,000197: 05,3227           63314                           BZMF     FETCH2WD                              #  YES.  (A MUST NEVER BE ZERO)
038725,000198: 05,3230           67712                           AD       MINB12                                #  NO- IS IT A POINTER (DNPTR) OR A
038726,000199: 05,3231           00006                           EXTEND                                         #      CHANNEL(DNCHAN)
038727,000200: 05,3232           63252                           BZMF     DODNPTR                               #  IT'S A POINTER.  (A MUST NEVER BE ZERO)
038728,000201: 
038729,000202: 05,3233           00006        DODNCHAN           TC       6                                     #  (EXECUTED AS EXTEND)  IT S A CHANNEL
038730,000203: 05,3234           50336                           INDEX    DNECADR                               
038731,000204: 05,3235           44000                           INDEX    0          -4000                      #  (EXECUTED AS READ)
038732,000205: 05,3236           54001                           TS       L                                     
038733,000206: 05,3237           00006                           TC       6                                     #  (EXECUTED AS EXTEND)
038734,000207: 05,3240           50336                           INDEX    DNECADR                               
038735,000208: 05,3241           43777                           INDEX    0          -4001                      #  (EXECUTED AS READ)
038736,000209: 05,3242           56336                           XCH      DNECADR                               #  SET DNECADR
038737,000210: 05,3243           40000                           COM                                            #        TO MINUS
038738,000211: 05,3244           56336                           XCH      DNECADR                               #                WHILE PRESERVING A.
038739,000212: 05,3245           13342                           TCF      DNTMEXIT                              #  GO SEND CHANNELS
038740,000213: 
038741,000214: 05,3246           45020        WOZERO             CS       BIT7                                  
038742,000215: 05,3247           00006                           EXTEND                                         
038743,000216: 05,3250           03013                           WAND     CHAN13                                #  SET WORD ORDER CODE TO ZERO
038744,000217: 05,3251           00002                           TC       Q                                     #  RETURN TO CALLER
038745,000218: 
038746,000219: 05,3252           50336        DODNPTR            INDEX    DNECADR                               #  DNECADR CONTAINS ADRES OF SUBLIST
038747,000220: 05,3253           00000                           0        0                                     #  CLEAR AND ADD LIST ENTRY INTO A.
038748,000221: 05,3254           10000                           CCS      A                                     #  IS THIS A SNAPSHOT SUBLIST
038749,000222: 05,3255           30336                           CA       DNECADR                               #  NO, IT IS A REGULAR SUBLIST.
038750,000223: 05,3256           13326                           TCF      DOSUBLST                              #  A MUST NOT BE ZERO.
038751,000224: 
038752,000225: 05,3257           56336                           XCH      DNECADR                               #  YES, IT IS A SNAPSHOT SUBLIST.
038753,000226: 05,3260           54337                           TS       SUBLIST                               #  C(DNECADR) INTO SUBLIST
038754,000227: 05,3261           35030                           CAF      ZERO                                  #        A    INTO     A
038755,000228: 05,3262           56336                           XCH      TMINDEX                               #  (NOTE..  TMINDEX = DNECADR)
038756,000229: 
038757,000230:                                                                                                  #  THE FOLLOWING CODING (FROM SNAPLOOP TO SNAPEND) IS FOR THE PURPOSE OF TAKING A SNAPSHOT OF 12 DP REGISTERS.
038758,000231:                                                                                                  #  THIS IS DONE BY SAVING 11 DP REGISTERS IN DNTMBUFF AND SENDING THE FIRST DP WORD IMMEDIATELY.
038759,000232:                                                                                                  #  THE SNAPSHOT PROCESSING IS THE MOST TIME CONSUMING AND THEREFORE THE CODING AND LIST STRUCTURE WERE DESIGNED
038760,000233:                                                                                                  #  TO MINIMIZE TIME. THE TIME OPTIMIZATION RESULTS IN RULES UNIQUE TO THE SNAPSHOT PORTION OF THE DOWNLIST.
038761,000234:                                                                                                  #  THESE RULES ARE......
038762,000235:                                                                                                  #        1.      ONLY 1DNADR'S CAN APPEAR IN THE SNAPSHOT SUBLIST
038763,000236:                                                                                                  #        2.      THE 1DNADR'S CANNOT REFER TO THE FIRST LOCATION IN ANY BANK.
038764,000237: 
038765,000238: 05,3263           54003        SNAPLOOP           TS       EBANK                                 #  SET EBANK
038766,000239: 05,3264           74371                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS
038767,000240: 05,3265           00006                           EXTEND                                         
038768,000241: 05,3266           50000                           INDEX    A                                     
038769,000242: 05,3267  E3,1401                                  EBANK=   1401                                  
038770,000243: 05,3267           31402                           DCA      1401                                  #  PICK UP 2 SNAPSHOT WORDS.
038771,000244: 05,3270     0340                                  EBANK=   DNTMBUFF                              
038772,000245: 05,3270           50336                           INDEX    TMINDEX                               
038773,000246: 05,3271           52341                           DXCH     DNTMBUFF                              #  STORE 2 SNAPSHOT WORDS IN BUFFER
038774,000247: 05,3272           24336                           INCR     TMINDEX                               #  SET BUFFER INDEX FOR NEXT 2 WORDS.
038775,000248: 05,3273           24336                           INCR     TMINDEX                               
038776,000249: 05,3274           24337        SNAPAGN            INCR     SUBLIST                               #  SET POINTER TO NEXT 2 WORDS OF SNAPSHOT
038777,000250: 05,3275           50337                           INDEX    SUBLIST                               
038778,000251: 05,3276           00000                           0        0                                     #  = CA SSSS (SSSS = NEXT ENTRY IN SUBLIST)
038779,000252: 05,3277           10000                           CCS      A                                     #  TEST FOR LAST TWO WORDS OF SNAPSHOT.
038780,000253: 05,3300           13263                           TCF      SNAPLOOP                              #  NOT LAST TWO.
038781,000254: 05,3301           03163        LDNPHAS2           GENADR   DNPHASE2                              
038782,000255: 05,3302           56337                           XCH      SUBLIST                               #  YES, LAST.  SAVE A.
038783,000256: 05,3303           40000                           COM                                            #  SET DNECADR AND
038784,000257: 05,3304           54336                           TS       DNECADR                               #        SUBLIST POINTERS
038785,000258: 05,3305           56337                           XCH      SUBLIST                               #                TO NEGATIVE VALUES.
038786,000259: 05,3306           54003                           TS       EBANK                                 
038787,000260: 05,3307           74371                           MASK     LOW8                                  
038788,000261: 05,3310           00006                           EXTEND                                         
038789,000262: 05,3311           50000                           INDEX    A                                     
038790,000263: 05,3312  E3,1401                                  EBANK=   1401                                  
038791,000264: 05,3312           31402                           DCA      1401                                  #  PICK UP FIRST 2 WORDS OF SNAPSHOT.
038792,000265: 05,3313     0340                                  EBANK=   DNTMBUFF                              
038793,000266: 05,3313           13342        SNAPEND            TCF      DNTMEXIT                              #  NOW GO SEND THEM.
038794,000267: 
038795,000268: 05,3314           30336        FETCH2WD           CA       DNECADR                               
038796,000269: 05,3315           54003                           TS       EBANK                                 #  SET EBANK
038797,000270: 05,3316           74371                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS
038798,000271: 05,3317           54001                           TS       L                                     
038799,000272: 05,3320           33171                           CA       DNADRDCR                              #  DECREMENT COUNT AND ECADR
038800,000273: 05,3321           26336                           ADS      DNECADR                               
038801,000274: 05,3322           00006                           EXTEND                                         
038802,000275: 05,3323           50001                           INDEX    L                                     
038803,000276: 05,3324  E3,1400                                  EBANK=   1400                                  
038804,000277: 05,3324           31401                           DCA      1400                                  #  PICK UP 2 DATA WORDS
038805,000278: 05,3325     0340                                  EBANK=   DNTMBUFF                              
038806,000279: 05,3325           13342                           TCF      DNTMEXIT                              #  NOW GO SEND THEM.
038807,000280: 
038808,000281: 05,3326           54337        DOSUBLST           TS       SUBLIST                               #  SET SUBLIST POINTER
038809,000282: 05,3327           50337        NEXTINSL           INDEX    SUBLIST                               
038810,000283: 05,3330           00000                           0        0                                     #  = CA SSSS (SSSS = NEXT ENTRY IN SUBLIST)
038811,000284: 05,3331           10000                           CCS      A                                     #  IS IT THE END OF THE SUBLIST
038812,000285: 05,3332           24337                           INCR     SUBLIST                               #  NO -
038813,000286: 05,3333           13337                           TCF      +4                                    
038814,000287: 05,3334           56337                           XCH      SUBLIST                               #  SAVE A.
038815,000288: 05,3335           40000                           COM                                            #  SET SUBLIST TO MINUS
038816,000289: 05,3336           56337                           XCH      SUBLIST                               #  RETRIEVE A.
038817,000290: 05,3337           24000                 +4        INCR     A                                     
038818,000291: 05,3340           54336                           TS       DNECADR                               #  SAVE DNADR
038819,000292: 05,3341           13225                           TCF      SETWO      +2                         #  GO USE COMMON CODING (PROBLEMS WOULD
038820,000293:                                                                                                  #  OCCUR IF THE PROGRAM ENCOUNTERED A
038821,000294:                                                                                                  #  DNPTR NOW)
038822,000295: 
038823,000296: 05,3342           00006        DNTMEXIT           EXTEND                                         #  DOWN-TELEMETRY EXIT
038824,000297: 05,3343           01034                           WRITE    DNTM1                                 #  TO SEND A + L TO CHANNELS 34 + 35
038825,000298: 05,3344           30001                           CA       L                                     #  RESPECTIVELY
038826,000299: 05,3345           00006        TMEXITL            EXTEND                                         
038827,000300: 05,3346           01035                           WRITE    DNTM2                                 
038828,000301: 05,3347           15330        TMRESUME           TCF      RESUME                                #  EXIT TELEMETRY PROGRAM VIA RESUME.
038829,000302: 
038830,000303: 05,3350     7712               MINB12             EQUALS   -1/8                                  
038831,000304: 05,3350     0336               DNECADR            EQUALS   TMINDEX                               
038832,000305: 05,3350     0334               CTLIST             EQUALS   LDATALST                              
038833,000306: 05,3350     0337               SUBLIST            EQUALS   DNQ                                   
038834,000307: 
038835,000308:                                                                                                  #  SUBROUTINE NAME- DNDUMP
038836,000309:                                                                                                  #  FUNCTIONAL DESCRIPTION - TO SEND (DUMP) ALL ERASABLE STORAGE 'N' TIMES.(N=1 TO 4). BANKS ARE SENT ONE AT A TIME
038837,000310:                                                                                                  #        EACH BANK IS PRECEEDED BY AN ID WORD, SYNCH BITS, ECADR AND TIME1 FOLLOWED BY THE 256D WORDS OF EACH
038838,000311:                                                                                                  #        EBANK. EBANKS ARE DUMPED IN ORDER (I.E. EBANK 0 FIRST, THEN EBANK1 ETC.)
038839,000312:                                                                                                  #  CALLING SEQUENCE- THE GROUND OR ASTRONAUT BY KEYING V74E CAN INITIALIZE THE DUMP.
038840,000313:                                                                                                  #        AFTER KEYING IN V74E THE CURRENT DOWNLIST WILL BE IMMEDIATELY TERMINATED AND THE DOWNLINK ERASABLE DUMP
038841,000314:                                                                                                  #        WILL BEGIN.
038842,000315:                                                                                                  #        ONCE INITIATED THE DOWNLINK ERASABLE DUMP CAN BE TERMINATED (AND INTERRUPTED DOWNLIST REINSTATED) ONLY
038843,000316:                                                                                                  #        BY THE FOLLOWING:
038844,000317:                                                                                                  #        1.      A FRESH START
038845,000318:                                                                                                  #        2.      COMPLETION OF ALL DOWNLINK DUMPS REQUESTED (ACCORDING TO BITS SET IN DUMPCNT). NOTE THAT DUMPCNT
038846,000319:                                                                                                  #                CAN BE ALTERED BY A V21N01.
038847,000320:                                                                                                  #        3.      AND INVOLUNTARILY BY A RESTART.
038848,000321:                                                                                                  #  NORMAL EXIT MODE - TCF DNPHASE1
038849,000322:                                                                                                  #  ALARM OR ABORT MODE - NONE
038850,000323:                                                                                                  #  *SUBROUTINES CALLED - NONE.
038851,000324:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED -
038852,000325:                                                                                                  #        DUMPCNT         OCT 20000       IF 4 COMPLETE ERASABLE DUMPS ARE DESIRED
038853,000326:                                                                                                  #        DUMPCNT         OCT 10000       IF 2 COMPLETE ERASABLE DUMPS ARE DESIRED
038854,000327:                                                                                                  #        DUMPCNT         OCT 04000       IF 1 COMPLETE ERASABLE DUMP  IS  DESIRED
038855,000328:                                                                                                  #  DEBRIS - DUMPLOC, DUMPSW, DNTMGOTO, EBANK AND CENTRAL REGISTERS
038856,000329:                                                                                                  #  TIMING -      TIME (IN SECS) = ((NO.DUMPS)*(NO.EBANKS)*(WDSPEREBANK + NO.IDWDS)) / NO.WDSPERSEC
038857,000330:                                                                                                  #                TIME (IN SECS) =  (   4    )*(    8    )*(    256     +     4   )  /     100
038858,000331:                                                                                                  #                THUS TIME (IN SECS TO SEND DUMP OF ERASABLE 4 TIMES VIA DOWNLINK) = 83.2 SECONDS
038859,000332: 
038860,000333:                                                                                                  #  STRUCTURE OF ONE EBANK AS IT IS SENT BY DOWNLINK PROGRAM -
038861,000334:                                                                                                  #        (REMINDER - THIS ONLY DESCRIBES ONE OF THE 8 EBANKS X 4 (DUMPS) = 32 EBANKS WHICH WILL BE SENT BY DNDUMP)
038862,000335:                                                                                                  #        DOWNLIST                                W
038863,000336:                                                                                                  #          WORD  TAKEN FROM CONTENTS OF  EXAMPLE O       COMMENTS
038864,000337:                                                                                                  #            1   ERASID                   0177X  0       DOWNLIST I.D. FOR DOWNLINK ERASABLE DUMP (X=7 CSM, 6 LM)
038865,000338:                                                                                                  #            2   LOWIDCOD                 77340  1       DOWNLINK SYNCH BITS.  (SAME ONE USED IN ALL OTHER DOWNLISTS)
038866,000339:                                                                                                  #            3   DUMPLOC                  13400  1       (SEE NOTES ON DUMPLOC) 1 = 3RD ERAS DUMP, 3400=ECADR OF 5TH WD
038867,000340:                                                                                                  #            4   TIME1                    14120  1       TIME IN CENTISECONDS
038868,000341:                                                                                                  #            5   FIRST WORD OF EBANK X    03400  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1400 (ECADR 3400)
038869,000342:                                                                                                  #            6   2ND   WORD OF EBANK X    00142  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1401 (ECADR 3401)
038870,000343:                                                                                                  #            7   3RD   WORD OF EBANK X    00142  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1402 (ECADR 3402)
038871,000344:                                                                                                  #            .                                   1
038872,000345:                                                                                                  #            .                                   1
038873,000346:                                                                                                  #            .                                   1
038874,000347:                                                                                                  #         260D   256TH WORD OF EBANK X    03777  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1777 (ECADR 3777)
038875,000348: 
038876,000349:                                                                                                  #  NOTE- DUMPLOC CONTAINS THE COUNTER AND ECADR FOR EACH WORD BEING SENT.
038877,000350:                                                                                                  #                THE BIT STRUCTURE OF DUMPLOC IS FOLLOWS---
038878,000351:                                                                                                  #                                                X = NOT USED
038879,000352:                                                                                                  #                X ABC EEE RRRRRRRR            ABC = ERASABLE DUMP COUNTER (I.E. ABC = 0,1,2 OR 3 WHICH MEANS THAT
038880,000353:                                                                                                  #                                                    COMPLETE ERASABLE DUMP NUMBER 1,2,3 OR 4 RESPECTIVELY IS IN PROGRESS)
038881,000354:                                                                                                  #                                              EEE = EBANK BITS
038882,000355:                                                                                                  #                                         RRRRRRRR = RELATIVE ADDRESS WITHIN AN EBANK.
038883,000356: 
038884,000357: 05,3350           35030        DNDUMPI            CA       ZERO                                  #  INITIALIZE DOWNLINK
038885,000358: 05,3351           54336                           TS       DUMPLOC                               #  ERASABLE DUMP
038886,000359: 05,3352           03414                 +2        TC       SENDID                                #  GO SEND ID AND SYNCH BITS
038887,000360: 05,3353           33362                           CA       LDNDUMP1                              #  SET DNTMGOTO
038888,000361: 05,3354           54335                           TS       DNTMGOTO                              #  TO LOCATION FOR NEXT PASS
038889,000362: 05,3355           30025                           CA       TIME1                                 #  PLACE TIME1
038890,000363: 05,3356           56001                           XCH      L                                     #  INTO L
038891,000364: 05,3357           30336                           CA       DUMPLOC                               #  AND ECADR OF THIS EBANK INTO A
038892,000365: 05,3360           13342                           TCF      DNTMEXIT                              #  SEND DUMPLOC AND TIME1
038893,000366: 
038894,000367: 05,3361           03363        LDNDUMP            ADRES    DNDUMP                                
038895,000368: 05,3362           03376        LDNDUMP1           ADRES    DNDUMP1                               
038896,000369: 
038897,000370: 05,3363           35025        DNDUMP             CA       TWO                                   #  INCREMENT ECADR IN DUMPLOC
038898,000371: 05,3364           26336                           ADS      DUMPLOC                               #  TO NEXT DP WORD TO BE
038899,000372: 05,3365           74371                           MASK     LOW8                                  #  DUMPED AND SAVE IT.
038900,000373: 05,3366           10000                           CCS      A                                     #  IS THIS THE BEGINNING OF A NEW EBANK
038901,000374: 05,3367           13400                           TCF      DNDUMP2                               #  NO- THEN CONTINUE DUMPING
038902,000375: 05,3370           30336                           CA       DUMPLOC                               #  YES- IS THIS THE END OF THE
038903,000376: 05,3371           70333                           MASK     DUMPCNT                               #  N TH (N = 1 TO 4) COMPLETE ERASABLE
038904,000377: 05,3372           77674                           MASK     PRIO34                                #  DUMP (BIT14 FOR 4, BIT13 FOR 2 OR BIT12
038905,000378: 05,3373           10000                           CCS      A                                     #  FOR 1 COMPLETE ERASABLE DUMP(S)).
038906,000379: 05,3374           13155                           TCF      DNPHASE1                              #  YES- START SENDING INTERRUPTED DOWNLIST
038907,000380:                                                                                                  #  AGAIN
038908,000381: 05,3375           13352                           TCF      DNDUMPI    +2                         #  NO- GO BACK AND INITIALIZE NEXT BANK
038909,000382: 
038910,000383: 05,3376           33361        DNDUMP1            CA       LDNDUMP                               #  SET DNTMGOTO
038911,000384: 05,3377           54335                           TS       DNTMGOTO                              #  FOR WORDS 3 TO 256D OF CURRENT EBANK
038912,000385: 
038913,000386: 05,3400           30336        DNDUMP2            CA       DUMPLOC                               
038914,000387: 05,3401           54003                           TS       EBANK                                 #  SET EBANK
038915,000388: 05,3402           74371                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS.
038916,000389: 05,3403           54002                           TS       Q                                     #  (NOTE: MASK INSTRUCTION IS USED TO PICK
038917,000390: 05,3404           35027                           CA       NEG0                                  #  UP ERASABLE REGISTERS SO THAT EDITING
038918,000391: 05,3405           54001                           TS       L                                     #  REGISTERS 20-23 WILL NOT BE ALTERED.)
038919,000392: 05,3406           50002                           INDEX    Q                                     
038920,000393: 05,3407  E3,1400                                  EBANK=   1400                                  #  PICK UP LOW ORDER REGISTER OF PAIR
038921,000394: 05,3407           71401                           MASK     1401                                  #  OF ERASABLE REGISTERS.
038922,000395: 05,3410           56001                           XCH      L                                     
038923,000396: 05,3411           50002                           INDEX    Q                                     #  PICK UP HIGH ORDER REGISTER OF PAIR
038924,000397: 05,3412           71400                           MASK     1400                                  #  OF ERASABLE REGISTERS.
038925,000398: 05,3413     0340                                  EBANK=   DNTMBUFF                              
038926,000399: 05,3413           13342                           TCF      DNTMEXIT                              #  GO SEND THEM
038927,000400: 
038928,000401: 05,3414           00006        SENDID             EXTEND                                         #  **ENTRANCE USED BY ERASABLE DUMP PROG.**
038929,000402: 05,3415           22335                           QXCH     DNTMGOTO                              #  SET DNTMGOTO SO NEXT TIME PROG WILL GO
038930,000403: 05,3416           35061                           CAF      ERASID                                #  TO LOCATION FOLLOWING :TC SENDID:
038931,000404: 
038932,000405: 05,3417           54001                           TS       L                                     #  **ENTRANCE USED BY REGULAR DOWNLINK PG**
038933,000406: 05,3420           03246                           TC       WOZERO                                #  GO SET WORD ORDER CODE TO ZERO
038934,000407: 05,3421           32000                           CAF      LOWIDCOD                              #  PLACE SPECIAL ID CODE INTO L
038935,000408: 05,3422           56001                           XCH      L                                     #  AND ID BACK INTO A
038936,000409: 05,3423           13342                           TCF      DNTMEXIT                              #  SEND DOWNLIST ID CODE(S).
038937,000410: 

End of include-file DOWN-TELEMETRY_PROGRAM.agc.  Parent file is MAIN.agc