Source Code
These source-code files are part of a reconstructed copy of Luminary 69/2,
the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.
The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation. Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
|
056023,000002: ## Copyright: Public domain.
056024,000003: ## Filename: RESTARTS_ROUTINE.agc
056025,000004: ## Purpose: A section of LUM69 revision 2.
056026,000005: ## It is part of the reconstructed source code for the flown
056027,000006: ## version of the flight software for the Lunar Module's (LM)
056028,000007: ## Apollo Guidance Computer (AGC) for Apollo 10. The code has
056029,000008: ## been recreated from a copy of Luminary revsion 069, using
056030,000009: ## changes present in Luminary 099 which were described in
056031,000010: ## Luminary memos 75 and 78. The code has been adapted such
056032,000011: ## that the resulting bugger words exactly match those specified
056033,000012: ## for LUM69 revision 2 in NASA drawing 2021152B, which gives
056034,000013: ## relatively high confidence that the reconstruction is correct.
056035,000014: ## Reference: pp. 1297-1302
056036,000015: ## Assembler: yaYUL
056037,000016: ## Contact: Ron Burkey <info@sandroid.org>.
056038,000017: ## Website: www.ibiblio.org/apollo/index.html
056039,000018: ## Mod history: 2019-07-27 MAS Created from Luminary 69.
056040,000019:
Page 1297 |
056042,000021: 01,3523 BANK 01
056043,000022: 01,2000 SETLOC RESTART
056044,000023: 01,2000 BANK
056045,000024:
056046,000025: 01,3523 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
056047,000026:
056048,000027: 01,3523 COUNT* $$/RSROU
056049,000028: 01,3523 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
056050,000029: 01,3524 60000 DOUBLE # SAVE FOR INDEXING
056051,000030: 01,3525 54155 TS TEMP2G
056052,000031:
056053,000032: 01,3526 33765 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
056054,000033: 01,3527 54157 TS TEMPSWCH # TABLE PHASE
056055,000034:
056056,000035: 01,3530 33562 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
056057,000036: 01,3531 54707 TS GOLOC +2 # GROUP AFTER THIS
056058,000037:
056059,000038: 01,3532 30154 CA TEMPPHS
056060,000039: 01,3533 75007 MASK OCT1400
056061,000040: 01,3534 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
056062,000041: 01,3535 13546 TCF ITSAVAR # IT:S A VARIABLE RESTART
056063,000042:
056064,000043: 01,3536 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
056065,000044: 01,3537 10000 CCS A
056066,000045: 01,3540 13646 TCF ITSATBL # NO, ITS A TABLE RESTART
056067,000046:
056068,000047: 01,3541 35024 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
056069,000048: 01,3542 05105 TC FINDVAC # THE DISPLAY RESTART JOB
056070,000049: 01,3543 E3,1400 EBANK= LST1
056071,000050: 01,3543 02712 20103 2CADR INITDSP
056072,000051:
056073,000052: 01,3545 03562 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
056074,000053:
056075,000054: 01,3546 75007 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
056076,000055: 01,3547 10000 CCS A
056077,000056: 01,3550 13617 TCF ITSLIKEB # YES, IT IS TYPE B
056078,000057:
056079,000058: 01,3551 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
056080,000059: 01,3552 50155 NDX TEMP2G
056081,000060: 01,3553 31437 DCA PHSNAME1
056082,000061: 01,3554 52706 DXCH GOLOC
056083,000062:
056084,000063: 01,3555 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
056085,000064: 01,3556 74757 MASK OCT7
056086,000065: 01,3557 67745 AD MINUS2
056087,000066: 01,3560 10000 CCS A
056088,000067: 01,3561 13731 TCF ITSLNGCL # ITS A LONGCALL
056089,000068:
056090,000069: 01,3562 04631 RTRNCADR TC SWRETURN # CANT GET HERE
Page 1298 |
056092,000071: 01,3563 13565 TCF ITSAWAIT
056093,000072:
056094,000073: 01,3564 13632 TCF ITSAJOB # ITS A JOB
056095,000074:
056096,000075: 01,3565 33771 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
056097,000076: 01,3566 54704 TS GOLOC -1
056098,000077:
056099,000078: 01,3567 50155 NDX TEMP2G # DIRECTLY STORED
056100,000079: 01,3570 31054 CA PHSPRDT1
056101,000080: 01,3571 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
056102,000081: 01,3572 24000 INCR A # NO,
056103,000082: 01,3573 13576 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
056104,000083:
056105,000084: 01,3574 15436 TCF ITSINDIR # STORED INDIRECTLY
056106,000085:
056107,000086: 01,3575 13615 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
056108,000087:
056109,000088: # ***** THIS MUST BE IN FIXED FIXED *****
056110,000089:
056111,000090: 5436 BLOCK 02
056112,000091: 4000 SETLOC FFTAG2
056113,000092: 4000 BANK
056114,000093:
056115,000094: 5436 COUNT* $$/RSROU
056116,000095: 5436 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
056117,000096: 5437 22006 LXCH BB # SWITCHED ERRASIBLE
056118,000097:
056119,000098: 5440 50000 NDX A # GET THE TIME INDIRECTLY
056120,000099: 5441 30001 CA 1
056121,000100:
056122,000101: 5442 22006 LXCH BB # RESTORE THE BB AND GOLOC
056123,000102: 5443 22706 LXCH GOLOC +1
056124,000103:
056125,000104: 5444 13576 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
056126,000105:
056127,000106: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
056128,000107:
056129,000108: 01,3576 BANK 01
056130,000109: 01,2000 SETLOC RESTART
056131,000110: 01,2000 BANK
056132,000111:
056133,000112: 01,3576 COUNT* $$/RSROU
056134,000113: 01,3576 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
056135,000114: 01,3577 54001 TS L # AND SAVE
056136,000115: 01,3600 50155 NDX TEMP2G
056137,000116: 01,3601 41053 CS TBASE1
056138,000117: 01,3602 00006 EXTEND
056139,000118: 01,3603 60025 SU TIME1
056140,000119: 01,3604 10000 CCS A
056141,000120: 01,3605 40000 COM
Page 1299 |
056143,000122: 01,3606 67730 AD OCT37776
056144,000123: 01,3607 64753 AD ONE
056145,000124: 01,3610 60001 AD L
056146,000125: 01,3611 10000 CCS A
056147,000126: 01,3612 34755 CA ZERO
056148,000127: 01,3613 13615 TCF +2
056149,000128: 01,3614 13615 TCF +1
056150,000129: 01,3615 64753 IMEDIATE AD ONE
056151,000130: 01,3616 00704 TC GOLOC -1
056152,000131: 01,3617 33562 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
056153,000132: 01,3620 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
056154,000133:
056155,000134: 01,3621 33766 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
056156,000135: 01,3622 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
056157,000136:
056158,000137: 01,3623 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
056159,000138: 01,3624 76073 MASK OCT177 # PART OF THIS VARIABLE PHASE
056160,000139: 01,3625 54154 TS TEMPPHS
056161,000140:
056162,000141: 01,3626 00006 EXTEND
056163,000142: 01,3627 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
056164,000143: 01,3630 31437 DCA PHSNAME1
056165,000144: 01,3631 52706 DXCH GOLOC
056166,000145:
056167,000146: 01,3632 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
056168,000147: 01,3633 31054 CA PHSPRDT1
056169,000148: 01,3634 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
056170,000149: 01,3635 00006 EXTEND # A FINDVAC OR A NOVAC
056171,000150: 01,3636 63642 BZMF ITSNOVAC
056172,000151:
056173,000152: 01,3637 33770 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
056174,000153: 01,3640 56704 XCH GOLOC -1 # PICK UP PRIO,
056175,000154: 01,3641 00704 TC GOLOC -1 # AND GO
056176,000155:
056177,000156: 01,3642 33772 ITSNOVAC CAF NOVACADR # NEGATIVE,
056178,000157: 01,3643 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
056179,000158: 01,3644 40000 COM # CORRECT PRIO,
056180,000159: 01,3645 00704 TC GOLOC -1 # AND GO
056181,000160:
056182,000161: 01,3646 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
056183,000162: 01,3647 10020 CCS CYR
056184,000163: 01,3650 13651 TCF +1 # IT:S EVEN
056185,000164: 01,3651 13747 TCF ITSEVEN
056186,000165:
056187,000166: 01,3652 33562 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
056188,000167: 01,3653 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
056189,000168:
056190,000169: 01,3654 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
056191,000170: 01,3655 54021 TS SR # THE RESTART TABLES
056192,000171: 01,3656 60021 AD SR
Page 1300 |
056194,000173: 01,3657 50155 NDX TEMP2G
056195,000174: 01,3660 62003 AD SIZETAB +1
056196,000175: 01,3661 54156 TS POINTER
056197,000176:
056198,000177: 01,3662 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
056199,000178: 01,3663 50156 NDX POINTER
056200,000179: 01,3664 32002 DCA CADRTAB # GET THE 2CADR
056201,000180:
056202,000181: 01,3665 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
056203,000182:
056204,000183: 01,3666 10000 CCS A # IS IT A JOB OR IS IT TIMED
056205,000184: 01,3667 24000 INCR A # POSITIVE, MUST BE A JOB
056206,000185: 01,3670 13743 TCF ITSAJOB2
056207,000186:
056208,000187: 01,3671 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
056209,000188: 01,3672 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
056210,000189:
056211,000190: 01,3673 33771 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
056212,000191: 01,3674 54704 TS GOLOC -1
056213,000192:
056214,000193: 01,3675 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
056215,000194: 01,3676 74742 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
056216,000195: 01,3677 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
056217,000196: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
056218,000197: # IN IMPORTANCE ANYWAY. BIT 4
056219,000198: 01,3700 13736 TCF ITSWTLST # IT IS A WAITLIST CALL
056220,000199:
056221,000200: 01,3701 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
056222,000201: 01,3702 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
056223,000202:
056224,000203: 01,3703 15445 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
056225,000204:
056226,000205: # ***** THIS MUST BE IN FIXED FIXED *****
056227,000206:
056228,000207: 5445 BLOCK 02
056229,000208: 4000 SETLOC FFTAG2
056230,000209: 4000 BANK
056231,000210:
056232,000211: 5445 COUNT* $$/RSROU
056233,000212: 5445 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
056234,000213: 5446 22006 LXCH BB
056235,000214: 5447 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
056236,000215:
056237,000216: 5450 00006 EXTEND # GET THE DELTA TIME
056238,000217: 5451 50000 NDX A
056239,000218: 5452 30001 DCA 0
056240,000219:
056241,000220: 5453 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
056242,000221: 5454 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
056243,000222: 5455 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
Page 1301 |
056245,000224: 5456 13704 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
056246,000225:
056247,000226: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
056248,000227:
056249,000228: 01,3704 BANK 01
056250,000229: 01,2000 SETLOC RESTART
056251,000230: 01,2000 BANK
056252,000231:
056253,000232: 01,3704 COUNT* $$/RSROU
056254,000233: 01,3704 53154 ITSLGCL2 DXCH LONGTIME
056255,000234:
056256,000235: 01,3705 00006 EXTEND # CALCULATE TIME LEFT
056257,000236: 01,3706 40025 DCS TIME2
056258,000237: 01,3707 21154 DAS LONGTIME
056259,000238: 01,3710 00006 EXTEND
056260,000239: 01,3711 31152 DCA LONGBASE
056261,000240: 01,3712 21154 DAS LONGTIME
056262,000241:
056263,000242: 01,3713 11153 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
056264,000243: 01,3714 13724 TCF LONGCLCL
056265,000244: 01,3715 13717 TCF +2
056266,000245: 01,3716 13612 TCF IMEDIATE -3
056267,000246: 01,3717 11154 CCS LONGTIME +1
056268,000247: 01,3720 13724 TCF LONGCLCL
056269,000248: 01,3721 13722 NOOP # CAN:T GET HERE *********
056270,000249: 01,3722 13612 TCF IMEDIATE -3
056271,000250: 01,3723 13615 TCF IMEDIATE
056272,000251:
056273,000252: 01,3724 33767 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
056274,000253: 01,3725 54704 TS GOLOC -1
056275,000254:
056276,000255: 01,3726 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
056277,000256: 01,3727 31154 DCA LONGTIME
056278,000257: 01,3730 00704 TC GOLOC -1
056279,000258:
056280,000259: 01,3731 33771 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
056281,000260: 01,3732 54704 TS GOLOC -1
056282,000261:
056283,000262: 01,3733 50155 NDX TEMP2G
056284,000263: 01,3734 41054 CS PHSPRDT1 # GET THE DELTA T ADDRESS
056285,000264:
056286,000265: 01,3735 15445 TCF ITSLGCL1 # NOW GET THE DELTA TIME
056287,000266:
056288,000267: 01,3736 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
056289,000268: 01,3737 54706 TS GOLOC +1
056290,000269:
056291,000270: 01,3740 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
056292,000271: 01,3741 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
056293,000272:
056294,000273: 01,3742 13571 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
056295,000274:
Page 1302 |
056297,000276: 01,3743 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
056298,000277:
056299,000278: 01,3744 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
056300,000279: 01,3745 32000 CA PRDTTAB
056301,000280:
056302,000281: 01,3746 13634 TCF CHKNOVAC
056303,000282:
056304,000283: 01,3747 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
056305,000284: 01,3750 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
056306,000285:
056307,000286: 01,3751 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
056308,000287: 01,3752 32002 CA SIZETAB # THE TABLE
056309,000288: 01,3753 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
056310,000289: 01,3754 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
056311,000290: 01,3755 60154 AD TEMPPHS
056312,000291: 01,3756 54156 TS POINTER
056313,000292:
056314,000293: 01,3757 13662 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
056315,000294:
056316,000295: 01,3760 36244 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
056317,000296: 01,3761 26156 ADS POINTER # THE TABLE
056318,000297:
056319,000298: 01,3762 33562 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
056320,000299: 01,3763 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
056321,000300: # GROUP
056322,000301: 01,3764 13662 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
056323,000302:
056324,000303: 01,3765 0154 TEMPPHS EQUALS MPAC
056325,000304: 01,3765 0155 TEMP2G EQUALS MPAC +1
056326,000305: 01,3765 0156 POINTER EQUALS MPAC +2
056327,000306: 01,3765 0157 TEMPSWCH EQUALS MPAC +3
056328,000307: 01,3765 0705 GOLOC EQUALS VAC5 +20D
056329,000308: 01,3765 7745 MINUS2 EQUALS NEG2
056330,000309: 01,3765 6073 OCT177 EQUALS LOW7
056331,000310:
056332,000311: 01,3765 03760 PHS2CADR GENADR PHSPART2
056333,000312: 01,3766 03536 PRT2CADR GENADR GETPART2
056334,000313: 01,3767 05277 LGCLCADR GENADR LONGCALL
056335,000314: 01,3770 05105 FVACCADR GENADR FINDVAC
056336,000315: 01,3771 05203 WTLTCADR GENADR WAITLIST
056337,000316: 01,3772 05072 NOVACADR GENADR NOVAC
056338,000317:
056339,000318:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc