Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

059982,000002:                                                                                                  ## Copyright:   Public domain.
059983,000003:                                                                                                  ## Filename:    SPS_BACK-UP_RCS_CONTROL.agc
059984,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
059985,000005:                                                                                                  ##              as closely as possible with available information. Sundance
059986,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
059987,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
059988,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
059989,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
059990,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
059991,000011:                                                                                                  ##              or the Sundance GSOPs.
059992,000012:                                                                                                  ## Assembler:   yaYUL
059993,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059994,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059995,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
059996,000016: 
059997,000017: 
059998,000018: 
059999,000019:                                                                                                  #  PROGRAM NAME:  SPSRCS
060000,000020: 
060001,000021:                                                                                                  #  AUTHOR:  EDGAR M. OSHIKA (AC ELECTRONICS)
060002,000022: 
060003,000023:                                                                                                  #  MODIFIED:  TO RETURN TO ALL AXES VIA Q BY P. S. WEISSMAN, OCT 7, 1968
060004,000024: 
060005,000025:                                                                                                  #  FUNCTIONAL DESCRIPTION:
060006,000026: 
060007,000027:                                                                                                  #  THIS PROGRAM CONTROLS THE FIRING OF ALL RCS JETS IN THE DOCKED CONFIGURATION ACCORDING TO THE FOLLOWING PHASE
060008,000028:                                                                                                  #  PLANE LOGIC.
060009,000029: 
060010,000030:                                                                                                  #  1.  OUTER RATE LIMIT (SPSRCS)
060011,000031: 
060012,000032:                                                                                                  #  IF MAGNITUDE OF EDOT IS GREATER THAN 1.73 DEG/SEC SET JET FIRING TIME, TJ, TO REDUCE RATE AND THEN RETURN TO
060013,000033:                                                                                                  #  CALLING PROGRAM (REQUESTING 4 JETS FOR P-AXIS).
060014,000034:                                                                                                  #  OTHERWISE, CONTINUE.
060015,000035: 
060016,000036:                                                                                                  #  2.  RATE DEAD BAND TEST ( JTONTEST)
060017,000037: 
060018,000038:                                                                                                  #  IF JETS ARE FIRING NEGATIVE AND RATE IS GREATER THAN -0.101 DEG/SEC, LEAVE JETS ON AND RETURN,
060019,000039:                                                                                                  #  IF JETS ARE FIRING POSITIVE AND RATE IS LESS THAN +0.101 DEG/SEC, LEAVE JETS ON AND RETURN, OTHERWISE CONTINUE.
060020,000040: 
060021,000041:                                                                                                  #  3.  COASTING TEST (SPSSTART)
060022,000042: 
060023,000043:                                                                                                  #  IF STATE (E,EDOT) IS BELOW LINE  E + 4 X EDOT > -1.4 DEG  AND EDOT IS LESS THAN 1.30 DEG/SEC SET JET TIME POSI-
060024,000044:                                                                                                  #  TIVE AND RETURN,
060025,000045:                                                                                                  #  IF STATE IS ABOVE LINE E + 4 X EDOT > +1.4 DEG AND EDOT IS GREATER THAN -1.30 DEG/SEC, SET JET TIME NEGATIVE
060026,000046:                                                                                                  #  AND RETURN,
060027,000047:                                                                                                  #  OTHERWISE, SET JET TIME ZERO AND RETURN.
060028,000048: 
060029,000049:                                                                                                  #  THE MINIMUM PULSE WIDTH OF THIS CONTROLLER IS DETERMINED BY THE REPETITION  RATE AT WHICH THIS ROUTINE IS CALLED
060030,000050:                                                                                                  #  AND IS NOMINALLY 100 MS FOR ALL AXES IN DRIFTING FLIGHT.   DURING POWERED FLIGHT THE MINIMUM IS 100 MS FOR THE
060031,000051:                                                                                                  #  P AXIS AND 200 MS FOR THE CONTROL OF THE U AND V AXES.
060032,000052: 
060033,000053:                                                                                                  #  CALLING SEQUENCE:
060034,000054: 
060035,000055:                                                                                                  #           TC     SPSRCS          FROM Q,R AXES RCS AUTOPILOT
060036,000056:                                                                                                  #                      INHINT                  FROM P-AXIS RCS AUTOPILOT
060037,000057:                                                                                                  #                      TC      IBNKCALL
060038,000058:                                                                                                  #                      CADR    SPSRCS
060039,000059: 
060040,000060: 
060041,000061:                                                                                                  #  EXIT:
060042,000062: 
060043,000063:                                                                                                  #           TC     Q
060044,000064:                                                                                                  #  ALARM/ABORT MODE:    NONE
060045,000065: 
060046,000066:                                                                                                  #  SUBROUTINES CALLED:    NONE
060047,000067: 
060048,000068:                                                                                                  #  INPUT:      E, EDOT
060049,000069: 
060050,000070:                                                                                                  #             TJP, TJV, TJU           TJ MUST NOT BE NEGATIVE ZERO
060051,000071: 
060052,000072:                                                                                                  #  OUTPUT:    TJP, TJV, TJU
060053,000073:                                                                                                  #             NUMBERT = 6,            WHEN RATE LIMITING P AXIS.
060054,000074: 
060055,000075: 
060056,000076: 17,3526                                           BANK     17                                    
060057,000077: 17,2000                                           SETLOC   DAPS2                                 
060058,000078: 17,2000                                           BANK                                           
060059,000079: 
060060,000080: 17,3526                                           COUNT*   $$/DAPBU                              
060061,000081: 
060062,000082: 17,3526  E6,1517                                  EBANK=   TJU                                   
060063,000083: 17,3526           31543        SPSRCS             CA       EDOT                                  
060064,000084: 17,3527           00006                           EXTEND                                         
060065,000085: 17,3530           75036                           MP       RATELIM1                              #  OUTER RATE LIMIT = 1.73 DEG/SEC
060066,000086: 17,3531           00006                           EXTEND                                         
060067,000087: 17,3532           13563                           BZF      JTONTEST                              
060068,000088: 
060069,000089: 17,3533           54001                           TS       L                                     
060070,000090: 17,3534           36216                           CA       SIX                                   
060071,000091: 17,3535           55740                           TS       NUMBERT                               
060072,000092: 17,3536           10001                           CCS      L                                     
060073,000093: 17,3537           13617                           TCF      NEGTHRST                              
060074,000094: 17,3540           05726                           TC       CCSHOLE                               #  **TEMP ** FILL WITH A CONSTANT
060075,000095: 17,3541  17,3512               RATELIM2           =        .1AT4                                 #  = OCT 00632,  1.125 DEG/SEC
060076,000096: 17,3541           35011        POSTHRST           CA       HALF                                  
060077,000097: 
060078,000098: 17,3542           51471                           NDX      AXISCTR                               
060079,000099: 17,3543           55517                           TS       TJU                                   
060080,000100: 17,3544           11471                           CCS      AXISCTR                               
060081,000101: 17,3545           13550                           TCF      +3                                    
060082,000102: 17,3546           13550                           TCF      +2                                    
060083,000103: 17,3547           00002                           TC       Q                                     
060084,000104: 
060085,000105: 17,3550           30101                           CA       FLAGWRD5                              
060086,000106: 17,3551           75012                           MASK     SNUFFBIT                              
060087,000107: 17,3552           00006                           EXTEND                                         
060088,000108: 17,3553           12522                           BZF      AFTERTJ    -2                         
060089,000109: 17,3554           31102                           CA       DAPBOOLS                              
060090,000110: 17,3555           75017                           MASK     DRIFTBIT                              
060091,000111: 17,3556           10000                           CCS      A                                     
060092,000112: 17,3557           12522                           TCF      AFTERTJ    -2                         
060093,000113: 
060094,000114: 17,3560           51471                           NDX      AXISCTR                               
060095,000115: 17,3561           55517                           TS       TJU                                   
060096,000116: 17,3562           12522                           TCF      AFTERTJ    -2                         
060097,000117: 
060098,000118: 17,3563           51471        JTONTEST           NDX      AXISCTR                               
060099,000119: 17,3564           11517                           CCS      TJU                                   
060100,000120: 17,3565           13571                           TCF      +4                                    
060101,000121: 17,3566           13603                           TCF      SPSSTART                              
060102,000122: 17,3567           31543                           CA       EDOT                                  
060103,000123: 17,3570           13572                           TCF      +2                                    
060104,000124: 
060105,000125: 17,3571           41543                 +4        CS       EDOT                                  
060106,000126: 17,3572           22000                           LXCH     A                                     
060107,000127: 17,3573           41102                           CS       DAPBOOLS                              #  IF DRIFTBIT = 1, USE ZERO TARGET RATE
060108,000128: 17,3574           75017                           MASK     DRIFTBIT                              #  IF DRIFTBIT = 0, USE 0.10 RATE TARGET
060109,000129: 17,3575           10000                           CCS      A                                     
060110,000130: 17,3576           35037                           CA       RATEDB1                               
060111,000131: 17,3577           60001                           AD       L                                     
060112,000132: 17,3600           00006                           EXTEND                                         
060113,000133: 17,3601           63603                           BZMF     +2                                    
060114,000134: 17,3602           13544                           TCF      POSTHRST   +3                         
060115,000135: 
060116,000136: 17,3603           31543        SPSSTART           CA       EDOT                                  
060117,000137: 17,3604           61542                           AD       E                                     
060118,000138: 17,3605           00006                           EXTEND                                         
060119,000139: 17,3606           71411                           MP       DKDB                                  #  PAD LOADED DEADBAND. FRESHSTART: 1.4 DEG
060120,000140: 17,3607           00006                           EXTEND                                         
060121,000141: 17,3610           13625                           BZF      TJZERO                                
060122,000142: 
060123,000143: 17,3611           00006                           EXTEND                                         
060124,000144: 17,3612           63621                           BZMF     +7                                    
060125,000145: 17,3613           31543                           CA       EDOT                                  
060126,000146: 17,3614           63512                           AD       RATELIM2                              
060127,000147: 17,3615           00006                           EXTEND                                         
060128,000148: 17,3616           63625                           BZMF     TJZERO                                
060129,000149: 17,3617           45011        NEGTHRST           CS       HALF                                  
060130,000150: 17,3620           13542                           TCF      POSTHRST   +1                         
060131,000151: 17,3621           43512                 +7        CS       RATELIM2                              
060132,000152: 17,3622           61543                           AD       EDOT                                  
060133,000153: 17,3623           00006                           EXTEND                                         
060134,000154: 17,3624           63541                           BZMF     POSTHRST                              
060135,000155: 17,3625           35030        TJZERO             CA       ZERO                                  
060136,000156: 17,3626           13542                           TCF      POSTHRST   +1                         
060137,000157: 
060138,000158: 
060139,000159: 17,3627     5036               RATELIM1           =        CALLCODE                              #  = 00032, CORRESPONDING TO 1.73 DEG/SEC
060140,000160: 17,3627     5037               RATEDB1            =        TBUILDFX                              #   = 00045, CORRESPONDS TO 0.101 DEG/SEC

End of include-file SPS_BACK-UP_RCS_CONTROL.agc.  Parent file is MAIN.agc