Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

046671,000002:                                                                                                  ## Copyright:   Public domain.
046672,000003:                                                                                                  ## Filename:    DOWN-TELEMETRY_PROGRAM.agc
046673,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
046674,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
046675,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
046676,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
046677,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
046678,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
046679,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
046680,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
046681,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
046682,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
046683,000014:                                                                                                  ##              reconstruction is correct.
046684,000015:                                                                                                  ## Assembler:   yaYUL
046685,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
046686,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
046687,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
046688,000019: 
046689,000020:                                                                                                  #  PROGRAM NAME - DOWN TELEMETRY PROGRAM
046690,000021:                                                                                                  #  MOD NO. - 0           TO COMPLETELY REWRITE THE DOWN TELEMETRY PROGRAM AND DOWNLINK ERASABLE DUMP PROGRAM FOR THE
046691,000022:                                                                                                  #                        PURPOSE OF SAVING APPROXIMATELY 150 WORDS OF CORE STORAGE.
046692,000023:                                                                                                  #                        THIS CHANGE REQUIRES AN ENTIRELY NEW METHOD OF SPECIFYING DOWNLINK LISTS.  REFER TO DOWNLINK
046693,000024:                                                                                                  #                        LISTS LOG SECTION FOR MORE DETAILS.  HOWEVER THIS CHANGE WILL NOT AFFECT THE GROUND PROCESSING
046694,000025:                                                                                                  #                        OF DOWN TELEMETRY DATA.
046695,000026:                                                                                                  #  MOD BY - KILROY, SMITH, DEWITT
046696,000027:                                                                                                  #  MOD BY - DENSMORE - JUNE 1969 - ELIMINATE ERASABLE DUMP COUNT
046697,000028:                                                                                                  #  DATE - 02 OCT 67
046698,000029:                                                                                                  #  AUTHORS - KILROY, SMITH, DEWITT, DEWOLF, FAGIN
046699,000030:                                                                                                  #  LOG SECTION - DOWN-TELEMETRY PROGRAM
046700,000031: 
046701,000032:                                                                                                  #  FUNCTIONAL DESCRIPTION - THIS ROUTINE IS INITIATED BY TELEMETRY END
046702,000033:                                                                                                  #        PULSE FROM THE DOWNLINK TELEMETRY CONVERTER.  THIS PULSE OCCURS
046703,000034:                                                                                                  #        AT 50 TIMES PER SEC (EVERY 20 MS) THEREFORE DODOWNTM IS
046704,000035:                                                                                                  #        EXECUTED AT THESE RATES.  THIS ROUTINE SELECTS THE APPROPRIATE
046705,000036:                                                                                                  #        AGC DATA TO BE TRANSMITTED DOWNLINK AND LOADS IT INTO OUTPUT
046706,000037:                                                                                                  #        CHANNELS 34 AND 35.  THE INFORMATION IS THEN GATED OUT FROM THE
046707,000038:                                                                                                  #        LGC IN SERIAL FASHION.
046708,000039: 
046709,000040:                                                                                                  #        THIS PROGRAM IS CODED FOR A 2 SECOND DOWNLIST.  SINCE DOWNRUPTS
046710,000041:                                                                                                  #        OCCUR EVERY 20 MS AND 2 AGC COMPUTER WORDS CAN BE PLACED IN
046711,000042:                                                                                                  #        CHANNELS 34 AND 35 DURING EACH DOWNRUPT THE PROGRAM IS CAPABLE
046712,000043:                                                                                                  #        OF SENDING 200 AGC WORDS EVERY 2 SECONDS.
046713,000044: 
046714,000045:                                                                                                  #  CALLING SEQUENCE - NONE
046715,000046:                                                                                                  #        PROGRAM IS ENTERED VIA TCF DODOWNTM WHICH IS EXECUTED AS A
046716,000047:                                                                                                  #        RESULT OF A DOWNRUPT.  CONTROL IS RETURNED VIA TCF RESUME WHICH
046717,000048:                                                                                                  #        IN EFFECT IS A RESUME.
046718,000049: 
046719,000050:                                                                                                  #  SUBROUTINES CALLED - NONE
046720,000051: 
046721,000052:                                                                                                  #  NORMAL EXIT MODE - TCF RESUME
046722,000053: 
046723,000054:                                                                                                  #  ALARM OR ABORT EXIT MODE - NONE
046724,000055: 
046725,000056:                                                                                                  #  RESTART PROTECTION:
046726,000057:                                                                                                  #        ON A FRESH START AND RESTART THE 'STARTSUB' SUBROUTINE WILL INITIALIZE THE DOWNLIST POINTER (ACTUALLY
046727,000058:                                                                                                  #        DNTMGOTO) TO THE BEGINNING OF THE CURRENT DOWNLIST (I.E. CURRENT CONTENTS OF DNLSTADR).  THIS HAS THE
046728,000059:                                                                                                  #        EFFECT OF IGNORING THE REMAINDER OF THE DOWNLIST WHICH THE DOWN-TELEMETRY PROGRAM WAS WORKING ON WHEN
046729,000060:                                                                                                  #        THE RESTART (OR FRESH START) OCCURRED AND RESUME DOWN TELEMETRY FROM THE BEGINNING OF THE CURRENT
046730,000061:                                                                                                  #        DOWNLIST.
046731,000062: 
046732,000063:                                                                                                  #        ALSO OF INTEREST IS THE FACT THAT ON A RESTART THE AGC WILL ZERO DOWNLINK CHANNELS 13, 34 AND 35.
046733,000064: 
046734,000065:                                                                                                  #  DOWNLINK LIST SELECTION:
046735,000066:                                                                                                  #        THE APPROPRIATE DOWNLINK LISTS ARE SELECTED BY THE FOLLOWING:
046736,000067:                                                                                                  #        1.      FRESH START
046737,000068:                                                                                                  #        2.      V37EXXE WHERE XX = THE MAJOR MODE BEING SELECTED.
046738,000069:                                                                                                  #        3.      UPDATE PROGRAM (P27)
046739,000070:                                                                                                  #        4.      NON-V37 SELECTABLE TYPE PROGRAMS (E.G. AGS INITIALIZATION (SUNDANCE, LUMINARY) AND P61-P62
046740,000071:                                                                                                  #                TRANSITION (COLOSSUS) ETC.).
046741,000072: 
046742,000073:                                                                                                  #  DOWNLINK LIST RULES AND LIMITATIONS:
046743,000074:                                                                                                  #        READ SECTION(S) WHICH FOLLOW 'DEBRIS' WRITEUP.
046744,000075: 
046745,000076:                                                                                                  #  OUTPUT - EVERY 2 SECONDS 100 DOUBLE PRECISION WORDS (I.E. 200 LGC
046746,000077:                                                                                                  #        COMPUTER WORDS) ARE TRANSMITTED VIA DOWNLINK.
046747,000078: 
046748,000079:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED - NONE
046749,000080:                                                                                                  #        'DNTMGOTO' AND 'DNLSTADR' ARE INITIALIZED BY THE FRESH START PROGRAM.
046750,000081: 
046751,000082:                                                                                                  #  DEBRIS (ERASABLE LOCATIONS DESTROYED BY THIS PROGRAM) -
046752,000083:                                                                                                  #        LDATALST, DNTMBUFF TO DNTMBUFF +21D, TMINDEX, DNQ.
046753,000084: 
046754,000085:                                                                                                  #  DODOWNTM IS ENTERED EVERY 20 MS BY AN INTERRUPT TRIGGERED BY THE
046755,000086:                                                                                                  #  RECEIPT OF AN ENDPULSE FROM THE SPACECRAFT TELEMETRY PROGRAMMER.
046756,000087: 
046757,000088:                                                                                                  #  NOTES REGARDING DOWNLINK LISTS ASSOCIATED WITH THIS PROGRAM:
046758,000089:                                                                                                  #  1.    DOWNLISTS. - DOWNLISTS MUST BE COMPILED IN THE SAME BANK AS THE
046759,000090:                                                                                                  #        DOWN-TELEMETRY PROGRAM.  THIS IS DONE FOR EASE OF CODING, FASTER
046760,000091:                                                                                                  #        EXECUTION.
046761,000092:                                                                                                  #  2.    EACH DOWNLINK LIST CONSISTS OF A CONTROL LIST AND A NUMBER OF
046762,000093:                                                                                                  #        SUBLISTS.
046763,000094:                                                                                                  #  3.    A SUBLIST REFERS TO A SNAPSHOT OR DATA COMMON TO THE SAME OR OTHER
046764,000095:                                                                                                  #        DOWNLINK LISTS.  ANY SUBLIST CONTAINING COMMON DATA NEEDS TO BE
046765,000096:                                                                                                  #        CODED ONLY ONCE FOR THE APPLICABLE DOWNLINK LISTS.
046766,000097:                                                                                                  #  4.    SNAPSHOT SUBLISTS REFER SPECIFICALLY TO HOMOGENOUS DATA WHICH MUST BE
046767,000098:                                                                                                  #        SAVED IN A BUFFER DURING ONE DOWNRUPT.
046768,000099:                                                                                                  #  5.    THE 1DNADR FOR THE 1ST WORD OF SNAPSHOT DATA IS FOUND AT THE END
046769,000100:                                                                                                  #        OF EACH SNAPSHOT SUBLIST, SINCE THE PROGRAM CODING SENDS THIS DP WORD
046770,000101:                                                                                                  #        IMMEDIATELY AFTER STORING THE OTHERS IN THE SNAPSHOT BUFFER.
046771,000102:                                                                                                  #  6.    ALL LISTS ARE COMBINATIONS OF CODED ERASABLE ADDRESS CONSTANTS
046772,000103:                                                                                                  #        CREATED FOR THE DOWNLIST PROGRAM.
046773,000104:                                                                                                  #        A.      1DNADR                  1-WORD DOWNLIST ADDRESS.
046774,000105:                                                                                                  #                SAME AS ECADR, BUT USED WHEN THE WORD ADDRESSED IS THE LEFT
046775,000106:                                                                                                  #                HALF OF A DOUBLE-PRECISION WORD FOR DOWN TELEMETRY.
046776,000107:                                                                                                  #        B.      2DNADR - 6DNADR         N-WORD DOWNLIST ADDRESS, N = 2 - 6.
046777,000108:                                                                                                  #                SAME AS 1DNADR, BUT WITH THE 4 UNUSED BITS OF THE ECADR FORMAT
046778,000109:                                                                                                  #                FILLED IN WITH 0001-0101.  USED TO POINT TO A LIST OF N DOUBLE-
046779,000110:                                                                                                  #                PRECISION WORDS, STORED CONSECUTIVELY, FOR DOWN TELEMETRY.
046780,000111:                                                                                                  #        C.      DNCHAN                  DOWNLIST CHANNEL ADDRESS.
046781,000112:                                                                                                  #                SAME AS 1DNADR, BUT WITH PREFIX BITS 0111.  USED TO POINT TO
046782,000113:                                                                                                  #                A PAIR OF CHANNELS FOR DOWN TELEMETRY.
046783,000114:                                                                                                  #        D.      DNPTR                   DOWN TELEMETRY SUBLIST POINTER.
046784,000115:                                                                                                  #                SAME AS CAF BUT TAGGED AS A CONSTANT.  USED IN CONTROL LIST TO POINT TO A SUBLIST.
046785,000116:                                                                                                  #                CAUTION --- A DNPTR CANNOT BE USED IN A SUBLIST.
046786,000117:                                                                                                  #  7.    THE WORD ORDER CODE IS SET TO ZERO AT THE BEGINNING OF EACH DOWNLIST (I.E. CONTROL LIST) AND WHEN
046787,000118:                                                                                                  #        A '1DNADR TIME2' IS DETECTED IN THE CONTROL LIST (ONLY).
046788,000119:                                                                                                  #  8.    IN THE SNAPSHOT SUBLIST ONLY, THE DNADR'S CANNOT POINT TO THE FIRST WORD OF ANY EBANK.
046789,000120: 
046790,000121:                                                                                                  #  DOWNLINK LIST RESTRICTIONS:
046791,000122:                                                                                                  #  (THE FOLLOWING POINTS MAY BE LISTED ELSEWHERE BUT ARE LISTED HERE SO IT IS CLEAR THAT THESE THINGS CANNOT BE
046792,000123:                                                                                                  #  DONE)
046793,000124:                                                                                                  #  1.    SNAPSHOT DOWNLIST:
046794,000125:                                                                                                  #        (A) CANNOT CONTAIN THE FOLLOWING ECADRS (I.E. 1DNADR'S): 0, 400, 1000, 1400, 2000, 2400, 3000, 3400.
046795,000126:                                                                                                  #        (B) CAN CONTAIN ONLY 1DNADR'S
046796,000127:                                                                                                  #  2.    ALL DOWNLINKED DATA (EXCEPT CHANNELS) IS PICKED UP BY A <DCA<SO DOWNLINK LISTS CANNOT CONTAIN THE
046797,000128:                                                                                                  #        EQUIVALENT OF THE FOLLOWING ECADRS (I.E. IDNADRS): 377, 777, 1377, 1777, 2377, 27777, 3377, 3777.
046798,000129:                                                                                                  #        (NOTE: THE TERM EQUIVALENT ' MEANT THAT THE IDNADR TO 6DNADR WILL BE PROCESSED LIKE 1 TO 6 ECADRS)
046799,000130:                                                                                                  #  3.    CONTROL LISTS AND SUBLISTS CANNOT HAVE ENTRIES = OCTAL 00000 OR OCTAL 77777
046800,000131:                                                                                                  #  4.    THE '1DNADR TIME2' WHICH WILL CAUSE THE DOWNLINK PROGRAM TO SET THE WORDER CODE TO 3 MUST APPEAR IN THE
046801,000132:                                                                                                  #        CONTROL SECTION OF THE DOWNLIST.
046802,000133:                                                                                                  #  5.    'DNCHAN 0' CANNOT BE USED.
046803,000134:                                                                                                  #  6.    'DNPTR 0' CANNOT BE USED.
046804,000135:                                                                                                  #  7.    DNPTR CANNOT APPEAR IN A SUBLIST.
046805,000136: 
046806,000137:                                                                                                  #  EBANK SETTINGS
046807,000138:                                                                                                  #        IN THE PROCESS OF SETTING THE EBANK (WHEN PICKING UP DOWNLINK DATA) THE DOWN TELEMETRY PROGRAM PUTS
046808,000139:                                                                                                  #        'GARBAGE' INTO BITS15-12 OF EBANK.  HUGH BLAIR-SMITH WARNS US THAT BITS15-12 OF EBANK MAY BECOME
046809,000140:                                                                                                  #        SIGNIFICANT SOMEDAY IN THE FUTURE.  IF/WHEN THAT HAPPENS, THE PROGRAM SHOULD INSURE (BY MASKING ETC.)
046810,000141:                                                                                                  #        THAT BITS 15-12 OF EBANK ARE ZERO.
046811,000142: 
046812,000143:                                                                                                  #  INITIALIZATION REQUIRED - TO INTERRUPT CURRENT LIST AND START A NEW ONE..
046813,000144:                                                                                                  #        1. ADRES OF DOWNLINK LIST INTO DNLSTADR
046814,000145:                                                                                                  #        2. NEGONE INTO SUBLIST
046815,000146:                                                                                                  #        3. NEGONE INTO DNECADR
046816,000147: 
046817,000148:    4000                                           SETLOC   FFTAG12                               
046818,000149:    4000                                           BANK                                           
046819,000150: 
046820,000151:    4662     0337                                  EBANK=   DNTMBUFF                              
046821,000152: 
046822,000153:    4662                                           COUNT    $$/DPROG                              
046823,000154:    4662           54016        DODOWNTM           TS       BANKRUPT                              
046824,000155:    4663           00006                           EXTEND                                         
046825,000156:    4664           22012                           QXCH     QRUPT                                 #  SAVE Q
046826,000157:    4665           35025                           CA       BIT7                                  #  SET WORD ORDER CODE TO 1.  EXCEPTION- AT
046827,000158:    4666           00006                           EXTEND                                         
046828,000159:    4667           02013                           RAND     CHAN13                                
046829,000160:    4670           10000                           CCS      A                                     
046830,000161:    4671           00334                           TC       DNTMGOTO                              
046831,000162:    4672           35025                           CA       BIT7                                  
046832,000163:    4673           00006                           EXTEND                                         #  THE BEGINNING OF EACH LIST THE WORD
046833,000164:    4674           05013                           WOR      CHAN13                                #  CODE WILL BE SET BACK TO 0.
046834,000165:    4675           00334                           TC       DNTMGOTO                              #  GOTO APPROPRIATE PHASE OF PROGRAM
046835,000166: 
046836,000167: 05,2000                                           SETLOC   DOWNTELM                              
046837,000168: 05,2000                                           BANK                                           
046838,000169: 
046839,000170: 05,3523                                           COUNT*   $$/DPROG                              
046840,000171: 05,3523           37716        DNPHASE1           CA       NEGONE                                #  INITIALIZE ALL CONTROL WORDS
046841,000172: 05,3524           54336                           TS       SUBLIST                               #  WORDS TO MINUS ONE
046842,000173: 05,3525           54335                           TS       DNECADR                               
046843,000174: 05,3526           33646                           CA       LDNPHAS2                              #  SET DNTMGOTO =O ALL SUBSEQUENT DOWNRUPTS
046844,000175: 05,3527           54334                           TS       DNTMGOTO                              #  GO TO DNPHASE2
046845,000176: 05,3530           13544                           TCF      NEWLIST                               
046846,000177: 05,3531           10335        DNPHASE2           CCS      DNECADR                               #  SENDING OF DATA IN PROGRESS
046847,000178: 05,3532           03661        DODNADR            TC       FETCH2WD                              #  YES - THEN FETCH THE NEXT 2 SP WORDS
046848,000179: 05,3533           77753        MINTIME2           -1DNADR  TIME2                                 #  NEGATIVE OF TIME2 1DNADR
046849,000180: 05,3534           13535                           TCF      +1                                    #  (ECADR OF 3776 + 74001 = 77777)
046850,000181: 
046851,000182: 05,3535           10336                           CCS      SUBLIST                               #  IS THE SUBLIST IN CONTROL
046852,000183: 05,3536           13674                           TCF      NEXTINSL                              #  YES
046853,000184: 05,3537           74001        DNADRDCR           OCT      74001                                 #  DNADR COUNT AND ECADR DECREMENTER
046854,000185: 
046855,000186: 05,3540           30333        CHKLIST            CA       CTLIST                                
046856,000187: 05,3541           00006                           EXTEND                                         
046857,000188: 05,3542           63544                           BZMF     NEWLIST                               #  IT WILL BE NEGATIVE AT END OF LIST
046858,000189: 05,3543           13551                           TCF      NEXTINCL                              
046859,000190: 05,3544           50332        NEWLIST            INDEX    DNLSTCOD                              
046860,000191: 05,3545           32335                           CA       DNTABLE                               #  INITIALIZE CTLIST WITH
046861,000192: 05,3546           54333                           TS       CTLIST                                #        STARTING ADDRESS OF NEW LIST
046862,000193: 05,3547           40332                           CS       DNLSTCOD                              
046863,000194: 05,3550           13763                           TCF      SENDID     +3                         
046864,000195: 05,3551           50333        NEXTINCL           INDEX    CTLIST                                
046865,000196: 05,3552           30000                           CA       0                                     
046866,000197: 05,3553           10000                           CCS      A                                     
046867,000198: 05,3554           24333                           INCR     CTLIST                                #  SET POINTER TO PICK UP NEXT CTLIST WORD
046868,000199: 05,3555           13561                           TCF      +4                                    #  ON NEXT ENTRY TO PROG.  (A SHOULD NOT =0)
046869,000200: 05,3556           56333                           XCH      CTLIST                                #  SET CTLIST TO NEGATIVE AND PLACE(CODING)
046870,000201: 05,3557           40000                           COM                                            #  UNCOMPLEMENTED DNADR INTO A.    (FOR LA)
046871,000202: 05,3560           56333                           XCH      CTLIST                                #                                  (ST IN )
046872,000203: 05,3561           24000                 +4        INCR     A                                     #                                  (CTLIST)
046873,000204: 05,3562           54335                           TS       DNECADR                               #  SAVE DNADR
046874,000205: 05,3563           63533                           AD       MINTIME2                              #  TEST FOR TIME2 (NEG. OF ECADR)
046875,000206: 05,3564           10000                           CCS      A                                     
046876,000207: 05,3565           13571                           TCF      SETWO      +1                         #  DON'T SET WORD ORDER CODE
046877,000208: 05,3566           47777        MINB1314           OCT      47777                                 #  MINUS BIT 13 AND 14 (CAN'T GET HERE)
046878,000209: 05,3567           13571                           TCF      SETWO      +1                         #  DON'T SET WORD ORDER CODE
046879,000210: 05,3570           03613        SETWO              TC       WOZERO                                #  GO SET WORD ORDER CODE TO ZERO.
046880,000211: 05,3571           30335                 +1        CA       DNECADR                               #  RELOAD A WITH THE DNADR.
046881,000212: 05,3572           63566                 +2        AD       MINB1314                              #  IS THIS A REGULAR DNADR?
046882,000213: 05,3573           00006                           EXTEND                                         
046883,000214: 05,3574           63661                           BZMF     FETCH2WD                              #  YES.  (A MUST NEVER BE ZERO)
046884,000215: 05,3575           67710                           AD       MINB12                                #  NO-  IS IT A POINTER (DNPTR) OR A
046885,000216: 05,3576           00006                           EXTEND                                         #        CHANNEL(DNCHAN)
046886,000217: 05,3577           63617                           BZMF     DODNPTR                               #  IT'S A POINTER.  (A MUST NEVER BE ZERO)
046887,000218: 
046888,000219: 05,3600           00006        DODNCHAN           TC       6                                     #  (EXECUTED AS EXTEND)  IT S A CHANNEL
046889,000220: 05,3601           50335                           INDEX    DNECADR                               
046890,000221: 05,3602           44000                           INDEX    0          -4000                      #  (EXECUTED AS READ)
046891,000222: 05,3603           54001                           TS       L                                     
046892,000223: 05,3604           00006                           TC       6                                     #  (EXECUTED AS EXTEND)
046893,000224: 05,3605           50335                           INDEX    DNECADR                               
046894,000225: 05,3606           43777                           INDEX    0          -4001                      #  (EXECUTED AS READ)
046895,000226: 05,3607           54335                           TS       DNECADR                               #  SET DNECADR
046896,000227: 05,3610           37716                           CA       NEGONE                                #        TO MINUS
046897,000228: 05,3611           56335                           XCH      DNECADR                               #                WHILE PRESERVING A.
046898,000229: 05,3612           13707                           TCF      DNTMEXIT                              #  GO SEND CHANNELS
046899,000230: 
046900,000231: 05,3613           45025        WOZERO             CS       BIT7                                  
046901,000232: 05,3614           00006                           EXTEND                                         
046902,000233: 05,3615           03013                           WAND     CHAN13                                #  SET WORD ORDER CODE TO ZERO
046903,000234: 05,3616           00002                           TC       Q                                     #  RETURN TO CALLER
046904,000235: 
046905,000236: 05,3617           50335        DODNPTR            INDEX    DNECADR                               #  DNECADR CONTAINS ADRES OF SUBLIST
046906,000237: 05,3620           00000                           0        0                                     #  CLEAR AND ADD LIST ENTRY INTO A.
046907,000238: 05,3621           10000                           CCS      A                                     #  IS THIS A SNAPSHOT SUBLIST
046908,000239: 05,3622           30335                           CA       DNECADR                               #  NO, IT IS A REGULAR SUBLIST.
046909,000240: 05,3623           13673                           TCF      DOSUBLST                              #  A MUST NOT BE ZERO.
046910,000241: 
046911,000242: 05,3624           56335                           XCH      DNECADR                               #  YES, IT IS A SNAPSHOT SUBLIST.
046912,000243: 05,3625           54336                           TS       SUBLIST                               #  C(DNECADR) INTO SUBLIST
046913,000244: 05,3626           35035                           CAF      ZERO                                  #        A    INTO     A
046914,000245: 05,3627           56335                           XCH      TMINDEX                               #  (NOTE.. TMINDEX = DNECADR)
046915,000246: 
046916,000247:                                                                                                  #  THE FOLLOWING CODING (FROM SNAPLOOP TO SNAPEND) IS FOR THE PURPOSE OF TAKING A SNAPSHOT OF 12 DP REGISTERS.
046917,000248:                                                                                                  #  THIS IS DONE BY SAVING 11 DP REGISTERS IN DNTMBUFF AND SENDING THE FIRST DP WORD IMMEDIATELY.
046918,000249:                                                                                                  #  THE SNAPSHOT PROCESSING IS THE MOST TIME CONSUMING AND THEREFORE THE CODING AND LIST STRUCTURE WERE DESIGNED
046919,000250:                                                                                                  #  TO MINIMIZE TIME.  THE TIME OPTIMIZATION RESULTS IN RULES UNIQUE TO THE SNAPSHOT PORTION OF THE DOWNLIST.
046920,000251:                                                                                                  #  THESE RULES ARE ......
046921,000252:                                                                                                  #        1.      ONLY 1DNADR'S CAN APPEAR IN THE SNAPSHOT SUBLIST
046922,000253:                                                                                                  #        2.      THE 1DNADR'S CANNOT REFER TO THE FIRST LOCATION IN ANY BANK.
046923,000254: 
046924,000255: 05,3630           54003        SNAPLOOP           TS       EBANK                                 #  SET EBANK
046925,000256: 05,3631           74373                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS
046926,000257: 05,3632           00006                           EXTEND                                         
046927,000258: 05,3633           50000                           INDEX    A                                     
046928,000259: 05,3634  E3,1401                                  EBANK=   1401                                  
046929,000260: 05,3634           31402                           DCA      1401                                  #  PICK UP 2 SNAPSHOT WORDS.
046930,000261: 05,3635     0337                                  EBANK=   DNTMBUFF                              
046931,000262: 05,3635           50335                           INDEX    TMINDEX                               
046932,000263: 05,3636           52340                           DXCH     DNTMBUFF                              #  STORE 2 SNAPSHOT WORDS IN BUFFER
046933,000264: 05,3637           24335                           INCR     TMINDEX                               #  SET BUFFER INDEX FOR NEXT 2 WORDS.
046934,000265: 05,3640           24335                           INCR     TMINDEX                               
046935,000266: 05,3641           24336        SNAPAGN            INCR     SUBLIST                               #  SET POINTER TO NEXT 2 WORDS OF SNAPSHOT
046936,000267: 05,3642           50336                           INDEX    SUBLIST                               
046937,000268: 05,3643           00000                           0        0                                     #  = CA SSSS (SSSS = NEXT ENTRY IN SUBLIST)
046938,000269: 05,3644           10000                           CCS      A                                     #  TEST FOR LAST TWO WORDS OF SNAPSHOT.
046939,000270: 05,3645           13630                           TCF      SNAPLOOP                              #  NOT LAST TWO.
046940,000271: 05,3646           03531        LDNPHAS2           GENADR   DNPHASE2                              
046941,000272: 05,3647           54336                           TS       SUBLIST                               #  YES, LAST.  SAVE A.
046942,000273: 05,3650           37716                           CA       NEGONE                                #  SET DNECADR AND
046943,000274: 05,3651           54335                           TS       DNECADR                               #        SUBLIST POINTERS
046944,000275: 05,3652           56336                           XCH      SUBLIST                               #                TO NEGATIVE VALUES.
046945,000276: 05,3653           54003                           TS       EBANK                                 
046946,000277: 05,3654           74373                           MASK     LOW8                                  
046947,000278: 05,3655           00006                           EXTEND                                         
046948,000279: 05,3656           50000                           INDEX    A                                     
046949,000280: 05,3657  E3,1401                                  EBANK=   1401                                  
046950,000281: 05,3657           31402                           DCA      1401                                  #  PICK UP FIRST 2 WORDS OF SNAPSHOT.
046951,000282: 05,3660     0337                                  EBANK=   DNTMBUFF                              
046952,000283: 05,3660           13707        SNAPEND            TCF      DNTMEXIT                              #  NOW GO SEND THEM.
046953,000284: 
046954,000285: 05,3661           30335        FETCH2WD           CA       DNECADR                               
046955,000286: 05,3662           54003                           TS       EBANK                                 #  SET EBANK
046956,000287: 05,3663           74373                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS
046957,000288: 05,3664           54001                           TS       L                                     
046958,000289: 05,3665           33537                           CA       DNADRDCR                              #  DECREMENT COUNT AND ECADR
046959,000290: 05,3666           26335                           ADS      DNECADR                               
046960,000291: 05,3667           00006                           EXTEND                                         
046961,000292: 05,3670           50001                           INDEX    L                                     
046962,000293: 05,3671  E3,1400                                  EBANK=   1400                                  
046963,000294: 05,3671           31401                           DCA      1400                                  #  PICK UP 2 DATA WORDS
046964,000295: 05,3672     0337                                  EBANK=   DNTMBUFF                              
046965,000296: 05,3672           13707                           TCF      DNTMEXIT                              #  NOW GO SEND THEM.
046966,000297: 
046967,000298: 05,3673           54336        DOSUBLST           TS       SUBLIST                               #  SET SUBLIST POINTER
046968,000299: 05,3674           50336        NEXTINSL           INDEX    SUBLIST                               
046969,000300: 05,3675           00000                           0        0                                     #  = CA SSSS (SSSS = NEXT ENTRY IN SUBLIST)
046970,000301: 05,3676           10000                           CCS      A                                     #  IS IT THE END OF THE SUBLIST
046971,000302: 05,3677           24336                           INCR     SUBLIST                               #  NO-
046972,000303: 05,3700           13704                           TCF      +4                                    
046973,000304: 05,3701           54336                           TS       SUBLIST                               #  SAVE A.
046974,000305: 05,3702           37716                           CA       NEGONE                                #  SET SUBLIST TO MINUS
046975,000306: 05,3703           56336                           XCH      SUBLIST                               #  RETRIEVE A.
046976,000307: 05,3704           24000                 +4        INCR     A                                     
046977,000308: 05,3705           54335                           TS       DNECADR                               #  SAVE DNADR
046978,000309: 05,3706           13572                           TCF      SETWO      +2                         #  GO USE COMMON CODING (PROBLEMS WOULD
046979,000310:                                                                                                  #  OCCUR IF THE PROGRAM ENCOUNTERED A
046980,000311:                                                                                                  #  DNPTR NOW)
046981,000312: 
046982,000313: 05,3707           00006        DNTMEXIT           EXTEND                                         #  DOWN-TELEMETRY EXIT
046983,000314: 05,3710           01034                           WRITE    DNTM1                                 #  TO SEND A + L TO CHANNELS 34 + 35
046984,000315: 05,3711           30001                           CA       L                                     #  RESPECTIVELY
046985,000316: 05,3712           00006        TMEXITL            EXTEND                                         
046986,000317: 05,3713           01035                           WRITE    DNTM2                                 
046987,000318: 05,3714           15347        TMRESUME           TCF      RESUME                                #  EXIT TELEMETRY PROGRAM VIA RESUME.
046988,000319: 
046989,000320: 05,3715     7710               MINB12             EQUALS   -1/8                                  
046990,000321: 05,3715     0335               DNECADR            EQUALS   TMINDEX                               
046991,000322: 05,3715     0333               CTLIST             EQUALS   LDATALST                              
046992,000323: 05,3715     0336               SUBLIST            EQUALS   DNQ                                   
046993,000324: 
046994,000325:                                                                                                  #  SUBROUTINE NAME - DNDUMP
046995,000326: 
046996,000327:                                                                                                  #  FUNCTIONAL DESCRIPTION - TO SEND (DUMP) ALL 8 BANKS OF ERASABLE STORAGE TWICE.  BANKS ARE SENT ONE AT A TIME
046997,000328:                                                                                                  #        EACH BANK IS PRECEEDED BY AN ID WORD, SYNCH BITS, ECADR AND TIME1 FOLLOWED BY THE 256D WORDS OF EACH
046998,000329:                                                                                                  #        EBANK.  EBANKS ARE DUMPED IN ORDER (I.E. EBANK 0 FIRST, THEN EBANK1 ETC.)
046999,000330: 
047000,000331:                                                                                                  #  CALLING SEQUENCE- THE GROUND OR ASTRONAUT BY KEYING V74E CAN INITIALIZE THE DUMP.
047001,000332:                                                                                                  #        AFTER KEYING IN V74E THE CURRENT DOWNLIST WILL BE IMMEDIATELY TERMINATED AND THE DOWNLINK ERASABLE DUMP
047002,000333:                                                                                                  #        WILL BEGIN.
047003,000334: 
047004,000335:                                                                                                  #        ONCE INITIATED THE DOWNLINK ERASABLE DUMP CAN BE TERMINATED (AND INTERRUPTED DOWNLIST REINSTATED) ONLY
047005,000336:                                                                                                  #        BY THE FOLLOWING:
047006,000337:                                                                                                  #        1. A FRESH START
047007,000338:                                                                                                  #        2. COMPLETION OF BOTH COMPLETE DUMPS
047008,000339:                                                                                                  #        3. AND INVOLUNTARILY BY A RESTART.
047009,000340:                                                                                                  #  NORMAL EXIT MODE- TCF DNPHASE1
047010,000341: 
047011,000342:                                                                                                  #  ALARM OR ABORT MODE- NONE
047012,000343: 
047013,000344:                                                                                                  #  *SUBROUTINES CALLED- NONE.
047014,000345: 
047015,000346:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
047016,000347:                                                                                                  #        NONE
047017,000348:                                                                                                  #  DEBRIS- DUMPLOC, DUMPSW, DNTMGOTO, EBANK AND CENTRAL REGISTERS
047018,000349: 
047019,000350:                                                                                                  #  TIMING-       TIME (IN SECS) = ((NO.DUMPS)*(NO.EBANKS)*(WDSPEREBANK + NO.IDWDS)) / NO.WDSPERSEC
047020,000351:                                                                                                  #                TIME (IN SECS) =  (   4    )*(    8    )*(    256     +     4   )  /     100
047021,000352:                                                                                                  #           THUS TIME (IN SECS TO SEND DUMP OF ERASABLE 4 TIMES VIA DOWNLINK) = 83.2 SECONDS
047022,000353: 
047023,000354:                                                                                                  #  STRUCTURE OF ONE EBANK AS IT IS SENT BY DOWNLINK PROGRAM-
047024,000355:                                                                                                  #        (REMINDER-THIS ONLY DESCRIBES ONE OF THE 8 EBANKS X 4 (DUMPS) = 32 EBANKS WHICH WILL BE SENT BY DNDUMP)
047025,000356: 
047026,000357:                                                                                                  #        DOWNLIST                                W
047027,000358:                                                                                                  #          WORD  TAKEN FROM CONTENTS OF  EXAMPLE O       COMMENTS
047028,000359:                                                                                                  #            1   ERASID                   0177X  0       DOWNLIST I.D. FOR DOWNLINK ERASABLE DUMP (X=7 CSM, 6 LM)
047029,000360:                                                                                                  #            2   LOWIDCOD                 77340  1       DOWNLINK SYNCH BITS.  (SAME ONE USED IN ALL OTHER DOWNLISTS)
047030,000361:                                                                                                  #            3   DUMPLOC                  13400  1       (SEE NOTES ON DUMPLOC) 1 = 3RD ERAS DUMP, 3400=ECADR OF 5TH WD
047031,000362:                                                                                                  #            4   TIME1                    14120  1       TIME IN CENTISECONDS
047032,000363:                                                                                                  #            5   FIRST WORD OF EBANK X    03400  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1400 (ECADR 3400)
047033,000364:                                                                                                  #            6   2ND   WORD OF EBANK X    00142  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1401 (ECADR 3401)
047034,000365:                                                                                                  #            7   3RD   WORD OF EBANK X    00142  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1402 (ECADR 3402)
047035,000366:                                                                                                  #            .                                   1
047036,000367:                                                                                                  #            .                                   1
047037,000368:                                                                                                  #            .                                   1
047038,000369:                                                                                                  #         260D   256TH WORD OF EBANK X    03777  1       IN THIS EXAMPLE THIS WORD = CONTENTS OF E7,1777 (ECADR 3777)
047039,000370: 
047040,000371:                                                                                                  #  NOTE-         DUMPLOC CONTAINS THE COUNTER AND ECADR FOR EACH WORD BEING SENT.
047041,000372:                                                                                                  #                THE BIT STRUCTURE OF DUMPLOC IS FOLLOWS---
047042,000373:                                                                                                  #                                                X = NOT USED
047043,000374:                                                                                                  #                X ABC EEE RRRRRRRR            ABC = ERASABLE DUMP COUNTER (I.E. ABC = 0,1,2 OR 3 WHICH MEANS THAT
047044,000375:                                                                                                  #                                                    COMPLETE ERASABLE DUMP NUMBER 1,2,3 OR 4 RESPECTIVELY IS IN PROGRESS)
047045,000376:                                                                                                  #                                              EEE = EBANK BITS
047046,000377:                                                                                                  #                                         RRRRRRRR = RELATIVE ADDRESS WITHIN AN EBANK.
047047,000378: 
047048,000379: 05,3715           35035        DNDUMPI            CA       ZERO                                  #  INITIALIZE DOWNLINK
047049,000380: 05,3716           54335                           TS       DUMPLOC                               #  ERASABLE DUMP
047050,000381: 05,3717           03760                 +2        TC       SENDID                                #  GO SEND ID AND SYNCH BITS
047051,000382: 05,3720           33727                           CA       LDNDUMP1                              #  SET DNTMGOTO
047052,000383: 05,3721           54334                           TS       DNTMGOTO                              #  TO LOCATION FOR NEXT PASS
047053,000384: 05,3722           30025                           CA       TIME1                                 #  PLACE TIME1
047054,000385: 05,3723           56001                           XCH      L                                     #  INTO L
047055,000386: 05,3724           30335                           CA       DUMPLOC                               #  AND ECADR OF THIS EBANK INTO A
047056,000387: 05,3725           13707                           TCF      DNTMEXIT                              #  SEND DUMPLOC AND TIME1
047057,000388: 
047058,000389: 05,3726           03730        LDNDUMP            ADRES    DNDUMP                                
047059,000390: 05,3727           03742        LDNDUMP1           ADRES    DNDUMP1                               
047060,000391: 
047061,000392: 05,3730           35032        DNDUMP             CA       TWO                                   #  INCREMENT ECADR IN DUMPLOC
047062,000393: 05,3731           26335                           ADS      DUMPLOC                               #  TO NEXT DP WORD TO BE
047063,000394: 05,3732           74373                           MASK     LOW8                                  #  DUMPED AND SAVE IT.
047064,000395: 05,3733           10000                           CCS      A                                     #  IS THIS THE BEGINNING OF A NEW EBANK
047065,000396: 05,3734           13744                           TCF      DNDUMP2                               #  NO- THEN CONTINUE DUMPING
047066,000397: 05,3735           30335                           CA       DUMPLOC                               #  YES- IS THIS THE END OF THE
047067,000398: 05,3736           75017                           MASK     BIT13                                 #  SECOND COMPLETE ERASABLE DUMP?
047068,000399: 05,3737           00006                           EXTEND                                         
047069,000400: 05,3740           13717                           BZF      DNDUMPI    +2                         #  NO - GO BACK AND INITIALIZE NEXT BANK
047070,000401: 05,3741           13523                           TCF      DNPHASE1                              #  YES - SEND DOWNLIST AGAIN
047071,000402: 05,3742           33726        DNDUMP1            CA       LDNDUMP                               #  SET DNTMGOTO
047072,000403: 05,3743           54334                           TS       DNTMGOTO                              #  FOR WORDS 3 TO 256D OF CURRENT EBANK
047073,000404: 
047074,000405: 05,3744           30335        DNDUMP2            CA       DUMPLOC                               
047075,000406: 05,3745           54003                           TS       EBANK                                 #  SET EBANK
047076,000407: 05,3746           74373                           MASK     LOW8                                  #  ISOLATE RELATIVE ADDRESS.
047077,000408: 05,3747           54002                           TS       Q                                     #  (NOTE: MASK INSTRUCTION IS USED TO PICK
047078,000409: 05,3750           35034                           CA       NEG0                                  #  UP ERASABLE REGISTERS SO THAT EDITING
047079,000410: 05,3751           54001                           TS       L                                     #  REGISTERS 20-23 WILL NOT BE ALTERED.)
047080,000411: 05,3752           50002                           INDEX    Q                                     
047081,000412: 05,3753  E3,1400                                  EBANK=   1400                                  #  PICK UP LOW ORDER REGISTER OF PAIR
047082,000413: 05,3753           71401                           MASK     1401                                  #  OF ERASABLE REGISTERS.
047083,000414: 05,3754           56001                           XCH      L                                     
047084,000415: 05,3755           50002                           INDEX    Q                                     #  PICK UP HIGH ORDER REGISTER OF PAIR
047085,000416: 05,3756           71400                           MASK     1400                                  #  OF ERASABLE REGISTERS.
047086,000417: 05,3757     0337                                  EBANK=   DNTMBUFF                              
047087,000418: 05,3757           13707                           TCF      DNTMEXIT                              #  GO SEND THEM
047088,000419: 
047089,000420: 05,3760           00006        SENDID             EXTEND                                         #  ** ENTRANCE USED BY ERASABLE DUMP PROG. **
047090,000421: 05,3761           22334                           QXCH     DNTMGOTO                              #  SET DNTMGOTO SO NEXT TIME PROG WILL GO
047091,000422: 05,3762           35070                           CAF      ERASID                                #  TO LOCATION FOLLOWING :TC SENDID:
047092,000423: 
047093,000424: 05,3763           54001                           TS       L                                     #  ** ENTRANCE USED BY REGULAR DOWNLINK PG **
047094,000425: 05,3764           03613                           TC       WOZERO                                #  GO SET WORD ORDER CODE TO ZERO
047095,000426: 05,3765           32000                           CAF      LOWIDCOD                              #  PLACE SPECIAL ID CODE INTO L
047096,000427: 05,3766           56001                           XCH      L                                     #  AND ID BACK INTO A
047097,000428: 05,3767           13707                           TCF      DNTMEXIT                              #  SEND DOWNLIST ID CODE(S).

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