Source Code
These source-code files were obtained by digitally photographing
an Artemis 72 program listing from a private collection and then
modifying pre-existing Comanche 55 (Apollo 11) source files to
incorporate changes. Note that the page images
presented online are of reduced quality, and that additional images
may be available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS BY NASA 2021114-011 11:40 FEB. 26, 1971 THIS AGC PROGRAM SHALL ALSO BE REFERRED TO AS COLOSSUS 3 THIS PROGRAM IS INTENDED FOR USE IN THE CM AS SPECIFIED IN REPORT R-577. THIS PROGRAM WAS PREPARED UNDER OSR PROJECT 55-23890, SPONSORED BY THE MANNED SPACECRAFT CENTER OF THE NATIONAL AERONAUTICS AND SPACE ADMINISTRATION THROUGH CONTRACT NAS 9-4065 WITH THE CHARLES STARK DRAPER LABORATORY, MASSACHUSETTS INSTITUTE OF TECHNOLOGY, CAMBRIDGE, MASS. |
058227,000002: # Copyright: Public domain.
058228,000003: # Filename: POWERED_FLIGHT_SUBROUTINES.agc
058229,000004: # Purpose: Part of the source code for Artemis (i.e., Colossus 3),
058230,000005: # build 072. This is for the Command Module's (CM)
058231,000006: # Apollo Guidance Computer (AGC), we believe for
058232,000007: # Apollo 15-17.
058233,000008: # Assembler: yaYUL
058234,000009: # Contact: Jim Lawton <jim DOT lawton AT gmail DOT com>
058235,000010: # Website: www.ibiblio.org/apollo/index.html
058236,000011: # Page scans: www.ibiblio.org/apollo/ScansForConversion/Artemis072/
058237,000012: # Mod history: 2009-08-21 JL Adapted from corresponding Comanche 055 file.
058238,000013: # 2010-02-20 RSB Un-##'d this header.
058239,000014:
Page 1364 |
058241,000016:
058242,000017: 23,2000 SETLOC POWFLITE
058243,000018: 23,2000 BANK
058244,000019:
058245,000020: 23,3530 0142 EBANK= DEXDEX
058246,000021: 23,3530 COUNT* $$/POWFL
058247,000022:
058248,000023: # CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*GR*GS ALL COMPUTE THE SINES AND
058249,000024: # COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE
058250,000025: # PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU. AN
058251,000026: # ADDITIONAL OUTPUT IS THE 1'S COMPLEMENT ANGLES AT CDUSPOT. THESE
058252,000027: # ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT,
058253,000028: # EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2. THEY DIFFER ONLY IN
058254,000029: # WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING.
058255,000030:
058256,000031: # CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE
058257,000032: # SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS.
058258,000033: # THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY
058259,000034: # CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS.
058260,000035:
058261,000036: # CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC.
058262,000037:
058263,000038: # CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP. THIS
058264,000039: # ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL
058265,000040: # ANGLES IN AN ORDER OTHER THAN X Y Z. A CALL TO THIS ROUTINE IS
058266,000041: # NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO
058267,000042: # MODES (SMNB OR NBSM). SINCE AX*SR*T EXPECTS TO FIND THE SINES AND
058268,000043: # COSINES IN THE ORDER Y Z X THE ANGLES MUST HAVE BEEN PLACED IN CDUSPOT
058269,000044: # IN THIS ORDER. CD*TR*GS NEED NOT BE REPEATED WHEN AX*SR*T IS CALLED
058270,000045: # MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED. NOTE THAT SINCE
058271,000046: # IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE
058272,000047: # CALLED USING BANKCALL. SORRY.
058273,000048:
058274,000049: # CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN
058275,000050: # INTERPRETIVE.
058276,000051:
058277,000052: 23,3530 77776 CDUTRIG EXIT
058278,000053: 23,3531 03534 TC CDUTRIGS
058279,000054: 23,3532 06006 TC INTPRET
058280,000055: 23,3533 77616 RVQ
058281,000056:
058282,000057: 23,3534 30032 CDUTRIGS CA CDUX
058283,000058: 23,3535 55175 TS CDUSPOT +4
058284,000059: 23,3536 30033 CA CDUY
058285,000060: 23,3537 55171 TS CDUSPOT
058286,000061: 23,3540 30034 CA CDUZ
058287,000062: 23,3541 55173 TS CDUSPOT +2
058288,000063:
058289,000064: 23,3542 00006 CD*TR*GS EXTEND
058290,000065: 23,3543 22142 QXCH TEM2
058291,000066: 23,3544 34766 CAF FOUR
Page 1365 |
058293,000068: 23,3545 76211 TR*GL**P MASK SIX # MAKE IT EVEN AND SMALLER
058294,000069: 23,3546 54143 TS TEM3
058295,000070: 23,3547 50143 INDEX TEM3
058296,000071: 23,3550 31171 CA CDUSPOT
058297,000072: 23,3551 52155 DXCH MPAC # STORING 2'S COMP ANGLE, LOADING MPAC
058298,000073: 23,3552 52127 DXCH VBUF +4 # STORING MPAC FOR LATER RESTORATION
058299,000074: 23,3553 04733 TC USPRCADR
058300,000075: 23,3554 51754 CADR CDULOGIC
058301,000076: 23,3555 00006 EXTEND
058302,000077: 23,3556 30155 DCA MPAC
058303,000078: 23,3557 50143 INDEX TEM3
058304,000079: 23,3560 53172 DXCH CDUSPOT # STORING 1'S COMPLEMENT ANGLE
058305,000080: 23,3561 04733 TC USPRCADR
058306,000081: 23,3562 01514 CADR COSINE
058307,000082: 23,3563 52155 DXCH MPAC
058308,000083: 23,3564 50143 INDEX TEM3
058309,000084: 23,3565 53150 DXCH COSCDU # STORING COSINE
058310,000085: 23,3566 00006 EXTEND
058311,000086: 23,3567 50143 INDEX TEM3
058312,000087: 23,3570 31172 DCA CDUSPOT # LOADING 1'S COMPLEMENT ANGLE
058313,000088: 23,3571 04733 TC USPRCADR
058314,000089: 23,3572 01526 CADR SINE +1 # SINE +1 EXPECTS ARGUMENT IN A AND L
058315,000090: 23,3573 52127 DXCH VBUF +4 # BRINGING UP PRIOR MPAC TO BE RESTORED
058316,000091: 23,3574 52155 DXCH MPAC
058317,000092: 23,3575 50143 INDEX TEM3
058318,000093: 23,3576 53142 DXCH SINCDU
058319,000094: 23,3577 10143 CCS TEM3
058320,000095: 23,3600 13545 TCF TR*GL**P
058321,000096: 23,3601 00142 TC TEM2
058322,000097:
Page 1366 |
058324,000099:
058325,000100: # ****************************************************************************************************************
058326,000101:
058327,000102: # QUICTRIG, INTENDED FOR GUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
058328,000103: # QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2,
058329,000104: # AND CDUSPOT +4. UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN
058330,000105: # CDUSPOT. QUICTRIG'S EXECUTION TIME IS 4.1 MS; THIS IS 10 TIMES AS FAST AS CD*TR*GS. QUICTRIG MAY BE
058331,000106: # CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL.
058332,000107:
058333,000108: 23,3602 00004 QUICTRIG INHINT # INHINT SINCE DAP USES THE SAME TEMPS
058334,000109: 23,3603 00006 EXTEND
058335,000110: 23,3604 22061 QXCH ITEMP1
058336,000111: 23,3605 34766 CAF FOUR
058337,000112: 23,3606 76211 +4 MASK SIX
058338,000113: 23,3607 54062 TS ITEMP2
058339,000114: 23,3610 50062 INDEX ITEMP2
058340,000115: 23,3611 31171 CA CDUSPOT
058341,000116: 23,3612 05061 TC SPSIN
058342,000117: 23,3613 00006 EXTEND
058343,000118: 23,3614 74753 MP BIT14 # SCALE DOWN TO MATCH INTERPRETER OUTPUTS
058344,000119: 23,3615 50062 INDEX ITEMP2
058345,000120: 23,3616 53142 DXCH SINCDU
058346,000121: 23,3617 50062 INDEX ITEMP2
058347,000122: 23,3620 31171 CA CDUSPOT
058348,000123: 23,3621 05060 TC SPCOS
058349,000124: 23,3622 00006 EXTEND
058350,000125: 23,3623 74753 MP BIT14
058351,000126: 23,3624 50062 INDEX ITEMP2
058352,000127: 23,3625 53150 DXCH COSCDU
058353,000128: 23,3626 10062 CCS ITEMP2
058354,000129: 23,3627 13606 TCF QUICTRIG +4
058355,000130: 23,3630 30061 CA ITEMP1
058356,000131: 23,3631 00003 RELINT
058357,000132: 23,3632 00000 TC A
058358,000133:
Page 1367 |
058360,000135:
058361,000136: # ****************************************************************************************************************
058362,000137:
058363,000138: # THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
058364,000139: # INTERPRETIVE. LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED.
058365,000140:
058366,000141: # THESE INTERFACE ROUTINES ARE PERMANENT. ALL RESTORE USER'S EBANK
058367,000142: # SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL",
058368,000143: # RETURNING VIA QPRET. ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR-
058369,000144: # MED INTERPRETER-STYLE IN MPAC: COMPONENTS AT MPAC, MPAC +3, AND MPAC +5.
058370,000145:
058371,000146: # TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES
058372,000147: # AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4; ODD
058373,000148: # LOCATIONS NEED NOT BE ZEROED). TRG*NBSM DOES THE NB TO SM TRANSFOR-
058374,000149: # MATION; TRG*SMNB, VICE VERSA.
058375,000150:
058376,000151: # CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF
058377,000152: # THE CDL COUNTERS. OTHERWISE IT IS LIKE TRG*NBSM.
058378,000153:
058379,000154: # CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM.
058380,000155:
058381,000156: 23,3633 77776 *SMNB* EXIT
058382,000157: 23,3634 07466 C*MM*N1 TC MPACVBUF # AX*SR*T EXPECTS VECTOR IN VBUF
058383,000158: 23,3635 46214 CS THREE # SIGNAL FOR SM TO NB TRANSFORMATION
058384,000159: 23,3636 03651 C*MM*N2 TC AX*SR*T
058385,000160: 23,3637 06006 TC INTPRET
058386,000161: 23,3640 43575 VLOAD RVQ
058387,000162: 23,3641 00123 VBUF
058388,000163:
058389,000164: 23,3642 77776 TRG*NBSM EXIT
058390,000165: 23,3643 03542 TC CD*TR*GS
058391,000166: 23,3644 07466 C*MM*N3 TC MPACVBUF # FOR AX*SR*T
058392,000167: 23,3645 36214 CA THREE # SIGNAL FOR NB TO SM TRANSFORMATION
058393,000168: 23,3646 13636 TCF C*MM*N2
058394,000169:
058395,000170: # *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU
058396,000171: # AND COSCDU) RATHER THAN THE ANGLES THEMSELVES. OTHERWISE THEY ARE
058397,000172: # LIKE TRG*NBSM AND TRG*SMNB.
058398,000173:
058399,000174: # NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES
058400,000175: # OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM
058401,000176: # AND TRG*SMNB NEED BE CALLED FOR EACH SERIES. FOR SUBSEQUENT TRANFOR-
058402,000177: # MATIONS USE *NBSM* AND *SMNB*.
058403,000178:
058404,000179: 23,3647 77776 *NBSM* EXIT
058405,000180: 23,3650 13644 TCF C*MM*N3
058406,000181:
058407,000182: # AX*SR*T COMBINES THE OLD SMNB AND NBSM. FOR THE NB TO SM
058408,000183: # TRANSFORMATION, ENTER WITH +3 IN A. FOR SM TO NB, ENTER WITH -3.
058409,000184: # THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF.
Page 1368 |
058411,000186: # AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION
058412,000187: # AT SINCDU AND COSCDU, IN THE ORDER Y Z X. A CALL TO CD*TR*GS, WITH
058413,000188: # THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF
058414,000189: # THIS. HERE IS A SAMPLE CALLING SEQUENCE:-
058415,000190:
058416,000191: # TC CDUTRIGS
058417,000192: # CS THREE # ("CA THREE" FOR NBSM)
058418,000193: # TC AX*SR*T
058419,000194:
058420,000195: # THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE
058421,000196: # THAN ONCE, UNLESS THE ANGLES HAVE CHANGED.
058422,000197:
058423,000198: # AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN
058424,000199: # UNITY. A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE
058425,000200: # HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS-
058426,000201: # FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED.
058427,000202:
058428,000203: 23,3651 54142 AX*SR*T TS DEXDEX # WHERE IT BECOMES THE INDEX OF INDEXES
058429,000204: 23,3652 00006 EXTEND
058430,000205: 23,3653 22145 QXCH RTNSAVER
058431,000206:
058432,000207: 23,3654 10142 R*TL**P CCS DEXDEX # +3 --> 0 -3 --> 2
058433,000208: 23,3655 40142 CS DEXDEX # THUS: +2 --> 1 -2 --> 1
058434,000209: 23,3656 66214 AD THREE # +1 --> 2 -1 --> 0
058435,000210: 23,3657 00006 EXTEND
058436,000211: 23,3660 50000 INDEX A
058437,000212: 23,3661 33740 DCA INDEXI
058438,000213: 23,3662 52144 DXCH DEXI
058439,000214:
058440,000215: 23,3663 34770 CA ONE
058441,000216: 23,3664 54130 TS BUF
058442,000217: 23,3665 00006 EXTEND
058443,000218: 23,3666 50143 INDEX DEX1
058444,000219: 23,3667 40123 DCS VBUF
058445,000220: 23,3670 13672 TCF LOOP1 # REALLY BE A SUBTRACT, AND VICE VERSA
058446,000221:
058447,000222: 23,3671 52131 LOOP2 DXCH BUF # LOADING VECTOR COMPONENT, STORING INDEX
058448,000223:
058449,000224: 23,3672 52155 LOOP1 DXCH MPAC
058450,000225: 23,3673 33736 CA SINESLOC
058451,000226: 23,3674 60143 AD DEX1
058452,000227: 23,3675 54116 TS ADDRWD
058453,000228:
058454,000229: 23,3676 07056 TC DMPSUB # MULTIPLY BY SIN(CDUANGLE)
058455,000230: 23,3677 10142 CCS DEXDEX
058456,000231: 23,3700 52155 DXCH MPAC # NBSM CASE
058457,000232: 23,3701 13704 TCF +3
058458,000233: 23,3702 00006 EXTEND # SMNB CASE
058459,000234: 23,3703 40155 DCS MPAC
058460,000235: 23,3704 52134 DXCH TERM1TMP
058461,000236:
Page 1369 |
058463,000238: 23,3705 36211 CA SIX # SINCDU AND COSCDU (EACH 6 WORDS) MUST
058464,000239: 23,3706 26116 ADS ADDRWD # BE CONSECUTIVE AND IN THAT ORDER
058465,000240:
058466,000241: 23,3707 00006 EXTEND
058467,000242: 23,3710 50130 INDEX BUF
058468,000243: 23,3711 50143 INDEX DEX1
058469,000244: 23,3712 30123 DCA VBUF
058470,000245: 23,3713 52155 DXCH MPAC
058471,000246: 23,3714 07056 TC DMPSUB # MULTIPLY BY COS(CDUANGLE)
058472,000247: 23,3715 52155 DXCH MPAC
058473,000248: 23,3716 20134 DAS TERM1TMP
058474,000249: 23,3717 52134 DXCH TERM1TMP
058475,000250: 23,3720 20001 DDOUBL
058476,000251: 23,3721 50130 INDEX BUF
058477,000252: 23,3722 50143 INDEX DEX1
058478,000253: 23,3723 52123 DXCH VBUF
058479,000254: 23,3724 52131 DXCH BUF # LOADING INDEX, STORING VECTOR COMPONENT
058480,000255:
058481,000256: 23,3725 10000 CCS A # 'CAUSE THAT'S WHERE THE INDEX NOW IS
058482,000257: 23,3726 13671 TCF LOOP2
058483,000258:
058484,000259: 23,3727 00006 EXTEND
058485,000260: 23,3730 26142 DIM DEXDEX # DECREMENT MAGNITUDE PRESERVING SIGN
058486,000261:
058487,000262: 23,3731 10142 TSTPOINT CCS DEXDEX # ONLY THE BRANCHING FUNCTION IS USED
058488,000263: 23,3732 13654 TCF R*TL**P
058489,000264: 23,3733 00145 TC RTNSAVER
058490,000265: 23,3734 13654 TCF R*TL**P
058491,000266: 23,3735 00145 TC RTNSAVER
058492,000267:
058493,000268: 23,3736 01141 SINESLOC ADRES SINCDU # FOR USE IN SETTING ADDRWD
058494,000269:
058495,000270: 23,3737 00004 INDEXI DEC 4 B-14 # ********** DON'T ***********
058496,000271: 23,3740 00002 DEC 2 B-14 # ********** TOUCH ***********
058497,000272: 23,3741 00000 DEC 0 B-14 # ********** THESE ***********
058498,000273: 23,3742 00004 DEC 4 B-14 # ********** CONSTANTS ***********
058499,000274:
058500,000275: # ****************************************************************************************************************
058501,000276:
Page 1370 |
058503,000278:
058504,000279: # THIS SUBROUTINE COMPUTES INCREMENTAL CHANGES IN CDU(GIMBAL) ANGLES FROM INCREMENTAL CHANGES ABOUT SM AXES. IT
058505,000280: # REQUIRES SM INCREMENTS AS A DP VECTOR SCALED AT ONE REVOLUTION(DTHETASM,+2,+4). SIN,COS(CDUY,Z,X) ARE IN
058506,000281: # SINCDU,+2,+4 AND COSCDU,+2,+4 RESPECTIVELY, SCALED TO ONE HALF. CDU INCREMENTS ARE PLACED IN DCDU,+2,+4 SCALED TO
058507,000282: # ONE REVOLUTION.
058508,000283:
058509,000284: # * COS(IGA)SEC(MGA) 0 -SIN(IGA)SEC(MGA) *
058510,000285: # * *
058511,000286: # * -COS(IGA)TAN(MGA) 1 SIN(IGA)TAN(MGA) *
058512,000287: # * *
058513,000288: # * SIN(IGA) 0 COS(IGA) *
058514,000289:
058515,000290: 23,2000 SETLOC POWFLIT1
058516,000291: 23,2000 BANK
058517,000292: 23,3743 COUNT* $$/POWFL
058518,000293: 23,3743 41345 SMCDURES DLOAD DMP
058519,000294: 23,3744 03212 DTHETASM
058520,000295: 23,3745 01150 COSCDUY
058521,000296:
058522,000297: 23,3746 41325 PDDL DMP
058523,000298: 23,3747 03216 DTHETASM +4
058524,000299: 23,3750 01142 SINCDUY
058525,000300:
058526,000301: 23,3751 77621 BDSU
058527,000302: 23,3752 77671 DDV
058528,000303: 23,3753 01152 COSCDUZ
058529,000304: 23,3754 03204 STORE DCDU
058530,000305:
058531,000306: 23,3755 72405 DMP SL1 # SCALE
058532,000307: 23,3756 01144 SINCDUZ
058533,000308: 23,3757 77621 BDSU
058534,000309:
058535,000310: 23,3760 03214 DTHETASM +2
058536,000311: 23,3761 17206 STODL DCDU +2
058537,000312: 23,3762 03212 DTHETASM
058538,000313:
058539,000314: 23,3763 65205 DMP PDDL
058540,000315: 23,3764 01142 SINCDUY
058541,000316: 23,3765 03216 DTHETASM +4
058542,000317:
058543,000318: 23,3766 43205 DMP DAD
058544,000319: 23,3767 01150 COSCDUY
058545,000320: 23,3770 77752 SL1
058546,000321: 23,3771 03210 STORE DCDU +4
058547,000322: 23,3772 77616 RVQ
End of include-file POWERED_FLIGHT_SUBROUTINES.agc. Parent file is MAIN.agc