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! |
058840,000002: ## Copyright: Public domain.
058841,000003: ## Filename: RTB_OP_CODES.agc
058842,000004: ## Purpose: Part of the source code for Luminary 1A build 099.
058843,000005: ## It is part of the source code for the Lunar Module's (LM)
058844,000006: ## Apollo Guidance Computer (AGC), for Apollo 11.
058845,000007: ## Assembler: yaYUL
058846,000008: ## Contact: Ron Burkey <info@sandroid.org>.
058847,000009: ## Website: www.ibiblio.org/apollo.
058848,000010: ## Pages: 1397-1401
058849,000011: ## Mod history: 2009-05-10 SN (Sergio Navarro). Started adapting
058850,000012: ## from the Luminary131/ file of the same
058851,000013: ## name, using Luminary099 page images.
058852,000014: ## 2016-12-18 RSB Proofed text comments with octopus/ProoferComments
058853,000015: ## and corrected the errors found.
058854,000016: ## 2017-03-03 RSB Snapshot of Luminary 99 Rev 1.
058855,000017:
Page 1397 |
058857,000019: 22,3773 BANK 22
058858,000020: 10,2000 SETLOC RTBCODES
058859,000021: 10,2000 BANK
058860,000022:
058861,000023: 10,3573 E5,1664 EBANK= XNB
058862,000024: 10,3573 COUNT* $$/RTB
058863,000025:
058864,000026: # LOAD TIME2, TIME1 INTO MPAC:
058865,000027:
058866,000028: 10,3573 00006 LOADTIME EXTEND
058867,000029: 10,3574 30025 DCA TIME2
058868,000030: 10,3575 16055 TCF SLOAD2
058869,000031:
058870,000032: # CONVERT THE SINGLE PRECISION 2'S COMPLEMENT NUMBER ARRIVING IN MPAC (SCALED IN HALF-REVOLUTIONS) TO A
058871,000033: # DP 1'S COMPLEMENT NUMBER SCALED IN REVOLUTIONS.
058872,000034:
058873,000035: 10,3576 10154 CDULOGIC CCS MPAC
058874,000036: 10,3577 34755 CAF ZERO
058875,000037: 10,3600 13603 TCF +3
058876,000038: 10,3601 13602 NOOP
058877,000039: 10,3602 44736 CS HALF
058878,000040:
058879,000041: 10,3603 54155 TS MPAC +1
058880,000042: 10,3604 34755 CAF ZERO
058881,000043: 10,3605 56154 XCH MPAC
058882,000044: 10,3606 00006 EXTEND
058883,000045: 10,3607 74736 MP HALF
058884,000046: 10,3610 20155 DAS MPAC
058885,000047: 10,3611 16061 TCF DANZIG # MODE IS ALREADY AT DOUBLE-PRECISION
058886,000048:
058887,000049: # FORCE TP SIGN AGREEMENT IN MPAC:
058888,000050:
058889,000051: 10,3612 07257 SGNAGREE TC TPAGREE
058890,000052: 10,3613 16061 TCF DANZIG
058891,000053:
058892,000054: # CONVERT THE DP 1'S COMPLEMENT ANGLE SCALED IN REVOLUTIONS TO A SINGLE PRECISION 2'S COMPLEMENT ANGLE
058893,000055: # SCALED IN HALF-REVOLUTIONS.
058894,000056:
058895,000057: 10,3614 03644 1STO2S TC 1TO2SUB
058896,000058: 10,3615 34755 CAF ZERO
058897,000059: 10,3616 54155 TS MPAC +1
058898,000060: 10,3617 16060 TCF NEWMODE
058899,000061:
058900,000062: # DO 1STO2S ON A VECTOR OF ANGLES:
058901,000063:
058902,000064: 10,3620 03644 V1STO2S TC 1TO2SUB # ANSWER ARRIVES IN A AND MPAC.
058903,000065:
058904,000066: 10,3621 52162 DXCH MPAC +5
058905,000067: 10,3622 52155 DXCH MPAC
058906,000068: 10,3623 03644 TC 1TO2SUB
Page 1398 |
058908,000070: 10,3624 54156 TS MPAC +2
058909,000071:
058910,000072: 10,3625 52160 DXCH MPAC +3
058911,000073: 10,3626 52155 DXCH MPAC
058912,000074: 10,3627 03644 TC 1TO2SUB
058913,000075: 10,3630 54155 TS MPAC +1
058914,000076:
058915,000077: 10,3631 30161 CA MPAC +5
058916,000078: 10,3632 54154 TS MPAC
058917,000079:
058918,000080: 10,3633 34753 TPMODE CAF ONE # MODE IS TP.
058919,000081: 10,3634 16060 TCF NEWMODE
058920,000082:
058921,000083: # V1STO2S FOR 2 COMPONENT VECTOR. USED BY RR.
058922,000084:
058923,000085: 10,3635 03644 2V1STO2S TC 1TO2SUB
058924,000086: 10,3636 52160 DXCH MPAC +3
058925,000087: 10,3637 52155 DXCH MPAC
058926,000088: 10,3640 03644 TC 1TO2SUB
058927,000089: 10,3641 54001 TS L
058928,000090: 10,3642 30157 CA MPAC +3
058929,000091: 10,3643 16055 TCF SLOAD2
058930,000092:
058931,000093: # SUBROUTINE TO DO DOUBLING AND 1'S TO 2'S CONVERSION:
058932,000094:
058933,000095: 10,3644 52155 1TO2SUB DXCH MPAC # FINAL MPAC +1 UNSPECIFIED.
058934,000096: 10,3645 20001 DDOUBL
058935,000097: 10,3646 10000 CCS A
058936,000098: 10,3647 64753 AD ONE
058937,000099: 10,3650 13652 TCF +2
058938,000100: 10,3651 40000 COM # THIS WAS REVERSE OF MSU.
058939,000101:
058940,000102: 10,3652 54154 TS MPAC # AND SKIP ON OVERFLOW.
058941,000103: 10,3653 00002 TC Q
058942,000104:
058943,000105: 10,3654 50000 INDEX A # OVERFLOW UNCORRECT AND IN MSU.
058944,000106: 10,3655 34734 CAF LIMITS
058945,000107: 10,3656 26154 ADS MPAC
058946,000108: 10,3657 00002 TC Q
058947,000109:
058948,000110: # THE FOLLOWING ROUTINE INCREMENTS IN 2S COMPLEMENT THE REGISTER WHOSE ADDRESS IS IN BUF BY THE 1S COMPL.
058949,000111: # QUANTITY FOUND IN TEM2. THIS MAY BE USED TO INCREMENT DESIRED IMU AND OPTICS CDU ANGLES OR ANY OTHER 2S COMPL.
058950,000112: # (+0 UNEQUAL TO -0) QUANTITY. MAY BE CALLED BY BANKCALL/SWCALL.
058951,000113:
058952,000114: 10,3660 54142 CDUINC TS TEM2 # 1S COMPL.QUANT. ARRIVES IN ACC. STORE IT
058953,000115: 10,3661 50130 INDEX BUF
058954,000116: 10,3662 10000 CCS 0 # CHANGE 2S COMPL. ANGLE(IN BUF)INTO 1S
058955,000117: 10,3663 64753 AD ONE
058956,000118: 10,3664 13670 TCF +4
058957,000119: 10,3665 64753 AD ONE
Page 1399 |
058959,000121: 10,3666 64753 AD ONE # OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
058960,000122: 10,3667 40000 COM
058961,000123:
058962,000124: 10,3670 60142 AD TEM2 # SULT MOVES FROM 2ND TO 3D QUAD. (OR BACK)
058963,000125: 10,3671 10000 CCS A # BACK TO 2S COMPL.
058964,000126: 10,3672 64753 AD ONE
058965,000127: 10,3673 13675 TCF +2
058966,000128: 10,3674 40000 COM
058967,000129: 10,3675 54142 TS TEM2 # STORE 14BIT QUANTITY WITH PRESENT SIGN
058968,000130: 10,3676 13702 TCF +4
058969,000131: 10,3677 50000 INDEX A # SIGN.
058970,000132: 10,3700 34734 CAF LIMITS # FIX IT, BY ADDING IN 37777 OR 40000
058971,000133: 10,3701 60142 AD TEM2
058972,000134:
058973,000135: 10,3702 50130 INDEX BUF
058974,000136: 10,3703 54000 TS 0 # STORE NEW ANGLE IN 2S COMPLEMENT.
058975,000137: 10,3704 00002 TC Q
058976,000138:
Page 1400 |
058978,000140: # RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
058979,000141:
058980,000142: 10,3705 50120 PULSEIMU INDEX FIXLOC # ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
058981,000143: 10,3706 30046 CA X1
058982,000144: 10,3707 04616 TC BANKCALL
058983,000145: 10,3710 17323 CADR IMUPULSE
058984,000146: 10,3711 16061 TCF DANZIG
058985,000147:
Page 1401 |
058987,000149: # THE SUBROUTINE SIGNMPAC SETS C(MPAC, MPAC +1) TO SIGN(MPAC).
058988,000150: # FOR THIS, ONLY THE CONTENTS OF MPAC ARE EXAMINED. ALSO +0 YIELDS POSMAX AND -0 YIELDS NEGMAX.
058989,000151:
058990,000152: # ENTRY MAY BE BY EITHER OF THE FOLLOWING:
058991,000153: # 1. LIMIT THE SIZE OF MPAC ON INTERPRETIVE OVERFLOW:
058992,000154: # ENTRY: BOVB
058993,000155: # SIGNMPAC
058994,000156: # 2. GENERATE IN MPAC THE SIGNUM FUNCTION OF MPAC:
058995,000157: # ENTRY: RTB
058996,000158: # SIGNMPAC
058997,000159: # IN EITHER CASE, RETURN IS TO THE NEXT INTERPRETIVE INSTRUCTION IN THE CALLING SEQUENCE.
058998,000160:
058999,000161: 10,3712 00006 SIGNMPAC EXTEND
059000,000162: 10,3713 34733 DCA DPOSMAX
059001,000163: 10,3714 52155 DXCH MPAC
059002,000164: 10,3715 10000 CCS A
059003,000165: 10,3716 34755 DPMODE CAF ZERO # SETS MPAC +2 TO ZERO IN THE PROCESS
059004,000166: 10,3717 16057 TCF SLOAD2 +2
059005,000167: 10,3720 13721 TCF +1
059006,000168: 10,3721 00006 EXTEND
059007,000169: 10,3722 44733 DCS DPOSMAX
059008,000170: 10,3723 16055 TCF SLOAD2
059009,000171:
059010,000172: # RTB OP CODE NORMUNIT IS LIKE INTERPRETIVE INSTRUCTION UNIT, EXCEPT THAT IT CAN BE DEPENDED ON NOT TO BLOW
059011,000173: # UP WHEN THE VECTOR BEING UNITIZED IS VERY SMALL -- IT WILL BLOW UP WHEN ALL COMPONENTS ARE ZERO. IF NORMUNIT
059012,000174: # IS USED AND THE UPPER ORDER HALVES OF ALL COMPONENTS ARE ZERO, THE MAGNITUDE RETURNED IN 36D WILL BE TOO LARGE
059013,000175: # BY A FACTOR OF 2(13) AND THE SQUARED MAGNITUDE RETURNED AT 34D WILL BE TOO BIG BY A FACTOR OF 2(26).
059014,000176:
059015,000177: 10,3724 34753 NORMUNX1 CAF ONE
059016,000178: 10,3725 13727 TCF NORMUNIT +1
059017,000179: 10,3726 34755 NORMUNIT CAF ZERO
059018,000180: 10,3727 60120 AD FIXLOC
059019,000181: 10,3730 54156 TS MPAC +2
059020,000182: 10,3731 04616 TC BANKCALL # GET SIGN AGREEMENT IN ALL COMPONENTS
059021,000183: 10,3732 01010 CADR VECAGREE
059022,000184: 10,3733 10154 CCS MPAC
059023,000185: 10,3734 13770 TCF NOSHIFT
059024,000186: 10,3735 13737 TCF +2
059025,000187: 10,3736 13770 TCF NOSHIFT
059026,000188: 10,3737 10157 CCS MPAC +3
059027,000189: 10,3740 13770 TCF NOSHIFT
059028,000190: 10,3741 13743 TCF +2
059029,000191: 10,3742 13770 TCF NOSHIFT
059030,000192: 10,3743 10161 CCS MPAC +5
059031,000193: 10,3744 13770 TCF NOSHIFT
059032,000194: 10,3745 13747 TCF +2
059033,000195: 10,3746 13770 TCF NOSHIFT
Page 1402 |
059035,000197: 10,3747 30155 CA MPAC +1 # SHIFT ALL COMPONENTS LEFT 13
059036,000198: 10,3750 00006 EXTEND
059037,000199: 10,3751 74736 MP BIT14
059038,000200: 10,3752 20155 DAS MPAC # DAS GAINS A LITTLE ACCURACY
059039,000201: 10,3753 30160 CA MPAC +4
059040,000202: 10,3754 00006 EXTEND
059041,000203: 10,3755 74736 MP BIT14
059042,000204: 10,3756 20160 DAS MPAC +3
059043,000205: 10,3757 30162 CA MPAC +6
059044,000206: 10,3760 00006 EXTEND
059045,000207: 10,3761 74736 MP BIT14
059046,000208: 10,3762 20162 DAS MPAC +5
059047,000209: 10,3763 34761 CAF THIRTEEN
059048,000210: 10,3764 50156 INDEX MPAC +2
059049,000211: 10,3765 54045 TS 37D
059050,000212: 10,3766 04635 OFFTUNIT TC POSTJUMP
059051,000213: 10,3767 01024 CADR UNIT +1 # SKIP THE "TC VECAGREE" DONE AT UNIT
059052,000214:
059053,000215: 10,3770 34755 NOSHIFT CAF ZERO
059054,000216: 10,3771 13764 TCF OFFTUNIT -2
059055,000217:
059056,000218: # RTB VECSGNAG ... FORCES SIGN AGREEMENT OF VECTOR IN MPAC.
059057,000219:
059058,000220: 10,3772 04616 VECSGNAG TC BANKCALL
059059,000221: 10,3773 01010 CADR VECAGREE
059060,000222: 10,3774 06061 TC DANZIG
059061,000223:
059062,000224:
End of include-file RTB_OP_CODES.agc. Parent file is MAIN.agc