forked from virtualagc/virtualagc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP70-P71.agc
404 lines (329 loc) · 14.8 KB
/
P70-P71.agc
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
### FILE="Main.annotation"
## Copyright: Public domain.
## Filename: P70-P71.agc
## Purpose: A section of Luminary revision 116.
## It is part of the source code for the Lunar Module's (LM)
## Apollo Guidance Computer (AGC) for Apollo 12.
## This file is intended to be a faithful transcription, except
## that the code format has been changed to conform to the
## requirements of the yaYUL assembler rather than the
## original YUL assembler.
## Reference: pp. 823-830
## Assembler: yaYUL
## Contact: Ron Burkey <[email protected]>.
## Website: www.ibiblio.org/apollo/index.html
## Mod history: 2017-01-22 MAS Created from Luminary 99.
## 2017-03-10 HG Transcribed
## 2017-03-14 RSB Proofed comment text via 3-way diff vs
## Luminary 99 and 131.
## 2017-03-19 HG Fix operand ROO --> RCO
## Page 823
BANK 21
SETLOC R11
BANK
EBANK= DVCNTR
COUNT* $$/R11
R10,R11 CS FLAGWRD7 # IS SERVICER STILL RUNNING?
MASK AVEGFBIT
CCS A
TCF TASKOVER # LET AVGEND TAKE CARE OF GROUP 2.
CCS PIPCTR
TCF +2
TCF LRHTASK # LAST PASS. CALL LRHTASK.
## Note: The operand "LRHTASK" above is circled with a red pen.
+2 TS PIPCTR1
PIPCTR1 = LADQSAVE
PIPCTR = PHSPRDT2
CAF OCT31
TC TWIDDLE
ADRES R10,R11
R10,R11A CAF HFLSHBIT
FLASHH? MASK FLGWRD11
EXTEND
BZF FLASHV? # H FLASH OFF, SO LEAVE ALONE
CA HLITE
TS L
TC FLIP # FLIP H LITE
FLASHV? CA VFLSHBIT # VFLASHBIT MUST BE BIT 2.
MASK FLGWRD11
EXTEND
BZF 10,11 # V FLASH OFF
CA VLITE
TS L
TC FLIP # FLIP V LITE
10,11 CA FLAGWRD9 # IS THE LETABORT FLAG SET ?
MASK LETABBIT
EXTEND
BZF LANDISP # NO. PROCEED TO R10.
P71NOW? CS MODREG # YES. ARE WE IN P71 NOW?
AD 1DEC71
EXTEND
BZF LANDISP # YES. PROCEED TO R10.
## Page 824
EXTEND # NO. IS AN ABORT STAGE COMMANDED?
READ CHAN30
COM
TS L
MASK BIT4
CCS A
TCF P71A # YES.
P70NOW? CS MODREG # NO. ARE WE IN P70 NOW?
AD 1DEC70
EXTEND
BZF LANDISP # YES. PROCEED TO R10.
CA L # NO. IS AN ABORT COMMANDED?
MASK BIT1
CCS A
TCF P70A # YES.
TCF LANDISP # NO. PROCEED TO R10.
COUNT* $$/P70
P70 TC LEGAL?
P70A CS ZERO
TCF +3
P71 TC LEGAL?
P71A CAF TWO
+3 TS Q
INHINT
EXTEND
DCA CNTABTAD
DTCB
EBANK= DVCNTR
CNTABTAD 2CADR CONTABRT
1DEC70 DEC 70
1DEC71 DEC 71
BANK 05
SETLOC ABORTS1
BANK
COUNT* $$/P70
CONTABRT CAF ABRTJADR
TS BRUPT
RESUME
ABRTJADR TCF ABRTJASK
ABRTJASK CAF OCTAL27
## Page 825
AD Q
TS L
COM
DXCH -PHASE4
INDEX Q
CAF MODE70
TS MODREG
TS DISPDEX # INSURE DISPDEX IS POSITIVE.
CCS Q # SET APSFLAG IF P71.
CS FLGWRD10 # SET APSFLAG PRIOR TO THE ENEMA.
MASK APSFLBIT
ADS FLGWRD10
CS DAPBITS # DAPBITS = OCT 40640 = BITS 6,8,9,15
MASK DAPBOOLS # RESET ULLAGE,DRIFT,XOVRIINH,AND PULSES
TS DAPBOOLS
CAF 1DEGDB # INSURE DAP DEADBAND IS SET TO 1 DEGREE
TS DB
CS FLAGWRD5 # SET ENGONFLG.
MASK ENGONBIT
ADS FLAGWRD5
CS PRIO30 # INSURE THAT THE ENGINE IS ON, IF ARMED.
EXTEND
RAND DSALMOUT
AD BIT13
EXTEND
WRITE DSALMOUT
CAF LRBYBIT # TERMINATE R12.
TS FLGWRD11
CS FLAGWRD0 # SET R10FLAG TO SUPPRESS OUTPUTS TO THE
MASK R10FLBIT # CROSS-POINTER DISPLAY.
ADS FLAGWRD0 # THE FOLLOWING ENEMA WILL REMOVE THE
# DISPLAY INERTIAL DATA OUTBIT.
EXTEND # LOAD TEVENT FOR THE DOWNLINK.
DCA TIME2
DXCH TEVENT
EXTEND
DCA SVEXITAD
DXCH AVGEXIT
TC ABTKLEAN # KILL GROUPS 1,3, AND 6.
## Page 826
CAF THREE # SET UP 4.3SPOT FOR GOABORT
TS L
COM
DXCH -PHASE4
TC POSTJUMP
CADR ENEMA
EBANK= DVCNTR
SVEXITAD 2CADR SERVEXIT
MODE70 DEC 70
OCTAL27 OCT 27
MODE71 DEC 71
DAPBITS OCT 40640
1DEGDB OCT 00554
BANK 32
SETLOC ABORTS
BANK
COUNT* $$/P70
GOABORT CAF FOUR
TS DVCNTR
CAF WHICHADR
TS WHICH
TC INTPRET
CLEAR CLEAR
FLRCS
FLUNDISP
CLEAR SET
IDLEFLAG
ACC4-2FL
SET CALL
P7071FLG
INITCDUW
## Note: Above interpretive operand "INITCDUW" is circled with a black pen.
EXIT
TC CHECKMM
70DEC DEC 70
TCF P71RET
P70INIT TC INTPRET
CALL
TGOCOMP
DLOAD SL
## Page 827
MDOTDPS
4D
BDDV
MASS
STODL TBUP
MASS
DDV SR1
K(1/DV)
STORE 1/DV1
STORE 1/DV2
STORE 1/DV3
BDDV
K(AT)
STODL AT
100PCTTO
STORE TTO
SLOAD DCOMP
DPSVEX
SR2
STCALL VE
COMMINIT
INJTARG DLOAD
ABTRDOT
STCALL RDOTD # INITIALIZE RDOTD.
YCOMP # COMPUTE Y
ABS DSU
YLIM # /Y/-DYMAX
BMN SIGN # IF <0, XR<.5DEG, LEAVE YCO AT 0
YOK # IF >0, FIX SIGN OF DEFICIT, THIS IS YCO.
Y
STORE YCO
YOK DLOAD DSU
YCO
Y
SR
5D
STORE XRANGE
SET CALL
FLVR
THETCOMP
DSU BPL
THETCRIT
+4
VLOAD GOTO
J1PARM
+3
+4 VLOAD
J2PARM
+3 STODL JPARM
RCO
## Page 828
STORE RP
SET EXIT
ROTFLAG
UPTHROT TC THROTUP
TC PHASCHNG
OCT 04024
TC UPFLAG
ADRES FLAP
UPTHROT1 TC BANKCALL # VERIFY THAT THE PANEL SWITCHES
CADR P40AUTO # ARE PROPERLY SET.
TC THROTUP
CAF PRIO17 # LET SERVICER FINISH BEFORE CONNECTING
TC PRIOCHNG # ASCENT GUIDANCE EQUATIONS.
EXTEND
DCA ATMAGAD
DXCH AVGEXIT
GRP4OFF TC PHASCHNG # TERMINATE USE OF GROUP 4.
OCT 00004
TCF ENDOFJOB
P71RET TC DOWNFLAG
ADRES LETABORT
CAF THRESH2 # SET DVMON THRESHOLD TO THE ASCENT VALUE.
TS DVTHRUSH
TC INTPRET
CALL
P12INIT
BON CALL
FLAP
OLDTIME
TGOCOMP # IF FLAP=0, TGO=T-TIG
GOTO
INJTARG
OLDTIME DLOAD SL1 # IF FLAP=1,TGO=2 TGO
TGO
STORE TGO1
EXIT
TC PHASCHNG
## Page 829
OCT 04024
EXTEND
DCA TGO1
DXCH TGO
TCF UPTHROT1
TGO1 = VGBODY
# ************************************************************************
BANK 21
SETLOC R11
BANK
COUNT* $$/P70
LEGAL? CS MMNUMBER # IS THE DESIRED PGM ALREADY IN PROGRESS?
AD MODREG
EXTEND
BZF ABORTALM
CS FLAGWRD9 # ARE THE ABORTS ENABLED?
MASK LETABBIT
CCS A
TCF ABORTALM
CA FLAGWRD7 # IS SERVICER ON THE AIR?
MASK AVEGFBIT
CCS A
TC Q # YES. ALL IS WELL.
ABORTALM TC FALTON
TC RELDSP
TC POSTJUMP
CADR PINBRNCH
BANK 32
SETLOC ABORTS
BANK
COUNT* $$/P70
# ************************************************************************
TGOCOMP RTB DSU
LOADTIME
TIG
SL
11D
STORE TGO
RVQ
## Page 830
# ************************************************************************
THROTUP CAF BIT13
TS THRUST
CAF BIT4
EXTEND
WOR CHAN14
TC Q
# ************************************************************************
10SECS 2DEC 1000
HINJECT 2DEC 18288 B-24 # 60,000 FEET EXPRESSED IN METERS.
(TGO)A 2DEC 37000 B-17
K(AT) 2DEC .02 # SCALING CONSTANT
WHICHADR REMADR ABRTABLE
# ************************************************************************
EBANK= DVCNTR
ATMAGAD 2CADR ATMAG