Source Code

014176,000002: ## Copyright: Public domain. 014177,000003: ## Filename: INFLIGHT_ALIGNMENT_PROGRAM.agc 014178,000004: ## Purpose: Part of the source code for Solarium build 55. This 014179,000005: ## is for the Command Module's (CM) Apollo Guidance 014180,000006: ## Computer (AGC), for Apollo 6. 014181,000007: ## Assembler: yaYUL --block1 014182,000008: ## Contact: Jim Lawton <jim DOT lawton AT gmail DOT com> 014183,000009: ## Website: www.ibiblio.org/apollo/index.html 014184,000010: ## Page Scans: www.ibiblio.org/apollo/ScansForConversion/Solarium055/ 014185,000011: ## Mod history: 2009-10-03 JL Created. 014186,000012: ## 2016-12-28 RSB Proofed comment text using octopus/ProoferComments, 014187,000013: ## and fixed errors found. 014188,000014:

Page 366

014190,000016: 
014191,000017: 22,6000                                           SETLOC   44000                                 
014192,000018: 
014193,000019: 22,6000           34475        SWAYSTAT           CAF      SIX                                   #  PROGRAM START AND INITIAL CONDITIONS
014194,000020: 22,6001           51100                           TS       DTCOUNT                               #  SET DTCOUNT = 6
014195,000021: 22,6002           51101                           TS       DTCOUNT    +1                         
014196,000022: 22,6003           34516                           CAF      ONE                                   
014197,000023: 22,6004           51102                           TS       SWAYPULS                              #  SET FIRST PIPA PULSE = +1
014198,000024: 22,6005           51103                           TS       SWAYPULS   +1                         
014199,000025: 22,6006           34516                           CAF      ONE                                   
014200,000026: 22,6007           02173                           TC       WAITLIST                              
014201,000027: 22,6010           44024                           CADR     SWAYROTY                              
014202,000028: 22,6011           34516                           CAF      ONE                                   
014203,000029: 22,6012           61104                           AD       PHAZING                               
014204,000030: 22,6013           02173                           TC       WAITLIST                              
014205,000031: 22,6014           44017                           CADR     SWAYROTZ                              
014206,000032: 22,6015           20016                           RELINT                                         
014207,000033: 22,6016           02124                           TC       ENDOFJOB                              
014208,000034: 
014209,000035: 
014210,000036: 
014211,000037: 22,6017           30003        SWAYROTZ           XCH      LP                                    #  STORE LP IN LPRUPT
014212,000038: 22,6020           30032                           XCH      LPRUPT                                
014213,000039: 22,6021           34516                           CAF      ONE                                   #  SET INDEX PIPSLECT FOR SELECTION OF
014214,000040: 22,6022           51111                           TS       PIPSLECT                              #  PIPA TO BE INCREMENTED
014215,000041: 22,6023           06030                           TC       SWAYROTY   +4                         
014216,000042: 
014217,000043: 22,6024           30003        SWAYROTY           XCH      LP                                    
014218,000044: 22,6025           30032                           XCH      LPRUPT                                
014219,000045: 22,6026           35501                           CAF      ZERO                                  
014220,000046: 22,6027           51111                           TS       PIPSLECT                              
014221,000047: 
014222,000048: 22,6030           45501                           CS       ZERO                                  
014223,000049: 22,6031           21111                           INDEX    PIPSLECT                              
014224,000050: 22,6032           30045                           XCH      PIPAY                                 
014225,000051: 22,6033           21111                           INDEX    PIPSLECT                              
014226,000052: 22,6034           61102                           AD       SWAYPULS                              
014227,000053: 22,6035           21111                           INDEX    PIPSLECT                              
014228,000054: 22,6036           30045                           XCH      PIPAY                                 
014229,000055: 22,6037           10000                           CCS      A                                     
014230,000056: 22,6040           64516                           AD       ONE                                   #  INCREMENT PIPA COUNTER IF PULSE
014231,000057: 22,6041           06045                           TC       ADDINC     +1                         
014232,000058: 22,6042           06044                           TC       ADDINC                                
014233,000059: 22,6043           06051                           TC       ENDCHEC                               
014234,000060: 
014235,000061: 
014236,000062: 
014237,000063: 22,6044           44516        ADDINC             CS       ONE                                   
014238,000064: 22,6045           21111                           INDEX    PIPSLECT                              
014239,000065: 22,6046           60045                           AD       PIPAY                                 
014240,000066: 22,6047           21111                           INDEX    PIPSLECT                              

