Source Code
These source-code files are part of a reconstructed copy of Skylark 048, the
Block II Command Module (CM) Apollo Guidance Computer (AGC) software for the
Skylab-2, Skylab-3, Skylab-4, and Apollo-Soyuz Test Project missions.
They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on Skylab-2, part numbers 2010802-541, 2010802-551, 2010802-561, 2010802-571, 2010802-581, and 2010802-591. Access to these modules was provided by the New Mexico Museum of Space History, who we are much indebted to. The source code for the Apollo 15, 16, and 17 software, Artemis 072, was used as a starting point. Heavy use was made of TRW 4900.5-244, Programmed Guidance Equations for Skylark Command Module Earth Orbital Program, dated 14 February 1972. This document contains pseudocode of essentially all of Skylark, using original program labels which have been copied for this source reconstruction. Since only binary dumps (rather than listings) of Skylark are available as source material, all comments and labels are approximate. They have been taken from the Programmed Guidance Equations or other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
050354,000002: ## Copyright: Public domain.
050355,000003: ## Filename: MEASUREMENT_INCORPORATION.agc
050356,000004: ## Purpose: A section of Skylark revision 048.
050357,000005: ## It is part of the source code for the Apollo Guidance Computer (AGC)
050358,000006: ## for Skylab-2, Skylab-3, Skylab-4, and ASTP. No original listings of
050359,000007: ## this software are available; instead, this file was created via
050360,000008: ## disassembly of dumps of the core rope modules actually flown on
050361,000009: ## Skylab-2. Access to these modules was provided by the New Mexico
050362,000010: ## Museum of Space History.
050363,000011: ## Assembler: yaYUL
050364,000012: ## Contact: Ron Burkey <info@sandroid.org>.
050365,000013: ## Website: www.ibiblio.org/apollo/index.html
050366,000014: ## Mod history: 2023-09-04 MAS Created from Artemis 072.
050367,000015: ## 2024-03-04 MAS Updated for Skylark 48.
050368,000016:
050369,000017: # INCORP1--PERFORMS THE SIX DIMENSIONAL STATE VECTOR DEVIATION FOR POSITI
050370,000018: # ON AND VELOCITY OR THE NINE DIMENSIONAL DEVIATION OF POSITION,VELOCITY,A
050371,000019: # ND RADAR OR LANDMARK BIAS.THE OUTPUT OF THE BVECTOR ROUTINE ALONG WITH T
050372,000020: # HE ERROR TRANSITION MATRIX(W) ARE USED AS INPUT TO THE ROUTINE.THE DEVIA
050373,000021: # TION IS OBTAINED BY COMPUTING AN ESTIMATED TRACKING MEASUREMENT FROM THE
050374,000022: # CURRENT STATE VECTOR AND COMPARING IT WITH AN ACTUAL TRACKING MEASUREMEN
050375,000023: # T AND APPLYING A STATISTICAL WEIGHTING VECTOR.
050376,000024:
050377,000025: # INPUT
050378,000026: # W = ERROR TRANSITION MATRIX 6X6
050379,000027: # VARIANCE = VARIANCE (SCALAR)
050380,000028: # DELTAQ = MEASURED DEVIATION (SCALAR)
050381,000029: # BVECTOR = 6 DIMENSIONAL BVECTOR
050382,000030:
050383,000031: # OUTPUT
050384,000032: # DELTAX = STATE VECTOR DEVIATIONS 6 DIMENSIONAL
050385,000033: # ZI = VECTOR USED FOR THE INCORPORATION 6 DIMENSIONAL
050386,000034: # GAMMA = SCALAR
050387,000035: # OMEGA = OMEGA WEIGHTING VECTOR 6 DIMENTIONAL
050388,000036:
050389,000037: # CALLING SEQUENCE
050390,000038: # L CALL INCORP1
050391,000039:
050392,000040: # NORMAL EXIT
050393,000041: # L+1 OF CALLING SEQUENCE
050394,000042:
050395,000043: 36,2000 SETLOC MEASINC
050396,000044: 36,2000 BANK
050397,000045:
050398,000046: 36,2775 COUNT* $$/INCOR
050399,000047:
050400,000048: 36,2775 E5,1400 EBANK= W
050401,000049:
050402,000050: 36,2775 77620 INCORP1 STQ
050403,000051: 36,2776 02200 EGRESS
050404,000052: 36,2777 66370 AXT,1 SSP
050405,000053: 36,3000 00044 36D
050406,000054: 36,3001 00051 S1
050407,000055: 36,3002 00022 18D # IX1 = 36 S1= 18
050408,000056: 36,3003 66374 AXT,2 SSP
050409,000057: 36,3004 00014 12D
050410,000058: 36,3005 00052 S2
050411,000059: 36,3006 00006 6 # IX2 = 12 S2=6
050412,000060: 36,3007 63775 Z123 VLOAD MXV*
050413,000061: 36,3010 03466 BVECTOR # BVECTOR (0)
050414,000062: 36,3011 02445 W +36D,1
050415,000063: 36,3012 12701 STORE ZI +12D,2
050416,000064: 36,3013 77775 VLOAD
050417,000065: 36,3014 03474 BVECTOR +6 # BVECTOR (1)
050418,000066: 36,3015 52717 MXV* VAD*
050419,000067: 36,3016 02533 W +90D,1
050420,000068: 36,3017 75076 ZI +12D,2
050421,000069: 36,3020 12701 STORE ZI +12D,2
050422,000070: 36,3021 77700 TIX,1
050423,000071: 36,3022 75023 INCOR1
050424,000072: 36,3023 77704 INCOR1 TIX,2
050425,000073: 36,3024 75007 Z123 # LOOP FOR Z1,Z2,Z3
050426,000074: 36,3025 77201 INCOR1A SETPD VLOAD
050427,000075: 36,3026 00001 0
050428,000076: 36,3027 02665 ZI
050429,000077: 36,3030 47036 VSQ RTB
050430,000078: 36,3031 45640 TPMODE
050431,000079: 36,3032 47515 PDVL VSQ
050432,000080: 36,3033 02673 ZI +6
050433,000081: 36,3034 76234 RTB TAD
050434,000082: 36,3035 45640 TPMODE
050435,000083: 36,3036 77171 TAD AXT,2
050436,000084: 36,3037 03504 VARIANCE
050437,000085: 36,3040 00000 0
050438,000086: 36,3041 01074 STORE TRIPA # ZI*2 + Z2*2 + Z3*2 + VARIANCE
050439,000087: 36,3042 40151 TLOAD BOV
050440,000088: 36,3043 03504 VARIANCE # CLEAR OVFIND
050441,000089: 36,3044 75045 +1
050442,000090: 36,3045 01077 STORE TEMPVAR # TEMP STORAGE FOR VARIANCE
050443,000091: 36,3046 77654 BZE
050444,000092: 36,3047 75056 INCOR1C
050445,000093: 36,3050 40112 INCOR1B SL2 BOV
050446,000094: 36,3051 75056 INCOR1C
050447,000095: 36,3052 01077 STORE TEMPVAR
050448,000096: 36,3053 52114 INCR,2 GOTO
050449,000097: 36,3054 00001 DEC 1 B-14
050450,000098: 36,3055 75050 INCOR1B
050451,000099: 36,3056 61551 INCOR1C TLOAD ROUND
050452,000100: 36,3057 01074 TRIPA
050453,000101: 36,3060 75405 DMP SQRT
050454,000102: 36,3061 01077 TEMPVAR
050455,000103: 36,3062 76257 SL* TAD
050456,000104: 36,3063 57576 0,2
050457,000105: 36,3064 01074 TRIPA
050458,000106: 36,3065 63101 NORM INCR,2
050459,000107: 36,3066 00050 X2
050460,000108: 36,3067 77775 DEC -2 B-14
050461,000109: 36,3070 77134 SXA,2 AXT,2
050462,000110: 36,3071 02116 NORMGAM # NORMALIZATION COUNT -2 FOR GAMMA
050463,000111: 36,3072 00154 108D
050464,000112: 36,3073 40265 BDDV SETPD
050465,000113: 36,3074 15174 DP1/4TH
050466,000114: 36,3075 00001 0
050467,000115: 36,3076 03450 STORE GAMMA
050468,000116: 36,3077 60351 TLOAD NORM
050469,000117: 36,3100 01074 TRIPA
050470,000118: 36,3101 00047 X1
050471,000119: 36,3102 65345 DLOAD PDDL # PD 0-1 = NORM (A)
050472,000120: 36,3103 00155 MPAC
050473,000121: 36,3104 03502 DELTAQ
050474,000122: 36,3105 77701 NORM
050475,000123: 36,3106 00051 S1
050476,000124: 36,3107 70460 XSU,1 SR1
050477,000125: 36,3110 00050 S1
050478,000126: 36,3111 41471 DDV PUSH # PD 0-1 = DELTAQ/A
050479,000127: 36,3112 77650 GOTO
050480,000128: 36,3113 62642 NEWZCOMP
050481,000129: 36,3114 77731 -3 SSP
050482,000130: 36,3115 00052 S2
050483,000131: 36,3116 00066 54D
050484,000132: 36,3117 60775 INCOR2 VLOAD VXM* # COMPUTE OMEGA1,2,3
050485,000133: 36,3120 02665 ZI
050486,000134: 36,3121 75222 W +108D,2
050487,000135: 36,3122 77206 PUSH VLOAD
050488,000136: 36,3123 02673 ZI +6
050489,000137: 36,3124 53303 VXM* VAD
050490,000138: 36,3125 75200 W +126D,2
050491,000139: 36,3126 61006 PUSH TIX,2 # PD 2-7=OMEGA1,8-13=OMEGA2,14-19=OMEGA3
050492,000140: 36,3127 75117 INCOR2
050493,000141: 36,3130 45575 VLOAD STADR
050494,000142: 36,3131 74317 STORE OMEGA +6
050495,000143: 36,3132 45575 VLOAD STADR
050496,000144: 36,3133 74325 STORE OMEGA
050497,000145: 36,3134 66374 INCOR2AB AXT,2 SSP
050498,000146: 36,3135 00014 12D
050499,000147: 36,3136 00052 S2
050500,000148: 36,3137 00006 6
050501,000149: 36,3140 77773 INCOR3 VLOAD*
050502,000150: 36,3141 74311 OMEGA +12D,2
050503,000151: 36,3142 53761 VXSC VSL*
050504,000152: 36,3143 00001 0 # DELTAQ/A
050505,000153: 36,3144 20201 0,1
050506,000154: 36,3145 11110 STORE DELTAX +12D,2
050507,000155: 36,3146 77304 TIX,2 VLOAD
050508,000156: 36,3147 75140 INCOR3
050509,000157: 36,3150 01102 DELTAX +6
050510,000158: 36,3151 77732 VSL3
050511,000159: 36,3152 01102 STORE DELTAX +6
050512,000160: 36,3153 77650 GOTO
050513,000161: 36,3154 02200 EGRESS
050514,000162:
050515,000163: # INCORP2 - INCORPORATES THE COMPUTED STATE VECTOR DEVIATIONS INTO THE
050516,000164: # ESTIMATED STATE VECTOR. THE STATE VECTOR UPDATED MAY BE FOR EITHER THE
050517,000165: # LEM OR THE CSM. DETERMINED BY FLAG VEHUPFLG. (ZERO = LEM) (1 = CSM)
050518,000166:
050519,000167: # INPUT
050520,000168: # PERMANENT STATE VECTOR FOR EITHER THE LEM OR CSM
050521,000169: # VEHUPFLG = UPDATE VEHICLE 0=LEM 1=CSM
050522,000170: # W = ERROR TRANSITION MATRIX
050523,000171: # DELTAX = COMPUTED STATE VECTOR DEVIATIONS
050524,000172: # GAMMA = SCALAR FOR INCORPORATION
050525,000173: # ZI = VECTOR USED IN INCORPORATION
050526,000174: # OMEGA = WEIGHTING VECTOR
050527,000175:
050528,000176: # OUTPUT
050529,000177: # UPDATED PERMANENT STATE VECTOR
050530,000178:
050531,000179: # CALLING SEQUENCE
050532,000180: # L CALL INCORP2
050533,000181:
050534,000182: # NORMAL EXIT
050535,000183: # L+1 OF CALLING SEQUENCE
050536,000184:
050537,000185:
050538,000186: 36,2000 SETLOC MEASINC1
050539,000187: 36,2000 BANK
050540,000188:
050541,000189: 36,3155 COUNT* $$/INCOR
050542,000190:
050543,000191: 36,3155 45020 INCORP2 STQ CALL
050544,000192: 36,3156 02200 EGRESS
050545,000193: 36,3157 11720 INTSTALL
050546,000194: 36,3160 74375 VLOAD VXSC # CALC. GAMMA * OMEGA1,2,3
050547,000195: 36,3161 03452 OMEGA
050548,000196: 36,3162 03450 GAMMA
050549,000197: 36,3163 26635 STOVL OMEGAM1
050550,000198: 36,3164 03460 OMEGA +6
050551,000199: 36,3165 77761 VXSC
050552,000200: 36,3166 03450 GAMMA
050553,000201: 36,3167 02643 STORE OMEGAM2
050554,000202: 36,3170 77776 EXIT
050555,000203: 36,3171 33372 CAF 36DD # INITIAL IX 1 SETTING FOR W MATRIX
050556,000204: 36,3172 55067 TS WIXA
050557,000205: 36,3173 55070 TS WIXB
050558,000206: 36,3174 35003 CAF ZERO
050559,000207: 36,3175 55071 TS ZIXA # INITIAL IX 2 SETTING FOR Z COMPONENT
050560,000208: 36,3176 55072 TS ZIXB
050561,000209: 36,3177 05415 FAZA TC PHASCHNG
050562,000210: 36,3200 04022 OCT 04022
050563,000211: 36,3201 07710 TC UPFLAG
050564,000212: 36,3202 00230 ADRES REINTFLG
050565,000213: 36,3203 31070 FAZA1 CA WIXB # START FIRST PHASE OF INCORP2
050566,000214: 36,3204 55067 TS WIXA # TO UPDATE 6 OR 9 DIM. W MATRIX IN TEMP
050567,000215: 36,3205 31072 CA ZIXB
050568,000216: 36,3206 55071 TS ZIXA
050569,000217: 36,3207 06006 TC INTPRET
050570,000218: 36,3210 73150 LXA,1 LXA,2
050571,000219: 36,3211 01067 WIXA
050572,000220: 36,3212 01071 ZIXA
050573,000221: 36,3213 70731 SSP DLOAD*
050574,000222: 36,3214 00051 S1
050575,000223: 36,3215 00006 6
050576,000224: 36,3216 75112 ZI,2
050577,000225: 36,3217 60276 DCOMP NORM # CALC UPPER 3X9 PARTITION OF W MATRIX
050578,000226: 36,3220 00052 S2
050579,000227: 36,3221 45161 VXSC CALL
050580,000228: 36,3222 02635 OMEGAM1
050581,000229: 36,3223 75362 FAZA2
050582,000230: 36,3224 77653 VAD*
050583,000231: 36,3225 02445 W +36D,1
050584,000232: 36,3226 02651 STORE HOLDW
050585,000233: 36,3227 57543 DLOAD* DCOMP # CALC MIDDLE 3X9 PARTITION OF W MATRIX
050586,000234: 36,3230 75112 ZI,2
050587,000235: 36,3231 74301 NORM VXSC
050588,000236: 36,3232 00052 S2
050589,000237: 36,3233 02643 OMEGAM2
050590,000238: 36,3234 77624 CALL
050591,000239: 36,3235 75362 FAZA2
050592,000240: 36,3236 77653 VAD*
050593,000241: 36,3237 02533 W +90D,1
050594,000242: 36,3240 02657 STORE HOLDW +6
050595,000243: 36,3241 77624 FAZB CALL
050596,000244: 36,3242 57046 GRP2PC
050597,000245: 36,3243 77776 EXIT
050598,000246: 36,3244 31067 FAZB1 CA WIXA # START 2ND PHASE OF INCORP2 TO TRANSFER
050599,000247: 36,3245 63373 AD 6DD # TEMP REG TO PERM W MATRIX
050600,000248: 36,3246 55070 TS WIXB
050601,000249: 36,3247 31071 CA ZIXA
050602,000250: 36,3250 67701 AD MINUS2
050603,000251: 36,3251 55072 TS ZIXB
050604,000252: 36,3252 06006 TC INTPRET
050605,000253: 36,3253 66350 LXA,1 SSP
050606,000254: 36,3254 01067 WIXA
050607,000255: 36,3255 00051 S1
050608,000256: 36,3256 00006 6
050609,000257: 36,3257 77775 VLOAD
050610,000258: 36,3260 02651 HOLDW
050611,000259: 36,3261 06445 STORE W +36D,1
050612,000260: 36,3262 77775 VLOAD
050613,000261: 36,3263 02657 HOLDW +6
050614,000262: 36,3264 06533 STORE W +90D,1
050615,000263: 36,3265 52100 FAZB2 TIX,1 GOTO
050616,000264: 36,3266 75270 +2
050617,000265: 36,3267 75272 FAZC # DONE WITH W MATRIX. UPDATE STATE VECTOR
050618,000266: 36,3270 77634 RTB
050619,000267: 36,3271 75177 FAZA
050620,000268: 36,3272 77624 FAZC CALL
050621,000269: 36,3273 57046 GRP2PC
050622,000270: 36,3274 47014 BON RTB
050623,000271: 36,3275 00707 VEHUPFLG
050624,000272: 36,3276 75352 DOCSM
050625,000273: 36,3277 11362 MOVEPLEM
050626,000274: 36,3300 77604 FAZAB BOVB
050627,000275: 36,3301 57450 TCDANZIG
050628,000276: 36,3302 54375 VLOAD VSL
050629,000277: 36,3303 01074 DELTAX # B29
050630,000278: 36,3304 20210 7
050631,000279: 36,3305 40055 VAD BOV
050632,000280: 36,3306 01521 TDELTAV
050633,000281: 36,3307 75320 FAZAB1
050634,000282: 36,3310 25521 STOVL TDELTAV
050635,000283: 36,3311 01102 DELTAX +6 # B7
050636,000284: 36,3312 53312 VSL4 VAD
050637,000285: 36,3313 01527 TNUV
050638,000286: 36,3314 77600 BOV
050639,000287: 36,3315 75324 FAZAB2
050640,000288: 36,3316 35527 STCALL TNUV
050641,000289: 36,3317 75332 FAZAB3
050642,000290: 36,3320 53375 FAZAB1 VLOAD VAD
050643,000291: 36,3321 01535 RCV
050644,000292: 36,3322 01074 DELTAX
050645,000293: 36,3323 01535 STORE RCV
050646,000294: 36,3324 53375 FAZAB2 VLOAD VAD
050647,000295: 36,3325 01543 VCV
050648,000296: 36,3326 01102 DELTAX +6
050649,000297: 36,3327 01543 STORE VCV
050650,000298: 36,3330 77624 CALL
050651,000299: 36,3331 23437 RECTIFY
050652,000300: 36,3332 77624 FAZAB3 CALL
050653,000301: 36,3333 57046 GRP2PC
050654,000302: 36,3334 47014 BON RTB
050655,000303: 36,3335 00707 VEHUPFLG
050656,000304: 36,3336 75355 DOCSM1
050657,000305: 36,3337 11347 MOVEALEM
050658,000306: 36,3340 77624 CALL
050659,000307: 36,3341 20245 SVDWN2 # STORE DOWNLINK STATE VECTOR
050660,000308: 36,3342 77624 FAZAB4 CALL
050661,000309: 36,3343 57046 GRP2PC # PHASE CHANGE
050662,000310: 36,3344 66150 FAZAB5 LXA,1 SXA,1
050663,000311: 36,3345 02200 EGRESS
050664,000312: 36,3346 00052 QPRET
050665,000313: 36,3347 77776 EXIT
050666,000314: 36,3350 04666 TC POSTJUMP # EXIT
050667,000315: 36,3351 11731 CADR INTWAKE
050668,000316: 36,3352 52034 DOCSM RTB GOTO
050669,000317: 36,3353 11327 MOVEPCSM
050670,000318: 36,3354 75300 FAZAB
050671,000319: 36,3355 45034 DOCSM1 RTB CALL
050672,000320: 36,3356 11314 MOVEACSM
050673,000321: 36,3357 20226 SVDWN1 # STORE DOWNLINK STATE VECTOR
050674,000322: 36,3360 77650 GOTO
050675,000323: 36,3361 75342 FAZAB4
050676,000324: 36,3362 71124 FAZA2 XCHX,2 LXC,2
050677,000325: 36,3363 00051 S2
050678,000326: 36,3364 00047 X2
050679,000327: 36,3365 53674 XAD,2 VSL*
050680,000328: 36,3366 02116 NORMGAM
050681,000329: 36,3367 57576 0,2
050682,000330: 36,3370 43524 XCHX,2 RVQ
050683,000331: 36,3371 00051 S2
050684,000332: 36,3372 26,3203 ZEROO = ZEROVECS
050685,000333: 36,3372 00044 36DD DEC 36 B-14
050686,000334: 36,3373 77771 6DD DEC -6 B-14
050687,000335: 36,3374 00014 12DD DEC 12 B-14
050688,000336:
050689,000337:
050690,000338: 31,2000 SETLOC MEASINC3
050691,000339: 31,2000 BANK
050692,000340: 31,2642 COUNT* $$/INCOR
050693,000341:
050694,000342: 31,2642 51575 NEWZCOMP VLOAD ABVAL
050695,000343: 31,2643 02665 ZI
050696,000344: 31,2644 24045 STOVL NORMZI
050697,000345: 31,2645 02673 ZI +6
050698,000346: 31,2646 41446 ABVAL PUSH
050699,000347: 31,2647 50025 DSU BMN
050700,000348: 31,2650 00045 NORMZI
050701,000349: 31,2651 62654 +3
050702,000350: 31,2652 45545 DLOAD STADR
050703,000351: 31,2653 77732 STORE NORMZI
050704,000352:
050705,000353: 31,2654 66145 NEWZCMP1 DLOAD SXA,1
050706,000354: 31,2655 00045 NORMZI
050707,000355: 31,2656 00044 NORMZI # SAVE X1
050708,000356: 31,2657 62101 NORM INCR,1
050709,000357: 31,2660 00047 X1
050710,000358: 31,2661 00002 DEC 2 B-14
050711,000359: 31,2662 53775 VLOAD VSL*
050712,000360: 31,2663 02665 ZI
050713,000361: 31,2664 20201 0,1
050714,000362: 31,2665 26665 STOVL ZI
050715,000363: 31,2666 02673 ZI +6
050716,000364: 31,2667 66057 VSL* SXA,1
050717,000365: 31,2670 20201 0,1
050718,000366: 31,2671 00045 NORMZI +1 # SAVE SHIFT
050719,000367: 31,2672 02673 STORE ZI +6D
050720,000368: 31,2673 54150 LXA,1 XSU,1
050721,000369: 31,2674 02116 NORMGAM
050722,000370: 31,2675 00045 NORMZI +1
050723,000371: 31,2676 77660 XSU,1
050724,000372: 31,2677 00045 NORMZI +1
050725,000373: 31,2700 70130 SXA,1 LXC,1
050726,000374: 31,2701 02116 NORMGAM
050727,000375: 31,2702 00045 NORMZI +1
050728,000376: 31,2703 40270 XAD,1 SETPD
050729,000377: 31,2704 00044 NORMZI
050730,000378: 31,2705 00003 2D
050731,000379: 31,2706 77650 GOTO
050732,000380: 31,2707 75114 INCOR2 -3
050733,000381: 31,2710 NORMZI = 36D
End of include-file MEASUREMENT_INCORPORATION.agc. Parent file is MAIN.agc