Proof POWERED_FLIGHT_SUBROUTINES #244 (#385)

* Proof FIXED_FIXED_CONSTANT_POOL (#207)

* Proof POWERED_FLIGHT_SUBROUTINES #244
This commit is contained in:
Glenn Dwiyatcita 2019-05-08 19:55:15 +02:00 committed by James Harris
parent 496453a615
commit 4f83a11ecb

View File

@ -37,22 +37,22 @@
EBANK= DEXDEX EBANK= DEXDEX
COUNT* $$/POWFL COUNT* $$/POWFL
# CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*GR*GS ALL COMPUTE THE SINES AND # CDUTRIG, CDUTRIG1, CDUTRIG2, AND CD*GR*GS ALL COMPUTE THE SINES AND
# COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE # COSINES OF THREE 2'S COMPLEMENT ANGLES AND PLACE THE RESULT, DOUBLE
# PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU. AN # PRECISION, IN THE SAME ORDER AS THE INPUTS, AT SINCDU AND COSCDU. AN
# ADDITIONAL OUTPUT IS THE 1'S COMPLENT ANGLES AT CDUSPOT. THESE # ADDITIONAL OUTPUT IS THE 1'S COMPLEMENT ANGLES AT CDUSPOT. THESE
# ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT. # ROUTINES GO OUT OF THEIR WAY TO LEAVE THE MPAC AREA AS THEY FIND IT,
# EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2. THEY DIFFER ONLY IN # EXCEPT FOR THE GENERALLY UNIMPORTANT MPAC +2. THEY DIFFER ONLY IN
# WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING. # WHERE THEY GET THE ANGLES, AND IN METHOD OF CALLING.
#
# CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE # CDUTRIG (AND CDUTRIG1, WHICH CAN BE CALLED IN BASIC) COMPUTE THE
# SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS. # SINES AND COSINES FROM THE CURRENT CONTENTS OF THE CDU REGISTERS.
# THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY # THE CONTENTS OF CDUTEMP, ETC., ARE NOT TOUCHED SO THAT THEY MAY
# CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS. # CONTINUE TO FORM A CONSISTENT SET WITH THE LATEST PIPA READINGS.
#
# CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC. # CDUTRIG1 IS LIKE CDUTRIG EXCEPT THAT IT CAN BE CALLED IN BASIC.
#
# CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP. THIS # CD*TR*GS FINDS CDU VALUES IN CDUSPOT RATHER THAN IN CDUTEMP. THIS
# ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL # ALLOWS USERS TO MAKE TRANSFORMATIONS USING ARBITRARY ANGLES, OR REAL
# ANGLES IN AN ORDER OTHER THAN X Y Z. A CALL TO THIS ROUTINE IS # ANGLES IN AN ORDER OTHER THAN X Y Z. A CALL TO THIS ROUTINE IS
# NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO # NECESSARY IN PREPARATION FOR A CALL TO AX*SR*T IN EITHER OF ITS TWO
@ -62,8 +62,8 @@
# MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED. NOTE THAT SINCE # MORE THAN ONCE, PROVIDED THE ANGLES HAVE NOT CHANGED. NOTE THAT SINCE
# IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE # IT CLOBBERS BUF2 (IN THE SINE AND COSINE ROUTINES) CD*TR*GS CANNOT BE
# CALLED USING BANKCALL. SORRY. # CALLED USING BANKCALL. SORRY.
#
# CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN # CD*TR*G IS LIKE CD*TR*GS EXCEPT THAT IT CAN BE CALLED IN
# INTERPRETIVE. # INTERPRETIVE.
CDUTRIG EXIT CDUTRIG EXIT
@ -118,10 +118,11 @@ TR*GL**P MASK SIX # MAKE IT EVEN AND SMALLER
TC TEM2 TC TEM2
# Page 1367 # Page 1367
# ******************************************************************************************************* # *******************************************************************************************************
# QUICTRIG, INTENDED FOR QUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
# QUICTRIG, INTENDED FOR GUIDANCE CYCLE USE WHERE TIME IS CRITICAL, IS A MUCH FASTER VERSION OF CD*TR*GS.
# QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2, # QUICTRIG COMPUTES AND STORES THE SINES AND COSINES OF THE 2'S COMPLEMENT ANGLES AT CDUSPOT, CDUSPOT +2,
# AND CDUSPOT +4. UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN # AND CDUSPOT +4. UNLIKE CD*TR*GS, QUICTRIG DOES NOT LEAVE THE 1'S COMPLEMENT VERSIONS OF THE ANGLES IN
# CDUSPOT. QUICTRIG'S EXECUTION TIME IS 4.1 MS; THIS IS 10 TIMES AS FAST AS CD*TR*GS. QUICTRIG MAY BE # CDUSPOT. QUICTRIG'S EXECUTION TIME IS 4.1 MS; THIS IS 10 TIMES AS FAST AS CD*TR*GS. QUICTRIG MAY BE
# CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL. # CALLED FROM INTERPRETIVE AS AN RTB OP-CODE, OR FROM BASIC VIA BANKCALL OR IBNKCALL.
QUICTRIG INHINT # INHINT SINCE DAP USES THE SAME TEMPS QUICTRIG INHINT # INHINT SINCE DAP USES THE SAME TEMPS
@ -151,10 +152,12 @@ QUICTRIG INHINT # INHINT SINCE DAP USES THE SAME TEMPS
TC A TC A
# Page 1368 # Page 1368
#**************************************************************************** #****************************************************************************
# THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
# THESE INTERFACE ROUTINES MAKE IT POSSIBLE TO CALL AX*SR*T, ETC., IN
# INTERPRETIVE. LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED. # INTERPRETIVE. LATER, WHERE POSSIBLE, THEY WILL BE ELIMINATED.
# #
# NBSM WILL BE THE FIRST TO GO. IT SHOULD NOT BE USED. # NBSM WILL BE THE FIRST TO GO. IT SHOULD NOT BE USED.
NBSM STQ NBSM STQ
X2 X2
@ -168,20 +171,20 @@ NBSM STQ
STCALL 32D # SINCE THERE'S NO STGOTO STCALL 32D # SINCE THERE'S NO STGOTO
X2 X2
# THESE INTERFACE ROUTINES ARE PERMANENT. ALL RESTORE USER'S EBANK # THESE INTERFACE ROUTINES ARE PERMANENT. ALL RESTORE USER'S EBANK
# SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL", # SETTING. ALL ARE STRICT INTERPRETIVE SUBROUTINES, CALLED USING "CALL",
# RETURNING VIA QPRET. ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR- # RETURNING VIA QPRET. ALL EXPECT AND RETURN THE VECTOR TO BE TRANSFOR-
# MED INTERPRETER-STYLE IN MPAC: COMPONENTS AT MPAC, MPAC +3, AND MPAC +5. # MED INTERPRETER-STYLE IN MPAC; COMPONENTS AT MPAC, MPAC +3, AND MPAC +5.
#
# TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES # TRG*SMNB AND TRG*NBSM BOTH EXPECT TO SEE THE 2'S COMPLEMENT ANGLES
# AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4. ODD # AT CDUSPOT (ORDER Y Z X, AT CDUSPOT, CDUSPOT +2, AND CDUSPOT +4; ODD
# LOCATIONS NEED NOT BE ZEROED). TRG*NBSM DOES THE NB TO SM TRANSFOR- # LOCATIONS NEED NOT BE ZEROED). TRG*NBSM DOES THE NB TO SM TRANSFOR-
# MATION: TRG*SMNB, VICE VERSA. # MATION; TRG*SMNB, VICE VERSA.
#
# CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF # CDU*NBSM DOES ITS TRANSFORMATION USING THE PRESENT CONTENTS OF
# THE CDL COUNTERS. OTHERWISE IT IS LIKE TRG*NBSM. # THE CDL COUNTERS. OTHERWISE IT IS LIKE TRG*NBSM.
# #
# CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM. # CDU*SMNB IS THE COMPLEMENT OF CDU*NBSM.
CDU*SMNB EXIT CDU*SMNB EXIT
TC CDUTRIGS TC CDUTRIGS
@ -209,11 +212,11 @@ C*MM*N3 TC MPACVBUF # FOR AX*SR*T
CA THREE # SIGNAL FOR NB TO SM TRANSFORMATION CA THREE # SIGNAL FOR NB TO SM TRANSFORMATION
TCF C*MM*N2 TCF C*MM*N2
# *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU # *NBSM* AND *SMNB* EXPECT TO SEE THE SINES AND COSINES (AT SINCDU
# AND COSCDU) RATHER THAN THE ANGLES THEMSELVES. OTHERWISE THEY ARE # AND COSCDU) RATHER THAN THE ANGLES THEMSELVES. OTHERWISE THEY ARE
# LIKE TRG*NBSM AND TRG*SMNB. # LIKE TRG*NBSM AND TRG*SMNB.
#
# NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES # NOTE THAT JUST AS CD*TR*GS NEED BE CALLED ONLY ONCE FOR EACH SERIES
# OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM # OF TRANSFORMATIONS USING THE SAME ANGLES, SO TOO ONLY ONE OF TRG*NBSM
# AND TRG*SMNB NEED BE CALLED FOR EACH SERIES. FOR SUBSEQUENT TRANFOR- # AND TRG*SMNB NEED BE CALLED FOR EACH SERIES. FOR SUBSEQUENT TRANFOR-
# MATIONS USE *NBSM* AND *SMNB*. # MATIONS USE *NBSM* AND *SMNB*.
@ -224,25 +227,27 @@ C*MM*N3 TC MPACVBUF # FOR AX*SR*T
*NBSM* EXIT *NBSM* EXIT
TCF C*MM*N3 TCF C*MM*N3
# AX*SR*T COMBINES THE OLD SMNB AND NBSM. FOR THE NB TO SM # AX*SR*T COMBINES THE OLD SMNB AND NBSM. FOR THE NB TO SM
# TRANSFORMATION, ENTER WITH +3 IN A. FOR SM TO NB, ENTER WITH -3. # TRANSFORMATION, ENTER WITH +3 IN A. FOR SM TO NB, ENTER WITH -3.
# THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF. # THE VECTOR TO BE TRANSFORMED ARRIVES, AND IS RETURNED, IN VBUF.
# AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION # AX*SR*T EXPECTS TO FIND THE SINES AND COSINES OF THE ANGLES OF ROTATION
# AT SINCDU AND COSCDU, IN THE ORDER Y Z X. A CALL TO CD*TR*GS, WITH # AT SINCDU AND COSCDU, IN THE ORDER Y Z X. A CALL TO CD*TR*GS, WITH
# THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF # THE 2'S COMPLEMENT ANGLES (ORDER Y Z X) AT CDUSPOT, WILL TAKE CARE OF
# THIS. HERE IS A SAMPLE CALLING SEQUENCE:-- # THIS. HERE IS A SAMPLE CALLING SEQUENCE:-
# TC CDUTRIGS
# CS THREE # ("CA THREE" FOR NBSM) # TC CDUTRIGS
# TC AX*SR*T # CS THREE ("CA THREE" FOR NBSM)
# TC AX*SR*T
# THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE # THE CALL TO CD*TR*GS NEED NOT BE REPEATED, WHEN AX*SR*T IS CALLED MORE
# THAN ONCE, UNLESS THE ANGLES HAVE CHANGED. # THAN ONCE, UNLESS THE ANGLES HAVE CHANGED.
#
# AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN # AX*SR*T IS GUARANTEED SAFE ONLY FOR VECTORS OF MAGNITUDE LESS THAN
# UNITY. A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE # UNITY. A LOOK AT THE CASE IN WHICH A VECTOR OF GREATER MAGNITUDE
# HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS- # HAPPENS TO LIE ALONG AN AXIS OF THE SYSTEM TO WHICH IT IS TO BE TRANS-
# FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED. # FORMED CONVINCES ONE THAT THIS IS A RESTRICTION WHICH MUST BE ACCEPTED.
AX*SR*T TS DEXDEX # WHERE IT BECOMES THE INDEX OF INDEXES. AX*SR*T TS DEXDEX # WHERE IT BECOMES THE INDEX OF INDEXES
EXTEND EXTEND
QXCH RTNSAVER QXCH RTNSAVER
@ -294,6 +299,7 @@ LOOP1 DXCH MPAC
INDEX DEX1 INDEX DEX1
DXCH VBUF DXCH VBUF
DXCH BUF # LOADING INDEX, STORING VECTOR COMPONENT DXCH BUF # LOADING INDEX, STORING VECTOR COMPONENT
CCS A # 'CAUSE THAT'S WHERE THE INDEX NOW IS CCS A # 'CAUSE THAT'S WHERE THE INDEX NOW IS
TCF LOOP2 TCF LOOP2
@ -307,8 +313,10 @@ TSTPOINT CCS DEXDEX # ONLY THE BRANCHING FUNCTION IS USED
TCF R*TL**P TCF R*TL**P
TC RTNSAVER TC RTNSAVER
SINESLOC ADRES SINCDU # FOR USE IN SETTING ADDRWD SINESLOC ADRES SINCDU # FOR USE IN SETTING ADDRWD
INDEXI DEC 4 # ********** DON'T *********** INDEXI DEC 4 # ********** DON'T ***********
DEC 2 # ********** TOUCH *********** DEC 2 # ********** TOUCH ***********
DEC 0 # ********** THESE *********** DEC 0 # ********** THESE ***********
@ -318,9 +326,9 @@ INDEXI DEC 4 # ********** DON'T ***********
# Page 1372 # Page 1372
# THIS SUBROUTINE COMPUTES INCREMENTAL CHANGES IN CDU(GIMBAL) ANGLES FROM INCREMENTAL CHANGES ABOUT SM AXES. IT # THIS SUBROUTINE COMPUTES INCREMENTAL CHANGES IN CDU(GIMBAL) ANGLES FROM INCREMENTAL CHANGES ABOUT SM AXES. IT
# REQUIRES SM INCREMENTS AS A DP VECTOR SCALED AT ONE REVOLUTION(DTHETASM,+2,+4). SIN,COS(CDUY,Z,X) ARE IN # REQUIRES SM INCREMENTS AS A DP VECTOR SCALED AT ONE REVOLUTION(DTHETASM,+2,+4). SIN,COS(CDUY,Z,X) ARE IN
# SINCDU,+2,+4 AND COSCDU,+2,+4 RESPECTIVELY, SCALED TO ONE HALF. CDU INCREMENTS ARE PLACED IN DCDU,+2,+4 SCALED TO # SINCDU,+2,+4 AND COSCDU,+2,+4 RESPECTIVELY,SCALED TO ONE HALF. CDU INCREENTS ARE PLACED IN DCDU,+2,+4 SCALED TO
# ONE REVOLUTION. # ONE REVOLUTION.
#
# * COS(IGA)SEC(MGA) 0 -SIN(IGA)SEC(MGA) * # * COS(IGA)SEC(MGA) 0 -SIN(IGA)SEC(MGA) *
# * * # * *
# * -COS(IGA)TAN(MGA) 1 SIN(IGA)TAN(MGA) * # * -COS(IGA)TAN(MGA) 1 SIN(IGA)TAN(MGA) *
@ -361,4 +369,3 @@ SMCDURES DLOAD DMP
SL1 SL1
STORE DCDU +4 STORE DCDU +4
RVQ RVQ