Page 367

014242,000068: 22,6050           30045                           XCH      PIPAY                                 
014243,000069: 
014244,000070: 
014245,000071: 
014246,000072: 22,6051           11105        ENDCHEC            CCS      ENDSROT                               #  IF ENDSROT = +1 EXIT PROGRAM
014247,000073: 22,6052           06055                           TC       CDTTHREE                              #  WHEN DTCOUNT = 6
014248,000074: 22,6053           06065                           TC       TIMCALC                               
014249,000075: 22,6054           06055                           TC       CDTTHREE                              
014250,000076: 22,6055           44475        CDTTHREE           CS       SIX                                   
014251,000077: 22,6056           21111                           INDEX    PIPSLECT                              
014252,000078: 22,6057           61100                           AD       DTCOUNT                               
014253,000079: 22,6060           10000                           CCS      A                                     
014254,000080: 22,6061           06065                           TC       TIMCALC                               #  EXIT ON DTCOUNT = 6
014255,000081: 22,6062           06124                           TC       ENDSWAY                               
014256,000082: 22,6063           06065                           TC       TIMCALC                               
014257,000083: 22,6064           06124                           TC       ENDSWAY                               
014258,000084: 
014259,000085: 
014260,000086: 
014261,000087: 22,6065           21111        TIMCALC            INDEX    PIPSLECT                              
014262,000088: 22,6066           11100                           CCS      DTCOUNT                               
014263,000089: 22,6067           06100                           TC       DIMCOUNT                              #  ACC NOW CONTAINS DTCOUNT - 1
014264,000090: 22,6070           06073                           TC       ALTPULSS                              #  IF DTCOUNT NORZ CHANGE
014265,000091: 22,6071           06073                           TC       ALTPULSS                              #  SIGN OF SWAYPULSE
014266,000092: 22,6072           30000                           NOOP                                           
014267,000093: 22,6073           21111        ALTPULSS           INDEX    PIPSLECT                              
014268,000094: 22,6074           41102                           CS       SWAYPULS                              
014269,000095: 22,6075           21111                           INDEX    PIPSLECT                              
014270,000096: 22,6076           51102                           TS       SWAYPULS                              
014271,000097: 22,6077           33535                           CAF      THIRTEEN                              #  AND RESTART DTCOUNT AT 13
014272,000098: 22,6100           21111        DIMCOUNT           INDEX    PIPSLECT                              
014273,000099: 22,6101           51100                           TS       DTCOUNT                               #  DTCOUNT NOW DIMINISHED BY ONE
014274,000100:                                                                                                  #  OR RESET TO 13
014275,000101: 22,6102           21111                           INDEX    PIPSLECT                              
014276,000102: 22,6103           21100                           INDEX    DTCOUNT                               #  SELECT APPROPRIATE DELTA T FROM LIST
014277,000103: 22,6104           36130                           CAF      DELTA                                 
014278,000104: 22,6105           25777                           EXTEND                                         
014279,000105: 22,6106           41110                           MP       TPERIOD                               #  AND MULTIPLY BY PERIOD
014280,000106: 22,6107           64477                           AD       FIVE                                  #  ROUND RESULT
014281,000107: 22,6110           25777                           EXTEND                                         
014282,000108: 22,6111           46146                           MP       ONETENTH                              
014283,000109: 22,6112           50575                           TS       RUPTSTOR   +3                         #  TIME (DT) TILL NEXT INTERRUPT 10MS
014284,000110: 22,6113           11111        NEXTRUPT           CCS      PIPSLECT                              
014285,000111: 22,6114           06121                           TC       ZPIPRUPT                              #  CALL WAITLIST FOR ZPIPA
014286,000112: 22,6115           30575                           XCH      RUPTSTOR   +3                         
014287,000113: 22,6116           02173                           TC       WAITLIST                              #  CALL WAITLIST FOR YPIPA
014288,000114: 22,6117           44024                           CADR     SWAYROTY                              
014289,000115: 22,6120           06124                           TC       ENDSWAY                               
014290,000116: 
014291,000117: 22,6121           30575        ZPIPRUPT           XCH      RUPTSTOR   +3                         

Page 368

014293,000119: 22,6122           02173                           TC       WAITLIST                              
014294,000120: 22,6123           44017                           CADR     SWAYROTZ                              
014295,000121: 22,6124           30032        ENDSWAY            XCH      LPRUPT                                #  REPLACE LP
014296,000122: 22,6125           25777                           EXTEND                                         
014297,000123: 22,6126           44516                           MP       BIT1                                  
014298,000124: 22,6127           02256                           TC       TASKOVER                              #  END OF SWAY ROUTINE
014299,000125: 

