forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IMU_COMPENSATION_PACKAGE.s
370 lines (307 loc) · 9.16 KB
/
IMU_COMPENSATION_PACKAGE.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
# Copyright: Public domain.
# Filename: IMU_COMPENSATION_PACKAGE.agc
# Purpose: Part of the source code for Colossus 2A, AKA Comanche 055.
# It is part of the source code for the Command Module's (CM)
# Apollo Guidance Computer (AGC), for Apollo 11.
# Assembler: yaYUL
# Contact: Ron Burkey <info@sandroid.org>.
# Website: www.ibiblio.org/apollo.
# Pages: 297-306
# Mod history: 2009-05-08 RSB Adapted from the Colossus249/ file of the
# same name, using Comanche055 page images/
# 2009-05-21 RSB In IRIGZ, PRIO17 corrected to PRIO21.
#
# This source code has been transcribed or otherwise adapted from digitized
# images of a hardcopy from the MIT Museum. The digitization was performed
# by Paul Fjeld, and arranged for by Deborah Douglas of the Museum. Many
# thanks to both. The images (with suitable reduction in storage size and
# consequent reduction in image quality as well) are available online at
# www.ibiblio.org/apollo. If for some reason you find that the images are
# illegible, contact me at info@sandroid.org about getting access to the
# (much) higher-quality images which Paul actually created.
#
# Notations on the hardcopy document read, in part:
#
# Assemble revision 055 of AGC program Comanche by NASA
# 2021113-051. 10:28 APR. 1, 1969
#
# This AGC program shall also be referred to as
# Colossus 2A
# Page 297
BANK 7
SETLOC IMUCOMP
BANK
EBANK= NBDX
COUNT 06/ICOMP
1/PIPA CAF LGCOMP # SAVE EBANK OF CALLING PROGRAM
XCH EBANK
TS MODE
CCS GCOMPSW # BYPASS IF GCOMPSW NEGATIVE
TCF +3
TCF +2
TCF IRIG1 # RETURN
INHINT # ASSURE COMPLETE COMPENSATION OF DELV'S
# FOR DOWNLINK.
1/PIPA1 CAF FOUR # PIPAZ, PIPAY, PIPAX
TS BUF +2
INDEX BUF +2
CA PIPASCF # (P.P.M.) X 2(-9)
EXTEND
INDEX BUF +2
MP DELVX # (PP) X 2(+14) NOW (PIPA PULSES) X 2(+5)
TS Q # SAVE MAJOR PART
CA L # MINOR PART
EXTEND
MP BIT6 # SCALE 2(+9) SHIFT RIGHT 9
INDEX BUF +2
TS DELVX +1 # FRACTIONAL PIPA PULSES SCALED 2(+14)
CA Q # MAJOR PART
EXTEND
MP BIT6 # SCALE 2(+9) SHIFT RIGHT 9
INDEX BUF +2
DAS DELVX # (PIPAI) + (PIPAI)(SF)
INDEX BUF +2
CS PIPABIAS # (PIPA PULSES)/(CS) X 2(-8) *
EXTEND
MP 1/PIPADT # (CS) X 2(+8) NOW (PIPA PULSES) X 2(+0) *
EXTEND
MP BIT1 # SCALE 2(+14) SHIFT RIGHT 14 *
INDEX BUF +2
DAS DELVX # (PIPAI) + (PIPAI)(SFE) - (BIAS)(DELTAT)
CCS BUF +2 # PIPAZ, PIPAY, PIPAX
# Page 298
AD NEG1
TCF 1/PIPA1 +1
NOOP # LESS THAN ZERO IMPOSSIBLE
RELINT
# Page 299
IRIGCOMP TS GCOMPSW # INDICATE COMMANDS 2 PULSES OR LESS.
TS BUF # INDEX COUNTER. IRIGX, IRIGY, IRIGZ.
IRIGX EXTEND
DCS DELVX # (PIPA PULSES) X 2(+14)
DXCH MPAC
CA ADIAX # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
TC GCOMPSUB # -(ADIAX)(PIPAX) (GYRO PULSES) X 2(+14)
EXTEND #
DCS DELVY # (PIPA PULSES) X 2(+14)
DXCH MPAC #
CS ADSRAX # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
TC GCOMPSUB # -(ADSRAX)(PIPAY) (GYRO PULSES) X 2(+14)
# EXTEND # ***
# DCS DELVY # *** (PIPA PULSES) X 2(+14)
# DXCH MPAC # ***
# CA ADOAX # *** (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
# TC GCOMPSUB # *** -(ADOAX)(PIPAZ) (GYRO PULSES) X 2(+14)
CS NBDX # (GYRO PULSES)/(CS) X 2(-3)
TC DRIFTSUB # -(NBDX)(DELTAT) (GYRO PULSES) X 2(+14)
IRIGY EXTEND
DCS DELVY # (PIPA PULSES) X 2(+14)
DXCH MPAC
CA ADIAY # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
TC GCOMPSUB # -(ADIAY)(PIPAY) (GYRO PULSES) X 2(+14)
EXTEND
DCS DELVZ # (PIPA PULSES) X 2(+14)
DXCH MPAC
CS ADSRAY # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
TC GCOMPSUB # +(ADSRAY)(PIPAZ) (GYRO PULSES) X 2(+14)
# EXTEND # ***
# DCS DELVX # *** (PIPA PULSES) X 2(+14)
# DXCH MPAC # ***
# CA ADOAY # *** (GYRO PULSES)/(PIPA PULS) X 2(-3) *
# TC GCOMPSUB # *** -(ADOAY)(/PIPAX) (GYRO PULSES) X 2(+14)
CS NBDY # (GYRO PULSES)/(CS) X 2(-5)
TC DRIFTSUB # -(NBDY)(DELTAT) (GYRO PULSES) X 2(+14)
IRIGZ EXTEND
DCS DELVY # (PIPA PULSES) X 2(-14)
DXCH MPAC
CA ADSRAZ # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
# Page 300
TC GCOMPSUB # -(ADSRAZ)(PIPAY) (GYRO PULSES) X 2(+14)
EXTEND
DCS DELVZ # (PIPA PULSES) X 2(+14)
DXCH MPAC
CA ADIAZ # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
TC GCOMPSUB # -(ADIAZ)(PIPAZ) (GYRO PULSES) X 2(+14)
# EXTEND # ***
# DCS DELVX # *** (PIPA PULSE) X 2(+14)
# DXCH MPAC # ***
# CS ADOAZ # *** (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
# TC GCOMPSUB # *** +(ADOAZ)(PIPAX) (GYRO PULSES) X 2(+14)
CA NBDZ # (GYRO PULSES)/(CS) X 2(-5)
TC DRIFTSUB # +(NBDZ)(DELTAT) (GYRO PULSES) X 2(+14)
# Page 301
CCS GCOMPSW # ARE GYRO COMMANDS GREATER THAN 2 PULSES
TCF +2 # YES
TCF IRIG1 # NO
CA PRIO21 # HIGHER THAN SERVICER -- LESS THAN PRELAUNCH
TC NOVAC
EBANK= NBDX
2CADR 1/GYRO
RELINT
IRIG1 CA MODE # SET EBANK FOR RETURN
TS EBANK
TCF SWRETURN
GCOMPSUB XCH MPAC # ADIA OR ADSRA COEFFICIENT ARRIVES IN A
EXTEND # C(MPAC) = (PIPA PULSES) X 2(+14)
MP MPAC # (GYRO PULSES)/(PIPA PULSE) X 2(-3) *
DXCH VBUF # NOW = (GYRO PULSES) X 2(+11) *
CA MPAC +1 # MINOR PART OF PIPA PULSES
EXTEND
MP MPAC # ADIA OR ADSRA
TS L
CAF ZERO
DAS VBUF # NOW = (GYRO PULSES) X 2(+11) *
CA VBUF # PARTIAL RESULT -- MAJOR
EXTEND
MP BIT12 # SCALE 2(+3) SHIFT RIGHT 3 *
INDEX BUF # RESULT = (GYRO PULSES) X 2(+14)
DAS GCOMP # HI(ADIA)(PIPAI) OR HI(ADSRA)(PIPAI)
CA VBUF +1 # PARTIAL RESULT -- MINOR
EXTEND
MP BIT12 # SCALE 2(+3) SHIFT RIGHT 3 *
TS L
CAF ZERO
INDEX BUF # RESULT = (GYRO PULSES) X 2(+14)
DAS GCOMP # (ADIA)(PIPAI) OR (ADSRA)(PIPAI)
TC Q
# Page 302
DRIFTSUB EXTEND
QXCH BUF +1
EXTEND # C(A) = NBD (GYRO PULSES)/(CS) X 2(-5)
MP 1/PIPADT # (CS) X 2(+8) NO (GYRO PULSES) X 2(+3)
LXCH MPAC +1 # SAVE FOR FRACTIONAL COMPENSATION
EXTEND
MP BIT4 # SCALE 2(+11) SHIFT RIGHT 11
INDEX BUF
DAS GCOMP # HI(NBD)(DELTAT) (GYRO PULSES) X 2(+14)
CA MPAC +1 # NOW MINOR PART
EXTEND
MP BIT4 # SCALE 2(+11) SHIFT RIGHT 11
TS L
CAF ZERO
INDEX BUF # ADD IN FRACTIONAL COMPENSATION
DAS GCOMP # (NBD)(DELTAT) (GYRO PULSES) X 2(+14)
DRFTSUB2 CAF TWO # PIPAX, PIPAY, PIPAZ
AD BUF
XCH BUF
INDEX A
CCS GCOMP # ARE GYRO COMMANDS 1 PULSE OR GREATER
TCF +2 # YES
TC BUF +1 # NO
MASK NEGONE
CCS A # ARE GYRO COMMANDS GREATER THAN 2 PULSES
TS GCOMPSW # YES -- SET GCOMPSW POSITIVE
TC BUF +1 # NO
# Page 303
1/GYRO CAF FOUR # PIPAZ, PIPAY, PIPAX
TS BUF
INDEX BUF # SCALE GYRO COMMANDS FOR IMUPULSE
CA GCOMP +1 # FRACTIONAL PULSES
EXTEND
MP BIT8 # SHIFT RIGHT 7
INDEX BUF
TS GCOMP +1 # FRACTIONAL PULSES SCALED
CAF ZERO # SET GCOMP = 0 FOR DAS INSTRUCTION
INDEX BUF
XCH GCOMP # GYRO PULSES
EXTEND
MP BIT8 # SHIFT RIGHT 7
INDEX BUF
DAS GCOMP # ADD THESE TO FRACTIONAL PULSES ABOVE
CCS BUF # PIPAZ, PIPAY, PIPAX
AD NEG1
TCF 1/GYRO +1
LGCOMP ECADR GCOMP # LESS THAN ZERO IMPOSSIBLE
CAF LGCOMP
TC BANKCALL
CADR IMUPULSE # CALL GYRO TORQUING ROUTINE
TC BANKCALL
CADR IMUSTALL # WAIT FOR PULSES TO GET OUT
TCF ENDOFJOB # TEMPORARY
GCOMP1 CAF FOUR # PIPAZ, PIPAY, PIPAX
TS BUF
INDEX BUF # RESCALE
CA GCOMP +1
EXTEND
MP BIT8 # SHIFT MINOR PART LEFT 7 -- MAJOR PART = 0
INDEX BUF
LXCH GCOMP +1 # BITS 8-14 OF MINOR PART WERE = 0
CCS BUF # PIPAZ, PIPAY, PIPAX
AD NEG1
TCF GCOMP1 +1
V06N30S VN 0630
TCF ENDOFJOB
# Page 304
NBDONLY CCS GCOMPSW # BYPASS IF GCOMPSW NEGATIVE
TCF +3
TCF +2
TCF ENDOFJOB
INHINT
CCS FLAGWRD2 # PREREAD T3RUPT MAY COINCIDE
TCF ENDOFJOB
TCF ENDOFJOB
TCF +1
CA TIME1 # (CS) X 2(+14)
XCH 1/PIPADT # PREVIOUS TIME
RELINT
COM
AD 1/PIPADT
NBD2 CCS A # CALCULATE ELAPSED TIME.
AD ONE # NO TIME1 OVERFLOW
TCF NBD3 # RESTORE TIME DIFFERENCE AND JUMP
TCF +2 # TIME1 OVERFLOW
TCF ENDOFJOB # IF ELAPSED TIME = 0 (DIFFERENCE = -0)
COM # CALCULATE ABSOLUTE DIFFERENCE
AD POSMAX
NBD3 EXTEND # C(A) = DELTAT (CS) X 2(+14)
MP BIT10 # SHIFT RIGHT 5
DXCH VBUF
EXTEND
DCA VBUF
DXCH MPAC # DELTAT NOW SCALED (CS) X 2(+19)
CAF ZERO
TS GCOMPSW # INDICATE COMMANDS 2 PULSES OR LESS.
TS BUF # INDEX X, Y, Z.
CS NBDX # (GYRO PULSES)/(CS) X 2(-5)
TC FBIASSUB # -(NBOX)(DELTAT) (GYRO PULSES) X 2(+14)
EXTEND
DCS VBUF
DXCH MPAC # DELTAT SCALED (CS) X 2(+19)
CA NBDY # (GYRO PULSES)/(CS) X 2(-5)
TC FBIASSUB # -(NBDY)(DELTAT) (GYRO PULSES) X 2(+14)
EXTEND
DCS VBUF
DXCH MPAC # DELTAT SCALED (CS) X 2(+19)
CS NBDZ # (GYRO PULSES)/(CS) X 2(-5)
TC FBIASSUB # +(NBDZ)(DELTAT) (GYRO PULSES) X 2(+14)
# Page 305
CCS GCOMPSW # ARE GYRO COMMANDS GREATER THAN 2 PULSES
TCF 1/GYRO # YES
TCF ENDOFJOB # NO
# Page 303
FBIASSUB XCH Q
TS BUF +1
CA Q # NBD SCALED (GYRO PULSES)/(CS) X 2(-5)
EXTEND
MP MPAC # DELTAT SCALED (CS) X 2(+19)
INDEX BUF
DAS GCOMP # HI(NBD)(DELTAT) (GYRO PULSES) X 2(+14)
CA Q # NO FRACTIONAL PART
EXTEND
MP MPAC +1
TS L
CAF ZERO
INDEX BUF
DAS GCOMP # (NBD)(DELTAT) (GYRO PULSES) X 2(+14)
TCF DRFTSUB2 # CHECK MAGNITUDE OF COMPENSATION
LASTBIAS TC BANKCALL
CADR PIPUSE
CCS GCOMPSW # BYPASS IF GCOMPSW NEGATIVE
TCF +3
TCF +2
TCF ENDOFJOB
CAF PRIO31 # 2 SECONDS SCALED (CS) X 2(+8)
XCH 1/PIPADT
COM
AD PIPTIME1 +1 # TIME AT PIPA1 =0
TCF NBD2