Source Code
These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3),
the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software
for Apollo 13.
The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments. Since no contemporary listings of Comanche 72/3 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. |
047184,000002: ## Copyright: Public domain.
047185,000003: ## Filename: INTERPRETER.agc
047186,000004: ## Purpose: A section of Manche72 revision 3.
047187,000005: ## It is part of the reconstructed source code for the final, flown
047188,000006: ## release of the software for the Command Module's (CM) Apollo
047189,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
047190,000008: ## of this program are available; instead, this file was recreated
047191,000009: ## from a reconstructed copy of Comanche 072. It has been adapted
047192,000010: ## such that the resulting bugger words exactly match those
047193,000011: ## specified for Manche72 revision 3 in NASA drawing 2021153G,
047194,000012: ## which gives relatively high confidence that the reconstruction
047195,000013: ## is correct.
047196,000014: ## Assembler: yaYUL
047197,000015: ## Contact: Ron Burkey <info@sandroid.org>.
047198,000016: ## Website: www.ibiblio.org/apollo/index.html
047199,000017: ## Mod history: 2024-05-19 MAS Created from Comanche 072.
047200,000018:
047201,000019: # SECTION 1 DISPATCHER
047202,000020:
047203,000021: # ENTRY TO THE INTERPRETER. INTPRET SETS LOC TO THE FIRST INSTRUCTION, BANKSET TO THE BBANK OF THE
047204,000022: # OBJECT INTERPRETIVE PROGRAM, AND INTBIT15 TO THE BIT15 CONTENTS OF FBANK. INTERPRETIVE PROGRAMS MAY BE IN
047205,000023: # VIRTUALLY ALL BANKS PRESENT UNDER ANY SUPER-BANK SETTING, WITH THE RESTRICTION THAT PROGRAMS IN HIGH BANKS
047206,000024: # (BIT15 OF FBANK = 1) DO NOT REFER TO LOWBANKS, AND VICE-VERSA. THE INTERPRETER DOES NOT SWITCH SUPERBANKS.
047207,000025: # E-BANK SWITCHING OCCURS WHENEVER GENERAL ERASABLE (100-3777) IS ADDRESSED.
047208,000026:
047209,000027: 6006 BLOCK 03
047210,000028:
047211,000029: 6006 COUNT 03/INTER
047212,000030: 6006 00003 INTPRET RELINT
047213,000031: 6007 00006 EXTEND # SET LOC TO THE WORD FOLLOWING THE TC.
047214,000032: 6010 22164 QXCH LOC
047215,000033: 6011 30006 +2 CA BBANK # INTERPRETIVE BRANCHES FINISH HERE.
047216,000034: 6012 54165 TS BANKSET
047217,000035: 6013 75015 MASK BIT15 # GET 15TH BIT FOR INDEXABLE ADDRESSES.
047218,000036: 6014 54115 TS INTBIT15
047219,000037:
047220,000038: 6015 54023 TS EDOP # MAKE SURE NO INSTRUCTIONS LEFT OVER
047221,000039:
047222,000040: 6016 16037 TCF NEWOPS # PICK UP OP CODE PAIR AND BEGIN.
047223,000041:
047224,000042: 6017 22006 INTRSM LXCH BBANK # RESUME SUSPENDED INTERPRETIVE JOB
047225,000043: 6020 16011 TCF INTPRET +3
047226,000044:
047227,000045: # DLOAD LOADS MPAC, MPAC +1, LEAVING ZERO IN MPAC +2.
047228,000046:
047229,000047: 6021 00006 DLOAD EXTEND
047230,000048: 6022 50116 INDEX ADDRWD
047231,000049: 6023 30001 DCA 0 # LOAD DP C(C(ADDRWD)) INTO MPAC,MPAX +1
047232,000050: 6024 52155 SLOAD2 DXCH MPAC
047233,000051: 6025 35035 CAF ZERO # ZERO MPAC +2
047234,000052:
047235,000053: # AT THE END OF MOST INSTRUCTIONS, CONTROL IS GIVEN TO DANZIG TO DISPATCH THE NEXT OPERATION.
047236,000054:
047237,000055: 6026 54156 TS MPAC +2 # AND DECLARE DP MODE
047238,000056:
047239,000057: 6027 54163 NEWMODE TS MODE # PROLOGUE FOR MODE-CHANGING INSTRUCTIONS.
047240,000058:
047241,000059: 6030 30165 DANZIG CA BANKSET # SET BBANK BEFORE TESTING NEWJOB SO THAT
047242,000060: 6031 54006 TS BBANK # IT MAY BE SAVED DIRECTLY BY CHANJOB.
047243,000061:
047244,000062: 6032 10023 NOIBNKSW CCS EDOP # SEE IF AN ORDER CODE IS LEFT OVER FROM
047245,000063: 6033 16046 TCF OPJUMP # THE LAST PAIR RETRIEVED. IF SO, EXECUTE.
047246,000064: # EDOP IS SET TO ZERO ON ITS RE-EDITING.
047247,000065:
047248,000066: 6034 10067 CCS NEWJOB # SEE IF A JOB OF HIGHER PRIORITY IS
047249,000067: 6035 15204 TCF CHANG2 # PRESENT, AND IF SO, CHANGE JOBS.
047250,000068:
047251,000069: 6036 24164 INCR LOC # ADVANCE THE LOCATION COUNTER.
047252,000070:
047253,000071: # ITRACE (1) REFERS TO "NEWOPS".
047254,000072: 6037 50164 NEWOPS INDEX LOC # ENTRY TO BEGIN BY PICKING OP CODE PAIR.
047255,000073: 6040 30000 CA 0 # MAY BE AN OPCODE PAIR OR A STORE CODE.
047256,000074: 6041 10000 CCS A # TEST SIGN AND GET DABS(A).
047257,000075: 6042 16331 TCF DOSTORE # PROCESS STORE CODE.
047258,000076:
047259,000077: 6043 00177 LOW7 OCT 177
047260,000078:
047261,000079: 6044 54023 TS EDOP # OP CODE PAIR. LEAVE THE OTHER IN EDOP
047262,000080: 6045 76043 MASK LOW7 # WHERE CCS EDOP WILL HONOR IT NEXT.
047263,000081:
047264,000082: 6046 54020 OPJUMP TS CYR # LOWWD ENTERS HERE IF A RIGHT-HAND OP
047265,000083: 6047 10020 CCS CYR # CODE IS TO BE PROCESSED. TEST PREFICES.
047266,000084: 6050 16216 TCF OPJUMP2 # TEST SECOND PREFIX BIT.
047267,000085:
047268,000086: 6051 16712 TCF EXIT # +0 OP CODE IS EXIT.
047269,000087:
047270,000088: # PROCESS ADDRESSES WHICH MAY BE DIRECT, INDEXED, OR REFERENCE THE PUSHDOWN LIST.
047271,000089:
047272,000090: 6052 75033 ADDRESS MASK BIT1 # SEE IF ADDRESS IS INDEXED. CYR CONTAINED
047273,000091: 6053 10000 CCS A # 400XX, SO BIT 1 IS NOW AS IT WAS IN CYR.
047274,000092: 6054 16115 TCF INDEX # FORM INDEXED ADDRESS.
047275,000093:
047276,000094: 6055 50164 DIRADRES INDEX LOC # LOOK AHEAD TO NEXT WORD TO SEE IF
047277,000095: 6056 40001 OCT40001 CS 1 # ADDRESS IS GIVEN.
047278,000096: 6057 10000 CCS A
047279,000097: 6060 16164 TCF PUSHUP # IF NOT.
047280,000098:
047281,000099: 6061 77773 NEG4 DEC -4 B-14
047282,000100:
047283,000101: 6062 24164 INCR LOC # IF SO, TO SHOW WE PICKED UP A WORD.
047284,000102: 6063 54116 TS ADDRWD
047285,000103:
047286,000104: # FINAL DIGESTION OF DIRECT ADDRESSES OF OP CODES WITH 01 PREFIX IS DONE HERE. IN EACH CASE, THE
047287,000105: # REQUIRED 12-BIT SUB-ADDRESS IS LEFT IN ADDRWD, WITH ANY REQUIRED E OR F BANK SWITCHING DONE. ADDRESSES LESS
047288,000106: # THAN 45D ARE TAKEN TO BE RELATIVE TO THE WORK AREA. THE OP CODE IS NOW IN BITS 1-5 OF CYR WITH BIT 14 = 1.
047289,000107:
047290,000108: 6064 66220 AD -ENDVAC # SEE IF ADDRESS RELATIVE TO WORK AREA.
047291,000109: 6065 10000 CCS A
047292,000110: 6066 67712 AD -ENDERAS # IF NOT, SEE IF IN GENERAL ERASABLE.
047293,000111: 6067 16074 TCF IERASTST
047294,000112:
047295,000113: 6070 30120 NETZERO CA FIXLOC # IF SO, LEAVE THE MODIFIED ADDRESS IN
047296,000114: 6071 26116 ADS ADDRWD # ADDRWD AND DISPATCH.
047297,000115: 6072 50020 ITR15 INDEX CYR # THIS INDEX MAKES THE NEXT INSTRUCTION
047298,000116: 6073 76242 7 INDJUMP -1 # TCF INDJUMP + OP, EDITING CYR.
047299,000117:
047300,000118: 6074 00006 IERASTST EXTEND
047301,000119: 6075 66105 BZMF GEADDR # GO PROCESS GENERAL-ERASABLE ADDRESS.
047302,000120:
047303,000121: 6076 75070 MASK LOW10 # FIXED BANK ADDRESS. RESTORE AND ADD B15.
047304,000122: 6077 65070 AD LOW10 # SWITCH BANKS AND LEAVE SUBADDRESS IN
047305,000123: 6100 56116 XCH ADDRWD # ADDRWD FOR OPERAND RETRIEVAL. (THIS
047306,000124: 6101 60115 AD INTBIT15 # METHOD PRECLUDES USE OF THE LAST
047307,000125: 6102 54004 TS FBANK # LOCATION IN EACH FBANK.)
047308,000126: 6103 50020 ITR12 INDEX CYR
047309,000127: 6104 76242 7 INDJUMP -1
047310,000128:
047311,000129: 6105 74373 GEADDR MASK LOW8
047312,000130: 6106 65065 AD OCT1400
047313,000131: 6107 56116 XCH ADDRWD
047314,000132: 6110 54003 TS EBANK
047315,000133: 6111 50020 ITR10 INDEX CYR
047316,000134: 6112 76242 7 INDJUMP -1
047317,000135:
047318,000136: # THE FOLLOWING ROUTINE PROCESSES INTERPRETIVE INDEXED ADDRESSES. AN INTERPRETER INDEX REGISTER MAY
047319,000137: # CONTAIN THE ADDRESS OF ANY ERASABLE REGISTER (0-42 BEING RELATIVE TO THE VAC AREA) OR ANY INTERPRETIVE PROGRAM
047320,000138: # BANK, OR ANY INTEGER IN THAT RANGE.
047321,000139:
047322,000140: 6113 37702 DODLOAD* CAF DLOAD* # STODL* COMES HERE TO PROCESS LOAD ADR.
047323,000141: 6114 54020 TS CYR # (STOVL* ENTERS HERE).
047324,000142:
047325,000143: 6115 30120 INDEX CA FIXLOC # SET UP INDEX LOCATION.
047326,000144: 6116 54130 TS INDEXLOC
047327,000145: 6117 24164 INCR LOC # (ADDRESS ALWAYS GIVEN).
047328,000146: 6120 50164 INDEX LOC
047329,000147: 6121 40000 CS 0
047330,000148: 6122 10000 CCS A # INDEX 2 IF ADDRESS STORED COMPLEMENTED.
047331,000149: 6123 24130 INCR INDEXLOC
047332,000150: 6124 16125 NOOP
047333,000151:
047334,000152: 6125 54116 TS ADDRWD # 14 BIT ADDRESS TO ADDRWD.
047335,000153: 6126 77711 MASK HIGH4 # IF ADDRESS GREATER THAN 2K, ADD INTBIT15
047336,000154: 6127 00006 EXTEND
047337,000155: 6130 16133 BZF INDEX2
047338,000156: 6131 30115 CA INTBIT15
047339,000157: 6132 26116 ADS ADDRWD
047340,000158:
047341,000159: 6133 50130 INDEX2 INDEX INDEXLOC
047342,000160: 6134 40046 CS X1
047343,000161: 6135 26116 ADS ADDRWD # DO AUGMENT, IGNORING AND CORRECTING OVF.
047344,000162:
047345,000163: 6136 77713 MASK HIGH9 # SEE IF ADDRESS IS IN WORK AREA.
047346,000164: 6137 00006 EXTEND
047347,000165: 6140 16153 BZF INDWORK
047348,000166: 6141 77711 MASK HIGH4 # SEE IF IN FIXED BANK.
047349,000167: 6142 00006 EXTEND
047350,000168: 6143 16155 BZF INDERASE
047351,000169:
047352,000170: 6144 30116 CA ADDRWD # IN FIXED - SWITCH BANKS AND CREATE
047353,000171: 6145 54004 TS FBANK # SUB-ADDRESS.
047354,000172: 6146 75070 MASK LOW10
047355,000173: 6147 65021 AD 2K
047356,000174: 6150 54116 TS ADDRWD
047357,000175: 6151 50020 ITR11 INDEX CYR
047358,000176: 6152 36242 3 INDJUMP -1
047359,000177:
047360,000178: 6153 30120 INDWORK CA FIXLOC # MAKE ADDRWD RELATIVE TO WORK AREA.
047361,000179: 6154 16161 TCF ITR13 -1
047362,000180:
047363,000181: 6155 35065 INDERASE CA OCT1400
047364,000182: 6156 56116 XCH ADDRWD
047365,000183: 6157 54003 TS EBANK
047366,000184: 6160 74373 MASK LOW8
047367,000185: 6161 26116 -1 ADS ADDRWD
047368,000186: 6162 50020 ITR13 INDEX CYR
047369,000187: 6163 36242 3 INDJUMP -1
047370,000188:
047371,000189: # PUSH-UP ROUTINES. WHEN NO OPERAND ADDRESS IS GIVEN, THE APPROPRIATE OPERAND IS TAKEN FROM THE PUSH-DOWN
047372,000190: # LIST. IN MOST CASES THE MODE OF THE RESULT (VECTOR OR SCALAR) OF THE LAST ARITHMETIC OPERATION PERFORMED
047373,000191: # IS THE SAME AS THE TYPE OF OPERAND DESIRED (ALL ADD/SUBTRACT ETC.). EXCEPTIONS TO THIS GENERAL RULE ARE LISTED
047374,000192: # BELOW (NOTE THAT IN EVERY CASE THE MODE REGISTER IS LEFT INTACT):
047375,000193:
047376,000194: # 1. VXSC AND V/SC WANT THE OPPOSITE TYPE OF OPERAND, E.G., IF THE LAST OPERATION YIELDED A VECTOR
047377,000195: # RESULT, VXSC WANTS A SCALAR.
047378,000196:
047379,000197: # 2. THE LOAD CODES SHOULD LOAD THE ACCUMULATOR INDEPENDENT OF THE RESULT OF THE LAST OPERATION. THIS
047380,000198: # INCLUDES VLOAD, DLOAD, TLOAD, PDDL, AND PDVL (NO PUSHUP WITH SLOAD).
047381,000199:
047382,000200: # 3. SOME ARITHMETIC OPERATIONS REQUIRE A STANDARD TYPE OF OPERAND REGARDLESS OF THE PREVIOUS OPERATION.
047383,000201: # THIS INCLUDES SIGN WANTING DP AND TAD REQUIRING TP.
047384,000202:
047385,000203: 6164 34374 PUSHUP CAF OCT23 # IF THE LOW 5 BITS OF CYR ARE LESS THAN
047386,000204: 6165 70020 MASK CYR # 20, THIS OP REQUIRES SPECIAL ATTENTION.
047387,000205: 6166 66171 AD -OCT10 # (NO -0).
047388,000206: 6167 10000 CCS A
047389,000207: 6170 16202 TCF REGUP # FOR ALL CODES GREATER THAN OCT 7.
047390,000208:
047391,000209: 6171 77767 -OCT10 OCT -10
047392,000210:
047393,000211: 6172 66061 AD NEG4 # WE NOW HAVE 7 - OP CODE (MOD4). SEE IF
047394,000212: 6173 10000 CCS A # THE OP CODE (MOD4) IS THREE (REVERSE).
047395,000213: 6174 50000 INDEX A # NO - THE MODE IS DEFINITE. PICK UP THE
047396,000214: 6175 46213 CS NO.WDS
047397,000215: 6176 16204 TCF REGUP +2
047398,000216:
047399,000217: 6177 50163 INDEX MODE # FOR VXSC AND V/SC WE WANT THE REQUIRED
047400,000218: 6200 46211 CS REVCNT # PUSHLOC DECREMENT WITHOUT CHANGING THE
047401,000219: 6201 16204 TCF REGUP +2 # MODE AT THIS TIME.
047402,000220:
047403,000221: 6202 50163 REGUP INDEX MODE # MOST ALL OP CODES PUSHUP HERE.
047404,000222: 6203 46213 CS NO.WDS
047405,000223: 6204 26166 +2 ADS PUSHLOC
047406,000224: 6205 54116 TS ADDRWD
047407,000225: 6206 50020 ITR14 INDEX CYR
047408,000226: 6207 76242 7 INDJUMP -1 # (THE INDEX MAKES THIS A TCF.)
047409,000227:
047410,000228: 6210 00002 OCT 2 # REVERSE PUSHUP DECREMENT. VECTOR TAKES 2
047411,000229: 6211 00006 REVCNT OCT 6 # WORDS, SCALAR TAKES 6.
047412,000230: 6212 00006 OCT 6
047413,000231: 6213 00002 NO.WDS OCT 2 # CONVENTIONAL DECREMENT IS 6 WORDS VECTOR
047414,000232: 6214 00003 OCTAL3 OCT 3 # 2 IN DP, AND 3 IN TP.
047415,000233: 6215 00006 OCT 6
047416,000234:
047417,000235: # TEST THE SECOND PREFIX BIT TO SEE IF THIS IS A MISCELLANEOUS OR A UNARY/SHORT SHIFT OPERATION.
047418,000236:
047419,000237: 6216 10020 OPJUMP2 CCS CYR # TEST SECOND PREFIX BIT.
047420,000238: 6217 16232 TCF OPJUMP3 # TEST THIRD BIT TO SEE IF UNARY OR SHIFT.
047421,000239:
047422,000240: 6220 77722 -ENDVAC DEC -45 B-14
047423,000241:
047424,000242: # THE FOLLOWING ROUTINE PROCESSES ADDRESSES OF SUFFIX CLASS 10. THEY ARE BASICALLY WORK AREA ADDRESSES
047425,000243: # IN THE RANGE 0-52, ERASABLE ECADR CONSTANTS FROM 100-3777, AND FCADRS ABOVE THAT. ALL 15 BITS ARE AVAILABLE
047426,000244: # IN CONTRAST TO SUFFIX 1, IN WHICH ONLY THE LOW ORDER 14 ARE AVAILABLE.
047427,000245:
047428,000246: 6221 24164 15BITADR INCR LOC # (ENTRY HERE FROM STCALL).
047429,000247: 6222 50164 INDEX LOC # PICK UP ADDRESS WORD.
047430,000248: 6223 30000 CA 0
047431,000249: 6224 54117 TS POLISH # WE MAY NEED A SUBADDRESS LATER.
047432,000250:
047433,000251: 6225 35071 CAF LOW7+2K # THESE INSTRUCTIONS ARE IN BANK 1.
047434,000252: 6226 54004 TS FBANK
047435,000253: 6227 70020 MASK CYR
047436,000254: 6230 50000 ITR7 INDEX A
047437,000255: 6231 16303 TCF MISCJUMP
047438,000256:
047439,000257: # COMPLETE THE DISPATCHING OF UNARY AND SHORT SHIFT OPERATIONS.
047440,000258:
047441,000259: 6232 54004 OPJUMP3 TS FBANK # CALL IN BANK 0 (BITS 11-15 OF A ARE 0.)
047442,000260: # ITRACE (6) REFERS TO "OPJUMP3".
047443,000261: 6233 10020 CCS CYR # TEST THIRD PREFIX BIT.
047444,000262: 6234 50000 INDEX A # THE DECREMENTED UNARY CODE IS IN BITS
047445,000263: 6235 12000 TCF UNAJUMP # 1-4 OF A (ZERO, EXIT, HAS BEEN DETECTED)
047446,000264:
047447,000265: 6236 10163 CCS MODE # ITS A SHORT SHIFT CODE. SEE IF PRESENT
047448,000266: 6237 12017 TCF SHORTT # SCALAR OR VECTOR.
047449,000267: 6240 12017 TCF SHORTT
047450,000268: 6241 12121 TCF SHORTV # CALLS THE APPROPRIATE ROUTINE.
047451,000269:
047452,000270: 6242 4364 FBANKMSK EQUALS BANKMASK
047453,000271: 6242 00122 LVBUF ADRES VBUF
047454,000272:
047455,000273: # THE FOLLOWING IS THE JUMP TABLE FOR OP CODES WHICH MAY HAVE INDEXABLE ADDRESSES OR MAY PUSH UP.
047456,000274:
047457,000275: 6243 16454 INDJUMP TCF VLOAD # 00 - LOAD MPAC WITH A VECTOR.
047458,000276: 6244 17040 TCF TAD # 01 - TRIPLE PRECISION ADD TO MPAC.
047459,000277: 6245 17624 TCF SIGN # 02 - COMPLEMENT MPAC (V OR SC) IF X NEG.
047460,000278: 6246 17350 TCF VXSC # 03 - VECTOR TIMES SCALAR.
047461,000279: 6247 16652 TCF CGOTO # 04 - COMPUTED GO TO.
047462,000280: 6250 16437 TCF TLOAD # 05 - LOAD MPAC WITH TRIPLE PRECISION.
047463,000281: 6251 16021 TCF DLOAD # 06 - LOAD MPAC WITH A DP SCALAR.
047464,000282: 6252 17573 TCF V/SC # 07 - VECTOR DIVIDED BY SCALAR.
047465,000283:
047466,000284: 6253 16450 TCF SLOAD # 10 - LOAD MPAC IN SINGLE PRECISION.
047467,000285: 6254 16567 TCF SSP # 11 - SET SINGLE PRECISION INTO X.
047468,000286: 6255 16472 TCF PDDL # 12 - PUSH DOWN MPAC AND RE-LOAD IN DP.
047469,000287: 6256 17303 TCF MXV # 13 - MATRIX POST-MULTIPLIED BY VECTOR.
047470,000288: 6257 16526 TCF PDVL # 14 - PUSH DOWN AND VECTORLOAD.
047471,000289: 6260 16575 TCF CCALL # 15 - COMPUTED CALL.
047472,000290: 6261 17306 TCF VXM # 16 - MATRIX PRE-MULTIPLIED BY VECTOR.
047473,000291: 6262 17565 TCF TSLC # 17 - NORMALIZE MPAC (SCALAR ONLY).
047474,000292:
047475,000293: 6263 17543 TCF DMPR # 20 - DP MULTIPLY AND ROUND.
047476,000294: 6264 17546 TCF DDV # 21 - DP DIVIDE BY.
047477,000295: 6265 17552 TCF BDDV # 22 - DP DIVIDE INTO.
047478,000296: 6266 17570 TCF GSHIFT # 23 - GENERAL SHIFT INSTRUCTION.
047479,000297: 6267 16720 TCF VAD # 24 - VECTOR ADD.
047480,000298: 6270 16716 TCF VSU # 25 - VECTOR SUBTRACT.
047481,000299: 6271 17005 TCF BVSU # 26 - VECTOR SUBTRACT FROM.
047482,000300: 6272 17300 TCF DOT # 27 - VECTOR DOT PRODUCT.
047483,000301:
047484,000302: 6273 17427 TCF VXV # 30 - VECTOR CROSS PRODUCT.
047485,000303: 6274 17374 TCF VPROJ # 31 - VECTOR PROJECTION.
047486,000304: 6275 16754 TCF DSU # 32 - DP SUBTRACT.
047487,000305: 6276 17031 TCF BDSU # 33 - DP SUBTRACT FROM.
047488,000306: 6277 16744 TCF DAD # 34 - DP ADD.
047489,000307: 6300 16300 TCF +0 # 35 - AVAILABLE
047490,000308: 6301 17541 TCF DMP1 # 36 - DP MULTIPLY.
047491,000309: 6302 17562 TCF SETPD # 37 - SET PUSH DOWN POINTER (DIRECT ONLY)
047492,000310:
047493,000311: # CODES 10 AND 14 MUST NOT PUSH UP. CODE 04 MAY BE USED FOR VECTOR DECLARE BEFORE PUSHUP IF DESIRED.
047494,000312:
047495,000313: # THE FOLLOWING JUMP TABLE APPLIES TO INDEX, BRANCH, AND MISCELLANEOUS INSTRUCTIONS.
047496,000314:
047497,000315: 6303 12371 MISCJUMP TCF AXT # 00 - ADDRESS TO INDEX TRUE.
047498,000316: 6304 12376 TCF AXC # 01 - ADDRESS TO INDEX COMPLEMENTED.
047499,000317: 6305 12401 TCF LXA # 02 - LOAD INDEX FROM ERASABLE.
047500,000318: 6306 12405 TCF LXC # 03 - LOAD INDEX FROM COMPLEMENT OF ERAS.
047501,000319: 6307 12411 TCF SXA # 04 - STORE INDEX IN ERASABLE.
047502,000320: 6310 12417 TCF XCHX # 05 - EXCHANGE INDEX WITH ERASABLE.
047503,000321: 6311 12433 TCF INCR # 06 - INCREMENT INDEX REGISTER.
047504,000322: 6312 12442 TCF TIX # 07 - TRANSFER ON INDEX.
047505,000323:
047506,000324: 6313 12425 TCF XAD # 10 - INDEX REGISTER ADD FROM ERASABLE.
047507,000325: 6314 12436 TCF XSU # 11 - INDEX SUBTRACT FROM ERASABLE.
047508,000326: 6315 12514 TCF BZE/GOTO # 12 - BRANCH ZERO AND GOTO.
047509,000327: 6316 12521 TCF BPL/BMN # 13 - BRANCH PLUS AND BRANCH MINUS.
047510,000328: 6317 12474 TCF RTB/BHIZ # 14 - RETURN TO BASIC AND BRANCH HI ZERO.
047511,000329: 6320 12534 TCF CALL/ITA # 15 - CALL AND STORE QPRET.
047512,000330: 6321 12543 TCF SW/ # 16 - SWITCH INSTRUCTIONS AND AVAILABLE.
047513,000331: 6322 12504 TCF BOV(B) # 17 - BRANCH ON OVERFLOW TO BASIC OR INT.
047514,000332:
047515,000333: # THE FOLLOWING JUMP TABLE APPIES TO UNARY INSTRUCTIONS.
047516,000334: 6323 COUNT 00/INTER
047517,000335: 00,2000 BANK 0 # 00 - EXIT - DETECTED EARLIER.
047518,000336: 00,2000 13207 UNAJUMP TCF SQRT # 01 - SQUARE ROOT.
047519,000337: 00,2001 13527 TCF SINE # 02 - SIN.
047520,000338: 00,2002 13516 TCF COSINE # 03 - COS.
047521,000339: 00,2003 13607 TCF ARCSIN # 04 - ARC SIN.
047522,000340: 00,2004 13611 TCF ARCCOS # 05 - ARC COS.
047523,000341: 00,2005 13174 TCF DSQ # 06 - DP SQUARE.
047524,000342: 00,2006 12116 TCF ROUND # 07 - ROUND TO DP.
047525,000343:
047526,000344: 00,2007 17637 TCF COMP # 10 - COMPLEMENT VECTOR OR SCALAR.
047527,000345: 00,2010 13232 TCF VDEF # 11 - VECTOR DEFINE.
047528,000346: 00,2011 13023 TCF UNIT # 12 - UNIT VECTOR.
047529,000347: 00,2012 13176 TCF ABVALABS # 13 - LENGTH OF VECTOR OR MAG OF SCALAR.
047530,000348: 00,2013 13245 TCF VSQ # 14 - SQUARE OF LENGTH OF VECTOR.
047531,000349: 00,2014 16323 TCF STADR # 15 - PUSH UP ON STORE CODE.
047532,000350: 00,2015 13274 TCF RVQ # 16 - RETURN VIA QPRET.
047533,000351: 00,2016 13247 TCF PUSH # 17 - PUSH MPAC DOWN.
047534,000352:
047535,000353: # SECTION 2 LOAD AND STORE PACKAGE.
047536,000354:
047537,000355: # A SET OF EIGHT STORE CODES IS PROVIDED AS THE PRIMARY METHOD OF STORING THE MULTI-PURPOSE
047538,000356: # ACCUMULATOR (MPAC). IF IN THE DANZIG SECTION LOC REFERS TO AN ALGEBRAICALLY POSITIVE WORD, IT IS TAKEN AS A
047539,000357: # STORE CODE WITH A CORRESPONDING ERASABLE ADDRESS. MOST OF THESE CODES ARE TWO ADDRESS, SPECIFYING THAT THE WORD
047540,000358: # FOLLOWING THE STORE CODE IS TO BE USED AS AN ADDRESS FROM WHICH TO RE-LOAD MPAC. FOUR OPTIONS ARE AVAILABLE:
047541,000359:
047542,000360: # 1. STORE STORE MPAC. THE E ADDRESS MAY BE INDEXED.
047543,000361: # 2. STODL STORE MPAC AND RE-LOAD IT IN DP WITH THE NEXT ADDRESS (THE LOAD MAY BE INDEXED).
047544,000362: # 3. STOVL STORE MPAC AND RE-LOAD A VECTOR (AS ABOVE).
047545,000363: # 4. STCALL STORE AND DO A CALL (BOTH ADDRESSES MUST BE DIRECT HERE).
047546,000364:
047547,000365: # STODL AND STOVL WILL TAKE FROM THE PUSH-DOWN LIST IF NO LOAD ADDRESS IS GIVEN.
047548,000366:
047549,000367: 6323 BLOCK 3
047550,000368:
047551,000369: 6323 COUNT 03/INTER
047552,000370:
047553,000371: 6323 30165 STADR CA BANKSET # THE STADR CODE (PUSHUP UP ON STORE
047554,000372: 6324 54004 TS FBANK # ADDRESS) ENTERS HERE.
047555,000373: 6325 24164 INCR LOC
047556,000374: 6326 50164 ITR1 INDEX LOC # THE STORECODE WAS STORED COMPLEMENTED TO
047557,000375: 6327 40000 CS 0 # MAKE IT LOOK LIKE AN OPCODE PAIR.
047558,000376: 6330 67716 AD NEGONE # (YUL CANT REMOVE 1 BECAUSE OF EARLY CCS)
047559,000377:
047560,000378: 6331 54116 DOSTORE TS ADDRWD
047561,000379: 6332 74372 MASK LOW11 # ENTRY FROM DISPATCHER. SAVE THE ERASABLE
047562,000380: 6333 56116 XCH ADDRWD # ADDRESS AND JUMP ON THE STORE CODE NO.
047563,000381: 6334 77671 MASK B12T14
047564,000382: 6335 00006 EXTEND
047565,000383: 6336 75027 MP BIT5 # EACH TRANSFER VECTOR ENTRY IS TWO WORDS.
047566,000384: 6337 50000 ITR0 INDEX A
047567,000385: 6340 16341 TCF STORJUMP
047568,000386:
047569,000387: # STORE CODE JUMP TABLE. CALLS THE APPROPRIATE STORING ROUTINE AND EXITS TO DANZIG OR TO ADDRESS WITH
047570,000388: # A SUPPLIED OPERATION CODE.
047571,000389:
047572,000390: # STORE STORE,1 AND STORE,2 RETURN TO DANZIG, THUS RESETTING THE EBANK TO ITS STATE AT INTPRET.
047573,000391:
047574,000392: 6341 06371 STORJUMP TC STORE # STORE.
047575,000393: 6342 16030 TCF DANZIG # PICK UP NEW OP CODE(S).
047576,000394: 6343 06363 TC STORE,1
047577,000395: 6344 16030 TCF DANZIG
047578,000396: 6345 06366 TC STORE,2
047579,000397: 6346 16030 TCF DANZIG
047580,000398:
047581,000399: 6347 06371 TC STORE # STODL.
047582,000400: 6350 16427 TCF DODLOAD
047583,000401:
047584,000402: 6351 06371 TC STORE # STODL WITH INDEXED LOAD ADDRESS.
047585,000403: 6352 16113 TCF DODLOAD*
047586,000404:
047587,000405: 6353 06371 TC STORE # STOVL.
047588,000406: 6354 16432 TCF DOVLOAD
047589,000407:
047590,000408: 6355 06371 TC STORE # STOVL WITH INDEXED LOAD ADDRESS.
047591,000409: 6356 16435 TCF DOVLOAD*
047592,000410: 6357 06371 TC STORE # STOTC.
047593,000411: 6360 35044 CAF CALLCODE
047594,000412: 6361 54020 TS CYR
047595,000413: 6362 16221 TCF 15BITADR # GET A 15 BIT ADDRESS.
047596,000414:
047597,000415: # STORE CODE ADDRESS PROCESSOR.
047598,000416:
047599,000417: 6363 50120 STORE,1 INDEX FIXLOC
047600,000418: 6364 40046 CS X1
047601,000419: 6365 16370 TCF PRESTORE
047602,000420:
047603,000421: 6366 50120 STORE,2 INDEX FIXLOC
047604,000422: 6367 40047 CS X2
047605,000423: 6370 26116 PRESTORE ADS ADDRWD # RESULTANT ADDRESS IS IN ERASABLE.
047606,000424:
047607,000425: 6371 40116 STORE CS ADDRWD
047608,000426: 6372 65050 AD DEC45
047609,000427: 6373 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
047610,000428: 6374 30120 CA FIXLOC # YES.
047611,000429: 6375 16402 TCF AHEAD5
047612,000430: 6376 35065 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
047613,000431: 6377 56116 XCH ADDRWD
047614,000432: 6400 54003 TS EBANK
047615,000433: 6401 74373 MASK LOW8
047616,000434: 6402 26116 AHEAD5 ADS ADDRWD
047617,000435:
047618,000436: # STORING ROUTINES. STORE DP, TP, OR VECTOR AS INDICATED BY MODE.
047619,000437:
047620,000438: 6403 00006 STARTSTO EXTEND # MPAC,+1 MUST BE STORED IN ANY EVENT.
047621,000439: # ITRACE (5) REFERS TO "STARTSTO".
047622,000440: 6404 30155 DCA MPAC
047623,000441: 6405 50116 INDEX ADDRWD
047624,000442: 6406 52001 DXCH 0
047625,000443:
047626,000444: 6407 10163 CCS MODE
047627,000445: 6410 16423 TCF TSTORE
047628,000446: 6411 00002 TC Q
047629,000447:
047630,000448: 6412 00006 VSTORE EXTEND
047631,000449: 6413 30160 DCA MPAC +3
047632,000450: 6414 50116 INDEX ADDRWD
047633,000451: 6415 52003 DXCH 2
047634,000452:
047635,000453: 6416 00006 EXTEND
047636,000454: 6417 30162 DCA MPAC +5
047637,000455: 6420 50116 INDEX ADDRWD
047638,000456: 6421 52005 DXCH 4
047639,000457: 6422 00002 TC Q
047640,000458:
047641,000459: 6423 30156 TSTORE CA MPAC +2
047642,000460: 6424 50116 INDEX ADDRWD
047643,000461: 6425 54002 TS 2
047644,000462: 6426 00002 TC Q
047645,000463:
047646,000464: # ROUTINES TO BEGIN PROCESSING OF THE SECOND ADDRESS ASSOCIATED WITH ALL STORE-TYPE CODES EXCEPT STORE
047647,000465: # ITSELF.
047648,000466:
047649,000467: 6427 37701 DODLOAD CAF DLOADCOD
047650,000468: 6430 54020 TS CYR
047651,000469: 6431 16055 TCF DIRADRES # GO GET A DIRECT ADDRESS.
047652,000470:
047653,000471: 6432 35015 DOVLOAD CAF VLOADCOD
047654,000472: 6433 54020 TS CYR
047655,000473: 6434 16055 TCF DIRADRES
047656,000474:
047657,000475: 6435 36056 DOVLOAD* CAF VLOAD*
047658,000476: 6436 16114 TCF DODLOAD* +1 # PROLOGUE TO INDEX ROUTINE.
047659,000477:
047660,000478: # THE FOLLOWING LOAD INSTRUCTIONS ARE PROVIDED FOR LOADING THE MULTI-PURPOSE ACCUMULATOR MPAC.
047661,000479:
047662,000480: 6437 50116 TLOAD INDEX ADDRWD
047663,000481: 6440 30002 CA 2 # LOAD A TRIPLE PRECISION ARGUMENT INTO
047664,000482: 6441 54156 TS MPAC +2 # THE FIRST THREE MPAC REGISTERS, WITH THE
047665,000483: 6442 00006 EXTEND # CONTENTS OF THE OTHER FOUR IRRELEVANT.
047666,000484: 6443 50116 INDEX ADDRWD
047667,000485: 6444 30001 DCA 0
047668,000486: 6445 52155 DXCH MPAC
047669,000487: 6446 35033 TMODE CAF ONE
047670,000488: 6447 16027 TCF NEWMODE # DECLARE TRIPLE PRECISION MODE.
047671,000489:
047672,000490: 6450 22007 SLOAD ZL # LOAD A SINGLE PRECISION NUMBER INTO
047673,000491: 6451 50116 INDEX ADDRWD # MPAC, SETTING MPAC+1,2 TO ZERO. THE
047674,000492: 6452 30000 CA 0 # CONTENTS OF THE REMAINING MPAC REGISTERS
047675,000493: 6453 16024 TCF SLOAD2 # ARE IRRELEVANT.
047676,000494:
047677,000495: 6454 00006 VLOAD EXTEND # LOAD A DOUBLE PRECISION VECTOR INTO
047678,000496: 6455 50116 INDEX ADDRWD # MPAC,+1, MPAC+3,4, AND MPAC+5,6. THE
047679,000497: 6456 30001 DCA 0 # CONTENTS OF MPAC +2 ARE IRRELEVANT.
047680,000498: 6457 52155 DXCH MPAC
047681,000499:
047682,000500: 6460 00006 ENDVLOAD EXTEND # PDVL COMES HERE TO FINISH UP FOR DP, TP.
047683,000501: 6461 50116 INDEX ADDRWD
047684,000502: 6462 30003 DCA 2
047685,000503: 6463 52160 DXCH MPAC +3
047686,000504:
047687,000505: 6464 00006 +4 EXTEND # TPDVL FINISHES HERE.
047688,000506: 6465 50116 INDEX ADDRWD
047689,000507: 6466 30005 DCA 4
047690,000508: 6467 52162 DXCH MPAC +5
047691,000509:
047692,000510: 6470 45033 VMODE CS ONE # DECLARE VECTOR MODE.
047693,000511: 6471 16027 TCF NEWMODE
047694,000512:
047695,000513: # THE FOLLOWING INSTRUCTIONS ARE PROVIDED FOR STORING OPERANDS IN THE PUSHDOWN LIST:
047696,000514: # 1. PUSH PUSHDOWN AND NO LOAD.
047697,000515: # 2. PDDL PUSHDOWN AND DOUBLE PRECISION LOAD.
047698,000516: # 3. PDVL PUSHDOWN AND VECTOR LOAD.
047699,000517:
047700,000518: 6472 00006 PDDL EXTEND
047701,000519: 6473 50116 INDEX ADDRWD # LOAD MPAC,+1, PUSHING THE FORMER
047702,000520: 6474 30001 DCA 0 # CONTENTS DOWN.
047703,000521: 6475 52155 DXCH MPAC
047704,000522: 6476 50166 INDEX PUSHLOC
047705,000523: 6477 52001 DXCH 0
047706,000524:
047707,000525: 6500 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER APPRO-
047708,000526: 6501 36213 CAF NO.WDS # PRIATELY.
047709,000527: 6502 26166 ADS PUSHLOC
047710,000528:
047711,000529: 6503 10163 CCS MODE
047712,000530: 6504 16521 TCF ENDTPUSH
047713,000531: 6505 16517 TCF ENDDPUSH
047714,000532:
047715,000533: 6506 54163 TS MODE # NOW DP.
047716,000534: 6507 54156 ENDVPUSH TS MPAC +2
047717,000535: 6510 52160 DXCH MPAC +3 # PUSH DOWN THE REST OF THE VECTOR HERE.
047718,000536: 6511 50166 INDEX PUSHLOC
047719,000537: 6512 51775 DXCH 0 -4
047720,000538:
047721,000539: 6513 52162 DXCH MPAC +5
047722,000540: 6514 50166 INDEX PUSHLOC
047723,000541: 6515 51777 DXCH 0 -2
047724,000542:
047725,000543: 6516 16030 TCF DANZIG
047726,000544:
047727,000545: 6517 54156 ENDDPUSH TS MPAC +2 # SET MPAC +2 TO ZERO AND EXIT ON DP.
047728,000546: 6520 16030 TCF DANZIG
047729,000547:
047730,000548: 6521 54163 ENDTPUSH TS MODE
047731,000549: 6522 56156 XCH MPAC +2 # ON TRIPLE, SET MPAC +2 TO ZERO, PUSHING
047732,000550: 6523 50166 +2 INDEX PUSHLOC # DOWN THE OLD CONTENTS
047733,000551: 6524 53777 TS 0 -1
047734,000552: 6525 16030 TCF DANZIG
047735,000553:
047736,000554: # PDVL - PUSHDOWN AND VECTOR LOAD.
047737,000555:
047738,000556: 6526 00006 PDVL EXTEND # RELOAD MPAC AND PUSH DOWN ITS CONTENTS.
047739,000557: 6527 50116 INDEX ADDRWD
047740,000558: 6530 30001 DCA 0
047741,000559: 6531 52155 DXCH MPAC
047742,000560: 6532 50166 INDEX PUSHLOC
047743,000561: 6533 52001 DXCH 0
047744,000562:
047745,000563: 6534 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER.
047746,000564: 6535 36213 CAF NO.WDS
047747,000565: 6536 26166 ADS PUSHLOC
047748,000566:
047749,000567: 6537 10163 CCS MODE # TEST PAST MODE.
047750,000568: 6540 16557 TCF TPDVL
047751,000569: 6541 16460 TCF ENDVLOAD # JUST LOAD LAST FOUR REGISTERS ON DP.
047752,000570:
047753,000571: 6542 00006 VPDVL EXTEND # PUSHDOWN AND RE-LOAD LAST TWO COMPONENTS
047754,000572: 6543 50116 INDEX ADDRWD
047755,000573: 6544 30003 DCA 2
047756,000574: 6545 52160 DXCH MPAC +3
047757,000575: 6546 50166 INDEX PUSHLOC
047758,000576: 6547 51775 DXCH 0 -4
047759,000577:
047760,000578: 6550 00006 EXTEND
047761,000579: 6551 50116 INDEX ADDRWD
047762,000580: 6552 30005 DCA 4
047763,000581: 6553 52162 DXCH MPAC +5
047764,000582: 6554 50166 INDEX PUSHLOC
047765,000583: 6555 51777 DXCH 0 -2
047766,000584:
047767,000585: 6556 16030 TCF DANZIG
047768,000586:
047769,000587: 6557 00006 TPDVL EXTEND # ON TP, WE MUST LOAD THE Y COMPONENT
047770,000588: 6560 50116 INDEX ADDRWD # BEFORE STORING MPAC +2 IN CASE THIS IS A
047771,000589: 6561 30003 DCA 2 # PUSHUP.
047772,000590: 6562 52160 DXCH MPAC +3
047773,000591:
047774,000592: 6563 30156 CA MPAC +2
047775,000593: 6564 50166 INDEX PUSHLOC # IN DP.
047776,000594: 6565 53777 TS 0 -1
047777,000595: 6566 16464 TCF ENDVLOAD +4
047778,000596:
047779,000597: # SSP (STORE SINGLE PRECISION) IS EXECUTED HERE.
047780,000598:
047781,000599: 6567 24164 SSP INCR LOC # PICK UP THE WORD FOLLOWING THE GIVEN
047782,000600: 6570 50164 INDEX LOC # ADDRESS AND STORE IT AT X.
047783,000601: 6571 30000 CA 0
047784,000602: 6572 50116 STORE1 INDEX ADDRWD # SOME INDEX AND MISCELLANEOUS OPS END
047785,000603: 6573 54000 TS 0 # HERE.
047786,000604: 6574 16030 TCF DANZIG
047787,000605:
047788,000606: # SEQUENCE CHANGING AND SUBROUTINE CALLING OPTIONS.
047789,000607:
047790,000608: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR SEQUENCING CHANGING, BRANCHING, AND CALLING SUBROUTINES:
047791,000609: # 1. GOTO GO TO.
047792,000610: # 2. CALL CALL SUBROUTINE SETTING QPRET.
047793,000611: # 3. CGOTO COMPUTED GO TO.
047794,000612: # 4. CCALL COMPUTED CALL.
047795,000613: # 7. BPL BRANCH IF MPAC POSITIVE OR ZERO.
047796,000614: # 8. BZE BRANCH IF MPAC ZERO.
047797,000615: # 9. BMN BRANCH IF MPAC NEGATIVE NON-ZERO.
047798,000616:
047799,000617: 6575 24164 CCALL INCR LOC # MAINTAIN LOC FOR QPRET COMPUTATION.
047800,000618: 6576 50164 INDEX LOC
047801,000619: 6577 30000 CAF 0 # GET BASE ADDRESS OF CADR LIST.
047802,000620: 6600 50116 INDEX ADDRWD
047803,000621: 6601 60000 AD 0 # ADD INCREMENT.
047804,000622: 6602 54004 TS FBANK # SELECT DESIRED CADR.
047805,000623: 6603 75070 MASK LOW10
047806,000624: 6604 50000 INDEX A
047807,000625: 6605 32000 CAF 10000
047808,000626: 6606 54117 TS POLISH
047809,000627:
047810,000628: 6607 30165 CALL CA BANKSET # FOR ANY OF THE CALL OPTIONS, MAKE UP THE
047811,000629: 6610 74364 MASK BANKMASK # ADDRESS OF THE NEXT OP-CODE PAIR/STORE
047812,000630: 6611 64364 AD BANKMASK # CODE AND LEAVE IT IN QPRET. NOTE THAT
047813,000631: 6612 60164 AD LOC # BANKMASK = -(2000 - 1).
047814,000632: 6613 50120 INDEX FIXLOC
047815,000633: 6614 54052 TS QPRET
047816,000634:
047817,000635: 6615 30117 GOTO CA POLISH # BASIC BRANCHING SEQUENCE.
047818,000636: 6616 77711 +1 MASK HIGH4
047819,000637: 6617 00006 EXTEND
047820,000638: 6620 16631 BZF GOTOERS # SEE IF ADDRESS POINTS TO FIXED OR ERAS.
047821,000639: 6621 30165 +4 CA BANKSET # SET EBANK PART OF BBANK. NEXT, SET UP
047822,000640: 6622 54006 TS BBANK # FBANK. THE COMBINATION IS PICKED UP &
047823,000641: 6623 30117 CA POLISH # PUT INTO BANKSET AT INTPRET +2.
047824,000642: 6624 54004 TS FBANK
047825,000643: 6625 75070 MASK LOW10
047826,000644: 6626 65021 AD 2K
047827,000645: 6627 54164 TS LOC
047828,000646: 6630 16011 TCF INTPRET +3
047829,000647:
047830,000648: 6631 E3,1400 EBANK= 1400 # SO YUL DOESN'T CUSS THE "CA 1400" BELOW.
047831,000649:
047832,000650: 6631 30117 GOTOERS CA POLISH # THE GIVEN ADDRESS IS IN ERASABLE - SEE
047833,000651: 6632 66220 AD -ENDVAC # IF RELATIVE TO THE WORK AREA.
047834,000652: 6633 10000 CCS A
047835,000653: 6634 30117 CA POLISH # GENERAL ERASABLE.
047836,000654: 6635 16644 TCF GOTOGE
047837,000655:
047838,000656: 6636 30120 CA FIXLOC # WORK AREA.
047839,000657: 6637 60117 AD POLISH
047840,000658: 6640 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
047841,000659: 6641 30000 CA 0 # THE BRANCH ADDRESS.
047842,000660: 6642 54117 TS POLISH
047843,000661: 6643 16616 TCF GOTO +1 # ALLOWS ARBITRARY INDIRECTNESS LEVELS.
047844,000662:
047845,000663: 6644 54003 GOTOGE TS EBANK
047846,000664: 6645 74373 MASK LOW8
047847,000665: 6646 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
047848,000666: 6647 31400 CA 1400 # THE BRANCH ADDRESS.
047849,000667: 6650 54117 TS POLISH
047850,000668: 6651 16616 TCF GOTO +1
047851,000669:
047852,000670: 6652 50164 CGOTO INDEX LOC # COMPUTED GO TO. PICK UP ADDRESS OF CADR
047853,000671: 6653 30001 CA 1 # LIST.
047854,000672: 6654 50116 INDEX ADDRWD # ADD MODIFIER.
047855,000673: 6655 60000 AD 0
047856,000674: 6656 54004 TS FBANK # SELECT GOTO ADDRESS.
047857,000675: 6657 75070 MASK LOW10
047858,000676: 6660 50000 INDEX A
047859,000677: 6661 32000 CA 10000
047860,000678: 6662 54117 TS POLISH
047861,000679: 6663 16616 TCF GOTO +1 # WITH ADDRESS IN A.
047862,000680:
047863,000681: 6664 30165 SWBRANCH CA BANKSET # SWITCH INSTRUCTIONS WHICH ELECT TO
047864,000682: 6665 54004 TS FBANK # BRANCH COME HERE TO DO SO.
047865,000683: 6666 50164 INDEX LOC
047866,000684: 6667 30001 CA 1
047867,000685: 6670 54117 TS POLISH
047868,000686: 6671 16616 TCF GOTO +1
047869,000687:
047870,000688: # TRIPLE PRECISION BRANCHING ROUTINE. IF CALLING TC IS AT L, RETURN IS AS FOLLOWS:
047871,000689: # L+1 IF MPAC IS GREATER THAN ZERO.
047872,000690: # L+2 IF MPAC IS EQUAL TO +0 OR -0.
047873,000691: # L+3 IF MPAC IS LESS THAN ZERO.
047874,000692:
047875,000693: 6672 10154 BRANCH CCS MPAC
047876,000694: 6673 00002 TC Q
047877,000695: 6674 16676 TCF +2 # ON ZERO.
047878,000696: 6675 16710 TCF NEG
047879,000697:
047880,000698: 6676 10155 CCS MPAC +1
047881,000699: 6677 00002 TC Q
047882,000700: 6700 16702 TCF +2
047883,000701: 6701 16710 TCF NEG
047884,000702:
047885,000703: 6702 10156 CCS MPAC +2
047886,000704: 6703 00002 TC Q
047887,000705: 6704 16706 TCF +2
047888,000706: 6705 16710 TCF NEG
047889,000707:
047890,000708: 6706 50002 Q+1 INDEX Q
047891,000709: 6707 00001 TC 1
047892,000710:
047893,000711: 6710 50002 NEG INDEX Q # IF FIRST NON-ZERO REGISTER WAS NEGATIVE.
047894,000712: 6711 00002 TC 2
047895,000713:
047896,000714: 6712 6710 Q+2 = NEG
047897,000715:
047898,000716: # ITRACE (3) REFERS TO "EXIT".
047899,000717:
047900,000718: 6712 30165 EXIT CA BANKSET # RESTORE USER'S BANK SETTING, AND LEAVE
047901,000719: 6713 54006 TS BBANK # INTERPRETIVE MODE.
047902,000720: 6714 50164 INDEX LOC
047903,000721: 6715 00001 TC 1
047904,000722:
047905,000723: # SECTION 3 - ADD/SUBTRACT PACKAGE.
047906,000724:
047907,000725: # THE FOLLOWING OPERATIONS ARE PROVIDED FOR ADDING TO AND SUBTRACTING FROM THE MULTI-PURPOSE ACCUMULATOR
047908,000726: # MPAC:
047909,000727: # 1. DAD DOUBLE PRECISION ADD.
047910,000728: # 2. DSU DOUBLE PRECISION SUBTRACT.
047911,000729: # 3. BDSU DOUBLE PRECISION SUBTRACT FROM.
047912,000730: # 4. TAD TRIPLE PRECISION ADD.
047913,000731: # 5. VAD VECTOR ADD.
047914,000732: # 6. VSU VECTOR SUBTRACT.
047915,000733: # 7. BVSU VECTOR SUBTRACT FROM.
047916,000734: # THE INTERPRETIVE OVERFLOW INDICATOR OVFIND IS SET NON-ZERO IF OVERFLOW OCCURS IN ANY OF THE ABOVE.
047917,000735:
047918,000736: 6716 35015 VSU CAF BIT15 # CHANGES 0 TO DCS.
047919,000737: 6717 16721 TCF +2
047920,000738:
047921,000739: 6720 34371 VAD CAF PRIO30 # CHANGES 0 TO DCA.
047922,000740: 6721 26116 ADS ADDRWD
047923,000741: 6722 00006 EXTEND
047924,000742: 6723 50116 INDEX ADDRWD
047925,000743: 6724 00003 READ HISCALAR # DCA 2 OR DCS 2
047926,000744: 6725 20160 DAS MPAC +3
047927,000745: 6726 00006 EXTEND # CHECK OVERFLOW.
047928,000746: 6727 16731 BZF +2
047929,000747: 6730 06763 TC OVERFLWY
047930,000748:
047931,000749: 6731 00006 EXTEND
047932,000750: 6732 50116 INDEX ADDRWD
047933,000751: 6733 00005 READ CHAN5 # DCA 4 OR DCS 4
047934,000752: 6734 20162 DAS MPAC +5
047935,000753: 6735 00006 EXTEND
047936,000754: 6736 16740 BZF +2
047937,000755: 6737 06760 TC OVERFLWZ
047938,000756:
047939,000757: 6740 00006 EXTEND
047940,000758: 6741 50116 INDEX ADDRWD
047941,000759: 6742 00001 READ LCHAN # DCA 0 OR DCS 0
047942,000760: 6743 16747 TCF ENDVXV
047943,000761:
047944,000762: 6744 00006 DAD EXTEND
047945,000763: 6745 50116 INDEX ADDRWD
047946,000764: 6746 30001 DCA 0
047947,000765: 6747 20155 ENDVXV DAS MPAC # VXV FINISHES HERE.
047948,000766: 6750 00006 EXTEND
047949,000767: 6751 16030 BZF DANZIG
047950,000768:
047951,000769: 6752 06766 SETOVF TC OVERFLOW
047952,000770: 6753 16030 TCF DANZIG
047953,000771:
047954,000772: 6754 00006 DSU EXTEND
047955,000773: 6755 50116 INDEX ADDRWD
047956,000774: 6756 40001 DCS 0
047957,000775: 6757 16747 TCF ENDVXV
047958,000776:
047959,000777: 6760 54001 OVERFLWZ TS L # ENTRY FOR THIRD COMPONENT.
047960,000778: 6761 35036 CAF FIVE
047961,000779: 6762 16765 TCF +3
047962,000780:
047963,000781: 6763 54001 OVERFLWY TS L # ENTRY FOR SECOND COMPONENT.
047964,000782: 6764 36214 CAF THREE
047965,000783: 6765 56001 XCH L
047966,000784:
047967,000785: 6766 50000 OVERFLOW INDEX A # ENTRY FOR 1ST COMP OR DP (L=0).
047968,000786: 6767 45014 CS LIMITS # PICK UP POSMAX OR NEGMAX.
047969,000787: 6770 54130 TS BUF
047970,000788: 6771 00006 EXTEND
047971,000789: 6772 24000 AUG A # FORCE OVERFLOW.
047972,000790: 6773 50001 INDEX L
047973,000791: 6774 26155 ADS MPAC +1
047974,000792: 6775 54007 TS 7
047975,000793: 6776 35035 CAF ZERO
047976,000794: 6777 60130 AD BUF
047977,000795: 7000 50001 INDEX L
047978,000796: 7001 26154 ADS MPAC
047979,000797: 7002 54007 TS 7
047980,000798: 7003 00002 TC Q # NO OVERFLOW EXIT.
047981,000799: 7004 17121 TCF SETOVF2 # SET OVFIND AND EXIT.
047982,000800:
047983,000801: 7005 00006 BVSU EXTEND
047984,000802: 7006 50116 INDEX ADDRWD
047985,000803: 7007 30003 DCA 2
047986,000804: 7010 52160 DXCH MPAC +3
047987,000805: 7011 00006 EXTEND
047988,000806: 7012 40001 DCOM
047989,000807: 7013 20160 DAS MPAC +3
047990,000808: 7014 00006 EXTEND
047991,000809: 7015 17017 BZF +2
047992,000810: 7016 06763 TC OVERFLWY
047993,000811:
047994,000812: 7017 00006 EXTEND
047995,000813: 7020 50116 INDEX ADDRWD
047996,000814: 7021 30005 DCA 4
047997,000815: 7022 52162 DXCH MPAC +5
047998,000816: 7023 00006 EXTEND
047999,000817: 7024 40001 DCOM
048000,000818: 7025 20162 DAS MPAC +5
048001,000819: 7026 00006 EXTEND
048002,000820: 7027 17031 BZF +2
048003,000821: 7030 06760 TC OVERFLWZ
048004,000822:
048005,000823: 7031 00006 BDSU EXTEND
048006,000824: 7032 50116 INDEX ADDRWD
048007,000825: 7033 30001 DCA 0
048008,000826: 7034 52155 DXCH MPAC
048009,000827: 7035 00006 EXTEND
048010,000828: 7036 40001 DCOM
048011,000829: 7037 16747 TCF ENDVXV
048012,000830:
048013,000831: # TRIPLE PRECISION ADD ROUTINE.
048014,000832:
048015,000833: 7040 00006 TAD EXTEND
048016,000834: 7041 50116 INDEX ADDRWD
048017,000835: 7042 30002 DCA 1 # ADD MINOR PARTS FIRST.
048018,000836: 7043 20156 DAS MPAC +1
048019,000837: 7044 50116 INDEX ADDRWD
048020,000838: 7045 60000 AD 0
048021,000839: 7046 60154 AD MPAC
048022,000840: 7047 54154 TS MPAC
048023,000841: 7050 16030 TCF DANZIG
048024,000842:
048025,000843: 7051 16752 TCF SETOVF # SET OVFIND IF SUCH OCCURS.
048026,000844:
048027,000845: # ARITHMETIC SUBROUTINES REQUIRED IN FIXED-FIXED.
048028,000846: # 1. DMPSUB DOUBLE PRECISION MULTIPLY. MULTIPLY THE CONTENTS OF MPAC,+1 BY THE DP WORD WHOSE ADDRESS
048029,000847: # IS IN ADDRWD AND LEAVE A TRIPLE PRECISION RESULT IN MPAC.
048030,000848: # 2. ROUNDSUB ROUND THE TRIPLE PRECISON CONTENTS OF MPAC TO DOUBLE PRECISION.
048031,000849: # 3. DOTSUB TAKE THE DOT PRODUCT OF THE VECTOR IN MPAC AND THE VECTOR WHOSE ADDRESS IS IN ADDRWD
048032,000850: # AND LEAVE THE TRIPLE PRECISION RESULT IN MPAC.
048033,000851: # 4. POLY USING THE CONTENTS OF MPAC AS A DP ARGUMENT, EVALUATE THE POLYNOMIAL WHOSE DEGREE AND
048034,000852: # COEFFICIENTS IMMEDIATELY FOLLOW THE TC POLY INSTRUCTION (SEE ROUTINE FOR DETAILS.)
048035,000853:
048036,000854: 7052 50002 DMP INDEX Q # BASIC SUBROUTINE FOR USE BY PINBALL, ETC
048037,000855: 7053 30000 CAF 0 # ADRES OF ARGUMENT FOLLOWS TC DMP .
048038,000856: 7054 24002 INCR Q
048039,000857: 7055 54116 -1 TS ADDRWD # (PROLOGUE FOR SETTING ADDRWD.)
048040,000858:
048041,000859: 7056 50116 DMPSUB INDEX ADDRWD # GET MINOR PART OF OPERAND AT C(ADDRWD).
048042,000860: 7057 30001 CA 1
048043,000861: 7060 54156 TS MPAC +2 # THIS WORKS FOR SQUARING MPAC AS WELL.
048044,000862: 7061 35035 CAF ZERO # SET MPAC +1 TO ZERO SO WE CAN ACCUMULATE
048045,000863: 7062 56155 XCH MPAC +1 # THE PARTIAL PRODUCTS WITH DAS
048046,000864: 7063 54135 TS MPTEMP # INSTRUCTIONS.
048047,000865: 7064 00006 EXTEND
048048,000866: 7065 70156 MP MPAC +2 # MINOR OF MPAC X MINOR OF C(ADDRWD).
048049,000867:
048050,000868: 7066 56156 XCH MPAC +2 # DISCARD MINOR PART OF ABOVE RESULT AND
048051,000869: 7067 00006 EXTEND # FORM MAJOR OF MPAC X MINOR OF C(ADDRWD).
048052,000870: 7070 70154 MP MPAC
048053,000871: 7071 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
048054,000872:
048055,000873: 7072 50116 INDEX ADDRWD # GET MAJOR PART OF ARGUMENT AT C(ADDRWD).
048056,000874: 7073 30000 CA 0
048057,000875: 7074 56135 XCH MPTEMP # SAVE AND BRING OUT MINOR OF MPAC.
048058,000876: 7075 00006 DMPSUB2 EXTEND
048059,000877: 7076 70135 MP MPTEMP # MAJOR OF C(ADDRWD) X MINOR OF MPAC.
048060,000878: 7077 20156 DAS MPAC +1 # ACCUMULATE, SETTING A TO NET OVERFLOW.
048061,000879:
048062,000880: 7100 56154 XCH MPAC # SETTING MPAC TO 0 OR +-1.
048063,000881: 7101 00006 EXTEND
048064,000882: 7102 70135 MP MPTEMP # MAJOR OF MPAC X MAJOR OF C(ADDRWD).
048065,000883: 7103 20155 DAS MPAC # GUARANTEED NO OVERFLOW.
048066,000884: 7104 00002 TC Q # 49 MCT = .573 MS. INCLUDING RETURN.
048067,000885:
048068,000886: # ROUND MPAC TO DOUBLE PRECISION, SETTING OVFIND ON THE RARE EVENT OF OVERFLOW.
048069,000887:
048070,000888: 7105 35035 ROUNDSUB CAF ZERO # SET MPAC +2 = 0 FOR SCALARS AND CHANGE
048071,000889: 7106 54163 +1 TS MODE # MODE TO DP.
048072,000890:
048073,000891: 7107 56156 VROUND XCH MPAC +2 # BUT WE NEEDNT TAKE THE TIME FOR VECTORS.
048074,000892: 7110 60000 DOUBLE
048075,000893: 7111 54001 TS L
048076,000894: 7112 00002 TC Q
048077,000895:
048078,000896: 7113 60155 AD MPAC +1 # ADD ROUNDING BIT IF MPAC +2 WAS GREATER
048079,000897: 7114 54155 TS MPAC +1 # THAN .5 IN MAGNITUDE.
048080,000898: 7115 00002 TC Q
048081,000899:
048082,000900: 7116 60154 AD MPAC # PROPAGATE INTERFLOW.
048083,000901: 7117 54154 TS MPAC
048084,000902: 7120 00002 TC Q
048085,000903:
048086,000904: 7121 54121 SETOVF2 TS OVFIND # (RARE).
048087,000905: 7122 00002 TC Q
048088,000906:
048089,000907: # THE DOT PRODUCT SUBROUTINE USUALLY FORMS THE DOT PRODUCT OF THE VECTOR IN MPAC WITH A STANDARD SIX
048090,000908: # REGISTER VECTOR WHOSE ADDRESS IS IN ADDRWD. IN THIS CASE C(DOTINC) ARE SET TO 2. VXM, HOWEVER, SETS C(DOTINC) TO
048091,000909: # 6 SO THAT DOTSUB DOTS MPAC WITH A COLUMN VECTOR OF THE MATRIX IN QUESTION IN THIS CASE.
048092,000910:
048093,000911: 7123 35032 PREDOT CAF TWO # PROLOGUE TO SET DOTINC TO 2.
048094,000912: 7124 54136 TS DOTINC
048095,000913:
048096,000914: 7125 00006 DOTSUB EXTEND
048097,000915: 7126 22137 QXCH DOTRET # SAVE RETURN.
048098,000916: 7127 07056 TC DMPSUB # DOT X COMPONENTS.
048099,000917: 7130 52160 DXCH MPAC +3 # POSITION Y COMPONENT OF MPAC FOR
048100,000918: 7131 52155 DXCH MPAC # MULTIPLICATION WHILE SAVING RESULT IN
048101,000919: 7132 52131 DXCH BUF # THREE WORD BUFFER, BUF.
048102,000920: 7133 30156 CA MPAC +2
048103,000921: 7134 54132 TS BUF +2
048104,000922:
048105,000923: 7135 30136 CA DOTINC # ADVANCE ADDRWD TO Y COMPONENT OF
048106,000924: 7136 26116 ADS ADDRWD # OTHER ARGUMENT.
048107,000925: 7137 07056 TC DMPSUB
048108,000926: 7140 52156 DXCH MPAC +1 # ACCUMULATE PARTIAL PRODUCTS.
048109,000927: 7141 20132 DAS BUF +1
048110,000928: 7142 60154 AD MPAC
048111,000929: 7143 60130 AD BUF
048112,000930: 7144 54130 TS BUF
048113,000931: 7145 17147 TCF +2
048114,000932: 7146 54121 TS OVFIND # IF OVERFLOW OCCURS.
048115,000933:
048116,000934: 7147 52162 DXCH MPAC +5 # MULTIPLY Z COMPONENTS.
048117,000935: 7150 52155 DXCH MPAC
048118,000936: 7151 30136 CA DOTINC
048119,000937: 7152 26116 ADS ADDRWD
048120,000938: 7153 07056 TC DMPSUB
048121,000939: 7154 52132 ENDDOT DXCH BUF +1 # LEAVE FINAL ACCUMULATION IN MPAC.
048122,000940: 7155 20156 DAS MPAC +1
048123,000941: 7156 60154 AD MPAC
048124,000942: 7157 60130 AD BUF
048125,000943: 7160 54154 TS MPAC
048126,000944: 7161 00137 TC DOTRET
048127,000945:
048128,000946: 7162 06766 TC OVERFLOW # ON OVERFLOW HERE.
048129,000947: 7163 00137 TC DOTRET
048130,000948:
048131,000949: # DOUBLE PRECISION POLYNOMIAL EVALUATOR
048132,000950: # N N-1
048133,000951: # THIS ROUTINE EVALUATES A X + A X + ... + A X + A LEAVING THE DP RESULT IN MPAC ON EXIT.
048134,000952: # N N-1 1 0
048135,000953:
048136,000954: # THE ROUTINE HAS TWO ENTRIES
048137,000955:
048138,000956: # 1. ENTRY THRU POWRSERS. THE COEFFICIENTS MAY BE EITHER IN FIXED OR ERASABLE, THE CALL IS BY
048139,000957: # TC POWRSERS, AND THE RETURN IS TO LOC(TC POWRSERS)+1. THE ENTERING DATA MUST BE AS FOLLOWS
048140,000958:
048141,000959: # A SP LOC-3 ADDRESS FOR REFERENCING COEF TABLE
048142,000960: # L SP N-1 N IS THE DEGREE OF THE POWER SERIES
048143,000961: # MPAC DP X ARGUMENT
048144,000962: # LOC-2N DP A(0)
048145,000963: # ...
048146,000964: # LOC DP A(N)
048147,000965:
048148,000966: # 2. ENTRY THRU POLY. THE CALL TO POLY AND THE ENTERING DATA MUST BE AS FOLLOWS
048149,000967:
048150,000968: # MPAC DP X ARGUMENT
048151,000969: # LOC TC POLY
048152,000970: # LOC+1 SP N-1
048153,000971: # LOC+2 DP A(0)
048154,000972: # ...
048155,000973: # LOC+2N+2 DP A(N) RETURN IS TO LOC+2N+4
048156,000974:
048157,000975: 7164 00006 POWRSERS EXTEND
048158,000976: 7165 22141 QXCH POLYRET # RETURN ADDRESS
048159,000977: 7166 54117 TS POLISH # POWER SERIES ADDRESS
048160,000978: 7167 22140 LXCH POLYCNT # N-1 TO COUNTER
048161,000979: 7170 17201 TCF POLYCOM # SKIP SET UP BY POLY
048162,000980:
048163,000981: 7171 50002 POLY INDEX Q
048164,000982: 7172 30000 CAF 0
048165,000983: 7173 54140 TS POLYCNT # N-1 TO COUNTER
048166,000984: 7174 60000 DOUBLE
048167,000985: 7175 60002 AD Q
048168,000986: 7176 54117 TS POLISH # L(A(N))-3 TO POLISH
048169,000987: 7177 65036 AD FIVE
048170,000988: 7200 54141 TS POLYRET # STORE RETURN ADDRESS
048171,000989:
048172,000990: 7201 36242 POLYCOM CAF LVBUF # INCOMING X WILL BE MOVED TO VBUF, SO
048173,000991: 7202 54116 TS ADDRWD # SET ADDRWD SO DMPSUB WILL MPY BY VBUF.
048174,000992:
048175,000993: 7203 00006 EXTEND
048176,000994: 7204 50117 INDEX POLISH
048177,000995: 7205 30004 DCA 3
048178,000996:
048179,000997: 7206 52155 DXCH MPAC # LOAD A(N) INTO MPAC,
048180,000998: 7207 52123 DXCH VBUF # SAVING X IN VBUF
048181,000999: 7210 17214 TCF POLY2
048182,001000:
048183,001001: 7211 54140 POLYLOOP TS POLYCNT # SAVE DECREMENTED LOOP COUNTER
048184,001002: 7212 45032 CS TWO
048185,001003: 7213 26117 ADS POLISH # REGRESS COEFFICIENT POINTER
048186,001004:
048187,001005: 7214 07056 POLY2 TC DMPSUB # MULTIPLY BY X
048188,001006: 7215 00006 EXTEND
048189,001007: 7216 50117 INDEX POLISH
048190,001008: 7217 30002 DCA 1 # ADD IN NEXT COEFFICIENT
048191,001009: 7220 20155 DAS MPAC # USERS RESPONSIBILITY TO ASSURE NO OVFLOW
048192,001010:
048193,001011: 7221 10140 CCS POLYCNT
048194,001012: 7222 17211 TCF POLYLOOP
048195,001013: 7223 00141 TC POLYRET # RETURN CALLER
048196,001014:
048197,001015: # MISCELLANEOUS MULTI-PRECISION ROUTINES REQUIRED IN FIXED-FIXED BUT NOT USED BY THE INTERPRETER.
048198,001016:
048199,001017: 7224 35035 DPAGREE CAF ZERO # DOUBLE PRECISION ENTRY -
048200,001018: 7225 54156 TS MPAC +2 # ZERO LOW-ORDER WORD
048201,001019:
048202,001020: 7226 22002 TPAGREE LXCH Q # FORCE SIGN AGREEMENT AMONG THE TRIPLE
048203,001021: 7227 06672 TC BRANCH # PRECISION CONTENTS OF MPAC. RETURNING
048204,001022: 7230 17234 TCF ARG+ # WITH SIGNUM OF THE INPUT IN A.
048205,001023: 7231 17254 TCF ARGZERO
048206,001024:
048207,001025: 7232 45013 CS POSMAX # IF NEGATIVE.
048208,001026: 7233 17235 TCF +2
048209,001027:
048210,001028: 7234 35013 ARG+ CAF POSMAX
048211,001029: 7235 54002 TS Q
048212,001030: 7236 00006 EXTEND
048213,001031: 7237 24000 AUG A # FORMS +-1.0.
048214,001032: 7240 60156 AD MPAC +2
048215,001033: 7241 54156 TS MPAC +2
048216,001034: 7242 35035 CAF ZERO
048217,001035: 7243 60002 AD Q
048218,001036: 7244 60155 AD MPAC +1
048219,001037: 7245 54155 TS MPAC +1
048220,001038: 7246 35035 CAF ZERO
048221,001039: 7247 60002 AD Q # Q STILL HAS POSMAX OR NEGMAX IN IT.
048222,001040: 7250 60154 AD MPAC
048223,001041: 7251 54154 ARGZERO2 TS MPAC # ALWAYS SKIPPING UNLESS ARGZERO.
048224,001042: 7252 54155 TS MPAC +1
048225,001043: 7253 00001 TC L # RETURN VIA L.
048226,001044:
048227,001045: 7254 54156 ARGZERO TS MPAC +2 # SET ALL THREE MPAC REGISTERS TO ZERO.
048228,001046: 7255 17251 TCF ARGZERO2
048229,001047:
048230,001048: # SHORTMP MULTIPLIES THE TP CONTENTS OF MPAC BY THE SINGLE PRECISION NUMBER ARRIVING IN A.
048231,001049:
048232,001050: 7256 54135 SHORTMP TS MPTEMP
048233,001051: 7257 00006 EXTEND
048234,001052: 7260 70156 MP MPAC +2
048235,001053: 7261 54156 TS MPAC +2
048236,001054: 7262 35035 SHORTMP2 CAF ZERO # SO SUBSEQUENT DAS WILL WORK.
048237,001055: 7263 56155 XCH MPAC +1
048238,001056: 7264 17075 TCF DMPSUB2
048239,001057:
048240,001058: # DMPNSUB MULTIPLIES THE DP FRACTION ARRIVING IN MPAC BY THE SP
048241,001059: # INTEGER ARRIVING IN A. THE DP PRODUCT DEPARTS BOTH IN MPAC AND IN
048242,001060: # A AND L. NOTE THAT DMPNSUB NORMALLY INCREASES THE MAGNITUDE OF THE
048243,001061: # CONTENTS OF MPAC. THE CUSTOMER MUST INSURE THAT B(A) X B(MPAC,MPAC+1)
048244,001062: # AND B(A) X B(MPAC) ARE LESS THAN 1 IN MAGNITUDE, WHERE B, AS IS OBVIOUS,
048245,001063: # INDICATES THE ARRIVING CONTENTS.
048246,001064:
048247,001065: 7265 54135 DMPNSUB TS DMPNTEMP
048248,001066: 7266 00006 EXTEND
048249,001067: 7267 70155 MP MPAC +1
048250,001068: 7270 52155 DXCH MPAC # LOW PRODUCT TO MPAC, HIGH FACTOR TO A
048251,001069: 7271 00006 EXTEND
048252,001070: 7272 70135 MP DMPNTEMP
048253,001071: 7273 30001 CA L
048254,001072: 7274 26154 ADS MPAC # COMPLETING THE PRODUCT IN MPAC
048255,001073: 7275 00006 EXTEND
048256,001074: 7276 30155 DCA MPAC # BRINGING THE PRODUCT INTO A AND L
048257,001075: 7277 00002 TC Q
048258,001076:
048259,001077: # MISCELLANEOUS VECTOR OPERATIONS. INCLUDED HERE ARE THE FOLLOWING:
048260,001078: # 1. DOT DP VECTOR DOT PRODUCT.
048261,001079: # 2. VXV DP VECTOR CROSS PRODUCT.
048262,001080: # 3. VXSC DP VECTOR TIMES SCALAR.
048263,001081: # 4. V/SC DP VECTOR DIVIDED BY SCALAR.
048264,001082: # 5. VPROJ DP VECTOR PROJECTION. ( (MPAC.X)MPAC ).
048265,001083: # 6. VXM DP VECTOR POST-MULTIPLIED BY MATRIX.
048266,001084: # 7. MXV DP VECTOR PRE-MULTIPLIED BY MATRIX.
048267,001085:
048268,001086: 7300 07123 DOT TC PREDOT # DO THE DOT PRODUCT AND EXIT, CHANGING
048269,001087: 7301 35035 DMODE CAF ZERO # THE MODE TO DP SCALAR.
048270,001088: 7302 16027 TCF NEWMODE
048271,001089:
048272,001090: 7303 35032 MXV CAF TWO # SET UP MATINC AND DOTINC FOR ROW
048273,001091: 7304 54140 TS MATINC # VECTORS.
048274,001092: 7305 17311 TCF VXM/MXV # GO TO COMMON PORTION.
048275,001093:
048276,001094: 7306 44377 VXM CS TEN # SET MATINC AND DOTINC TO REFER TO MATRIX
048277,001095: 7307 54140 TS MATINC # AS THREE COLUMN VECTORS.
048278,001096: 7310 36211 CAF SIX
048279,001097:
048280,001098: # COMMON PORTION OF MXV AND VXM.
048281,001099:
048282,001100: 7311 54136 VXM/MXV TS DOTINC
048283,001101:
048284,001102: # ITRACE (2) REFERS TO "VXM/MXV".
048285,001103:
048286,001104: 7312 07501 TC MPACVBUF # SAVE VECTOR IN MPAC FOR FURTHER USE.
048287,001105:
048288,001106: 7313 07125 TC DOTSUB # GO DOT TO GET X COMPONENT OF ANSWER.
048289,001107: 7314 00006 EXTEND
048290,001108: 7315 30123 DCA VBUF # MOVE MPAC VECTOR BACK INTO MPAC, SAVING
048291,001109: 7316 52155 DXCH MPAC # NEW X COMPONENT IN BUF2.
048292,001110: 7317 52134 DXCH BUF2
048293,001111: 7320 00006 EXTEND
048294,001112: 7321 30125 DCA VBUF +2
048295,001113: 7322 52160 DXCH MPAC +3
048296,001114: 7323 00006 EXTEND
048297,001115: 7324 30127 DCA VBUF +4
048298,001116: 7325 52162 DXCH MPAC +5
048299,001117: 7326 30140 CA MATINC # INITIALIZE ADDRWD FOR NEXT DOT PRODUCT.
048300,001118: 7327 26116 ADS ADDRWD # FORMS BASE ADDRESS OF NEXT COLUMN(ROW).
048301,001119:
048302,001120: 7330 07125 TC DOTSUB
048303,001121: 7331 52123 DXCH VBUF # MOVE GIVEN VECTOR BACK TO MPAC, SAVING Y
048304,001122: 7332 52155 DXCH MPAC # COMPONENT OF ANSWER IN VBUF +2.
048305,001123: 7333 52125 DXCH VBUF +2
048306,001124: 7334 52160 DXCH MPAC +3
048307,001125: 7335 52127 DXCH VBUF +4
048308,001126: 7336 52162 DXCH MPAC +5
048309,001127: 7337 30140 CA MATINC # FORM ADDRESS OF LAST COLUMN OR ROW.
048310,001128: 7340 26116 ADS ADDRWD
048311,001129:
048312,001130: 7341 07125 TC DOTSUB
048313,001131: 7342 52134 DXCH BUF2 # ANSWER NOW COMPLETE. PUT COMPONENTS INTO
048314,001132: 7343 52155 DXCH MPAC # PROPER MPAC REGISTERS.
048315,001133: 7344 52162 DXCH MPAC +5
048316,001134: 7345 52125 DXCH VBUF +2
048317,001135: 7346 52160 DXCH MPAC +3
048318,001136: 7347 16030 TCF DANZIG # EXIT.
048319,001137:
048320,001138: # VXSC - VECTOR TIMES SCALAR.
048321,001139:
048322,001140: 7350 10163 VXSC CCS MODE # TEST PRESENT MODE.
048323,001141: 7351 17377 TCF DVXSC # SEPARATE ROUTINE WHEN SCALAR IS IN MPAC.
048324,001142: 7352 17377 TCF DVXSC
048325,001143:
048326,001144: 7353 07056 VVXSC TC DMPSUB # COMPUTE X COMPONENT
048327,001145: 7354 07107 TC VROUND # AND ROUND IT.
048328,001146: 7355 52160 DXCH MPAC +3 # PUT Y COMPONENT INTO MPAC SAVING MPAC IN
048329,001147: 7356 52155 DXCH MPAC # MPAC +3.
048330,001148: 7357 52160 DXCH MPAC +3
048331,001149:
048332,001150: 7360 07056 TC DMPSUB # DO SAME FOR Y AND Z COMPONENTS.
048333,001151: 7361 07107 TC VROUND
048334,001152: 7362 52162 DXCH MPAC +5
048335,001153: 7363 52155 DXCH MPAC
048336,001154: 7364 52162 DXCH MPAC +5
048337,001155:
048338,001156: 7365 07056 TC DMPSUB
048339,001157: 7366 07107 TC VROUND
048340,001158: 7367 52155 VROTATEX DXCH MPAC # EXIT USED TO RESTORE MPAC AFTER THIS
048341,001159: 7370 52162 DXCH MPAC +5 # TYPE OF ROTATION. CALLED BY VECTOR SHIFT
048342,001160: 7371 52160 DXCH MPAC +3 # RIGHT, V/SC, ETC.
048343,001161: 7372 52155 DXCH MPAC
048344,001162: 7373 16030 TCF DANZIG
048345,001163:
048346,001164: # DP VECTOR PROJECTION ROUTINE.
048347,001165:
048348,001166: 7374 07123 VPROJ TC PREDOT # (MPAC.X)MPAC IS COMPUTED AND LEFT IN
048349,001167: 7375 45031 CS FOUR # MPAC. DO DOT AND FALL INTO DVXSC.
048350,001168: 7376 26116 ADS ADDRWD
048351,001169:
048352,001170: # VXSC WHEN SCALAR ARRIVES IN MPAC AND VECTOR IS AT X.
048353,001171:
048354,001172: 7377 00006 DVXSC EXTEND # SAVE SCALAR IN MPAC +3 AND GET X
048355,001173: 7400 30155 DCA MPAC # COMPONENT OF ANSWER.
048356,001174: 7401 52160 DXCH MPAC +3
048357,001175: 7402 07056 TC DMPSUB
048358,001176: 7403 07107 TC VROUND
048359,001177:
048360,001178: 7404 35032 CAF TWO # ADVANCE ADDRWD TO Y COMPONENT OF X.
048361,001179: 7405 26116 ADS ADDRWD
048362,001180: 7406 00006 EXTEND
048363,001181: 7407 30160 DCA MPAC +3 # PUT SCALAR BACK INTO MPAC AND SAVE
048364,001182: 7410 52155 DXCH MPAC # X RESULT IN MPAC +5.
048365,001183: 7411 52162 DXCH MPAC +5
048366,001184: 7412 07056 TC DMPSUB
048367,001185: 7413 07107 TC VROUND
048368,001186:
048369,001187: 7414 35032 CAF TWO
048370,001188: 7415 26116 ADS ADDRWD # TO Z COMPONENT.
048371,001189: 7416 52160 DXCH MPAC +3 # BRING SCALAR BACK, PUTTING Y RESULT IN
048372,001190: 7417 52155 DXCH MPAC # THE PROPER PLACE.
048373,001191: 7420 52160 DXCH MPAC +3
048374,001192: 7421 07056 TC DMPSUB
048375,001193: 7422 07107 TC VROUND
048376,001194:
048377,001195: 7423 52155 DXCH MPAC # PUT Z COMPONENT IN PROPER PLACE, ALSO
048378,001196: 7424 52162 DXCH MPAC +5 # POSITIONING X.
048379,001197: 7425 52155 DXCH MPAC
048380,001198:
048381,001199: 7426 16470 TCF VMODE # MODE HAS CHANGED TO VECTOR.
048382,001200:
048383,001201: # THE VECTOR CROSS PRODUCT ROUTINE CALCULATES (X M -X M ,X M -X M ,X M -X M ) WHERE M IS THE VECTOR IN
048384,001202: # 3 2 2 3 1 3 3 1 2 1 1 2
048385,001203: # MPAC AND X THE VECTOR AT THE GIVEN ADDRESS.
048386,001204:
048387,001205: 7427 00006 VXV EXTEND
048388,001206: 7430 30162 DCA MPAC +5 # FORM UP M3X1, LEAVING M1 IN VBUF.
048389,001207: 7431 52155 DXCH MPAC
048390,001208: 7432 52123 DXCH VBUF
048391,001209: 7433 07056 TC DMPSUB # BY X1.
048392,001210:
048393,001211: 7434 00006 EXTEND
048394,001212: 7435 40160 DCS MPAC +3 # CALCULATE -X1M2, SAVING X1M3 IN VBUF +2.
048395,001213: 7436 52155 DXCH MPAC
048396,001214: 7437 52125 DXCH VBUF +2
048397,001215: 7440 07056 TC DMPSUB
048398,001216:
048399,001217: 7441 35032 CAF TWO # ADVANCE ADDRWD TO X2.
048400,001218: 7442 26116 ADS ADDRWD
048401,001219: 7443 00006 EXTEND
048402,001220: 7444 40162 DCS MPAC +5 # PREPARE TO GET -X2M3, SAVING -X1M2 IN
048403,001221: 7445 52155 DXCH MPAC # MPAC +5.
048404,001222: 7446 52162 DXCH MPAC +5
048405,001223: 7447 07056 TC DMPSUB
048406,001224:
048407,001225: 7450 00006 EXTEND
048408,001226: 7451 30123 DCA VBUF # GET X2M1, SAVING -X2M3 IN VBUF +4.
048409,001227: 7452 52155 DXCH MPAC
048410,001228: 7453 52127 DXCH VBUF +4
048411,001229: 7454 07056 TC DMPSUB
048412,001230:
048413,001231: 7455 35032 CAF TWO # ADVANCE ADDRWD TO X3.
048414,001232: 7456 26116 ADS ADDRWD
048415,001233: 7457 00006 EXTEND
048416,001234: 7460 40123 DCS VBUF # GET -X3M1, ADDING X2M1 TO MPAC +5 TO
048417,001235: 7461 52155 DXCH MPAC # COMPLETE THE Z COMPONENT OF THE ANSWER.
048418,001236: 7462 20162 DAS MPAC +5
048419,001237:
048420,001238: 7463 00006 EXTEND
048421,001239: 7464 17466 BZF +2
048422,001240: 7465 06760 TC OVERFLWZ
048423,001241:
048424,001242: 7466 07056 TC DMPSUB
048425,001243: 7467 52125 DXCH VBUF +2 # MOVE X1M3 TO MPAC +3 SETTING UP FOR X3M2
048426,001244: 7470 52160 DXCH MPAC +3 # AND ADD -X3M1 TO MPAC +3 TO COMPLETE THE
048427,001245: 7471 52155 DXCH MPAC # Y COMPONENT OF THE RESULT.
048428,001246: 7472 20160 DAS MPAC +3
048429,001247:
048430,001248: 7473 00006 EXTEND
048431,001249: 7474 17476 BZF +2
048432,001250: 7475 06763 TC OVERFLWY
048433,001251:
048434,001252: 7476 07056 TC DMPSUB
048435,001253: 7477 52127 DXCH VBUF +4 # GO ADD -X2M3 TO X3M2 TO COMPLETE THE X
048436,001254: 7500 16747 TCF ENDVXV # COMPONENT (TAIL END OF DAD).
048437,001255:
048438,001256: # THE MPACVBUF SUBROUTINE SAVES THE VECTOR IN MPAC IN VBUF WITHOUT CLOBBERING MPAC.
048439,001257:
048440,001258: 7501 00006 MPACVBUF EXTEND # CALLED BY MXV, VXM, AND UNIT.
048441,001259: 7502 30155 DCA MPAC
048442,001260: 7503 52123 DXCH VBUF
048443,001261: 7504 00006 EXTEND
048444,001262: 7505 30160 DCA MPAC +3
048445,001263: 7506 52125 DXCH VBUF +2
048446,001264: 7507 00006 EXTEND
048447,001265: 7510 30162 DCA MPAC +5
048448,001266: 7511 52127 DXCH VBUF +4
048449,001267: 7512 00002 TC Q # RETURN TO CALLER.
048450,001268:
048451,001269: # DOUBLE PRECISION SIGN AGREE ROUTINE. ARRIVE WITH INPUT IN A+L. OUTPUT IS IN A + L.
048452,001270:
048453,001271: 7513 10000 ALSIGNAG CCS A # TEST UPPER PART.
048454,001272: 7514 17520 TCF UPPOS # IT IS POSITIVE
048455,001273: 7515 00002 TC Q # ZERO
048456,001274: 7516 17530 TCF UPNEG # NEGATIVE
048457,001275: 7517 00002 TC Q # ZERO
048458,001276:
048459,001277: 7520 56001 UPPOS XCH L # SAVE DECREMENTED UPPER PART.
048460,001278: 7521 65016 AD HALF
048461,001279: 7522 65016 AD HALF
048462,001280: 7523 54000 TS A # SKIPS ON OVERFLOW
048463,001281: 7524 17526 TCF +2
048464,001282: 7525 24001 INCR L # RESTORE UPPER TO ROIGINAL VALUE
048465,001283: 7526 56001 XCH L # SWAP A + L BACK.
048466,001284: 7527 00002 TC Q
048467,001285:
048468,001286: 7530 56001 UPNEG XCH L # SAVE COMPLEMENTED + DECREMENTED UPPER PT
048469,001287: 7531 65015 AD NEGMAX
048470,001288: 7532 67716 AD NEGONE
048471,001289: 7533 54000 TS A
048472,001290: 7534 17536 TCF +2 # DONT INCREMENT IF NO OVERFLOW.
048473,001291: 7535 24001 INCR L
048474,001292: 7536 56001 XCH L
048475,001293: 7537 40000 COM # MAKE NEGATIVE AGAIN.
048476,001294: 7540 00002 TC Q
048477,001295:
048478,001296: # INTERPRETIVE INSTRUCTIONS WHOSE EXECUTION CONSISTS OF PRINCIPALLY CALLING SUBROUTINES.
048479,001297:
048480,001298: 7541 07056 DMP1 TC DMPSUB # DMP INSTRUCTION.
048481,001299: 7542 16030 TCF DANZIG
048482,001300:
048483,001301: 7543 07056 DMPR TC DMPSUB
048484,001302: 7544 07106 TC ROUNDSUB +1 # (C(A) = +0).
048485,001303: 7545 16030 TCF DANZIG
048486,001304:
048487,001305: 7546 00006 DDV EXTEND
048488,001306: 7547 50116 INDEX ADDRWD # MOVE DIVIDEND INTO BUF.
048489,001307: 7550 30001 DCA 0
048490,001308: 7551 17556 TCF BDDV +4
048491,001309:
048492,001310: 7552 00006 BDDV EXTEND # MOVE DIVISOR INTO MPAC SAVING MPAC, THE
048493,001311: 7553 50116 INDEX ADDRWD # DIVIDEND, IN BUF.
048494,001312: 7554 30001 DCA 0
048495,001313: 7555 52155 DXCH MPAC
048496,001314: 7556 52131 +4 DXCH BUF
048497,001315: 7557 35035 CAF ZERO # DIVIDE ROUTINES IN BANK 0.
048498,001316: 7560 54004 TS FBANK
048499,001317: 7561 12353 TCF DDV/BDDV
048500,001318:
048501,001319: 7562 30116 SETPD CA ADDRWD # MUST SET TO WORK AREA, OR EBANK TROUBLE.
048502,001320: 7563 54166 TS PUSHLOC
048503,001321: 7564 16032 TCF NOIBNKSW # NO FBANK SWITCH REQUIRED.
048504,001322:
048505,001323: 7565 35035 TSLC CAF ZERO # SHIFTING ROUTINES LOCATED IN BANK 00.
048506,001324: 7566 54004 TS FBANK
048507,001325: 7567 12172 TCF TSLC2
048508,001326:
048509,001327: 7570 36043 GSHIFT CAF LOW7 # USED AS MASK AT GENSHIFT. THIS PROCESSES
048510,001328: 7571 54004 TS FBANK # ANY SHIFT INSTRUCTION (EXCEPT TSLC) WITH
048511,001329: 7572 12214 TCF GENSHIFT # AN ADDRESS (ROUTINES IN BANK 0).
048512,001330:
048513,001331: # THE FOLLOWING IS THE PROLOGUE TO V/SC. IF THE PRESENT MODE IS VECTOR, IT SAVES THE SCALAR AT X IN BUF
048514,001332: # AND CALLS THE V/SC ROUTINE IN BANK 0. IF THE PRESENT MODE IS SCALAR, IT MOVES THE VECTOR AT X INTO MPAC, SAVING
048515,001333: # THE SCALAR IN MPAC IN BUF BEFORE CALLING THE V/SC ROUTINE IN BANK 0.
048516,001334:
048517,001335: 7573 10163 V/SC CCS MODE
048518,001336: 7574 17605 TCF DV/SC # MOVE VECTOR INTO MPAC.
048519,001337: 7575 17605 TCF DV/SC
048520,001338:
048521,001339: 7576 00006 VV/SC EXTEND
048522,001340: 7577 50116 INDEX ADDRWD
048523,001341: 7600 30001 DCA 0
048524,001342: 7601 52131 V/SC1 DXCH BUF # IN BOTH CASES, VECTOR IS NOW IN MPAC AND
048525,001343: 7602 35035 CAF ZERO # SCALAR IN BUF.
048526,001344: 7603 54004 TS FBANK
048527,001345: 7604 12654 TCF V/SC2
048528,001346:
048529,001347: 7605 00006 DV/SC EXTEND
048530,001348: 7606 50116 INDEX ADDRWD
048531,001349: 7607 30003 DCA 2
048532,001350: 7610 52160 DXCH MPAC +3
048533,001351: 7611 00006 EXTEND
048534,001352: 7612 50116 INDEX ADDRWD
048535,001353: 7613 30005 DCA 4
048536,001354: 7614 52162 DXCH MPAC +5
048537,001355:
048538,001356: 7615 45033 CS ONE # CHANGE MODE TO VECTOR.
048539,001357: 7616 54163 TS MODE
048540,001358:
048541,001359: 7617 00006 EXTEND
048542,001360: 7620 50116 INDEX ADDRWD
048543,001361: 7621 30001 DCA 0
048544,001362: 7622 52155 DXCH MPAC
048545,001363: 7623 17601 TCF V/SC1 # FINISH PROLOGUE AT COMMON SECTION.
048546,001364:
048547,001365: # SIGN AND COMPLEMENT INSTRUCTIONS.
048548,001366:
048549,001367: 7624 50116 SIGN INDEX ADDRWD # CALL COMP INSTRUCTION IF WORD AT X IS
048550,001368: 7625 10000 CCS 0 # NEGATIVE NON-ZERO.
048551,001369: 7626 16030 TCF DANZIG
048552,001370: 7627 17631 TCF +2
048553,001371: 7630 17637 TCF COMP # DO THE COMPLEMENT.
048554,001372:
048555,001373: 7631 50116 INDEX ADDRWD
048556,001374: 7632 10001 CCSL CCS 1
048557,001375: 7633 16030 TCF DANZIG
048558,001376: 7634 16030 TCF DANZIG
048559,001377: 7635 17637 TCF COMP
048560,001378: 7636 16030 TCF DANZIG
048561,001379: 7637 00006 COMP EXTEND # COMPLEMENT DP MPAC IN EVERY CASE.
048562,001380: 7640 40155 DCS MPAC
048563,001381: 7641 52155 DXCH MPAC
048564,001382:
048565,001383: 7642 10163 CCS MODE # EITHER COMPLEMENT MPAC +3 OR THE REST OF
048566,001384: 7643 17654 TCF DCOMP # THE VECTOR ACCUMULATOR.
048567,001385: 7644 17654 TCF DCOMP
048568,001386:
048569,001387: 7645 00006 EXTEND # VECTOR COMPLEMENT.
048570,001388: 7646 40160 DCS MPAC +3
048571,001389: 7647 52160 DXCH MPAC +3
048572,001390: 7650 00006 EXTEND
048573,001391: 7651 40162 DCS MPAC +5
048574,001392: 7652 52162 DXCH MPAC +5
048575,001393: 7653 16030 TCF DANZIG
048576,001394:
048577,001395: 7654 40156 DCOMP CS MPAC +2
048578,001396: 7655 54156 TS MPAC +2
048579,001397: 7656 16030 TCF DANZIG
048580,001398:
048581,001399: # THE FOLLOWING SHORT SHIFT CODES REQUIRE NO ADDRESS WORD:
048582,001400: # 1. SR1 TO SR4 SCALAR SHIFT RIGHT.
048583,001401: # 2. SR1R TO SR4R SCALAR SHIFT RIGHT AND ROUND.
048584,001402: # 3. SL1 TO SL4 SCALAR SHIFT LEFT.
048585,001403: # 4. SL1R TO SL4R SCALAR SHIFT LEFT AND ROUND.
048586,001404: # 5. VSR1 TO VSR8 VECTOR SHIFT RIGHT (ALWAYS ROUNDS).
048587,001405: # 6. VSL1 TO VSL8 VECTOR SHIFT LEFT (NEVER ROUNDS).
048588,001406: # THE FOLLOWING CODES REQUIRE AN ADDRESS WHICH MAY BE INDEXED:*
048589,001407: # 1. SR SCALAR SHIFT RIGHT.
048590,001408: # 2. SRR SCALAR SHIFT RIGHT AND ROUND.
048591,001409: # 3. SL SCALAR SHIFT LEFT.
048592,001410: # 4. SLR SCALAR SHIFT LEFT AND ROUND.
048593,001411: # 5. VSR VECTOR SHIFT RIGHT.
048594,001412: # 6. VSL VECTOR SHIFT LEFT.
048595,001413: # * IF THE ADDRESS IS INDEXED, AND THE INDEX MODIFICATION RESULTS IN A NEGATIVE SHIFT COUNT, A SHIFT OF THE
048596,001414: # ABSOLUTE VALUE OF THE COUNT IS DONE IN THE OPPOSITE DIRECTION.
048597,001415:
048598,001416: 00,2017 BANK 00
048599,001417:
048600,001418: 00,2017 COUNT 00/INTER
048601,001419:
048602,001420: 00,2017 36211 SHORTT CAF SIX # SCALAR SHORT SHIFTS COME HERE. THE SHIFT
048603,001421: 00,2020 70020 MASK CYR # COUNT-1 IS NOW IN BITS 2-3 OF CYR. THE
048604,001422: 00,2021 54021 TS SR # ROUNDING BIT IS IN BIT1 AT THIS POINT.
048605,001423:
048606,001424: 00,2022 10020 CCS CYR # SEE IF RIGHT OR LEFT SHIFT DESIRED.
048607,001425: 00,2023 12101 TCF TSSL # SHIFT LEFT.
048608,001426:
048609,001427: 00,2024 00024 SRDDV DEC 20 B-14 # MPTEMP SETTING FOR SR BEFORE DDV.
048610,001428:
048611,001429: 00,2025 50021 TSSR INDEX SR # GET SHIFTING BIT.
048612,001430: 00,2026 35016 CAF BIT14
048613,001431: 00,2027 54135 TS MPTEMP
048614,001432:
048615,001433: 00,2030 10020 CCS CYR # SEE IF A ROUND IS DESIRED.
048616,001434: 00,2031 02050 RIGHTR TC MPACSRND # YES - SHIFT RIGHT AND ROUND.
048617,001435: 00,2032 16027 TCF NEWMODE # SET MODE TO DP (C(A) = 0).
048618,001436: 00,2033 30135 MPACSHR CA MPTEMP # DO A TRIPLE PRECISION SHIFT RIGHT.
048619,001437: 00,2034 00006 EXTEND
048620,001438: 00,2035 70156 MP MPAC +2
048621,001439: 00,2036 54156 +3 TS MPAC +2 # (EXIT FROM SQRT AND ABVAL).
048622,001440: 00,2037 30135 CA MPTEMP
048623,001441: 00,2040 00006 EXTEND
048624,001442: 00,2041 70154 MP MPAC # SHIFT MAJOR PART INTO A,L AND PLACE IN
048625,001443: 00,2042 52155 DXCH MPAC # MPAC,+1.
048626,001444: 00,2043 30135 CA MPTEMP
048627,001445: 00,2044 00006 EXTEND
048628,001446: 00,2045 70001 MP L # ORIGINAL C(MPAC +1).
048629,001447: 00,2046 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
048630,001448: 00,2047 16030 TCF DANZIG
048631,001449:
048632,001450: # MPAC SHIFT RIGHT AND ROUND SUBROUTINES.
048633,001451:
048634,001452: 00,2050 30156 MPACSRND CA MPAC +2 # WE HAVE TO DO ALL THREE MULTIPLIES SINCE
048635,001453: 00,2051 00006 EXTEND # MPAC +1 AND MPAC +2 MIGHT HAVE SIGN
048636,001454: 00,2052 70135 MP MPTEMP # DISAGREEMENT WITH A SHIFT RIGHT OF 1.
048637,001455: 00,2053 56155 XCH MPAC +1
048638,001456: 00,2054 00006 EXTEND
048639,001457: 00,2055 70135 MP MPTEMP
048640,001458: 00,2056 56155 XCH MPAC +1 # TRIAL MINOR PART.
048641,001459: 00,2057 60001 AD L
048642,001460:
048643,001461: 00,2060 60000 VSHR2 DOUBLE # (FINISH VECTOR COMPONENT SHIFT RIGHT
048644,001462: 00,2061 54156 TS MPAC +2 # AND ROUND.
048645,001463: 00,2062 12064 TCF +2
048646,001464: 00,2063 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
048647,001465:
048648,001466: 00,2064 35035 CAF ZERO
048649,001467: 00,2065 54156 TS MPAC +2
048650,001468: 00,2066 56154 XCH MPAC # SETTING TO ZERO SO FOLLOWING DAS WORKS.
048651,001469: 00,2067 00006 EXTEND
048652,001470: 00,2070 70135 MP MPTEMP
048653,001471: 00,2071 20155 DAS MPAC # AGAIN NO OVERFLOW.
048654,001472: 00,2072 00002 TC Q
048655,001473:
048656,001474: 00,2073 30135 VSHRRND CA MPTEMP # ENTRY TO SHIFT RIGHT AND ROUND MPAC WHEN
048657,001475: 00,2074 00006 EXTEND # MPAC CONTAINS A VECTOR COMPONENT.
048658,001476: 00,2075 70155 MP MPAC +1
048659,001477: 00,2076 54155 TS MPAC +1
048660,001478: 00,2077 56001 XCH L
048661,001479: 00,2100 12060 TCF VSHR2 # GO ADD ONE IF NECESSARY AND FINISH.
048662,001480:
048663,001481: # ROUTINE FOR SHORT SCALAR SHIFT LEFT (AND MAYBE ROUND).
048664,001482:
048665,001483: 00,2101 30021 TSSL CA SR # GET SHIFT COUNT FOR SR.
048666,001484: 00,2102 54135 +1 TS MPTEMP
048667,001485:
048668,001486: 00,2103 00006 +2 EXTEND # ENTRY HERE FROM SL FOR SCALARS.
048669,001487: 00,2104 30156 DCA MPAC +1 # SHIFTING LEFT ONE PLACE AT A TIME IS
048670,001488: 00,2105 20156 DAS MPAC +1 # FASTER THAN DOING THE WHOLE SHIFT WITH
048671,001489: 00,2106 60154 AD MPAC # MULTIPLIES ASSUMING THAT FREQUENCY OF
048672,001490: 00,2107 60154 AD MPAC # SHIFT COUNTS GOES DOWN RAPIDLY AS A
048673,001491: 00,2110 54154 TS MPAC # FUNCTION OF THEIR MAGNITUDE.
048674,001492: 00,2111 12113 TCF +2
048675,001493: 00,2112 54121 TS OVFIND # OVERFLOW. (LEAVES OVERFLOW-CORRECTED
048676,001494: # RESULT ANYWAY).
048677,001495: 00,2113 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNT.
048678,001496: 00,2114 12102 TCF TSSL +1
048679,001497:
048680,001498: 00,2115 10020 CCS CYR # SEE IF ROUND WANTED.
048681,001499: 00,2116 07105 ROUND TC ROUNDSUB # YES - ROUND AND EXIT.
048682,001500: 00,2117 16030 TCF DANZIG # SL LEAVES A ZERO IN CYR FOR NO ROUND.
048683,001501: 00,2120 16030 TCF DANZIG # NO - EXIT IMMEDIATL
048684,001502:
048685,001503: # VECTOR SHIFTING ROUTINES.
048686,001504:
048687,001505: 00,2121 35037 SHORTV CAF LOW3 # SAVE 3 BIT SHIFT COUNT - 1 WITHOUT
048688,001506: 00,2122 70020 MASK CYR # EDITING CYR.
048689,001507: 00,2123 54135 TS MPTEMP
048690,001508: 00,2124 10020 CCS CYR # SEE IF LEFT OR RIGHT SHIFT.
048691,001509: 00,2125 12145 TCF VSSL # VECTOR SHIFT LEFT.
048692,001510: 00,2126 00176 OCT176 OCT 176 # USED IN PROCESSED SHIFTS WITH - COUNT.
048693,001511:
048694,001512: 00,2127 50135 VSSR INDEX MPTEMP # (ENTRY FROM SR). PICK UP SHIFTING BIT.
048695,001513: 00,2130 35016 CAF BIT14 # MPTEMP CONTAINS THE SHIFT COUNT - 1.
048696,001514: 00,2131 54135 TS MPTEMP
048697,001515: 00,2132 02073 TC VSHRRND # SHIFT X COMPONENT.
048698,001516:
048699,001517: 00,2133 52155 DXCH MPAC # SWAP X AND Y COMPONENTS.
048700,001518: 00,2134 52160 DXCH MPAC +3
048701,001519: 00,2135 52155 DXCH MPAC
048702,001520: 00,2136 02073 TC VSHRRND # SHIFT Y COMPONENT.
048703,001521:
048704,001522: 00,2137 52155 DXCH MPAC # SWAP Y AND Z COMPONENTS.
048705,001523: 00,2140 52162 DXCH MPAC +5
048706,001524: 00,2141 52155 DXCH MPAC
048707,001525: 00,2142 02073 TC VSHRRND # SHIFT Z COMPONENT.
048708,001526:
048709,001527: 00,2143 17367 TCF VROTATEX # RESTORE COMPONENTS TO PROPER PLACES.
048710,001528:
048711,001529: # VECTOR SHIFT LEFT - DONE ONE PLACE AT A TIME.
048712,001530:
048713,001531: 00,2144 54135 -1 TS MPTEMP # SHIFTING LOOP.
048714,001532:
048715,001533: 00,2145 00006 VSSL EXTEND
048716,001534: 00,2146 30155 DCA MPAC
048717,001535: 00,2147 20155 DAS MPAC
048718,001536: 00,2150 00006 EXTEND
048719,001537: 00,2151 12153 BZF +2
048720,001538: 00,2152 06766 TC OVERFLOW
048721,001539:
048722,001540: 00,2153 00006 EXTEND
048723,001541: 00,2154 30160 DCA MPAC +3
048724,001542: 00,2155 20160 DAS MPAC +3
048725,001543: 00,2156 00006 EXTEND
048726,001544: 00,2157 12161 BZF +2
048727,001545: 00,2160 06763 TC OVERFLWY
048728,001546:
048729,001547: 00,2161 00006 EXTEND
048730,001548: 00,2162 30162 DCA MPAC +5
048731,001549: 00,2163 20162 DAS MPAC +5
048732,001550: 00,2164 00006 EXTEND
048733,001551: 00,2165 12167 BZF +2
048734,001552: 00,2166 06760 TC OVERFLWZ
048735,001553:
048736,001554: 00,2167 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNTER.
048737,001555: 00,2170 12144 TCF VSSL -1
048738,001556: 00,2171 16030 TCF DANZIG # EXIT.
048739,001557:
048740,001558: # TSLC - TRIPLE SHIFT LEFT AND COUNT. SHIFTS MPAC LEFT UNTIL GREATER THAN .5 IN MAGNITUDE, LEAVING
048741,001559: # THE COMPLEMENT OF THE NUMBER OF SHIFTS REQUIRED IN X.
048742,001560:
048743,001561: 00,2172 54135 TSLC2 TS MPTEMP # START BY ZEROING SHIFT COUNT (IN A NOW).
048744,001562: 00,2173 06672 TC BRANCH # EXIT WITH NO SHIFTING IF ARGUMENT ZERO.
048745,001563: 00,2174 12176 TCF +2
048746,001564: 00,2175 12212 TCF ENDTSLC # STORES ZERO SHIFT COUNT IN THIS CASE.
048747,001565:
048748,001566: 00,2176 07226 TC TPAGREE # MAY CAUSE UPSHIFT OF ONE EXTRA PLACE.
048749,001567:
048750,001568: 00,2177 30154 CA MPAC # BEGIN NORMALIZATION LOOP.
048751,001569: 00,2200 12207 TCF TSLCTEST
048752,001570:
048753,001571: 00,2201 24135 TSLCLOOP INCR MPTEMP # INCREMENT SHIFT COUNTER.
048754,001572: 00,2202 00006 EXTEND
048755,001573: 00,2203 30156 DCA MPAC +1
048756,001574: 00,2204 20156 DAS MPAC +1
048757,001575: 00,2205 60154 AD MPAC
048758,001576: 00,2206 26154 ADS MPAC
048759,001577: 00,2207 60000 TSLCTEST DOUBLE # SEE IF (ANOTHER) SHIFT IS REQUIRED.
048760,001578: 00,2210 54000 OVSK
048761,001579: 00,2211 12201 TCF TSLCLOOP # YES - INCREMENT COUNT AND SHIFT AGAIN.
048762,001580:
048763,001581: 00,2212 40135 ENDTSLC CS MPTEMP
048764,001582: 00,2213 16572 TCF STORE1 # STORE SHIFT COUNT AND RETURN TO DANZIG.
048765,001583:
048766,001584: # THE FOLLOWING ROUTINES PROCESSES THE GENERAL SHIFT INSTRUCTIONS SR, SRR, SL, AND SLR.
048767,001585: # THE GIVEN ADDRESS IS DECODED AS FOLLOWS:
048768,001586: # BITS 1-7 SHIFT COUNT (SUBADDRESS) LESS THAN 125 DECIMAL.
048769,001587: # BIT 8 PSEUDO SIGN BIT (DETECTS CHANGE IN SIGN IN INDEXED SHIFTS).
048770,001588: # BIT 9 0 FOR LEFT SHIFT, AND 1 FOR RIGHT SHIFT.
048771,001589: # BIT 10 1 FOR TERMINAL ROUND ON SCALAR SHIFTS, 0 OTHERWISE.
048772,001590: # BITS 11-13 0.
048773,001591: # BIT 14 1.
048774,001592: # BIT 15 0.
048775,001593: # THE ABOVE ENCODING IS DONE BY THE YUL SYSTEM.
048776,001594:
048777,001595: 00,2214 70116 GENSHIFT MASK ADDRWD # GET SHIFT COUNT, TESTING FOR ZERO.
048778,001596: 00,2215 10000 CCS A # (ARRIVES WITH C(A) = LOW7).
048779,001597: 00,2216 12224 TCF GENSHFT2 # IF NON-ZERO, PROCEED WITH DECREMENTED CT
048780,001598:
048781,001599: 00,2217 35022 CAF BIT10 # ZERO SHIFT COUNT. NO SHIFTS NEEDED BUT
048782,001600: 00,2220 70116 MASK ADDRWD # WE MIGHT HAVE TO ROUND MPAC ON SLR AND
048783,001601: 00,2221 10000 CCS A # SRR (SCALAR ONLY).
048784,001602: 00,2222 07105 TC ROUNDSUB
048785,001603: 00,2223 16030 TCF DANZIG
048786,001604:
048787,001605: 00,2224 54135 GENSHFT2 TS MPTEMP # DECREMENTED SHIFT COUNT TO MPTEMP.
048788,001606: 00,2225 35024 CAF BIT8 # TEST MEANING OF LOW SEVEN BIT COUNT IN
048789,001607: 00,2226 00006 EXTEND # MPTEMP NOW.
048790,001608: 00,2227 70116 MP ADDRWD
048791,001609: 00,2230 76214 MASK LOW2 # JUMPS ON SHIFT DIRECTION (BIT8) AND
048792,001610: 00,2231 50000 INDEX A
048793,001611: 00,2232 12233 TCF +1 # ORIGINAL SHIFT DIRECTION (BIT 9).
048794,001612: 00,2233 12332 TCF RIGHT- # NEGATIVE SHIFT COUNT FOR SL OR SLR.
048795,001613: 00,2234 12342 TCF LEFT # SL OR SLR.
048796,001614: 00,2235 12336 TCF LEFT- # NEGATIVE SHIFT COUNT WITH SR OR SRR.
048797,001615:
048798,001616: # GENERAL SHIFT RIGHT.
048799,001617:
048800,001618: 00,2236 10163 RIGHT CCS MODE # SEE IF VECTOR OR SCALAR.
048801,001619: 00,2237 12277 TCF GENSCR
048802,001620: 00,2240 12277 TCF GENSCR
048803,001621:
048804,001622: 00,2241 30135 CA MPTEMP # SEE IF SHIFT COUNT LESS THAN 14D.
048805,001623: 00,2242 63730 VRIGHT2 AD NEG12
048806,001624: 00,2243 00006 EXTEND
048807,001625: 00,2244 62127 BZMF VSSR # IF SO, BRANCH AND SHIFT IMMEDIATELY.
048808,001626:
048809,001627: 00,2245 67716 AD NEGONE # IF NOT, REDUCE MPTEMP BY A TOTAL OF 14,
048810,001628: 00,2246 54135 TS MPTEMP # AND DO A SHIFT RIGHT AND ROUND BY 14.
048811,001629: 00,2247 35035 CAF ZERO # THE ROUND AT THIS STAGE MAY INTRODUCE A
048812,001630: 00,2250 54001 TS L # ONE BIT ERROR IN A SHIFT RIGHT 15D.
048813,001631: 00,2251 56154 XCH MPAC
048814,001632: 00,2252 56155 XCH MPAC +1
048815,001633: 00,2253 02272 TC SETROUND # X COMPONENT NOW SHIFTED, SO MAKE UP THE
048816,001634: 00,2254 20155 DAS MPAC # ROUNDING QUANTITY (0 IN A AND 0 OR +-1
048817,001635: # IN L).
048818,001636: 00,2255 56157 XCH MPAC +3 # REPEAT THE ABOVE PROCESS FOR Y AND Z.
048819,001637: 00,2256 56160 XCH MPAC +4
048820,001638: 00,2257 02272 TC SETROUND
048821,001639: 00,2260 20160 DAS MPAC +3 # NO OVERFLOW ON THESE ADDS.
048822,001640:
048823,001641: 00,2261 56161 XCH MPAC +5
048824,001642: 00,2262 56162 XCH MPAC +6
048825,001643: 00,2263 02272 TC SETROUND
048826,001644: 00,2264 20162 DAS MPAC +5
048827,001645:
048828,001646: 00,2265 10135 CCS MPTEMP # SEE IF DONE, DOING FINAL DECREMENT.
048829,001647: 00,2266 54135 TS MPTEMP
048830,001648: 00,2267 12242 TCF VRIGHT2
048831,001649: 00,2270 04604 BIASLO DEC .2974 B-1 # SQRT CONSTANT
048832,001650:
048833,001651: 00,2271 16030 TCF DANZIG
048834,001652:
048835,001653: 00,2272 60000 SETROUND DOUBLE # MAKES UP ROUNDING QUANTITY FROM ARRIVING
048836,001654: 00,2273 54156 TS MPAC +2 # C(A). L IS ZERO INITIALLY.
048837,001655: 00,2274 35035 CAF ZERO
048838,001656: 00,2275 56001 XCH L
048839,001657: 00,2276 00002 TC Q # RETURN AND DO THE DAS, RESETTING L TO 0.
048840,001658:
048841,001659: # PROCESS SR AND SRR FOR SCALARS.
048842,001660:
048843,001661: 00,2277 30135 GENSCR CA MPTEMP # SEE IF THE ORIGINAL SHIFT COUNT WAS LESS
048844,001662: 00,2300 63730 +1 AD NEG12 # THAN 14D.
048845,001663: 00,2301 00006 EXTEND
048846,001664: 00,2302 62322 BZMF DOSSHFT # DO THE SHIFT IMMEDIATELY IF SO.
048847,001665:
048848,001666: 00,2303 67716 +4 AD NEGONE # IF NOT, DECREMENT SHIFT COUNT BY 14D AND
048849,001667: 00,2304 54135 TS MPTEMP # SHIFT MPAC RIGHT 14 PLACES.
048850,001668: 00,2305 35035 CAF ZERO
048851,001669: 00,2306 56154 XCH MPAC
048852,001670: 00,2307 56155 XCH MPAC +1
048853,001671: 00,2310 54156 TS MPAC +2
048854,001672: 00,2311 10135 CCS MPTEMP # SEE IF FINISHED, DO FINAL DECREMENT.
048855,001673: 00,2312 54135 TS MPTEMP
048856,001674: 00,2313 02300 TC GENSCR +1
048857,001675: 00,2314 22650 SLOPEHI DEC .5884 # SQRT CONSTANT.
048858,001676: 00,2315 35022 CAF BIT10 # FINISHED WITH SHIFT. SEE IF ROUND
048859,001677: 00,2316 70116 MASK ADDRWD # WANTED.
048860,001678: 00,2317 10000 CCS A
048861,001679: 00,2320 07105 TC ROUNDSUB
048862,001680: 00,2321 16030 TCF DANZIG # DO SO AND/OR EXIT.
048863,001681:
048864,001682: 00,2322 50135 DOSSHFT INDEX MPTEMP # PICK UP SHIFTING BIT.
048865,001683: 00,2323 35016 CAF BIT14
048866,001684: 00,2324 54135 TS MPTEMP
048867,001685: 00,2325 35022 CAF BIT10 # SEE IF TERMINAL ROUND DESIRED.
048868,001686: 00,2326 70116 MASK ADDRWD
048869,001687: 00,2327 10000 CCS A
048870,001688: 00,2330 12031 TCF RIGHTR # YES.
048871,001689: 00,2331 12033 TCF MPACSHR # JUST SHIFT RIGHT.
048872,001690:
048873,001691: # PROCESS THE RIGHT- (SL(R) WITH A NEGATIVE COUNT), LEFT-, AND LEFT OPTIONS.
048874,001692:
048875,001693: 00,2332 40135 RIGHT- CS MPTEMP # GET ABSOLUTE VALUE - 1 OF SHIFT COUNT
048876,001694: 00,2333 62126 AD OCT176 # UNDERSTANDING THAT BIT8 (PSEUDO-SIGN)
048877,001695: 00,2334 54135 TS MPTEMP # WAS 1 INITIALLY.
048878,001696: 00,2335 12236 TCF RIGHT # DO NORMAL SHIFT RIGHT.
048879,001697:
048880,001698: 00,2336 42126 LEFT- CS OCT176 # SAME PROLOGUE TO LEFT FOR INDEXED RIGHT
048881,001699: 00,2337 60135 AD MPTEMP # SHIFTS WHOSE NET SHIFT COUNT IS NEGATIVE
048882,001700: 00,2340 40000 COM
048883,001701: 00,2341 54135 TS MPTEMP
048884,001702:
048885,001703: 00,2342 10163 LEFT CCS MODE # SINCE LEFT SHIFTING IS SONE ONE PLACE AT
048886,001704: 00,2343 12346 TCF GENSCL # A TIME, NO COMPARISON WITH 14 NEED BE
048887,001705: 00,2344 12346 TCF GENSCL # DONE. FOR SCALARS, SEE IF TERMINAL ROUND
048888,001706: 00,2345 12145 TCF VSSL # DESIRED. FOR VECTORS, SHIFT IMMEDIATELY.
048889,001707:
048890,001708: 00,2346 40116 GENSCL CS ADDRWD # PUT ROUNDING BIT (BIT 10 OF ADDRWD) INTO
048891,001709: 00,2347 00006 EXTEND # BIT 15 OF CYR WHERE THE ROUNDING BIT OF
048892,001710: 00,2350 75026 MP BIT6 # A SHORT SHIFT LEFT WOULD BE
048893,001711: 00,2351 54020 TS CYR
048894,001712: 00,2352 12103 TCF TSSL +2 # DO THE SHIFT.
048895,001713:
048896,001714: # SCALAR DIVISION INSTRUCTIONS, DDV AND BDDV, ARE EXECUTED HERE. AT THIS POINT, THE DIVIDEND IS IN MPAC
048897,001715: # AND THE DIVISOR IN BUF.
048898,001716:
048899,001717: 00,2353 45033 DDV/BDDV CS ONE # INITIALIZATION.
048900,001718: 00,2354 54136 TS DVSIGN # +-1 FOR POSITIVE QUOTIENT - -0 FOR NEG.
048901,001719: 00,2355 54137 TS DVNORMCT # DIVIDEND NORMALIZATION COUNT.
048902,001720: 00,2356 54140 TS MAXDVSW # NEAR-ONE DIVIDE FLAG.
048903,001721:
048904,001722: 00,2357 10130 CCS BUF # FORCE BUF POSITIVE WITH THE MAJOR PART
048905,001723: 00,2360 12516 TCF BUFPOS # NON-ZERO.
048906,001724: 00,2361 12363 TCF +2
048907,001725: 00,2362 12531 TCF BUFNEG
048908,001726:
048909,001727: 00,2363 54156 BUFZERO TS MPAC +2 # ZERO THIS.
048910,001728: 00,2364 07226 TC TPAGREE # FORCE SIGN AGREEMENT BEFORE OVERFLOW
048911,001729:
048912,001730: 00,2365 10154 CCS MPAC # TEST TO SEE IF MPAC NON-ZERO. (TOO BIG)
048913,001731: 00,2366 12414 TCF OVF+ # MAJOR PART OF DIVIDEND IS POSITIVE NON-0
048914,001732: 00,2367 12371 TCF +2
048915,001733: 00,2370 12413 TCF OVF+ -1 # MAJOR PART OF DIVIDEND IS NEG. NON-ZERO
048916,001734:
048917,001735: 00,2371 56131 XCH BUF +1 # SHIFT DIVIDEND AND DIVISOR LEFT 14.
048918,001736: 00,2372 56130 XCH BUF
048919,001737: 00,2373 56155 XCH MPAC +1
048920,001738: 00,2374 56154 XCH MPAC
048921,001739: 00,2375 10130 CCS BUF # TRY AGAIN ON FORMER MINOR PART.
048922,001740: 00,2376 12422 TCF BUF+
048923,001741: 00,2377 12401 TCF +2 # OVERFLOW ON ZERO DIVISOR.
048924,001742: 00,2400 12416 TCF BUF-
048925,001743:
048926,001744: 00,2401 40154 CS MPAC # SIGN OF MPAC DETERMINES SIGN OF RESULT.
048927,001745: 00,2402 00006 SGNDVOVF EXTEND
048928,001746: 00,2403 62405 BZMF +2
048929,001747: 00,2404 24136 INCR DVSIGN # NEGMAX IN MPAC PERHAPS.
048930,001748: 00,2405 35013 DVOVF CAF POSMAX # ON DIVISION OVERFLOW OF ANY SORT, SET
048931,001749: 00,2406 54154 TS MPAC # SET DP MPAC TO +-POSMAX.
048932,001750: 00,2407 02630 TC FINALDV +3
048933,001751: 00,2410 35033 CAF ONE # SET OVERFLOW INDICATOR AND EXIT.
048934,001752: 00,2411 54121 TS OVFIND
048935,001753: 00,2412 06030 TC DANZIG
048936,001754:
048937,001755: 00,2413 24136 -1 INCR DVSIGN
048938,001756: 00,2414 40131 OVF+ CS BUF +1 # LOAD LOWER ORDER PART OF DIVISOR.
048939,001757: 00,2415 12402 TCF SGNDVOVF # GET SIGN OF RESULT.
048940,001758:
048941,001759: 00,2416 00006 BUF- EXTEND # IF BUF IS NEGATIVE, COMPLEMENT IT AND
048942,001760: 00,2417 40131 DCS BUF # MAINTAIN DVSIGN FOR FINAL QUOTIENT SIGN.
048943,001761: 00,2420 52131 DXCH BUF
048944,001762: 00,2421 24136 INCR DVSIGN # NOW -0.
048945,001763:
048946,001764: 00,2422 10154 BUF+ CCS MPAC # FORCE MPAC POSITIVE, CHECKING FOR ZERO
048947,001765: 00,2423 12437 TCF MPAC+ # DIVIDEND IN THE PROCESS.
048948,001766: 00,2424 12426 TCF +2
048949,001767: 00,2425 12433 TCF MPAC-
048950,001768: 00,2426 10155 CCS MPAC +1
048951,001769: 00,2427 12437 TCF MPAC+
048952,001770: 00,2430 16030 TCF DANZIG # EXIT IMMEDIATELY ON ZERO DIVIDEND.
048953,001771: 00,2431 12433 TCF MPAC-
048954,001772: 00,2432 16030 TCF DANZIG
048955,001773:
048956,001774: 00,2433 00006 MPAC- EXTEND # FORCE MPAC POSITIVE AS BUF IN BUF-.
048957,001775: 00,2434 40155 DCS MPAC
048958,001776: 00,2435 52155 DXCH MPAC
048959,001777: 00,2436 24136 INCR DVSIGN # NOW +1 OR -0.
048960,001778:
048961,001779: 00,2437 40154 MPAC+ CS MPAC # CHECK FOR DIVISION OVERFLOW. IF THE
048962,001780: 00,2440 67716 AD NEGONE # MAJOR PART OF THE DIVIDEND IS LESS THAN
048963,001781: 00,2441 60130 AD BUF # THE MAJOR PART OF THE DIVISOR BY AT
048964,001782: 00,2442 10000 CCS A # LEAST TWO, WE CAN PROCEED IMMEDIATELY
048965,001783: 00,2443 12505 TCF DVNORM # WITHOUT NORMALIZATION PRODUCING A DVMAX.
048966,001784: 00,2444 60001 -1/2+2 OCT 60001 # USED IN SQRTSUB.
048967,001785:
048968,001786: 00,2445 12446 TCF +1 # IF THE ABOVE DOES NOT HOLD, FORCE SIGN
048969,001787: 00,2446 35016 CAF HALF # AGREEMENT IN NUMERATOR AND DENOMINATOR
048970,001788: 00,2447 60000 DOUBLE # TO FACILITATE OVERFLOW AND NEAR-ONE
048971,001789: 00,2450 60155 AD MPAC +1 # CHECKING.
048972,001790: 00,2451 54155 TS MPAC +1
048973,001791: 00,2452 35035 CAF ZERO
048974,001792: 00,2453 65013 AD POSMAX
048975,001793: 00,2454 26154 ADS MPAC
048976,001794:
048977,001795: 00,2455 35016 CAF HALF # SAME FOR BUF.
048978,001796: 00,2456 60000 DOUBLE
048979,001797: 00,2457 60131 AD BUF +1
048980,001798: 00,2460 54131 TS BUF +1
048981,001799: 00,2461 35035 CAF ZERO
048982,001800: 00,2462 65013 AD POSMAX
048983,001801: 00,2463 26130 ADS BUF
048984,001802:
048985,001803: 00,2464 40154 CS MPAC # CHECK MAGNITUDE OF SIGN-CORRECTED
048986,001804: 00,2465 60130 AD BUF # OPERANDS.
048987,001805: 00,2466 10000 CCS A
048988,001806: 00,2467 12505 TCF DVNORM # DIVIDE OK - WILL NOT BECOME MAXDV CASE.
048989,001807: 00,2470 00133 LBUF2 ADRES BUF2
048990,001808: 00,2471 12405 TCF DVOVF # DIVISOR NOT LESS THAN DIVIDEND - OVF.
048991,001809:
048992,001810: 00,2472 54140 TS MAXDVSW # IF THE MAJOR PARTS OF THE DIVIDEND AND
048993,001811: 00,2473 40155 CS MPAC +1 # DIVISOR ARE EQUAL, A SPECIAL APPROXIMA-
048994,001812: 00,2474 60131 AD BUF +1 # TION IS USED (PROVIDED THE DIVISION IS
048995,001813: 00,2475 00006 EXTEND # POSSIBLE, OF COURSE).
048996,001814: 00,2476 62405 BZMF DVOVF
048997,001815: 00,2477 12505 TCF DVNORM # IF NO OVERFLOW.
048998,001816:
048999,001817: 00,2500 00006 BUFNORM EXTEND # ADD -1 TO AUGMENT SHIFT COUNT AND SHIFT
049000,001818: 00,2501 24137 AUG DVNORMCT # LEFT ONE PLACE.
049001,001819: 00,2502 00006 EXTEND
049002,001820: 00,2503 30131 DCA BUF
049003,001821: 00,2504 20131 DAS BUF
049004,001822:
049005,001823: 00,2505 30130 DVNORM CA BUF # SEE IF DIVISOR NORMALIZED YET.
049006,001824: 00,2506 60000 DOUBLE
049007,001825: 00,2507 54000 OVSK
049008,001826: 00,2510 12500 TCF BUFNORM # NO - SHIFT LEFT ONE AND TRY AGAIN.
049009,001827:
049010,001828: 00,2511 52155 DXCH MPAC # CALL DIVIDEND NORMALIZATION SEQUENCE
049011,001829: 00,2512 50137 INDEX DVNORMCT # PRIOR TO DOING THE DIVIDE.
049012,001830: 00,2513 02565 TC MAXTEST
049013,001831:
049014,001832: 00,2514 54156 TS MPAC +2 # RETURNS WITH DIVISION DONE AND C(A) = 0.
049015,001833: 00,2515 16030 TCF DANZIG
049016,001834:
049017,001835: 00,2516 10000 BUFPOS CCS A
049018,001836: 00,2517 12422 TCF BUF+ # TO BUF+ IF BUF IS GREATER THAN +1.
049019,001837:
049020,001838: 00,2520 40131 CS BUF +1 # IF BUF IS +1, FORCING SIGN AGREEMENT
049021,001839: 00,2521 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
049022,001840: 00,2522 62422 BZMF BUF+ # BRANCH IF SIGNS AGREE.
049023,001841:
049024,001842: 00,2523 35016 CA HALF # SIGNS DISAGREE. FORCE AGREEMENT.
049025,001843: 00,2524 60000 +6 DOUBLE
049026,001844: 00,2525 26131 ADS BUF +1
049027,001845: 00,2526 35035 CA ZERO
049028,001846: 00,2527 54130 TS BUF
049029,001847: 00,2530 12363 TCF BUFZERO
049030,001848:
049031,001849: 00,2531 10000 BUFNEG CCS A
049032,001850: 00,2532 12416 TCF BUF- # TO BUF- IF BUF IS LESS THAN -1.
049033,001851:
049034,001852: 00,2533 30131 CA BUF +1 # IF BUF IS -1, FORCING SIGN AGREEMENT
049035,001853: 00,2534 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
049036,001854: 00,2535 62416 BZMF BUF- # BRANCH IF SIGNS AGREE.
049037,001855:
049038,001856: 00,2536 45016 CS HALF # SIGNS DISAGREE. FORCE AGREEMENT.
049039,001857: 00,2537 12524 TCF BUFPOS +6
049040,001858:
049041,001859: # THE FOLLOWING ARE PROLOGUES TO SHIFT THE DIVIDEND ARRIVING IN A AND L BEFORE THE DIVIDE.
049042,001860:
049043,001861: 00,2540 22021 -21D LXCH SR # SPECIAL PROLOGUE FOR UNIT WHEN THE
049044,001862: 00,2541 00006 EXTEND # LENGTH OF THE ARGUMENT WAS NOT LESS THAN
049045,001863: 00,2542 75016 MP HALF # .5. IN THIS CASE, EACH COMPONENT MUST BE
049046,001864: 00,2543 56001 XCH L # SHIFTED RIGHT ONE TO PRODUCE A HALF-UNIT
049047,001865: 00,2544 60021 AD SR # VECTOR.
049048,001866: 00,2545 56001 XCH L
049049,001867: 00,2546 12571 TCF GENDDV +1 # WITH DP DIVIDEND IN A,L.
049050,001868:
049051,001869: 00,2547 20001 DDOUBL # PROLOGUE WHICH NORMALIZES THE DIVIDEND
049052,001870: 00,2550 20001 DDOUBL # WHEN IT IS KNOWN THAT NO DIVISION
049053,001871: 00,2551 20001 DDOUBL # OVERFLOW WILL OCCUR.
049054,001872: 00,2552 20001 DDOUBL
049055,001873: 00,2553 20001 DDOUBL
049056,001874: 00,2554 20001 DDOUBL
049057,001875: 00,2555 20001 DDOUBL
049058,001876: 00,2556 20001 DDOUBL
049059,001877: 00,2557 20001 DDOUBL
049060,001878: 00,2560 20001 DDOUBL
049061,001879: 00,2561 20001 DDOUBL
049062,001880: 00,2562 20001 DDOUBL
049063,001881: 00,2563 20001 DDOUBL
049064,001882: 00,2564 52155 DXCH MPAC
049065,001883:
049066,001884: 00,2565 10140 MAXTEST CCS MAXDVSW # 0 IF MAJORS MIGHT BE =, -1 OTHERWISE.
049067,001885: 00,2566 06552 BIASHI DEC .4192 B-1 # SQRT CONSTANTS
049068,001886:
049069,001887: 00,2567 12642 TCF MAXDV # CHECK TO SEE IF THEY ARE NOW EQUAL.
049070,001888:
049071,001889: # THE FOLLOWING IS A GENERAL PURPOSE DOUBLE PRECISION DIVISION ROUTINE. IT DIVIDES MPAC BY BUF AND LEAVES
049072,001890: # THE RESULT IN MPAC. THE FOLLOWING CONDITIONS MUST BE SATISFIED:
049073,001891:
049074,001892: # 1. THE DIVISOR (BUF) MUST BE POSITIVE AND NOT LESS THAN .5.
049075,001893:
049076,001894: # 2. THE DIVIDEND (MPAC) MUST BE POSITIVE WITH THE MAJOR PART OF MPAC STRICTLY LESS THAN THAT OF BUF
049077,001895: # (A SPECIAL APPROXIMATION, MAXDV, IS USED WHEN THE MAJOR PARTS ARE EQUAL).
049078,001896:
049079,001897: # UNDERSTANDING THAT A/B = Q + S(R/B) WHERE S = 2(-14) AND Q AND R ARE QUOTIENT AND REMAINDER, RESPEC-
049080,001898: # TIVELY, THE FOLLOWING APPROXIMATION IS OBTAINED BY MULTIPLYING ABOVE AND BELOW BY C - SD AND NEGLECTING TERMS OF
049081,001899: # ORDER S-SQUARED (POSSIBLY INTRODUCING ERROR INTO THE LOW TWO BITS OF THE RESULT). SIGN AGREEMENT IS UNNECESSARY.
049082,001900:
049083,001901: # A + SB . (R - QD) A + SB
049084,001902: # ------ = Q + S(------) WHERE Q AND R ARE QUOTIENT AND REMAINDER OF ------ RESPECTIVELY.
049085,001903: # C + SD ( C ) C
049086,001904:
049087,001905: 00,2570 52155 GENDDV DXCH MPAC # WE NEED A AND B ONLY FOR FIRST DV.
049088,001906: 00,2571 00006 +1 EXTEND # (SPECIAL UNIT PROLOGUE ENTERS HERE).
049089,001907: 00,2572 10130 DV BUF # A NOW CONTAINS Q AND L, R.
049090,001908: 00,2573 52155 DXCH MPAC
049091,001909:
049092,001910: 00,2574 40154 CS MPAC # FORM DIVIDEND FOR MINOR PART OF RESULT.
049093,001911: 00,2575 00006 EXTEND
049094,001912: 00,2576 70131 MP BUF +1
049095,001913: 00,2577 60155 AD MPAC +1 # OVERFLOW AT THIS POINT IS POSITIVE SINCE
049096,001914: 00,2600 54000 OVSK # R IS POSITIVE IN EVERY CASE.
049097,001915: 00,2601 12606 TCF +5
049098,001916:
049099,001917: 00,2602 00006 EXTEND # OVERFLOW CAN BE REMOVED BY SUBTRACTING C
049100,001918: 00,2603 60130 SU BUF # (BUF) ONCE SINCE R IS ALWAYS LESS THAN C
049101,001919: 00,2604 24154 INCR MPAC # IN THIS CASE. INCR COMPENSATES SUBTRACT.
049102,001920: 00,2605 12610 TCF +DOWN # (SINCE C(A) IS STILL POSITIVE).
049103,001921:
049104,001922: 00,2606 00006 +5 EXTEND # C(A) CAN BE MADE LESS THAN C IN MAGNI-
049105,001923: 00,2607 62620 BZMF -UP # TUDE BY DIMINISHING IT BY C (SINCE C IS
049106,001924: # NOT LESS THAN .5) UNLESS C(A) = 0.
049107,001925:
049108,001926: 00,2610 00006 +DOWN EXTEND
049109,001927: 00,2611 60130 SU BUF # IF POSITIVE, REDUCE ONLY IF NECESSARY
049110,001928: 00,2612 00006 EXTEND # SINCE THE COMPENSATING INCR MIGHT CAUSE
049111,001929: 00,2613 12616 BZF +3 # OVERFLOW.
049112,001930: 00,2614 00006 EXTEND # DONT SUBTRACT UNLESS RESULT IS POSITIVE
049113,001931: 00,2615 62624 BZMF ENDMAXDV # OR ZERO.
049114,001932:
049115,001933: 00,2616 24154 +3 INCR MPAC # KEEP SUBTRACT HERE AND COMPENSATE.
049116,001934: 00,2617 12625 TCF FINALDV
049117,001935:
049118,001936: 00,2620 00006 -UP EXTEND # IF ZERO, SET MINOR PART OF RESULT TO
049119,001937: 00,2621 12630 BZF FINALDV +3 # ZERO.
049120,001938:
049121,001939: 00,2622 00006 EXTEND # IF NEGATIVE, ADD C TO A, SUBTRACTING ONE
049122,001940: 00,2623 26154 DIM MPAC # TO COMPENSATE. DIM IS OK HERE SINCE THE
049123,001941: 00,2624 60130 ENDMAXDV AD BUF # MAJOR PART NEVER GOES NEGATIVE.
049124,001942:
049125,001943: 00,2625 22007 FINALDV ZL # DO DV TO OBTAIN MINOR PART OF RESULT.
049126,001944: 00,2626 00006 EXTEND
049127,001945: 00,2627 10130 DV BUF
049128,001946: 00,2630 54155 +3 TS MPAC +1
049129,001947:
049130,001948: 00,2631 10136 CCS DVSIGN # LEAVE RESULT POSITIVE UNLESS C(DVSIGN)=
049131,001949: 00,2632 00002 TC Q # -0.
049132,001950: 00,2633 00002 TC Q
049133,001951: 00,2634 00002 TC Q
049134,001952:
049135,001953: 00,2635 00006 EXTEND
049136,001954: 00,2636 40155 DCS MPAC
049137,001955: 00,2637 52155 DXCH MPAC
049138,001956: 00,2640 35035 CAF ZERO # SO WE ALWAYS RETURN WITH C(A) = 0.
049139,001957: 00,2641 00002 TC Q
049140,001958:
049141,001959: # IF THE MAJOR PARTS OF THE DIVISOR AND DIVIDEND ARE EQUAL, BUT THE MINOR PARTS ARE SUCH THAT THE
049142,001960: # DIVIDEND IS STRICTLY LESS THAN THE DIVISOR IN MAGNITUDE, THE FOLLOWING APPROXIMATION IS USED. THE ASSUMPTIONS
049143,001961: # ARE THE SAME AS THE GENERAL ROUTINE WITH THE ADDITION THAT SIGN AGREEMENT IS NECESSARY (B, C, & D POSITIVE).
049144,001962:
049145,001963: # C + SB . (C + B - D)
049146,001964: # ------ = 37777 + S(---------)
049147,001965: # C + SD ( C )
049148,001966:
049149,001967: # THE DIVISION MAY BE PERFORMED IMMEDIATELY SINCE B IS STRICTLY LESS THAN D AND C IS NOT LESS THAN .5.
049150,001968:
049151,001969: 00,2642 40154 MAXDV CS MPAC # SEE IF MAXDV CASE STILL HOLDS AFTER
049152,001970: 00,2643 60130 AD BUF # NORMALIZATION.
049153,001971: 00,2644 00006 EXTEND
049154,001972: 00,2645 12647 BZF +2
049155,001973: 00,2646 12570 TCF GENDDV # MPAC NOW LESS THAN BUF - DIVIDE AS USUAL
049156,001974:
049157,001975: 00,2647 35013 +2 CAF POSMAX # SET MAJOR PART OF RESULT.
049158,001976: 00,2650 54154 TS MPAC
049159,001977:
049160,001978: 00,2651 40131 CS BUF +1 # FORM DIVIDEND OF MINOR PART OF RESULT.
049161,001979: 00,2652 60155 AD MPAC +1
049162,001980: 00,2653 12624 TCF ENDMAXDV # GO ADD C AND DO DIVIDE, ATTACHING SIGN
049163,001981: # BEFORE EXITING.
049164,001982:
049165,001983: # VECTOR DIVIDED BY SCALAR, V/SC, IS EXECUTED HERE. THE VECTOR IS NOW IN MPAC WITH SCALAR IN BUF.
049166,001984:
049167,001985: 00,2654 45033 V/SC2 CS ONE # INITIALIZE DIVIDEND NORMALIZATION COUNT
049168,001986: 00,2655 54137 TS DVNORMCT # AND DIVISION SIGN REGISTER.
049169,001987: 00,2656 54127 TS VBUF +5
049170,001988:
049171,001989: 00,2657 03010 TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
049172,001990:
049173,001991: 00,2660 52131 DXCH BUF
049174,001992: 00,2661 07513 TC ALSIGNAG # SIGN AGREE BUF
049175,001993: 00,2662 52131 DXCH BUF
049176,001994: 00,2663 10130 CCS BUF # FORCE DIVISOR POSITIVE WITH MAJOR PART
049177,001995: 00,2664 12721 TCF /BUF+ # NON-ZERO (IF POSSIBLE).
049178,001996: 00,2665 12667 TCF +2
049179,001997: 00,2666 12715 TCF /BUF-
049180,001998:
049181,001999: 00,2667 56131 XCH BUF +1 # SHIFT VECTOR AND SCALAR LEFT 14.
049182,002000: 00,2670 56130 XCH BUF
049183,002001: 00,2671 56155 XCH MPAC +1
049184,002002: 00,2672 56154 XCH MPAC
049185,002003: 00,2673 00006 EXTEND # CHECK FOR OVERFLOW IN EACH CASE.
049186,002004: 00,2674 12676 BZF +2
049187,002005: 00,2675 12405 TCF DVOVF
049188,002006:
049189,002007: 00,2676 56160 XCH MPAC +4
049190,002008: 00,2677 56157 XCH MPAC +3
049191,002009: 00,2700 00006 EXTEND
049192,002010: 00,2701 12703 BZF +2
049193,002011: 00,2702 12405 TCF DVOVF
049194,002012:
049195,002013: 00,2703 56162 XCH MPAC +6
049196,002014: 00,2704 56161 XCH MPAC +5
049197,002015: 00,2705 00006 EXTEND
049198,002016: 00,2706 12710 BZF +2
049199,002017: 00,2707 12405 TCF DVOVF
049200,002018:
049201,002019: 00,2710 10130 CCS BUF
049202,002020: 00,2711 12721 TCF /BUF+
049203,002021: 00,2712 12405 TCF DVOVF # ZERO DIVISOR - OVERFLOW.
049204,002022: 00,2713 12715 TCF /BUF-
049205,002023: 00,2714 12405 TCF DVOVF
049206,002024:
049207,002025: 00,2715 00006 /BUF- EXTEND # ON NEGATIVE, COMPLEMENT BUF AND MAINTAIN
049208,002026: 00,2716 40131 DCS BUF # DVSIGN IN VBUF +5.
049209,002027: 00,2717 52131 DXCH BUF
049210,002028: 00,2720 24127 INCR VBUF +5
049211,002029:
049212,002030: 00,2721 00006 /BUF+ EXTEND
049213,002031: 00,2722 30131 DCA BUF # LEAVE ABS(ORIG DIVISOR) IN BUF2
049214,002032: 00,2723 52134 DXCH BUF2 # FOR OVERFLOW TESTING
049215,002033: 00,2724 12732 TCF /NORM # NORMALIZE DIVISOR IN BUF.
049216,002034:
049217,002035: 00,2725 00006 /NORM2 EXTEND # IF LESS THAN .5, AUGMENT DVNORMCT AND
049218,002036: 00,2726 24137 AUG DVNORMCT # DOUBLE DIVISOR.
049219,002037: 00,2727 00006 EXTEND
049220,002038: 00,2730 30131 DCA BUF
049221,002039: 00,2731 20131 DAS BUF
049222,002040:
049223,002041: 00,2732 30130 /NORM CA BUF # SEE IF DIVISOR NORMALIZED.
049224,002042: 00,2733 60000 DOUBLE
049225,002043: 00,2734 54000 OVSK
049226,002044: 00,2735 12725 TCF /NORM2 # DOUBLE AND TRY AGAIN IF NOT.
049227,002045:
049228,002046: 00,2736 02750 TC V/SCDV # DO X COMPONENT DIVIDE.
049229,002047: 00,2737 52160 DXCH MPAC +3 # SUPPLY ARGUMENTS IN USUAL SEQUENCE.
049230,002048: 00,2740 52155 DXCH MPAC
049231,002049: 00,2741 52160 DXCH MPAC +3
049232,002050:
049233,002051: 00,2742 02750 TC V/SCDV # Y COMPONENT.
049234,002052: 00,2743 52162 DXCH MPAC +5
049235,002053: 00,2744 52155 DXCH MPAC
049236,002054: 00,2745 52162 DXCH MPAC +5
049237,002055:
049238,002056: 00,2746 02750 TC V/SCDV # Z COMPONENT.
049239,002057: 00,2747 17367 TCF VROTATEX # GO RE-ARRANGE COMPONENTS BEFORE EXIT.
049240,002058:
049241,002059: # SUBROUTINE USED BY V/SC TO DIVIDE VECTOR COMPONENT IN MPAC,+1 BY THE SCALAR GIVEN IN BUF.
049242,002060:
049243,002061: 00,2750 30127 V/SCDV CA VBUF +5 # REFLECTS SIGN OF SCALAR.
049244,002062: 00,2751 54136 TS DVSIGN
049245,002063:
049246,002064: 00,2752 10154 CCS MPAC # FORCE MPAC POSITIVE, EXITING ON ZERO.
049247,002065: 00,2753 12767 TCF /MPAC+
049248,002066: 00,2754 12756 TCF +2
049249,002067: 00,2755 12763 TCF /MPAC-
049250,002068:
049251,002069: 00,2756 10155 CCS MPAC +1
049252,002070: 00,2757 12767 TCF /MPAC+
049253,002071: 00,2760 00002 TC Q
049254,002072: 00,2761 12763 TCF /MPAC-
049255,002073: 00,2762 00002 TC Q
049256,002074:
049257,002075: 00,2763 00006 /MPAC- EXTEND # USUAL COMPLEMENTING AND SETTING OF SIGN.
049258,002076: 00,2764 40155 DCS MPAC
049259,002077: 00,2765 52155 DXCH MPAC
049260,002078: 00,2766 24136 INCR DVSIGN
049261,002079:
049262,002080: 00,2767 45033 /MPAC+ CS ONE # INITIALIZE NEAR-ONE SWITCH.
049263,002081: 00,2770 54140 TS MAXDVSW
049264,002082:
049265,002083: 00,2771 40154 CS MPAC # CHECK POSSIBLE OVERFLOW.
049266,002084: 00,2772 60133 AD BUF2 # UNNORMALIZED INPUT DIVISOR.
049267,002085: 00,2773 10000 CCS A
049268,002086: 00,2774 13004 TCF DDVCALL # NOT NEAR-ONE
049269,002087: 00,2775 12777 TCF +2 # +0 IS JUST POSSIBLE
049270,002088: 00,2776 12405 TCF DVOVF # NO HOPE
049271,002089: 00,2777 54140 TS MAXDVSW # SIGNAL POSSIBLE NEAR-ONE CASE
049272,002090: 00,3000 40155 CS MPAC +1 # SEE IF DIVISION CAN BE DONE
049273,002091: 00,3001 60134 AD BUF2 +1
049274,002092: 00,3002 00006 EXTEND
049275,002093: 00,3003 62405 BZMF DVOVF
049276,002094:
049277,002095: 00,3004 52155 DDVCALL DXCH MPAC # CALL PRE-DIVIDE NORMALIZATION.
049278,002096: 00,3005 50137 INDEX DVNORMCT
049279,002097: 00,3006 12565 TCF MAXTEST
049280,002098:
049281,002099: 00,3007 32506 SLOPELO DEC .8324
049282,002100:
049283,002101: 00,3010 56002 VECAGREE XCH Q # SAVE Q IN A
049284,002102: 00,3011 52155 DXCH MPAC
049285,002103: 00,3012 07513 TC ALSIGNAG # SIGNAGREE MPAC
049286,002104: 00,3013 52155 DXCH MPAC
049287,002105: 00,3014 52160 DXCH MPAC +3
049288,002106: 00,3015 07513 TC ALSIGNAG # SIGN AGREE MPAC +3
049289,002107: 00,3016 52160 DXCH MPAC +3
049290,002108: 00,3017 52162 DXCH MPAC +5
049291,002109: 00,3020 07513 TC ALSIGNAG # SIGNAGREE MPAC +5
049292,002110: 00,3021 52162 DXCH MPAC +5
049293,002111: 00,3022 00000 TC A
049294,002112:
049295,002113: # THE FOLLOWING ROUTINE EXECUTES THE UNIT INSTRUCTION, WHICH TAKES THE UNIT OF THE VECTOR IN MPAC.
049296,002114:
049297,002115: 00,3023 03010 UNIT TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
049298,002116: 00,3024 07501 TC MPACVBUF # SAVE ARGUMENT IN VBUF
049299,002117: 00,3025 35035 CAF ZERO # MUST SENSE OVERFLOW IN FOLLOWING DOT.
049300,002118: 00,3026 56121 XCH OVFIND
049301,002119: 00,3027 54141 TS TEM1
049302,002120: 00,3030 03317 TC VSQSUB # DOT MPAC WITH ITSELF.
049303,002121: 00,3031 30141 CA TEM1
049304,002122: 00,3032 56121 XCH OVFIND
049305,002123: 00,3033 00006 EXTEND
049306,002124: 00,3034 13036 BZF +2
049307,002125: 00,3035 12405 TCF DVOVF
049308,002126: 00,3036 00006 EXTEND
049309,002127: 00,3037 30155 DCA MPAC # LEAVE THE SQUARE OF THE LENGTH OF THE
049310,002128: 00,3040 50120 INDEX FIXLOC # ARGUMENT IN LVSQUARE.
049311,002129: 00,3041 52043 DXCH LVSQUARE
049312,002130:
049313,002131: 00,3042 03343 TC SQRTSUB # GO TAKE THE NORMALIZED SQUARE ROOT.
049314,002132:
049315,002133: 00,3043 10154 CCS MPAC # CHECK FOR UNIT OVERFLOW.
049316,002134: 00,3044 13051 TCF +5 # MPAC IS NOT LESS THAN .5 UNLESS
049317,002135: 00,3045 54001 TS L
049318,002136: 00,3046 50120 INDEX FIXLOC
049319,002137: 00,3047 52045 DXCH LV
049320,002138: 00,3050 12405 TCF DVOVF # INPUT TO SQRTSUB WAS 0.
049321,002139:
049322,002140: 00,3051 44333 CS FOURTEEN # SEE IF THE INPUT WAS SO SMALL THE THE
049323,002141: 00,3052 60135 AD MPTEMP # FIRST TWO REGISTERS OF THE SQUARE WERE 0
049324,002142: 00,3053 10000 CCS A
049325,002143: 00,3054 40000 COM # IF SO, SAVE THE NEGATIVE OF THE SHIFT
049326,002144: 00,3055 13133 TCF SMALL # COUNT -15D.
049327,002145:
049328,002146: 00,3056 13065 TCF LARGE # (THIS IS USUALLY THE CASE.)
049329,002147:
049330,002148: 00,3057 45041 CS THIRTEEN # IF THE SHIFT COUNT WAS EXACTLY 14, SET
049331,002149: 00,3060 54135 TS MPTEMP # THE PRE-DIVIDE NORM COUNT TO -13D.
049332,002150:
049333,002151: 00,3061 30154 CA MPAC # SHIFT THE LENGTH RIGHT 14 BEFORE STORING
049334,002152: 00,3062 54001 SMALL2 TS L # (SMALL EXITS TO THIS POINT).
049335,002153: 00,3063 35035 CAF ZERO
049336,002154: 00,3064 13112 TCF LARGE2 # GO TO STORE LENGTH AND PROCEED.
049337,002155:
049338,002156: 00,3065 10135 LARGE CCS MPTEMP # MOST ALL CASES COME HERE.
049339,002157: 00,3066 13074 TCF LARGE3 # SEE IF NO NORMALIZATION WAS REQUIRED BY
049340,002158: 00,3067 42024 CS SRDDV # SQRT, AND IF SO, SET UP FOR A SHIFT
049341,002159: 00,3070 54135 TS MPTEMP # RIGHT 1 BEFORE DIVIDING TO PRODUCE
049342,002160: 00,3071 00006 EXTEND # THE DESIRED HALF UNIT VECTOR.
049343,002161: 00,3072 30155 DCA MPAC
049344,002162: 00,3073 13112 TCF LARGE2
049345,002163:
049346,002164: 00,3074 40000 LARGE3 COM # LEAVE NEGATIVE OF SHIFT COUNT-1 FOR
049347,002165: 00,3075 54135 TS MPTEMP # PREDIVIDE LEFT SHIFT.
049348,002166:
049349,002167: 00,3076 40000 COM # PICK UP REQUIRED SHIFTING BIT TO UNNORM-
049350,002168: 00,3077 50000 INDEX A # ALIZE THE SQRT RESULT.
049351,002169: 00,3100 35016 CAF BIT14
049352,002170: 00,3101 54130 TS BUF
049353,002171: 00,3102 00006 EXTEND
049354,002172: 00,3103 70155 MP MPAC +1
049355,002173: 00,3104 56130 XCH BUF
049356,002174: 00,3105 00006 EXTEND # (UNNORMALIZE THE SQRT FOR LV).
049357,002175: 00,3106 70154 MP MPAC
049358,002176: 00,3107 56001 XCH L
049359,002177: 00,3110 60130 AD BUF
049360,002178: 00,3111 56001 XCH L
049361,002179:
049362,002180: 00,3112 50120 LARGE2 INDEX FIXLOC
049363,002181: 00,3113 52045 DXCH LV # LENGTH NOW STORED IN WORK AREA.
049364,002182:
049365,002183: 00,3114 45033 CS ONE
049366,002184: 00,3115 54140 TS MAXDVSW # NO MAXDV CASES IN UNIT.
049367,002185:
049368,002186: 00,3116 52123 DXCH VBUF # PREPARE X COMPONENT FOR DIVIDE, SETTING
049369,002187: 00,3117 52155 DXCH MPAC # LENGTH OF VECTOR AS DIVISOR IN BUF.
049370,002188: 00,3120 52131 DXCH BUF
049371,002189: 00,3121 03151 TC UNITDV
049372,002190:
049373,002191: 00,3122 52125 DXCH VBUF +2 # DO Y AND Z IN USUAL FASHION SO WE CAN
049374,002192: 00,3123 52155 DXCH MPAC # EXIT THROUGH VROTATEX.
049375,002193: 00,3124 52160 DXCH MPAC +3
049376,002194: 00,3125 03151 TC UNITDV
049377,002195:
049378,002196: 00,3126 52127 DXCH VBUF +4
049379,002197: 00,3127 52155 DXCH MPAC
049380,002198: 00,3130 52162 DXCH MPAC +5
049381,002199: 00,3131 03151 TC UNITDV
049382,002200: 00,3132 17367 TCF VROTATEX # AND EXIT.
049383,002201:
049384,002202: # IF THE LENGTH OF THE ARGUMENT VECTOR WAS LESS THAN 2(-28), EACH COMPONENT MUST BE SHIFTED LEFT AT LEAST
049385,002203: # 14 PLACES BEFORE THE DIVIDE. NOTE THAT IN THIS CASE, THE MAJOR PART OF EACH COMPONENT IS ZERO.
049386,002204:
049387,002205: 00,3133 54135 SMALL TS MPTEMP # NEGATIVE OF PRE-DIVIDE SHIFT COUNT.
049388,002206:
049389,002207: 00,3134 35035 CAF ZERO # SHIFT EACH COMPONENT LEFT 14.
049390,002208: 00,3135 56123 XCH VBUF +1
049391,002209: 00,3136 56122 XCH VBUF
049392,002210: 00,3137 56125 XCH VBUF +3
049393,002211: 00,3140 56124 XCH VBUF +2
049394,002212: 00,3141 56127 XCH VBUF +5
049395,002213: 00,3142 56126 XCH VBUF +4
049396,002214:
049397,002215: 00,3143 40135 CS MPTEMP
049398,002216: 00,3144 50000 INDEX A
049399,002217: 00,3145 35016 CAF BIT14
049400,002218: 00,3146 00006 EXTEND
049401,002219: 00,3147 70154 MP MPAC
049402,002220: 00,3150 13062 TCF SMALL2
049403,002221:
049404,002222: 00,3151 5041 THIRTEEN = OCT15
049405,002223: 00,3151 4333 FOURTEEN = OCT16
049406,002224: 00,3151 4333 OCT16 = R1D1
049407,002225:
049408,002226: # THE FOLLOWING ROUTINE SETS UP THE CALL TO THE DIVIDE ROUTINES.
049409,002227:
049410,002228: 00,3151 10154 UNITDV CCS MPAC # FORCE MPAC POSITIVE IF POSSIBLE, SETTING
049411,002229: 00,3152 13170 TCF UMPAC+ # DVSIGN ACCORDING TO THE SIGN OF MPAC
049412,002230: 00,3153 13155 TCF +2 # SINCE THE DIVISOR IS ALWAYS POSITIVE
049413,002231: 00,3154 13162 TCF UMPAC- # HERE.
049414,002232:
049415,002233: 00,3155 10155 CCS MPAC +1
049416,002234: 00,3156 13170 TCF UMPAC+
049417,002235: 00,3157 00002 TC Q # EXIT IMMEDIATELY ON ZERO.
049418,002236: 00,3160 13162 TCF UMPAC-
049419,002237: 00,3161 00002 TC Q
049420,002238:
049421,002239: 00,3162 45035 UMPAC- CS ZERO # IF NEGATIVE, SET -0 IN DVSIGN FOR FINAL
049422,002240: 00,3163 54136 TS DVSIGN # COMPLEMENT.
049423,002241: 00,3164 00006 EXTEND
049424,002242: 00,3165 40155 DCS MPAC # PICK UP ABSOLUTE VALUE OF ARG AND JUMP.
049425,002243: 00,3166 50135 INDEX MPTEMP
049426,002244: 00,3167 12564 TCF MAXTEST -1
049427,002245:
049428,002246: 00,3170 54136 UMPAC+ TS DVSIGN # SET DVSIGN FOR POSITIVE QUOTIENT.
049429,002247: 00,3171 52155 DXCH MPAC
049430,002248: 00,3172 50135 INDEX MPTEMP
049431,002249: 00,3173 12564 TCF MAXTEST -1
049432,002250:
049433,002251: # MISCELLANEOUS UNARY OPERATIONS.
049434,002252:
049435,002253: 00,3174 03300 DSQ TC DSQSUB # SQUARE THE DP CONTENTS OF MPAC.
049436,002254: 00,3175 16030 TCF DANZIG
049437,002255:
049438,002256: 00,3176 10163 ABVALABS CCS MODE # ABVAL OR ABS INSTRUCTION.
049439,002257: 00,3177 13226 TCF ABS # DO ABS ON SCALAR.
049440,002258: 00,3200 13226 TCF ABS
049441,002259:
049442,002260: 00,3201 03317 ABVAL TC VSQSUB # DOT MPAC WITH ITSELF.
049443,002261: 00,3202 22163 LXCH MODE # MODE IS NOW DP (L ZERO AFTER DAS).
049444,002262:
049445,002263: 00,3203 00006 EXTEND # STORE SQUARE OF LENGTH IN WORK AREA.
049446,002264: 00,3204 30155 DCA MPAC
049447,002265: 00,3205 50120 INDEX FIXLOC
049448,002266: 00,3206 52043 DXCH LVSQUARE
049449,002267:
049450,002268: # PROGRAM DESCRIPTION - SUBROUTINE SQRT
049451,002269:
049452,002270: # FUNCTIONAL DESCRIPTION - DOUBLE PRECISION SQUARE ROOT ROUTINE
049453,002271: # THIS PROGRAM TAKES THE SQUARE ROOT OF THE 27 OR 28 MOST SIGNIFICANT BITS IN THE TRIPLE PRECISION SET OF
049454,002272: # NUMBERS - MPAC, MPAC+1, AND MPAC+2. THE ROOT IS RETURNED DOUBLE PRECISION IN MPAC AND MPAC+1.
049455,002273:
049456,002274: # WARNING - THIS SUBROUTINE USES A TRIPLE PRECISION INPUT. THE PROGRAMMER MUST ASSURE THE CONTENTS OF MPAC+2
049457,002275: # ESPECIALLY IF THE CONTENTS OF MPAC IS SMALL OR ZERO. FOR DETAILS SEE STG MEMO NO.949.
049458,002276:
049459,002277: # CALLING SEQUENCE - IN INTERPRETIVE MODE I.E., FOLLOWING TC INTPRET,SQRT NO ADDRESS IS ALLOWED
049460,002278: # INPUT SCALING THE BINARY POINT IS ASSUMED TO THE RIGHT OF BIT 15. THE ANSWER IS RETURNED WITH THE SAME SCALING
049461,002279:
049462,002280: # SUBROUTINES - GENSCR, MPACSHR, SQRTSUB, ABORT
049463,002281:
049464,002282: # ABORT EXIT MODE - ABORTS ON NEGATIVE INPUT -1.2X10E-4 (77775 OCTAL) OR LESS.
049465,002283: # DISPLAYS ERROR CODE 1302
049466,002284: # TC ABORT
049467,002285: # OCT 1302
049468,002286:
049469,002287: # DEBRIS - LOCATIONS BUF, MPTEMP, ADDRWD ARE USED
049470,002288:
049471,002289: 00,3207 03343 SQRT TC SQRTSUB # TAKE THE SQUARE ROOT OF MPAC.
049472,002290: 00,3210 10135 CCS MPTEMP # RETURNED NORMALIZED SQUARE ROOT. SEE IF
049473,002291: 00,3211 13213 TCF +2 # ANY UN-NORMALIZATION REQUIRED AND EXIT
049474,002292: 00,3212 16030 TCF DANZIG # IF NOT.
049475,002293:
049476,002294: 00,3213 63730 AD NEG12 # A RIGHT SHIFT OF MORE THAN 13 COULD BE
049477,002295: 00,3214 00006 EXTEND # REQUIRED IF INPUT WAS ZERO IN MPAC,+1.
049478,002296: 00,3215 63221 BZMF SQRTSHFT # GOES HERE IN MOST CASES.
049479,002297: 00,3216 22007 ZL # IF A LONG SHIFT IS REQUIRED, GO TO
049480,002298: 00,3217 22116 LXCH ADDRWD # GENERAL RIGHT SHIFT ROUTINES.
049481,002299: 00,3220 12303 TCF GENSCR +4 # ADDRWD WAS ZERO TO PREVENT ROUND.
049482,002300:
049483,002301: 00,3221 50135 SQRTSHFT INDEX MPTEMP # SELECT SHIFTING BIT AND EXIT THROUGH
049484,002302: 00,3222 35015 CAF BIT15 # SHIFT ROUTINES.
049485,002303: 00,3223 54135 TS MPTEMP
049486,002304: 00,3224 35035 CAF ZERO # TO ZERO MPAC +2 IN THE PROCESS.
049487,002305: 00,3225 12036 TCF MPACSHR +3
049488,002306:
049489,002307: 00,3226 06672 ABS TC BRANCH # TEST SIGN OF MPAC AND COMPLEMENT IF
049490,002308: 00,3227 16030 TCF DANZIG
049491,002309: 00,3230 16030 TCF DANZIG
049492,002310: 00,3231 17637 TCF COMP
049493,002311:
049494,002312: 00,3232 45031 VDEF CS FOUR # VECTOR DEFINE - ESSENTIALLY TREATS
049495,002313: 00,3233 26166 ADS PUSHLOC # SCALAR IN MPAC AS X COMPONENT, PUSHES UP
049496,002314: 00,3234 00006 EXTEND # FOR Y AND THEN AGAIN FOR Z.
049497,002315: 00,3235 50000 INDEX A
049498,002316: 00,3236 30003 DCA 2
049499,002317: 00,3237 52160 DXCH MPAC +3
049500,002318: 00,3240 00006 EXTEND
049501,002319: 00,3241 50166 INDEX PUSHLOC
049502,002320: 00,3242 30001 DCA 0
049503,002321: 00,3243 52162 DXCH MPAC +5
049504,002322: 00,3244 16470 TCF VMODE # MODE IS NON VECTOR.
049505,002323:
049506,002324: 00,3245 03317 VSQ TC VSQSUB # DOT MPAC WITH ITSELF.
049507,002325: 00,3246 17301 TCF DMODE # MODE IS NOW DP.
049508,002326:
049509,002327: 00,3247 00006 PUSH EXTEND # PUSH DOWN MPAC LEAVING IT LOADED.
049510,002328: 00,3250 30155 DCA MPAC
049511,002329: 00,3251 50166 INDEX PUSHLOC # PUSH DOWN FIRST TWO REGISTERS IN EACH
049512,002330: 00,3252 52001 DXCH 0
049513,002331:
049514,002332: 00,3253 50163 INDEX MODE # INCREMENT PUSHDOWN POINTER.
049515,002333: 00,3254 36213 CAF NO.WDS
049516,002334: 00,3255 26166 ADS PUSHLOC
049517,002335:
049518,002336: 00,3256 10163 CCS MODE
049519,002337: 00,3257 13272 TCF TPUSH # PUSH DOWN MPAC +2.
049520,002338: 00,3260 16030 TCF DANZIG # DONE FOR DP.
049521,002339:
049522,002340: 00,3261 00006 EXTEND # ON VECTOR, PUSH DOWN Y AND Z COMPONENTS.
049523,002341: 00,3262 30160 DCA MPAC +3
049524,002342: 00,3263 50166 INDEX PUSHLOC
049525,002343: 00,3264 51775 DXCH 0 -4
049526,002344: 00,3265 00006 EXTEND
049527,002345: 00,3266 30162 DCA MPAC +5
049528,002346: 00,3267 50166 INDEX PUSHLOC
049529,002347: 00,3270 51777 DXCH 0 -2
049530,002348: 00,3271 16030 TCF DANZIG
049531,002349:
049532,002350: 00,3272 30156 TPUSH CA MPAC +2
049533,002351: 00,3273 16523 TCF ENDTPUSH +2
049534,002352:
049535,002353: 00,3274 50120 RVQ INDEX FIXLOC # RVQ - RETURN IVA QPRET.
049536,002354: 00,3275 30052 CA QPRET
049537,002355: 00,3276 54117 TS POLISH
049538,002356: 00,3277 16621 TCF GOTO +4 # (ASSUME QPRET POINTS TO FIXED ONLY.)
049539,002357:
049540,002358: # THE FOLLOWING SUBROUTINES ARE USED IN SQUARING MPAC, IN BOTH THE SCALAR AND VECTOR SENSE. THEY ARE
049541,002359: # SPECIAL CASES OF DMPSUB AND DOTSUB, PUT IN TO SAVE SOME TIME.
049542,002360:
049543,002361: 00,3300 30155 DSQSUB CA MPAC +1 # SQUARES THE SCALAR CONTENTS OF MPAC.
049544,002362: 00,3301 00006 EXTEND
049545,002363: 00,3302 70000 SQUARE
049546,002364: 00,3303 54156 TS MPAC +2
049547,002365: 00,3304 35035 CAF ZERO # FORM 2(CROSS TERM).
049548,002366: 00,3305 56155 XCH MPAC +1
049549,002367: 00,3306 00006 EXTEND
049550,002368: 00,3307 70154 MP MPAC
049551,002369: 00,3310 20001 DDOUBL # AND MAYBE OVERFLOW.
049552,002370: 00,3311 20156 DAS MPAC +1 # AND SET A TO NET OVERFLOW.
049553,002371: 00,3312 56154 XCH MPAC
049554,002372: 00,3313 00006 EXTEND
049555,002373: 00,3314 70000 SQUARE
049556,002374: 00,3315 20155 DAS MPAC
049557,002375: 00,3316 00002 TC Q
049558,002376:
049559,002377: 00,3317 00006 VSQSUB EXTEND # DOTS THE VECTOR IN MPAC WITH ITSELF.
049560,002378: 00,3320 22137 QXCH DOTRET
049561,002379: 00,3321 03300 TC DSQSUB # SQUARE THE X COMPONENT.
049562,002380: 00,3322 52160 DXCH MPAC +3
049563,002381: 00,3323 52155 DXCH MPAC
049564,002382: 00,3324 52131 DXCH BUF # SO WE CAN END IN DOTSUB.
049565,002383: 00,3325 30156 CA MPAC +2
049566,002384: 00,3326 54132 TS BUF +2
049567,002385:
049568,002386: 00,3327 03300 TC DSQSUB # SQUARE Y COMPONENT.
049569,002387: 00,3330 52156 DXCH MPAC +1
049570,002388: 00,3331 20132 DAS BUF +1
049571,002389: 00,3332 60154 AD MPAC
049572,002390: 00,3333 60130 AD BUF
049573,002391: 00,3334 54130 TS BUF
049574,002392: 00,3335 13337 TCF +2
049575,002393: 00,3336 54121 TS OVFIND # IF OVERFLOW.
049576,002394:
049577,002395: 00,3337 52162 DXCH MPAC +5
049578,002396: 00,3340 52155 DXCH MPAC
049579,002397: 00,3341 03300 TC DSQSUB # SQUARE Z COMPONENT.
049580,002398: 00,3342 17154 TCF ENDDOT # END AS IN DOTSUB.
049581,002399:
049582,002400: # DOUBLE PRECISION SQUARE ROOT ROUTINE. TAKE THE SQUARE ROOT OF THE TRIPLE PRECISION (MPAC +2 USED ONLY
049583,002401: # IN NORMALIZATION) CONTENTS OF MPAC AND LEAVE THE NORMALIZED RESULT IN MPAC (C(MPAC) GREATER THAN OR EQUAL TO
049584,002402: # .5). THE RIGHT SHIFT COUNT (TO UNNORMALIZE) IS LEFT IN MPTEMP.
049585,002403:
049586,002404: 00,3343 35035 SQRTSUB CAF ZERO # START BY ZEROING RIGHT SHIFT COUNT.
049587,002405: 00,3344 54135 TS MPTEMP
049588,002406:
049589,002407: 00,3345 10154 CCS MPAC # CHECK FOR POSITIVE ARGUMENT, SHIFTING
049590,002408: 00,3346 13404 TCF SMPAC+ # FIRST SIGNIFICANT MPAC REGISTER INTO
049591,002409: 00,3347 13351 TCF +2 # MPAC ITSELF.
049592,002410: 00,3350 13373 TCF SQRTNEG # SEE IF MAG OF ARGUMENT LESS THAN 10(-4).
049593,002411:
049594,002412: 00,3351 56156 XCH MPAC +2 # MPAC IS ZERO - SHIFT LEFT 14.
049595,002413: 00,3352 56155 XCH MPAC +1
049596,002414: 00,3353 54154 TS MPAC
049597,002415: 00,3354 35037 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
049598,002416: 00,3355 54135 TS MPTEMP
049599,002417:
049600,002418: 00,3356 10154 CCS MPAC # SEE IF MPAC NOW PNZ.
049601,002419: 00,3357 13404 TCF SMPAC+
049602,002420: 00,3360 13362 TCF +2
049603,002421: 00,3361 13376 TCF ZEROANS # NEGATIVE BUT LESS THAN 10(-4) IN MAG.
049604,002422:
049605,002423: 00,3362 56155 XCH MPAC +1 # ZERO - SHIFT LEFT 14 AGAIN.
049606,002424: 00,3363 54154 TS MPAC
049607,002425: 00,3364 35037 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
049608,002426: 00,3365 26135 ADS MPTEMP
049609,002427:
049610,002428: 00,3366 10154 CCS MPAC
049611,002429: 00,3367 13404 TCF SMPAC+
049612,002430: 00,3370 00002 TC Q # SQRT(0) = 0.
049613,002431: 00,3371 13376 TCF ZEROANS
049614,002432: 00,3372 13452 TCF FIXROOT # DO NOT LEAVE SQRTSUB WITH -0 IN MPAC.
049615,002433:
049616,002434: 00,3373 10000 SQRTNEG CCS A # ARGUMENT IS NEGATIVE, BUT SEE IF SIGN-
049617,002435: 00,3374 13402 TCF SQRTABRT # CORRECTED ARGUMENT IS LESS THAN 10(-4)
049618,002436:
049619,002437: 00,3375 10155 CCS MPAC +1 # IN MAGNITUDE. IF SO, CALL ANSWER ZERO.
049620,002438: 00,3376 35035 ZEROANS CAF ZERO # FORCE ANSWER TO ZERO HERE.
049621,002439: 00,3377 13452 TCF FIXROOT
049622,002440: 00,3400 13402 TCF SQRTABRT
049623,002441: 00,3401 13452 TCF FIXROOT
049624,002442:
049625,002443: 00,3402 05725 SQRTABRT TC POODOO
049626,002444: 00,3403 21302 OCT 21302 # SQRT CALLED WITH NEGATIVE ARGUMENT
049627,002445:
049628,002446: 00,3404 62444 SMPAC+ AD -1/2+2 # SEE IF ARGUMENT GREATER THAN OR EQUAL TO
049629,002447: 00,3405 00006 EXTEND # .5.
049630,002448: 00,3406 63455 BZMF SRTEST # IF SO, SEE IF LESS THAN .25.
049631,002449:
049632,002450: 00,3407 52155 DXCH MPAC # WE WILL TAKE THE SQUARE ROOT OF MPAC/2.
049633,002451: 00,3410 22021 LXCH SR # SHIFT RIGHT 1 AND GO TO THE SQRT ROUTINE
049634,002452: 00,3411 00006 EXTEND
049635,002453: 00,3412 75016 MP HALF
049636,002454: 00,3413 52155 DXCH MPAC
049637,002455: 00,3414 56021 XCH SR
049638,002456: 00,3415 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
049639,002457:
049640,002458: 00,3416 32314 ARGHI CAF SLOPEHI # ARGUMENT BETWEEN .25 AND .5. GET A
049641,002459: 00,3417 00006 EXTEND # LINEAR APPROXIMATION FOR THIS RANGE.
049642,002460: 00,3420 70154 MP MPAC
049643,002461: 00,3421 62566 AD BIASHI # X0/2 = (MPAC/2)(SLOPEHI) + BIASHI/2.
049644,002462:
049645,002463: 00,3422 54130 +4 TS BUF # X0/2 (ARGLO ENTERS HERE).
049646,002464: 00,3423 30154 CA MPAC # SINGLE-PRECISION THROUGHOUT.
049647,002465: 00,3424 22007 ZL
049648,002466: 00,3425 00006 EXTEND
049649,002467: 00,3426 10130 DV BUF # (MPAC/2)/(X0/2)
049650,002468: 00,3427 00006 EXTEND
049651,002469: 00,3430 75016 MP HALF
049652,002470: 00,3431 26130 ADS BUF # X1 = X0/2 + .5(MPAC/2)/(X0/2).
049653,002471:
049654,002472: 00,3432 00006 EXTEND
049655,002473: 00,3433 75016 MP HALF # FORM UP X1/2.
049656,002474: 00,3434 52155 DXCH MPAC # SAVE AND BRING OUT ARGUMENT.
049657,002475: 00,3435 00006 EXTEND # TAKE DP QUOTIENT WITH X1.
049658,002476: 00,3436 10130 DV BUF
049659,002477: 00,3437 54131 TS BUF +1 # SAVE MAJOR PART OF QUOTIENT.
049660,002478: 00,3440 35035 CAF ZERO # FORM MINOR PART OF QUOTIENT USING
049661,002479: 00,3441 56001 XCH L # (REMAINDER,0).
049662,002480: 00,3442 00006 EXTEND
049663,002481: 00,3443 10130 DV BUF
049664,002482: 00,3444 54001 TS L # IN PREPARATION FOR DAS.
049665,002483: 00,3445 30131 CA BUF +1
049666,002484: 00,3446 20155 DAS MPAC # X2 = X1/2 + (MPAC/2)X1
049667,002485:
049668,002486: 00,3447 00006 EXTEND # OVERFLOWS IF ARG. NEAR POSMAX.
049669,002487: 00,3450 13454 BZF TCQBNK00
049670,002488: 00,3451 35013 CAF POSMAX
049671,002489: 00,3452 54154 FIXROOT TS MPAC
049672,002490: 00,3453 54155 TS MPAC +1
049673,002491: 00,3454 00002 TCQBNK00 TC Q # RETURN TO CALLER TO UNNORMALIZE, ETC.
049674,002492:
049675,002493: 00,3455 65017 SRTEST AD QUARTER # ARGUMENT WAS LESS THAN .5, SEE IF LESS
049676,002494: 00,3456 00006 EXTEND # THAN .25.
049677,002495: 00,3457 63501 BZMF SQRTNORM # IF SO, BEGIN NORMALIZATION.
049678,002496:
049679,002497: 00,3460 52155 DXCH MPAC # IF BETWEEN .5 AND .25, SHIFT RIGHT 1 AND
049680,002498: 00,3461 22021 LXCH SR # START AT ARGLO.
049681,002499: 00,3462 00006 EXTEND
049682,002500: 00,3463 75016 MP HALF
049683,002501: 00,3464 52155 DXCH MPAC
049684,002502: 00,3465 56021 XCH SR
049685,002503: 00,3466 26155 ADS MPAC +1 # NO OVERFLOW.
049686,002504:
049687,002505: 00,3467 33007 ARGLO CAF SLOPELO # (NORMALIZED) ARGUMENT BETWEEN .125 AND
049688,002506: 00,3470 00006 EXTEND # .25
049689,002507: 00,3471 70154 MP MPAC
049690,002508: 00,3472 62270 AD BIASLO
049691,002509: 00,3473 13422 TCF ARGHI +4 # BEGIN SQUARE ROOT.
049692,002510:
049693,002511: 00,3474 00006 SQRTNM2 EXTEND # SHIFT LEFT 2 AND INCREMENT RIGHT SHIFT
049694,002512: 00,3475 30156 DCA MPAC +1 # COUNT (FOR TERMINAL UNNORMALIZATION).
049695,002513: 00,3476 20156 DAS MPAC +1
049696,002514: 00,3477 60154 AD MPAC
049697,002515: 00,3500 26154 ADS MPAC # (NO OVERFLOW).
049698,002516:
049699,002517: 00,3501 24135 SQRTNORM INCR MPTEMP # FIRST TIME THROUGH, JUST SHIFT LEFT 1
049700,002518: 00,3502 00006 EXTEND # (PUTS IN EFFECTIVE RIGHT SHIFT SINCE
049701,002519: 00,3503 30156 DCA MPAC +1 # WE WANT MPAC/2).
049702,002520: 00,3504 20156 DAS MPAC +1
049703,002521: 00,3505 60154 AD MPAC
049704,002522: 00,3506 26154 ADS MPAC # (AGAIN NO OVERFLOW).
049705,002523: 00,3507 60000 DOUBLE
049706,002524: 00,3510 54022 TS CYL
049707,002525:
049708,002526: 00,3511 10022 NORMTEST CCS CYL # SEE IF ARGUMENT NOW NORMALIZED AT
049709,002527: 00,3512 10022 CCS CYL # GREATER THAN .125.
049710,002528: 00,3513 13474 TCF SQRTNM2 # NO - SHIFT LEFT 2 MORE AND TRY AGAIN.
049711,002529: 00,3514 13416 TCF ARGHI # YES - NOW BETWEEN .5 AND .25.
049712,002530: 00,3515 13467 TCF ARGLO # ARGUMENT NOW BETWEEN .25 AND .125.
049713,002531:
049714,002532: # TRIGONOMETRIC FUNCTION PACKAGE.
049715,002533: # THE FOLLOWING TRIGONOMETRIC FUNCTIONS ARE AVAILABLE AS INTERPRETIVE OPERATIONS:
049716,002534: # 1. SIN COMPUTES (1/2)SINE(2 PI MPAC).
049717,002535: # 2. COS COMPUTES (1/2)COSINE(2 PI MPAC).
049718,002536: # 3. ASIN COMPUTES (1/2PI)ARCSINE(2 MPAC).
049719,002537: # 4. ACOS COMPUTES (1/2PI)ARCCOSINE(2 MPAC).
049720,002538:
049721,002539: # SIN-ASIN AND COS-ACOS ARE MUTUALLY INVERSE, IE SIN(ASIN(X)) = X.
049722,002540:
049723,002541: 00,3516 06672 COSINE TC BRANCH # FINDS COSINE USING THE IDENTITY
049724,002542: 00,3517 13522 TCF +3 # COS(X) = SIN(PI/2 - ABS(X)).
049725,002543: 00,3520 13525 TCF PRESINE
049726,002544: 00,3521 13525 TCF PRESINE
049727,002545:
049728,002546: 00,3522 00006 +3 EXTEND
049729,002547: 00,3523 40155 DCS MPAC
049730,002548: 00,3524 52155 DXCH MPAC
049731,002549:
049732,002550: 00,3525 35017 PRESINE CAF QUARTER # PI/2 SCALED.
049733,002551: 00,3526 26154 ADS MPAC
049734,002552:
049735,002553: 00,3527 52155 SINE DXCH MPAC # DOUBLE ARGUMENT.
049736,002554: 00,3530 20001 DDOUBL
049737,002555: 00,3531 54000 OVSK # SEE IF OVERFLOW PRESENT.
049738,002556: 00,3532 13535 TCF +3 # IF NOT, ARGUMENT OK AS IS.
049739,002557:
049740,002558: 00,3533 00006 EXTEND # IF SO, WE LOST (OR GAINED) PI, SO
049741,002559: 00,3534 40001 DCOM # COMPLEMENT MPAC USING THE IDENTITY
049742,002560: # SIN(X-(+)PI) = SIN(-X).
049743,002561: 00,3535 52155 +3 DXCH MPAC
049744,002562: 00,3536 30154 CA MPAC # SEE IF ARGUMENT GREATER THAN .5 IN
049745,002563: 00,3537 60000 DOUBLE # MAGNITUDE. IF SO, REDUCE IT TO LESS THAN
049746,002564: 00,3540 54001 TS L # .5 (+-PI/2 SCALED) AS FOLLOWS:
049747,002565: 00,3541 13552 TCF SN1
049748,002566:
049749,002567: 00,3542 50000 INDEX A # IF POSITIVE, FORM PI - X, IF NEGATIVE
049750,002568: 00,3543 35015 CAF NEG1/2 +1 # USE -PI -X.
049751,002569: 00,3544 60000 DOUBLE
049752,002570: 00,3545 00006 EXTEND
049753,002571: 00,3546 60154 SU MPAC # GUARANTEED NO OVERFLOW.
049754,002572: 00,3547 54154 TS MPAC
049755,002573: 00,3550 40155 CS MPAC +1
049756,002574: 00,3551 54155 TS MPAC +1
049757,002575:
049758,002576: 00,3552 00006 SN1 EXTEND # SET UP TO EVALUATE HASTINGS POLYNOMIAL
049759,002577: 00,3553 30155 DCA MPAC
049760,002578: 00,3554 52134 DXCH BUF2
049761,002579: 00,3555 03300 TC DSQSUB # SQUARE MPAC.
049762,002580:
049763,002581: 00,3556 07171 TC POLY # EVALUATE FOURTH ORDER POLYNOMIAL.
049764,002582: 00,3557 00003 DEC 3 B-14
049765,002583: 00,3560 14441 37325 2DEC +.3926990796
049766,002584: 00,3562 53250 60764 2DEC -.6459637111
049767,002585: 00,3564 12146 21276 2DEC +.318758717
049768,002586: 00,3566 75466 71471 2DEC -.074780249
049769,002587: 00,3570 00236 32757 2DEC +.009694988
049770,002588:
049771,002589: 00,3572 32470 CAF LBUF2 # MULTIPLY BY ARGUMENT AND SHIFT LEFT 2.
049772,002590: 00,3573 07055 TC DMPSUB -1
049773,002591:
049774,002592: 00,3574 00006 EXTEND
049775,002593: 00,3575 30156 DCA MPAC +1
049776,002594: 00,3576 20156 DAS MPAC +1
049777,002595: 00,3577 60154 AD MPAC
049778,002596: 00,3600 26154 ADS MPAC # NEITHER SHIFT OVERFLOWS.
049779,002597: 00,3601 00006 EXTEND
049780,002598: 00,3602 30156 DCA MPAC +1
049781,002599: 00,3603 20156 DAS MPAC +1
049782,002600: 00,3604 60154 AD MPAC
049783,002601: 00,3605 26154 ADS MPAC
049784,002602: 00,3606 16030 TCF DANZIG
049785,002603:
049786,002604: # ARCSIN/ARCCOS ROUTINE.
049787,002605:
049788,002606: 00,3607 33630 ARCSIN CAF LASINEX # COMPUTE ARCSIN BY USING THE IDENTITY
049789,002607: 00,3610 13612 TCF +2 # ARCSIN(X) = PI/2 - ARCCOS(X).
049790,002608:
049791,002609: 00,3611 33712 ARCCOS CAF LDANZIG # (EXITS IMMEDIATELY).
049792,002610: 00,3612 54136 TS ESCAPE
049793,002611: 00,3613 06672 TC BRANCH # TEST SIGN OF INPUT.
049794,002612: 00,3614 13624 TCF ACOSST # START IMMEDIATELY IF POSITIVE.
049795,002613: 00,3615 13726 TCF ACOSZERO # ARCCOS(0) = PI/2 = .25.
049796,002614: 00,3616 00006 EXTEND # IF NEGATIVE, USE THE IDENTITY
049797,002615: 00,3617 40155 DCS MPAC # ARCCOS(X) = PI - ARCCOS(-X), FORCING
049798,002616: 00,3620 52155 DXCH MPAC # ARGUMENT POSITIVE.
049799,002617: 00,3621 33731 CAF TCSUBTR # SET EXIT TO DO ABOVE BEFORE
049800,002618: 00,3622 56136 XCH ESCAPE # ARCSIN/ARCCOS CONSIDERATIONS.
049801,002619: 00,3623 54137 TS ESCAPE2
049802,002620:
049803,002621: 00,3624 45016 ACOSST CS HALF # TEST MAGNITUDE OF INPUT.
049804,002622: 00,3625 60154 AD MPAC
049805,002623: 00,3626 10000 CCS A
049806,002624: 00,3627 13720 TCF ACOSOVF # THIS IS PROBABLY AN OVERFLOW CASE.
049807,002625:
049808,002626: 00,3630 13706 LASINEX TCF ASINEX
049809,002627:
049810,002628: 00,3631 13641 TCF ACOSST2 # NO OVERFLOW - PROCEED.
049811,002629:
049812,002630: 00,3632 10155 CCS MPAC +1 # IF MAJOR PART IS .5, CALL ANSWER 0
049813,002631: 00,3633 35035 CAF ZERO # UNLESS MINOR PART NEGATIVE.
049814,002632: 00,3634 13636 TCF ACOS=0
049815,002633:
049816,002634: 00,3635 13641 TCF ACOSST2
049817,002635:
049818,002636: 00,3636 54155 ACOS=0 TS MPAC +1
049819,002637: 00,3637 54154 TS MPAC
049820,002638: 00,3640 00136 TC ESCAPE
049821,002639:
049822,002640: 00,3641 00006 ACOSST2 EXTEND # NOW THAT ARGUMENT IS IN PROPER RANGE,
049823,002641: 00,3642 40155 DCS MPAC # BEGIN COMPUTATION. USE HASTINGS
049824,002642: 00,3643 65016 AD HALF # APPROXIMATION ARCCOS(X) = SQRT(1-X)P(X)
049825,002643: 00,3644 52155 DXCH MPAC # IN A SCALED VERSION WHERE P(X) IS A
049826,002644: 00,3645 52134 DXCH BUF2 # SEVENTH ORDER POLYNOMIAL.
049827,002645:
049828,002646: 00,3646 03343 TC SQRTSUB # RETURNS WITH NORMALIZED SQUARE ROOT.
049829,002647:
049830,002648: 00,3647 10135 CCS MPTEMP # SEE IF UN-NORMALIZATION REQUIRED.
049831,002649: 00,3650 13713 TCF ACOSSHR # IF SO.
049832,002650:
049833,002651: 00,3651 52155 ACOS3 DXCH MPAC # SET UP FOR POLYNOMIAL EVALUATION.
049834,002652: 00,3652 52134 DXCH BUF2
049835,002653: 00,3653 52155 DXCH MPAC
049836,002654:
049837,002655: 00,3654 07171 TC POLY
049838,002656: 00,3655 00006 DEC 6 B-14
049839,002657: 00,3656 13240 23630 2DEC +.353553385 # COEFFICIENTS ARE C 2(+I)/PISQRT(2) WHERE
049840,002658: 00,3660 74721 47775 2DEC* -.0483017006 B+1* # I
049841,002659: 00,3662 02440 20237 2DEC* +.0200273085 B+2* # WHERE C STANDS FOR ORIGINAL COEFFS.
049842,002660: 00,3664 75067 70742 2DEC* -.0112931863 B+3*
049843,002661: 00,3666 03436 26756 2DEC* +.00695311612 B+4*
049844,002662: 00,3670 74037 57640 2DEC* -.00384617957 B+5*
049845,002663: 00,3672 03046 07143 2DEC* +.001501297736 B+6*
049846,002664: 00,3674 76654 42244 2DEC* -.000284160334 B+7*
049847,002665:
049848,002666: 00,3676 32470 CAF LBUF2 # DO FINAL MULTIPLY AND GO TO ANY
049849,002667: 00,3677 07055 TC DMPSUB -1 # EPILOGUE SEQUENCES.
049850,002668: 00,3700 00136 TC ESCAPE
049851,002669:
049852,002670: 00,3701 00006 SUBTR EXTEND # EPILOGUE FOR NEGATIVE INPUTS TO ARCCOS.
049853,002671: 00,3702 40155 DCS MPAC
049854,002672: 00,3703 65016 AD HALF # FORMS PI - ARCCOS(-X) = ARCCOS(X).
049855,002673: 00,3704 52155 DXCH MPAC
049856,002674: 00,3705 00137 TC ESCAPE2 # GO TO POSSIBLE ARCSIN EPILOGUE.
049857,002675:
049858,002676: 00,3706 00006 ASINEX EXTEND
049859,002677: 00,3707 40155 DCS MPAC # ARCSIN EPILOGUE - GET ARCSIN(X)
049860,002678: 00,3710 65017 AD QUARTER # = PI/2 - ARCCOS(X).
049861,002679: 00,3711 52155 DXCH MPAC
049862,002680: 00,3712 16030 LDANZIG TCF DANZIG
049863,002681:
049864,002682: 00,3713 50000 ACOSSHR INDEX A # THE SHIFT RIGHT IS LESS THAN 14 SINCE
049865,002683: 00,3714 35016 CAF BIT14 # THE INPUT WAS NON-ZERO DP.
049866,002684: 00,3715 54135 TS MPTEMP
049867,002685: 00,3716 02073 TC VSHRRND # DP SHIFT RIGHT AND ROUND.
049868,002686: 00,3717 13651 TCF ACOS3 # PROCEED.
049869,002687:
049870,002688: 00,3720 00006 ACOSOVF EXTEND # IF MAJOR PART WAS ONLY 1 MORE THAN .5,
049871,002689: 00,3721 13636 BZF ACOS=0 # CALL ANSWER ZERO.
049872,002690:
049873,002691: 00,3722 05664 ACOSABRT TC ALARM # IF OVERFLOW, CALL ANSWER ZERO BUT
049874,002692: 00,3723 01301 OCT 1301 # SOUND AN ALARM.
049875,002693:
049876,002694: 00,3724 35035 CAF ZERO
049877,002695: 00,3725 13636 TCF ACOS=0
049878,002696:
049879,002697: 00,3726 35017 ACOSZERO CAF QUARTER # ACOS(0) = PI/2.
049880,002698: 00,3727 13637 TCF ACOS=0 +1 # SET MPAC AND EXIT VIA ESCAPE.
049881,002699:
049882,002700: 00,3730 77763 NEG12 DEC -12 B-14
049883,002701: 00,3731 13701 TCSUBTR TCF SUBTR
049884,002702:
049885,002703: # THE FOLLOWING INSTRUCTIONS ARE AVAILABLE FOR SETTING, MODIFYING, AND BRANCHING ON INDEX REGISTERS:
049886,002704:
049887,002705: # 1. AXT ADDRESS TO INDEX TRUE.
049888,002706: # 1. AXC ADDRESS TO INDEX COMPLEMENTED.
049889,002707: # 3. LXA LOAD INDEX FROM ERASABLE.
049890,002708: # 4. LXC LOAD INDEX COMPLEMENTED FROM ERASABLE.
049891,002709: # 5. SXA STORE INDEX IN ERASABLE.
049892,002710: # 6. XCHX EXCHANGE INDEX REIGSTER WITH ERASABLE.
049893,002711:
049894,002712: # 7. INCR INCREMENT INDEX REGISTER.
049895,002713: # 8. XAD ERASABLE ADD TO INDEX REGISTER.
049896,002714: # 9. XSU ERASABLE SUBTRACT FROM INDEX REGISTER.
049897,002715: # 10. TIX BRANCH ON INDEX REGISTER AND DECREMENT.
049898,002716:
049899,002717: 01,2371 BANK 01
049900,002718:
049901,002719: 01,2371 COUNT 01/INTER
049902,002720:
049903,002721: 01,2371 02466 AXT TC TAGSUB # SELECT APPROPRIATE INDEX REGISTER.
049904,002722: 01,2372 30117 CA POLISH
049905,002723: 01,2373 50130 XSTORE INDEX INDEXLOC # CONTAINS C(FIXLOC) OR C(FIXLOC)+1.
049906,002724: 01,2374 54046 TS X1
049907,002725: 01,2375 16030 TCF DANZIG
049908,002726:
049909,002727: 01,2376 02466 AXC TC TAGSUB
049910,002728: 01,2377 40117 CS POLISH
049911,002729: 01,2400 02373 TC XSTORE
049912,002730:
049913,002731: 01,2401 02454 LXA TC 15ADRERS # LOAD INDEX REGISTER FROM ERASABLE.
049914,002732: 01,2402 50117 INDEX POLISH
049915,002733: 01,2403 30000 CA 0
049916,002734: 01,2404 12373 TCF XSTORE
049917,002735:
049918,002736: 01,2405 02454 LXC TC 15ADRERS # LOAD NDX REG FROM ERASABLE COMPLEMENTED.
049919,002737: 01,2406 50117 INDEX POLISH
049920,002738: 01,2407 40000 CS 0
049921,002739: 01,2410 12373 TCF XSTORE
049922,002740:
049923,002741: 01,2411 02454 SXA TC 15ADRERS # STORE INDEX REGISTER IN ERASABLE.
049924,002742: 01,2412 50130 INDEX INDEXLOC
049925,002743: 01,2413 30046 CA X1
049926,002744: 01,2414 50117 MSTORE1 INDEX POLISH
049927,002745: 01,2415 54000 TS 0
049928,002746: 01,2416 16030 TCF DANZIG
049929,002747:
049930,002748: 01,2417 02454 XCHX TC 15ADRERS # EXCHANGE INDEX REGISTER WITH ERASABLE.
049931,002749: 01,2420 50117 INDEX POLISH
049932,002750: 01,2421 30000 CA 0
049933,002751: 01,2422 50130 INDEX INDEXLOC
049934,002752: 01,2423 56046 XCH X1
049935,002753: 01,2424 12414 TCF MSTORE1
049936,002754:
049937,002755: 01,2425 02454 XAD TC 15ADRERS # ADD ERASABLE TO INDEX REGISTER.
049938,002756: 01,2426 50117 INDEX POLISH
049939,002757: 01,2427 30000 CA 0
049940,002758: 01,2430 50130 XAD2 INDEX INDEXLOC
049941,002759: 01,2431 26046 ADS X1 # IGNORING OVERFLOWS.
049942,002760: 01,2432 16030 TCF DANZIG
049943,002761:
049944,002762: 01,2433 02466 INCR TC TAGSUB # INCREMENT INDEX REGISTER.
049945,002763: 01,2434 30117 CA POLISH
049946,002764: 01,2435 12430 TCF XAD2
049947,002765:
049948,002766: 01,2436 02454 XSU TC 15ADRERS # SUBTRACT ERASABLE FROM INDEX REGISTER.
049949,002767: 01,2437 50117 INDEX POLISH
049950,002768: 01,2440 40000 CS 0
049951,002769: 01,2441 12430 TCF XAD2
049952,002770:
049953,002771: 01,2442 02466 TIX TC TAGSUB # BRANCH AND DECREMENT ON INDEX.
049954,002772: 01,2443 50130 INDEX INDEXLOC
049955,002773: 01,2444 40050 CS S1
049956,002774: 01,2445 50130 INDEX INDEXLOC
049957,002775: 01,2446 60046 AD X1
049958,002776: 01,2447 00006 EXTEND # NO OPERATION IF DECREMENTED INDEX IS
049959,002777: 01,2450 66030 BZMF DANZIG # NEGATIVE OR ZERO.
049960,002778:
049961,002779: 01,2451 50130 DOTIXBR INDEX INDEXLOC
049962,002780: 01,2452 56046 XCH X1 # IGNORING OVERFLOWS.
049963,002781:
049964,002782: 01,2453 16615 TCF GOTO # DO THE BRANCH USING THE CADR IN POLISH.
049965,002783:
049966,002784: # SUBROUTINE TO CONVERT AN ERASABLE ADDRESS (11 BITS) TO AN EBANK SETTING AND SUBADDRESS.
049967,002785:
049968,002786: 01,2454 40117 15ADRERS CS POLISH
049969,002787: 01,2455 65050 AD DEC45
049970,002788: 01,2456 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
049971,002789: 01,2457 30120 CA FIXLOC # YES. ADD FIXLOC. EBANK OK AS IS.
049972,002790: 01,2460 12465 TCF +5
049973,002791:
049974,002792: 01,2461 35065 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
049975,002793: 01,2462 56117 XCH POLISH
049976,002794: 01,2463 54003 TS EBANK
049977,002795: 01,2464 74373 MASK LOW8
049978,002796: 01,2465 26117 +5 ADS POLISH # FALL INTO TAGSUB, AND RETURN VIA Q.
049979,002797:
049980,002798: # SUBROUTINE WHICH SETS THE ADDRESS OF THE SPECIFIED INDEX IN INDEXLOC. (ACTUALLY, THE ADDRESS -38D.)
049981,002799:
049982,002800: 01,2466 30120 TAGSUB CA FIXLOC
049983,002801: 01,2467 54130 TS INDEXLOC
049984,002802:
049985,002803: 01,2470 10020 CCS CYR # BIT 15 SPECIFIES INDEX.
049986,002804: 01,2471 24130 INCR INDEXLOC # 0 MEANS USE X2.
049987,002805: 01,2472 00002 TC Q
049988,002806: 01,2473 00002 TC Q # 1 FOR X1.
049989,002807:
049990,002808: # MISCELLANEOUS OPERATION CODES WITH DIRECT ADDRESSES. INCLUDED HERE ARE:
049991,002809: # 1. ITA STORE QPRET (RETURN ADDRESS) IN ERASABLE.
049992,002810: # 2. CALL CALL A SUBROUTINE, LEAVING RETURN IN QPRET.
049993,002811: # 3. RTB RETURN TO BASIC LANGUAGE AT THE GIVEN ADDRESS.
049994,002812: # 4. BHIZ BRANCH IF THE HIGHORDER OF MPAC IS ZERO (SINGLE PRECISION).
049995,002813: # 5. BOV BRANCH ON OVERFLOW.
049996,002814: # 6. GOTO SIMPLE SEQUENCE CHANGE.
049997,002815:
049998,002816: 01,2474 10020 RTB/BHIZ CCS CYR
049999,002817: 01,2475 30117 RTB CA POLISH
050000,002818: 01,2476 04701 TC SWCALL -1 # SO A "TC Q" FROM ROUTINE LEADS TO DANZIG
050001,002819:
050002,002820: 01,2477 10154 BHIZ CCS MPAC
050003,002821: 01,2500 16030 TCF DANZIG
050004,002822: 01,2501 16615 TCF GOTO
050005,002823: 01,2502 16030 TCF DANZIG
050006,002824: 01,2503 16615 TCF GOTO
050007,002825:
050008,002826: 01,2504 10121 BOV(B) CCS OVFIND # BRANCH ON OVERFLOW TO BASIC OR INTERP.
050009,002827: 01,2505 12507 TCF +2
050010,002828: 01,2506 16030 TCF DANZIG
050011,002829: 01,2507 54121 TS OVFIND
050012,002830: 01,2510 10020 CCS CYR
050013,002831: 01,2511 12475 TCF RTB # IF BASIC.
050014,002832: 01,2512 00360 B5TOBB OCT 360
050015,002833: 01,2513 16615 TCF GOTO
050016,002834:
050017,002835: 01,2514 10020 BZE/GOTO CCS CYR # SEE WHICH OP-CODE IS DESIRED.
050018,002836: 01,2515 06672 TC BRANCH # DO BZE.
050019,002837: 01,2516 16030 TCF DANZIG
050020,002838: 01,2517 16615 TCF GOTO # DO GOTO.
050021,002839: 01,2520 16030 TCF DANZIG
050022,002840:
050023,002841: 01,2521 10020 BPL/BMN CCS CYR
050024,002842: 01,2522 12530 TCF BPL
050025,002843: 01,2523 12000 5B10 DEC 5 B+10 # SHIFTS OP CODE IN SWITCH INSTRUCTION ADR
050026,002844:
050027,002845: 01,2524 06672 TC BRANCH # DO BMN.
050028,002846: 01,2525 16030 TCF DANZIG
050029,002847: 01,2526 16030 TCF DANZIG
050030,002848: 01,2527 16615 TCF GOTO # ONLY IF NNZ.
050031,002849:
050032,002850: 01,2530 06672 BPL TC BRANCH
050033,002851: 01,2531 16615 TCF GOTO # IF POSITIVE OR ZERO.
050034,002852: 01,2532 16615 TCF GOTO
050035,002853: 01,2533 16030 TCF DANZIG
050036,002854:
050037,002855: 01,2534 10020 CALL/ITA CCS CYR
050038,002856: 01,2535 16607 TCF CALL
050039,002857:
050040,002858: 01,2536 05753 TC CCSHOLE
050041,002859: 01,2537 02454 TC 15ADRERS # STORE QPRET. (TAGSUB AFTER 15ADRERS IS
050042,002860: 01,2540 50120 INDEX FIXLOC # SLOW IN THIS CASE, BUT SAVES STORAGE.)
050043,002861: 01,2541 30052 CA QPRET
050044,002862: 01,2542 12414 TCF MSTORE1
050045,002863:
050046,002864: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR ALTERING AND TESTING INTERPRETIVE SWITCHES:
050047,002865: # 00 BONSET SET A SWITCH AND DO A GOTO IF IT WAS ON.
050048,002866: # 01 SETGO SET A SWITCH AND DO A GOTO.
050049,002867: # 02 BOFSET SET A SWITCH AND DOA GOTO IF IT WAS OFF
050050,002868: # 03 SET SET A SWITCH.
050051,002869: # 04 BONINV INVERT A SWITCH AND BRANCH IF IT WAS ON.
050052,002870: # 05 INVGO INVERT A SWITCH AND DO A GOTO.
050053,002871: # 06 BOFINV INVERT A SWITCH AND BRANCH IF IT WAS OFF
050054,002872: # 07 INVERT INVERT A SWITCH.
050055,002873: # 10 BONCLR CLEAR A SWITCH AND BRANCH IF IT WAS ON.
050056,002874: # 11 CLRGO CLEAR A SWITCH AND DO A GOTO.
050057,002875: # 12 BOFCLR CLEAR A SWITCH AND BRANCH IF IT WAS OFF.
050058,002876: # 13 CLEAR CLEAR A SWITCH.
050059,002877: # 14 BON BRANCH IF A SWITCH WAS ON.
050060,002878: # 16 BOFF BRANCH IF A SWITCH WAS OFF.
050061,002879: # THE ADDRESS SUPPLIED WITH THE SWITCH INSTRUCTION IS INTERPRETED AS FOLLOWS:
050062,002880: # BITS 1-4 SWITCH BIT NUMBER (1-15).
050063,002881: # BITS 5-8 SWITCH OPERATION NUMBER.
050064,002882: # BITS 9- SWITCH WORD NUMBER (UP TO 64 SWITCH WORDS).
050065,002883: # THE ADDRESS ITSELF IS MADE UP BY THE YUL SYSTEM ASSEMBLER. THE BRANCH INSTRUCTIONS REQUIRE TWO
050066,002884: # ADDRESSES, THE SECOND TAKEN AS THE DIRECT (OR INDIRECT IF IN ERASABLE) ADDRESS OF THE BRANCH.
050067,002885:
050068,002886: 01,2543 35042 SWITCHES CAF LOW4 # LEAVE THE SWITCH BIT IN SWBIT.
050069,002887: 01,2544 70117 MASK POLISH
050070,002888: 01,2545 50000 INDEX A
050071,002889: 01,2546 35015 CAF BIT15 # (NUMBER FROM LEFT TO RIGHT.)
050072,002890: 01,2547 54131 TS SWBIT
050073,002891:
050074,002892: 01,2550 35025 CAF BIT7 # LEAVE THE SWITCH NUMBER IN SWWORD.
050075,002893: 01,2551 00006 EXTEND
050076,002894: 01,2552 70117 MP POLISH
050077,002895: 01,2553 54130 TS SWWORD
050078,002896:
050079,002897: 01,2554 00004 INHINT # DURING SWITCH CHANGE SO RUPT CAN USE TOO
050080,002898: 01,2555 50000 INDEX A # LEAVE THE SWITCH WORD ITSELF IN L.
050081,002899: 01,2556 30074 CA STATE
050082,002900: 01,2557 54002 TS Q # Q WILL BE USED AS A CHANNEL.
050083,002901: 01,2560 35021 CAF BIT11
050084,002902: 01,2561 00006 EXTEND # DISPATCH SWITCH BIT OPERATION AS IN BITS
050085,002903: 01,2562 70117 MP POLISH # 7-8 OF POLISH.
050086,002904: 01,2563 72623 MASK B3TOB4 # GETS 4X2-BIT CODE.
050087,002905: 01,2564 50000 INDEX A
050088,002906: 01,2565 12566 TCF +1
050089,002907:
050090,002908: 01,2566 30131 +1 CA SWBIT # 00 - SET SWITCH IN QUESTION.
050091,002909: 01,2567 00006 EXTEND
050092,002910: 01,2570 04002 ROR QCHAN
050093,002911: 01,2571 12600 TCF SWSTORE
050094,002912:
050095,002913: 01,2572 30131 +5 CA SWBIT # 01 - INVERT SWITCH.
050096,002914: 01,2573 00006 EXTEND
050097,002915: 01,2574 06002 RXOR QCHAN
050098,002916: 01,2575 12600 TCF SWSTORE
050099,002917:
050100,002918: 01,2576 40131 +9D CS SWBIT # 10 - CLEAR.
050101,002919: 01,2577 70002 MASK Q
050102,002920: 01,2600 50130 SWSTORE INDEX SWWORD
050103,002921: 01,2601 54074 TS STATE # NEW SWITCH WORD.
050104,002922:
050105,002923: 01,2602 00003 +13D RELINT # 11 - NOOP.
050106,002924: 01,2603 35017 CAF BIT13
050107,002925: 01,2604 00006 EXTEND # DISPATCH SEQUCE CHANGING OR BRANCHING
050108,002926: 01,2605 70117 MP POLISH # CODE.
050109,002927: 01,2606 72623 MASK B3TOB4
050110,002928: 01,2607 50000 INDEX A
050111,002929: 01,2610 12611 TCF +1 # ORIGINALLY STORED IN BITS 5-6.
050112,002930:
050113,002931: 01,2611 40002 +1 CS Q # 00 - BRANCH IF ON.
050114,002932: 01,2612 70131 TEST MASK SWBIT
050115,002933: 01,2613 10000 CCS A
050116,002934: 01,2614 12624 TCF SWSKIP
050117,002935:
050118,002936: 01,2615 16664 +5 TCF SWBRANCH # 01 - GO TO.
050119,002937:
050120,002938: 01,2616 12624 TCF SWSKIP # HERE ONLY ON BIT 15.
050121,002939:
050122,002940: 01,2617 05753 TC CCSHOLE
050123,002941: 01,2620 05753 TC CCSHOLE
050124,002942:
050125,002943: 01,2621 30002 +9D CA Q # 10 - BRANCH IF OFF.
050126,002944: 01,2622 12612 TCF TEST
050127,002945:
050128,002946: 01,2623 00014 B3TOB4 OCT 0014
050129,002947: 01,2624 24164 SWSKIP INCR LOC
050130,002948:
050131,002949: 01,2625 01,2543 SW/ EQUALS SWITCHES
050132,002950:
050133,002951: 01,2625 16030 +13D TCF DANZIG # 11 - NOOP.
End of include-file INTERPRETER.agc. Parent file is MAIN.agc