Page 369

014301,000127: 
014302,000128:                                                                                                  #  MEMORY ASSIGNMENTS
014303,000129: 
014304,000130: 
014305,000131: 
014306,000132: 22,6130     1100               DTCOUNT            EQUALS   AMEMORY                               #  YPIPA STATE COUNTER (0-7)
014307,000133: 22,6130     1102               SWAYPULS           EQUALS   AMEMORY    +2                         #  NEXT YPIPA PULSE (+1,-1)
014308,000134: 22,6130     1104               PHAZING            EQUALS   AMEMORY    +4                         #  TIME DELAY FOR ZPIPA START
014309,000135:                                                                                                  #  INITIALIZED BY KEYBOARD
014310,000136:                                                                                                  #  +XXXXX. E-2 SEC
014311,000137:                                                                                                  #  MUST BE GREATER THAN 00001
014312,000138: 22,6130     1105               ENDSROT            EQUALS   AMEMORY    +5                         #  FLAG FOR PROGRAM EXIT
014313,000139:                                                                                                  #  SET BY KEYBOARD
014314,000140:                                                                                                  #  = 00001. TO END SWAYROUTINE
014315,000141:                                                                                                  #  = +00000. TO CONTINUE
014316,000142: 22,6130     1110               TPERIOD            EQUALS   AMEMORY    +8D                        #  PERIOD OF SWAY
014317,000143:                                                                                                  #  SET BY KEYBOARD
014318,000144:                                                                                                  #  = XX.XXX SEC
014319,000145: 22,6130     1111               PIPSLECT           EQUALS   AMEMORY    +9D                        #  INDEX FOR PIPA SELECTION
014320,000146: 22,6130           01602        DELTA              DEC      .05482                                #  DELTA  TO
014321,000147: 22,6131           01064                           DEC      .03444                                #  1
014322,000148: 22,6132           00720                           DEC      .02833                                #  2
014323,000149: 22,6133           00636                           DEC      .02528                                #  3
014324,000150: 22,6134           00602                           DEC      .02356                                #  4
014325,000151: 22,6135           00562                           DEC      .02259                                #  5
014326,000152: 22,6136           00553                           DEC      .02213                                #  6
014327,000153: 22,6137           00553                           DEC      .02213                                #  7
014328,000154: 22,6140           00562                           DEC      .02259                                #  8
014329,000155: 22,6141           00602                           DEC      .02356                                #  9
014330,000156: 22,6142           00636                           DEC      .02528                                #  10
014331,000157: 22,6143           00720                           DEC      .02833                                #  11
014332,000158: 22,6144           01064                           DEC      .03444                                #  12
014333,000159: 22,6145           04173                           DEC      .1325                                 #  13
014334,000160: 22,6146           03146        ONETENTH           DEC      E-1        B-14                       
014335,000161: 

Page 370

