Source Code
These source-code files are part of a reconstructed copy of Sundial E, the
final release of the Block II Command Module (CM) Apollo Guidance Computer
(AGC) system test software.
They have been created via disassembly of binary dumps of original core rope memory modules, part numbers 2003053-121, 2003053-151, and 2003972-211, belonging to the MIT Museum. Since only binary dumps (rather than listings) of Sundial are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
014116,000002: ## Copyright: Public domain.
014117,000003: ## Filename: RTB_OP_CODES.agc
014118,000004: ## Purpose: A section of Sundial E.
014119,000005: ## It is part of the reconstructed source code for the final
014120,000006: ## release of the Block II Command Module system test software. No
014121,000007: ## original listings of this program are available; instead, this
014122,000008: ## file was created via disassembly of dumps of Sundial core rope
014123,000009: ## modules and comparison with other AGC programs.
014124,000010: ## Assembler: yaYUL
014125,000011: ## Contact: Ron Burkey <info@sandroid.org>.
014126,000012: ## Website: www.ibiblio.org/apollo/index.html
014127,000013: ## Mod history: 2023-06-22 MAS Created from Aurora 12.
014128,000014: ## 2023-06-30 MAS Updated for Sundial E.
014129,000015:
014130,000016: 04,3534 SETLOC ENDPINS1
014131,000017:
014132,000018: # LOAD TIME2, TIME1 INTO MPAC:
014133,000019:
014134,000020: 04,3534 00006 LOADTIME EXTEND
014135,000021: 04,3535 30025 DCA TIME2
014136,000022: 04,3536 16470 TCF SLOAD2
014137,000023:
014138,000024: # CONVERT THE SINGLE PRECISION 2'S COMPLEMENT NUMBER ARRIVING IN MPAC (SCALED IN HALF-REVOLUTIONS) TO A
014139,000025: # DP 1'S COMPLEMENT NUMBER SCALED IN REVOLUTIONS.
014140,000026:
014141,000027: 04,3537 10140 CDULOGIC CCS MPAC
014142,000028: 04,3540 37657 CAF ZERO
014143,000029: 04,3541 13544 TCF +3
014144,000030: 04,3542 13543 NOOP
014145,000031: 04,3543 47635 CS HALF
014146,000032:
014147,000033: 04,3544 54141 TS MPAC +1
014148,000034: 04,3545 37657 CAF ZERO
014149,000035: 04,3546 56140 XCH MPAC
014150,000036: 04,3547 00006 EXTEND
014151,000037: 04,3550 77635 MP HALF
014152,000038: 04,3551 20141 DAS MPAC
014153,000039: 04,3552 16472 TCF SLOAD2 +2 # C(A) = +0.
014154,000040:
014155,000041: # READ IMU CDUS INTO MPAC AS A VECTOR. ESPECIALLY USEFUL IN CONNECTION WITH SMNB, ETC.
014156,000042:
014157,000043: 04,3553 00004 READCDUS INHINT
014158,000044: 04,3554 30033 CA CDUY # IN ORDER Y Z X
014159,000045: 04,3555 54140 TS MPAC
014160,000046: 04,3556 30034 CA CDUZ
014161,000047: 04,3557 54143 TS MPAC +3
014162,000048: 04,3560 30032 CA CDUX
014163,000049: 04,3561 13570 TCF READPIPS +6 # COMMON CODING.
014164,000050:
014165,000051: # READ THE PIPS INTO MPAC WITHOUT CHANGING THEM:
014166,000052:
014167,000053: 04,3562 00004 READPIPS INHINT
014168,000054: 04,3563 30037 CA PIPAX
014169,000055: 04,3564 54140 TS MPAC
014170,000056: 04,3565 30040 CA PIPAY
014171,000057: 04,3566 54143 TS MPAC +3
014172,000058: 04,3567 30041 CA PIPAZ
014173,000059: 04,3570 00003 RELINT
014174,000060: 04,3571 54145 TS MPAC +5
014175,000061:
014176,000062: 04,3572 37657 CAF ZERO
014177,000063: 04,3573 54141 TS MPAC +1
014178,000064: 04,3574 54144 TS MPAC +4
014179,000065: 04,3575 54146 TS MPAC +6
014180,000066:
014181,000067: 04,3576 47652 VECMODE CS ONE
014182,000068: 04,3577 16013 TCF NEWMODE
014183,000069:
014184,000070: # FORCE TP SIGN AGREEMENT IN MPAC:
014185,000071:
014186,000072: 04,3600 07230 SGNAGREE TC TPAGREE
014187,000073: 04,3601 16014 TCF DANZIG
014188,000074:
014189,000075: # CONVERT THE DP 1'S COMPLEMENT ANGLE SCALED IN REVOLUTIONS TO A SINGLE PRECISION 2'S COMPLEMENT ANGLE
014190,000076: # SCALED IN HALF-REVOLUTIONS.
014191,000077:
014192,000078: 04,3602 03632 1STO2S TC 1TO2SUB
014193,000079: 04,3603 37657 CAF ZERO
014194,000080: 04,3604 54141 TS MPAC +1
014195,000081: 04,3605 16013 TCF NEWMODE
014196,000082:
014197,000083: # DO 1STO2S ON A VECTOR OF ANGLES:
014198,000084:
014199,000085: 04,3606 03632 V1STO2S TC 1TO2SUB # ANSWER ARRIVES IN A AND MPAC.
014200,000086:
014201,000087: 04,3607 52146 DXCH MPAC +5
014202,000088: 04,3610 52141 DXCH MPAC
014203,000089: 04,3611 03632 TC 1TO2SUB
014204,000090: 04,3612 54142 TS MPAC +2
014205,000091:
014206,000092: 04,3613 52144 DXCH MPAC +3
014207,000093: 04,3614 52141 DXCH MPAC
014208,000094: 04,3615 03632 TC 1TO2SUB
014209,000095: 04,3616 54141 TS MPAC +1
014210,000096:
014211,000097: 04,3617 30145 CA MPAC +5
014212,000098: 04,3620 54140 TS MPAC
014213,000099:
014214,000100: 04,3621 37652 CAF ONE # MODE IS TP.
014215,000101: 04,3622 16013 TCF NEWMODE
014216,000102:
014217,000103: # V1STO2S FOR 2 COMPONENT VECTOR, USED BY RR.
014218,000104:
014219,000105: 04,3623 03632 2V1STO2S TC 1TO2SUB
014220,000106: 04,3624 52144 DXCH MPAC +3
014221,000107: 04,3625 52141 DXCH MPAC
014222,000108: 04,3626 03632 TC 1TO2SUB
014223,000109: 04,3627 54001 TS L
014224,000110: 04,3630 30143 CA MPAC +3
014225,000111: 04,3631 16470 TCF SLOAD2
014226,000112:
014227,000113: # SUBROUTINE TO DO DOUBLING AND 1'S TO 2'S COMVERSION:
014228,000114:
014229,000115: 04,3632 52141 1TO2SUB DXCH MPAC # FINAL MPAC +1 UNSPECIFIED.
014230,000116: 04,3633 20001 DDOUBL
014231,000117: 04,3634 10000 CCS A
014232,000118: 04,3635 67652 AD ONE
014233,000119: 04,3636 13640 TCF +2
014234,000120: 04,3637 40000 COM # THIS WAS REVERSE OF MSU.
014235,000121:
014236,000122: 04,3640 54140 TS MPAC # AND SKIP ON OVERFLOW.
014237,000123: 04,3641 00002 TC Q
014238,000124:
014239,000125: 04,3642 50000 INDEX A # OVERFLOW UNCORRECT AND IN MSU.
014240,000126: 04,3643 37633 CAF LIMITS
014241,000127: 04,3644 26140 ADS MPAC
014242,000128: 04,3645 00002 TC Q
014243,000129:
014244,000130: # SUBROUTINE TO INCREMENT CDUS
014245,000131: 04,3646 33661 INCRCDUS CAF LOCTHETA
014246,000132: 04,3647 54114 TS BUF # PLACE ADRES(THETA) IN BUF.
014247,000133: 04,3650 30140 CAE MPAC # INCREMENT IN 1S COMPL.
014248,000134: 04,3651 03662 TC CDUINC
014249,000135:
014250,000136: 04,3652 24114 INCR BUF
014251,000137: 04,3653 30143 CAE MPAC +3
014252,000138: 04,3654 03662 TC CDUINC
014253,000139:
014254,000140: 04,3655 24114 INCR BUF
014255,000141: 04,3656 30145 CAE MPAC +5
014256,000142: 04,3657 03662 TC CDUINC
014257,000143:
014258,000144: 04,3660 13576 TCF VECMODE
014259,000145:
014260,000146: 04,3661 00400 LOCTHETA ADRES THETAD
014261,000147:
014262,000148: # THE FOLLOWING ROUTINE INCREMENTS IN 2S COMPLEMENT THE REGISTER WHOSE ADDRESS IS IN BUF BY THE 1S COMPL.
014263,000149: # QUANTITY FOUND IN TEM2. THIS MAY BE USED TO INCREMENT DESIRED IMU AND OPTICS CDU ANGLES OR ANY OTHER 2S COMPL.
014264,000150: # (+0 UNEQUAL TO -0) QUANTITY. MAY BE CALLED BY BANKCALL/SWCALL.
014265,000151:
014266,000152: 04,3662 54126 CDUINC TS TEM2 # 1S COMPL.QUANT. ARRIVES IN ACC. STORE IT
014267,000153: 04,3663 50114 INDEX BUF
014268,000154: 04,3664 10000 CCS 0 # CHANGE 2S COMPL. ANGLE(IN BUF)INTO 1S
014269,000155: 04,3665 67652 AD ONE
014270,000156: 04,3666 13672 TCF +4
014271,000157: 04,3667 67652 AD ONE
014272,000158: 04,3670 67652 AD ONE # OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
014273,000159: 04,3671 40000 COM
014274,000160:
014275,000161: 04,3672 60126 AD TEM2 # ADD IN INCREMENT. WILL OVERFLOW IF RE-
014276,000162: # SULT MOVES FROM 2ND TO 3D QUAD.(OR BACK)
014277,000163: 04,3673 10000 CCS A # BACK TO 2S COMPL.
014278,000164: 04,3674 67652 AD ONE
014279,000165: 04,3675 13677 TCF +2
014280,000166: 04,3676 40000 COM
014281,000167: 04,3677 54126 TS TEM2 # STORE 14BIT QUANTITY WITH PRESENT SIGN
014282,000168: 04,3700 13704 TCF +4
014283,000169: 04,3701 50000 INDEX A # OVERFLOW MEANS CORRECT 14BIT VALUE,WRONG
014284,000170: # SIGN.
014285,000171: 04,3702 37633 CAF LIMITS # FIX IT,BY ADDING IN 37777 OR 40000
014286,000172: 04,3703 60126 AD TEM2
014287,000173:
014288,000174: 04,3704 50114 INDEX BUF
014289,000175: 04,3705 54000 TS 0 # STORE NEW ANGLE IN 2S COMPLEMENT.
014290,000176: 04,3706 00002 TC Q
014291,000177:
014292,000178: # RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
014293,000179:
014294,000180: 04,3707 50104 PULSEIMU INDEX FIXLOC # ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
014295,000181: 04,3710 30046 CA X1
014296,000182: 04,3711 04064 TC BANKCALL
014297,000183: 04,3712 26333 CADR IMUPULSE
014298,000184: 04,3713 16014 TCF DANZIG
014299,000185:
014300,000186: 04,3714 00004 PIPREAD INHINT
014301,000187: 04,3715 37657 CAF ZERO
014302,000188: 04,3716 56037 XCH PIPAX
014303,000189: 04,3717 54140 TS MPAC
014304,000190: 04,3720 37657 CAF ZERO
014305,000191: 04,3721 56040 XCH PIPAY
014306,000192: 04,3722 54143 TS MPAC +3
014307,000193: 04,3723 37657 CAF ZERO
014308,000194: 04,3724 56041 XCH PIPAZ
014309,000195: 04,3725 00003 RELINT
014310,000196: 04,3726 54145 TS MPAC +5
014311,000197:
014312,000198: 04,3727 37657 CAF ZERO
014313,000199: 04,3730 54141 TS MPAC +1
014314,000200: 04,3731 54144 TS MPAC +4
014315,000201: 04,3732 54146 TS MPAC +6
014316,000202:
014317,000203: 04,3733 13576 TCF VECMODE
014318,000204:
014319,000205: # TRANSPSE COMPUTES THE TRANSPOSE OF A MATRIX (TRANSPOSE = INVERSE OF ORTHOGONAL TRANSFORMATION).
014320,000206:
014321,000207: # THE INPUT IS A MATRIX DEFINING COORDINATE SYSTEM A WITH RESPECT TO COORDINATE SYSTEM B STORED IN STARAD THRU
014322,000208: # STARAD +17D.
014323,000209:
014324,000210: # THE OUTPUT IS A MATRIX DEFINING COORDINATE SYSTEM B WITH RESPECT TO COORDINATE SYSTEM A STORED IN STARAD THRU
014325,000211: # STARAD +17D.
014326,000212:
014327,000213: 04,3734 53447 TRANSPSE DXCH STARAD +2 # PUSHDOWN NONE
014328,000214: 04,3735 53453 DXCH STARAD +6
014329,000215: 04,3736 53447 DXCH STARAD +2
014330,000216:
014331,000217: 04,3737 53451 DXCH STARAD +4
014332,000218: 04,3740 53461 DXCH STARAD +12D
014333,000219: 04,3741 53451 DXCH STARAD +4
014334,000220:
014335,000221: 04,3742 53457 DXCH STARAD +10D
014336,000222: 04,3743 53463 DXCH STARAD +14D
014337,000223: 04,3744 53457 DXCH STARAD +10D
014338,000224: 04,3745 16014 TCF DANZIG
014339,000225:
014340,000226: # EACH ROUTINE TAKES A 3X3 MATRIX STORED IN DOUBLE PRECISION IN A FIXED AREA OF ERASABLE MEMORY AND REPLACES IT
014341,000227: # WITH THE TRANSPOSE MATRIX. TRANSP1 USES LOCATIONS XNB+0,+1 THROUGH XNB+16D, 17D AND TRANSP2 USES LOCATIONS
014342,000228: # XNB1+0,+1 THROUGH XNB1+16D, 17D. EACH MATRIX IS STORED BY ROWS.
014343,000229:
014344,000230: 04,3746 E5,1422 EBANK= XNB
014345,000231:
014346,000232: 04,3746 53425 TRANSP1 DXCH XNB +2
014347,000233: 04,3747 53431 DXCH XNB +6
014348,000234: 04,3750 53425 DXCH XNB +2
014349,000235:
014350,000236: 04,3751 53427 DXCH XNB +4
014351,000237: 04,3752 53437 DXCH XNB +12D
014352,000238: 04,3753 53427 DXCH XNB +4
014353,000239:
014354,000240: 04,3754 53435 DXCH XNB +10D
014355,000241: 04,3755 53441 DXCH XNB +14D
014356,000242: 04,3756 53435 DXCH XNB +10D
014357,000243: 04,3757 16014 TCF DANZIG
014358,000244:
014359,000245:
014360,000246: 04,3760 E5,1733 EBANK= XNB1
014361,000247:
014362,000248: 04,3760 53736 TRANSP2 DXCH XNB1 +2
014363,000249: 04,3761 53742 DXCH XNB1 +6
014364,000250: 04,3762 53736 DXCH XNB1 +2
014365,000251:
014366,000252: 04,3763 53740 DXCH XNB1 +4
014367,000253: 04,3764 53750 DXCH XNB1 +12D
014368,000254: 04,3765 53740 DXCH XNB1 +4
014369,000255:
014370,000256: 04,3766 53746 DXCH XNB1 +10D
014371,000257: 04,3767 53752 DXCH XNB1 +14D
014372,000258: 04,3770 53746 DXCH XNB1 +10D
014373,000259: 04,3771 16014 TCF DANZIG
014374,000260:
014375,000261: 04,3772 ENDRTBSS EQUALS
End of include-file RTB_OP_CODES.agc. Parent file is MAIN.agc