Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

063605,000002:                                                                                                  ## Copyright:   Public domain.
063606,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
063607,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
063608,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
063609,000006:                                                                                                  ##              release of the flight software for the Command Module's
063610,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
063611,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
063612,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
063613,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
063614,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
063615,000012:                                                                                                  ##              that the reconstruction is correct.
063616,000013:                                                                                                  ## Reference:   1486
063617,000014:                                                                                                  ## Assembler:   yaYUL
063618,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
063619,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
063620,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
063621,000018: 

Page 1486

063623,000020: 
063624,000021:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION. IT MAY BE CALLED
063625,000022:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
063626,000023: 
063627,000024:                                                                                                  #        CALLING SEQUENCE IS AS FOLLOWS:
063628,000025: 
063629,000026:                                                                                                  #        TC      ALARM
063630,000027:                                                                                                  #        OCT     NNNNN
063631,000028:                                                                                                  #                                (RETURNS HERE)
063632,000029: 
063633,000030:    4000                                           SETLOC   FFTAG7                                
063634,000031:    4000                                           BANK                                           
063635,000032: 
063636,000033:    5671     0375                                  EBANK=   FAILREG                               
063637,000034: 
063638,000035:    5671                                           COUNT*   $$/ALARM                              
063639,000036: 
063640,000037:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
063641,000038: 
063642,000039:    5671           00004        ALARM              INHINT                                         
063643,000040: 
063644,000041:    5672           30002                           CA       Q                                     
063645,000042:    5673           55363        ALARM2             TS       ALMCADR                               
063646,000043:    5674           50002                           INDEX    Q                                     
063647,000044:    5675           30000                           CA       0                                     
063648,000045:    5676           54001        BORTENT            TS       L                                     
063649,000046: 
063650,000047:    5677           30006        PRIOENT            CA       BBANK                                 
063651,000048:    5700           00006                 +1        EXTEND                                         
063652,000049:    5701           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
063653,000050:    5702           55364                           TS       ALMCADR    +1                         
063654,000051: 
063655,000052:    5703           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
063656,000053:    5704           54061                           TS       ITEMP1                                
063657,000054: 
063658,000055:    5705           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
063659,000056:    5706           15712                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
063660,000057:    5707           30001                           CA       L                                     
063661,000058:    5710           54375                           TS       FAILREG                               
063662,000059:    5711           15716                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
063663,000060: 
063664,000061:    5712           10376        CHKFAIL2           CCS      FAILREG    +1                         
063665,000062:    5713           15716                           TCF      PROGLARM                              
063666,000063:    5714           30001                           CA       L                                     
063667,000064:    5715           54376                           TS       FAILREG    +1                         
063668,000065: 
063669,000066:    5716           22377        PROGLARM           LXCH     FAILREG    +2                         #  STORE AS "MOST RECENT" ALARM CODE
063670,000067: 
063671,000068:    5717           41241                           CS       DSPTAB     +11D                       #  TURN ON PROGRAM ALARM IF OFF
063672,000069:    5720           77716                           MASK     BIT15+9                               
063673,000070:    5721           27241                           ADS      DSPTAB     +11D                       
063674,000071: 
063675,000072:    5722           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A

Page 1487

063677,000074:    5723           00003                           RELINT                                         
063678,000075:    5724           50000                           INDEX    A                                     
063679,000076:    5725           00001                           TC       1                                     
063680,000077: 
063681,000078:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
063682,000079:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4. EXAMPLE FOLLOWS,
063683,000080:                                                                                                  #                CAF     OCTXX           ALARM CODE
063684,000081:                                                                                                  #                TC      BANKCALL
063685,000082:                                                                                                  #                CADR    PRIOLARM
063686,000083: 
063687,000084:                                                                                                  #                ...     ...
063688,000085:                                                                                                  #                ...     ...
063689,000086:                                                                                                  #                ...     ...             ASTRONAUT RETURN
063690,000087:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER. RESTART
063691,000088:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
063692,000089: 
063693,000090: 10,2000                                           SETLOC   DISPLAYS                              
063694,000091: 10,2000                                           BANK                                           
063695,000092: 
063696,000093: 10,3766                                           COUNT*   $$/DSPLA                              
063697,000094: 10,3766           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
063698,000095: 10,3767           54001                           TS       L                                     #  SAVE ALARM CODE
063699,000096: 
063700,000097: 10,3770           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
063701,000098: 10,3771           55363                           TS       ALMCADR                               
063702,000099: 10,3772           30134                           CA       BUF2       +1                         
063703,000100: 10,3773           05700                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
063704,000101: 10,3774           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
063705,000102: 10,3775           35023                           CAF      V05N09                                
063706,000103: 10,3776           12750                           TCF      PRIODSPR                              
063707,000104: 
063708,000105:    6000                                           SETLOC   FFTAG13                               
063709,000106:    6000                                           BANK                                           
063710,000107: 
063711,000108:    7706                                           COUNT*   $$/ALARM                              
063712,000109:    7706           00004        BAILOUT            INHINT                                         
063713,000110:    7707           30002                           CA       Q                                     
063714,000111:    7710           55363                           TS       ALMCADR                               
063715,000112: 
063716,000113:    7711           04636                           TC       BANKCALL                              
063717,000114:    7712           40000                           CADR     VAC5STOR                              
063718,000115: 
063719,000116:    7713           51363                           INDEX    ALMCADR                               
063720,000117:    7714           30000                           CAF      0                                     
063721,000118:    7715           05676                           TC       BORTENT                               
063722,000119:    7716           40400        BIT15+9            OCT      40400                                 
063723,000120: 
063724,000121:    7717           00004                 -1        INHINT                                         
063725,000122:    7720           34767        WHIMPER            CA       TWO                                   
063726,000123:    7721           60005                           AD       Z                                     

