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.

061791,000002:                                                                                                  ## Copyright:   Public domain.
061792,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
061793,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
061794,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
061795,000006:                                                                                                  ##              release of the flight software for the Command Module's
061796,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
061797,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
061798,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
061799,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
061800,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
061801,000012:                                                                                                  ##              that the reconstruction is correct.
061802,000013:                                                                                                  ## Reference:   1445
061803,000014:                                                                                                  ## Assembler:   yaYUL
061804,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061805,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
061806,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
061807,000018: 

Page 1445

061809,000020: 
061810,000021: 07,2000                                           SETLOC   KEYRUPT                               
061811,000022: 07,2000                                           BANK                                           
061812,000023: 07,3666                                           COUNT*   $$/KEYUP                              
061813,000024: 
061814,000025: 07,3666           54016        KEYRUPT1           TS       BANKRUPT                              
061815,000026: 07,3667           56002                           XCH      Q                                     
061816,000027: 07,3670           54012                           TS       QRUPT                                 
061817,000028: 07,3671           04366                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
061818,000029: 07,3672           34342                           CAF      LOW5                                  
061819,000030: 07,3673           00006                           EXTEND                                         
061820,000031: 07,3674           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
061821,000032: 07,3675           54073        KEYCOM             TS       RUPTREG4                              
061822,000033: 07,3676           40101                           CS       FLAGWRD5                              
061823,000034: 07,3677           74752                           MASK     DSKYBIT                               
061824,000035: 07,3700           26101                           ADS      FLAGWRD5                              
061825,000036: 
061826,000037: 07,3701           05120        ACCEPTUP           TC       NOVAC30                               #  (NOTE: RUPTREG4 = KEYTEMP1)
061827,000038: 07,3702     1202                                  EBANK=   DSPCOUNT                              
061828,000039: 07,3702           02000 60102                     2CADR    CHARIN                                
061829,000040: 
061830,000041: 07,3704           30073                           CA       RUPTREG4                              
061831,000042: 07,3705           50064                           INDEX    LOCCTR                                
061832,000043: 07,3706           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
061833,000044: 07,3707           05323                           TC       RESUME                                
061834,000045: 

Page 1446

061836,000047: 
061837,000048:                                                                                                  #  UPRUPT PROGRAM
061838,000049: 
061839,000050: 07,3710           54016        UPRUPT             TS       BANKRUPT                              
061840,000051: 07,3711           56002                           XCH      Q                                     
061841,000052: 07,3712           54012                           TS       QRUPT                                 
061842,000053: 07,3713           04366                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
061843,000054: 07,3714           34772                           CAF      ZERO                                  
061844,000055: 07,3715           56045                           XCH      INLINK                                
061845,000056: 07,3716           54073                           TS       KEYTEMP1                              
061846,000057: 07,3717           30075                           CA       FLAGWRD1                              
061847,000058: 07,3720           74755                           MASK     NOP01BIT                              #  IF = , MISSION IS IN
061848,000059: 07,3721           10000                           CCS      A                                     #  PRELAUNCH AND UPLINK DATA SUM IS ENABLED
061849,000060: 07,3722           13726                           TCF      +4                                    #  IF FLAGWORD1 BIT 12 =1, IT IS NOT
061850,000061: 07,3723           30073                           CA       KEYTEMP1                              #  ALLOWED.
061851,000062: 07,3724           27116                           ADS      UPSUM                                 
061852,000063: 07,3725           25117                           INCR     UPSUM      +1                         
061853,000064: 07,3726           34766                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
061854,000065: 07,3727           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
061855,000066: 07,3730           05011                           WOR      DSALMOUT                              
061856,000067: 07,3731           34342        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
061857,000068: 07,3732           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
061858,000069: 07,3733           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
061859,000070: 07,3734           00006                           EXTEND                                         
061860,000071: 07,3735           74757                           MP       BIT10                                 #  SHIFT RIGHT 5
061861,000072: 07,3736           55137                           TS       KEYTEMP2                              
061862,000073: 07,3737           74342                           MASK     LOW5                                  #  MID 5
061863,000074: 07,3740           63774                           AD       HI10                                  
061864,000075: 07,3741           03771                           TC       UPTEST                                
061865,000076: 07,3742           34757                           CAF      BIT10                                 
061866,000077: 07,3743           00006                           EXTEND                                         
061867,000078: 07,3744           71137                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
061868,000079: 07,3745           74342                           MASK     LOW5                                  #  HIGH 5
061869,000080: 07,3746           40000                           COM                                            
061870,000081: 07,3747           03771                           TC       UPTEST                                
061871,000082: 
061872,000083: 07,3750           45000        UPOK               CS       ELRCODE                               #  CODE IS GOOD. IF CODE = 'ERROR RESET',
061873,000084: 07,3751           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
061874,000085: 07,3752           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
061875,000086: 07,3753           13761                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
061876,000087: 
061877,000088: 07,3754           34765                           CAF      UPLOCBIT                              #  TEST UPLOCKFL FOR 0 OR 1
061878,000089: 07,3755           70103                           MASK     FLAGWRD7                              
061879,000090: 07,3756           10000                           CCS      A                                     
061880,000091: 07,3757           05323                           TC       RESUME                                #  UPLOCKFL = 1
061881,000092: 07,3760           03701                           TC       ACCEPTUP                              #  UPLOCKFL = 0
061882,000093: 
061883,000094: 07,3761           44765        CLUPLOCK           CS       UPLOCBIT                              #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
061884,000095: 07,3762           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
061885,000096: 07,3763           54103                           TS       FLAGWRD7                              
061886,000097: 07,3764           03701                           TC       ACCEPTUP                              

Page 1447

061888,000099:                                                                                                  #  CODE IS BAD
061889,000100: 07,3765           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
061890,000101: 07,3766           74765                           MASK     UPLOCBIT                              #  (BY SETTING UPLOCKFL = 1) UNTIL
061891,000102: 07,3767           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
061892,000103: 07,3770           05323                           TC       RESUME                                
061893,000104: 07,3771           60073        UPTEST             AD       KEYTEMP1                              
061894,000105: 07,3772           10000                           CCS      A                                     
061895,000106: 07,3773           03765                           TC       TMFAIL2                               
061896,000107: 07,3774           77740        HI10               OCT      77740                                 
061897,000108: 07,3775           03765                           TC       TMFAIL2                               
061898,000109: 07,3776           00002                           TC       Q                                     
061899,000110: 
061900,000111: 07,3777     5000               ELRCODE            EQUALS   OCT22                                 
061901,000112: 
061902,000113:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
061903,000114:                                                                                                  #        1.      VBRELDSP
061904,000115:                                                                                                  #        2.      ERROR RESET
061905,000116:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
061906,000117: 
061907,000118:                                                                                                  #                                      -
061908,000119:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E   CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
061909,000120:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
061910,000121:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
061911,000122:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
061912,000123:                                                                                                  #  BY 15 ZEROES. THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
061913,000124:                                                                                                  #  FAILURE)
061914,000125: 
061915,000126:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.

End of include-file KEYRUPT,_UPRUPT.agc.  Parent file is MAIN.agc