014337,000163: 
014338,000164:                                                                                                  #  VERIFICATION ASSISTANVE FOR INFLIGHT
014339,000165: 
014340,000166: 
014341,000167: 
014342,000168: 22,6147           04000        MYTEST             TC       INTPRET                               #                                        456
014343,000169: 22,6150           45176                           DMOVE    0                                     #                                        356
014344,000170: 22,6151           05174                                    ZERODP                                #  SET ANGLES TO ZERO AND TEST           256
014345,000171: 22,6152           33523                           STORE    IGC                                   #                                        156
014346,000172: 
014347,000173: 22,6153           47576                           NOLOD    0                                     #                                        056
014348,000174: 22,6154           33525                           STORE    MGC                                   #                                        -56
014349,000175: 
014350,000176: 22,6155           47576                           NOLOD    0                                     #                                        +56
014351,000177: 22,6156           33521                           STORE    OGC                                   
014352,000178: 
014353,000179: 22,6157           76776                           ITC      0                                     
014354,000180: 22,6160           04262                                    DOTEST                                
014355,000181: 
014356,000182: 22,6161           47176                           COMP     0                                     #  SET ANGLES TO -HALF AND TEST
014357,000183: 22,6162           05200                                    HALFDP                                
014358,000184: 22,6163           33523                           STORE    IGC                                   
014359,000185: 
014360,000186: 22,6164           47576                           NOLOD    0                                     
014361,000187: 22,6165           33525                           STORE    MGC                                   
014362,000188: 
014363,000189: 22,6166           47576                           NOLOD    0                                     
014364,000190: 22,6167           33521                           STORE    OGC                                   
014365,000191: 
014366,000192: 22,6170           76776                           ITC      0                                     
014367,000193: 22,6171           04262                                    DOTEST                                
014368,000194: 
014369,000195: 22,6172           45175        CHGIGC             DMOVE    1                                     #  CHANGE IGC,MGC, AND OGC AND TEST
014370,000196: 22,6173           70776                           DAD                                            
014371,000197: 22,6174           01317                                    AZIMUTH                               
014372,000198: 22,6175           04256                                    INCRMT                                
014373,000199: 22,6176           33523                           STORE    IGC                                   
014374,000200: 
014375,000201: 22,6177           47576                           NOLOD    0                                     
014376,000202: 22,6200           33317                           STORE    AZIMUTH                               
014377,000203: 
014378,000204: 22,6201           66775                           DSU      1                                     
014379,000205: 22,6202           43772                           BPL      ITC                                   
014380,000206: 22,6203           01523                                    IGC                                   
014381,000207: 22,6204           05200                                    HALFDP                                
014382,000208: 22,6205           04260                                    OUT                                   
014383,000209: 22,6206           04262                                    DOTEST                                
014384,000210: 
014385,000211: 22,6207           45175        CHGMGC             DMOVE    1                                     #  CHANGE MGC AND OGC AND TEST
014386,000212: 22,6210           70776                           DAD                                            
014387,000213: 22,6211           01321                                    GYROCSW                               

Page 371

014389,000215: 22,6212           04256                                    INCRMT                                
014390,000216: 22,6213           33525                           STORE    MGC                                   
014391,000217: 
014392,000218: 22,6214           47576                           NOLOD    0                                     
014393,000219: 22,6215           33321                           STORE    GYROCSW                               
014394,000220: 
014395,000221: 22,6216           66775                           DSU      1                                     
014396,000222: 22,6217           43772                           BPL      ITC                                   
014397,000223: 22,6220           01525                                    MGC                                   
014398,000224: 22,6221           05200                                    HALFDP                                
014399,000225: 22,6222           04251                                    RESETM                                
014400,000226: 22,6223           04262                                    DOTEST                                
014401,000227: 
014402,000228: 22,6224           45175        CHGOGC             DMOVE    1                                     #  RESET OGC AND TEST
014403,000229: 22,6225           70776                           DAD                                            
014404,000230: 22,6226           01323                                    PRELXGA                               
014405,000231: 22,6227           04256                                    INCRMT                                
014406,000232: 22,6230           33521                           STORE    OGC                                   
014407,000233: 
014408,000234: 22,6231           47576                           NOLOD    0                                     
014409,000235: 22,6232           33323                           STORE    PRELXGA                               
014410,000236: 
014411,000237: 22,6233           66775                           DSU      1                                     
014412,000238: 22,6234           43772                           BPL      ITC                                   
014413,000239: 22,6235           01521                                    OGC                                   
014414,000240: 22,6236           05200                                    HALFDP                                
014415,000241: 22,6237           04244                                    RESETO                                
014416,000242: 22,6240           04262                                    DOTEST                                
014417,000243: 
014418,000244: 22,6241           76776                           ITC      0                                     
014419,000245: 22,6242           04225                                    CHGOGC                                
014420,000246: 
014421,000247: 22,6243           47176        RESETO             COMP     0                                     #  RESET OGC TO-HALF
014422,000248: 22,6244           05200                                    HALFDP                                #  LOOP TO CHGMGC
014423,000249: 22,6245           33323                           STORE    PRELXGA                               
014424,000250: 
014425,000251: 22,6246           76776                           ITC      0                                     
014426,000252: 22,6247           04210                                    CHGMGC                                
014427,000253: 
014428,000254: 22,6250           47176        RESETM             COMP     0                                     #  RESET MGC TO -HALF
014429,000255: 22,6251           05200                                    HALFDP                                #  LOOP TO CHGIGC
014430,000256: 22,6252           33321                           STORE    GYROCSW                               
014431,000257: 
014432,000258: 22,6253           76776                           ITC      0                                     
014433,000259: 22,6254           04173                                    CHGIGC                                
014434,000260: 
014435,000261: 22,6255           06314 31463  INCRMT             2DEC     .20                                   
014436,000262: 
014437,000263: 22,6257           77576        OUT                EXIT     0                                     #  END OF MAIN
014438,000264: 22,6260           02124        LASTWORD           TC       ENDOFJOB                              

