forked from chrislgarry/Apollo-11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INTEGRATION_INITIALIZATION.s
1182 lines (1110 loc) · 25.9 KB
/
INTEGRATION_INITIALIZATION.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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright: Public domain.
# Filename: INTEGRATION_INITIALIZATION.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 <[email protected]>.
# Website: www.ibiblio.org/apollo.
# Pages: 1309-1333
# Mod history: 2009-05-15 RSB Adapted from the Colossus249/ file of the
# same name, using Comanche055 page images.
# 2009-05-20 RSB Corrections: fixed an interpreter instruction,
# fixed a SETLOC.
# 2009-05-23 RSB In SETCOAST, corrected MOONTHIS to AMOONFLG.
#
# 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 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 1309
# 1.0 INTRODUCTION
# ----------------
#
# FROM A USER'S POINT OF VIEW, ORBITAL INTEGRATION IS ESSENTIALLY THE SAME AS THE 278 INTEGRATION
# PROGRAM. THE SAME ENTRANCES TO THE PROGRAM WILL BE MAINTAINED, THE SAME STALLING ROUTINE WILL BE USED AND
# OUTPUT WILL STILL BE VIA THE PUSHLIST. THE PRIMARY DIFFERENCES TO A USER INVOLVE THE ADDED CAPABILITY OF
# TERMINATING INTEGRATION AT A SPECIFIC FINAL RADIUS AND THE DIFFERENCE IN STATE VECTOR SCALING INSIDE AND OUTSIDE
# THE LUNAR SPHERE OF INFLUENCE.
#
# IN ORDER TO MAKE THE CSM(LEM)PREC AND CSM(LEM)CONIC ENTRANCES SIMILAR TO FLIGHT 278, THE INTEGRATION PROGRAM
# WILL ITSELF SET THE FINAL RADIUS (RFINAL) TO 0 SO THAT REACHING THE DESIRED TIME ONLY WILL TERMINATE
# INTEGRATION. THE DP REGISTER RFINAL MUST BE SET BY USERS OF INTEGRVS AND INTEGRV, AND MUST BE DONE AFTER THE
# CALL TC INTSTALL.
#
# WHEN THE LM IS ON THE LUNAR SURFACE (INDICATED BY LUNAR SURFACE FLAG SET) CALLS TO LEMCONIC, LEMPREC, AND
# INTEGRV WITH VINFLAG = 0 WILL RESULT IN THE USE OF THE PLANETARY INERTIAL ORIENTATION SUBROUTINES TO PROVIDE
# BOTH THE LM'S POSITION AND VELOCITY IN THE REFERENCE COORDINATE SYSTEM.
# THE PROGRAM WILL PROVIDE OUTPUT AS IF INTEGRATION WAS USED. THAT IS, THE PUSHLIST WILL BE SET AS NOTED BELOW AND
# THE PERMANENT STATE VECTOR UPDATED WHEN SPECIFIED BY AN INTEGRV CALL.
#
# USERS OF INTEGRVS DESIRING INTEGRATION (INTYPFLG = 0) SHOULD NOTE THAT THE OBLATENESS PERTURBATION COMPUTATION
# IN LUNAR ORBIT IS TIME DEPENDENT. THEREFORE, THE USER SHOULD SUPPLY AN INITIAL STATE VECTOR VALID AT SOME REAL
# TIME AND THE DESIRED TIME (TDEC1) ALSO AT SOME REAL TIME. FOR CONIC "INTEGRATION" THE USER MAY STILL USE ZERO
# AS THE INITIAL TIME AND DELTA TIME AS THE DESIRED TIME.
#
# 2.0 CENTRAL DESCRIPTION
# -----------------------
#
# THE INTEGRATION PROGRAM OPERATES AS A CLOSED INTERPRETIVE SUBROUTINE AND PERFORMS THESE FUNCTIONS --
# 1) INTEGRATES (PRECISION OR CONIC) EITHER CSM OR LM STATE VECTOR
# 2) INTEGRATES THE W-MATRIX
# 3) PERMANENT OR TEMPORARY UPDATE OF THE STATE VECTOR
#
# THERE ARE SIX ENTRANCES TO THE INTEGRATION PROGRAM. FOUR OF THESE (CSMPREC, LEMPREC, CSMCONIC, LEMCONIC) SET
# ALL THE FLAGS REQUIRED IN THE INTEGRATION PROGRAM ITSELF TO CAUSE THE PRECISION OR CONIC INTEGRATION (KEPLER) OF
# THE LM OR CSM STATE VECTOR, AS THE NAMES SUGGEST. ONE ENTRANCE (INTEGRVS) PERMITS THE CALLING PROGRAM TO
# PROVIDE A STATE VECTOR TO BE INTEGRATED. THE CALLING PROGRAM MUST SET THE FLAGS INDICATING (1) PRECISION OR
# CONIC INTEGRATION, (2) IN OR OUT OF LUNAR SPHERE, (3) MIDCOURSE OR NOT, AND THE INTEGRATION PROGRAM COMPLETES
# THE FLAG SETTING TO BYPASS W-MATRIX INTEGRATION. THE LAST ENTRANCE (INTEGRV, USED IN GENERAL BY THE
# NAVIGATION PROGRAMS) PERMITS THE CALLER TO SET FIVE FLAGS (NOT MOONFLAG OR MIDFLAG) BUT NOT TO INPUT A STATE
# VECTOR. ANY PROGRAM WHICH CALLS INTEGRVS OR INTEGRV MUST CALL INTSTALL BEFORE IT SETS THE INTEGRATION FLAGS
# AND/OR STATE VECTOR.
#
# THREE SETS OF 42 REGISTERS AND 2 FLAGS ARE USED FOR THE STATE VECTORS. TWO SETS, WHICH MAY NOT BE OVERLAYED, ARE
# USED FOR THE PERMANENT STATE VECTORS FOR THE CSM AND LM. THE THIRD SET, WHICH MAY BE OVERLAYED WHEN INTEGRATION
# IS NOT BEING DONE, IS USED IN THE COMPUTATIONS.
#
# THE PERMANENT STATE VECTORS WILL BE PERIODICALLY UPDATED SO THAT THE VECTORS WILL NOT BE OLDER THAN 4 TIMESTEPS.
# THE PERMANENT STATE VECTORS WILL ALSO BE UPDATED WHENEVER THE W-MATRIX IS INTEGRATED OR WHEN A CALLER OF INTEGRV
# SETS STATEFLG (THE NAVIGATION PROGRAMS P20, P22.)
#
# Page 1310
# APPENDIX B OF THE USERS' GUIDE LISTS THE STATE VECTOR QUANTITIES.
#
# 2.1 RESTARTS
#
# PHASE CHANGES WILL BE MADE IN THE INTEGRATION PROGRAM ONLY FOR THE INTEGRV ENTRANCE (I.E., WHEN THE W-MATRIX IS
# INTEGRATED OR PERMANENT STATE VECTOR IS UPDATED.) THE GROUP NUMBER USED WILL BE THAT FOR THE P20-25 PROGRAMS
# (I.E., GROUP2) WINCE THE INTEGRV ENTRANCE WILL ONLY BE USED BY THESE PROGRAMS. IF A RESTART OCCURS DURING AN
# INTEGRATION OF THE STATE VECTOR ONLY, THE RECOVERY WILL BE TO THE LAST PHASE IN THE CALLING PROGRAM. CALLING
# PROGRAMS WHICH USE THE INTEGRV OR INTEGRVS ENTRANCE OF INTEGRATION WHOULD ENSURE THAT IF PHASE CHANGING IS DONE
# THAT IT IS PRIOR TO SETTING THE INTEGRATION INPUTS IN THE PUSHLIST.
# THIS IS BECAUSE THE PUSHLIST IS LOST DURING A RESTART.
#
# 2.2 SCALING
#
# THE INTEGRATION ROUTIEN WILL MAINTAIN THE PERMANENT MEMORY STATE VECTORS IN THE SCALING AND UNITS DEFINED IN
# APPENDIX B OF THE USERS' GUIDE. THE SCALING OF THE OUTPUT POSITION VECTOR DEPENDS ON THE ORIGIN OF THE COORDINATE
# SYSTEM AT THE DESIRED INTEGRATION TIME. THE COORDINATE SYSTEM TRANSFORMATION WILL BE DONE AUTOMATICALLY ON
# MULTIPLE TIMESTEP ENCKE INTEGRATION ONLY. THUS IT IS POSSIBLE TO HAVE OUTPUT FROM SUCCESSIVE INTEGRATIONS IN
# DIFFERENT SCALING.
# HOWEVER, RATT, VATT WILL ALWAYS BE SCALED THE SAME.
#
# 3.0 INPUT/OUTPUT
# ----------------
#
# PROGRAM INPUTS ARE THE FLAGS DESCRIBED IN APPENDIX A AND THE PERMANENT STATE VECTOR QUANTITIES DESCRIBED IN
# APPENDIX B OF THE USERS' GUIDE, PLUS THE DESIRED TIME TO INTEGRATE TO IN TDEC1 (A PUSH LIST LOCATION).
# FOR INTEGRVS, THE RCV,VCV,TET OR THE TEMPORARY STATE VECTOR MUST BE SET, PLUS MOONFLAG AND MIDFLAG
#
# FOR SIMULATION THE FOLLOWING QUANTITIES MUST BE PRESET ---
# EARTH MOON
# 29 27
# RRECTCSM(LEM) RECTIFIED POSITION VECTOR METERS 2 2
#
# 7 5
# VRECTCSM(LEM) RECTIFIED VELOCITY VECTOR M/CSEC 2 2
#
# 28 28
# TETCSM(LEM) TIME STATE VECTOR IS VALID CSEC 2 2
# CUSTOMARILY 0, BUT NOTE LUNAR
# ORBIT DEPENDENCE ON REAL TIME.
#
# 22 18
# DELTAVCSM(LEM) POSITION DEVIATION METERS 2 2
# 0 IF TCCSM(LEM) = 0
#
# 3 -1
# NUVCSM(LEM) VELOCITY DEVIATION M/CSEC 2 2
# 0 IF TCCSM(LEM) = 0
# Page 1311
# 29 27
# RCVSM(LEM) CONIC POSITION METERS 2 2
# EQUALS RRECTCSM(LEM) IF
# TCCSM(LEM) = 0
#
# 7 5
# VCVCSM(LEM) CONIC VELOCITY M/CSEC 2 2
# EQUALS VRECTCSM(LEM) IF
# TCCSM(LEM) = 0
#
# 28 28
# TCCSM(LEM) TIME SINCE RECTIFICATION CSECS 2 2
# CUSTOMARILY 0
#
# 1/2 17 16
# XKEPCSM(LEM) RDOT OF KEPLER'S EQUATION M 2 2
# 0 IF TCCSM(LEM) = 0
#
# CMOONFLG PERMANENT FLAGS CORRESPONDING 0 0
# CMIDFLAG TO MOONFLAG AND MIDFLAG 0,1 0,1
# LMOONFLG C = CSM, L = LM 0 0
# LMIDFLG 0,1 0,1
#
# SURFFLAG LUNAR SURFACE FLAG 0,1 0,1
#
# IN ADDITION, IF (L)CMIDFLAG IS SET, THE INITIAL INPUT VALUES FOR LUNAR
# SOLAR EPHEMERIDES SUBROUTINE AND PLANETARY INERTIAL ORIENTATION SUB-
# ROUTINE MUST BE PRESET.
#
# OUTPUT
# AFTER EVERY CALL TO INTEGRATION
# EARTH MOON
# 29 29
# 0D RATT POSITION METERS 2 2
#
# 7 7
# 6D VATT VELOCITY M/CSEC 2 2
#
# 28 28
# 12D TAT TIME 2 2
#
# 29 27
# 14D RATT1 POSITION METERS 2 2
#
# 7 5
# 20D VATT1 VELOCITY M/CSEC 2 2
#
# 3 2 36 30
# 26D MU(P) MU M /CS 2 2
#
# X1 MUTABLE ENTRY -2 -10D
#
# X2 COORDINT
# X2 COORDINATE SYSTEM ORIGIN 0 2
# (THIS, NOT MOONFLAG, SHOULD BE
# Page 1312
# USED TO DETERMINE ORIGIN.)
#
# IN ADDITION TO THE ABOVE, THE PERMANENT STATE VECTOR IS UPDATED WHENEVER
# STATEFLG WAS SET AND WHENEVER A W-MATRIX IS TO BE INTEGRATED. THE PUSH
# COUNTER IS SET TO 0 AND OVERFLOW IS CLEARED BEFORE RETURNING TO THE
# CALLING PROGRAM.
#
# 4.0 CALLING SEQUENCES AND SAMPLE CODE
# -------------------------------------
#
# A) PRECISION ORBITAL INTEGRATION. CSMPREC, LEMPREC ENTRANCES
# L-X STORE TIME TO 96T5791T5 T 95 PUS L9ST (T4531)
# L CALL
# L+1 CSMPREC (OR LEMPREC)
# L+2 RETURN
# INPUT 28
# TDEC1 (PD 32D) TIME TO INTEGRATE TO...CENTISECONDS SCALED 2
# OUTPUT
# THE DATA LISTED IN SECTION 3.2 PLUS
# RQVV POSITION VECTOR OF VEHICLE WITH RESPECT TO SECONDARY
# BODY... METERS B-29 ONLY IF MIDFLAG = DIM0FLAG = 1
# B) CONIC INTEGRATION. CSMCONIC, LEMCONIC ENTRANCES
# L-X STORE TIME IN PUSH LIST (TDEC1)
# L CALL
# L+1 CSMCONIC (OR LEMCONIC)
# INPUT/OUTPUT
# SAME AS PRECISION INTEGRATION, EXCEPT RQVV NOT SET
# C) INTEGRATE GIVEN STATE VECTOR. INTEGRVS ENTRANCE
# CALL
# INTSTALL
# VLOAD
# POSITION VECTOR
# STOVL RCV
# VELOCITY VECTOR
# STODL VCV
# TIME STATE VECTOR VALID
# STODL TET
# FINAL RADIUS
# STORE RFINAL
# SET(CLEAR) SET(CLEAR)
# INTYPFLAG
# MOONFLAG
# SET(CLEAR) DLOAD
# DESIRED TIME
# STCALL TDEC1
# INTEGRVS
# INPUT
# RCV POSITION VECTOR METERS
# VCV VELOCITY VECTOR M/CSEC
# TET TIME OF STATE VECTOR (MAY = 0) CSEC B-28
# Page 1313
# TDEC1 TIME TO INTEGRATE TO CSEC B-28 (PD 32D)
# (MAY BE INCREMENT IF TET=0)
# OUTPUT
# SAME AS FOR PRECISION OR CONIC INTEGRATION,
# DEPENDING ON INTYPFLG.
# D) INTEGRATE STATE VECTOR. INTGRV ENTRANCE
# L-X STORE TIME IN PUSH LIST (TDEC1) (MAY BE DONE AFTER CALL TO INTSTALL)
# L-8 CALL
# L-7
# L-6 SET(CLEAR) SET(CLEAR)
# L-5 VINTFLAG 1=CSM, 0=LM
# L-4 INTYPFLAG 1=CONIC, 0=PRECISION
# L-3 SET(CLEAR) SET(CLEAR)
# L-2 DIM0FLAG 1=W-MATRIX, 0=NO W-MATRIX
# L-1 D6OR9FLG 1=9X9, 0=6X6
# L SET DLOAD
# L+1 STATEFLG DESIRE PERMANENT UPDATE
# L+2 FINAL RAD. OF STATE VECTOR
# L+3 STCALL RFINAL
# L+4 INTEGRV
# L CALL NORMAL USE -- WILL UPDATE STATE
# L+1 INTEGRV VECTOR IF DIM0FLAG=1. (STATEFLG IS
# L+2 RETURN ALWAYS RESET IN INTEGRATION AFTER
# IT USED.)
# INPUT
# TDEC1 (PD 32D) TIME TO INTEGRATE TO CSEC B-28
# OUTPUT
# SAME AS FOR PRECISION OR CONIC INTEGRATION
# THE PROGRAM WILL SET MOONFLAG, MIDFLAG DEPENDING ON
# THE PERMANENT STATE VECTOR REPRESENTATION.
BANK 11
SETLOC INTINIT
BANK
EBANK= RRECTCSM
COUNT 13/INTIN
STATEINT TC PHASCHNG
OCT 00052
CAF PRIO5
TC FINDVAC
EBANK= RRECTCSM
2CADR STATINT1
TC TASKOVER
STATINT1 TC INTPRET
BON RTB
QUITFLAG
NOINT # NO STATEINT IF V96
LOADTIME
# Page 1314
STORE TDEC1
CLEAR CALL
V96ONFLG
INTSTALL
SET CALL
NODOFLAG
SETIFLGS
GOTO
STATEUP
600SECS 2DEC 60000
ENDINT CLEAR EXIT
STATEFLG
TC PHASCHNG
OCT 20032
EXTEND
DCA 600SECS
TC LONGCALL
EBANK= RRECTHIS
2CADR STATEINT
TC ENDOFJOB
SETIFLGS SET CLEAR
STATEFLG
INTYPFLG
CLEAR CLEAR
DIM0FLAG
D6OR9FLG
RVQ
NOINT EXIT
TC PHASCHNG
OCT 2
TC DOWNFLAG
ADRES QUITFLAG
TC ENDOFJOB
# ATOPCSM TRANSFERS RRECT TO RRECT +41 TO RRECTCSM TO RRECTCSM +41
#
# CALLING SEQUENCE
# L CALL
# L+1 ATOPCSM
#
# NORMAL EXIT AT L+2
ATOPCSM STQ RTB
S2
MOVEACSM
SET CALL
# Page 1315
CMOONFLG
SVDWN1
BON CLRGO
MOONFLAG
S2
CMOONFLG
S2
MOVEACSM TC SETBANK
TS DIFEQCNT # INITIALIZE INDEX
INDEX DIFEQCNT
CA RRECT
INDEX DIFEQCNT
TS RRECTCSM
CCS DIFEQCNT # IS TRANSFER COMPLETE
TCF MOVEACSM +1 # NO-LOOP
TC DANZIG # COMPLETE -- RETURN
# PTOACSM TRANSFERS RRECTCSM TO RRECTCSM +41 TO RRECT TO RRECT +41
#
# CALLING SEQUENCE
# L CALL
# PTOACSM
#
# NORMAL EXIT AT L+2
PTOACSM RTB BON
MOVEPCSM
CMOONFLG
SETMOON
CLRMOON CLEAR SSP
MOONFLAG
PBODY
0
RVQ
SETMOON SET SSP
MOONFLAG
PBODY
2
RVQ
MOVEPCSM TC SETBANK
TS DIFEQCNT
INDEX DIFEQCNT
CA RRECTCSM
INDEX DIFEQCNT
TS RRECT
CCS DIFEQCNT
TCF MOVEPCSM +1
TC DANZIG
# Page 1316
# ATOPLEM TRANSFERS RRECT TO RRECT +41 TO RRECTLEM TO RRECTLEM +41
ATOPLEM STQ RTB
S2
MOVEALEM
SET CALL
LMOONFLG
SVDWN2
BON CLRGO
MOONFLAG
S2
LMOONFLG
S2
MOVEALEM TC SETBANK
TS DIFEQCNT
INDEX DIFEQCNT
CA RRECT
INDEX DIFEQCNT
TS RRECTLEM
CCS DIFEQCNT
TCF MOVEALEM +1
TC DANZIG
# PTOALEM TRANSFERS RRECTLEM TO RRECTLEM +41 TO RRECT TO RRECT +41
PTOALEM BON RTB
SURFFLAG
USEPIOS
MOVEPLEM
BON GOTO
LMOONFLG
SETMOON
CLRMOON
MOVEPLEM TC SETBANK
TS DIFEQCNT
INDEX DIFEQCNT
CA RRECTLEM
INDEX DIFEQCNT
TS RRECT
CCS DIFEQCNT
TCF MOVEPLEM +1
TC DANZIG
USEPIOS SETPD VLOAD
0
RLS
PDDL PUSH
TDEC1
# Page 1317
STODL TET
5/8
CALL
RP-TO-R
STOVL RCV
ZUNIT
STODL 0D
TET
STODL 6D
5/8
SET CALL # NEEDED FOR SETTING X1 ON EXIT
MOONFLAG
RP-TO-R
VXV VXSC
RCV
OMEGMOON
STOVL VCV
ZEROVEC
STORE TDELTAV
AXT,2 SXA,2
2
PBODY
STCALL TNUV
A-PCHK
OMEGMOON 2DEC* 2.66169947 E-8 B+23*
SETBANK CAF INTBANK
TS BBANK
CAF FORTYONE
TC Q
EBANK= RRECTCSM
INTBANK BBCON INTEGRV
# SPECIAL PURPOSE ENTRIES TO ORBITAL INTEGRATION. THESE ROUTINES PROVIDE ENTRANCES TO INTEGRATION WITH
# APPROPRIATE SWITCHES SET OR CLEARED FOR THE DESIRED INTEGRATION.
#
# CSMPREC AND LEMPREC PERFORM ORBIT INTEGRATION BY THE ENCKE METHOD TO THE TIME INDICATED IN TDEC1.
# ACCELERATIONS DUE TO OBLATENESS ARE INCLUDED. NO W-MATRIX INT. IS DONE.
# THE PERMANENT STATE VECTOR IS NOT UPDATED.
# CSMCONIC AND LEMCONIC PERFORM ORBIT INTEG. BY KEPLER'S METHOD TO THE TIME INDICATED IN TDEC1.
# NO DISTURBING ACCELERATIONS ARE INCLUDED. IN THE PROGRAM FLOW THE GIVEN
# STATE VECTOR IS RECTIFIED BEFORE SOLUTION OF KEPLER'S EQUATION.
#
# THE ROUTINES ASSUME THAT THE CSM (LEM) STATE VECTOR IN P-MEM IS VALID.
# SWITCHES SET PRIOR TO ENTRY TO THE MAIN INTEG. PROG ARE AS FOLLOWS:
# CSMPREC CSMCONIC LEMPREC LEMCONIC
# VINTFLAG SET SET CLEAR CLEAR
# INTYPFLG CLEAR SET CLEAR SET
# DIM0FLAG CLEAR CLEAR CLEAR CLEAR
# Page 1318
#
# CALLING SEQUENCE
# L-X STORE TDEC1
# L CALL (STCALL TDEC1)
# L+1 CSMPREC (CSMCONIC, LEMPREC, LEMCONIC)
#
# NORMAL EXIT TO L+2
#
# SUBROUTINES CALLED
# INTEGRV1
# PRECOUT FOR CSMPREC AND LEMPREC
# CONICOUT FOR CSMCONIC AND LEMCONIC
#
# OUTPUT -- SEE PAGE 2 OF THIS LOG SECTION
#
# INPUT
# TDEC1 TIME TO INTEGRATE TO. CSECS B-28
CSMPREC STQ CALL
X1
INTSTALL
SXA,1 SET
IRETURN
VINTFLAG
IFLAGP SET CLEAR
PRECIFLG
DIM0FLAG
CLRGO
INTYPFLG
INTEGRV1
LEMPREC STQ CALL
X1
INTSTALL
SXA,1 CLRGO
IRETURN
VINTFLAG
IFLAGP
CSMCONIC STQ CALL
X1
INTSTALL
SXA,1 SET
IRETURN
VINTFLAG
IFLAGC CLEAR SETGO
DIM0FLAG
INTYPFLG
INTEGRV1
LEMCONIC STQ CALL
X1
# Page 1319
INTSTALL
SXA,1 CLRGO
IRETURN
VINTFLAG
IFLAGC
INTEGRVS SET SSP
PRECIFLG
PBODY
0
BOF SSP
MOONFLAG
+3
PBODY
2
STQ VLOAD
IRETURN
ZEROVEC
STORE TDELTAV
STCALL TNUV
RECTIFY
CLEAR SET
DIM0FLAG
NEWIFLG
SETGO
RPQFLAG
ALOADED
# INTEGRV IS AN ENTRY TO ORBIT INTEGRATION WHICH PERMITS THE CALLER,
# NORMALLY THE NAVIGATION PROGRAM, TO SET THE INTEG. FLAGS. THE ROUTINE
# IS ENTERED AT INTEGRV1 BY CSMPREC ET. AL. AND AT ALOADED BY INTEGRVS.
# THE ROUTINE SETS UP A-MEMORY IF ENTERED AT INTEGRV,1 AND SETS THE INTEG.
# PROGRAM FOR PRECISION OR CONIC.
#
# THE CALLER MUST FIRST CALL INTSTALL TO CHECK IF INTEG. IS IN USE BEFORE
# SETTING ANY FLAGS.
#
# THE FLAGS WHICH SHOULD BE SET OR CLEARED ARE
# VINTFLAG (IGNORED WHEN ENTERED FROM INTEGRVS)
# INTYPFLG
# DIM0FLAG
# D6OR9FLG
#
# CALLING SEQUENCE
# L-X CALL
# L-Y INTSTALL
# L-1 SET OR CLEAR ALL FOUR FLAGS. ALSO CAN SET STATEFLG IF DESIRED
# AND DIM0FLAG IS CLEAR.
# L CALL
# L+1 INTEGRV
#
# INITIALIZATION
# FLAGS AS ABOVE
# STORE TIME TO INTEGRATE TO IN TDEC1
#
# Page 1320
# OUTPUT
# RATT AS
# VATT DEFINED
# TAT BEFORE
INTEGRV STQ
IRETURN
INTEGRV1 SET SET
RPQFLAG
NEWIFLG
INTEGRV2 SSP
QPRET
ALOADED
BON GOTO
VINTFLAG
PTOACSM
PTOALEM
SETLOC INTINIT1
BANK
ALOADED DLOAD
TDEC1
STORE TDEC
BOFF GOTO
INTYPFLG
TESTLOOP
RVCON
SETLOC INTINIT
BANK
A-PCHK BOF CALL
MIDFLAG
ANDOUT # DON'T MAKE ORIGIN CHANGE CHECK
CHKSWTCH
BPL CALL
ANDOUT # NO ORIGIN CHANGE
ORIGCHNG # MAKE THE SWITCH
ANDOUT BOFCLR EXIT
STATEFLG
RECTOUT
TC PHASCHNG
OCT 04022
TC UPFLAG # PHASE CHANGE HAS OCCURRED BETWEEN
ADRES REINTFLG # INTSTALL AND INTWAKE
TC INTPRET
SSP
QPRET
PHEXIT
BON GOTO
VINTFLAG
ATOPCSM
# Page 1321
ATOPLEM
PHEXIT CALL
GRP2PC
RECTOUT SETPD CALL
0
RECTIFY
VLOAD VSL*
RRECT
0,2
PDVL VSL* # RATT TO PD0
VRECT
0,2
PDDL PDVL # VATT TO PD6 TAT TO PD12
TET
RRECT
PDVL PDDL*
VRECT
MUEARTH,2
PUSH AXT,1
DEC -10
BON AXT,1
MOONFLAG
+2
DEC -2
INTEXIT SETPD BOV
0
+1
CLEAR
MIDAVFLG
CLEAR CLEAR
AVEMIDSW # ALLOW UPDATE OF DOWNLINK STATE VECTOR
PRECIFLG
SLOAD EXIT
IRETURN
CA MPAC
INDEX FIXLOC
TS QPRET
TC INTWAKE
# RVCON SETS UP ORBIT INTEGRATION TO DO A CONIC SOLUTION FOR POSITION AND
# VELOCITY FOR THE INTERVAL (TET-TDEC)
RVCON DLOAD DSU
TDEC
TET
STCALL TAU.
RECTIFY
CALL
KEPPREP
DLOAD DAD
TC
# Page 1322
TET
STCALL TET
RECTOUT
# Page 1323
TESTLOOP BOF CLRGO
QUITFLAG
+3
STATEFLG
INTEXIT # STOP INTEGRATION
+3 SETPD LXA,2
10D
PBODY
VLOAD ABVAL
RCV
PUSH CLEAR # RC TO 10D
MIDFLAG
DSU* BMN # MIDFLAG=0 IF R G.T. RMP
RME,2
+3
SET
MIDFLAG
NORFINAL DLOAD DMP
10D
34D
SR1R DDV*
MUEARTH,2
SQRT DMP
.3D
SR3 SR4 # DT IS TRUNCATED TO A MULTIPLE
DLOAD SL
MPAC
15D # OF 128 CSECS.
PUSH BOV
MAXDT
BDSU BMN
DT/2MAX
MAXDT
DT/2COMP DLOAD DSU
TDEC
TET
RTB SL
SGNAGREE
8D
STORE DT/2 # B-19
BOV ABS
GETMAXDT
DSU BMN # IS TIME TO INTEG. TO GR THAN MAXTIME
12D
P00HCHK
USEMAXDT DLOAD SIGN
12D
DT/2
# Page 1324
STCALL DT/2
P00HCHK
MAXDT DLOAD PDDL # EXCHANGE DT/2MAX WITH COMPUTED MAX.
DT/2MAX
GOTO
DT/2COMP
GETMAXDT RTB
SIGNMPAC
STCALL DT/2
USEMAXDT
P00HCHK DLOAD ABS
DT/2
DSU BMN
DT/2MIN
A-PCHK
SLOAD BHIZ
MODREG
+3
GOTO
TIMESTEP
BON # WAS THIS CALL VIA CSM(LEM)PREC
PRECIFLG
TIMESTEP # YES
DLOAD DSU
DT/2
12D
BMN BOFCLR
A-PCHK
NEWIFLG
TIMESTEP
DLOAD DSU
TDEC
TET
BMN # NO BACKWARD INTEGRATION
INTEXIT
PDDL SR4
DT/2 # IS 4(DT) LS (TDEC - TET)
SR2R BDSU
BMN GOTO
INTEXIT
TIMESTEP
DT/2MIN 2DEC 3 B-20
DT/2MAX 2DEC 4000 E2 B-20
INTSTALL EXIT
CAF ZERO
ALLSTALL TS L
CA RASFLAG
INDEX L
# Page 1325
MASK INTBITAB # IS THIS STALL AREA FREE
EXTEND
BZF OKTOGRAB # YES
INDEX L
CAF WAKESTAL
TC JOBSLEEP
INTWAKE0 EXIT
TCF INTWAKE1
INTWAKE CS RASFLAG # IS THIS INTSTALLED ROUTINE TO BE
MASK REINTBIT # RESTARTED
CCS A
TC INTWAKE1 # NO
INDEX FIXLOC
CA QPRET
TS TBASE2 # YES, DON'T RESTART WITH SOMEONE ELSE'S Q
TC PHASCHNG
OCT 04022
CA TBASE2
INDEX FIXLOC
TS QPRET
CAF REINTBIT
MASK RASFLAG
EXTEND
BZF GOBAC # DON'T INTWAKE IF WE CAME HERE VIA RESTART
INTWAKE1 CAF ZERO
WAKE TS STALTEM # INDEX OF ANY STALL USER
WAKE1 INDEX STALTEM
CAF WAKESTAL
INHINT
TC JOBWAKE
CCS LOCCTR
TCF WAKE1 # MAY BE MORE TO WAKE UP
FORTYONE DEC 41
INDEX STALTEM
CS INTBITAB
MASK RASFLAG
TS RASFLAG # RELEASE STALL AREA
RELINT
TCF GOBAC
OKTOGRAB INDEX L # NO, WAIT UNTIL AVAILABLE
CAF INTFLBIT
ADS RASFLAG
GOBAC TC INTPRET
RVQ
# Page 1326
ERASTAL1 EXIT
CAF ONE
TCF ALLSTALL
ERASTAL2 EXIT
CAF TWO
TCF ALLSTALL
ERASWAK1 CAF ONE
TCF WAKE
ERASWAK2 CAF TWO
TCF WAKE
WAKESTAL CADR INTSTALL +1
CADR ERASTAL1 +1
CADR ERASTAL2 +1
STALTEM EQUALS MPAC
INTBITAB OCT 20100
OCT 10040
OCT 04020
# Page 1327
# AVETOMID
#
# THIS ROUTINE PERFORMS THE TRANSITION FROM A THRUSTING PHASE TO THE COAST
# PHASE BY INITIALIZING THIS VEHICLE'S PERMANENT STATE VECTOR WITH THE
# VALUES LEFT BY THE AVERAGEG ROUTINE IN RN,VN,PIPTIME.
#
# BEFORE THIS IS DONE THE W-MATRIX, IF IT'S VALID (OR WFLAG OR RENDWFLT IS
# SET) IS INTEGRATED FORWARD TO PIPTIME WITH THE PRE-THRUST STATE VECTOR.
#
# IN ADDITION, THE OTHER VEHICLE IS INTEGRATED (PERMANENT) TO PIPTIME.
#
# FINALLY TRKMKCNT IS ZEROED.
SETLOC INTINIT2
BANK
COUNT* $$/INTIN
AVETOMID STQ BON
EGRESS
RENDWFLG
INT/W # W-MATRIX VALID, GO INTEGRATE IT
BON
ORBWFLAG
INT/W # W-MATRIX VALID, GO INTEGRATE IT.
SETCOAST AXT,2 CALL # NOW MOVE PROPERLY SCALED RN,UN AS WELL AS
2 # PIPTIME TO INTEGRATION ERASABLES.
INTSTALL
BON AXT,2
AMOONFLG
+2
0
VLOAD VSR*
RN
0,2
STORE RRECT
STODL RCV
PIPTIME
STOVL TET
VN
VSR* CALL
0,2
MINIRECT # FINISH SETTING UP STATE VECTOR
RTB SSP
MOVATHIS # PUT TEMP STATE VECTOR INTO PERMANENT
TRKMKCNT
0
SET BON
CMOONFLG
# Page 1328
AMOONFLG
+3
CLEAR
CMOONFLG
BON DLOAD # NOW DO LM
SURFFLAG
FAZAB5 # NO COASTING LM
PIPTIME
STCALL TDEC1
SETIFLGS
CLEAR CALL
VINTFLAG
INTEGRV
GOTO
EGRESS
INT/W DLOAD CALL
PIPTIME # INTEGRATE W THRU BURN
INTSTALL
SET SET
DIM0FLAG # DO W-MATRIX
AVEMIDSW # SO WON'T CLOBBER RN,VN,PIPTIME
CLEAR SET
D6OR9FLG
VINTFLAG
STCALL TDEC1
INTEGRV
GOTO
SETCOAST
# Page 1329
# MIDTOAV1
#
# THIS ROUTINE INTEGRATES (PRECISION) TO THE TIME SPECIFIED IN TDEC1.
# IF, AT THE END OF AN INTEGRATION TIME STEP, CURRENT TIME PLUS A DELTA
# TIME (SEE TIMEDELT.....BASED ON THE COMPUTATION TIME FOR ONE TIME STEP)
# IS GREATER THAN THE DESIRED TIME, ALARM 1703 IS SET AND THE INTEGRATION
# IS DONE TO THE CURRENT TIME.
# RETURN IS IN BASIC TO THE RETURN ADDRESS PLUS ONE.
#
# IF THE INTEGRATION IS FINISHED TO THE DESIRED TIME, RETURN IS IN BASIC
# TO THE RETURN ADDRESS.
#
# IN EITHER CASE, BEFORE RETURNING, THE EXTRAPOLATED STATE VECTOR IS TRANSFERRED
# FROM R,VATT TO R,VN1 -- PIPTIME1 IS SET TO THE FINISHING INTEGRATION
# TIME AND MPAC IS SET TO THE DELTA TIME --
# TAT MINUS CURRENT TIME
# MIDTOAV2
#
# THIS ROUTINE INTEGRATES THIS VEHICLE'S STATE VECTOR TO THE CURRENT TIME PLUS
# INCREMENTS OF TIMEDELT SUCH THAT THE DIFFERENCE BETWEEN CURRENT TIME
# AND THE STATE VECTOR TIME AT THE END OF THE LAST STEP IS AT LEAST 5.6
# SECS.
# NO INPUTS ARE REQUIRED OF THE CALLER. RETURN IS IN BASIC TO THE RETURN
# ADDRESS WITH THE ABOVE TRANSFERS TO R,VN1 -- PIPTIME1 -- AND MPAC DONE
SETLOC INTINIT
BANK
EBANK= IRETURN1
MIDTOAV2 STQ CALL
IRETURN1
INTSTALL
DLOAD CLEAR
TIMEDELT
MID1FLAG
STCALL T-TO-ADD
ENTMID2
MIDTOAV1 STQ CALL
IRETURN1
INTSTALL
SET RTB
MID1FLAG