Page 1488

063728,000125:    7722           54017                           TS       BRUPT                                 
063729,000126:    7723           50017                           RESUME                                         
063730,000127:    7724           04655                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
063731,000128:    7725           12712                           CADR     ENEMA                                 
063732,000129: 
063733,000130:    4000                                           SETLOC   FFTAG7                                
063734,000131:    4000                                           COUNT*   $$/ALARM                              
063735,000132:    4000                                           BANK                                           
063736,000133: 
063737,000134:    5726           00004        POODOO             INHINT                                         
063738,000135:    5727           30002                           CA       Q                                     
063739,000136:    5730           55363                           TS       ALMCADR                               
063740,000137: 
063741,000138:    5731           04636                           TC       BANKCALL                              
063742,000139:    5732           40000                           CADR     VAC5STOR                              #  STORE ERASABLES FOR DEBUGGING PURPOSES.
063743,000140: 
063744,000141:    5733           51363                           INDEX    ALMCADR                               
063745,000142:    5734           30000                           CAF      0                                     
063746,000143:    5735           05676        ABORT2             TC       BORTENT                               
063747,000144: 
063748,000145:    5736           77770        OCT77770           OCT      77770                                 #  DONT MOVE
063749,000146:    5737           34763                           CA       V37FLBIT                              #  IS AVERAGE G ON
063750,000147:    5740           70103                           MASK     FLAGWRD7                              
063751,000148:    5741           10000                           CCS      A                                     
063752,000149:    5742           07717                           TC       WHIMPER    -1                         #  YES.  DONT DO POODOO.  DO BAILOUT.
063753,000150: 
063754,000151:    5743           44753                           CS       BIT14                                 #  DISREGARD ENTRY SETTING
063755,000152:    5744           71247                           MASK     EXTVBACT                              #  EXTENDED VBS ACTIVE?
063756,000153:    5745           10000                           CCS      A                                     
063757,000154:    5746           17717                           TCF      WHIMPER    -1                         #  YES  DONT DO POODOO  DO BAILOUT
063758,000155: 
063759,000156:    5747           05561                           TC       DOWNFLAG                              
063760,000157:    5750           00067                           ADRES    STATEFLG                              
063761,000158: 
063762,000159:    5751           05561                           TC       DOWNFLAG                              
063763,000160:    5752           00236                           ADRES    AUTOSEQ                               
063764,000161: 
063765,000162:    5753           05561                           TC       DOWNFLAG                              
063766,000163:    5754           00230                           ADRES    REINTFLG                              
063767,000164: 
063768,000165:    5755           05561                           TC       DOWNFLAG                              
063769,000166:    5756           00176                           ADRES    UTFLAG                                
063770,000167:    5757           05561                           TC       DOWNFLAG                              
063771,000168:    5760           00010                           ADRES    RNDVZFLG                              
063772,000169:    5761           05561                           TC       DOWNFLAG                              
063773,000170:    5762           00031                           ADRES    TRACKFLG                              #  FORCE STOPRATE
063774,000171:    5763           05561                           TC       DOWNFLAG                              
063775,000172:    5764           00054                           ADRES    NODOFLAG                              
063776,000173: 
063777,000174:    5765           04636                           TC       BANKCALL                              

Page 1489

063779,000176:    5766           12536                           CADR     MR.KLEAN                              
063780,000177:    5767           07720                           TC       WHIMPER                               
063781,000178: 
063782,000179:    5770     5205               DOALARM            EQUALS   ENDOFJOB                              
063783,000180: 
063784,000181:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
063785,000182:                                                                                                  #                CAF     (ALARM)
063786,000183:                                                                                                  #                TC      VARALARM
063787,000184: 
063788,000185:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
063789,000186: 
063790,000187:    5770           00004        VARALARM           INHINT                                         
063791,000188: 
063792,000189:    5771           54001                           TS       L                                     #  SAVE USERS ALARM CODE
063793,000190: 
063794,000191:    5772           30002                           CA       Q                                     #  SAVE USERS Q
063795,000192:    5773           55363                           TS       ALMCADR                               
063796,000193: 
063797,000194:    5774           05677                           TC       PRIOENT                               
063798,000195:    5775           00014        OCT14              OCT      14                                    #  DONT MOVE
063799,000196: 
063800,000197:    5776           01363                           TC       ALMCADR                               #  RETURN TO USER
063801,000198: 
063802,000199:    5777     7706               ABORT              EQUALS   BAILOUT                               #  *** TEMPORARY UNTIL ABORT CALLS OUT

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