Page 372

014440,000266: 
014441,000267: 22,6261           45575        DOTEST             ITA      1                                     
014442,000268: 22,6262           75172                           VMOVE    ITC                                   
014443,000269: 22,6263           01315                                    LATITUDE                              
014444,000270: 22,6264           15573                                    UNITX                                 
014445,000271: 22,6265           04313                                    MYROT                                 
014446,000272: 
014447,000273: 22,6266           47576                           NOLOD    0                                     
014448,000274: 22,6267           33403                           STORE    STARAD                                
014449,000275: 
014450,000276: 22,6270           75175                           VMOVE    1                                     
014451,000277: 22,6271           76776                           ITC                                            
014452,000278: 22,6272           15601                                    UNITY                                 
014453,000279: 22,6273           04313                                    MYROT                                 
014454,000280: 
014455,000281: 22,6274           47576                           NOLOD    0                                     
014456,000282: 22,6275           33411                           STORE    STARAD     +6D                        
014457,000283: 
014458,000284: 22,6276           75176                           VMOVE    0                                     
014459,000285: 22,6277           15573                                    UNITX                                 
014460,000286: 22,6300           32007                           STORE    6D                                    
014461,000287: 
014462,000288: 22,6301           75176                           VMOVE    0                                     
014463,000289: 22,6302           15601                                    UNITY                                 
014464,000290: 22,6303           32015                           STORE    12D                                   
014465,000291: 
014466,000292: 22,6304           76776                           ITC      0                                     
014467,000293: 22,6305           04761                                    AXISGEN                               
014468,000294: 
014469,000295: 22,6306           76776                           ITC      0                                     #  SEND NEW VECTORS TO CALCGTA
014470,000296: 22,6307           04353                                    CALCGTA                               
014471,000297: 
014472,000298: 22,6310           44576                           ITCI     0                                     
014473,000299: 22,6311           01315                                    LATITUDE                              
014474,000300: 22,6312           45575        MYROT              ITA      1                                     #  INITIALIZE
014475,000301: 22,6313           43411                           TEST     SWITCH                                
014476,000302: 22,6314           00052                                    S2                                    
014477,000303: 22,6315           00006                                    NBSMBIT                               
014478,000304: 22,6316           04321                                    MYROT1                                
014479,000305: 22,6317           00006                                    NBSMBIT                               
014480,000306: 
014481,000307: 22,6320           75575        MYROT1             AXT,1    1                                     #  ROTATE X,Z  ABOUT  Y
014482,000308: 22,6321           74423                           AXT,2    DMOVE                                 
014483,000309: 22,6322           00005                                    4                                     
014484,000310: 22,6323           00001                                    0                                     
014485,000311: 22,6324           01523                                    IGC                                   
014486,000312: 22,6325           32037                           STORE    30D                                   
014487,000313: 
014488,000314: 22,6326           76776                           ITC      0                                     
014489,000315: 22,6327           04566                                    ACCUROT                               

Page 373

014491,000317: 22,6330           75575                           AXT,1    1                                     #   ROTATE X,Y  ABOUT  Z
014492,000318: 22,6331           74423                           AXT,2    DMOVE                                 
014493,000319: 22,6332           00003                                    2                                     
014494,000320: 22,6333           00005                                    4                                     
014495,000321: 22,6334           01525                                    MGC                                   
014496,000322: 22,6335           32037                           STORE    30D                                   
014497,000323: 
014498,000324: 22,6336           76776                           ITC      0                                     
014499,000325: 22,6337           04566                                    ACCUROT                               
014500,000326: 
014501,000327: 22,6340           75575                           AXT,1    1                                     #  ROTATE  Z,Y ABOUT  X
014502,000328: 22,6341           74423                           AXT,2    DMOVE                                 
014503,000329: 22,6342           00001                                    0                                     
014504,000330: 22,6343           00003                                    2                                     
014505,000331: 22,6344           01521                                    OGC                                   
014506,000332: 22,6345           32037                           STORE    30D                                   
014507,000333: 
014508,000334: 22,6346           76776                           ITC      0                                     
014509,000335: 22,6347           04566                                    ACCUROT                               
014510,000336: 
014511,000337: 22,6350           44576                           ITCI     0                                     
014512,000338: 22,6351           00052                                    S2                                    

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