Source Code
This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure! |
054884,000002: ## Copyright: Public domain.
054885,000003: ## Filename: RESTARTS_ROUTINE.agc
054886,000004: ## Purpose: Part of the source code for Luminary 1A build 099.
054887,000005: ## It is part of the source code for the Lunar Module's (LM)
054888,000006: ## Apollo Guidance Computer (AGC), for Apollo 11.
054889,000007: ## Assembler: yaYUL
054890,000008: ## Contact: Onno Hommes <ohommes@cmu.edu>.
054891,000009: ## Website: www.ibiblio.org/apollo.
054892,000010: ## Pages: 1303-1309
054893,000011: ## Mod history: 2009-05-27 OH Transcribed from page images.
054894,000012: ## 2016-12-18 RSB Proofed text comments with octopus/ProoferComments
054895,000013: ## and corrected the errors found.
054896,000014: ## 2017-03-03 RSB Snapshot of Luminary 99 Rev 1.
054897,000015: ## 2017-03-14 RSB Comment-text fixes noted in proofing Luminary 116.
054898,000016: ## 2017-03-16 RSB Comment-text fixes identified in 5-way
054899,000017: ## side-by-side diff of Luminary 69/99/116/131/210.
054900,000018:
Page 1303 |
054902,000020: 01,3526 BANK 01
054903,000021: 01,2000 SETLOC RESTART
054904,000022: 01,2000 BANK
054905,000023:
054906,000024: 01,3526 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
054907,000025:
054908,000026: 01,3526 COUNT* $$/RSROU
054909,000027: 01,3526 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
054910,000028: 01,3527 60000 DOUBLE # SAVE FOR INDEXING
054911,000029: 01,3530 54155 TS TEMP2G
054912,000030:
054913,000031: 01,3531 33770 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
054914,000032: 01,3532 54157 TS TEMPSWCH # TABLE PHASE
054915,000033:
054916,000034: 01,3533 33565 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
054917,000035: 01,3534 54707 TS GOLOC +2 # GROUP AFTER THIS
054918,000036:
054919,000037: 01,3535 30154 CA TEMPPHS
054920,000038: 01,3536 75007 MASK OCT1400
054921,000039: 01,3537 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
054922,000040: 01,3540 13551 TCF ITSAVAR # IT:S A VARIABLE RESTART
054923,000041:
054924,000042: 01,3541 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
054925,000043: 01,3542 10000 CCS A
054926,000044: 01,3543 13651 TCF ITSATBL # NO, ITS A TABLE RESTART
054927,000045:
054928,000046: 01,3544 35024 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
054929,000047: 01,3545 05105 TC FINDVAC # THE DISPLAY RESTART JOB
054930,000048: 01,3546 E3,1400 EBANK= LST1
054931,000049: 01,3546 03037 20103 2CADR INITDSP
054932,000050:
054933,000051: 01,3550 03565 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
054934,000052:
054935,000053: 01,3551 75007 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
054936,000054: 01,3552 10000 CCS A
054937,000055: 01,3553 13622 TCF ITSLIKEB # YES, IT IS TYPE B
054938,000056:
054939,000057: 01,3554 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
054940,000058: 01,3555 50155 NDX TEMP2G
054941,000059: 01,3556 31437 DCA PHSNAME1
054942,000060: 01,3557 52706 DXCH GOLOC
054943,000061:
054944,000062: 01,3560 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
054945,000063: 01,3561 74757 MASK OCT7
054946,000064: 01,3562 67746 AD MINUS2
054947,000065: 01,3563 10000 CCS A
054948,000066: 01,3564 13734 TCF ITSLNGCL # ITS A LONGCALL
054949,000067:
054950,000068: 01,3565 04631 RTRNCADR TC SWRETURN # CANT GET HERE
Page 1304 |
054952,000070: 01,3566 13570 TCF ITSAWAIT
054953,000071:
054954,000072: 01,3567 13635 TCF ITSAJOB # ITS A JOB
054955,000073:
054956,000074: 01,3570 33774 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
054957,000075: 01,3571 54704 TS GOLOC -1
054958,000076:
054959,000077: 01,3572 50155 NDX TEMP2G # DIRECTLY STORED
054960,000078: 01,3573 31054 CA PHSPRDT1
054961,000079: 01,3574 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
054962,000080: 01,3575 24000 INCR A # NO,
054963,000081: 01,3576 13601 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
054964,000082:
054965,000083: 01,3577 15436 TCF ITSINDIR # STORED INDIRECTLY
054966,000084:
054967,000085: 01,3600 13620 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
054968,000086:
054969,000087: # ***** THIS MUST BE IN FIXED FIXED *****
054970,000088:
054971,000089: 5436 BLOCK 02
054972,000090: 4000 SETLOC FFTAG2
054973,000091: 4000 BANK
054974,000092:
054975,000093: 5436 COUNT* $$/RSROU
054976,000094: 5436 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
054977,000095: 5437 22006 LXCH BB # SWITCHED ERRASIBLE
054978,000096:
054979,000097: 5440 50000 NDX A # GET THE TIME INDIRECTLY
054980,000098: 5441 30001 CA 1
054981,000099:
054982,000100: 5442 22006 LXCH BB # RESTORE THE BB AND GOLOC
054983,000101: 5443 22706 LXCH GOLOC +1
054984,000102:
054985,000103: 5444 13601 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
054986,000104:
054987,000105: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
054988,000106:
054989,000107: 01,3601 BANK 01
054990,000108: 01,2000 SETLOC RESTART
054991,000109: 01,2000 BANK
054992,000110:
054993,000111: 01,3601 COUNT* $$/RSROU
054994,000112: 01,3601 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
054995,000113: 01,3602 54001 TS L # AND SAVE
054996,000114: 01,3603 50155 NDX TEMP2G
054997,000115: 01,3604 41053 CS TBASE1
054998,000116: 01,3605 00006 EXTEND
054999,000117: 01,3606 60025 SU TIME1
055000,000118: 01,3607 10000 CCS A
055001,000119: 01,3610 40000 COM
Page 1305 |
055003,000121: 01,3611 67731 AD OCT37776
055004,000122: 01,3612 64753 AD ONE
055005,000123: 01,3613 60001 AD L
055006,000124: 01,3614 10000 CCS A
055007,000125: 01,3615 34755 CA ZERO
055008,000126: 01,3616 13620 TCF +2
055009,000127: 01,3617 13620 TCF +1
055010,000128: 01,3620 64753 IMEDIATE AD ONE
055011,000129: 01,3621 00704 TC GOLOC -1
055012,000130: 01,3622 33565 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
055013,000131: 01,3623 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
055014,000132:
055015,000133: 01,3624 33771 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
055016,000134: 01,3625 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
055017,000135:
055018,000136: 01,3626 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
055019,000137: 01,3627 76074 MASK OCT177 # PART OF THIS VARIABLE PHASE
055020,000138: 01,3630 54154 TS TEMPPHS
055021,000139:
055022,000140: 01,3631 00006 EXTEND
055023,000141: 01,3632 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
055024,000142: 01,3633 31437 DCA PHSNAME1
055025,000143: 01,3634 52706 DXCH GOLOC
055026,000144:
055027,000145: 01,3635 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
055028,000146: 01,3636 31054 CA PHSPRDT1
055029,000147: 01,3637 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
055030,000148: 01,3640 00006 EXTEND # A FINDVAC OR A NOVAC
055031,000149: 01,3641 63645 BZMF ITSNOVAC
055032,000150:
055033,000151: 01,3642 33773 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
055034,000152: 01,3643 56704 XCH GOLOC -1 # PICK UP PRIO,
055035,000153: 01,3644 00704 TC GOLOC -1 # AND GO
055036,000154:
055037,000155: 01,3645 33775 ITSNOVAC CAF NOVACADR # NEGATIVE,
055038,000156: 01,3646 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
055039,000157: 01,3647 40000 COM # CORRECT PRIO,
055040,000158: 01,3650 00704 TC GOLOC -1 # AND GO
055041,000159:
055042,000160: 01,3651 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
055043,000161: 01,3652 10020 CCS CYR
055044,000162: 01,3653 13654 TCF +1 # IT:S EVEN
055045,000163: 01,3654 13752 TCF ITSEVEN
055046,000164:
055047,000165: 01,3655 33565 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
055048,000166: 01,3656 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
055049,000167:
055050,000168: 01,3657 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
055051,000169: 01,3660 54021 TS SR # THE RESTART TABLES
055052,000170: 01,3661 60021 AD SR
Page 1306 |
055054,000172: 01,3662 50155 NDX TEMP2G
055055,000173: 01,3663 62003 AD SIZETAB +1
055056,000174: 01,3664 54156 TS POINTER
055057,000175:
055058,000176: 01,3665 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
055059,000177: 01,3666 50156 NDX POINTER
055060,000178: 01,3667 32002 DCA CADRTAB # GET THE 2CADR
055061,000179:
055062,000180: 01,3670 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
055063,000181:
055064,000182: 01,3671 10000 CCS A # IS IT A JOB OR IS IT TIMED
055065,000183: 01,3672 24000 INCR A # POSITIVE, MUST BE A JOB
055066,000184: 01,3673 13746 TCF ITSAJOB2
055067,000185:
055068,000186: 01,3674 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
055069,000187: 01,3675 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
055070,000188:
055071,000189: 01,3676 33774 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
055072,000190: 01,3677 54704 TS GOLOC -1
055073,000191:
055074,000192: 01,3700 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
055075,000193: 01,3701 74742 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
055076,000194: 01,3702 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
055077,000195: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
055078,000196: # IN IMPORTANCE ANYWAY. BIT 4
055079,000197: 01,3703 13741 TCF ITSWTLST # IT IS A WAITLIST CALL
055080,000198:
055081,000199: 01,3704 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
055082,000200: 01,3705 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
055083,000201:
055084,000202: 01,3706 15445 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
055085,000203:
055086,000204: # ***** THIS MUST BE IN FIXED FIXED *****
055087,000205:
055088,000206: 5445 BLOCK 02
055089,000207: 4000 SETLOC FFTAG2
055090,000208: 4000 BANK
055091,000209:
055092,000210: 5445 COUNT* $$/RSROU
055093,000211: 5445 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
055094,000212: 5446 22006 LXCH BB
055095,000213: 5447 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
055096,000214:
055097,000215: 5450 00006 EXTEND # GET THE DELTA TIME
055098,000216: 5451 50000 NDX A
055099,000217: 5452 30001 DCA 0
055100,000218:
055101,000219: 5453 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
055102,000220: 5454 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
055103,000221: 5455 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
Page 1307 |
055105,000223: 5456 13707 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
055106,000224:
055107,000225: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
055108,000226:
055109,000227: 01,3707 BANK 01
055110,000228: 01,2000 SETLOC RESTART
055111,000229: 01,2000 BANK
055112,000230:
055113,000231: 01,3707 COUNT* $$/RSROU
055114,000232: 01,3707 53154 ITSLGCL2 DXCH LONGTIME
055115,000233:
055116,000234: 01,3710 00006 EXTEND # CALCULATE TIME LEFT
055117,000235: 01,3711 40025 DCS TIME2
055118,000236: 01,3712 21154 DAS LONGTIME
055119,000237: 01,3713 00006 EXTEND
055120,000238: 01,3714 31152 DCA LONGBASE
055121,000239: 01,3715 21154 DAS LONGTIME
055122,000240:
055123,000241: 01,3716 11153 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
055124,000242: 01,3717 13727 TCF LONGCLCL
055125,000243: 01,3720 13722 TCF +2
055126,000244: 01,3721 13615 TCF IMEDIATE -3
055127,000245: 01,3722 11154 CCS LONGTIME +1
055128,000246: 01,3723 13727 TCF LONGCLCL
055129,000247: 01,3724 13725 NOOP # CAN:T GET HERE *********
055130,000248: 01,3725 13615 TCF IMEDIATE -3
055131,000249: 01,3726 13620 TCF IMEDIATE
055132,000250:
055133,000251: 01,3727 33772 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
055134,000252: 01,3730 54704 TS GOLOC -1
055135,000253:
055136,000254: 01,3731 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
055137,000255: 01,3732 31154 DCA LONGTIME
055138,000256: 01,3733 00704 TC GOLOC -1
055139,000257:
055140,000258: 01,3734 33774 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
055141,000259: 01,3735 54704 TS GOLOC -1
055142,000260:
055143,000261: 01,3736 50155 NDX TEMP2G
055144,000262: 01,3737 41054 CS PHSPRDT1 # GET THE DELTA T ADDRESS
055145,000263:
055146,000264: 01,3740 15445 TCF ITSLGCL1 # NOW GET THE DELTA TIME
055147,000265:
055148,000266: 01,3741 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
055149,000267: 01,3742 54706 TS GOLOC +1
055150,000268:
055151,000269: 01,3743 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
055152,000270: 01,3744 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
055153,000271:
055154,000272: 01,3745 13574 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
055155,000273:
Page 1308 |
055157,000275: 01,3746 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
055158,000276:
055159,000277: 01,3747 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
055160,000278: 01,3750 32000 CA PRDTTAB
055161,000279:
055162,000280: 01,3751 13637 TCF CHKNOVAC
055163,000281:
055164,000282: 01,3752 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
055165,000283: 01,3753 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
055166,000284:
055167,000285: 01,3754 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
055168,000286: 01,3755 32002 CA SIZETAB # THE TABLE
055169,000287: 01,3756 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
055170,000288: 01,3757 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
055171,000289: 01,3760 60154 AD TEMPPHS
055172,000290: 01,3761 54156 TS POINTER
055173,000291:
055174,000292: 01,3762 13665 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
055175,000293:
055176,000294: 01,3763 36245 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
055177,000295: 01,3764 26156 ADS POINTER # THE TABLE
055178,000296:
055179,000297: 01,3765 33565 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
055180,000298: 01,3766 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
055181,000299: # GROUP
055182,000300: 01,3767 13665 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
055183,000301:
055184,000302: 01,3770 0154 TEMPPHS EQUALS MPAC
055185,000303: 01,3770 0155 TEMP2G EQUALS MPAC +1
055186,000304: 01,3770 0156 POINTER EQUALS MPAC +2
055187,000305: 01,3770 0157 TEMPSWCH EQUALS MPAC +3
055188,000306: 01,3770 0705 GOLOC EQUALS VAC5 +20D
055189,000307: 01,3770 7746 MINUS2 EQUALS NEG2
055190,000308: 01,3770 6074 OCT177 EQUALS LOW7
055191,000309:
055192,000310: 01,3770 03763 PHS2CADR GENADR PHSPART2
055193,000311: 01,3771 03541 PRT2CADR GENADR GETPART2
055194,000312: 01,3772 05277 LGCLCADR GENADR LONGCALL
055195,000313: 01,3773 05105 FVACCADR GENADR FINDVAC
055196,000314: 01,3774 05203 WTLTCADR GENADR WAITLIST
055197,000315: 01,3775 05072 NOVACADR GENADR NOVAC
055198,000316:
055199,000317:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc