forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ASCENT_GUIDANCE.s
647 lines (603 loc) · 11 KB
/
ASCENT_GUIDANCE.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
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# Copyright: Public domain.
# Filename: ASCENT_GUIDNCE.agc
# Purpose: Part of the source code for Luminary 1A build 099.
# It is part of the source code for the Lunar Module's (LM)
# Apollo Guidance Computer (AGC), for Apollo 11.
# Assembler: yaYUL
# Contact: Hartmuth Gutsche <[email protected]>.
# Website: www.ibiblio.org/apollo.
# Pages: 843-856
# Mod history: 2009-05-23 HG Transcribed from page images.
# 2009-06-05 RSB Fixed a couple of typos.
# 2009-06-07 RSB Corrected a typo.
#
# 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 [email protected]
# about getting access to the (much) higher-quality images which Paul
# actually created.
#
# Notations on the hardcopy document read, in part:
#
# Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
# 16:27 JULY 14, 1969
# Page 843
BANK 34
SETLOC ASCFILT
BANK
EBANK= DVCNTR
COUNT* $$/ASENT
ATMAG TC PHASCHNG
OCT 00035
TC INTPRET
BON
FLRCS
ASCENT
DLOAD DSU
ABDVCONV
MINABDV
BMN CLEAR
ASCTERM4
SURFFLAG
CLEAR SLOAD
RENDWFLG
BIT3H
DDV EXIT
ABDVCONV
DXCH MPAC
DXCH 1/DV3
DXCH 1/DV2
DXCH 1/DV1
DXCH 1/DV0
TC INTPRET
DLOAD DAD
1/DV0
1/DV1
DAD DAD
1/DV2
1/DV3
DMP DMP
VE
2SEC(9)
SL3 PDDL
TBUP
SR1 DAD
DSU
6SEC(18)
STODL TBUP
VE
SR1 DDV
TBUP
STCALL AT
# Page 844
ASCENT
BIT3H OCT 4
# Page 845
BANK 30
SETLOC ASENT
BANK
COUNT* $$/ASENT
ASCENT VLOAD ABVAL
R
STOVL /R/MAG
ZAXIS1
DOT SL1
V # Z.V = ZDOT*2(-8).
STOVL ZDOT # ZDOT*2(-7)
ZAXIS1
VXV VSL1
UNIT/R/ # Z X UR = LAXIS*2(-2)
STORE LAXIS # LAXIS*2(-1)
DOT SL1
V # L.V = YDOT*2(-8).
STCALL YDOT # YDOT * 2(-7)
YCOMP
VLOAD
GDT1/2 # LOAD GDT1/2*2(-7) M/CS.
V/SC DOT
2SEC(18)
UNIT/R/ # G.UR*2(9) = GR*2(9).
PDVL VXV # STORE IN PDL(0)
UNIT/R/ # LOAD UNIT/R/ *2(-1)
V # UR*2(-1) X V*2(-7) = H/R*2(-8).
VSQ DDV # H(2)/R(2)*2(-16).
/R/MAG # H(2)/R(3)*2(9).
SL1 DAD
STADR
STODL GEFF # GEFF*2(10)m/CS/CS.
ZDOTD
DSU
ZDOT
STORE DZDOT # DZDOT = (ZDOTD - ZDOT) * 2(7) M/CS.
VXSC PDDL
ZAXIS1
YDOTD
DSU
YDOT
STORE DYDOT # DYDOT = (YDOTD - YDOT) *2(7) M/CS.
VXSC PDDL
LAXIS
RDOTD
# Page 846
DSU
RDOT
STORE DRDOT # DRDOT = (RDOTD - RDOT) * 2(7) M/CS.
VXSC VAD
UNIT/R/
VAD VSL1
STADR
STORE VGVECT # VG = (DRDOT)R + (DVDOT)L + (DZDOT)Z.
DLOAD DMP # LOAD TGO
TGO # TGO GEFF
GEFF
VXSC VSL1
UNIT/R/ # TGO GEFF UR
BVSU
VGVECT # COMPENSATED FOR GEFF
STORE VGVECT # STORE FOR DOWNLINK
MXV VSL1 # GET VGBODY FOR N85 DISPLAY
XNBPIP
STOVL VGBODY
VGVECT
ABVAL BOFF # MAGNITUDE OF VGVECT
FLRCS # IF FLRCS=0,D0 NORMAL GUIDANCE
MAINENG
DDV # USE TGO=VG/AT WITH RCS
AT/RCS
STCALL TGO # THIS WILL BE USED ON NEXT CYCLE
ASCTERM2
MAINENG DDV PUSH # VG/VE IN PDL(0) (2)
VE
DMP BDSU # 1 - KT VG/VE
KT1
NEARONE
DMP DMP # TBUP VG(1-KT VG/VE)/VE (0)
TBUP # = TGO
DSU # COMPENSATE FOR TAILOFF
TTO
STORE TGO
SR DCOMP
11D
STODL TTOGO # TGO *2(-28) CS
TGO
BON DSU
IDLEFLAG
T2TEST
4SEC(17) # ( TGO - 4 )*2(-17) CS.
BMN
ENGOFF
T2TEST DLOAD
TGO
DSU BMN # IF TGO - T2 NEG., GO TO CMPONENT
# Page 847
T2A
CMPONENT
DLOAD DSU
TBUP
TGO
DDV CALL # 1- TGO/TBUP
TBUP
LOGSUB
SL PUSH # -L IN PDL(0) (2)
5
BDDV BDSU # -TGO/L*2(-17)
TGO
TBUP # TBUP + TGO/L = D12*2(-17)
PUSH BON # STORE IN PDL(2) (4)
FLPC # IF FLPC = 1, GO TO CONST
NORATES
DLOAD DSU
TGO
T3
BPL SET # FLPC=1
RATES
FLPC
NORATES DLOAD
HI6ZEROS
STORE PRATE # B = 0
STORE YRATE # D = 0
GOTO
CONST # GO TO CONST
RATES DLOAD DSU
TGO
02D # TGO - D12 = D21*2(-17)
PUSH SL1 # IN PDL(4) (6)
BDSU SL3 # (1/2TGO - D21)*2(-13) = E * 2(-13)
TGO # (8)
PDDL DMP # IN PDL(6)
TGO
RDOT # RDOT TGO * 2(-24)
DAD DSU # R + RDOT TGO
/R/MAG # R + RDOT TGO - RCO
RCO # MPAC = -DR *2(-24).
PDDL DMP # -DR IN PDL(8) (10)
DRDOT
04D # D21 DRDOT*2(-24)
DAD SL2 # (D21 DRDOT-DR)*2(-22) (8)
DDV DDV
06D # (D21 DRDOT-DR)/E*2(-9)
TGO
STORE PRATE # B * 2(8)
BMN DLOAD # B>0 NOT PERMITTED
CHKBMAG
#Page 848
HI6ZEROS
STCALL PRATE
PROK
CHKBMAG SR4 DDV # B*2(4)
TBUP # (B / TAU) * 2(21)
DSU BPL
PRLIMIT # ( B / TAU ) = 2(21) MAX.
PROK
DLOAD DMP
PRLIMIT
TBUP # B MAX. * 2(4)
SL4 # BMAX*2(8)
STORE PRATE
PROK DLOAD
TGO
DMP DAD # YDOT TGO
YDOT
Y # Y + YDOT TGO
DSU PDDL # Y + YDOT TGO - YCO
YCO # MPAC = - DY*(-24.) IN PDL(8) (10)
DYDOT
DMP DAD # D21 DYDOT - DY (8)
04D
SL2 DDV # (D21 DYDOT - DY)/E*2(-9)
DDV SETPD # (D21 DYDOT - DY)/E TGO*2(8)
TGO # = D*2(8)
04
STORE YRATE
CONST DLOAD DMP # LOAD B*2(8)
PRATE # B D12*2(-9)
02D
PDDL DDV # D12 B IN PDL(4) (6)
DRDOT # LOAD DRDOT*2(-7)
00D # -DRDOT/L*2(-7)
SR2 DSU # (-DRDOT/L-D12 B)=A*2(-9) (4)
STADR
STODL PCONS
YRATE # D*2(8)
DMP PDDL # D12 D,EXCH WITH -L IN PDL(0) (2,2)
BDDV SR2 # -DYDOT/L*2(-9)
DYDOT
DSU # (-DYDOT/L-D12 D)=C*2(-9)
00D
STORE YCONS
CMPONENT SETPD DLOAD
00D
100CS
DMP
PRATE # B(T-T0)*2(-9)
DAD DDV # (A+B(T-T0))*2(-9)
# Page 849
PCONS # (A+B(T-T0))/TBUP*2(8)
TBUP
SL1 DSU
GEFF # ATR*2(9)
STODL ATR
100CS
DMP DAD
YRATE
YCONS # (C+D(T-T0))*2(-9)
DDV SL1
TBUP
STORE ATY # ATY*2(9)
VXSC PDDL # ATY UY*2(8) (6)
LAXIS
ATR
VXSC VAD
UNIT/R/
VSL1 PUSH # AH*2(9) IN PDL(0) (6)
ABVAL PDDL # AH(2) IN PDL(34)
AT # AHMAG IN PDL(6) (8)
DSQ DSU # (AT(2)-AH(2))*2(18)
34D # =ATP2*2(18)
PDDL PUSH # (12)
AT
DSQ DSU # (AT(2)KR(2)-AH(2))*2(18) (10)
34D # =ATP3*2(18)
BMN DLOAD # IF ATP3 NEG,GO TO NO-ATP
NO-ATP # LOAD ATP2, IF ATP3 POS
8D
SQRT GOTO # ATP*2(9)
AIMER
NO-ATP DLOAD BDDV # KR AT/AH = KH (8)
6D
VXSC # KH AG*2(9)
00D
STODL 00D # STORE NEW AH IN PDL(0)
HI6ZEROS
AIMER SIGN
DZDOT
STORE ATP
VXSC
ZAXIS1 # ATP ZAXIS *2(8).
VSL1 VAD # AT*2(0)
00D
STORE UNFC/2 # WILL BE OVERWRITTEN IF IN VERT. RISE.
SETPD BON
00D
FLPI
P12RET
BON
# Page 850
FLVR
CHECKALT
MAINLINE VLOAD VCOMP
UNIT/R/
STODL UNWC/2
TXO
DSU BPL
PIPTIME
ASCTERM
BON
ROTFLAG
ANG1CHEK
CLRXFLAG CLEAR CLEAR
NOR29FLG # START r29 IN ASCENT PHASE.
XOVINFLG # ALLOW X-AXIS OVERRIDE
ASCTERM EXIT
CA FLAGWRD9
MASK FLRCSBIT
CCS A
TCF ASCTERM3
TC INTPRET
CALL
FINDCDUW -2
ASCTERM1 EXIT
+1 CA FLAGWRD9 # INSURE THAT THE NOUN 63 DISPLAY IS
MASK FLRCSBIT # BYPASSED IF WE ARE IN THE RCS TRIMMING
CCS A # MODE OF OPERATION
TCF ASCTERM3
CA FLAGWRD8 # BYPASS DISPLAYS IF ENGINE FAILURE IS
MASK FLUNDBIT # INDICATED.
CCS A
TCF ASCTERM3
CAF V06N63*
TC BANKCALL
CADR GODSPR
TCF ASCTERM3
ASCTERM2 EXIT
ASCTERM3 TCF ENDOFJOB
ASCTERM4 EXIT
INHINT
TC IBNKCALL # NO GUIDANCE THIS CYCLE -- HENCE ZERO
CADR ZATTEROR # THE DAP COMMANDED ERRORSss.
TCF ASCTERM1 +1
CHECKALT DLOAD DSU
/R/MAG
/LAND/
DSU BMN # IF H LT 25K CHECK Z AXIS ORIENTATION
25KFT
CHECKYAW
# Page 851
EXITVR CLEAR BON
FLVR
ROTFLAG
MAINLINE
DLOAD DAD
PIPTIME
10SECS
STCALL TXO
MAINLINE
EXITVR1 CLRGO
ROTFLAG
EXITVR
SETLOC ASENT1
BANK
COUNT* $$/ASENT
ANG1CHEK VLOAD DOT
UNFC/2
XNBPIP
DSU BPL
COSTHET1
OFFROT
VLOAD DOT
XNBPIP
UNIT/R/
DSU BMN
COSTHET2
KEEPVR1
OFFROT CLRGO
ROTFLAG
CLRXFLAG
BANK 7
SETLOC ASENT2
BANK
COUNT* $$/ASENT
SETXFLAG = CHECKYAW
CHECKYAW SET
XOVINFLG # PROHIBIT X-AXIS OVERRRIDE
DLOAD VXSC
ATY
LAXIS
PDDL VXSC
ATP
ZAXIS1
VAD UNIT
PUSH DOT
# Page 852
YNBPIP
ABS DSU
SIN5DEG
BPL DLOAD
KEEPVR
RDOT
DSU BPL
40FPS
EXITVR1
GOTO
KEEPVR
BANK 5
SETLOC ASENT3
BANK
COUNT* $$/ASENT
SIN5DEG 2DEC 0.08716 B-2
40FPS 2DEC 0.12192 B-7
BANK 14
SETLOC ASENT4
BANK
COUNT* $$/ASENT
KEEPVR VLOAD STADR # RECALL LOSVEC FROM PUSHLIST
STORE UNWC/2
KEEPVR1 VLOAD
UNIT/R/
STCALL UNFC/2
ASCTERM
ENGOFF RTB
LOADTIME
DSU DAD
PIPTIME
TTOGO
DCOMP EXIT
TC TPAGREE # FORCH SIGN AGREEMENT ON MPAC, MPAC +1.
CAF EBANK7
TS EBANK
EBANK= TGO
INHINT
CCS MPAC +1
TCF +3 # C(A) = DT - 1 BIT
TCF +2 # C(A) = 0
CAF ZERO # C(A) = 0
AD BIT1 # C(A) = 1 BIT OR DT.
# Page 853
TS ENGOFFDT
TC TWIDDLE
ADRES ENGOFF1
TC PHASCHNG
OCT 47014
-GENADR ENGOFFDT
EBANK= TGO
2CADR ENGOFF1
TC INTPRET
SET GOTO
IDLEFLAG # DISABLE DELTA-V MONITOR
T2TEST
ENGOFF1 TC IBNKCALL # SHUT OFF THE ENGINE.
CADR ENGINOF2
CAF PRIO17 # SET UP A JOB FOR THE ASCENT GUIDANCE
TC FINDVAC # POSTBURN LOGIC.
EBANK= WHICH
2CADR CUTOFF
TC PHASCHNG
OCT 07024
OCT 17000
EBANK= TGO
2CADR CUTOFF
TCF TASKOVER
CUTOFF TC UPFLAG # SET FLRCS FLAG.
ADRES FLRCS
-5 CAF V16N63
TC BANKCALL
CADR GOFLASH
TCF +3
TCF CUTOFF1
TCF -5
+3 TC POSTJUMP
CADR TERMASC
CUTOFF1 INHINT
TC IBNKCALL # ZERO ATTITUDE ERRORS BEFORE REDUCINT DB.
CADR ZATTEROR
TC IBNKCALL
CADR SETMINDB
TC POSTJUMP
CADR CUTOFF2
# Page 854
V16N63 VN 1663
BANK 30
SETLOC ASENT5
BANK
COUNT* $$/ASENT
CUTOFF2 TC PHASCHNG
OCT 04024
CAF V16N85C
TC BANKCALL
CADR GOFLASH
TCF TERMASC
TCF +2 # PROCEED
TCF CUTOFF2
TERMASC TC PHASCHNG
OCT 04024
INHINT # RESTORE DEADBAND DESIRED BY ASTRONAUT.
TC IBNKCALL
CADR RESTORDB
TC DOWNFLAG # DISALLOW ABORTS AT THIS TIME.
ADRES LETABORT
TCF GOTOP00H
V16N85C VN 1685
BANK 27
SETLOC ASENT1
BANK
COUNT* $$/ASENT
YCOMP VLOAD DOT
UNIT/R/
QAXIS
SL2 DMP
RCO
STORE Y
RVQ
BANK 30
SETLOC ASENT
BANK
# Page 855
100CS EQUALS 2SEC(18)
T2A EQUALS 2SEC(17)
4SEC(17) 2DEC 400 B-17
2SEC(17) 2DEC 200 B-17
T3 2DEC 1000 B-17
6SEC(18) 2DEC 600 B-18
BIT4H OCT 10
2SEC(9) 2DEC 200 B-9
V06N63* VN 0663
V06N76 VN 0676
V06N33A VN 0633
BANK 33
SETLOC ASENT6
BANK
COUNT* $$/ASENT
KT1 2DEC 0.5000
PRLIMIT 2DEC -.0639 # (B/TBUP)MIN=-.1FT.SEC(-3)
MINABDV 2DEC .0356 B-5 # 10 PERCENT BIGGER THAN GRAVITY
1/DV0 = MASS1
# Page 856
# THE LOGARITHM SUBROUTINE
BANK 24
SETLOC FLOGSUB
BANK
# INPUT ..... X IN MPAC
# OUTPUT ..... -LOG(X) IN MPAC
LOGSUB NORM BDSU
MPAC +6
NEARONE
EXIT
TC POLY
DEC 6
2DEC .0000000060
2DEC -.0312514377
2DEC -.0155686771
2DEC -.0112502068
2DEC -.0018545108
2DEC -.0286607906
2DEC .0385598563
2DEC -.0419361902
CAF ZERO
TS MPAC +2
EXTEND
DCA CLOG2/32
DXCH MPAC
DXCH BUF +1
CA MPAC +6
TC SHORTMP
DXCH MPAC +1
DXCH MPAC
DXCH BUF +1
DAS MPAC
TC INTPRET
DCOMP RVQ
CLOG2/32 2DEC .0216608494