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