Source Code
These source-code files are part of a reconstructed copy of Luminary 98, a
development version of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer
(AGC) software.
The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 98 listing. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. |
027540,000002: ## Copyright: Public domain.
027541,000003: ## Filename: GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
027542,000004: ## Purpose: A section of Luminary revision 98.
027543,000005: ## It is part of the reconstructed source code for the a
027544,000006: ## development version of the flight software for the Lunar
027545,000007: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027546,000008: ## The code has been recreated from a copy of Luminary 99
027547,000009: ## revision 001, using asterisks indicating changed lines in
027548,000010: ## the listing and Luminary Memo #85, which lists changes between
027549,000011: ## Luminary 98 and 99.
027550,000012: ## Reference: pp. 654-657
027551,000013: ## Assembler: yaYUL
027552,000014: ## Contact: Ron Burkey <info@sandroid.org>.
027553,000015: ## Website: www.ibiblio.org/apollo/index.html
027554,000016: ## Mod history: 2019-07-28 MAS Created from Luminary 99.
027555,000017:
Page 654 |
027557,000019: # GROUND TRACKING DETERMINATION PROGRAM P21
027558,000020: # PROGRAM DESCRIPTION
027559,000021: # MOD NO - 1
027560,000022: # MOD BY - N. M. NEVILLE
027561,000023:
027562,000024: # FUNCTIONAL DECRIPTION -
027563,000025: # TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
027564,000026: # THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
027565,000027:
027566,000028: # CALLING SEQUENCE -
027567,000029: # ASTRONAUT REQUEST THROUGH DSKY V37E21E
027568,000030:
027569,000031: # SUBROUTINES CALLED -
027570,000032: # GOPERF4
027571,000033: # GOFLASH
027572,000034: # THISPREC
027573,000035: # OTHPREC
027574,000036: # LAT-LONG
027575,000037:
027576,000038: # NORMAL EXIT MODES -
027577,000039: # ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
027578,000040:
027579,000041: # ALARM OR ABORT EXIT MODES -
027580,000042: # NONE
027581,000043:
027582,000044: # OUTPUT -
027583,000045: # OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
027584,000046: # COMPUTED
027585,000047: # OPTION CODE 00002
027586,000048: # THIS 00001
027587,000049: # OTHER 00002
027588,000050: # DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS, MINUTES, SECONDS
027589,000051: # DECIMAL DISPLAY OF LAT,LONG,ALT
027590,000052:
027591,000053: # ERASABLE INITIALIZATION REQUIRED
027592,000054: # AX0 2DEC 4.652459653 E-5 RADIANS %68-69 CONSTANTS"
027593,000055: # -AY0 2DEC 2.147535898 E-5 RADIANS
027594,000056: # AZ0 2DEC .7753206164 REVOLUTIONS
027595,000057: # FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
027596,000058: # 504LM 2DEC -2.700340600 E-5 RADIANS
027597,000059: # 504LM _2 2DEC -7.514128400 E-4 RADIANS
027598,000060: # 504LM _4 2DEC _2.553198641 E-4 RADIANS
027599,000061:
027600,000062: # NONE
027601,000063:
027602,000064: # DEBRIS
Page 655 |
027604,000066: # CENTRALS - A,Q,L
027605,000067: # OTHER - THOSE USED BY THE ABOVE LISTED SUBROUTINES
027606,000068: # SEE LEMPREC, LAT-LONG
027607,000069:
027608,000070: 35,2545 30,2000 SBANK= LOWSUPER # FOR LOW 2CADR'S.
027609,000071:
027610,000072: 33,2200 BANK 33
027611,000073: 24,2000 SETLOC P20S
027612,000074: 24,2000 BANK
027613,000075:
027614,000076: 24,3505 E7,1762 EBANK= P21TIME
027615,000077: 24,3505 COUNT* $$/P21
027616,000078: 24,3505 34753 PROG21 CAF ONE
027617,000079: 24,3506 55145 TS OPTION2 # ASSUMED VEHICLE IS LM, R2 = 00001
027618,000080: 24,3507 34752 CAF BIT2 # OPTION 2
027619,000081: 24,3510 04616 TC BANKCALL
027620,000082: 24,3511 20633 CADR GOPERF4
027621,000083: 24,3512 06001 TC GOTOPOOH # TERMINATE
027622,000084: 24,3513 03515 TC +2 # PROCEED VALUE OF ASSUMED VEHICLE OK
027623,000085: 24,3514 03507 TC -5 # R2 LOADED THROUGH DSKY
027624,000086: 24,3515 33665 P21PROG1 CAF V6N34 # LOAD DESIRED TIME OF LAT-LONG.
027625,000087: 24,3516 04616 TC BANKCALL
027626,000088: 24,3517 20476 CADR GOFLASH
027627,000089: 24,3520 06001 TC GOTOPOOH # TERM
027628,000090: 24,3521 03523 TC +2 # PROCEED VALUES OK
027629,000091: 24,3522 03515 TC -5 # TIME LOADED THROUGH DSKY
027630,000092: 24,3523 06037 TC INTPRET
027631,000093: 24,3524 77745 DLOAD
027632,000094: 24,3525 01046 DSPTEM1
027633,000095: 24,3526 34041 STCALL TDEC1 # INTEGRATE TO TIME SPECIFIED IN TDEC
027634,000096: 24,3527 27414 INTSTALL
027635,000097: 24,3530 43014 BON CLEAR
027636,000098: 24,3531 00304 P21FLAG
027637,000099: 24,3532 51550 P21CONT # ON --- RECYCLE USING BASE VECTOR
027638,000100: 24,3533 01674 VINTFLAG # OFF -- 1ST PASS CALL BASE VECTOR
027639,000101: 24,3534 70535 SLOAD SR1
027640,000102: 24,3535 01146 OPTION2
027641,000103: 24,3536 43030 BHIZ SET
027642,000104: 24,3537 51541 +2 # ZERO -- THIS VEHICLE (LM)
027643,000105: 24,3540 01474 VINTFLAG # ONE -- OTHER VEHICLE (CM)
027644,000106: 24,3541 43014 CLEAR CLEAR
027645,000107: 24,3542 01676 DIM0FLAG
027646,000108: 24,3543 01673 INTYPFLG # PRECISION
027647,000109: 24,3544 77624 CALL
027648,000110: 24,3545 27134 INTEGRV # CALCULATE
027649,000111: 24,3546 77650 GOTO # -AND
027650,000112: 24,3547 51571 P21VSAVE # -SAVE BASE VECTOR
027651,000113: 24,3550 77775 P21CONT VLOAD
027652,000114: 24,3551 03676 P21BASER # RECYCLE -- INTEG FROM BASE VECTOR
027653,000115: 24,3552 25535 STOVL RCV # --POS
Page 656 |
027655,000117: 24,3553 03704 P21BASEV
027656,000118: 24,3554 15543 STODL VCV # --VEL
027657,000119: 24,3555 03763 P21TIME
027658,000120: 24,3556 01517 STORE TET # --TIME
027659,000121: 24,3557 43014 CLEAR CLEAR
027660,000122: 24,3560 01676 DIM0FLAG
027661,000123: 24,3561 00263 MOONFLAG
027662,000124: 24,3562 53135 SLOAD BZE
027663,000125: 24,3563 01164 P21ORIG
027664,000126: 24,3564 51567 +3 # ZERO = EARTH
027665,000127: 24,3565 77614 SET # ---2 = MOON
027666,000128: 24,3566 00063 MOONFLAG
027667,000129: 24,3567 77624 +3 CALL
027668,000130: 24,3570 27107 INTEGRVS
027669,000131: 24,3571 77745 P21VSAVE DLOAD # SAVE CURRENT BASE VECTOR
027670,000132: 24,3572 00015 TAT
027671,000133: 24,3573 27763 STOVL P21TIME # --TIME
027672,000134: 24,3574 00017 RATT1
027673,000135: 24,3575 27676 STOVL P21BASER # --POS B-29 OR B-27
027674,000136: 24,3576 00025 VATT1
027675,000137: 24,3577 03704 STORE P21BASEV # --VEL B-07 OR B-05
027676,000138: 24,3600 53646 ABVAL SL*
027677,000139: 24,3601 57576 0,2
027678,000140: 24,3602 27712 STOVL P21VEL # VEL/ FOR N91 DISP
027679,000141: 24,3603 00001 RATT
027680,000142: 24,3604 50256 UNIT DOT
027681,000143: 24,3605 00007 VATT # U(R).V
027682,000144: 24,3606 67471 DDV ASIN # U(R).U(V)
027683,000145: 24,3607 03712 P21VEL
027684,000146: 24,3610 03714 STORE P21GAM # SIN-1 U(R).U(V) , -90 TO &90
027685,000147: 24,3611 67334 SXA,2 SLOAD
027686,000148: 24,3612 01163 P21ORIG # 0 = EARTH
027687,000149: 24,3613 01146 OPTION2
027688,000150: 24,3614 46142 SR1 BHIZ
027689,000151: 24,3615 51620 +3
027690,000152: 24,3616 77650 GOTO
027691,000153: 24,3617 51623 +4
027692,000154: 24,3620 77614 +3 BON
027693,000155: 24,3621 04307 SURFFLAG
027694,000156: 24,3622 51625 P21DSP
027695,000157: 24,3623 77614 +4 SET
027696,000158: 24,3624 00064 P21FLAG
027697,000159: 24,3625 67214 P21DSP CLEAR SLOAD # GENERATE DISPLAY DATA
027698,000160: 24,3626 01663 LUNAFLAG
027699,000161: 24,3627 00050 X2
027700,000162: 24,3630 43054 BZE SET
027701,000163: 24,3631 51633 +2 # 0 = EARTH
027702,000164: 24,3632 01463 LUNAFLAG
027703,000165: 24,3633 77775 VLOAD
027704,000166: 24,3634 00001 RATT
Page 657 |
027706,000168: 24,3635 16032 STODL ALPHAV
027707,000169: 24,3636 00015 TAT
027708,000170: 24,3637 45014 CLEAR CALL
027709,000171: 24,3640 00662 ERADFLAG
027710,000172: 24,3641 26351 LAT-LONG
027711,000173: 24,3642 77605 DMP # MPAC = ALT, METERS B-29
027712,000174: 24,3643 11667 K.01
027713,000175: 24,3644 03716 STORE P21ALT # ALT/100 FOR N91 DISP
027714,000176: 24,3645 77776 EXIT
027715,000177: 24,3646 33664 CAF V06N43 # DISPLAY LAT, LONG, ALT
027716,000178: 24,3647 04616 TC BANKCALL # LAT, LONG = 1/2 REVS B0
027717,000179: 24,3650 20476 CADR GOFLASH # ALT = KM B14
027718,000180: 24,3651 06001 TC GOTOPOOH # TERM
027719,000181: 24,3652 06001 TC GOTOPOOH
027720,000182: 24,3653 06037 TC INTPRET # V32E RECYCLE
027721,000183: 24,3654 43345 DLOAD DAD
027722,000184: 24,3655 03763 P21TIME
027723,000185: 24,3656 11663 600SEC # 600 SECONDS OR 10 MIN
027724,000186: 24,3657 01046 STORE DSPTEM1
027725,000187: 24,3660 77634 RTB
027726,000188: 24,3661 51515 P21PROG1
027727,000189: 24,3662 00003 25140 600SEC 2DEC 60000 B-28 # 10 MIN
027728,000190:
027729,000191: 24,3664 01453 V06N43 VN 00643
027730,000192: 24,3665 01442 V6N34 VN 00634
027731,000193: 24,3666 00243 32703 K.01 2DEC .01
027732,000194:
End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc. Parent file is MAIN.agc