Source Code
These source-code files derive from a printout of Luminary 210 (Apollo 15-17
Lunar Module guidance computer program), from the personal library of
original AGC developer Don Eyles, digitally photographed at archive.org,
financially sponsored by Jim Lawton, and transcribed to source code by a
team of volunteers. This colorized, syntax-highlighted form was created
by assembling that transcribed source code. Note that the full page images
are available on the
Virtual AGC project page at archive.org, while reduced-size images
are presented at the VirtualAGC project website. Report or fix any
transcription errors at
the Virtual AGC project code repository. Notations on the program listing read, in part: GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY BY NASA 2021112-161 17:11 MAR. 19,1971Note that the date is the date of the printout, not the date of the program revision. |
043970,000002: ## Copyright: Public domain.
043971,000003: ## Filename: INTERPRETER.agc
043972,000004: ## Purpose: A section of Luminary revision 210.
043973,000005: ## It is part of the source code for the Lunar Module's (LM)
043974,000006: ## Apollo Guidance Computer (AGC) for Apollo 15-17.
043975,000007: ## This file is intended to be a faithful transcription, except
043976,000008: ## that the code format has been changed to conform to the
043977,000009: ## requirements of the yaYUL assembler rather than the
043978,000010: ## original YUL assembler.
043979,000011: ## Reference: pp. 1000-1092
043980,000012: ## Assembler: yaYUL
043981,000013: ## Contact: Ron Burkey <info@sandroid.org>.
043982,000014: ## Website: www.ibiblio.org/apollo/index.html
043983,000015: ## Mod history: 2016-11-17 JL Created from Luminary131 version.
043984,000016: ## 2016-12-03 MAS Started transcription.
043985,000017: ## 2016-12-07 MAS Completed transcription.
043986,000018: ## 2016-12-07 HG fix P00 -> POO (only in operand POODOO1)
043987,000019: ## 2016-12-26 RSB Comment-text proofed using ProoferComments
043988,000020: ## and corrected errors found.
043989,000021: ## 2017-01-28 RSB Back-ported some comment-text fixes made in Luminary 69.
043990,000022: ## 2017-02-05 RSB Back-ported comment corrections
043991,000023: ## identified while proofing Artemis 072.
043992,000024: ## 2017-03-15 RSB Comment-text fixes identified in 5-way
043993,000025: ## side-by-side diff of Luminary 69/99/116/131/210.
043994,000026: ## 2021-05-30 ABS B5TOBB -> B5TOB8
043995,000027:
Page 1000 |
043997,000029: # SECTION 1 DISPATCHER
043998,000030:
043999,000031: # ENTRY TO THE INTERPRETER. INTPRET SETS LOC TO THE FIRST INSTRUCTION, BANKSET TO THE BBANK OF THE
044000,000032: # OBJECT INTERPRETIVE PROGRAM, AND INTBIT15 TO THE BIT15 CONTENTS OF FBANK. INTERPRETIVE PROGRAMS MAY BE IN
044001,000033: # VIRTUALLY ALL BANKS PRESENT UNDER ANY SUPER-BANK SETTING, WITH THE RESTRICTION THAT PROGRAMS IN HIGH BANKS
044002,000034: # (BIT15 OF FBANK = 1) DO NOT REFER TO LOWBANKS, AND VICE-VERSA. THE INTERPRETER DOES NOT SWITCH SUPERBANKS.
044003,000035: # E-BANK SWITCHING OCCURS WHENEVER GENERAL ERASABLE (100 - 3777) IS ADDRESSED.
044004,000036:
044005,000037: 6060 BLOCK 03
044006,000038:
044007,000039: 6060 COUNT* $$/INTER
044008,000040: 6060 00003 INTPRET RELINT
044009,000041: 6061 00006 EXTEND # SET LOC TO THE WORD FOLLOWING THE TC.
044010,000042: 6062 22164 QXCH LOC
044011,000043:
044012,000044: 6063 30006 +2 CA BBANK # INTERPRETIVE BRANCHES FINISH HERE.
044013,000045: 6064 54165 TS BANKSET
044014,000046: 6065 74726 MASK BIT15 # GET 15TH BIT FOR INDEXABLE ADDRESSES.
044015,000047: 6066 54115 TS INTBIT15
044016,000048:
044017,000049: 6067 54023 TS EDOP # MAKE SURE NO INSTRUCTIONS LEFT OVER
044018,000050:
044019,000051: 6070 16111 TCF NEWOPS # PICK UP OP CODE PAIR AND BEGIN.
044020,000052:
044021,000053:
044022,000054: 6071 22006 INTRSM LXCH BBANK # RESUME SUSPENDED INTERPRETIVE JOB
044023,000055: 6072 16063 TCF INTPRET +3
044024,000056: # DLOAD LOADS MPAC, MPAC +1, LEAVING ZERO IN MPAC +2.
044025,000057:
044026,000058: 6073 00006 DLOAD EXTEND
044027,000059: 6074 50116 INDEX ADDRWD
044028,000060: 6075 30001 DCA 0 # LOAD DP C(C(ADDRWD)) INTO MPAC,MPAX +1
044029,000061: 6076 52155 SLOAD2 DXCH MPAC
044030,000062: 6077 34746 CAF ZERO # ZERO MPAC +2
044031,000063:
Page 1001 |
044033,000065: # AT THE END OF MOST INSTRUCTIONS, CONTROL IS GIVEN TO DANZIG TO DISPATCH THE NEXT OPERATION.
044034,000066:
044035,000067: 6100 54156 TS MPAC +2 # AND DECLARE DP MODE
044036,000068:
044037,000069: 6101 54163 NEWMODE TS MODE # PROLOGUE FOR MODE-CHANGING INSTRUCTIONS.
044038,000070:
044039,000071: 6102 30165 DANZIG CA BANKSET # SET BBANK BEFORE TESTING NEWJOB SO THAT
044040,000072: 6103 54006 TS BBANK # IT MAY BE SAVED DIRECTLY BY CHANJOB.
044041,000073:
044042,000074: 6104 10023 NOIBNKSW CCS EDOP # SEE IF AN ORDER CODE IS LEFT OVER FROM
044043,000075: 6105 16120 TCF OPJUMP # THE LAST PAIR RETRIEVED. IF SO, EXECUTE.
044044,000076: # EDOP IS SET TO ZERO ON ITS RE-EDITING.
044045,000077:
044046,000078: 6106 10067 CCS NEWJOB # SEE IF A JOB OF HIGHER PRIORITY IS
044047,000079: 6107 15117 TCF CHANG2 # PRESENT, AND IF SO, CHANGE JOBS.
044048,000080:
044049,000081: 6110 24164 INCR LOC # ADVANCE THE LOCATION COUNTER.
044050,000082: # ITRACE (1) REFERS TO "NEWOPS".
044051,000083: 6111 50164 NEWOPS INDEX LOC # ENTRY TO BEGIN BY PICKING OP CODE PAIR.
044052,000084: 6112 30000 CA 0 # MAY BE AN OPCODE PAIR OR A STORE CODE.
044053,000085: 6113 10000 CCS A # TEST SIGN AND GET DABS(A).
044054,000086: 6114 16403 TCF DOSTORE # PROCESS STORE CODE.
044055,000087:
044056,000088: 6115 00177 LOW7 OCT 177
044057,000089:
044058,000090: 6116 54023 TS EDOP # OP CODE PAIR. LEAVE THE OTHER IN EDOP
044059,000091: 6117 76115 MASK LOW7 # WHERE CCS EDOP WILL HONOR IT NEXT.
044060,000092:
044061,000093: 6120 54020 OPJUMP TS CYR # LOWWD ENTERS HERE IF A RIGHT-HAND OP
044062,000094: 6121 10020 CCS CYR # CODE IS TO BE PROCESSED. TEST PREFICES.
044063,000095: 6122 16270 TCF OPJUMP2 # TEST SECOND PREFIX BIT.
044064,000096:
044065,000097: 6123 16764 TCF EXIT # +0 OP CODE IS EXIT.
044066,000098:
Page 1002 |
044068,000100: # PROCESS ADDRESSES WHICH MAY BE DIRECT, INDEXED, OR REFERENCE THE PUSHDOWN LIST.
044069,000101:
044070,000102: 6124 74744 ADDRESS MASK BIT1 # SEE IF ADDRESS IS INDEXED. CYR CONTAINED
044071,000103: 6125 10000 CCS A # 400XX, SO BIT 1 IS NOW AS IT WAS IN CYR.
044072,000104: 6126 16167 TCF INDEX # FORM INDEXED ADDRESS.
044073,000105:
044074,000106: 6127 50164 DIRADRES INDEX LOC # LOOK AHEAD TO NEXT WORD TO SEE IF
044075,000107: 6130 40001 OCT40001 CS 1 # ADDRESS IS GIVEN.
044076,000108: 6131 10000 CCS A
044077,000109: 6132 16236 TCF PUSHUP # IF NOT.
044078,000110:
044079,000111: 6133 77773 NEG4 DEC -4 B-14
044080,000112:
044081,000113: 6134 24164 INCR LOC # IF SO, TO SHOW WE PICKED UP A WORD.
044082,000114: 6135 54116 TS ADDRWD
044083,000115:
Page 1003 |
044085,000117: # FINAL DIGESTION OF DIRECT ADDRESSES OF OP CODES WITH 01 PREFIX IS DONE HERE. IN EACH CASE, THE
044086,000118: # REQUIRED 12-BIT SUB-ADDRESS IS LEFT IN ADDRWD, WITH ANY REQUIRED E OR F BANK SWITCHING DONE. ADDRESSES LESS
044087,000119: # 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.
044088,000120:
044089,000121: 6136 66272 AD -ENDVAC # SEE IF ADDRESS RELATIVE TO WORK AREA.
044090,000122: 6137 10000 CCS A
044091,000123: 6140 67764 AD -ENDERAS # IF NOT, SEE IF IN GENERAL ERASABLE.
044092,000124: 6141 16146 TCF IERASTST
044093,000125:
044094,000126: 6142 30120 NETZERO CA FIXLOC # IF SO, LEAVE THE MODIFIED ADDRESS IN
044095,000127: 6143 26116 ADS ADDRWD # ADDRWD AND DISPATCH.
044096,000128: 6144 50020 ITR15 INDEX CYR # THIS INDEX MAKES THE NEXT INSTRUCTION
044097,000129: 6145 76314 7 INDJUMP -1 # TCF INDJUMP + OP, EDITING CYR.
044098,000130:
044099,000131: 6146 00006 IERASTST EXTEND
044100,000132: 6147 66157 BZMF GEADDR # GO PROCESS GENERAL-ERASABLE ADDRESS.
044101,000133:
044102,000134: 6150 75003 MASK LOW10 # FIXED BANK ADDRESS. RESTORE AND ADD B15.
044103,000135: 6151 65003 AD LOW10 # SWITCH BANKS AND LEAVE SUBADDRESS IN
044104,000136: 6152 56116 XCH ADDRWD # ADDRWD FOR OPERAND RETRIEVAL. (THIS
044105,000137: 6153 60115 AD INTBIT15 # METHOD PRECLUDES USE OF THE LAST
044106,000138: 6154 54004 TS FBANK # LOCATION IN EACH FBANK.)
044107,000139: 6155 50020 ITR12 INDEX CYR
044108,000140: 6156 76314 7 INDJUMP -1
044109,000141:
044110,000142: 6157 74350 GEADDR MASK LOW8
044111,000143: 6160 65000 AD OCT1400
044112,000144: 6161 56116 XCH ADDRWD
044113,000145: 6162 54003 TS EBANK
044114,000146: 6163 50020 ITR10 INDEX CYR
044115,000147: 6164 76314 7 INDJUMP -1
044116,000148:
Page 1004 |
044118,000150: # THE FOLLOWING ROUTINE PROCESSES INTERPRETIVE INDEXED ADDRESSES. AN INTERPRETER INDEX REGISTER MAY
044119,000151: # CONTAIN THE ADDRESS OF ANY ERASABLE REGISTER (0-42 BEING RELATIVE TO THE VAC AREA) OR ANY INTERPRETIVE PROGRAM
044120,000152: # BANK, OR ANY INTEGER IN THAT RANGE.
044121,000153:
044122,000154: 6165 37754 DODLOAD* CAF DLOAD* # STODL* COMES HERE TO PROCESS LOAD ADR.
044123,000155: 6166 54020 TS CYR # (STOVL* ENTERS HERE).
044124,000156:
044125,000157: 6167 30120 INDEX CA FIXLOC # SET UP INDEX LOCATION.
044126,000158: 6170 54130 TS INDEXLOC
044127,000159: 6171 24164 INCR LOC # (ADDRESS ALWAYS GIVEN).
044128,000160: 6172 50164 INDEX LOC
044129,000161: 6173 40000 CS 0
044130,000162: 6174 10000 CCS A # INDEX 2 IF ADDRESS STORED COMPLEMENTED.
044131,000163: 6175 24130 INCR INDEXLOC
044132,000164: 6176 16177 NOOP
044133,000165:
044134,000166: 6177 54116 TS ADDRWD # 14 BIT ADDRESS TO ADDRWD.
044135,000167: 6200 77763 MASK HIGH4 # IF ADDRESS GREATER THAN 2K, ADD INTBIT15
044136,000168: 6201 00006 EXTEND
044137,000169: 6202 16205 BZF INDEX2
044138,000170: 6203 30115 CA INTBIT15
044139,000171: 6204 26116 ADS ADDRWD
044140,000172:
044141,000173: 6205 50130 INDEX2 INDEX INDEXLOC
044142,000174: 6206 40046 CS X1
044143,000175: 6207 26116 ADS ADDRWD # DO AUGMENT, IGNORING AND CORRECTING OVF.
044144,000176:
044145,000177: 6210 77765 MASK HIGH9 # SEE IF ADDRESS IS IN WORK AREA.
044146,000178: 6211 00006 EXTEND
044147,000179: 6212 16225 BZF INDWORK
044148,000180: 6213 77763 MASK HIGH4 # SEE IF IN FIXED BANK.
044149,000181: 6214 00006 EXTEND
044150,000182: 6215 16227 BZF INDERASE
044151,000183:
044152,000184: 6216 30116 CA ADDRWD # IN FIXED - SWITCH BANKS AND CREATE
044153,000185: 6217 54004 TS FBANK # SUB-ADDRESS.
044154,000186: 6220 75003 MASK LOW10
044155,000187: 6221 64732 AD 2K
044156,000188: 6222 54116 TS ADDRWD
044157,000189: 6223 50020 ITR11 INDEX CYR
044158,000190: 6224 36314 3 INDJUMP -1
044159,000191:
044160,000192: 6225 30120 INDWORK CA FIXLOC # MAKE ADDRWD RELATIVE TO WORK AREA.
044161,000193: 6226 16233 TCF ITR13 -1
044162,000194:
044163,000195: 6227 35000 INDERASE CA OCT1400
044164,000196: 6230 56116 XCH ADDRWD
044165,000197: 6231 54003 TS EBANK
044166,000198: 6232 74350 MASK LOW8
044167,000199: 6233 26116 -1 ADS ADDRWD
Page 1005 |
044169,000201: 6234 50020 ITR13 INDEX CYR
044170,000202: 6235 36314 3 INDJUMP -1
044171,000203:
Page 1006 |
044173,000205: # PUSH-UP ROUTINES. WHEN NO OPERAND ADDRESS IS GIVEN, THE APPROPRIATE OPERAND IS TAKEN FROM THE PUSH-DOWN
044174,000206: # LIST. IN MOST CASES THE MODE OF THE RESULT (VECTOR OR SCALAR) OF THE LAST ARITHMETIC OPERATION PERFORMED
044175,000207: # IS THE SAME AS THE TYPE OF OPERAND DESIRED (ALL ADD/SUBTRACT ETC.). EXCEPTIONS TO THIS GENERAL RULE ARE LISTED
044176,000208: # BELOW (NOTE THAT IN EVERY CASE THE MODE REGISTER IS LEFT INTACT):
044177,000209:
044178,000210: # 1. VXSC AND V/SC WANT THE OPPOSITE TYPE OF OPERAND, E.G., IF THE LAST OPERATION YIELDED A VECTOR
044179,000211: # RESULT, VXSC WANTS A SCALAR.
044180,000212:
044181,000213: # 2. THE LOAD CODES SHOULD LOAD THE ACCUMULATOR INDEPENDENT OF THE RESULT OF THE LAST OPERATION. THIS
044182,000214: # INCLUDES VLOAD, DLOAD, TLOAD, PDDL, AND PDVL (NO PUSHUP WITH SLOAD).
044183,000215:
044184,000216: # 3. SOME ARITHMETIC OPERATIONS REQUIRE A STANDARD TYPE OF OPERAND REGARDLESS OF THE PREVIOUS OPERATION.
044185,000217: # THIS INCLUDES SIGN WANTING DP AND TAD REQUIRING TP.
044186,000218:
044187,000219: 6236 34351 PUSHUP CAF OCT23 # IF THE LOW 5 BITS OF CYR ARE LESS THAN
044188,000220: 6237 70020 MASK CYR # 20, THIS OP REQUIRES SPECIAL ATTENTION.
044189,000221: 6240 66243 AD -OCT10 # (NO -0).
044190,000222: 6241 10000 CCS A
044191,000223: 6242 16254 TCF REGUP # FOR ALL CODES GREATER THAN OCT 7.
044192,000224:
044193,000225: 6243 77767 -OCT10 OCT -10
044194,000226:
044195,000227: 6244 66133 AD NEG4 # WE NOW HAVE 7 - OP CODE(MOD4). SEE IF
044196,000228: 6245 10000 CCS A # THE OP CODE (MOD4) IS THREE (REVERSE).
044197,000229: 6246 50000 INDEX A # NO - THE MODE IS DEFINITE. PICK UP THE
044198,000230: 6247 46265 CS NO.WDS
044199,000231: 6250 16256 TCF REGUP +2
044200,000232:
044201,000233: 6251 50163 INDEX MODE # FOR VXSC AND V/SC WE WANT THE REQUIRED
044202,000234: 6252 46263 CS REVCNT # PUSHLOC DECREMENT WITHOUT CHANGING THE
044203,000235: 6253 16256 TCF REGUP +2 # MODE AT THIS TIME.
044204,000236:
044205,000237: 6254 50163 REGUP INDEX MODE # MOST ALL OP CODES PUSHUP HERE.
044206,000238: 6255 46265 CS NO.WDS
044207,000239: 6256 26166 +2 ADS PUSHLOC
044208,000240: 6257 54116 TS ADDRWD
044209,000241: 6260 50020 ITR14 INDEX CYR
044210,000242: 6261 76314 7 INDJUMP -1 # (THE INDEX MAKES THIS A TCF.)
044211,000243:
044212,000244: 6262 00002 OCT 2 # REVERSE PUSHUP DECREMENT. VECTOR TAKES 2
044213,000245: 6263 00006 REVCNT OCT 6 # WORDS, SCALAR TAKES 6.
044214,000246: 6264 00006 OCT 6
044215,000247: 6265 00002 NO.WDS OCT 2 # CONVENTIONAL DECREMENT IS 6 WORDS VECTOR
044216,000248: 6266 00003 OCTAL3 OCT 3 # 2 IN DP, AND 3 IN TP.
044217,000249: 6267 00006 OCT 6
044218,000250:
Page 1007 |
044220,000252: # TEST THE SECOND PREFIX BIT TO SEE IF THIS IS A MISCELLANEOUS OR A UNARY/SHORT SHIFT OPERATION.
044221,000253:
044222,000254: 6270 10020 OPJUMP2 CCS CYR # TEST SECOND PREFIX BIT.
044223,000255: 6271 16304 TCF OPJUMP3 # TEST THIRD BIT TO SEE IF UNARY OR SHIFT.
044224,000256:
044225,000257: 6272 77722 -ENDVAC DEC -45 B-14
044226,000258:
044227,000259: # THE FOLLOWING ROUTINE PROCESSES ADDRESSES OF SUFFIX CLASS 10. THEY ARE BASICALLY WORK AREA ADDRESSES
044228,000260: # IN THE RANGE 0 - 52, ERASABLE ECADR CONSTANTS FROM 100 - 3777, AND FCADRS ABOVE THAT. ALL 15 BITS ARE AVAILABLE
044229,000261: # IN CONTRAST TO SUFFIX 1, IN WHICH ONLY THE LOW ORDER 14 ARE AVAILABLE.
044230,000262:
044231,000263: 6273 24164 15BITADR INCR LOC # (ENTRY HERE FROM STCALL).
044232,000264: 6274 50164 INDEX LOC # PICK UP ADDRESS WORD.
044233,000265: 6275 30000 CA 0
044234,000266: 6276 54117 TS POLISH # WE MAY NEED A SUBADDRESS LATER.
044235,000267:
044236,000268: 6277 35004 CAF LOW7+2K # THESE INSTRUCTIONS ARE IN BANK 1.
044237,000269: 6300 54004 TS FBANK
044238,000270: 6301 70020 MASK CYR
044239,000271: 6302 50000 ITR7 INDEX A
044240,000272: 6303 16355 TCF MISCJUMP
044241,000273:
Page 1008 |
044243,000275: # COMPLETE THE DISPATCHING OF UNARY AND SHORT SHIFT OPERATIONS.
044244,000276:
044245,000277: 6304 54004 OPJUMP3 TS FBANK # CALL IN BANK 0 (BITS 11-15 OF A ARE 0.)
044246,000278: # ITRACE (6) REFERS TO "OPJUMP3".
044247,000279: 6305 10020 CCS CYR # TEST THIRD PREFIX BIT.
044248,000280: 6306 50000 INDEX A # THE DECREMENTED UNARY CODE IS IN BITS
044249,000281: 6307 12000 TCF UNAJUMP # 1-4 OF A (ZERO, EXIT, HAS BEEN DETECTED)
044250,000282:
044251,000283: 6310 10163 CCS MODE # ITS A SHORT SHIFT CODE. SEE IF PRESENT
044252,000284: 6311 12017 TCF SHORTT # SCALAR OR VECTOR.
044253,000285: 6312 12017 TCF SHORTT
044254,000286: 6313 12121 TCF SHORTV # CALLS THE APPROPRIATE ROUTINE.
044255,000287:
044256,000288: 6314 4341 FBANKMSK EQUALS BANKMASK
044257,000289: 6314 00122 LVBUF ADRES VBUF
044258,000290:
Page 1009 |
044260,000292: # THE FOLLOWING IS THE JUMP TABLE FOR OP CODES WHICH MAY HAVE INDEXABLE ADDRESSES OR MAY PUSH UP.
044261,000293:
044262,000294: 6315 16526 INDJUMP TCF VLOAD # 00 - LOAD MPAC WITH A VECTOR.
044263,000295: 6316 17112 TCF TAD # 01 - TRIPLE PRECISION ADD TO MPAC.
044264,000296: 6317 17676 TCF SIGN # 02 - COMPLEMENT MPAC (V OR SC) IF X NEG.
044265,000297: 6320 17422 TCF VXSC # 03 - VECTOR TIMES SCALAR.
044266,000298: 6321 16724 TCF CGOTO # 04 - COMPUTED GO TO.
044267,000299: 6322 16511 TCF TLOAD # 05 - LOAD MPAC WITH TRIPLE PRECISION.
044268,000300: 6323 16073 TCF DLOAD # 06 - LOAD MPAC WITH A DP SCALAR.
044269,000301: 6324 17645 TCF V/SC # 07 - VECTOR DIVIDED BY SCALAR.
044270,000302:
044271,000303: 6325 16522 TCF SLOAD # 10 - LOAD MPAC IN SINGLE PRECISION.
044272,000304: 6326 16641 TCF SSP # 11 - SET SINGLE PRECISION INTO X.
044273,000305: 6327 16544 TCF PDDL # 12 - PUSH DOWN MPAC AND RE-LOAD IN DP.
044274,000306: 6330 17355 TCF MXV # 13 - MATRIX POST-MULTIPLIED BY VECTOR.
044275,000307: 6331 16600 TCF PDVL # 14 - PUSH DOWN AND VECTOR LOAD.
044276,000308: 6332 16647 TCF CCALL # 15 - COMPUTED CALL.
044277,000309: 6333 17360 TCF VXM # 16 - MATRIX PRE-MULTIPLIED BY VECTOR.
044278,000310: 6334 17637 TCF TSLC # 17 - NORMALIZE MPAC (SCALAR ONLY).
044279,000311:
044280,000312: 6335 17615 TCF DMPR # 20 - DP MULTIPLY AND ROUND.
044281,000313: 6336 17620 TCF DDV # 21 - DP DIVIDE BY.
044282,000314: 6337 17624 TCF BDDV # 22 - DP DIVIDE INTO.
044283,000315: 6340 17642 TCF GSHIFT # 23 - GENERAL SHIFT INSTRUCTION.
044284,000316: 6341 16772 TCF VAD # 24 - VECTOR ADD.
044285,000317: 6342 16770 TCF VSU # 25 - VECTOR SUBTRACT.
044286,000318: 6343 17057 TCF BVSU # 26 - VECTOR SUBTRACT FROM.
044287,000319: 6344 17352 TCF DOT # 27 - VECTOR DOT PRODUCT.
044288,000320:
044289,000321: 6345 17501 TCF VXV # 30 - VECTOR CROSS PRODUCT.
044290,000322: 6346 17446 TCF VPROJ # 31 - VECTOR PROJECTION.
044291,000323: 6347 17026 TCF DSU # 32 - DP SUBTRACT.
044292,000324: 6350 17103 TCF BDSU # 33 - DP SUBTRACT FROM.
044293,000325: 6351 17016 TCF DAD # 34 - DP ADD.
044294,000326: 6352 16352 TCF +0 # 35 - AVAILABLE
044295,000327: 6353 17613 TCF DMP1 # 36 - DP MULTIPLY.
044296,000328: 6354 17634 TCF SETPD # 37 - SET PUSH DOWN POINTER (DIRECT ONLY)
044297,000329:
044298,000330: # CODES 10 AND 14 MUST NOT PUSH UP. CODE 04 MAY BE USED FOR VECTOR DECLARE BEFORE PUSHUP IF DESIRED.
044299,000331:
Page 1010 |
044301,000333: # THE FOLLOWING JUMP TABLE APPLIES TO INDEX, BRANCH, AND MISCELLANEOUS INSTRUCTIONS.
044302,000334:
044303,000335: 6355 12350 MISCJUMP TCF AXT # 00 - ADDRESS TO INDEX TRUE.
044304,000336: 6356 12355 TCF AXC # 01 - ADDRESS TO INDEX COMPLEMENTED.
044305,000337: 6357 12360 TCF LXA # 02 - LOAD INDEX FROM ERASABLE.
044306,000338: 6360 12364 TCF LXC # 03 - LOAD INDEX FROM COMPLEMENT OF ERAS.
044307,000339: 6361 12370 TCF SXA # 04 - STORE INDEX IN ERASABLE.
044308,000340: 6362 12376 TCF XCHX # 05 - EXCHANGE INDEX WITH ERASABLE.
044309,000341: 6363 12412 TCF INCR # 06 - INCREMENT INDEX REGISTER.
044310,000342: 6364 12421 TCF TIX # 07 - TRANSFER ON INDEX.
044311,000343:
044312,000344: 6365 12404 TCF XAD # 10 - INDEX REGISTER ADD FROM ERASABLE.
044313,000345: 6366 12415 TCF XSU # 11 - INDEX SUBTRACT FROM ERASABLE.
044314,000346: 6367 12473 TCF BZE/GOTO # 12 - BRANCH ZERO AND GOTO.
044315,000347: 6370 12500 TCF BPL/BMN # 13 - BRANCH PLUS AND BRANCH MINUS.
044316,000348: 6371 12453 TCF RTB/BHIZ # 14 - RETURN TO BASIC AND BRANCH HI ZERO.
044317,000349: 6372 12513 TCF CALL/ITA # 15 - CALL AND STORE QPRET.
044318,000350: 6373 12522 TCF SW/ # 16 - SWITCH INSTRUCTIONS AND AVAILABLE.
044319,000351: 6374 12463 TCF BOV(B) # 17 - BRANCH ON OVERFLOW TO BASIC OR INT.
044320,000352:
Page 1011 |
044322,000354: # THE FOLLOWING JUMP TABLE APPIES TO UNARY INSTRUCTIONS.
044323,000355:
044324,000356: 6375 COUNT* $$/INTER
044325,000357: 00,2000 BANK 0 # 00 - EXIT - DETECTED EARLIER.
044326,000358: 00,2000 13207 UNAJUMP TCF SQRT # 01 - SQUARE ROOT.
044327,000359: 00,2001 13530 TCF SINE # 02 - SIN.
044328,000360: 00,2002 13517 TCF COSINE # 03 - COS.
044329,000361: 00,2003 13610 TCF ARCSIN # 04 - ARC SIN.
044330,000362: 00,2004 13612 TCF ARCCOS # 05 - ARC COS.
044331,000363: 00,2005 13174 TCF DSQ # 06 - DP SQUARE.
044332,000364: 00,2006 12116 TCF ROUND # 07 - ROUND TO DP.
044333,000365:
044334,000366: 00,2007 17711 TCF COMP # 10 - COMPLEMENT VECTOR OR SCALAR.
044335,000367: 00,2010 13232 TCF VDEF # 11 - VECTOR DEFINE.
044336,000368: 00,2011 13023 TCF UNIT # 12 - UNIT VECTOR.
044337,000369: 00,2012 13176 TCF ABVALABS # 13 - LENGTH OF VECTOR OR MAG OF SCALAR.
044338,000370: 00,2013 13245 TCF VSQ # 14 - SQUARE OF LENGTH OF VECTOR.
044339,000371: 00,2014 16375 TCF STADR # 15 - PUSH UP ON STORE CODE.
044340,000372: 00,2015 13274 TCF RVQ # 16 - RETURN VIA QPRET.
044341,000373: 00,2016 13247 TCF PUSH # 17 - PUSH MPAC DOWN.
044342,000374:
Page 1012 |
044344,000376: # SECTION 2 LOAD AND STORE PACKAGE.
044345,000377:
044346,000378: # A SET OF EIGHT STORE CODES IS PROVIDED AS THE PRIMARY METHOD OF STORING THE MULTI-PURPOSE
044347,000379: # ACCUMULATOR (MPAC). IF IN THE DANZIG SECTION LOC REFERS TO AN ALGEBRAICALLY POSITIVE WORD, IT IS TAKEN AS A
044348,000380: # STORE CODE WITH A CORRESPONDING ERASABLE ADDRESS. MOST OF THESE CODES ARE TWO ADDRESS, SPECIFYING THAT THE WORD
044349,000381: # FOLLOWING THE STORE CODE IS TO BE USED AS AN ADDRESS FROM WHICH TO RE-LOAD MPAC. FOUR OPTIONS ARE AVAILABLE:
044350,000382:
044351,000383: # 1. STORE STORE MPAC. THE E ADDRESS MAY BE INDEXED.
044352,000384: # 2. STODL STORE MPAC AND RE-LOAD IT IN DP WITH THE NEXT ADDRESS (THE LOAD MAY BE INDEXED).
044353,000385: # 3. STOVL STORE MPAC AND RE-LOAD A VECTOR (AS ABOVE).
044354,000386: # 4. STCALL STORE AND DO A CALL (BOTH ADDRESSES MUST BE DIRECT HERE).
044355,000387:
044356,000388: # STODL AND STOVL WILL TAKE FROM THE PUSH-DOWN LIST IF NO LOAD ADDRESS IS GIVEN.
044357,000389:
044358,000390: 6375 BLOCK 3
044359,000391:
044360,000392: 6375 COUNT* $$/INTER
044361,000393: 6375 30165 STADR CA BANKSET # THE STADR CODE (PUSHUP UP ON STORE
044362,000394: 6376 54004 TS FBANK # ADDRESS) ENTERS HERE.
044363,000395: 6377 24164 INCR LOC
044364,000396: 6400 50164 ITR1 INDEX LOC # THE STORECODE WAS STORED COMPLEMENTED TO
044365,000397: 6401 40000 CS 0 # MAKE IT LOOK LIKE AN OPCODE PAIR.
044366,000398: 6402 67770 AD NEGONE # (YUL CANT REMOVE 1 BECAUSE OF EARLY CCS)
044367,000399:
044368,000400: 6403 54116 DOSTORE TS ADDRWD
044369,000401: 6404 74347 MASK LOW11 # ENTRY FROM DISPATCHER. SAVE THE ERASABLE
044370,000402: 6405 56116 XCH ADDRWD # ADDRESS AND JUMP ON THE STORE CODE NO.
044371,000403: 6406 77743 MASK B12T14
044372,000404: 6407 00006 EXTEND
044373,000405: 6410 74740 MP BIT5 # EACH TRANSFER VECTOR ENTRY IS TWO WORDS.
044374,000406: 6411 50000 ITR0 INDEX A
044375,000407: 6412 16413 TCF STORJUMP
044376,000408:
Page 1013 |
044378,000410: # STORE CODE JUMP TABLE. CALLS THE APPROPRIATE STORING ROUTINE AND EXITS TO DANZIG OR TO ADDRESS WITH
044379,000411: # A SUPPLIED OPERATION CODE.
044380,000412:
044381,000413: # STORE STORE,1 AND STORE,2 RETURN TO DANZIG, THUS RESETTING THE EBANK TO ITS STATE AT INTPRET.
044382,000414:
044383,000415: 6413 06443 STORJUMP TC STORE # STORE.
044384,000416: 6414 16102 TCF DANZIG # PICK UP NEW OP CODE(S).
044385,000417: 6415 06435 TC STORE,1
044386,000418: 6416 16102 TCF DANZIG
044387,000419: 6417 06440 TC STORE,2
044388,000420: 6420 16102 TCF DANZIG
044389,000421:
044390,000422: 6421 06443 TC STORE # STODL.
044391,000423: 6422 16501 TCF DODLOAD
044392,000424:
044393,000425: 6423 06443 TC STORE # STODL WITH INDEXED LOAD ADDRESS.
044394,000426: 6424 16165 TCF DODLOAD*
044395,000427:
044396,000428: 6425 06443 TC STORE # STOVL.
044397,000429: 6426 16504 TCF DOVLOAD
044398,000430:
044399,000431: 6427 06443 TC STORE # STOVL WITH INDEXED LOAD ADDRESS.
044400,000432: 6430 16507 TCF DOVLOAD*
044401,000433: 6431 06443 TC STORE # STOTC.
044402,000434: 6432 34757 CAF CALLCODE
044403,000435: 6433 54020 TS CYR
044404,000436: 6434 16273 TCF 15BITADR # GET A 15 BIT ADDRESS.
044405,000437:
Page 1014 |
044407,000439: # STORE CODE ADDRESS PROCESSOR.
044408,000440:
044409,000441: 6435 50120 STORE,1 INDEX FIXLOC
044410,000442: 6436 40046 CS X1
044411,000443: 6437 16442 TCF PRESTORE
044412,000444:
044413,000445: 6440 50120 STORE,2 INDEX FIXLOC
044414,000446: 6441 40047 CS X2
044415,000447: 6442 26116 PRESTORE ADS ADDRWD # RESULTANT ADDRESS IS IN ERASABLE.
044416,000448:
044417,000449: 6443 40116 STORE CS ADDRWD
044418,000450: 6444 64763 AD DEC45
044419,000451: 6445 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
044420,000452: 6446 30120 CA FIXLOC # YES.
044421,000453: 6447 16454 TCF AHEAD5
044422,000454: 6450 35000 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
044423,000455: 6451 56116 XCH ADDRWD
044424,000456: 6452 54003 TS EBANK
044425,000457: 6453 74350 MASK LOW8
044426,000458: 6454 26116 AHEAD5 ADS ADDRWD
044427,000459:
Page 1015 |
044429,000461: # STORING ROUTINES. STORE DP, TP, OR VECTOR AS INDICATED BY MODE.
044430,000462:
044431,000463: 6455 00006 STARTSTO EXTEND # MPAC,+1 MUST BE STORED IN ANY EVENT.
044432,000464: # ITRACE (5) REFERS TO "STARTSTO".
044433,000465: 6456 30155 DCA MPAC
044434,000466: 6457 50116 INDEX ADDRWD
044435,000467: 6460 52001 DXCH 0
044436,000468:
044437,000469: 6461 10163 CCS MODE
044438,000470: 6462 16475 TCF TSTORE
044439,000471: 6463 00002 TC Q
044440,000472:
044441,000473: 6464 00006 VSTORE EXTEND
044442,000474: 6465 30160 DCA MPAC +3
044443,000475: 6466 50116 INDEX ADDRWD
044444,000476: 6467 52003 DXCH 2
044445,000477:
044446,000478: 6470 00006 EXTEND
044447,000479: 6471 30162 DCA MPAC +5
044448,000480: 6472 50116 INDEX ADDRWD
044449,000481: 6473 52005 DXCH 4
044450,000482: 6474 00002 TC Q
044451,000483:
044452,000484: 6475 30156 TSTORE CA MPAC +2
044453,000485: 6476 50116 INDEX ADDRWD
044454,000486: 6477 54002 TS 2
044455,000487: 6500 00002 TC Q
044456,000488:
Page 1016 |
044458,000490: # ROUTINES TO BEGIN PROCESSING OF THE SECOND ADDRESS ASSOCIATED WITH ALL STORE-TYPE CODES EXCEPT STORE
044459,000491: # ITSELF.
044460,000492:
044461,000493: 6501 37753 DODLOAD CAF DLOADCOD
044462,000494: 6502 54020 TS CYR
044463,000495: 6503 16127 TCF DIRADRES # GO GET A DIRECT ADDRESS.
044464,000496:
044465,000497: 6504 34726 DOVLOAD CAF VLOADCOD
044466,000498: 6505 54020 TS CYR
044467,000499: 6506 16127 TCF DIRADRES
044468,000500:
044469,000501: 6507 36130 DOVLOAD* CAF VLOAD*
044470,000502: 6510 16166 TCF DODLOAD* +1 # PROLOGUE TO INDEX ROUTINE.
044471,000503:
Page 1017 |
044473,000505: # THE FOLLOWING LOAD INSTRUCTIONS ARE PROVIDED FOR LOADING THE MULTI-PURPOSE ACCUMULATOR MPAC.
044474,000506:
044475,000507: 6511 50116 TLOAD INDEX ADDRWD
044476,000508: 6512 30002 CA 2 # LOAD A TRIPLE PRECISION ARGUMENT INTO
044477,000509: 6513 54156 TS MPAC +2 # THE FIRST THREE MPAC REGISTERS, WITH THE
044478,000510: 6514 00006 EXTEND # CONTENTS OF THE OTHER FOUR IRRELEVANT.
044479,000511: 6515 50116 INDEX ADDRWD
044480,000512: 6516 30001 DCA 0
044481,000513: 6517 52155 DXCH MPAC
044482,000514: 6520 34744 TMODE CAF ONE
044483,000515: 6521 16101 TCF NEWMODE # DECLARE TRIPLE PRECISION MODE.
044484,000516:
044485,000517: 6522 22007 SLOAD ZL # LOAD A SINGLE PRECISION NUMBER INTO
044486,000518: 6523 50116 INDEX ADDRWD # MPAC, SETTING MPAC+1,2 TO ZERO. THE
044487,000519: 6524 30000 CA 0 # CONTENTS OF THE REMAINING MPAC REGISTERS
044488,000520: 6525 16076 TCF SLOAD2 # ARE IRRELEVANT.
044489,000521:
044490,000522: 6526 00006 VLOAD EXTEND # LOAD A DOUBLE PRECISION VECTOR INTO
044491,000523: 6527 50116 INDEX ADDRWD # MPAC,+1, MPAC+3,4, AND MPAC+5,6. THE
044492,000524: 6530 30001 DCA 0 # CONTENTS OF MPAC +2 ARE IRRELEVANT.
044493,000525: 6531 52155 DXCH MPAC
044494,000526:
044495,000527: 6532 00006 ENDVLOAD EXTEND # PDVL COMES HERE TO FINISH UP FOR DP, TP.
044496,000528: 6533 50116 INDEX ADDRWD
044497,000529: 6534 30003 DCA 2
044498,000530: 6535 52160 DXCH MPAC +3
044499,000531:
044500,000532: 6536 00006 +4 EXTEND # TPDVL FINISHES HERE.
044501,000533: 6537 50116 INDEX ADDRWD
044502,000534: 6540 30005 DCA 4
044503,000535: 6541 52162 DXCH MPAC +5
044504,000536:
044505,000537: 6542 44744 VMODE CS ONE # DECLARE VECTOR MODE.
044506,000538: 6543 16101 TCF NEWMODE
044507,000539:
Page 1018 |
044509,000541: # THE FOLLOWING INSTRUCTIONS ARE PROVIDED FOR STORING OPERANDS IN THE PUSHDOWN LIST:
044510,000542: # 1. PUSH PUSHDOWN AND NO LOAD.
044511,000543: # 2. PDDL PUSHDOWN AND DOUBLE PRECISION LOAD.
044512,000544: # 3. PDVL PUSHDOWN AND VECTOR LOAD.
044513,000545:
044514,000546: 6544 00006 PDDL EXTEND
044515,000547: 6545 50116 INDEX ADDRWD # LOAD MPAC,+1, PUSHING THE FORMER
044516,000548: 6546 30001 DCA 0 # CONTENTS DOWN.
044517,000549: 6547 52155 DXCH MPAC
044518,000550: 6550 50166 INDEX PUSHLOC
044519,000551: 6551 52001 DXCH 0
044520,000552:
044521,000553: 6552 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER APPRO-
044522,000554: 6553 36265 CAF NO.WDS # PRIATELY.
044523,000555: 6554 26166 ADS PUSHLOC
044524,000556:
044525,000557: 6555 10163 CCS MODE
044526,000558: 6556 16573 TCF ENDTPUSH
044527,000559: 6557 16571 TCF ENDDPUSH
044528,000560:
044529,000561: 6560 54163 TS MODE # NOW DP.
044530,000562: 6561 54156 ENDVPUSH TS MPAC +2
044531,000563: 6562 52160 DXCH MPAC +3 # PUSH DOWN THE REST OF THE VECTOR HERE.
044532,000564: 6563 50166 INDEX PUSHLOC
044533,000565: 6564 51775 DXCH 0 -4
044534,000566:
044535,000567: 6565 52162 DXCH MPAC +5
044536,000568: 6566 50166 INDEX PUSHLOC
044537,000569: 6567 51777 DXCH 0 -2
044538,000570:
044539,000571: 6570 16102 TCF DANZIG
044540,000572:
044541,000573: 6571 54156 ENDDPUSH TS MPAC +2 # SET MPAC +2 TO ZERO AND EXIT ON DP.
044542,000574: 6572 16102 TCF DANZIG
044543,000575:
044544,000576: 6573 54163 ENDTPUSH TS MODE
044545,000577: 6574 56156 XCH MPAC +2 # ON TRIPLE, SET MPAC +2 TO ZERO, PUSHING
044546,000578: 6575 50166 +2 INDEX PUSHLOC # DOWN THE OLD CONTENTS
044547,000579: 6576 53777 TS 0 -1
044548,000580: 6577 16102 TCF DANZIG
044549,000581:
Page 1019 |
044551,000583: # PDVL - PUSHDOWN AND VECTOR LOAD.
044552,000584:
044553,000585: 6600 00006 PDVL EXTEND # RELOAD MPAC AND PUSH DOWN ITS CONTENTS.
044554,000586: 6601 50116 INDEX ADDRWD
044555,000587: 6602 30001 DCA 0
044556,000588: 6603 52155 DXCH MPAC
044557,000589: 6604 50166 INDEX PUSHLOC
044558,000590: 6605 52001 DXCH 0
044559,000591:
044560,000592: 6606 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER.
044561,000593: 6607 36265 CAF NO.WDS
044562,000594: 6610 26166 ADS PUSHLOC
044563,000595:
044564,000596: 6611 10163 CCS MODE # TEST PAST MODE.
044565,000597: 6612 16631 TCF TPDVL
044566,000598: 6613 16532 TCF ENDVLOAD # JUST LOAD LAST FOUR REGISTERS ON DP.
044567,000599:
044568,000600: 6614 00006 VPDVL EXTEND # PUSHDOWN AND RE-LOAD LAST TWO COMPONENTS
044569,000601: 6615 50116 INDEX ADDRWD
044570,000602: 6616 30003 DCA 2
044571,000603: 6617 52160 DXCH MPAC +3
044572,000604: 6620 50166 INDEX PUSHLOC
044573,000605: 6621 51775 DXCH 0 -4
044574,000606:
044575,000607: 6622 00006 EXTEND
044576,000608: 6623 50116 INDEX ADDRWD
044577,000609: 6624 30005 DCA 4
044578,000610: 6625 52162 DXCH MPAC +5
044579,000611: 6626 50166 INDEX PUSHLOC
044580,000612: 6627 51777 DXCH 0 -2
044581,000613:
044582,000614: 6630 16102 TCF DANZIG
044583,000615:
044584,000616: 6631 00006 TPDVL EXTEND # ON TP, WE MUST LOAD THE Y COMPONENT
044585,000617: 6632 50116 INDEX ADDRWD # BEFORE STORING MPAC +2 INCASE THIS IS A
044586,000618: 6633 30003 DCA 2 # PUSHUP.
044587,000619: 6634 52160 DXCH MPAC +3
044588,000620:
044589,000621: 6635 30156 CA MPAC +2
044590,000622: 6636 50166 INDEX PUSHLOC # IN DP.
044591,000623: 6637 53777 TS 0 -1
044592,000624: 6640 16536 TCF ENDVLOAD +4
044593,000625:
044594,000626: # SSP (STORE SINGLE PRECISION) IS EXECUTED HERE.
044595,000627:
044596,000628: 6641 24164 SSP INCR LOC # PICK UP THE WORD FOLLOWING THE GIVEN
044597,000629: 6642 50164 INDEX LOC # ADDRESS AND STORE IT AT X.
044598,000630: 6643 30000 CA 0
044599,000631: 6644 50116 STORE1 INDEX ADDRWD # SOME INDEX AND MISCELLANEOUS OPS END
044600,000632: 6645 54000 TS 0 # HERE.
Page 1020 |
044602,000634: 6646 16102 TCF DANZIG
044603,000635:
Page 1021 |
044605,000637: # SEQUENCE CHANGING AND SUBROUTINE CALLING OPTIONS.
044606,000638:
044607,000639: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR SEQUENCING CHANGING, BRANCHING, AND CALLING SUBROUTINES:
044608,000640:
044609,000641: # 1. GOTO GO TO.
044610,000642: # 2. CALL CALL SUBROUTINE SETTING QPRET.
044611,000643: # 3. CGOTO COMPUTED GO TO.
044612,000644: # 4. CCALL COMPUTED CALL.
044613,000645: # 7. BPL BRANCH IF MPAC POSITIVE OR ZERO.
044614,000646: # 8. BZE BRANCH IF MPAC ZERO.
044615,000647: # 9. BMN BRANCH IF MPAC NEGATIVE NON-ZERO.
044616,000648:
044617,000649: 6647 24164 CCALL INCR LOC # MAINTAIN LOC FOR QPRET COMPUTATION.
044618,000650: 6650 50164 INDEX LOC
044619,000651: 6651 30000 CAF 0 # GET BASE ADDRESS OF CADR LIST.
044620,000652: 6652 50116 INDEX ADDRWD
044621,000653: 6653 60000 AD 0 # ADD INCREMENT.
044622,000654: 6654 54004 TS FBANK # SELECT DESIRED CADR.
044623,000655: 6655 75003 MASK LOW10
044624,000656: 6656 50000 INDEX A
044625,000657: 6657 32000 CAF 10000
044626,000658: 6660 54117 TS POLISH
044627,000659:
044628,000660: 6661 30165 CALL CA BANKSET # FOR ANY OF THE CALL OPTIONS, MAKE UP THE
044629,000661: 6662 74341 MASK BANKMASK # ADDRESS OF THE NEXT OP-CODE PAIR/STORE
044630,000662: 6663 64341 AD BANKMASK # CODE AND LEAVE IT IN QPRET. NOTE THAT
044631,000663: 6664 60164 AD LOC # BANKMASK = -(2000 - 1).
044632,000664: 6665 50120 INDEX FIXLOC
044633,000665: 6666 54052 TS QPRET
044634,000666:
044635,000667: 6667 30117 GOTO CA POLISH # BASIC BRANCHING SEQUENCE.
044636,000668: 6670 77763 +1 MASK HIGH4
044637,000669: 6671 00006 EXTEND
044638,000670: 6672 16703 BZF GOTOERS # SEE IF ADDRESS POINTS TO FIXED OR ERAS.
044639,000671: 6673 30165 +4 CA BANKSET # SET EBANK PART OF BBANK. NEXT, SET UP
044640,000672: 6674 54006 TS BBANK # FBANK. THE COMBINATION IS PICKED UP &
044641,000673: 6675 30117 CA POLISH # PUT INTO BANKSET AT INTPRET +2.
044642,000674: 6676 54004 TS FBANK
044643,000675: 6677 75003 MASK LOW10
044644,000676: 6700 64732 AD 2K
044645,000677: 6701 54164 TS LOC
044646,000678: 6702 16063 TCF INTPRET +3
044647,000679:
044648,000680: 6703 E3,1400 EBANK= 1400 # SO YUL DOESN'T CUSS THE "CA 1400" BELOW.
044649,000681:
044650,000682: 6703 30117 GOTOERS CA POLISH # THE GIVEN ADDRESS IS IN ERASABLE - SEE
044651,000683: 6704 66272 AD -ENDVAC # IF RELATIVE TO THE WORK AREA.
044652,000684: 6705 10000 CCS A
044653,000685: 6706 30117 CA POLISH # GENERAL ERASABLE.
044654,000686: 6707 16716 TCF GOTOGE
044655,000687:
Page 1022 |
044657,000689: 6710 30120 CA FIXLOC # WORK AREA.
044658,000690: 6711 60117 AD POLISH
044659,000691: 6712 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
044660,000692: 6713 30000 CA 0 # THE BRANCH ADDRESS.
044661,000693: 6714 54117 TS POLISH
044662,000694: 6715 16670 TCF GOTO +1 # ALLOWS ARBITRARY INDIRECTNESS LEVELS.
044663,000695:
044664,000696: 6716 54003 GOTOGE TS EBANK
044665,000697: 6717 74350 MASK LOW8
044666,000698: 6720 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
044667,000699: 6721 31400 CA 1400 # THE BRANCH ADDRESS.
044668,000700: 6722 54117 TS POLISH
044669,000701: 6723 16670 TCF GOTO +1
044670,000702:
044671,000703: 6724 50164 CGOTO INDEX LOC # COMPUTED GO TO. PICK UP ADDRESS OF CADR
044672,000704: 6725 30001 CA 1 # LIST.
044673,000705: 6726 50116 INDEX ADDRWD # ADD MODIFIER.
044674,000706: 6727 60000 AD 0
044675,000707: 6730 54004 TS FBANK # SELECT GOTO ADDRESS.
044676,000708: 6731 75003 MASK LOW10
044677,000709: 6732 50000 INDEX A
044678,000710: 6733 32000 CA 10000
044679,000711: 6734 54117 TS POLISH
044680,000712: 6735 16670 TCF GOTO +1 # WITH ADDRESS IN A.
044681,000713:
044682,000714: 6736 30165 SWBRANCH CA BANKSET # SWITCH INSTRUCTIONS WHICH ELECT TO
044683,000715: 6737 54004 TS FBANK # BRANCH COME HERE TO DO SO.
044684,000716: 6740 50164 INDEX LOC
044685,000717: 6741 30001 CA 1
044686,000718: 6742 54117 TS POLISH
044687,000719: 6743 16670 TCF GOTO +1
044688,000720:
Page 1023 |
044690,000722: # TRIPLE PRECISION BRANCHING ROUTINE. IF CALLING TC IS AT L, RETURN IS AS FOLLOWS:
044691,000723:
044692,000724: # L+1 IF MPAC IS GREATER THAN ZERO.
044693,000725: # L+2 IF MPAC IS EQUAL TO +0 OR -0.
044694,000726: # L+3 IF MPAC IS LESS THAN ZERO.
044695,000727:
044696,000728: 6744 10154 BRANCH CCS MPAC
044697,000729: 6745 00002 TC Q
044698,000730: 6746 16750 TCF +2 # ON ZERO.
044699,000731: 6747 16762 TCF NEG
044700,000732:
044701,000733: 6750 10155 CCS MPAC +1
044702,000734: 6751 00002 TC Q
044703,000735: 6752 16754 TCF +2
044704,000736: 6753 16762 TCF NEG
044705,000737:
044706,000738: 6754 10156 CCS MPAC +2
044707,000739: 6755 00002 TC Q
044708,000740: 6756 16760 TCF +2
044709,000741: 6757 16762 TCF NEG
044710,000742:
044711,000743: 6760 50002 Q+1 INDEX Q
044712,000744: 6761 00001 TC 1
044713,000745:
044714,000746: 6762 50002 NEG INDEX Q # IF FIRST NON-ZERO REGISTER WAS NEGATIVE.
044715,000747: 6763 00002 TC 2
044716,000748:
044717,000749:
044718,000750: 6764 6762 Q+2 = NEG
044719,000751:
044720,000752: # ITRACE (3) REFERS TO "EXIT".
044721,000753: 6764 30165 EXIT CA BANKSET # RESTORE USER'S BANK SETTING, AND LEAVE
044722,000754: 6765 54006 TS BBANK # INTERPRETIVE MODE.
044723,000755: 6766 50164 INDEX LOC
044724,000756: 6767 00001 TC 1
044725,000757:
Page 1024 |
044727,000759: # SECTION 3 - ADD/SUBTRACT PACKAGE.
044728,000760:
044729,000761: # THE FOLLOWING OPERATIONS ARE PROVIDED FOR ADDING TO AND SUBTRACTING FROM THE MULTI-PURPOSE ACCUMULATOR
044730,000762: # MPAC:
044731,000763:
044732,000764: # 1. DAD DOUBLE PRECISION ADD.
044733,000765: # 2. DSU DOUBLE PRECISION SUBTRACT.
044734,000766: # 3. BDSU DOUBLE PRECISION SUBTRACT FROM.
044735,000767:
044736,000768: # 4. TAD TRIPLE PRECISION ADD.
044737,000769:
044738,000770: # 5. VAD VECTOR ADD.
044739,000771: # 6. VSU VECTOR SUBTRACT.
044740,000772: # 7. BVSU VECTOR SUBTRACT FROM.
044741,000773:
044742,000774: # THE INTERPRETIVE OVERFLOW INDICATOR OVFIND IS SET NON-ZERO IF OVERFLOW OCCURS IN ANY OF THE ABOVE.
044743,000775:
044744,000776: 6770 34726 VSU CAF BIT15 # CHANGES 0 TO DCS.
044745,000777: 6771 16773 TCF +2
044746,000778:
044747,000779: 6772 34346 VAD CAF PRIO30 # CHANGES 0 TO DCA.
044748,000780: 6773 26116 ADS ADDRWD
044749,000781: 6774 00006 EXTEND
044750,000782: 6775 50116 INDEX ADDRWD
044751,000783: 6776 00003 READ HISCALAR # DCA 2 OR DCS 2
044752,000784: 6777 20160 DAS MPAC +3
044753,000785: 7000 00006 EXTEND # CHECK OVERFLOW.
044754,000786: 7001 17003 BZF +2
044755,000787: 7002 07035 TC OVERFLWY
044756,000788:
044757,000789: 7003 00006 EXTEND
044758,000790: 7004 50116 INDEX ADDRWD
044759,000791: 7005 00005 READ CHAN5 # DCA 4 OR DCS 4
044760,000792: 7006 20162 DAS MPAC +5
044761,000793: 7007 00006 EXTEND
044762,000794: 7010 17012 BZF +2
044763,000795: 7011 07032 TC OVERFLWZ
044764,000796:
044765,000797: 7012 00006 EXTEND
044766,000798: 7013 50116 INDEX ADDRWD
044767,000799: 7014 00001 READ LCHAN # DCA 0 OR DCS 0
044768,000800: 7015 17021 TCF ENDVXV
044769,000801:
044770,000802: 7016 00006 DAD EXTEND
044771,000803: 7017 50116 INDEX ADDRWD
044772,000804: 7020 30001 DCA 0
044773,000805: 7021 20155 ENDVXV DAS MPAC # VXV FINISHES HERE.
044774,000806: 7022 00006 EXTEND
044775,000807: 7023 16102 BZF DANZIG
044776,000808:
Page 1025 |
044778,000810: 7024 07040 SETOVF TC OVERFLOW
044779,000811: 7025 16102 TCF DANZIG
044780,000812:
Page 1026 |
044782,000814: 7026 00006 DSU EXTEND
044783,000815: 7027 50116 INDEX ADDRWD
044784,000816: 7030 40001 DCS 0
044785,000817: 7031 17021 TCF ENDVXV
044786,000818:
044787,000819: 7032 54001 OVERFLWZ TS L # ENTRY FOR THIRD COMPONENT.
044788,000820: 7033 34747 CAF FIVE
044789,000821: 7034 17037 TCF +3
044790,000822:
044791,000823: 7035 54001 OVERFLWY TS L # ENTRY FOR SECOND COMPONENT.
044792,000824: 7036 36266 CAF THREE
044793,000825: 7037 56001 XCH L
044794,000826:
044795,000827: 7040 50000 OVERFLOW INDEX A # ENTRY FOR 1ST COMP OR DP (L=0).
044796,000828: 7041 44725 CS LIMITS # PICK UP POSMAX OR NEGMAX.
044797,000829: 7042 54130 TS BUF
044798,000830: 7043 00006 EXTEND
044799,000831: 7044 24000 AUG A # FORCE OVERFLOW.
044800,000832: 7045 50001 INDEX L
044801,000833: 7046 26155 ADS MPAC +1
044802,000834: 7047 54007 TS 7
044803,000835: 7050 34746 CAF ZERO
044804,000836: 7051 60130 AD BUF
044805,000837: 7052 50001 INDEX L
044806,000838: 7053 26154 ADS MPAC
044807,000839: 7054 54007 TS 7
044808,000840: 7055 00002 TC Q # NO OVERFLOW EXIT.
044809,000841: 7056 17173 TCF SETOVF2 # SET OVFIND AND EXIT.
044810,000842:
044811,000843: 7057 00006 BVSU EXTEND
044812,000844: 7060 50116 INDEX ADDRWD
044813,000845: 7061 30003 DCA 2
044814,000846: 7062 52160 DXCH MPAC +3
044815,000847: 7063 00006 EXTEND
044816,000848: 7064 40001 DCOM
044817,000849: 7065 20160 DAS MPAC +3
044818,000850: 7066 00006 EXTEND
044819,000851: 7067 17071 BZF +2
044820,000852: 7070 07035 TC OVERFLWY
044821,000853:
044822,000854: 7071 00006 EXTEND
044823,000855: 7072 50116 INDEX ADDRWD
044824,000856: 7073 30005 DCA 4
044825,000857: 7074 52162 DXCH MPAC +5
044826,000858: 7075 00006 EXTEND
044827,000859: 7076 40001 DCOM
044828,000860: 7077 20162 DAS MPAC +5
044829,000861: 7100 00006 EXTEND
044830,000862: 7101 17103 BZF +2
044831,000863: 7102 07032 TC OVERFLWZ
044832,000864:
Page 1027 |
044834,000866: 7103 00006 BDSU EXTEND
044835,000867: 7104 50116 INDEX ADDRWD
044836,000868: 7105 30001 DCA 0
044837,000869: 7106 52155 DXCH MPAC
044838,000870: 7107 00006 EXTEND
044839,000871: 7110 40001 DCOM
044840,000872: 7111 17021 TCF ENDVXV
044841,000873:
Page 1028 |
044843,000875: # TRIPLE PRECISION ADD ROUTINE.
044844,000876:
044845,000877: 7112 00006 TAD EXTEND
044846,000878: 7113 50116 INDEX ADDRWD
044847,000879: 7114 30002 DCA 1 # ADD MINOR PARTS FIRST.
044848,000880: 7115 20156 DAS MPAC +1
044849,000881: 7116 50116 INDEX ADDRWD
044850,000882: 7117 60000 AD 0
044851,000883: 7120 60154 AD MPAC
044852,000884: 7121 54154 TS MPAC
044853,000885: 7122 16102 TCF DANZIG
044854,000886:
044855,000887: 7123 17024 TCF SETOVF # SET OVFIND IF SUCH OCCURS.
044856,000888:
Page 1029 |
044858,000890: # ARITHMETIC SUBROUTINES REQUIRED IN FIXED-FIXED.
044859,000891:
044860,000892: # 1. DMPSUB DOUBLE PRECISION MULTIPLY. MULTIPLY THE CONTENTS OF MPAC,+1 BY THE DP WORD WHOSE ADDRESS
044861,000893: # IS IN ADDRWD AND LEAVE A TRIPLE PRECISION RESULT IN MPAC.
044862,000894: # 2. ROUNDSUB ROUND THE TRIPLE PRECISON CONTENTS OF MPAC TO DOUBLE PRECISION.
044863,000895: # 3. DOTSUB TAKE THE DOT PRODUCT OF THE VECTOR IN MPAC AND THE VECTOR WHOSE ADDRESS IS IN ADDRWD
044864,000896: # AND LEAVE THE TRIPLE PRECISION RESULT IN MPAC.
044865,000897: # 4. POLY USING THE CONTENTS OF MPAC AS A DP ARGUMENT, EVALUATE THE POLYNOMIAL WHOSE DEGREE AND
044866,000898: # COEFFICIENTS IMMEDIATELY FOLLOW THE TC POLY INSTRUCTION (SEE ROUTINE FOR DETAILS.)
044867,000899:
044868,000900:
044869,000901: 7124 50002 DMP INDEX Q # BASIC SUBROUTINE FOR USE BY PINBALL, ETC
044870,000902: 7125 30000 CAF 0 # ADRES OF ARGUMENT FOLLOWS TC DMP .
044871,000903: 7126 24002 INCR Q
044872,000904: 7127 54116 -1 TS ADDRWD # (PROLOGUE FOR SETTING ADDRWD.)
044873,000905:
044874,000906: 7130 50116 DMPSUB INDEX ADDRWD # GET MINOR PART OF OPERAND AT C(ADDRWD).
044875,000907: 7131 30001 CA 1
044876,000908: 7132 54156 TS MPAC +2 # THIS WORKS FOR SQUARING MPAC AS WELL.
044877,000909: 7133 34746 CAF ZERO # SET MPAC +1 TO ZERO SO WE CAN ACCUMULATE
044878,000910: 7134 56155 XCH MPAC +1 # THE PARTIAL PRODUCTS WITH DAS
044879,000911: 7135 54135 TS MPTEMP # INSTRUCTIONS.
044880,000912: 7136 00006 EXTEND
044881,000913: 7137 70156 MP MPAC +2 # MINOR OF MPAC X MINOR OF C(ADDRWD).
044882,000914:
044883,000915: 7140 56156 XCH MPAC +2 # DISCARD MINOR PART OF ABOVE RESULT AND
044884,000916: 7141 00006 EXTEND # FORM MAJOR OF MPAC X MINOR OF C(ADDRWD).
044885,000917: 7142 70154 MP MPAC
044886,000918: 7143 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
044887,000919:
044888,000920: 7144 50116 INDEX ADDRWD # GET MAJOR PART OF ARGUMENT AT C(ADDRWD).
044889,000921: 7145 30000 CA 0
044890,000922: 7146 56135 XCH MPTEMP # SAVE AND BRING OUT MINOR OF MPAC.
044891,000923: 7147 00006 DMPSUB2 EXTEND
044892,000924: 7150 70135 MP MPTEMP # MAJOR OF C(ADDRWD) X MINOR OF MPAC.
044893,000925: 7151 20156 DAS MPAC +1 # ACCUMULATE, SETTING A TO NET OVERFLOW.
044894,000926:
044895,000927: 7152 56154 XCH MPAC # SETTING MPAC TO 0 OR +-1.
044896,000928: 7153 00006 EXTEND
044897,000929: 7154 70135 MP MPTEMP # MAJOR OF MPAC X MAJOR OF C(ADDRWD).
044898,000930: 7155 20155 DAS MPAC # GUARANTEED NO OVERFLOW.
044899,000931: 7156 00002 TC Q # 49 MCT = .573 MS. INCLUDING RETURN.
044900,000932:
Page 1030 |
044902,000934: # ROUND MPAC TO DOUBLE PRECISION, SETTING OVFIND ON THE RARE EVENT OF OVERFLOW.
044903,000935:
044904,000936: 7157 34746 ROUNDSUB CAF ZERO # SET MPAC +2 = 0 FOR SCALARS AND CHANGE
044905,000937: 7160 54163 +1 TS MODE # MODE TO DP.
044906,000938:
044907,000939: 7161 56156 VROUND XCH MPAC +2 # BUT WE NEEDNT TAKE THE TIME FOR VECTORS.
044908,000940: 7162 60000 DOUBLE
044909,000941: 7163 54001 TS L
044910,000942: 7164 00002 TC Q
044911,000943:
044912,000944: 7165 60155 AD MPAC +1 # ADD ROUNDING BIT IF MPAC +2 WAS GREATER
044913,000945: 7166 54155 TS MPAC +1 # THAN .5 IN MAGNITUDE.
044914,000946: 7167 00002 TC Q
044915,000947:
044916,000948: 7170 60154 AD MPAC # PROPAGATE INTERFLOW.
044917,000949: 7171 54154 TS MPAC
044918,000950: 7172 00002 TC Q
044919,000951:
044920,000952: 7173 54121 SETOVF2 TS OVFIND # (RARE).
044921,000953: 7174 00002 TC Q
044922,000954:
Page 1031 |
044924,000956: # THE DOT PRODUCT SUBROUTINE USUALLY FORMS THE DOT PRODUCT OF THE VECTOR IN MPAC WITH A STANDARD SIX
044925,000957: # REGISTER VECTOR WHOSE ADDRESS IS IN ADDRWD. IN THIS CASE C(DOTINC) ARE SET TO 2. VXM, HOWEVER, SETS C(DOTINC) TO
044926,000958: # 6 SO THAT DOTSUB DOTS MPAC WITH A COLUMN VECTOR OF THE MATRIX IN QUESTION IN THIS CASE.
044927,000959:
044928,000960: 7175 34743 PREDOT CAF TWO # PROLOGUE TO SET DOTINC TO 2.
044929,000961: 7176 54136 TS DOTINC
044930,000962:
044931,000963: 7177 00006 DOTSUB EXTEND
044932,000964: 7200 22137 QXCH DOTRET # SAVE RETURN.
044933,000965: 7201 07130 TC DMPSUB # DOT X COMPONENTS.
044934,000966: 7202 52160 DXCH MPAC +3 # POSITION Y COMPONENT OF MPAC FOR
044935,000967: 7203 52155 DXCH MPAC # MULTIPLICATION WHILE SAVING RESULT IN
044936,000968: 7204 52131 DXCH BUF # THREE WORD BUFFER, BUF.
044937,000969: 7205 30156 CA MPAC +2
044938,000970: 7206 54132 TS BUF +2
044939,000971:
044940,000972: 7207 30136 CA DOTINC # ADVANCE ADDRWD TO Y COMPONENT OF
044941,000973: 7210 26116 ADS ADDRWD # OTHER ARGUMENT.
044942,000974: 7211 07130 TC DMPSUB
044943,000975: 7212 52156 DXCH MPAC +1 # ACCUMULATE PARTIAL PRODUCTS.
044944,000976: 7213 20132 DAS BUF +1
044945,000977: 7214 60154 AD MPAC
044946,000978: 7215 60130 AD BUF
044947,000979: 7216 54130 TS BUF
044948,000980: 7217 17221 TCF +2
044949,000981: 7220 54121 TS OVFIND # IF OVERFLOW OCCURS.
044950,000982:
044951,000983: 7221 52162 DXCH MPAC +5 # MULTIPLY Z COMPONENTS.
044952,000984: 7222 52155 DXCH MPAC
044953,000985: 7223 30136 CA DOTINC
044954,000986: 7224 26116 ADS ADDRWD
044955,000987: 7225 07130 TC DMPSUB
044956,000988: 7226 52132 ENDDOT DXCH BUF +1 # LEAVE FINAL ACCUMULATION IN MPAC.
044957,000989: 7227 20156 DAS MPAC +1
044958,000990: 7230 60154 AD MPAC
044959,000991: 7231 60130 AD BUF
044960,000992: 7232 54154 TS MPAC
044961,000993: 7233 00137 TC DOTRET
044962,000994:
044963,000995: 7234 07040 TC OVERFLOW # ON OVERFLOW HERE.
044964,000996: 7235 00137 TC DOTRET
044965,000997:
Page 1032 |
044967,000999: # DOUBLE PRECISION POLYNOMIAL EVALUATOR
044968,001000:
044969,001001: # N N-1
044970,001002: # THIS ROUTINE EVALUATES A X + A X + ... + A X + A LEAVING THE DP RESULT IN MPAC ON EXIT.
044971,001003: # N N-1 1 0
044972,001004:
044973,001005: # THE ROUTINE HAS TWO ENTRIES
044974,001006:
044975,001007: # 1. ENTRY THRU POWRSERS. THE COEFFICIENTS MAY BE EITHER IN FIXED OR ERASABLE, THE CALL IS BY
044976,001008: # TC POWRSERS, AND THE RETURN IS TO LOC(TC POWRSERS)+1. THE ENTERING DATA MUST BE AS FOLLOWS
044977,001009:
044978,001010: # A SP LOC-3 ADDRESS FOR REFERENCING COEF TABLE
044979,001011: # L SP N-1 N IS THE DEGREE OF THE POWER SERIES
044980,001012: # MPAC DP X ARGUMENT
044981,001013:
044982,001014: # LOC-2N DP A(0)
044983,001015: # ...
044984,001016: # LOC DP A(N)
044985,001017:
044986,001018: # 2. ENTRY THRU POLY. THE CALL TO POLY AND THE ENTERING DATA MUST BE AS FOLLOWS
044987,001019:
044988,001020: # MPAC DP X ARGUMENT
044989,001021:
044990,001022: # LOC TC POLY
044991,001023: # LOC+1 SP N-1
044992,001024: # LOC+2 DP A(0)
044993,001025: # ...
044994,001026: # LOC+2N+2 DP A(N) RETURN IS TO LOC+2N+4
044995,001027:
044996,001028: 7236 00006 POWRSERS EXTEND
044997,001029: 7237 22141 QXCH POLYRET # RETURN ADDRESS
044998,001030: 7240 54117 TS POLISH # POWER SERIES ADDRESS
044999,001031: 7241 22140 LXCH POLYCNT # N-1 TO COUNTER
045000,001032: 7242 17253 TCF POLYCOM # SKIP SET UP BY POLY
045001,001033:
045002,001034: 7243 50002 POLY INDEX Q
045003,001035: 7244 30000 CAF 0
045004,001036: 7245 54140 TS POLYCNT # N-1 TO COUNTER
045005,001037: 7246 60000 DOUBLE
045006,001038: 7247 60002 AD Q
045007,001039: 7250 54117 TS POLISH # L(A(N))-3 TO POLISH
045008,001040: 7251 64747 AD FIVE
045009,001041: 7252 54141 TS POLYRET # STORE RETURN ADDRESS
045010,001042:
045011,001043: 7253 36314 POLYCOM CAF LVBUF # INCOMING X WILL BE MOVED TO VBUF, SO
045012,001044: 7254 54116 TS ADDRWD # SET ADDRWD SO DMPSUB WILL MPY BY VBUF.
045013,001045:
045014,001046: 7255 00006 EXTEND
045015,001047: 7256 50117 INDEX POLISH
045016,001048: 7257 30004 DCA 3
045017,001049:
Page 1033 |
045019,001051: 7260 52155 DXCH MPAC # LOAD A(N) INTO MPAC,
045020,001052: 7261 52123 DXCH VBUF # SAVING X IN VBUF
045021,001053: 7262 17266 TCF POLY2
045022,001054:
045023,001055: 7263 54140 POLYLOOP TS POLYCNT # SAVE DECREMENTED LOOP COUNTER
045024,001056: 7264 44743 CS TWO
045025,001057: 7265 26117 ADS POLISH # REGRESS COEFFICIENT POINTER
045026,001058:
045027,001059: 7266 07130 POLY2 TC DMPSUB # MULTIPLY BY X
045028,001060: 7267 00006 EXTEND
045029,001061: 7270 50117 INDEX POLISH
045030,001062: 7271 30002 DCA 1 # ADD IN NEXT COEFFICIENT
045031,001063: 7272 20155 DAS MPAC # USERS RESPONSIBILITY TO ASSURE NO OVFLOW
045032,001064:
045033,001065: 7273 10140 CCS POLYCNT
045034,001066: 7274 17263 TCF POLYLOOP
045035,001067: 7275 00141 TC POLYRET # RETURN CALLER
045036,001068:
Page 1034 |
045038,001070: # MISCELLANEOUS MULTI-PRECISION ROUTINES REQUIRED IN FIXED-FIXED BUT NOT USED BY THE INTERPRETER.
045039,001071:
045040,001072: 7276 34746 DPAGREE CAF ZERO # DOUBLE PRECISION ENTRY -
045041,001073: 7277 54156 TS MPAC +2 # ZERO LOW-ORDER WORD
045042,001074:
045043,001075: 7300 22002 TPAGREE LXCH Q # FORCE SIGN AGREEMENT AMONG THE TRIPLE
045044,001076: 7301 06744 TC BRANCH # PRECISION CONTENTS OF MPAC. RETURNING
045045,001077: 7302 17306 TCF ARG+ # WITH SIGNUM OF THE INPUT IN A.
045046,001078: 7303 17326 TCF ARGZERO
045047,001079:
045048,001080: 7304 44724 CS POSMAX # IF NEGATIVE.
045049,001081: 7305 17307 TCF +2
045050,001082:
045051,001083: 7306 34724 ARG+ CAF POSMAX
045052,001084: 7307 54002 TS Q
045053,001085: 7310 00006 EXTEND
045054,001086: 7311 24000 AUG A # FORMS +-1.0.
045055,001087: 7312 60156 AD MPAC +2
045056,001088: 7313 54156 TS MPAC +2
045057,001089: 7314 34746 CAF ZERO
045058,001090: 7315 60002 AD Q
045059,001091: 7316 60155 AD MPAC +1
045060,001092: 7317 54155 TS MPAC +1
045061,001093: 7320 34746 CAF ZERO
045062,001094: 7321 60002 AD Q # Q STILL HAS POSMAX OR NEGMAX IN IT.
045063,001095: 7322 60154 AD MPAC
045064,001096: 7323 54154 ARGZERO2 TS MPAC # ALWAYS SKIPPING UNLESS ARGZERO.
045065,001097: 7324 54155 TS MPAC +1
045066,001098: 7325 00001 TC L # RETURN VIA L.
045067,001099:
045068,001100: 7326 54156 ARGZERO TS MPAC +2 # SET ALL THREE MPAC REGISTERS TO ZERO.
045069,001101: 7327 17323 TCF ARGZERO2
045070,001102:
045071,001103: # SHORTMP MULTIPLIES THE TP CONTENTS OF MPAC BY THE SINGLE PRECISION NUMBER ARRIVING IN A.
045072,001104:
045073,001105: 7330 54135 SHORTMP TS MPTEMP
045074,001106: 7331 00006 EXTEND
045075,001107: 7332 70156 MP MPAC +2
045076,001108: 7333 54156 TS MPAC +2
045077,001109: 7334 34746 SHORTMP2 CAF ZERO # SO SUBSEQUENT DAS WILL WORK.
045078,001110: 7335 56155 XCH MPAC +1
045079,001111: 7336 17147 TCF DMPSUB2
045080,001112:
At the bottom of the page is wrtten some code: CA EX MP DXCH CA HMEAS +1 EX MP .2SP DXCH L _ CA ZERO DXCH HMEAS EX MP .2SP DAS HMEAS _ |
045096,001128:
Page 1035 |
045098,001130: # DMPNSUB MULTIPLIES THE DP FRACTION ARRIVING IN MPAC BY THE SP
045099,001131: # INTEGER ARRIVING IN A. THE DP PRODUCT DEPARTS BOTH IN MPAC AND IN
045100,001132: # A AND L. NOTE THAT DMPNSUB NORMALLY INCREASES THE MAGNITUDE OF THE
045101,001133: # CONTENTS OF MPAC. THE CUSTOMER MUST INSURE THAT B(A) X B(MPAC,MPAC+1)
045102,001134: # AND B(A) X B(MPAC) ARE LESS THAN 1 IN MAGNITUDE, WHERE B, AS IS OBVIOUS,
045103,001135: # INDICATES THE ARRIVING CONTENTS.
045104,001136:
045105,001137: 7337 54135 DMPNSUB TS DMPNTEMP
045106,001138: 7340 00006 EXTEND
045107,001139: 7341 70155 MP MPAC +1
045108,001140: 7342 52155 DXCH MPAC # LOW PRODUCT TO MPAC, HIGH FACTOR TO A
045109,001141: 7343 00006 EXTEND
045110,001142: 7344 70135 MP DMPNTEMP
045111,001143: 7345 30001 CA L
045112,001144: 7346 26154 ADS MPAC # COMPLETING THE PRODUCT IN MPAC
045113,001145: 7347 00006 EXTEND
045114,001146: 7350 30155 DCA MPAC # BRINGING THE PRODUCT INTO A AND L
045115,001147: 7351 00002 TC Q
045116,001148:
Page 1036 |
045118,001150: # MISCELLANEOUS VECTOR OPERATIONS. INCLUDED HERE ARE THE FOLLOWING:
045119,001151:
045120,001152: # 1. DOT DP VECTOR DOT PRODUCT.
045121,001153: # 2. VXV DP VECTOR CROSS PRODUCT.
045122,001154: # 3. VXSC DP VECTOR TIMES SCALAR.
045123,001155: # 4. V/SC DP VECTOR DIVIDED BY SCALAR.
045124,001156: # 5. VPROJ DP VECTOR PROJECTION. ( (MPAC.X)MPAC ).
045125,001157: # 6. VXM DP VECTOR POST-MULTIPLIED BY MATRIX.
045126,001158: # 7. MXV DP VECTOR PRE-MULTIPLIED BY MATRIX.
045127,001159:
045128,001160: 7352 07175 DOT TC PREDOT # DO THE DOT PRODUCT AND EXIT, CHANGING
045129,001161: 7353 34746 DMODE CAF ZERO # THE MODE TO DP SCALAR.
045130,001162: 7354 16101 TCF NEWMODE
045131,001163:
045132,001164:
045133,001165: 7355 34743 MXV CAF TWO # SET UP MATINC AND DOTINC FOR ROW
045134,001166: 7356 54140 TS MATINC # VECTORS.
045135,001167: 7357 17363 TCF VXM/MXV # GO TO COMMON PORTION.
045136,001168:
045137,001169: 7360 44354 VXM CS TEN # SET MATINC AND DOTINC TO REFER TO MATRIX
045138,001170: 7361 54140 TS MATINC # AS THREE COLUMN VECTORS.
045139,001171: 7362 36263 CAF SIX
045140,001172:
Page 1037 |
045142,001174: # COMMON PORTION OF MXV AND VXM.
045143,001175:
045144,001176: 7363 54136 VXM/MXV TS DOTINC
045145,001177: # ITRACE (2) REFERS TO "VXM/MXV".
045146,001178: 7364 07553 TC MPACVBUF # SAVE VECTOR IN MPAC FOR FURTHER USE.
045147,001179:
045148,001180: 7365 07177 TC DOTSUB # GO DOT TO GET X COMPONENT OF ANSWER.
045149,001181: 7366 00006 EXTEND
045150,001182: 7367 30123 DCA VBUF # MOVE MPAC VECTOR BACK INTO MPAC, SAVING
045151,001183: 7370 52155 DXCH MPAC # NEW X COMPONENT IN BUF2.
045152,001184: 7371 52134 DXCH BUF2
045153,001185: 7372 00006 EXTEND
045154,001186: 7373 30125 DCA VBUF +2
045155,001187: 7374 52160 DXCH MPAC +3
045156,001188: 7375 00006 EXTEND
045157,001189: 7376 30127 DCA VBUF +4
045158,001190: 7377 52162 DXCH MPAC +5
045159,001191: 7400 30140 CA MATINC # INITIALIZE ADDRWD FOR NEXT DOT PRODUCT.
045160,001192: 7401 26116 ADS ADDRWD # FORMS BASE ADDRESS OF NEXT COLUMN(ROW).
045161,001193:
045162,001194: 7402 07177 TC DOTSUB
045163,001195: 7403 52123 DXCH VBUF # MOVE GIVEN VECTOR BACK TO MPAC, SAVING Y
045164,001196: 7404 52155 DXCH MPAC # COMPONENT OF ANSWER IN VBUF +2.
045165,001197: 7405 52125 DXCH VBUF +2
045166,001198: 7406 52160 DXCH MPAC +3
045167,001199: 7407 52127 DXCH VBUF +4
045168,001200: 7410 52162 DXCH MPAC +5
045169,001201: 7411 30140 CA MATINC # FORM ADDRESS OF LAST COLUMN OR ROW.
045170,001202: 7412 26116 ADS ADDRWD
045171,001203:
045172,001204: 7413 07177 TC DOTSUB
045173,001205: 7414 52134 DXCH BUF2 # ANSWER NOW COMPLETE. PUT COMPONENTS INTO
045174,001206: 7415 52155 DXCH MPAC # PROPER MPAC REGISTERS.
045175,001207: 7416 52162 DXCH MPAC +5
045176,001208: 7417 52125 DXCH VBUF +2
045177,001209: 7420 52160 DXCH MPAC +3
045178,001210: 7421 16102 TCF DANZIG # EXIT.
045179,001211:
Page 1038 |
045181,001213: # VXSC - VECTOR TIMES SCALAR.
045182,001214:
045183,001215: 7422 10163 VXSC CCS MODE # TEST PRESENT MODE.
045184,001216: 7423 17451 TCF DVXSC # SEPARATE ROUTINE WHEN SCALAR IS IN MPAC.
045185,001217: 7424 17451 TCF DVXSC
045186,001218:
045187,001219: 7425 07130 VVXSC TC DMPSUB # COMPUTE X COMPONENT
045188,001220: 7426 07161 TC VROUND # AND ROUND IT.
045189,001221: 7427 52160 DXCH MPAC +3 # PUT Y COMPONENT INTO MPAC SAVING MPAC IN
045190,001222: 7430 52155 DXCH MPAC # MPAC +3.
045191,001223: 7431 52160 DXCH MPAC +3
045192,001224:
045193,001225: 7432 07130 TC DMPSUB # DO SAME FOR Y AND Z COMPONENTS.
045194,001226: 7433 07161 TC VROUND
045195,001227: 7434 52162 DXCH MPAC +5
045196,001228: 7435 52155 DXCH MPAC
045197,001229: 7436 52162 DXCH MPAC +5
045198,001230:
045199,001231: 7437 07130 TC DMPSUB
045200,001232: 7440 07161 TC VROUND
045201,001233: 7441 52155 VROTATEX DXCH MPAC # EXIT USED TO RESTORE MPAC AFTER THIS
045202,001234: 7442 52162 DXCH MPAC +5 # TYPE OF ROTATION. CALLED BY VECTOR SHIFT
045203,001235: 7443 52160 DXCH MPAC +3 # RIGHT, V/SC, ETC.
045204,001236: 7444 52155 DXCH MPAC
045205,001237: 7445 16102 TCF DANZIG
045206,001238:
Page 1039 |
045208,001240: # DP VECTOR PROJECTION ROUTINE.
045209,001241:
045210,001242: 7446 07175 VPROJ TC PREDOT # (MPAC.X)MPAC IS COMPUTED AND LEFT IN
045211,001243: 7447 44742 CS FOUR # MPAC. DO DOT AND FALL INTO DVXSC.
045212,001244: 7450 26116 ADS ADDRWD
045213,001245:
045214,001246: # VXSC WHEN SCALAR ARRIVES IN MPAC AND VECTOR IS AT X.
045215,001247:
045216,001248: 7451 00006 DVXSC EXTEND # SAVE SCALAR IN MPAC +3 AND GET X
045217,001249: 7452 30155 DCA MPAC # COMPONENT OF ANSWER.
045218,001250: 7453 52160 DXCH MPAC +3
045219,001251: 7454 07130 TC DMPSUB
045220,001252: 7455 07161 TC VROUND
045221,001253:
045222,001254: 7456 34743 CAF TWO # ADVANCE ADDRWD TO Y COMPONENT OF X.
045223,001255: 7457 26116 ADS ADDRWD
045224,001256: 7460 00006 EXTEND
045225,001257: 7461 30160 DCA MPAC +3 # PUT SCALAR BACK INTO MPAC AND SAVE
045226,001258: 7462 52155 DXCH MPAC # X RESULT IN MPAC +5.
045227,001259: 7463 52162 DXCH MPAC +5
045228,001260: 7464 07130 TC DMPSUB
045229,001261: 7465 07161 TC VROUND
045230,001262:
045231,001263: 7466 34743 CAF TWO
045232,001264: 7467 26116 ADS ADDRWD # TO Z COMPONENT.
045233,001265: 7470 52160 DXCH MPAC +3 # BRING SCALAR BACK, PUTTING Y RESULT IN
045234,001266: 7471 52155 DXCH MPAC # THE PROPER PLACE.
045235,001267: 7472 52160 DXCH MPAC +3
045236,001268: 7473 07130 TC DMPSUB
045237,001269: 7474 07161 TC VROUND
045238,001270:
045239,001271: 7475 52155 DXCH MPAC # PUT Z COMPONENT IN PROPER PLACE, ALSO
045240,001272: 7476 52162 DXCH MPAC +5 # POSITIONING X.
045241,001273: 7477 52155 DXCH MPAC
045242,001274:
045243,001275: 7500 16542 TCF VMODE # MODE HAS CHANGED TO VECTOR.
045244,001276:
Page 1040 |
045246,001278: # THE VECTOR CROSS PRODUCT ROUTINE CALCULATES (X M -X M ,X M -X M ,X M -X M ) WHERE M IS THE VECTOR IN
045247,001279: # 3 2 2 3 1 3 3 1 2 1 1 2
045248,001280: # MPAC AND X THE VECTOR AT THE GIVEN ADDRESS.
045249,001281:
045250,001282: 7501 00006 VXV EXTEND
045251,001283: 7502 30162 DCA MPAC +5 # FORM UP M3X1, LEAVING M1 IN VBUF.
045252,001284: 7503 52155 DXCH MPAC
045253,001285: 7504 52123 DXCH VBUF
045254,001286: 7505 07130 TC DMPSUB # BY X1.
045255,001287:
045256,001288: 7506 00006 EXTEND
045257,001289: 7507 40160 DCS MPAC +3 # CALCULATE -X1M2, SAVING X1M3 IN VBUF +2.
045258,001290: 7510 52155 DXCH MPAC
045259,001291: 7511 52125 DXCH VBUF +2
045260,001292: 7512 07130 TC DMPSUB
045261,001293:
045262,001294: 7513 34743 CAF TWO # ADVANCE ADDRWD TO X2.
045263,001295: 7514 26116 ADS ADDRWD
045264,001296: 7515 00006 EXTEND
045265,001297: 7516 40162 DCS MPAC +5 # PREPARE TO GET -X2M3, SAVING -X1M2 IN
045266,001298: 7517 52155 DXCH MPAC # MPAC +5.
045267,001299: 7520 52162 DXCH MPAC +5
045268,001300: 7521 07130 TC DMPSUB
045269,001301:
045270,001302: 7522 00006 EXTEND
045271,001303: 7523 30123 DCA VBUF # GET X2M1, SAVING -X2M3 IN VBUF +4.
045272,001304: 7524 52155 DXCH MPAC
045273,001305: 7525 52127 DXCH VBUF +4
045274,001306: 7526 07130 TC DMPSUB
045275,001307:
045276,001308: 7527 34743 CAF TWO # ADVANCE ADDRWD TO X3.
045277,001309: 7530 26116 ADS ADDRWD
045278,001310: 7531 00006 EXTEND
045279,001311: 7532 40123 DCS VBUF # GET -X3M1, ADDING X2M1 TO MPAC +5 TO
045280,001312: 7533 52155 DXCH MPAC # COMPLETE THE Z COMPONENT OF THE ANSWER.
045281,001313: 7534 20162 DAS MPAC +5
045282,001314:
045283,001315: 7535 00006 EXTEND
045284,001316: 7536 17540 BZF +2
045285,001317: 7537 07032 TC OVERFLWZ
045286,001318:
045287,001319: 7540 07130 TC DMPSUB
045288,001320: 7541 52125 DXCH VBUF +2 # MOVE X1M3 TO MPAC +3 SETTING UP FOR X3M2
045289,001321: 7542 52160 DXCH MPAC +3 # AND ADD -X3M1 TO MPAC +3 TO COMPLETE THE
045290,001322: 7543 52155 DXCH MPAC # Y COMPONENT OF THE RESULT.
045291,001323: 7544 20160 DAS MPAC +3
045292,001324:
045293,001325: 7545 00006 EXTEND
045294,001326: 7546 17550 BZF +2
Page 1041 |
045296,001328: 7547 07035 TC OVERFLWY
045297,001329:
045298,001330: 7550 07130 TC DMPSUB
045299,001331: 7551 52127 DXCH VBUF +4 # GO ADD -X2M3 TO X3M2 TO COMPLETE THE X
045300,001332: 7552 17021 TCF ENDVXV # COMPONENT (TAIL END OF DAD).
045301,001333:
045302,001334: # THE MPACVBUF SUBROUTINE SAVES THE VECTOR IN MPAC IN VBUF WITHOUT CLOBBERING MPAC.
045303,001335:
045304,001336: 7553 00006 MPACVBUF EXTEND # CALLED BY MXV, VXM, AND UNIT.
045305,001337: 7554 30155 DCA MPAC
045306,001338: 7555 52123 DXCH VBUF
045307,001339: 7556 00006 EXTEND
045308,001340: 7557 30160 DCA MPAC +3
045309,001341: 7560 52125 DXCH VBUF +2
045310,001342: 7561 00006 EXTEND
045311,001343: 7562 30162 DCA MPAC +5
045312,001344: 7563 52127 DXCH VBUF +4
045313,001345: 7564 00002 TC Q # RETURN TO CALLER.
045314,001346:
045315,001347:
045316,001348: # DOUBLE PRECISION SIGN AGREE ROUTINE. ARRIVE WITH INPUT IN A+L. OUTPUT IS IN A + L.
045317,001349:
045318,001350: 7565 10000 ALSIGNAG CCS A # TEST UPPER PART.
045319,001351: 7566 17572 TCF UPPOS # IT IS POSITIVE
045320,001352: 7567 00002 TC Q # ZERO
045321,001353: 7570 17602 TCF UPNEG # NEGATIVE
045322,001354: 7571 00002 TC Q # ZERO
045323,001355:
045324,001356: 7572 56001 UPPOS XCH L # SAVE DECREMENTED UPPER PART.
045325,001357: 7573 64727 AD HALF
045326,001358: 7574 64727 AD HALF
045327,001359: 7575 54000 TS A # SKIPS ON OVERFLOW
045328,001360: 7576 17600 TCF +2
045329,001361: 7577 24001 INCR L # RESTORE UPPER TO ROIGINAL VALUE
045330,001362: 7600 56001 XCH L # SWAP A + L BACK.
045331,001363: 7601 00002 TC Q
045332,001364:
045333,001365: 7602 56001 UPNEG XCH L # SAVE COMPLEMENTED + DECREMENTED UPPER PT
045334,001366: 7603 64726 AD NEGMAX
045335,001367: 7604 67770 AD NEGONE
045336,001368: 7605 54000 TS A
045337,001369: 7606 17610 TCF +2 # DONT INCREMENT IF NO OVERFLOW.
045338,001370: 7607 24001 INCR L
045339,001371: 7610 56001 XCH L
045340,001372: 7611 40000 COM # MAKE NEGATIVE AGAIN.
045341,001373: 7612 00002 TC Q
045342,001374:
Page 1042 |
045344,001376: # INTERPRETIVE INSTRUCTIONS WHOSE EXECUTION CONSISTS OF PRINCIPALLY CALLING SUBROUTINES.
045345,001377:
045346,001378: 7613 07130 DMP1 TC DMPSUB # DMP INSTRUCTION.
045347,001379: 7614 16102 TCF DANZIG
045348,001380:
045349,001381: 7615 07130 DMPR TC DMPSUB
045350,001382: 7616 07160 TC ROUNDSUB +1 # (C(A) = +0).
045351,001383: 7617 16102 TCF DANZIG
045352,001384:
045353,001385: 7620 00006 DDV EXTEND
045354,001386: 7621 50116 INDEX ADDRWD # MOVE DIVIDEND INTO BUF.
045355,001387: 7622 30001 DCA 0
045356,001388: 7623 17630 TCF BDDV +4
045357,001389:
045358,001390: 7624 00006 BDDV EXTEND # MOVE DIVISOR INTO MPAC SAVING MPAC, THE
045359,001391: 7625 50116 INDEX ADDRWD # DIVIDEND, IN BUF.
045360,001392: 7626 30001 DCA 0
045361,001393: 7627 52155 DXCH MPAC
045362,001394: 7630 52131 +4 DXCH BUF
045363,001395: 7631 34746 CAF ZERO # DIVIDE ROUTINES IN BANK 0.
045364,001396: 7632 54004 TS FBANK
045365,001397: 7633 12353 TCF DDV/BDDV
045366,001398:
045367,001399: 7634 30116 SETPD CA ADDRWD # MUST SET TO WORK AREA, OR EBANK TROUBLE.
045368,001400: 7635 54166 TS PUSHLOC
045369,001401: 7636 16104 TCF NOIBNKSW # NO FBANK SWITCH REQUIRED.
045370,001402:
045371,001403: 7637 34746 TSLC CAF ZERO # SHIFTING ROUTINES LOCATED IN BANK 00.
045372,001404: 7640 54004 TS FBANK
045373,001405: 7641 12172 TCF TSLC2
045374,001406:
045375,001407: 7642 36115 GSHIFT CAF LOW7 # USED AS MASK AT GENSHIFT. THIS PROCESSES
045376,001408: 7643 54004 TS FBANK # ANY SHIFT INSTRUCTION (EXCEPT TSLC) WITH
045377,001409: 7644 12214 TCF GENSHIFT # AN ADDRESS (ROUTINES IN BANK 0).
045378,001410:
Page 1043 |
045380,001412: # THE FOLLOWING IS THE PROLOGUE TO V/SC. IF THE PRESENT MODE IS VECTOR, IT SAVES THE SCALAR AT X IN BUF
045381,001413: # AND CALLS THE V/SC ROUTINE IN BANK 0. IF THE PRESENT MODE IS SCALAR, IT MOVES THE VECTOR AT X INTO MPAC, SAVING
045382,001414: # THE SCALAR IN MPAC IN BUF BEFORE CALLING THE V/SC ROUTINE IN BANK 0.
045383,001415:
045384,001416: 7645 10163 V/SC CCS MODE
045385,001417: 7646 17657 TCF DV/SC # MOVE VECTOR INTO MPAC.
045386,001418: 7647 17657 TCF DV/SC
045387,001419:
045388,001420: 7650 00006 VV/SC EXTEND
045389,001421: 7651 50116 INDEX ADDRWD
045390,001422: 7652 30001 DCA 0
045391,001423: 7653 52131 V/SC1 DXCH BUF # IN BOTH CASES, VECTOR IS NOW IN MPAC AND
045392,001424: 7654 34746 CAF ZERO # SCALAR IN BUF.
045393,001425: 7655 54004 TS FBANK
045394,001426: 7656 12654 TCF V/SC2
045395,001427:
045396,001428: 7657 00006 DV/SC EXTEND
045397,001429: 7660 50116 INDEX ADDRWD
045398,001430: 7661 30003 DCA 2
045399,001431: 7662 52160 DXCH MPAC +3
045400,001432: 7663 00006 EXTEND
045401,001433: 7664 50116 INDEX ADDRWD
045402,001434: 7665 30005 DCA 4
045403,001435: 7666 52162 DXCH MPAC +5
045404,001436:
045405,001437: 7667 44744 CS ONE # CHANGE MODE TO VECTOR.
045406,001438: 7670 54163 TS MODE
045407,001439:
045408,001440: 7671 00006 EXTEND
045409,001441: 7672 50116 INDEX ADDRWD
045410,001442: 7673 30001 DCA 0
045411,001443: 7674 52155 DXCH MPAC
045412,001444: 7675 17653 TCF V/SC1 # FINISH PROLOGUE AT COMMON SECTION.
045413,001445:
Page 1044 |
045415,001447: # SIGN AND COMPLEMENT INSTRUCTIONS.
045416,001448:
045417,001449: 7676 50116 SIGN INDEX ADDRWD # CALL COMP INSTRUCTION IF WORD AT X IS
045418,001450: 7677 10000 CCS 0 # NEGATIVE NON-ZERO.
045419,001451: 7700 16102 TCF DANZIG
045420,001452: 7701 17703 TCF +2
045421,001453: 7702 17711 TCF COMP # DO THE COMPLEMENT.
045422,001454:
045423,001455: 7703 50116 INDEX ADDRWD
045424,001456: 7704 10001 CCSL CCS 1
045425,001457: 7705 16102 TCF DANZIG
045426,001458: 7706 16102 TCF DANZIG
045427,001459: 7707 17711 TCF COMP
045428,001460: 7710 16102 TCF DANZIG
045429,001461: 7711 00006 COMP EXTEND # COMPLEMENT DP MPAC IN EVERY CASE.
045430,001462: 7712 40155 DCS MPAC
045431,001463: 7713 52155 DXCH MPAC
045432,001464:
045433,001465: 7714 10163 CCS MODE # EITHER COMPLEMENT MPAC +3 OR THE REST OF
045434,001466: 7715 17726 TCF DCOMP # THE VECTOR ACCUMULATOR.
045435,001467: 7716 17726 TCF DCOMP
045436,001468:
045437,001469: 7717 00006 EXTEND # VECTOR COMPLEMENT.
045438,001470: 7720 40160 DCS MPAC +3
045439,001471: 7721 52160 DXCH MPAC +3
045440,001472: 7722 00006 EXTEND
045441,001473: 7723 40162 DCS MPAC +5
045442,001474: 7724 52162 DXCH MPAC +5
045443,001475: 7725 16102 TCF DANZIG
045444,001476:
045445,001477: 7726 40156 DCOMP CS MPAC +2
045446,001478: 7727 54156 TS MPAC +2
045447,001479: 7730 16102 TCF DANZIG
045448,001480:
Page 1045 |
045450,001482: # THE FOLLOWING SHORT SHIFT CODES REQUIRE NO ADDRESS WORD:
045451,001483:
045452,001484: # 1. SR1 TO SR4 SCALAR SHIFT RIGHT.
045453,001485: # 2. SR1R TO SR4R SCALAR SHIFT RIGHT AND ROUND.
045454,001486: # 3. SL1 TO SL4 SCALAR SHIFT LEFT.
045455,001487: # 4. SL1R TO SL4R SCALAR SHIFT LEFT AND ROUND.
045456,001488:
045457,001489: # 5. VSR1 TO VSR8 VECTOR SHIFT RIGHT (ALWAYS ROUNDS).
045458,001490: # 6. VSL1 TO VSL8 VECTOR SHIFT LEFT (NEVER ROUNDS).
045459,001491:
045460,001492: # THE FOLLOWING CODES REQUIRE AN ADDRESS WHICH MAY BE INDEXED:*
045461,001493:
045462,001494: # 1. SR SCALAR SHIFT RIGHT.
045463,001495: # 2. SRR SCALAR SHIFT RIGHT AND ROUND.
045464,001496: # 3. SL SCALAR SHIFT LEFT.
045465,001497: # 4. SLR SCALAR SHIFT LEFT AND ROUND.
045466,001498:
045467,001499: # 5. VSR VECTOR SHIFT RIGHT.
045468,001500: # 6. VSL VECTOR SHIFT LEFT.
045469,001501:
045470,001502: # * IF THE ADDRESS IS INDEXED, AND THE INDEX MODIFICATION RESULTS IN A NEGATIVE SHIFT COUNT, A SHIFT OF THE
045471,001503: # ABSOLUTE VALUE OF THE COUNT IS DONE IN THE OPPOSITE DIRECTION.
045472,001504:
045473,001505:
045474,001506: 00,2017 BANK 00
045475,001507:
045476,001508: 00,2017 COUNT* $$/INTER
045477,001509: 00,2017 36263 SHORTT CAF SIX # SCALAR SHORT SHIFTS COME HERE. THE SHIFT
045478,001510: 00,2020 70020 MASK CYR # COUNT-1 IS NOW IN BITS 2-3 OF CYR. THE
045479,001511: 00,2021 54021 TS SR # ROUNDING BIT IS IN BIT1 AT THIS POINT.
045480,001512:
045481,001513: 00,2022 10020 CCS CYR # SEE IF RIGHT OR LEFT SHIFT DESIRED.
045482,001514: 00,2023 12101 TCF TSSL # SHIFT LEFT.
045483,001515:
045484,001516: 00,2024 00024 SRDDV DEC 20 B-14 # MPTEMP SETTING FOR SR BEFORE DDV.
045485,001517:
045486,001518: 00,2025 50021 TSSR INDEX SR # GET SHIFTING BIT.
045487,001519: 00,2026 34727 CAF BIT14
045488,001520: 00,2027 54135 TS MPTEMP
045489,001521:
045490,001522: 00,2030 10020 CCS CYR # SEE IF A ROUND IS DESIRED.
045491,001523: 00,2031 02050 RIGHTR TC MPACSRND # YES - SHIFT RIGHT AND ROUND.
045492,001524: 00,2032 16101 TCF NEWMODE # SET MODE TO DP (C(A) = 0).
045493,001525: 00,2033 30135 MPACSHR CA MPTEMP # DO A TRIPLE PRECISION SHIFT RIGHT.
045494,001526: 00,2034 00006 EXTEND
045495,001527: 00,2035 70156 MP MPAC +2
045496,001528: 00,2036 54156 +3 TS MPAC +2 # (EXIT FROM SQRT AND ABVAL).
045497,001529: 00,2037 30135 CA MPTEMP
045498,001530: 00,2040 00006 EXTEND
045499,001531: 00,2041 70154 MP MPAC # SHIFT MAJOR PART INTO A,L AND PLACE IN
Page 1046 |
045501,001533: 00,2042 52155 DXCH MPAC # MPAC,+1.
045502,001534: 00,2043 30135 CA MPTEMP
045503,001535: 00,2044 00006 EXTEND
045504,001536: 00,2045 70001 MP L # ORIGINAL C(MPAC +1).
045505,001537: 00,2046 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
045506,001538: 00,2047 16102 TCF DANZIG
045507,001539:
045508,001540: # MPAC SHIFT RIGHT AND ROUND SUBROUTINES.
045509,001541:
045510,001542: 00,2050 30156 MPACSRND CA MPAC +2 # WE HAVE TO DO ALL THREE MULTIPLIES SINCE
045511,001543: 00,2051 00006 EXTEND # MPAC +1 AND MPAC +2 MIGHT HAVE SIGN
045512,001544: 00,2052 70135 MP MPTEMP # DISAGREEMENT WITH A SHIFT RIGHT OF 1.
045513,001545: 00,2053 56155 XCH MPAC +1
045514,001546: 00,2054 00006 EXTEND
045515,001547: 00,2055 70135 MP MPTEMP
045516,001548: 00,2056 56155 XCH MPAC +1 # TRIAL MINOR PART.
045517,001549: 00,2057 60001 AD L
045518,001550:
045519,001551: 00,2060 60000 VSHR2 DOUBLE # (FINISH VECTOR COMPONENT SHIFT RIGHT
045520,001552: 00,2061 54156 TS MPAC +2 # AND ROUND.
045521,001553: 00,2062 12064 TCF +2
045522,001554: 00,2063 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
045523,001555:
045524,001556: 00,2064 34746 CAF ZERO
045525,001557: 00,2065 54156 TS MPAC +2
045526,001558: 00,2066 56154 XCH MPAC # SETTING TO ZERO SO FOLLOWING DAS WORKS.
045527,001559: 00,2067 00006 EXTEND
045528,001560: 00,2070 70135 MP MPTEMP
045529,001561: 00,2071 20155 DAS MPAC # AGAIN NO OVERFLOW.
045530,001562: 00,2072 00002 TC Q
045531,001563:
045532,001564: 00,2073 30135 VSHRRND CA MPTEMP # ENTRY TO SHIFT RIGHT AND ROUND MPAC WHEN
045533,001565: 00,2074 00006 EXTEND # MPAC CONTAINS A VECTOR COMPONENT.
045534,001566: 00,2075 70155 MP MPAC +1
045535,001567: 00,2076 54155 TS MPAC +1
045536,001568: 00,2077 56001 XCH L
045537,001569: 00,2100 12060 TCF VSHR2 # GO ADD ONE IF NECESSARY AND FINISH.
045538,001570:
Page 1047 |
045540,001572: # ROUTINE FOR SHORT SCALAR SHIFT LEFT (AND MAYBE ROUND).
045541,001573:
045542,001574: 00,2101 30021 TSSL CA SR # GET SHIFT COUNT FOR SR.
045543,001575: 00,2102 54135 +1 TS MPTEMP
045544,001576:
045545,001577: 00,2103 00006 +2 EXTEND # ENTRY HERE FROM SL FOR SCALARS.
045546,001578: 00,2104 30156 DCA MPAC +1 # SHIFTING LEFT ONE PLACE AT A TIME IS
045547,001579: 00,2105 20156 DAS MPAC +1 # FASTER THAN DOING THE WHOLE SHIFT WITH
045548,001580: 00,2106 60154 AD MPAC # MULTIPLIES ASSUMING THAT FREQUENCY OF
045549,001581: 00,2107 60154 AD MPAC # SHIFT COUNTS GOES DOWN RAPIDLY AS A
045550,001582: 00,2110 54154 TS MPAC # FUNCTION OF THEIR MAGNITUDE.
045551,001583: 00,2111 12113 TCF +2
045552,001584: 00,2112 54121 TS OVFIND # OVERFLOW. (LEAVES OVERFLOW-CORRECTED
045553,001585: # RESULT ANYWAY).
045554,001586: 00,2113 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNT.
045555,001587: 00,2114 12102 TCF TSSL +1
045556,001588:
045557,001589: 00,2115 10020 CCS CYR # SEE IF ROUND WANTED.
045558,001590: 00,2116 07157 ROUND TC ROUNDSUB # YES - ROUND AND EXIT.
045559,001591: 00,2117 16102 TCF DANZIG # SL LEAVES A ZERO IN CYR FOR NO ROUND.
045560,001592: 00,2120 16102 TCF DANZIG # NO - EXIT IMMEDIATL
045561,001593:
Page 1048 |
045563,001595: # VECTOR SHIFTING ROUTINES.
045564,001596:
045565,001597: 00,2121 34750 SHORTV CAF LOW3 # SAVE 3 BIT SHIFT COUNT - 1 WITHOUT
045566,001598: 00,2122 70020 MASK CYR # EDITING CYR.
045567,001599: 00,2123 54135 TS MPTEMP
045568,001600: 00,2124 10020 CCS CYR # SEE IF LEFT OR RIGHT SHIFT.
045569,001601: 00,2125 12145 TCF VSSL # VECTOR SHIFT LEFT.
045570,001602: 00,2126 00176 OCT176 OCT 176 # USED IN PROCESSED SHIFTS WITH - COUNT.
045571,001603:
045572,001604: 00,2127 50135 VSSR INDEX MPTEMP # (ENTRY FROM SR). PICK UP SHIFTING BIT.
045573,001605: 00,2130 34727 CAF BIT14 # MPTEMP CONTAINS THE SHIFT COUNT - 1.
045574,001606: 00,2131 54135 TS MPTEMP
045575,001607: 00,2132 02073 TC VSHRRND # SHIFT X COMPONENT.
045576,001608:
045577,001609: 00,2133 52155 DXCH MPAC # SWAP X AND Y COMPONENTS.
045578,001610: 00,2134 52160 DXCH MPAC +3
045579,001611: 00,2135 52155 DXCH MPAC
045580,001612: 00,2136 02073 TC VSHRRND # SHIFT Y COMPONENT.
045581,001613:
045582,001614: 00,2137 52155 DXCH MPAC # SWAP Y AND Z COMPONENTS.
045583,001615: 00,2140 52162 DXCH MPAC +5
045584,001616: 00,2141 52155 DXCH MPAC
045585,001617: 00,2142 02073 TC VSHRRND # SHIFT Z COMPONENT.
045586,001618:
045587,001619: 00,2143 17441 TCF VROTATEX # RESTORE COMPONENTS TO PROPER PLACES.
045588,001620:
Page 1049 |
045590,001622: # VECTOR SHIFT LEFT - DONE ONE PLACE AT A TIME.
045591,001623:
045592,001624: 00,2144 54135 -1 TS MPTEMP # SHIFTING LOOP.
045593,001625:
045594,001626: 00,2145 00006 VSSL EXTEND
045595,001627: 00,2146 30155 DCA MPAC
045596,001628: 00,2147 20155 DAS MPAC
045597,001629: 00,2150 00006 EXTEND
045598,001630: 00,2151 12153 BZF +2
045599,001631: 00,2152 07040 TC OVERFLOW
045600,001632:
045601,001633: 00,2153 00006 EXTEND
045602,001634: 00,2154 30160 DCA MPAC +3
045603,001635: 00,2155 20160 DAS MPAC +3
045604,001636: 00,2156 00006 EXTEND
045605,001637: 00,2157 12161 BZF +2
045606,001638: 00,2160 07035 TC OVERFLWY
045607,001639:
045608,001640: 00,2161 00006 EXTEND
045609,001641: 00,2162 30162 DCA MPAC +5
045610,001642: 00,2163 20162 DAS MPAC +5
045611,001643: 00,2164 00006 EXTEND
045612,001644: 00,2165 12167 BZF +2
045613,001645: 00,2166 07032 TC OVERFLWZ
045614,001646:
045615,001647: 00,2167 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNTER.
045616,001648: 00,2170 12144 TCF VSSL -1
045617,001649: 00,2171 16102 TCF DANZIG # EXIT.
045618,001650:
Page 1050 |
045620,001652: # TSLC - TRIPLE SHIFT LEFT AND COUNT. SHIFTS MPAC LEFT UNTIL GREATER THAN .5 IN MAGNITUDE, LEAVING
045621,001653: # THE COMPLEMENT OF THE NUMBER OF SHIFTS REQUIRED IN X.
045622,001654:
045623,001655: 00,2172 54135 TSLC2 TS MPTEMP # START BY ZEROING SHIFT COUNT (IN A NOW).
045624,001656: 00,2173 06744 TC BRANCH # EXIT WITH NO SHIFTING IF ARGUMENT ZERO.
045625,001657: 00,2174 12176 TCF +2
045626,001658: 00,2175 12212 TCF ENDTSLC # STORES ZERO SHIFT COUNT IN THIS CASE.
045627,001659:
045628,001660: 00,2176 07300 TC TPAGREE # MAY CAUSE UPSHIFT OF ONE EXTRA PLACE.
045629,001661:
045630,001662: 00,2177 30154 CA MPAC # BEGIN NORMALIZATION LOOP.
045631,001663: 00,2200 12207 TCF TSLCTEST
045632,001664:
045633,001665: 00,2201 24135 TSLCLOOP INCR MPTEMP # INCREMENT SHIFT COUNTER.
045634,001666: 00,2202 00006 EXTEND
045635,001667: 00,2203 30156 DCA MPAC +1
045636,001668: 00,2204 20156 DAS MPAC +1
045637,001669: 00,2205 60154 AD MPAC
045638,001670: 00,2206 26154 ADS MPAC
045639,001671: 00,2207 60000 TSLCTEST DOUBLE # SEE IF (ANOTHER) SHIFT IS REQUIRED.
045640,001672: 00,2210 54000 OVSK
045641,001673: 00,2211 12201 TCF TSLCLOOP # YES - INCREMENT COUNT AND SHIFT AGAIN.
045642,001674:
045643,001675: 00,2212 40135 ENDTSLC CS MPTEMP
045644,001676: 00,2213 16644 TCF STORE1 # STORE SHIFT COUNT AND RETURN TO DANZIG.
045645,001677:
Page 1051 |
045647,001679: # THE FOLLOWING ROUTINES PROCESSES THE GENERAL SHIFT INSTRUCTIONS SR, SRR, SL, AND SLR.
045648,001680: # THE GIVEN ADDRESS IS DECODED AS FOLLOWS:
045649,001681:
045650,001682: # BITS 1-7 SHIFT COUNT (SUBADDRESS) LESS THAN 125 DECIMAL.
045651,001683: # BIT 8 PSEUDO SIGN BIT (DETECTS CHANGE IN SIGN IN INDEXED SHIFTS).
045652,001684: # BIT 9 0 FOR LEFT SHIFT, AND 1 FOR RIGHT SHIFT.
045653,001685: # BIT 10 1 FOR TERMINAL ROUND ON SCALAR SHIFTS, 0 OTHERWISE.
045654,001686: # BITS 11-13 0.
045655,001687: # BIT 14 1.
045656,001688: # BIT 15 0.
045657,001689:
045658,001690: # THE ABOVE ENCODING IS DONE BY THE YUL SYSTEM.
045659,001691:
045660,001692:
045661,001693: 00,2214 70116 GENSHIFT MASK ADDRWD # GET SHIFT COUNT, TESTING FOR ZERO.
045662,001694: 00,2215 10000 CCS A # (ARRIVES WITH C(A) = LOW7).
045663,001695: 00,2216 12224 TCF GENSHFT2 # IF NON-ZERO, PROCEED WITH DECREMENTED CT
045664,001696:
045665,001697: 00,2217 34733 CAF BIT10 # ZERO SHIFT COUNT. NO SHIFTS NEEDED BUT
045666,001698: 00,2220 70116 MASK ADDRWD # WE MIGHT HAVE TO ROUND MPAC ON SLR AND
045667,001699: 00,2221 10000 CCS A # SRR (SCALAR ONLY).
045668,001700: 00,2222 07157 TC ROUNDSUB
045669,001701: 00,2223 16102 TCF DANZIG
045670,001702:
045671,001703: 00,2224 54135 GENSHFT2 TS MPTEMP # DECREMENTED SHIFT COUNT TO MPTEMP.
045672,001704: 00,2225 34735 CAF BIT8 # TEST MEANING OF LOW SEVEN BIT COUNT IN
045673,001705: 00,2226 00006 EXTEND # MPTEMP NOW.
045674,001706: 00,2227 70116 MP ADDRWD
045675,001707: 00,2230 76266 MASK LOW2 # JUMPS ON SHIFT DIRECTION (BIT8) AND
045676,001708: 00,2231 50000 INDEX A
045677,001709: 00,2232 12233 TCF +1 # ORIGINAL SHIFT DIRECTION (BIT 9).
045678,001710: 00,2233 12332 TCF RIGHT- # NEGATIVE SHIFT COUNT FOR SL OR SLR.
045679,001711: 00,2234 12342 TCF LEFT # SL OR SLR.
045680,001712: 00,2235 12336 TCF LEFT- # NEGATIVE SHIFT COUNT WITH SR OR SRR.
045681,001713:
Page 1052 |
045683,001715: # GENERAL SHIFT RIGHT.
045684,001716:
045685,001717: 00,2236 10163 RIGHT CCS MODE # SEE IF VECTOR OR SCALAR.
045686,001718: 00,2237 12277 TCF GENSCR
045687,001719: 00,2240 12277 TCF GENSCR
045688,001720:
045689,001721: 00,2241 30135 CA MPTEMP # SEE IF SHIFT COUNT LESS THAN 14D.
045690,001722: 00,2242 63733 VRIGHT2 AD NEG12
045691,001723: 00,2243 00006 EXTEND
045692,001724: 00,2244 62127 BZMF VSSR # IF SO, BRANCH AND SHIFT IMMEDIATELY.
045693,001725:
045694,001726: 00,2245 67770 AD NEGONE # IF NOT, REDUCE MPTEMP BY A TOTAL OF 14,
045695,001727: 00,2246 54135 TS MPTEMP # AND DO A SHIFT RIGHT AND ROUND BY 14.
045696,001728: 00,2247 34746 CAF ZERO # THE ROUND AT THIS STAGE MAY INTRODUCE A
045697,001729: 00,2250 54001 TS L # ONE BIT ERROR IN A SHIFT RIGHT 15D.
045698,001730: 00,2251 56154 XCH MPAC
045699,001731: 00,2252 56155 XCH MPAC +1
045700,001732: 00,2253 02272 TC SETROUND # X COMPONENT NOW SHIFTED, SO MAKE UP THE
045701,001733: 00,2254 20155 DAS MPAC # ROUNDING QUANTITY (0 IN A AND 0 OR +-1
045702,001734: # IN L).
045703,001735: 00,2255 56157 XCH MPAC +3 # REPEAT THE ABOVE PROCESS FOR Y AND Z.
045704,001736: 00,2256 56160 XCH MPAC +4
045705,001737: 00,2257 02272 TC SETROUND
045706,001738: 00,2260 20160 DAS MPAC +3 # NO OVERFLOW ON THESE ADDS.
045707,001739:
045708,001740: 00,2261 56161 XCH MPAC +5
045709,001741: 00,2262 56162 XCH MPAC +6
045710,001742: 00,2263 02272 TC SETROUND
045711,001743: 00,2264 20162 DAS MPAC +5
045712,001744:
045713,001745: 00,2265 10135 CCS MPTEMP # SEE IF DONE, DOING FINAL DECREMENT.
045714,001746: 00,2266 54135 TS MPTEMP
045715,001747: 00,2267 12242 TCF VRIGHT2
045716,001748: 00,2270 04604 BIASLO DEC .2974 B-1 # SQRT CONSTANT
045717,001749:
045718,001750: 00,2271 16102 TCF DANZIG
045719,001751:
045720,001752: 00,2272 60000 SETROUND DOUBLE # MAKES UP ROUNDING QUANTITY FROM ARRIVING
045721,001753: 00,2273 54156 TS MPAC +2 # C(A). L IS ZERO INITIALLY.
045722,001754: 00,2274 34746 CAF ZERO
045723,001755: 00,2275 56001 XCH L
045724,001756: 00,2276 00002 TC Q # RETURN AND DO THE DAS, RESETTING L TO 0.
045725,001757:
Page 1053 |
045727,001759: # PROCESS SR AND SRR FOR SCALARS.
045728,001760:
045729,001761: 00,2277 30135 GENSCR CA MPTEMP # SEE IF THE ORIGINAL SHIFT COUNT WAS LESS
045730,001762: 00,2300 63733 +1 AD NEG12 # THAN 14D.
045731,001763: 00,2301 00006 EXTEND
045732,001764: 00,2302 62322 BZMF DOSSHFT # DO THE SHIFT IMMEDIATELY IF SO.
045733,001765:
045734,001766: 00,2303 67770 +4 AD NEGONE # IF NOT, DECREMENT SHIFT COUNT BY 14D AND
045735,001767: 00,2304 54135 TS MPTEMP # SHIFT MPAC RIGHT 14 PLACES.
045736,001768: 00,2305 34746 CAF ZERO
045737,001769: 00,2306 56154 XCH MPAC
045738,001770: 00,2307 56155 XCH MPAC +1
045739,001771: 00,2310 54156 TS MPAC +2
045740,001772: 00,2311 10135 CCS MPTEMP # SEE IF FINISHED, DO FINAL DECREMENT.
045741,001773: 00,2312 54135 TS MPTEMP
045742,001774: 00,2313 02300 TC GENSCR +1
045743,001775: 00,2314 22650 SLOPEHI DEC .5884 # SQRT CONSTANT.
045744,001776: 00,2315 34733 CAF BIT10 # FINISHED WITH SHIFT. SEE IF ROUND
045745,001777: 00,2316 70116 MASK ADDRWD # WANTED.
045746,001778: 00,2317 10000 CCS A
045747,001779: 00,2320 07157 TC ROUNDSUB
045748,001780: 00,2321 16102 TCF DANZIG # DO SO AND/OR EXIT.
045749,001781:
045750,001782: 00,2322 50135 DOSSHFT INDEX MPTEMP # PICK UP SHIFTING BIT.
045751,001783: 00,2323 34727 CAF BIT14
045752,001784: 00,2324 54135 TS MPTEMP
045753,001785: 00,2325 34733 CAF BIT10 # SEE IF TERMINAL ROUND DESIRED.
045754,001786: 00,2326 70116 MASK ADDRWD
045755,001787: 00,2327 10000 CCS A
045756,001788: 00,2330 12031 TCF RIGHTR # YES.
045757,001789: 00,2331 12033 TCF MPACSHR # JUST SHIFT RIGHT.
045758,001790:
Page 1054 |
045760,001792: # PROCESS THE RIGHT- (SL(R) WITH A NEGATIVE COUNT), LEFT-, AND LEFT OPTIONS.
045761,001793:
045762,001794: 00,2332 40135 RIGHT- CS MPTEMP # GET ABSOLUTE VALUE - 1 OF SHIFT COUNT
045763,001795: 00,2333 62126 AD OCT176 # UNDERSTANDING THAT BIT8 (PSEUDO-SIGN)
045764,001796: 00,2334 54135 TS MPTEMP # WAS 1 INITIALLY.
045765,001797: 00,2335 12236 TCF RIGHT # DO NORMAL SHIFT RIGHT.
045766,001798:
045767,001799: 00,2336 42126 LEFT- CS OCT176 # SAME PROLOGUE TO LEFT FOR INDEXED RIGHT
045768,001800: 00,2337 60135 AD MPTEMP # SHIFTS WHOSE NET SHIFT COUNT IS NEGATIVE
045769,001801: 00,2340 40000 COM
045770,001802: 00,2341 54135 TS MPTEMP
045771,001803:
045772,001804: 00,2342 10163 LEFT CCS MODE # SINCE LEFT SHIFTING IS SONE ONE PLACE AT
045773,001805: 00,2343 12346 TCF GENSCL # A TIME, NO COMPARISON WITH 14 NEED BE
045774,001806: 00,2344 12346 TCF GENSCL # DONE. FOR SCALARS, SEE IF TERMINAL ROUND
045775,001807: 00,2345 12145 TCF VSSL # DESIRED. FOR VECTORS, SHIFT IMMEDIATELY.
045776,001808:
045777,001809: 00,2346 40116 GENSCL CS ADDRWD # PUT ROUNDING BIT (BIT 10 OF ADDRWD)INTO
045778,001810: 00,2347 00006 EXTEND # BIT 15 OF CYR WHERE THE ROUNDING BIT OF
045779,001811: 00,2350 74737 MP BIT6 # A SHORT SHIFT LEFT WOULD BE
045780,001812: 00,2351 54020 TS CYR
045781,001813: 00,2352 12103 TCF TSSL +2 # DO THE SHIFT.
045782,001814:
Page 1055 |
045784,001816: # SCALAR DIVISION INSTRUCTIONS, DDV AND BDDV, ARE EXECUTED HERE. AT THIS POINT, THE DIVIDEND IS IN MPAC
045785,001817: # AND THE DIVISOR IN BUF.
045786,001818:
045787,001819: 00,2353 44744 DDV/BDDV CS ONE # INITIALIZATION.
045788,001820: 00,2354 54136 TS DVSIGN # +-1 FOR POSITIVE QUOTIENT - -0 FOR NEG.
045789,001821: 00,2355 54137 TS DVNORMCT # DIVIDEND NORMALIZATION COUNT.
045790,001822: 00,2356 54140 TS MAXDVSW # NEAR-ONE DIVIDE FLAG.
045791,001823:
045792,001824: 00,2357 10130 CCS BUF # FORCE BUF POSITIVE WITH THE MAJOR PART
045793,001825: 00,2360 12516 TCF BUFPOS # NON-ZERO.
045794,001826: 00,2361 12363 TCF +2
045795,001827: 00,2362 12531 TCF BUFNEG
045796,001828:
045797,001829: 00,2363 54156 BUFZERO TS MPAC +2 # ZERO THIS.
045798,001830: 00,2364 07300 TC TPAGREE # FORCE SIGN AGREEMENT BEFORE OVERFLOW
045799,001831:
045800,001832: 00,2365 10154 CCS MPAC # TEST TO SEE IF MPAC NON-ZERO. (TOO BIG)
045801,001833: 00,2366 12414 TCF OVF+ # MAJOR PART OF DIVIDEND IS POSITIVE NON-0
045802,001834: 00,2367 12371 TCF +2
045803,001835: 00,2370 12413 TCF OVF+ -1 # MAJOR PART OF DIVIDEND IS NEG. NON-ZERO
045804,001836:
045805,001837: 00,2371 56131 XCH BUF +1 # SHIFT DIVIDEND AND DIVISOR LEFT 14.
045806,001838: 00,2372 56130 XCH BUF
045807,001839: 00,2373 56155 XCH MPAC +1
045808,001840: 00,2374 56154 XCH MPAC
045809,001841: 00,2375 10130 CCS BUF # TRY AGAIN ON FORMER MINOR PART.
045810,001842: 00,2376 12422 TCF BUF+
045811,001843: 00,2377 12401 TCF +2 # OVERFLOW ON ZERO DIVISOR.
045812,001844: 00,2400 12416 TCF BUF-
045813,001845:
045814,001846: 00,2401 40154 CS MPAC # SIGN OF MPAC DETERMINES SIGN OF RESULT.
045815,001847: 00,2402 00006 SGNDVOVF EXTEND
045816,001848: 00,2403 62405 BZMF +2
045817,001849: 00,2404 24136 INCR DVSIGN # NEGMAX IN MPAC PERHAPS.
045818,001850: 00,2405 34724 DVOVF CAF POSMAX # ON DIVISION OVERFLOW OF ANY SORT, SET
045819,001851: 00,2406 54154 TS MPAC # SET DP MPAC TO +-POSMAX.
045820,001852: 00,2407 02630 TC FINALDV +3
045821,001853: 00,2410 34744 CAF ONE # SET OVERFLOW INDICATOR AND EXIT.
045822,001854: 00,2411 54121 TS OVFIND
045823,001855: 00,2412 06102 TC DANZIG
045824,001856:
045825,001857: 00,2413 24136 -1 INCR DVSIGN
045826,001858: 00,2414 40131 OVF+ CS BUF +1 # LOAD LOWER ORDER PART OF DIVISOR.
045827,001859: 00,2415 12402 TCF SGNDVOVF # GET SIGN OF RESULT.
045828,001860:
045829,001861: 00,2416 00006 BUF- EXTEND # IF BUF IS NEGATIVE, COMPLEMENT IT AND
045830,001862: 00,2417 40131 DCS BUF # MAINTAIN DVSIGN FOR FINAL QUOTIENT SIGN.
045831,001863: 00,2420 52131 DXCH BUF
045832,001864: 00,2421 24136 INCR DVSIGN # NOW -0.
045833,001865:
Page 1056 |
045835,001867: 00,2422 10154 BUF+ CCS MPAC # FORCE MPAC POSITIVE, CHECKING FOR ZERO
045836,001868: 00,2423 12437 TCF MPAC+ # DIVIDEND IN THE PROCESS.
045837,001869: 00,2424 12426 TCF +2
045838,001870: 00,2425 12433 TCF MPAC-
045839,001871: 00,2426 10155 CCS MPAC +1
045840,001872: 00,2427 12437 TCF MPAC+
045841,001873: 00,2430 16102 TCF DANZIG # EXIT IMMEDIATELY ON ZERO DIVIDEND.
045842,001874: 00,2431 12433 TCF MPAC-
045843,001875: 00,2432 16102 TCF DANZIG
045844,001876:
045845,001877: 00,2433 00006 MPAC- EXTEND # FORCE MPAC POSITIVE AS BUF IN BUF-.
045846,001878: 00,2434 40155 DCS MPAC
045847,001879: 00,2435 52155 DXCH MPAC
045848,001880: 00,2436 24136 INCR DVSIGN # NOW +1 OR -0.
045849,001881:
Page 1057 |
045851,001883: 00,2437 40154 MPAC+ CS MPAC # CHECK FOR DIVISION OVERFLOW. IF THE
045852,001884: 00,2440 67770 AD NEGONE # MAJOR PART OF THE DIVIDEND IS LESS THAN
045853,001885: 00,2441 60130 AD BUF # THE MAJOR PART OF THE DIVISOR BY AT
045854,001886: 00,2442 10000 CCS A # LEAST TWO, WE CAN PROCEED IMMEDIATELY
045855,001887: 00,2443 12505 TCF DVNORM # WITHOUT NORMALIZATION PRODUCING A DVMAX.
045856,001888: 00,2444 60001 -1/2+2 OCT 60001 # USED IN SQRTSUB.
045857,001889:
045858,001890: 00,2445 12446 TCF +1 # IF THE ABOVE DOES NOT HOLD, FORCE SIGN
045859,001891: 00,2446 34727 CAF HALF # AGREEMENT IN NUMERATOR AND DENOMINATOR
045860,001892: 00,2447 60000 DOUBLE # TO FACILITATE OVERFLOW AND NEAR-ONE
045861,001893: 00,2450 60155 AD MPAC +1 # CHECKING.
045862,001894: 00,2451 54155 TS MPAC +1
045863,001895: 00,2452 34746 CAF ZERO
045864,001896: 00,2453 64724 AD POSMAX
045865,001897: 00,2454 26154 ADS MPAC
045866,001898:
045867,001899: 00,2455 34727 CAF HALF # SAME FOR BUF.
045868,001900: 00,2456 60000 DOUBLE
045869,001901: 00,2457 60131 AD BUF +1
045870,001902: 00,2460 54131 TS BUF +1
045871,001903: 00,2461 34746 CAF ZERO
045872,001904: 00,2462 64724 AD POSMAX
045873,001905: 00,2463 26130 ADS BUF
045874,001906:
045875,001907: 00,2464 40154 CS MPAC # CHECK MAGNITUDE OF SIGN-CORRECTED
045876,001908: 00,2465 60130 AD BUF # OPERANDS.
045877,001909: 00,2466 10000 CCS A
045878,001910: 00,2467 12505 TCF DVNORM # DIVIDE OK - WILL NOT BECOME MAXDV CASE.
045879,001911: 00,2470 00133 LBUF2 ADRES BUF2
045880,001912: 00,2471 12405 TCF DVOVF # DIVISOR NOT LESS THAN DIVIDEND - OVF.
045881,001913:
045882,001914: 00,2472 54140 TS MAXDVSW # IF THE MAJOR PARTS OF THE DIVIDEND AND
045883,001915: 00,2473 40155 CS MPAC +1 # DIVISOR ARE EQUAL, A SPECIAL APPROXIMA-
045884,001916: 00,2474 60131 AD BUF +1 # TION IS USED (PROVIDED THE DIVISION IS
045885,001917: 00,2475 00006 EXTEND # POSSIBLE, OF COURSE).
045886,001918: 00,2476 62405 BZMF DVOVF
045887,001919: 00,2477 12505 TCF DVNORM # IF NO OVERFLOW.
045888,001920:
Page 1058 |
045890,001922: 00,2500 00006 BUFNORM EXTEND # ADD -1 TO AUGMENT SHIFT COUNT AND SHIFT
045891,001923: 00,2501 24137 AUG DVNORMCT # LEFT ONE PLACE.
045892,001924: 00,2502 00006 EXTEND
045893,001925: 00,2503 30131 DCA BUF
045894,001926: 00,2504 20131 DAS BUF
045895,001927:
045896,001928: 00,2505 30130 DVNORM CA BUF # SEE IF DIVISOR NORMALIZED YET.
045897,001929: 00,2506 60000 DOUBLE
045898,001930: 00,2507 54000 OVSK
045899,001931: 00,2510 12500 TCF BUFNORM # NO - SHIFT LEFT ONE AND TRY AGAIN.
045900,001932:
045901,001933: 00,2511 52155 DXCH MPAC # CALL DIVIDEND NORMALIZATION SEQUENCE
045902,001934: 00,2512 50137 INDEX DVNORMCT # PRIOR TO DOING THE DIVIDE.
045903,001935: 00,2513 02565 TC MAXTEST
045904,001936:
045905,001937: 00,2514 54156 TS MPAC +2 # RETURNS WITH DIVISION DONE AND C(A) = 0.
045906,001938: 00,2515 16102 TCF DANZIG
045907,001939:
045908,001940: 00,2516 10000 BUFPOS CCS A
045909,001941: 00,2517 12422 TCF BUF+ # TO BUF+ IF BUF IS GREATER THAN +1.
045910,001942:
045911,001943: 00,2520 40131 CS BUF +1 # IF BUF IS +1, FORCING SIGN AGREEMENT
045912,001944: 00,2521 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
045913,001945: 00,2522 62422 BZMF BUF+ # BRANCH IF SIGNS AGREE.
045914,001946:
045915,001947: 00,2523 34727 CA HALF # SIGNS DISAGREE. FORCE AGREEMENT.
045916,001948: 00,2524 60000 +6 DOUBLE
045917,001949: 00,2525 26131 ADS BUF +1
045918,001950: 00,2526 34746 CA ZERO
045919,001951: 00,2527 54130 TS BUF
045920,001952: 00,2530 12363 TCF BUFZERO
045921,001953:
045922,001954: 00,2531 10000 BUFNEG CCS A
045923,001955: 00,2532 12416 TCF BUF- # TO BUF- IF BUF IS LESS THAN -1.
045924,001956:
045925,001957: 00,2533 30131 CA BUF +1 # IF BUF IS -1, FORCING SIGN AGREEMENT
045926,001958: 00,2534 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
045927,001959: 00,2535 62416 BZMF BUF- # BRANCH IF SIGNS AGREE.
045928,001960:
045929,001961: 00,2536 44727 CS HALF # SIGNS DISAGREE. FORCE AGREEMENT.
045930,001962: 00,2537 12524 TCF BUFPOS +6
045931,001963:
Page 1059 |
045933,001965: # THE FOLLOWING ARE PROLOGUES TO SHIFT THE DIVIDEND ARRIVING IN A AND L BEFORE THE DIVIDE.
045934,001966:
045935,001967: 00,2540 22021 -21D LXCH SR # SPECIAL PROLOGUE FOR UNIT WHEN THE
045936,001968: 00,2541 00006 EXTEND # LENGTH OF THE ARGUMENT WAS NOT LESS THAN
045937,001969: 00,2542 74727 MP HALF # .5. IN THIS CASE, EACH COMPONENT MUST BE
045938,001970: 00,2543 56001 XCH L # SHIFTED RIGHT ONE TO PRODUCE A HALF-UNIT
045939,001971: 00,2544 60021 AD SR # VECTOR.
045940,001972: 00,2545 56001 XCH L
045941,001973: 00,2546 12571 TCF GENDDV +1 # WITH DP DIVIDEND IN A,L.
045942,001974:
045943,001975: 00,2547 20001 DDOUBL # PROLOGUE WHICH NORMALIZES THE DIVIDEND
045944,001976: 00,2550 20001 DDOUBL # WHEN IT IS KNOWN THAT NO DIVISION
045945,001977: 00,2551 20001 DDOUBL # OVERFLOW WILL OCCUR.
045946,001978: 00,2552 20001 DDOUBL
045947,001979: 00,2553 20001 DDOUBL
045948,001980: 00,2554 20001 DDOUBL
045949,001981: 00,2555 20001 DDOUBL
045950,001982: 00,2556 20001 DDOUBL
045951,001983: 00,2557 20001 DDOUBL
045952,001984: 00,2560 20001 DDOUBL
045953,001985: 00,2561 20001 DDOUBL
045954,001986: 00,2562 20001 DDOUBL
045955,001987: 00,2563 20001 DDOUBL
045956,001988: 00,2564 52155 DXCH MPAC
045957,001989:
045958,001990: 00,2565 10140 MAXTEST CCS MAXDVSW # 0 IF MAJORS MIGHT BE =, -1 OTHERWISE.
045959,001991: 00,2566 06552 BIASHI DEC .4192 B-1 # SQRT CONSTANTS
045960,001992:
045961,001993: 00,2567 12642 TCF MAXDV # CHECK TO SEE IF THEY ARE NOW EQUAL.
045962,001994:
Page 1060 |
045964,001996: # THE FOLLOWING IS A GENERAL PURPOSE DOUBLE PRECISION DIVISION ROUTINE. IT DIVIDES MPAC BY BUF AND LEAVES
045965,001997: # THE RESULT IN MPAC. THE FOLLOWING CONDITIONS MUST BE SATISFIED:
045966,001998:
045967,001999: # 1. THE DIVISOR (BUF) MUST BE POSITIVE AND NOT LESS THAN .5.
045968,002000:
045969,002001: # 2. THE DIVIDEND (MPAC) MUST BE POSITIVE WITH THE MAJOR PART OF MPAC STRICTLY LESS THAN THAT OF BUF
045970,002002: # (A SPECIAL APPROXIMATION, MAXDV, IS USED WHEN THE MAJOR PARTS ARE EQUAL).
045971,002003:
045972,002004: # UNDERSTANDING THAT A/B = Q + S(R/B) WHERE S = 2(-14) AND Q AND R ARE QUOTIENT AND REMAINDER, RESPEC-
045973,002005: # TIVELY, THE FOLLOWING APPROXIMATION IS OBTAINED BY MULTIPLYING ABOVE AND BELOW BY C - SD AND NEGLECTING TERMS OF
045974,002006: # ORDER S-SQUARED (POSSIBLY INTRODUCING ERROR INTO THE LOW TWO BITS OF THE RESULT). SIGN AGREEMENT IS UNNECESSARY.
045975,002007:
045976,002008: # A + SB . (R - QD) A + SB
045977,002009: # ------ = Q + S(------) WHERE Q AND R ARE QUOTIENT AND REMAINDER OF ------ RESPECTIVELY.
045978,002010: # C + SD ( C ) C
045979,002011:
045980,002012:
045981,002013: 00,2570 52155 GENDDV DXCH MPAC # WE NEED A AND B ONLY FOR FIRST DV.
045982,002014: 00,2571 00006 +1 EXTEND # (SPECIAL UNIT PROLOGUE ENTERS HERE).
045983,002015: 00,2572 10130 DV BUF # A NOW CONTAINS Q AND L, R.
045984,002016: 00,2573 52155 DXCH MPAC
045985,002017:
045986,002018: 00,2574 40154 CS MPAC # FORM DIVIDEND FOR MINOR PART OF RESULT.
045987,002019: 00,2575 00006 EXTEND
045988,002020: 00,2576 70131 MP BUF +1
045989,002021: 00,2577 60155 AD MPAC +1 # OVERFLOW AT THIS POINT IS POSITIVE SINCE
045990,002022: 00,2600 54000 OVSK # R IS POSITIVE IN EVERY CASE.
045991,002023: 00,2601 12606 TCF +5
045992,002024:
045993,002025: 00,2602 00006 EXTEND # OVERFLOW CAN BE REMOVED BY SUBTRACTING C
045994,002026: 00,2603 60130 SU BUF # (BUF) ONCE SINCE R IS ALWAYS LESS THAN C
045995,002027: 00,2604 24154 INCR MPAC # IN THIS CASE. INCR COMPENSATES SUBTRACT.
045996,002028: 00,2605 12610 TCF +DOWN # (SINCE C(A) IS STILL POSITIVE).
045997,002029:
045998,002030: 00,2606 00006 +5 EXTEND # C(A) CAN BE MADE LESS THAN C IN MAGNI-
045999,002031: 00,2607 62620 BZMF -UP # TUDE BY DIMINISHING IT BY C (SINCE C IS
046000,002032: # NOT LESS THAN .5) UNLESS C(A) = 0.
046001,002033:
Page 1061 |
046003,002035: 00,2610 00006 +DOWN EXTEND
046004,002036: 00,2611 60130 SU BUF # IF POSITIVE, REDUCE ONLY IF NECESSARY
046005,002037: 00,2612 00006 EXTEND # SINCE THE COMPENSATING INCR MIGHT CAUSE
046006,002038: 00,2613 12616 BZF +3 # OVERFLOW.
046007,002039: 00,2614 00006 EXTEND # DONT SUBTRACT UNLESS RESULT IS POSITIVE
046008,002040: 00,2615 62624 BZMF ENDMAXDV # OR ZERO.
046009,002041:
046010,002042: 00,2616 24154 +3 INCR MPAC # KEEP SUBTRACT HERE AND COMPENSATE.
046011,002043: 00,2617 12625 TCF FINALDV
046012,002044:
046013,002045: 00,2620 00006 -UP EXTEND # IF ZERO, SET MINOR PART OF RESULT TO
046014,002046: 00,2621 12630 BZF FINALDV +3 # ZERO.
046015,002047:
046016,002048: 00,2622 00006 EXTEND # IF NEGATIVE, ADD C TO A, SUBTRACTING ONE
046017,002049: 00,2623 26154 DIM MPAC # TO COMPENSATE. DIM IS OK HERE SINCE THE
046018,002050: 00,2624 60130 ENDMAXDV AD BUF # MAJOR PART NEVER GOES NEGATIVE.
046019,002051:
Page 1062 |
046021,002053: 00,2625 22007 FINALDV ZL # DO DV TO OBTAIN MINOR PART OF RESULT.
046022,002054: 00,2626 00006 EXTEND
046023,002055: 00,2627 10130 DV BUF
046024,002056: 00,2630 54155 +3 TS MPAC +1
046025,002057:
046026,002058: 00,2631 10136 CCS DVSIGN # LEAVE RESULT POSITIVE UNLESS C(DVSIGN)=
046027,002059: 00,2632 00002 TC Q # -0.
046028,002060: 00,2633 00002 TC Q
046029,002061: 00,2634 00002 TC Q
046030,002062:
046031,002063: 00,2635 00006 EXTEND
046032,002064: 00,2636 40155 DCS MPAC
046033,002065: 00,2637 52155 DXCH MPAC
046034,002066: 00,2640 34746 CAF ZERO # SO WE ALWAYS RETURN WITH C(A) = 0.
046035,002067: 00,2641 00002 TC Q
046036,002068:
Page 1063 |
046038,002070: # IF THE MAJOR PARTS OF THE DIVISOR AND DIVIDEND ARE EQUAL, BUT THE MINOR PARTS ARE SUCH THAT THE
046039,002071: # DIVIDEND IS STRICTLY LESS THAN THE DIVISOR IN MAGNITUDE, THE FOLLOWING APPROXIMATION IS USED. THE ASSUMPTIONS
046040,002072: # ARE THE SAME AS THE GENERAL ROUTINE WITH THE ADDITION THAT SIGN AGREEMENT IS NECESSARY (B, C, & D POSITIVE).
046041,002073:
046042,002074: # C + SB . (C + B - D)
046043,002075: # ------ = 37777 + S(---------)
046044,002076: # C + SD ( C )
046045,002077:
046046,002078: # THE DIVISION MAY BE PERFORMED IMMEDIATELY SINCE B IS STRICTLY LESS THAN D AND C IS NOT LESS THAN .5.
046047,002079:
046048,002080: 00,2642 40154 MAXDV CS MPAC # SEE IF MAXDV CASE STILL HOLDS AFTER
046049,002081: 00,2643 60130 AD BUF # NORMALIZATION.
046050,002082: 00,2644 00006 EXTEND
046051,002083: 00,2645 12647 BZF +2
046052,002084: 00,2646 12570 TCF GENDDV # MPAC NOW LESS THAN BUF - DIVIDE AS USUAL
046053,002085:
046054,002086: 00,2647 34724 +2 CAF POSMAX # SET MAJOR PART OF RESULT.
046055,002087: 00,2650 54154 TS MPAC
046056,002088:
046057,002089: 00,2651 40131 CS BUF +1 # FORM DIVIDEND OF MINOR PART OF RESULT.
046058,002090: 00,2652 60155 AD MPAC +1
046059,002091: 00,2653 12624 TCF ENDMAXDV # GO ADD C AND DO DIVIDE, ATTACHING SIGN
046060,002092: # BEFORE EXITING.
046061,002093:
Page 1064 |
046063,002095: # VECTOR DIVIDED BY SCALAR, V/SC, IS EXECUTED HERE. THE VECTOR IS NOW IN MPAC WITH SCALAR IN BUF.
046064,002096:
046065,002097: 00,2654 44744 V/SC2 CS ONE # INITIALIZE DIVIDEND NORMALIZATION COUNT
046066,002098: 00,2655 54137 TS DVNORMCT # AND DIVISION SIGN REGISTER.
046067,002099: 00,2656 54127 TS VBUF +5
046068,002100:
046069,002101: 00,2657 03010 TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
046070,002102:
046071,002103: 00,2660 52131 DXCH BUF
046072,002104: 00,2661 07565 TC ALSIGNAG # SIGN AGREE BUF
046073,002105: 00,2662 52131 DXCH BUF
046074,002106: 00,2663 10130 CCS BUF # FORCE DIVISOR POSITIVE WITH MAJOR PART
046075,002107: 00,2664 12721 TCF /BUF+ # NON-ZERO (IF POSSIBLE).
046076,002108: 00,2665 12667 TCF +2
046077,002109: 00,2666 12715 TCF /BUF-
046078,002110:
046079,002111: 00,2667 56131 XCH BUF +1 # SHIFT VECTOR AND SCALAR LEFT 14.
046080,002112: 00,2670 56130 XCH BUF
046081,002113: 00,2671 56155 XCH MPAC +1
046082,002114: 00,2672 56154 XCH MPAC
046083,002115: 00,2673 00006 EXTEND # CHECK FOR OVERFLOW IN EACH CASE.
046084,002116: 00,2674 12676 BZF +2
046085,002117: 00,2675 12405 TCF DVOVF
046086,002118:
046087,002119: 00,2676 56160 XCH MPAC +4
046088,002120: 00,2677 56157 XCH MPAC +3
046089,002121: 00,2700 00006 EXTEND
046090,002122: 00,2701 12703 BZF +2
046091,002123: 00,2702 12405 TCF DVOVF
046092,002124:
046093,002125: 00,2703 56162 XCH MPAC +6
046094,002126: 00,2704 56161 XCH MPAC +5
046095,002127: 00,2705 00006 EXTEND
046096,002128: 00,2706 12710 BZF +2
046097,002129: 00,2707 12405 TCF DVOVF
046098,002130:
046099,002131: 00,2710 10130 CCS BUF
046100,002132: 00,2711 12721 TCF /BUF+
046101,002133: 00,2712 12405 TCF DVOVF # ZERO DIVISOR - OVERFLOW.
046102,002134: 00,2713 12715 TCF /BUF-
046103,002135: 00,2714 12405 TCF DVOVF
046104,002136:
046105,002137: 00,2715 00006 /BUF- EXTEND # ON NEGATIVE, COMPLEMENT BUF AND MAINTAIN
046106,002138: 00,2716 40131 DCS BUF # DVSIGN IN VBUF +5.
046107,002139: 00,2717 52131 DXCH BUF
046108,002140: 00,2720 24127 INCR VBUF +5
046109,002141:
Page 1065 |
046111,002143: 00,2721 00006 /BUF+ EXTEND
046112,002144: 00,2722 30131 DCA BUF # LEAVE ABS(ORIG DIVISOR) IN BUF2
046113,002145: 00,2723 52134 DXCH BUF2 # FOR OVERFLOW TESTING
046114,002146: 00,2724 12732 TCF /NORM # NORMALIZE DIVISOR IN BUF.
046115,002147:
046116,002148: 00,2725 00006 /NORM2 EXTEND # IF LESS THAN .5, AUGMENT DVNORMCT AND
046117,002149: 00,2726 24137 AUG DVNORMCT # DOUBLE DIVISOR.
046118,002150: 00,2727 00006 EXTEND
046119,002151: 00,2730 30131 DCA BUF
046120,002152: 00,2731 20131 DAS BUF
046121,002153:
046122,002154: 00,2732 30130 /NORM CA BUF # SEE IF DIVISOR NORMALIZED.
046123,002155: 00,2733 60000 DOUBLE
046124,002156: 00,2734 54000 OVSK
046125,002157: 00,2735 12725 TCF /NORM2 # DOUBLE AND TRY AGAIN IF NOT.
046126,002158:
046127,002159: 00,2736 02750 TC V/SCDV # DO X COMPONENT DIVIDE.
046128,002160: 00,2737 52160 DXCH MPAC +3 # SUPPLY ARGUMENTS IN USUAL SEQUENCE.
046129,002161: 00,2740 52155 DXCH MPAC
046130,002162: 00,2741 52160 DXCH MPAC +3
046131,002163:
046132,002164: 00,2742 02750 TC V/SCDV # Y COMPONENT.
046133,002165: 00,2743 52162 DXCH MPAC +5
046134,002166: 00,2744 52155 DXCH MPAC
046135,002167: 00,2745 52162 DXCH MPAC +5
046136,002168:
046137,002169: 00,2746 02750 TC V/SCDV # Z COMPONENT.
046138,002170: 00,2747 17441 TCF VROTATEX # GO RE-ARRANGE COMPONENTS BEFORE EXIT.
046139,002171:
Page 1066 |
046141,002173: # SUBROUTINE USED BY V/SC TO DIVIDE VECTOR COMPONENT IN MPAC,+1 BY THE SCALAR GIVEN IN BUF.
046142,002174:
046143,002175: 00,2750 30127 V/SCDV CA VBUF +5 # REFLECTS SIGN OF SCALAR.
046144,002176: 00,2751 54136 TS DVSIGN
046145,002177:
046146,002178: 00,2752 10154 CCS MPAC # FORCE MPAC POSITIVE, EXITING ON ZERO.
046147,002179: 00,2753 12767 TCF /MPAC+
046148,002180: 00,2754 12756 TCF +2
046149,002181: 00,2755 12763 TCF /MPAC-
046150,002182:
046151,002183: 00,2756 10155 CCS MPAC +1
046152,002184: 00,2757 12767 TCF /MPAC+
046153,002185: 00,2760 00002 TC Q
046154,002186: 00,2761 12763 TCF /MPAC-
046155,002187: 00,2762 00002 TC Q
046156,002188:
046157,002189: 00,2763 00006 /MPAC- EXTEND # USUAL COMPLEMENTING AND SETTING OF SIGN.
046158,002190: 00,2764 40155 DCS MPAC
046159,002191: 00,2765 52155 DXCH MPAC
046160,002192: 00,2766 24136 INCR DVSIGN
046161,002193:
046162,002194: 00,2767 44744 /MPAC+ CS ONE # INITIALIZE NEAR-ONE SWITCH.
046163,002195: 00,2770 54140 TS MAXDVSW
046164,002196:
046165,002197: 00,2771 40154 CS MPAC # CHECK POSSIBLE OVERFLOW.
046166,002198: 00,2772 60133 AD BUF2 # UNNORMALIZED INPUT DIVISOR.
046167,002199: 00,2773 10000 CCS A
046168,002200: 00,2774 13004 TCF DDVCALL # NOT NEAR-ONE
046169,002201: 00,2775 12777 TCF +2 # +0 IS JUST POSSIBLE
046170,002202: 00,2776 12405 TCF DVOVF # NO HOPE
046171,002203: 00,2777 54140 TS MAXDVSW # SIGNAL POSSIBLE NEAR-ONE CASE
046172,002204: 00,3000 40155 CS MPAC +1 # SEE IF DIVISION CAN BE DONE
046173,002205: 00,3001 60134 AD BUF2 +1
046174,002206: 00,3002 00006 EXTEND
046175,002207: 00,3003 62405 BZMF DVOVF
046176,002208:
046177,002209: 00,3004 52155 DDVCALL DXCH MPAC # CALL PRE-DIVIDE NORMALIZATION.
046178,002210: 00,3005 50137 INDEX DVNORMCT
046179,002211: 00,3006 12565 TCF MAXTEST
046180,002212:
Page 1067 |
046182,002214: 00,3007 32506 SLOPELO DEC .8324
046183,002215:
046184,002216: 00,3010 56002 VECAGREE XCH Q # SAVE Q IN A
046185,002217: 00,3011 52155 DXCH MPAC
046186,002218: 00,3012 07565 TC ALSIGNAG # SIGNAGREE MPAC
046187,002219: 00,3013 52155 DXCH MPAC
046188,002220: 00,3014 52160 DXCH MPAC +3
046189,002221: 00,3015 07565 TC ALSIGNAG # SIGN AGREE MPAC +3
046190,002222: 00,3016 52160 DXCH MPAC +3
046191,002223: 00,3017 52162 DXCH MPAC +5
046192,002224: 00,3020 07565 TC ALSIGNAG # SIGNAGREE MPAC +5
046193,002225: 00,3021 52162 DXCH MPAC +5
046194,002226: 00,3022 00000 TC A
046195,002227:
Page 1068 |
046197,002229: # THE FOLLOWING ROUTINE EXECUTES THE UNIT INSTRUCTION, WHICH TAKES THE UNIT OF THE VECTOR IN MPAC.
046198,002230:
046199,002231: 00,3023 03010 UNIT TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
046200,002232: 00,3024 07553 TC MPACVBUF # SAVE ARGUMENT IN VBUF
046201,002233: 00,3025 34746 CAF ZERO # MUST SENSE OVERFLOW IN FOLLOWING DOT.
046202,002234: 00,3026 56121 XCH OVFIND
046203,002235: 00,3027 54141 TS TEM1
046204,002236: 00,3030 03317 TC VSQSUB # DOT MPAC WITH ITSELF.
046205,002237: 00,3031 30141 CA TEM1
046206,002238: 00,3032 56121 XCH OVFIND
046207,002239: 00,3033 00006 EXTEND
046208,002240: 00,3034 13036 BZF +2
046209,002241: 00,3035 12405 TCF DVOVF
046210,002242: 00,3036 00006 EXTEND
046211,002243: 00,3037 30155 DCA MPAC # LEAVE THE SQUARE OF THE LENGTH OF THE
046212,002244: 00,3040 50120 INDEX FIXLOC # ARGUMENT IN LVSQUARE.
046213,002245: 00,3041 52043 DXCH LVSQUARE
046214,002246:
046215,002247: 00,3042 03343 TC SQRTSUB # GO TAKE THE NORMALIZED SQUARE ROOT.
046216,002248:
046217,002249: 00,3043 10154 CCS MPAC # CHECK FOR UNIT OVERFLOW.
046218,002250: 00,3044 13051 TCF +5 # MPAC IS NOT LESS THAN .5 UNLESS
046219,002251: 00,3045 54001 TS L
046220,002252: 00,3046 50120 INDEX FIXLOC
046221,002253: 00,3047 52045 DXCH LV
046222,002254: 00,3050 12405 TCF DVOVF # INPUT TO SQRTSUB WAS 0.
046223,002255:
046224,002256: 00,3051 44310 CS FOURTEEN # SEE IF THE INPUT WAS SO SMALL THE THE
046225,002257: 00,3052 60135 AD MPTEMP # FIRST TWO REGISTERS OF THE SQUARE WERE 0
046226,002258: 00,3053 10000 CCS A
046227,002259: 00,3054 40000 COM # IF SO, SAVE THE NEGATIVE OF THE SHIFT
046228,002260: 00,3055 13133 TCF SMALL # COUNT -15D.
046229,002261:
046230,002262: 00,3056 13065 TCF LARGE # (THIS IS USUALLY THE CASE.)
046231,002263:
046232,002264: 00,3057 44752 CS THIRTEEN # IF THE SHIFT COUNT WAS EXACTLY 14, SET
046233,002265: 00,3060 54135 TS MPTEMP # THE PRE-DIVIDE NORM COUNT TO -13D.
046234,002266:
046235,002267: 00,3061 30154 CA MPAC # SHIFT THE LENGTH RIGHT 14 BEFORE STORING
046236,002268: 00,3062 54001 SMALL2 TS L # (SMALL EXITS TO THIS POINT).
046237,002269: 00,3063 34746 CAF ZERO
046238,002270: 00,3064 13112 TCF LARGE2 # GO TO STORE LENGTH AND PROCEED.
046239,002271:
046240,002272: 00,3065 10135 LARGE CCS MPTEMP # MOST ALL CASES COME HERE.
046241,002273: 00,3066 13074 TCF LARGE3 # SEE IF NO NORMALIZATION WAS REQUIRED BY
046242,002274:
046243,002275: 00,3067 42024 CS SRDDV # SQRT, AND IF SO, SET UP FOR A SHIFT
046244,002276: 00,3070 54135 TS MPTEMP # RIGHT 1 BEFORE DIVIDING TO PRODUCE
046245,002277: 00,3071 00006 EXTEND # THE DESIRED HALF UNIT VECTOR.
046246,002278: 00,3072 30155 DCA MPAC
Page 1069 |
046248,002280: 00,3073 13112 TCF LARGE2
046249,002281:
Page 1070 |
046251,002283: 00,3074 40000 LARGE3 COM # LEAVE NEGATIVE OF SHIFT COUNT-1 FOR
046252,002284: 00,3075 54135 TS MPTEMP # PREDIVIDE LEFT SHIFT.
046253,002285:
046254,002286: 00,3076 40000 COM # PICK UP REQUIRED SHIFTING BIT TO UNNORM-
046255,002287: 00,3077 50000 INDEX A # ALIZE THE SQRT RESULT.
046256,002288: 00,3100 34727 CAF BIT14
046257,002289: 00,3101 54130 TS BUF
046258,002290: 00,3102 00006 EXTEND
046259,002291: 00,3103 70155 MP MPAC +1
046260,002292: 00,3104 56130 XCH BUF
046261,002293: 00,3105 00006 EXTEND # (UNNORMALIZE THE SQRT FOR LV).
046262,002294: 00,3106 70154 MP MPAC
046263,002295: 00,3107 56001 XCH L
046264,002296: 00,3110 60130 AD BUF
046265,002297: 00,3111 56001 XCH L
046266,002298:
046267,002299: 00,3112 50120 LARGE2 INDEX FIXLOC
046268,002300: 00,3113 52045 DXCH LV # LENGTH NOW STORED IN WORK AREA.
046269,002301:
046270,002302: 00,3114 44744 CS ONE
046271,002303: 00,3115 54140 TS MAXDVSW # NO MAXDV CASES IN UNIT.
046272,002304:
046273,002305: 00,3116 52123 DXCH VBUF # PREPARE X COMPONENT FOR DIVIDE, SETTING
046274,002306: 00,3117 52155 DXCH MPAC # LENGTH OF VECTOR AS DIVISOR IN BUF.
046275,002307: 00,3120 52131 DXCH BUF
046276,002308: 00,3121 03151 TC UNITDV
046277,002309:
046278,002310: 00,3122 52125 DXCH VBUF +2 # DO Y AND Z IN USUAL FASHION SO WE CAN
046279,002311: 00,3123 52155 DXCH MPAC # EXIT THROUGH VROTATEX.
046280,002312: 00,3124 52160 DXCH MPAC +3
046281,002313: 00,3125 03151 TC UNITDV
046282,002314:
046283,002315: 00,3126 52127 DXCH VBUF +4
046284,002316: 00,3127 52155 DXCH MPAC
046285,002317: 00,3130 52162 DXCH MPAC +5
046286,002318: 00,3131 03151 TC UNITDV
046287,002319: 00,3132 17441 TCF VROTATEX # AND EXIT.
046288,002320:
Page 1071 |
046290,002322: # IF THE LENGTH OF THE ARGUMENT VECTOR WAS LESS THAN 2(-28), EACH COMPONENT MUST BE SHIFTED LEFT AT LEAST
046291,002323: # 14 PLACES BEFORE THE DIVIDE. NOTE THAT IN THIS CASE, THE MAJOR PART OF EACH COMPONENT IS ZERO.
046292,002324:
046293,002325: 00,3133 54135 SMALL TS MPTEMP # NEGATIVE OF PRE-DIVIDE SHIFT COUNT.
046294,002326:
046295,002327: 00,3134 34746 CAF ZERO # SHIFT EACH COMPONENT LEFT 14.
046296,002328: 00,3135 56123 XCH VBUF +1
046297,002329: 00,3136 56122 XCH VBUF
046298,002330: 00,3137 56125 XCH VBUF +3
046299,002331: 00,3140 56124 XCH VBUF +2
046300,002332: 00,3141 56127 XCH VBUF +5
046301,002333: 00,3142 56126 XCH VBUF +4
046302,002334:
046303,002335: 00,3143 40135 CS MPTEMP
046304,002336: 00,3144 50000 INDEX A
046305,002337: 00,3145 34727 CAF BIT14
046306,002338: 00,3146 00006 EXTEND
046307,002339: 00,3147 70154 MP MPAC
046308,002340: 00,3150 13062 TCF SMALL2
046309,002341:
046310,002342: 00,3151 4752 THIRTEEN = OCT15
046311,002343: 00,3151 4310 FOURTEEN = OCT16
046312,002344: 00,3151 4310 OCT16 = R1D1
046313,002345:
Page 1072 |
046315,002347: # THE FOLLOWING ROUTINE SETS UP THE CALL TO THE DIVIDE ROUTINES.
046316,002348:
046317,002349: 00,3151 10154 UNITDV CCS MPAC # FORCE MPAC POSITIVE IF POSSIBLE, SETTING
046318,002350: 00,3152 13170 TCF UMPAC+ # DVSIGN ACCORDING TO THE SIGN OF MPAC
046319,002351: 00,3153 13155 TCF +2 # SINCE THE DIVISOR IS ALWAYS POSITIVE
046320,002352: 00,3154 13162 TCF UMPAC- # HERE.
046321,002353:
046322,002354: 00,3155 10155 CCS MPAC +1
046323,002355: 00,3156 13170 TCF UMPAC+
046324,002356: 00,3157 00002 TC Q # EXIT IMMEDIATELY ON ZERO.
046325,002357: 00,3160 13162 TCF UMPAC-
046326,002358: 00,3161 00002 TC Q
046327,002359:
046328,002360: 00,3162 44746 UMPAC- CS ZERO # IF NEGATIVE, SET -0 IN DVSIGN FOR FINAL
046329,002361: 00,3163 54136 TS DVSIGN # COMPLEMENT.
046330,002362: 00,3164 00006 EXTEND
046331,002363: 00,3165 40155 DCS MPAC # PICK UP ABSOLUTE VALUE OF ARG AND JUMP.
046332,002364: 00,3166 50135 INDEX MPTEMP
046333,002365: 00,3167 12564 TCF MAXTEST -1
046334,002366:
046335,002367: 00,3170 54136 UMPAC+ TS DVSIGN # SET DVSIGN FOR POSITIVE QUOTIENT.
046336,002368: 00,3171 52155 DXCH MPAC
046337,002369: 00,3172 50135 INDEX MPTEMP
046338,002370: 00,3173 12564 TCF MAXTEST -1
046339,002371:
Page 1073 |
046341,002373: # MISCELLANEOUS UNARY OPERATIONS.
046342,002374:
046343,002375: 00,3174 03300 DSQ TC DSQSUB # SQUARE THE DP CONTENTS OF MPAC.
046344,002376: 00,3175 16102 TCF DANZIG
046345,002377:
046346,002378: 00,3176 10163 ABVALABS CCS MODE # ABVAL OR ABS INSTRUCTION.
046347,002379: 00,3177 13226 TCF ABS # DO ABS ON SCALAR.
046348,002380: 00,3200 13226 TCF ABS
046349,002381:
046350,002382: 00,3201 03317 ABVAL TC VSQSUB # DOT MPAC WITH ITSELF.
046351,002383: 00,3202 22163 LXCH MODE # MODE IS NOW DP (L ZERO AFTER DAS).
046352,002384:
046353,002385: 00,3203 00006 EXTEND # STORE SQUARE OF LENGTH IN WORK AREA.
046354,002386: 00,3204 30155 DCA MPAC
046355,002387: 00,3205 50120 INDEX FIXLOC
046356,002388: 00,3206 52043 DXCH LVSQUARE
046357,002389:
Page 1074 |
046359,002391: # PROGRAM DESCRIPTION- SUBROUTINE SQRT
046360,002392: # FUNCTIONAL DESCRIPTION-DOUBLE PRECISION SQUARE ROOT ROUTINE
046361,002393: # THIS PROGRAM TAKES THE SQUARE ROOT OF THE 27 OR 28 MOST SIGNIFICANT BITS IN THE TRIPLE PRECISION SET OF
046362,002394: # NUMBERS-MPAC,MPAC+1,AND MPAC+2. THE ROOT IS RETURNED DOUBLE PRECISION IN MPAC AND MPAC+1.
046363,002395: # WARNING- THIS SUBROUTINE USES A TRIPLE PRECISION INPUT. THE PROGRAMMER MUST ASSURE THE CONTENTS OF MPAC+2
046364,002396: # ESPECIALLY IF THE CONTENTS OF MPAC IS SMALL OR ZERO. FOR DETAILS SEE STG MEMO NO.949.
046365,002397: # CALLING SEQUENCE- IN INTERPRETIVE MODE I.E., FOLLOWING TC INTPRET,SQRT NO ADDRESS IS ALLOWED
046366,002398: # INPUT SCALING THE BINARY POINT IS ASSUMED TO THE RIGHT OF BIT 15. THE ANSWER IS RETURNED WITH THE SAME SCALING
046367,002399: # SUBROUTINES- GENSCR,MPACSHR, SQRTSUB,ABORT
046368,002400: # ABORT EXIT MODE- ABORTS ON NEGATIVE INPUT -1.2X10E-4 (77775 OCTAL) OR LESS.
046369,002401: # DISPLAYS ERROR CODE 1302
046370,002402: # TC ABORT
046371,002403: # OCT 1302
046372,002404: # DEBRIS - LOCATIONS BUF,MPTEMP,ADDRWD ARE USED
046373,002405: 00,3207 03343 SQRT TC SQRTSUB # TAKE THE SQUARE ROOT OF MPAC.
046374,002406: 00,3210 10135 CCS MPTEMP # RETURNED NORMALIZED SQUARE ROOT. SEE IF
046375,002407: 00,3211 13213 TCF +2 # ANY UN-NORMALIZATION REQUIRED AND EXIT
046376,002408: 00,3212 16102 TCF DANZIG # IF NOT.
046377,002409:
046378,002410: 00,3213 63733 AD NEG12 # A RIGHT SHIFT OF MORE THAN 13 COULD BE
046379,002411: 00,3214 00006 EXTEND # REQUIRED IF INPUT WAS ZERO IN MPAC,+1.
046380,002412: 00,3215 63221 BZMF SQRTSHFT # GOES HERE IN MOST CASES.
046381,002413: 00,3216 22007 ZL # IF A LONG SHIFT IS REQUIRED, GO TO
046382,002414: 00,3217 22116 LXCH ADDRWD # GENERAL RIGHT SHIFT ROUTINES.
046383,002415: 00,3220 12303 TCF GENSCR +4 # ADDRWD WAS ZERO TO PREVENT ROUND.
046384,002416:
046385,002417: 00,3221 50135 SQRTSHFT INDEX MPTEMP # SELECT SHIFTING BIT AND EXIT THROUGH
046386,002418: 00,3222 34726 CAF BIT15 # SHIFT ROUTINES.
046387,002419: 00,3223 54135 TS MPTEMP
046388,002420: 00,3224 34746 CAF ZERO # TO ZERO MPAC +2 IN THE PROCESS.
046389,002421: 00,3225 12036 TCF MPACSHR +3
046390,002422:
046391,002423: 00,3226 06744 ABS TC BRANCH # TEST SIGN OF MPAC AND COMPLEMENT IF
046392,002424: 00,3227 16102 TCF DANZIG
046393,002425: 00,3230 16102 TCF DANZIG
046394,002426: 00,3231 17711 TCF COMP
046395,002427:
Page 1075 |
046397,002429: 00,3232 44742 VDEF CS FOUR # VECTOR DEFINE - ESSENTIALLY TREATS
046398,002430: 00,3233 26166 ADS PUSHLOC # SCALAR IN MPAC AS X COMPONENT, PUSHES UP
046399,002431: 00,3234 00006 EXTEND # FOR Y AND THEN AGAIN FOR Z.
046400,002432: 00,3235 50000 INDEX A
046401,002433: 00,3236 30003 DCA 2
046402,002434: 00,3237 52160 DXCH MPAC +3
046403,002435: 00,3240 00006 EXTEND
046404,002436: 00,3241 50166 INDEX PUSHLOC
046405,002437: 00,3242 30001 DCA 0
046406,002438: 00,3243 52162 DXCH MPAC +5
046407,002439: 00,3244 16542 TCF VMODE # MODE IS NON VECTOR.
046408,002440:
046409,002441: 00,3245 03317 VSQ TC VSQSUB # DOT MPAC WITH ITSELF.
046410,002442: 00,3246 17353 TCF DMODE # MODE IS NOW DP.
046411,002443:
046412,002444: 00,3247 00006 PUSH EXTEND # PUSH DOWN MPAC LEAVING IT LOADED.
046413,002445: 00,3250 30155 DCA MPAC
046414,002446: 00,3251 50166 INDEX PUSHLOC # PUSH DOWN FIRST TWO REGISTERS IN EACH
046415,002447: 00,3252 52001 DXCH 0
046416,002448:
046417,002449: 00,3253 50163 INDEX MODE # INCREMENT PUSHDOWN POINTER.
046418,002450: 00,3254 36265 CAF NO.WDS
046419,002451: 00,3255 26166 ADS PUSHLOC
046420,002452:
046421,002453: 00,3256 10163 CCS MODE
046422,002454: 00,3257 13272 TCF TPUSH # PUSH DOWN MPAC +2.
046423,002455: 00,3260 16102 TCF DANZIG # DONE FOR DP.
046424,002456:
046425,002457: 00,3261 00006 EXTEND # ON VECTOR, PUSH DOWN Y AND Z COMPONENTS.
046426,002458: 00,3262 30160 DCA MPAC +3
046427,002459: 00,3263 50166 INDEX PUSHLOC
046428,002460: 00,3264 51775 DXCH 0 -4
046429,002461: 00,3265 00006 EXTEND
046430,002462: 00,3266 30162 DCA MPAC +5
046431,002463: 00,3267 50166 INDEX PUSHLOC
046432,002464: 00,3270 51777 DXCH 0 -2
046433,002465: 00,3271 16102 TCF DANZIG
046434,002466:
046435,002467: 00,3272 30156 TPUSH CA MPAC +2
046436,002468: 00,3273 16575 TCF ENDTPUSH +2
046437,002469:
046438,002470: 00,3274 50120 RVQ INDEX FIXLOC # RVQ - RETURN IVA QPRET.
046439,002471: 00,3275 30052 CA QPRET
046440,002472: 00,3276 54117 TS POLISH
046441,002473: 00,3277 16673 TCF GOTO +4 # (ASSUME QPRET POINTS TO FIXED ONLY.)
046442,002474:
Page 1076 |
046444,002476: # THE FOLLOWING SUBROUTINES ARE USED IN SQUARING MPAC, IN BOTH THE SCALAR AND VECTOR SENSE. THEY ARE
046445,002477: # SPECIAL CASES OF DMPSUB AND DOTSUB, PUT IN TO SAVE SOME TIME.
046446,002478:
046447,002479: 00,3300 30155 DSQSUB CA MPAC +1 # SQUARES THE SCALAR CONTENTS OF MPAC.
046448,002480: 00,3301 00006 EXTEND
046449,002481: 00,3302 70000 SQUARE
046450,002482: 00,3303 54156 TS MPAC +2
046451,002483: 00,3304 34746 CAF ZERO # FORM 2(CROSS TERM).
046452,002484: 00,3305 56155 XCH MPAC +1
046453,002485: 00,3306 00006 EXTEND
046454,002486: 00,3307 70154 MP MPAC
046455,002487: 00,3310 20001 DDOUBL # AND MAYBE OVERFLOW.
046456,002488: 00,3311 20156 DAS MPAC +1 # AND SET A TO NET OVERFLOW.
046457,002489: 00,3312 56154 XCH MPAC
046458,002490: 00,3313 00006 EXTEND
046459,002491: 00,3314 70000 SQUARE
046460,002492: 00,3315 20155 DAS MPAC
046461,002493: 00,3316 00002 TC Q
046462,002494:
046463,002495: 00,3317 00006 VSQSUB EXTEND # DOTS THE VECTOR IN MPAC WITH ITSELF.
046464,002496: 00,3320 22137 QXCH DOTRET
046465,002497: 00,3321 03300 TC DSQSUB # SQUARE THE X COMPONENT.
046466,002498: 00,3322 52160 DXCH MPAC +3
046467,002499: 00,3323 52155 DXCH MPAC
046468,002500: 00,3324 52131 DXCH BUF # SO WE CAN END IN DOTSUB.
046469,002501: 00,3325 30156 CA MPAC +2
046470,002502: 00,3326 54132 TS BUF +2
046471,002503:
046472,002504: 00,3327 03300 TC DSQSUB # SQUARE Y COMPONENT.
046473,002505: 00,3330 52156 DXCH MPAC +1
046474,002506: 00,3331 20132 DAS BUF +1
046475,002507: 00,3332 60154 AD MPAC
046476,002508: 00,3333 60130 AD BUF
046477,002509: 00,3334 54130 TS BUF
046478,002510: 00,3335 13337 TCF +2
046479,002511: 00,3336 54121 TS OVFIND # IF OVERFLOW.
046480,002512:
046481,002513: 00,3337 52162 DXCH MPAC +5
046482,002514: 00,3340 52155 DXCH MPAC
046483,002515: 00,3341 03300 TC DSQSUB # SQUARE Z COMPONENT.
046484,002516: 00,3342 17226 TCF ENDDOT # END AS IN DOTSUB.
046485,002517:
Page 1077 |
046487,002519: # DOUBLE PRECISION SQUARE ROOT ROUTINE. TAKE THE SQUARE ROOT OF THE TRIPLE PRECISION (MPAC +2 USED ONLY
046488,002520: # IN NORMALIZATION) CONTENTS OF MPAC AND LEAVE THE NORMALIZED RESULT IN MPAC (C(MPAC) GREATER THAN OR EQUAL TO
046489,002521: # .5). THE RIGHT SHIFT COUNT (TO UNNORMALIZE) IS LEFT IN MPTEMP.
046490,002522:
046491,002523: 00,3343 34746 SQRTSUB CAF ZERO # START BY ZEROING RIGHT SHIFT COUNT.
046492,002524: 00,3344 54135 TS MPTEMP
046493,002525:
046494,002526: 00,3345 10154 CCS MPAC # CHECK FOR POSITIVE ARGUMENT, SHIFTING
046495,002527: 00,3346 13405 TCF SMPAC+ # FIRST SIGNIFICANT MPAC REGISTER INTO
046496,002528: 00,3347 13351 TCF +2 # MPAC ITSELF.
046497,002529: 00,3350 13373 TCF SQRTNEG # SEE IF MAG OF ARGUMENT LESS THAN 10(-4).
046498,002530:
046499,002531: 00,3351 56156 XCH MPAC +2 # MPAC IS ZERO - SHIFT LEFT 14.
046500,002532: 00,3352 56155 XCH MPAC +1
046501,002533: 00,3353 54154 TS MPAC
046502,002534: 00,3354 34750 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
046503,002535: 00,3355 54135 TS MPTEMP
046504,002536:
046505,002537: 00,3356 10154 CCS MPAC # SEE IF MPAC NOW PNZ.
046506,002538: 00,3357 13405 TCF SMPAC+
046507,002539: 00,3360 13362 TCF +2
046508,002540: 00,3361 13376 TCF ZEROANS # NEGATIVE BUT LESS THAN 10(-4) IN MAG.
046509,002541:
046510,002542: 00,3362 56155 XCH MPAC +1 # ZERO - SHIFT LEFT 14 AGAIN.
046511,002543: 00,3363 54154 TS MPAC
046512,002544: 00,3364 34750 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
046513,002545: 00,3365 26135 ADS MPTEMP
046514,002546:
046515,002547: 00,3366 10154 CCS MPAC
046516,002548: 00,3367 13405 TCF SMPAC+
046517,002549: 00,3370 00002 TC Q # SQRT(0) = 0.
046518,002550: 00,3371 13376 TCF ZEROANS
046519,002551: 00,3372 13453 TCF FIXROOT # DO NOT LEAVE SQRTSUB WITH -0 IN MPAC.
046520,002552:
046521,002553: 00,3373 10000 SQRTNEG CCS A # ARGUMENT IS NEGATIVE, BUT SEE IF SIGN-
046522,002554: 00,3374 13402 TCF SQRTABRT # CORRECTED ARGUMENT IS LESS THAN 10(-4)
046523,002555:
046524,002556: 00,3375 10155 CCS MPAC +1 # IN MAGNITUDE. IF SO, CALL ANSWER ZERO.
046525,002557: 00,3376 34746 ZEROANS CAF ZERO # FORCE ANSWER TO ZERO HERE.
046526,002558: 00,3377 13453 TCF FIXROOT
046527,002559: 00,3400 13402 TCF SQRTABRT
046528,002560: 00,3401 13453 TCF FIXROOT
046529,002561:
046530,002562: 00,3402 52165 SQRTABRT DXCH LOC
046531,002563: 00,3403 05722 TC POODOO1
046532,002564: 00,3404 21302 OCT 21302
046533,002565:
046534,002566: 00,3405 62444 SMPAC+ AD -1/2+2 # SEE IF ARGUMENT GREATER THAN OR EQUAL TO
Page 1078 |
046536,002568: 00,3406 00006 EXTEND # .5.
046537,002569: 00,3407 63456 BZMF SRTEST # IF SO, SEE IF LESS THAN .25.
046538,002570:
046539,002571: 00,3410 52155 DXCH MPAC # WE WILL TAKE THE SQUARE ROOT OF MPAC/2.
046540,002572: 00,3411 22021 LXCH SR # SHIFT RIGHT 1 AND GO TO THE SQRT ROUTINE
046541,002573: 00,3412 00006 EXTEND
046542,002574: 00,3413 74727 MP HALF
046543,002575: 00,3414 52155 DXCH MPAC
046544,002576: 00,3415 56021 XCH SR
046545,002577: 00,3416 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
046546,002578:
046547,002579: 00,3417 32314 ARGHI CAF SLOPEHI # ARGUMENT BETWEEN .25 AND .5. GET A
046548,002580: 00,3420 00006 EXTEND # LINEAR APPROXIMATION FOR THIS RANGE.
046549,002581: 00,3421 70154 MP MPAC
046550,002582: 00,3422 62566 AD BIASHI # X0/2 = (MPAC/2)(SLOPEHI) + BIASHI/2.
046551,002583:
046552,002584: 00,3423 54130 +4 TS BUF # X0/2 (ARGLO ENTERS HERE).
046553,002585: 00,3424 30154 CA MPAC # SINGLE-PRECISION THROUGHOUT.
046554,002586: 00,3425 22007 ZL
046555,002587: 00,3426 00006 EXTEND
046556,002588: 00,3427 10130 DV BUF # (MPAC/2)/(X0/2)
046557,002589: 00,3430 00006 EXTEND
046558,002590: 00,3431 74727 MP HALF
046559,002591: 00,3432 26130 ADS BUF # X1 = X0/2 + .5(MPAC/2)/(X0/2).
046560,002592:
046561,002593: 00,3433 00006 EXTEND
046562,002594: 00,3434 74727 MP HALF # FORM UP X1/2.
046563,002595: 00,3435 52155 DXCH MPAC # SAVE AND BRING OUT ARGUMENT.
046564,002596: 00,3436 00006 EXTEND # TAKE DP QUOTIENT WITH X1.
046565,002597: 00,3437 10130 DV BUF
046566,002598: 00,3440 54131 TS BUF +1 # SAVE MAJOR PART OF QUOTIENT.
046567,002599: 00,3441 34746 CAF ZERO # FORM MINOR PART OF QUOTIENT USING
046568,002600: 00,3442 56001 XCH L # (REMAINDER,0).
046569,002601: 00,3443 00006 EXTEND
046570,002602: 00,3444 10130 DV BUF
046571,002603: 00,3445 54001 TS L # IN PREPARATION FOR DAS.
046572,002604: 00,3446 30131 CA BUF +1
046573,002605: 00,3447 20155 DAS MPAC # X2 = X1/2 + (MPAC/2)X1
046574,002606:
046575,002607: 00,3450 00006 EXTEND # OVERFLOWS IF ARG. NEAR POSMAX.
046576,002608: 00,3451 13455 BZF TCQBNK00
046577,002609: 00,3452 34724 CAF POSMAX
046578,002610: 00,3453 54154 FIXROOT TS MPAC
046579,002611: 00,3454 54155 TS MPAC +1
046580,002612: 00,3455 00002 TCQBNK00 TC Q # RETURN TO CALLER TO UNNORMALIZE, ETC.
046581,002613:
Page 1079 |
046583,002615: 00,3456 64730 SRTEST AD QUARTER # ARGUMENT WAS LESS THAN .5, SEE IF LESS
046584,002616: 00,3457 00006 EXTEND # THAN .25.
046585,002617: 00,3460 63502 BZMF SQRTNORM # IF SO, BEGIN NORMALIZATION.
046586,002618:
046587,002619: 00,3461 52155 DXCH MPAC # IF BETWEEN .5 AND .25, SHIFT RIGHT 1 AND
046588,002620: 00,3462 22021 LXCH SR # START AT ARGLO.
046589,002621: 00,3463 00006 EXTEND
046590,002622: 00,3464 74727 MP HALF
046591,002623: 00,3465 52155 DXCH MPAC
046592,002624: 00,3466 56021 XCH SR
046593,002625: 00,3467 26155 ADS MPAC +1 # NO OVERFLOW.
046594,002626:
046595,002627: 00,3470 33007 ARGLO CAF SLOPELO # (NORMALIZED) ARGUMENT BETWEEN .125 AND
046596,002628: 00,3471 00006 EXTEND # .25
046597,002629: 00,3472 70154 MP MPAC
046598,002630: 00,3473 62270 AD BIASLO
046599,002631: 00,3474 13423 TCF ARGHI +4 # BEGIN SQUARE ROOT.
046600,002632:
046601,002633: 00,3475 00006 SQRTNM2 EXTEND # SHIFT LEFT 2 AND INCREMENT RIGHT SHIFT
046602,002634: 00,3476 30156 DCA MPAC +1 # COUNT (FOR TERMINAL UNNORMALIZATION).
046603,002635: 00,3477 20156 DAS MPAC +1
046604,002636: 00,3500 60154 AD MPAC
046605,002637: 00,3501 26154 ADS MPAC # (NO OVERFLOW).
046606,002638:
046607,002639: 00,3502 24135 SQRTNORM INCR MPTEMP # FIRST TIME THROUGH, JUST SHIFT LEFT 1
046608,002640: 00,3503 00006 EXTEND # (PUTS IN EFFECTIVE RIGHT SHIFT SINCE
046609,002641: 00,3504 30156 DCA MPAC +1 # WE WANT MPAC/2).
046610,002642: 00,3505 20156 DAS MPAC +1
046611,002643: 00,3506 60154 AD MPAC
046612,002644: 00,3507 26154 ADS MPAC # (AGAIN NO OVERFLOW).
046613,002645: 00,3510 60000 DOUBLE
046614,002646: 00,3511 54022 TS CYL
046615,002647:
046616,002648: 00,3512 10022 NORMTEST CCS CYL # SEE IF ARGUMENT NOW NORMALIZED AT
046617,002649: 00,3513 10022 CCS CYL # GREATER THAN .125.
046618,002650: 00,3514 13475 TCF SQRTNM2 # NO - SHIFT LEFT 2 MORE AND TRY AGAIN.
046619,002651: 00,3515 13417 TCF ARGHI # YES - NOW BETWEEN .5 AND .25.
046620,002652: 00,3516 13470 TCF ARGLO # ARGUMENT NOW BETWEEN .25 AND .125.
046621,002653:
Page 1080 |
046623,002655: # TRIGONOMETRIC FUNCTION PACKAGE.
046624,002656:
046625,002657: # THE FOLLOWING TRIGONOMETRIC FUNCTIONS ARE AVAILABLE AS INTERPRETIVE OPERATIONS:
046626,002658:
046627,002659: # 1. SIN COMPUTES (1/2)SINE(2 PI MPAC).
046628,002660: # 2. COS COMPUTES (1/2)COSINE(2 PI MPAC).
046629,002661:
046630,002662: # 3. ASIN COMPUTES (1/2PI)ARCSINE(2 MPAC).
046631,002663: # 4. ACOS COMPUTES (1/2PI)ARCCOSINE(2 MPAC).
046632,002664:
046633,002665: # SIN-ASIN AND COS-ACOS ARE MUTUALLY INVERSE, IE SIN(ASIN(X)) = X.
046634,002666:
046635,002667: 00,3517 06744 COSINE TC BRANCH # FINDS COSINE USING THE IDENTITY
046636,002668: 00,3520 13523 TCF +3 # COS(X) = SIN(PI/2 - ABS(X)).
046637,002669: 00,3521 13526 TCF PRESINE
046638,002670: 00,3522 13526 TCF PRESINE
046639,002671:
046640,002672: 00,3523 00006 +3 EXTEND
046641,002673: 00,3524 40155 DCS MPAC
046642,002674: 00,3525 52155 DXCH MPAC
046643,002675:
046644,002676: 00,3526 34730 PRESINE CAF QUARTER # PI/2 SCALED.
046645,002677: 00,3527 26154 ADS MPAC
046646,002678:
046647,002679:
046648,002680: 00,3530 52155 SINE DXCH MPAC # DOUBLE ARGUMENT.
046649,002681: 00,3531 20001 DDOUBL
046650,002682: 00,3532 54000 OVSK # SEE IF OVERFLOW PRESENT.
046651,002683: 00,3533 13536 TCF +3 # IF NOT, ARGUMENT OK AS IS.
046652,002684:
046653,002685: 00,3534 00006 EXTEND # IF SO, WE LOST (OR GAINED) PI, SO
046654,002686: 00,3535 40001 DCOM # COMPLEMENT MPAC USING THE IDENTITY
046655,002687: # SIN(X-(+)PI) = SIN(-X).
046656,002688: 00,3536 52155 +3 DXCH MPAC
046657,002689: 00,3537 30154 CA MPAC # SEE IF ARGUMENT GREATER THAN .5 IN
046658,002690: 00,3540 60000 DOUBLE # MAGNITUDE. IF SO, REDUCE IT TO LESS THAN
046659,002691: 00,3541 54001 TS L # .5 (+-PI/2 SCALED) AS FOLLOWS:
046660,002692: 00,3542 13553 TCF SN1
046661,002693:
046662,002694: 00,3543 50000 INDEX A # IF POSITIVE, FORM PI - X, IF NEGATIVE
046663,002695: 00,3544 34726 CAF NEG1/2 +1 # USE -PI - X.
046664,002696: 00,3545 60000 DOUBLE
046665,002697: 00,3546 00006 EXTEND
046666,002698: 00,3547 60154 SU MPAC # GUARANTEED NO OVERFLOW.
046667,002699: 00,3550 54154 TS MPAC
046668,002700: 00,3551 40155 CS MPAC +1
046669,002701: 00,3552 54155 TS MPAC +1
046670,002702:
Page 1081 |
046672,002704: 00,3553 00006 SN1 EXTEND # SET UP TO EVALUATE HASTINGS POLYNOMIAL
046673,002705: 00,3554 30155 DCA MPAC
046674,002706: 00,3555 52134 DXCH BUF2
046675,002707: 00,3556 03300 TC DSQSUB # SQUARE MPAC.
046676,002708:
046677,002709: 00,3557 07243 TC POLY # EVALUATE FOURTH ORDER POLYNOMIAL.
046678,002710: 00,3560 00003 DEC 3 B-14
046679,002711: 00,3561 14441 37325 2DEC +.3926990796
046680,002712:
046681,002713: 00,3563 53250 60764 2DEC -.6459637111
046682,002714:
046683,002715: 00,3565 12146 21276 2DEC +.318758717
046684,002716:
046685,002717: 00,3567 75466 71471 2DEC -.074780249
046686,002718:
046687,002719: 00,3571 00236 32757 2DEC +.009694988
046688,002720:
046689,002721:
046690,002722: 00,3573 32470 CAF LBUF2 # MULTIPLY BY ARGUMENT AND SHIFT LEFT 2.
046691,002723: 00,3574 07127 TC DMPSUB -1
046692,002724:
046693,002725: 00,3575 00006 EXTEND
046694,002726: 00,3576 30156 DCA MPAC +1
046695,002727: 00,3577 20156 DAS MPAC +1
046696,002728: 00,3600 60154 AD MPAC
046697,002729: 00,3601 26154 ADS MPAC # NEITHER SHIFT OVERFLOWS.
046698,002730: 00,3602 00006 EXTEND
046699,002731: 00,3603 30156 DCA MPAC +1
046700,002732: 00,3604 20156 DAS MPAC +1
046701,002733: 00,3605 60154 AD MPAC
046702,002734: 00,3606 26154 ADS MPAC
046703,002735: 00,3607 16102 TCF DANZIG
046704,002736:
Page 1082 |
046706,002738: # ARCSIN/ARCCOS ROUTINE.
046707,002739:
046708,002740: 00,3610 33631 ARCSIN CAF LASINEX # COMPUTE ARCSIN BY USING THE IDENTITY
046709,002741: 00,3611 13613 TCF +2 # ARCSIN(X) = PI/2 - ARCCOS(X).
046710,002742:
046711,002743: 00,3612 33713 ARCCOS CAF LDANZIG # (EXITS IMMEDIATELY).
046712,002744: 00,3613 54136 TS ESCAPE
046713,002745: 00,3614 06744 TC BRANCH # TEST SIGN OF INPUT.
046714,002746: 00,3615 13625 TCF ACOSST # START IMMEDIATELY IF POSITIVE.
046715,002747: 00,3616 13731 TCF ACOSZERO # ARCCOS(0) = PI/2 = .25.
046716,002748: 00,3617 00006 EXTEND # IF NEGATIVE, USE THE IDENTITY
046717,002749: 00,3620 40155 DCS MPAC # ARCCOS(X) = PI - ARCCOS(-X), FORCING
046718,002750: 00,3621 52155 DXCH MPAC # ARGUMENT POSITIVE.
046719,002751: 00,3622 33734 CAF TCSUBTR # SET EXIT TO DO ABOVE BEFORE
046720,002752: 00,3623 56136 XCH ESCAPE # ARCSIN/ARCCOS CONSIDERATIONS.
046721,002753: 00,3624 54137 TS ESCAPE2
046722,002754:
046723,002755: 00,3625 44727 ACOSST CS HALF # TEST MAGNITUDE OF INPUT.
046724,002756: 00,3626 60154 AD MPAC
046725,002757: 00,3627 10000 CCS A
046726,002758: 00,3630 13721 TCF ACOSOVF # THIS IS PROBABLY AN OVERFLOW CASE.
046727,002759:
046728,002760: 00,3631 13707 LASINEX TCF ASINEX
046729,002761:
046730,002762: 00,3632 13642 TCF ACOSST2 # NO OVERFLOW - PROCEED.
046731,002763:
046732,002764: 00,3633 10155 CCS MPAC +1 # IF MAJOR PART IS .5, CALL ANSWER 0
046733,002765: 00,3634 34746 CAF ZERO # UNLESS MINOR PART NEGATIVE.
046734,002766: 00,3635 13637 TCF ACOS=0
046735,002767:
046736,002768: 00,3636 13642 TCF ACOSST2
046737,002769:
046738,002770: 00,3637 54155 ACOS=0 TS MPAC +1
046739,002771: 00,3640 54154 TS MPAC
046740,002772: 00,3641 00136 TC ESCAPE
046741,002773:
046742,002774: 00,3642 00006 ACOSST2 EXTEND # NOW THAT ARGUMENT IS IN PROPER RANGE,
046743,002775: 00,3643 40155 DCS MPAC # BEGIN COMPUTATION. USE HASTINGS
046744,002776: 00,3644 64727 AD HALF # APPROXIMATION ARCCOS(X) = SQRT(1-X)P(X)
046745,002777: 00,3645 52155 DXCH MPAC # IN A SCALED VERSION WHERE P(X) IS A
046746,002778: 00,3646 52134 DXCH BUF2 # SEVENTH ORDER POLYNOMIAL.
046747,002779:
046748,002780: 00,3647 03343 TC SQRTSUB # RETURNS WITH NORMALIZED SQUARE ROOT.
046749,002781:
046750,002782: 00,3650 10135 CCS MPTEMP # SEE IF UN-NORMALIZATION REQUIRED.
046751,002783: 00,3651 13714 TCF ACOSSHR # IF SO.
046752,002784:
Page 1083 |
046754,002786: 00,3652 52155 ACOS3 DXCH MPAC # SET UP FOR POLYNOMIAL EVALUATION.
046755,002787: 00,3653 52134 DXCH BUF2
046756,002788: 00,3654 52155 DXCH MPAC
046757,002789:
046758,002790: 00,3655 07243 TC POLY
046759,002791: 00,3656 00006 DEC 6 B-14
046760,002792: 00,3657 13240 23630 2DEC +.353553385 # COEFFICIENTS ARE C 2(+I)/PISQRT(2) WHERE
046761,002793:
046762,002794: 00,3661 74721 47775 2DEC* -.0483017006 B+1* # I
046763,002795:
046764,002796: 00,3663 02440 20237 2DEC* +.0200273085 B+2* # WHERE C STANDS FOR ORIGINAL COEFFS.
046765,002797:
046766,002798: 00,3665 75067 70742 2DEC* -.0112931863 B+3*
046767,002799:
046768,002800: 00,3667 03436 26756 2DEC* +.00695311612 B+4*
046769,002801:
046770,002802: 00,3671 74037 57640 2DEC* -.00384617957 B+5*
046771,002803:
046772,002804: 00,3673 03046 07143 2DEC* +.001501297736 B+6*
046773,002805:
046774,002806: 00,3675 76654 42244 2DEC* -.000284160334 B+7*
046775,002807:
046776,002808:
046777,002809: 00,3677 32470 CAF LBUF2 # DO FINAL MULTIPLY AND GO TO ANY
046778,002810: 00,3700 07127 TC DMPSUB -1 # EPILOGUE SEQUENCES.
046779,002811: 00,3701 00136 TC ESCAPE
046780,002812:
046781,002813: 00,3702 00006 SUBTR EXTEND # EPILOGUE FOR NEGATIVE INPUTS TO ARCCOS.
046782,002814: 00,3703 40155 DCS MPAC
046783,002815: 00,3704 64727 AD HALF # FORMS PI - ARCCOS(-X) = ARCCOS(X).
046784,002816: 00,3705 52155 DXCH MPAC
046785,002817: 00,3706 00137 TC ESCAPE2 # GO TO POSSIBLE ARCSIN EPILOGUE.
046786,002818:
046787,002819: 00,3707 00006 ASINEX EXTEND
046788,002820: 00,3710 40155 DCS MPAC # ARCSIN EPILOGUE - GET ARCSIN(X)
046789,002821: 00,3711 64730 AD QUARTER # = PI/2 - ARCCOS(X).
046790,002822: 00,3712 52155 DXCH MPAC
046791,002823: 00,3713 16102 LDANZIG TCF DANZIG
046792,002824:
Page 1084 |
046794,002826: 00,3714 50000 ACOSSHR INDEX A # THE SHIFT RIGHT IS LESS THAN 14 SINCE
046795,002827: 00,3715 34727 CAF BIT14 # THE INPUT WAS NON-ZERO DP.
046796,002828: 00,3716 54135 TS MPTEMP
046797,002829: 00,3717 02073 TC VSHRRND # DP SHIFT RIGHT AND ROUND.
046798,002830: 00,3720 13652 TCF ACOS3 # PROCEED.
046799,002831:
046800,002832: 00,3721 00006 ACOSOVF EXTEND # IF MAJOR PART WAS ONLY 1 MORE THAN .5,
046801,002833: 00,3722 13637 BZF ACOS=0 # CALL ANSWER ZERO.
046802,002834:
046803,002835: 00,3723 00006 ACOSABRT EXTEND # IF OVERFLOW, CALL ANSWER ZERO BUT
046804,002836: 00,3724 30165 DCA LOC # SOUND AN ALARM.
046805,002837: 00,3725 05726 TC ALARM1
046806,002838: 00,3726 01301 OCT 1301
046807,002839:
046808,002840: 00,3727 34746 CAF ZERO
046809,002841: 00,3730 13637 TCF ACOS=0
046810,002842:
046811,002843: 00,3731 34730 ACOSZERO CAF QUARTER # ACOS(0) = PI/2.
046812,002844: 00,3732 13640 TCF ACOS=0 +1 # SET MPAC AND EXIT VIA ESCAPE.
046813,002845:
046814,002846: 00,3733 77763 NEG12 DEC -12 B-14
046815,002847: 00,3734 13702 TCSUBTR TCF SUBTR
046816,002848:
Page 1085 |
046818,002850: # THE FOLLOWING INSTRUCTIONS ARE AVAILABLE FOR SETTING, MODIFYING, AND BRANCHING ON INDEX REGISTERS:
046819,002851:
046820,002852: # 1. AXT ADDRESS TO INDEX TRUE.
046821,002853: # 1. AXC ADDRESS TO INDEX COMPLEMENTED.
046822,002854: # 3. LXA LOAD INDEX FROM ERASABLE.
046823,002855: # 4. LXC LOAD INDEX COMPLEMENTED FROM ERASABLE.
046824,002856: # 5. SXA STORE INDEX IN ERASABLE.
046825,002857: # 6. XCHX EXCHANGE INDEX REIGSTER WITH ERASABLE.
046826,002858:
046827,002859: # 7. INCR INCREMENT INDEX REGISTER.
046828,002860: # 8. XAD ERASABLE ADD TO INDEX REGISTER.
046829,002861: # 9. XSU ERASABLE SUBTRACT FROM INDEX REGISTER.
046830,002862:
046831,002863: # 10. TIX BRANCH ON INDEX REGISTER AND DECREMENT.
046832,002864:
046833,002865: 01,2350 BANK 01
046834,002866:
046835,002867: 01,2350 COUNT* $$/INTER
046836,002868: 01,2350 02445 AXT TC TAGSUB # SELECT APPROPRIATE INDEX REGISTER.
046837,002869: 01,2351 30117 CA POLISH
046838,002870: 01,2352 50130 XSTORE INDEX INDEXLOC # CONTAINS C(FIXLOC) OR C(FIXLOC)+1.
046839,002871: 01,2353 54046 TS X1
046840,002872: 01,2354 16102 TCF DANZIG
046841,002873:
046842,002874: 01,2355 02445 AXC TC TAGSUB
046843,002875: 01,2356 40117 CS POLISH
046844,002876: 01,2357 02352 TC XSTORE
046845,002877:
046846,002878: 01,2360 02433 LXA TC 15ADRERS # LOAD INDEX REGISTER FROM ERASABLE.
046847,002879: 01,2361 50117 INDEX POLISH
046848,002880: 01,2362 30000 CA 0
046849,002881: 01,2363 12352 TCF XSTORE
046850,002882:
046851,002883: 01,2364 02433 LXC TC 15ADRERS # LOAD NDX REG FROM ERASABLE COMPLEMENTED.
046852,002884: 01,2365 50117 INDEX POLISH
046853,002885: 01,2366 40000 CS 0
046854,002886: 01,2367 12352 TCF XSTORE
046855,002887:
046856,002888: 01,2370 02433 SXA TC 15ADRERS # STORE INDEX REGISTER IN ERASABLE.
046857,002889: 01,2371 50130 INDEX INDEXLOC
046858,002890: 01,2372 30046 CA X1
046859,002891: 01,2373 50117 MSTORE1 INDEX POLISH
046860,002892: 01,2374 54000 TS 0
046861,002893: 01,2375 16102 TCF DANZIG
046862,002894:
Page 1086 |
046864,002896: 01,2376 02433 XCHX TC 15ADRERS # EXCHANGE INDEX REGISTER WITH ERASABLE.
046865,002897: 01,2377 50117 INDEX POLISH
046866,002898: 01,2400 30000 CA 0
046867,002899: 01,2401 50130 INDEX INDEXLOC
046868,002900: 01,2402 56046 XCH X1
046869,002901: 01,2403 12373 TCF MSTORE1
046870,002902:
046871,002903: 01,2404 02433 XAD TC 15ADRERS # ADD ERASABLE TO INDEX REGISTER.
046872,002904: 01,2405 50117 INDEX POLISH
046873,002905: 01,2406 30000 CA 0
046874,002906: 01,2407 50130 XAD2 INDEX INDEXLOC
046875,002907: 01,2410 26046 ADS X1 # IGNORING OVERFLOWS.
046876,002908: 01,2411 16102 TCF DANZIG
046877,002909:
046878,002910: 01,2412 02445 INCR TC TAGSUB # INCREMENT INDEX REGISTER.
046879,002911: 01,2413 30117 CA POLISH
046880,002912: 01,2414 12407 TCF XAD2
046881,002913:
046882,002914: 01,2415 02433 XSU TC 15ADRERS # SUBTRACT ERASABLE FROM INDEX REGISTER.
046883,002915: 01,2416 50117 INDEX POLISH
046884,002916: 01,2417 40000 CS 0
046885,002917: 01,2420 12407 TCF XAD2
046886,002918:
046887,002919: 01,2421 02445 TIX TC TAGSUB # BRANCH AND DECREMENT ON INDEX.
046888,002920: 01,2422 50130 INDEX INDEXLOC
046889,002921: 01,2423 40050 CS S1
046890,002922: 01,2424 50130 INDEX INDEXLOC
046891,002923: 01,2425 60046 AD X1
046892,002924: 01,2426 00006 EXTEND # NO OPERATION IF DECREMENTED INDEX IS
046893,002925: 01,2427 66102 BZMF DANZIG # NEGATIVE OR ZERO.
046894,002926:
046895,002927: 01,2430 50130 DOTIXBR INDEX INDEXLOC
046896,002928: 01,2431 56046 XCH X1 # IGNORING OVERFLOWS.
046897,002929:
046898,002930: 01,2432 16667 TCF GOTO # DO THE BRANCH USING THE CADR IN POLISH.
046899,002931:
Page 1087 |
046901,002933: # SUBROUTINE TO CONVERT AN ERASABLE ADDRESS (11 BITS) TO AN EBANK SETTING AND SUBADDRESS.
046902,002934:
046903,002935: 01,2433 40117 15ADRERS CS POLISH
046904,002936: 01,2434 64763 AD DEC45
046905,002937: 01,2435 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
046906,002938: 01,2436 30120 CA FIXLOC # YES. ADD FIXLOC. EBANK OK AS IS.
046907,002939: 01,2437 12444 TCF +5
046908,002940:
046909,002941: 01,2440 35000 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
046910,002942: 01,2441 56117 XCH POLISH
046911,002943: 01,2442 54003 TS EBANK
046912,002944: 01,2443 74350 MASK LOW8
046913,002945: 01,2444 26117 +5 ADS POLISH # FALL INTO TAGSUB, AND RETURN VIA Q.
046914,002946:
046915,002947: # SUBROUTINE WHICH SETS THE ADDRESS OF THE SPECIFIED INDEX IN INDEXLOC. (ACTUALLY, THE ADDRESS -38D.)
046916,002948:
046917,002949: 01,2445 30120 TAGSUB CA FIXLOC
046918,002950: 01,2446 54130 TS INDEXLOC
046919,002951:
046920,002952: 01,2447 10020 CCS CYR # BIT 15 SPECIFIES INDEX.
046921,002953: 01,2450 24130 INCR INDEXLOC # 0 MEANS USE X2.
046922,002954: 01,2451 00002 TC Q
046923,002955: 01,2452 00002 TC Q # 1 FOR X1.
046924,002956:
Page 1088 |
046926,002958: # MISCELLANEOUS OPERATION CODES WITH DIRECT ADDRESSES. INCLUDED HERE ARE:
046927,002959:
046928,002960: # 1. ITA STORE QPRET (RETURN ADDRESS) IN ERASABLE.
046929,002961: # 2. CALL CALL A SUBROUTINE, LEAVING RETURN IN QPRET.
046930,002962: # 3. RTB RETURN TO BASIC LANGUAGE AT THE GIVEN ADDRESS.
046931,002963: # 4. BHIZ BRANCH IF THE HIGH ORDER OF MPAC IS ZERO (SINGLE PRECISION).
046932,002964: # 5. BOV BRANCH ON OVERFLOW.
046933,002965: # 6. GOTO SIMPLE SEQUENCE CHANGE.
046934,002966:
046935,002967: 01,2453 10020 RTB/BHIZ CCS CYR
046936,002968: 01,2454 30117 RTB CA POLISH
046937,002969: 01,2455 04612 TC SWCALL -1 # SO A "TC Q" FROM ROUTINE LEADS TO DANZIG
046938,002970:
046939,002971: 01,2456 10154 BHIZ CCS MPAC
046940,002972: 01,2457 16102 TCF DANZIG
046941,002973: 01,2460 16667 TCF GOTO
046942,002974: 01,2461 16102 TCF DANZIG
046943,002975: 01,2462 16667 TCF GOTO
046944,002976:
046945,002977: 01,2463 10121 BOV(B) CCS OVFIND # BRANCH ON OVERFLOW TO BASIC OR INTERP.
046946,002978: 01,2464 12466 TCF +2
046947,002979: 01,2465 16102 TCF DANZIG
046948,002980: 01,2466 54121 TS OVFIND
046949,002981: 01,2467 10020 CCS CYR
046950,002982: 01,2470 12454 TCF RTB # IF BASIC.
046951,002983: 01,2471 00360 B5TOB8 OCT 360
046952,002984: 01,2472 16667 TCF GOTO
046953,002985:
Page 1089 |
046955,002987: 01,2473 10020 BZE/GOTO CCS CYR # SEE WHICH OP-CODE IS DESIRED.
046956,002988: 01,2474 06744 TC BRANCH # DO BZE.
046957,002989: 01,2475 16102 TCF DANZIG
046958,002990: 01,2476 16667 TCF GOTO # DO GOTO.
046959,002991: 01,2477 16102 TCF DANZIG
046960,002992:
046961,002993: 01,2500 10020 BPL/BMN CCS CYR
046962,002994: 01,2501 12507 TCF BPL
046963,002995: 01,2502 12000 5B10 DEC 5 B+10 # SHIFTS OP CODE IN SWITCH INSTRUCTION ADR
046964,002996:
046965,002997: 01,2503 06744 TC BRANCH # DO BMN.
046966,002998: 01,2504 16102 TCF DANZIG
046967,002999: 01,2505 16102 TCF DANZIG
046968,003000: 01,2506 16667 TCF GOTO # ONLY IF NNZ.
046969,003001:
046970,003002: 01,2507 06744 BPL TC BRANCH
046971,003003: 01,2510 16667 TCF GOTO # IF POSITIVE OR ZERO.
046972,003004: 01,2511 16667 TCF GOTO
046973,003005: 01,2512 16102 TCF DANZIG
046974,003006:
046975,003007: 01,2513 10020 CALL/ITA CCS CYR
046976,003008: 01,2514 16661 TCF CALL
046977,003009:
046978,003010: 01,2515 05701 TC CCSHOLE
046979,003011: 01,2516 02433 TC 15ADRERS # STORE QPRET. (TAGSUB AFTER 15ADRERS IS
046980,003012: 01,2517 50120 INDEX FIXLOC # SLOW IN THIS CASE, BUT SAVES STORAGE.)
046981,003013: 01,2520 30052 CA QPRET
046982,003014: 01,2521 12373 TCF MSTORE1
046983,003015:
Page 1090 |
046985,003017: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR ALTERING AND TESTING INTERPRETIVE SWITCHES:
046986,003018:
046987,003019: # 00 BONSET SET A SWITCH AND DO A GOTO IF IT WAS ON.
046988,003020: # 01 SETGO SET A SWITCH AND DO A GOTO.
046989,003021: # 02 BOFSET SET A SWITCH AND DO A GOTO IF IT WAS OFF
046990,003022: # 03 SET SET A SWITCH.
046991,003023:
046992,003024: # 04 BONINV INVERT A SWITCH AND BRANCH IF IT WAS ON.
046993,003025: # 05 INVGO INVERT A SWITCH AND DO A GOTO.
046994,003026: # 06 BOFINV INVERT A SWITCH AND BRANCH IF IT WAS OFF
046995,003027: # 07 INVERT INVERT A SWITCH.
046996,003028:
046997,003029: # 10 BONCLR CLEAR A SWITCH AND BRANCH IF IT WAS ON.
046998,003030: # 11 CLRGO CLEAR A SWITCH AND DO A GOTO.
046999,003031: # 12 BOFCLR CLEAR A SWITCH AND BRANCH IF IT WAS OFF.
047000,003032: # 13 CLEAR CLEAR A SWITCH.
047001,003033:
047002,003034: # 14 BON BRANCH IF A SWITCH WAS ON.
047003,003035: # 16 BOFF BRANCH IF A SWITCH WAS OFF.
047004,003036:
047005,003037:
047006,003038: # THE ADDRESS SUPPLIED WITH THE SWITCH INSTRUCTION IS INTERPRETED AS FOLLOWS:
047007,003039:
047008,003040: # BITS 1-4 SWITCH BIT NUMBER (1-15).
047009,003041: # BITS 5-8 SWITCH OPERATION NUMBER.
047010,003042: # BITS 9- SWITCH WORD NUMBER (UP TO 64 SWITCH WORDS).
047011,003043:
047012,003044: # THE ADDRESS ITSELF IS MADE UP BY THE YUL SYSTEM ASSEMBLER. THE BRANCH INSTRUCTIONS REQUIRE TWO
047013,003045: # ADDRESSES, THE SECOND TAKEN AS THE DIRECT (OR INDIRECT IF IN ERASABLE) ADDRESS OF THE BRANCH.
047014,003046:
047015,003047:
047016,003048: 01,2522 34753 SWITCHES CAF LOW4 # LEAVE THE SWITCH BIT IN SWBIT .
047017,003049: 01,2523 70117 MASK POLISH
047018,003050: 01,2524 50000 INDEX A
047019,003051: 01,2525 34726 CAF BIT15 # (NUMBER FROM LEFT TO RIGHT.)
047020,003052: 01,2526 54131 TS SWBIT
047021,003053:
047022,003054: 01,2527 34736 CAF BIT7 # LEAVE THE SWITCH NUMBER IN SWWORD.
047023,003055: 01,2530 00006 EXTEND
047024,003056: 01,2531 70117 MP POLISH
047025,003057: 01,2532 54130 TS SWWORD
047026,003058:
047027,003059: 01,2533 00004 INHINT # DURING SWITCH CHANGE SO RUPT CAN USE TOO
047028,003060: 01,2534 50000 INDEX A # LEAVE THE SWITCH WORD ITSELF IN L.
047029,003061: 01,2535 30074 CA STATE
047030,003062: 01,2536 54002 TS Q # Q WILL BE USED AS A CHANNEL.
Page 1091 |
047032,003064: 01,2537 34732 CAF BIT11
047033,003065: 01,2540 00006 EXTEND # DISPATCH SWITCH BIT OPERATION AS IN BITS
047034,003066: 01,2541 70117 MP POLISH # 7-8 OF POLISH.
047035,003067: 01,2542 72602 MASK B3TOB4 # GETS 4X2-BIT CODE.
047036,003068: 01,2543 50000 INDEX A
047037,003069: 01,2544 12545 TCF +1
047038,003070:
047039,003071: 01,2545 30131 +1 CA SWBIT # 00 - SET SWITCH IN QUESTION.
047040,003072: 01,2546 00006 EXTEND
047041,003073: 01,2547 04002 ROR QCHAN
047042,003074: 01,2550 12557 TCF SWSTORE
047043,003075:
047044,003076: 01,2551 30131 +5 CA SWBIT # 01 - INVERT SWITCH.
047045,003077: 01,2552 00006 EXTEND
047046,003078: 01,2553 06002 RXOR QCHAN
047047,003079: 01,2554 12557 TCF SWSTORE
047048,003080:
047049,003081: 01,2555 40131 +9D CS SWBIT # 10 - CLEAR.
047050,003082: 01,2556 70002 MASK Q
047051,003083: 01,2557 50130 SWSTORE INDEX SWWORD
047052,003084: 01,2560 54074 TS STATE # NEW SWITCH WORD.
047053,003085:
Page 1092 |
047055,003087: 01,2561 00003 +13D RELINT # 11 - NOOP.
047056,003088: 01,2562 34730 CAF BIT13
047057,003089: 01,2563 00006 EXTEND # DISPATCH SEQUCE CHANGING OR BRANCHING
047058,003090: 01,2564 70117 MP POLISH # CODE.
047059,003091: 01,2565 72602 MASK B3TOB4
047060,003092: 01,2566 50000 INDEX A
047061,003093: 01,2567 12570 TCF +1 # ORIGINALLY STORED IN BITS 5-6.
047062,003094:
047063,003095: 01,2570 40002 +1 CS Q # 00 - BRANCH IF ON.
047064,003096: 01,2571 70131 TEST MASK SWBIT
047065,003097: 01,2572 10000 CCS A
047066,003098: 01,2573 12603 TCF SWSKIP
047067,003099:
047068,003100: 01,2574 16736 +5 TCF SWBRANCH # 01 - GO TO.
047069,003101:
047070,003102: 01,2575 12603 TCF SWSKIP # HERE ONLY ON BIT 15.
047071,003103:
047072,003104: 01,2576 05701 TC CCSHOLE
047073,003105: 01,2577 05701 TC CCSHOLE
047074,003106:
047075,003107: 01,2600 30002 +9D CA Q # 10 - BRANCH IF OFF.
047076,003108: 01,2601 12571 TCF TEST
047077,003109:
047078,003110: 01,2602 00014 B3TOB4 OCT 0014
047079,003111: 01,2603 24164 SWSKIP INCR LOC
047080,003112:
047081,003113: 01,2604 01,2522 SW/ EQUALS SWITCHES
047082,003114:
047083,003115: 01,2604 16102 +13D TCF DANZIG # 11 - NOOP.
End of include-file INTERPRETER.agc. Parent file is MAIN.agc