Source Code
These source-code files derive from a printout of Luminary 116 (the Apollo 12
Lunar Module guidance computer program), from the personal library of
original AGC developer Don Eyles, digitally photographed at archive.org,
financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071 19:09 AUG. 11,1969Note that the date is the date of the printout, not the date of the program revision. |
042912,000002: ## Copyright: Public domain.
042913,000003: ## Filename: INTERPRETER.agc
042914,000004: ## Purpose: A section of Luminary revision 116.
042915,000005: ## It is part of the source code for the Lunar Module's (LM)
042916,000006: ## Apollo Guidance Computer (AGC) for Apollo 12.
042917,000007: ## This file is intended to be a faithful transcription, except
042918,000008: ## that the code format has been changed to conform to the
042919,000009: ## requirements of the yaYUL assembler rather than the
042920,000010: ## original YUL assembler.
042921,000011: ## Reference: pp. 994-1086
042922,000012: ## Assembler: yaYUL
042923,000013: ## Contact: Ron Burkey <info@sandroid.org>.
042924,000014: ## Website: www.ibiblio.org/apollo/index.html
042925,000015: ## Mod history: 2017-01-22 MAS Created from Luminary 99.
042926,000016: ## 2017-01-28 RSB Back-ported some comment-text fixes made in Luminary 69.
042927,000017: ## 2017-02-05 RSB Back-ported comment corrections
042928,000018: ## identified while proofing Artemis 072.
042929,000019: ## 2017-03-10 HG Transcribed
042930,000020: ## 2017-03-13 RSB Proofed comment text via 3-way diff vs
042931,000021: ## Luminary 99 and 131.
042932,000022: ## 2017-03-15 RSB Comment-text fixes identified in 5-way
042933,000023: ## side-by-side diff of Luminary 69/99/116/131/210.
042934,000024: ## 2021-05-30 ABS Added IRT0 location symbol to match scans.
042935,000025: ## B5TOBB -> B5TOB8
042936,000026:
Page 994 |
042938,000028: # SECTION 1 DISPATCHER
042939,000029:
042940,000030: # ENTRY TO THE INTERPRETER. INTPRET SETS LOC TO THE FIRST INSTRUCTION, BANKSET TO THE BBANK OF THE
042941,000031: # OBJECT INTERPRETIVE PROGRAM, AND INTBIT15 TO THE BIT15 CONTENTS OF FBANK. INTERPRETIVE PROGRAMS MAY BE IN
042942,000032: # VIRTUALLY ALL BANKS PRESENT UNDER ANY SUPER-BANK SETTING, WITH THE RESTRICTION THAT PROGRAMS IN HIGH BANKS
042943,000033: # (BIT15 OF FBANK = 1) DO NOT REFER TO LOWBANKS, AND VICE-VERSA. THE INTERPRETER DOES NOT SWITCH SUPERBANKS.
042944,000034: # E-BANK SWITCHING OCCURS WHENEVER GENERAL ERASABLE (100-3777) IS ADDRESSED.
042945,000035:
042946,000036:
042947,000037: 6042 BLOCK 03
042948,000038:
042949,000039: 6042 COUNT* $$/INTER
042950,000040: 6042 00003 INTPRET RELINT
042951,000041: 6043 00006 EXTEND # SET LOC TO THE WORD FOLLOWING THE TC.
042952,000042: 6044 22164 QXCH LOC
042953,000043:
042954,000044: 6045 30006 +2 CA BBANK # INTERPRETIVE BRANCHES FINISH HERE.
042955,000045: 6046 54165 TS BANKSET
042956,000046: 6047 74735 MASK BIT15 # GET 15TH BIT FOR INDEXABLE ADDRESSES.
042957,000047: 6050 54115 TS INTBIT15
042958,000048:
042959,000049: 6051 54023 TS EDOP # MAKE SURE NO INSTRUCTIONS LEFT OVER
042960,000050:
042961,000051: 6052 16073 TCF NEWOPS # PICK UP OP CODE PAIR AND BEGIN.
042962,000052:
042963,000053:
042964,000054: 6053 22006 INTRSM LXCH BBANK # RESUME SUSPENDED INTERPRETIVE JOB
042965,000055: 6054 16045 TCF INTPRET +3
042966,000056: # DLOAD LOADS MPAC, MPAC +1, LEAVING ZERO IN MPAC +2.
042967,000057:
042968,000058: 6055 00006 DLOAD EXTEND
042969,000059: 6056 50116 INDEX ADDRWD
042970,000060: 6057 30001 DCA 0 # LOAD DP C(C(ADDRWD)) INTO MPAC,MPAX +1
042971,000061: 6060 52155 SLOAD2 DXCH MPAC
042972,000062: 6061 34755 CAF ZERO # ZERO MPAC +2
042973,000063:
Page 995 |
042975,000065: # AT THE END OF MOST INSTRUCTIONS, CONTROL IS GIVEN TO DANZIG TO DISPATCH THE NEXT OPERATION.
042976,000066:
042977,000067: 6062 54156 TS MPAC +2 # AND DECLARE DP MODE
042978,000068:
042979,000069: 6063 54163 NEWMODE TS MODE # PROLOGUE FOR MODE-CHANGING INSTRUCTIONS.
042980,000070:
042981,000071: 6064 30165 DANZIG CA BANKSET # SET BBANK BEFORE TESTING NEWJOB SO THAT
042982,000072: 6065 54006 TS BBANK # IT MAY BE SAVED DIRECTLY BY CHANJOB.
042983,000073:
042984,000074: 6066 10023 NOIBNKSW CCS EDOP # SEE IF AN ORDER CODE IS LEFT OVER FROM
042985,000075: 6067 16102 TCF OPJUMP # THE LAST PAIR RETRIEVED. IF SO, EXECUTE.
042986,000076: # EDOP IS SET TO ZERO ON ITS RE-EDITING.
042987,000077:
042988,000078: 6070 10067 CCS NEWJOB # SEE IF A JOB OF HIGHER PRIORITY IS
042989,000079: 6071 15126 TCF CHANG2 # PRESENT, AND IF SO, CHANGE JOBS.
042990,000080:
042991,000081: 6072 24164 INCR LOC # ADVANCE THE LOCATION COUNTER.
042992,000082:
042993,000083: # ITRACE (1) REFERS TO "NEWOPS".
042994,000084: 6073 50164 NEWOPS INDEX LOC # ENTRY TO BEGIN BY PICKING OP CODE PAIR.
042995,000085: 6074 30000 CA 0 # MAY BE AN OPCODE PAIR OR A STORE CODE.
042996,000086: 6075 10000 CCS A # TEST SIGN AND GET DABS(A).
042997,000087: 6076 16365 TCF DOSTORE # PROCESS STORE CODE.
042998,000088:
042999,000089: 6077 00177 LOW7 OCT 177
043000,000090:
043001,000091: 6100 54023 TS EDOP # OP CODE PAIR. LEAVE THE OTHER IN EDOP
043002,000092: 6101 76077 MASK LOW7 # WHERE CCS EDOP WILL HONOR IT NEXT.
043003,000093:
043004,000094: 6102 54020 OPJUMP TS CYR # LOWWD ENTERS HERE IF A RIGHT-HAND OP
043005,000095: 6103 10020 CCS CYR # CODE IS TO BE PROCESSED. TEST PREFICES.
043006,000096: 6104 16252 TCF OPJUMP2 # TEST SECOND PREFIX BIT.
043007,000097:
043008,000098: 6105 16746 TCF EXIT # +0 OP CODE IS EXIT.
043009,000099:
Page 996 |
043011,000101: # PROCESS ADDRESSES WHICH MAY BE DIRECT, INDEXED, OR REFERENCE THE PUSHDOWN LIST.
043012,000102:
043013,000103: 6106 74753 ADDRESS MASK BIT1 # SEE IF ADDRESS IS INDEXED. CYR CONTAINED
043014,000104: 6107 10000 CCS A # 400XX, SO BIT 1 IS NOW AS IT WAS IN CYR.
043015,000105: 6110 16151 TCF INDEX # FORM INDEXED ADDRESS.
043016,000106:
043017,000107: 6111 50164 DIRADRES INDEX LOC # LOOK AHEAD TO NEXT WORD TO SEE IF
043018,000108: 6112 40001 OCT40001 CS 1 # ADDRESS IS GIVEN.
043019,000109: 6113 10000 CCS A
043020,000110: 6114 16220 TCF PUSHUP # IF NOT.
043021,000111:
043022,000112: 6115 77773 NEG4 DEC -4 B-14
043023,000113:
043024,000114: 6116 24164 INCR LOC # IF SO, TO SHOW WE PICKED UP A WORD.
043025,000115: 6117 54116 TS ADDRWD
043026,000116:
Page 997 |
043028,000118: # FINAL DIGESTION OF DIRECT ADDRESSES OF OP CODES WITH 01 PREFIX IS DONE HERE. IN EACH CASE, THE
043029,000119: # REQUIRED 12-BIT SUB-ADDRESS IS LEFT IN ADDRWD, WITH ANY REQUIRED E OR F BANK SWITCHING DONE. ADDRESSES LESS
043030,000120: # 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.
043031,000121:
043032,000122: 6120 66254 AD -ENDVAC # SEE IF ADDRESS RELATIVE TO WORK AREA.
043033,000123: 6121 10000 CCS A
043034,000124: 6122 67746 AD -ENDERAS # IF NOT, SEE IF IN GENERAL ERASABLE.
043035,000125: 6123 16130 TCF IERASTST
043036,000126:
043037,000127: 6124 30120 NETZERO CA FIXLOC # IF SO, LEAVE THE MODIFIED ADDRESS IN
043038,000128: 6125 26116 ADS ADDRWD # ADDRWD AND DISPATCH.
043039,000129: 6126 50020 ITR15 INDEX CYR # THIS INDEX MAKES THE NEXT INSTRUCTION
043040,000130: 6127 76276 7 INDJUMP -1 # TCF INDJUMP + OP, EDITING CYR.
043041,000131:
043042,000132: 6130 00006 IERASTST EXTEND
043043,000133: 6131 66141 BZMF GEADDR # GO PROCESS GENERAL-ERASABLE ADDRESS.
043044,000134:
043045,000135: 6132 75012 MASK LOW10 # FIXED BANK ADDRESS. RESTORE AND ADD B15.
043046,000136: 6133 65012 AD LOW10 # SWITCH BANKS AND LEAVE SUBADDRESS IN
043047,000137: 6134 56116 XCH ADDRWD # ADDRWD FOR OPERAND RETRIEVAL. (THIS
043048,000138: 6135 60115 AD INTBIT15 # METHOD PRECLUDES USE OF THE LAST
043049,000139: 6136 54004 TS FBANK # LOCATION IN EACH FBANK.)
043050,000140: 6137 50020 ITR12 INDEX CYR
043051,000141: 6140 76276 7 INDJUMP -1
043052,000142:
043053,000143: 6141 74357 GEADDR MASK LOW8
043054,000144: 6142 65007 AD OCT1400
043055,000145: 6143 56116 XCH ADDRWD
043056,000146: 6144 54003 TS EBANK
043057,000147: 6145 50020 ITR10 INDEX CYR
043058,000148: 6146 76276 7 INDJUMP -1
043059,000149:
Page 998 |
043061,000151: # THE FOLLOWING ROUTINE PROCESSES INTERPRETIVE INDEXED ADDRESSES. AN INTERPRETER INDEX REGISTER MAY
043062,000152: # CONTAIN THE ADDRESS OF ANY ERASABLE REGISTER (0-42 BEING RELATIVE TO THE VAC AREA) OR ANY INTERPRETIVE PROGRAM
043063,000153: # BANK, OR ANY INTEGER IN THAT RANGE.
043064,000154:
043065,000155: 6147 37736 DODLOAD* CAF DLOAD* # STODL* COMES HERE TO PROCESS LOAD ADR.
043066,000156: 6150 54020 TS CYR # (STOVL* ENTERS HERE).
043067,000157:
043068,000158: 6151 30120 INDEX CA FIXLOC # SET UP INDEX LOCATION.
043069,000159: 6152 54130 TS INDEXLOC
043070,000160: 6153 24164 INCR LOC # (ADDRESS ALWAYS GIVEN).
043071,000161: 6154 50164 INDEX LOC
043072,000162: 6155 40000 CS 0
043073,000163: 6156 10000 CCS A # INDEX 2 IF ADDRESS STORED COMPLEMENTED.
043074,000164: 6157 24130 INCR INDEXLOC
043075,000165: 6160 16161 NOOP
043076,000166:
043077,000167: 6161 54116 TS ADDRWD # 14 BIT ADDRESS TO ADDRWD.
043078,000168: 6162 77745 MASK HIGH4 # IF ADDRESS GREATER THAN 2K, ADD INTBIT15
043079,000169: 6163 00006 EXTEND
043080,000170: 6164 16167 BZF INDEX2
043081,000171: 6165 30115 CA INTBIT15
043082,000172: 6166 26116 ADS ADDRWD
043083,000173:
043084,000174: 6167 50130 INDEX2 INDEX INDEXLOC
043085,000175: 6170 40046 CS X1
043086,000176: 6171 26116 ADS ADDRWD # DO AUGMENT, IGNORING AND CORRECTING OVF.
043087,000177:
043088,000178: 6172 77747 MASK HIGH9 # SEE IF ADDRESS IS IN WORK AREA.
043089,000179: 6173 00006 EXTEND
043090,000180: 6174 16207 BZF INDWORK
043091,000181: 6175 77745 MASK HIGH4 # SEE IF IN FIXED BANK.
043092,000182: 6176 00006 EXTEND
043093,000183: 6177 16211 BZF INDERASE
043094,000184:
043095,000185: 6200 30116 CA ADDRWD # IN FIXED - SWITCH BANKS AND CREATE
043096,000186: 6201 54004 TS FBANK # SUB-ADDRESS.
043097,000187: 6202 75012 MASK LOW10
043098,000188: 6203 64741 AD 2K
043099,000189: 6204 54116 TS ADDRWD
043100,000190: 6205 50020 ITR11 INDEX CYR
043101,000191: 6206 36276 3 INDJUMP -1
043102,000192:
043103,000193: 6207 30120 INDWORK CA FIXLOC # MAKE ADDRWD RELATIVE TO WORK AREA.
043104,000194: 6210 16215 TCF ITR13 -1
043105,000195:
043106,000196: 6211 35007 INDERASE CA OCT1400
043107,000197: 6212 56116 XCH ADDRWD
043108,000198: 6213 54003 TS EBANK
043109,000199: 6214 74357 MASK LOW8
043110,000200: 6215 26116 -1 ADS ADDRWD
043111,000201:
Page 999 |
043113,000203: 6216 50020 ITR13 INDEX CYR
043114,000204: 6217 36276 3 INDJUMP -1
043115,000205:
Page 1000 |
043117,000207: # PUSH-UP ROUTINES. WHEN NO OPERAND ADDRESS IS GIVEN, THE APPROPRIATE OPERAND IS TAKEN FROM THE PUSH-DOWN
043118,000208: # LIST. IN MOST CASES THE MODE OF THE RESULT (VECTOR OR SCALAR) OF THE LAST ARITHMETIC OPERATION PERFORMED
043119,000209: # IS THE SAME AS THE TYPE OF OPERAND DESIRED (ALL ADD/SUBTRACT ETC.). EXCEPTIONS TO THIS GENERAL RULE ARE LISTED
043120,000210: # BELOW (NOTE THAT IN EVERY CASE THE MODE REGISTER IS LEFT INTACT):
043121,000211:
043122,000212: # 1. VXSC AND V/SC WANT THE OPPOSITE TYPE OF OPERAND, E.G., IF THE LAST OPERATION YIELDED A VECTOR
043123,000213: # RESULT, VXSC WANTS A SCALAR.
043124,000214:
043125,000215: # 2. THE LOAD CODES SHOULD LOAD THE ACCUMULATOR INDEPENDENT OF THE RESULT OF THE LAST OPERATION. THIS
043126,000216: # INCLUDES VLOAD, DLOAD, TLOAD, PDDL, AND PDVL (NO PUSHUP WITH SLOAD).
043127,000217:
043128,000218: # 3. SOME ARITHMETIC OPERATIONS REQUIRE A STANDARD TYPE OF OPERAND REGARDLESS OF THE PREVIOUS OPERATION.
043129,000219: # THIS INCLUDES SIGN WANTING DP AND TAD REQUIRING TP.
043130,000220:
043131,000221: 6220 34360 PUSHUP CAF OCT23 # IF THE LOW 5 BITS OF CYR ARE LESS THAN
043132,000222: 6221 70020 MASK CYR # 20, THIS OP REQUIRES SPECIAL ATTENTION.
043133,000223: 6222 66225 AD -OCT10 # (NO -0).
043134,000224: 6223 10000 CCS A
043135,000225: 6224 16236 TCF REGUP # FOR ALL CODES GREATER THAN OCT 7.
043136,000226:
043137,000227: 6225 77767 -OCT10 OCT -10
043138,000228:
043139,000229: 6226 66115 AD NEG4 # WE NOW HAVE 7 - OP CODE(MOD4). SEE IF
043140,000230: 6227 10000 CCS A # THE OP CODE (MOD4) IS THREE (REVERSE).
043141,000231: 6230 50000 INDEX A # NO - THE MODE IS DEFINITE. PICK UP THE
043142,000232: 6231 46247 CS NO.WDS
043143,000233: 6232 16240 TCF REGUP +2
043144,000234:
043145,000235: 6233 50163 INDEX MODE # FOR VXSC AND V/SC WE WANT THE REQUIRED
043146,000236: 6234 46245 CS REVCNT # PUSHLOC DECREMENT WITHOUT CHANGING THE
043147,000237: 6235 16240 TCF REGUP +2 # MODE AT THIS TIME.
043148,000238:
043149,000239: 6236 50163 REGUP INDEX MODE # MOST ALL OP CODES PUSHUP HERE.
043150,000240: 6237 46247 CS NO.WDS
043151,000241: 6240 26166 +2 ADS PUSHLOC
043152,000242: 6241 54116 TS ADDRWD
043153,000243: 6242 50020 ITR14 INDEX CYR
043154,000244: 6243 76276 7 INDJUMP -1 # (THE INDEX MAKES THIS A TCF.)
043155,000245:
043156,000246: 6244 00002 OCT 2 # REVERSE PUSHUP DECREMENT. VECTOR TAKES 2
043157,000247: 6245 00006 REVCNT OCT 6 # WORDS, SCALAR TAKES 6.
043158,000248: 6246 00006 OCT 6
043159,000249: 6247 00002 NO.WDS OCT 2 # CONVENTIONAL DECREMENT IS 6 WORDS VECTOR
043160,000250: 6250 00003 OCTAL3 OCT 3 # 2 IN DP, AND 3 IN TP.
043161,000251: 6251 00006 OCT 6
043162,000252:
Page 1001 |
043164,000254: # TEST THE SECOND PREFIX BIT TO SEE IF THIS IS A MISCELLANEOUS OR A UNARY/SHORT SHIFT OPERATION.
043165,000255:
043166,000256: 6252 10020 OPJUMP2 CCS CYR # TEST SECOND PREFIX BIT.
043167,000257: 6253 16266 TCF OPJUMP3 # TEST THIRD BIT TO SEE IF UNARY OR SHIFT.
043168,000258:
043169,000259: 6254 77722 -ENDVAC DEC -45 B-14
043170,000260:
043171,000261: # THE FOLLOWING ROUTINE PROCESSES ADDRESSES OF SUFFIX CLASS 10. THEY ARE BASICALLY WORK AREA ADDRESSES
043172,000262: # IN THE RANGE 0 - 52, ERASABLE ECADR CONSTANTS FROM 100 - 3777, AND FCADRS ABOVE THAT. ALL 15 BITS ARE AVAILABLE
043173,000263: # IN CONTRAST TO SUFFIX 1, IN WHICH ONLY THE LOW ORDER 14 ARE AVAILABLE.
043174,000264:
043175,000265: 6255 24164 15BITADR INCR LOC # (ENTRY HERE FROM STCALL).
043176,000266: 6256 50164 INDEX LOC # PICK UP ADDRESS WORD.
043177,000267: 6257 30000 CA 0
043178,000268: 6260 54117 TS POLISH # WE MAY NEED A SUBADDRESS LATER.
043179,000269:
043180,000270: 6261 35013 CAF LOW7+2K # THESE INSTRUCTIONS ARE IN BANK 1.
043181,000271: 6262 54004 TS FBANK
043182,000272: 6263 70020 MASK CYR
043183,000273: 6264 50000 ITR7 INDEX A
043184,000274: 6265 16337 TCF MISCJUMP
043185,000275:
Page 1002 |
043187,000277: # COMPLETE THE DISPATCHING OF UNARY AND SHORT SHIFT OPERATIONS.
043188,000278:
043189,000279: 6266 54004 OPJUMP3 TS FBANK # CALL IN BANK 0 (BITS 11-15 OF A ARE 0.)
043190,000280: # ITRACE (6) REFERS TO "OPJUMP3".
043191,000281: 6267 10020 CCS CYR # TEST THIRD PREFIX BIT.
043192,000282: 6270 50000 INDEX A # THE DECREMENTED UNARY CODE IS IN BITS
043193,000283: 6271 12000 TCF UNAJUMP # 1-4 OF A (ZERO, EXIT, HAS BEEN DETECTED)
043194,000284:
043195,000285: 6272 10163 CCS MODE # ITS A SHORT SHIFT CODE. SEE IF PRESENT
043196,000286: 6273 12017 TCF SHORTT # SCALAR OR VECTOR.
043197,000287: 6274 12017 TCF SHORTT
043198,000288: 6275 12121 TCF SHORTV # CALLS THE APPROPRIATE ROUTINE.
043199,000289:
043200,000290:
043201,000291: 6276 4350 FBANKMSK EQUALS BANKMASK
043202,000292: 6276 00122 LVBUF ADRES VBUF
043203,000293:
Page 1003 |
043205,000295: # THE FOLLOWING IS THE JUMP TABLE FOR OP CODES WHICH MAY HAVE INDEXABLE ADDRESSES OR MAY PUSH UP.
043206,000296:
043207,000297: 6277 16510 INDJUMP TCF VLOAD # 00 - LOAD MPAC WITH A VECTOR.
043208,000298: 6300 17074 TCF TAD # 01 - TRIPLE PRECISION ADD TO MPAC.
043209,000299: 6301 17660 TCF SIGN # 02 - COMPLEMENT MPAC (V OR SC) IF X NEG.
043210,000300: 6302 17404 TCF VXSC # 03 - VECTOR TIMES SCALAR.
043211,000301: 6303 16706 TCF CGOTO # 04 - COMPUTED GO TO.
043212,000302: 6304 16473 TCF TLOAD # 05 - LOAD MPAC WITH TRIPLE PRECISION.
043213,000303: 6305 16055 TCF DLOAD # 06 - LOAD MPAC WITH A DP SCALAR.
043214,000304: 6306 17627 TCF V/SC # 07 - VECTOR DIVIDED BY SCALAR.
043215,000305:
043216,000306: 6307 16504 TCF SLOAD # 10 - LOAD MPACIN SINGLE PRECISION.
043217,000307: 6310 16623 TCF SSP # 11 - SET SINGLE PRECISION INTO X.
043218,000308: 6311 16526 TCF PDDL # 12 - PUSH DOWN MPAC AND RE-LOAD IN DP.
043219,000309: 6312 17337 TCF MXV # 13 - MATRIX POST-MULTIPLIED BY VECTOR.
043220,000310: 6313 16562 TCF PDVL # 14 - PUSH DOWN AND VECTOR LOAD.
043221,000311: 6314 16631 TCF CCALL # 15 - COMPUTED CALL.
043222,000312: 6315 17342 TCF VXM # 16 - MATRIX PRE-MULTIPLIED BY VECTOR.
043223,000313: 6316 17621 TCF TSLC # 17 - NORMALIZE MPAC (SCALAR ONLY).
043224,000314:
043225,000315: 6317 17577 TCF DMPR # 20 - DP MULTIPLY AND ROUND.
043226,000316: 6320 17602 TCF DDV # 21 - DP DIVIDE BY.
043227,000317: 6321 17606 TCF BDDV # 22 - DP DIVIDE INTO.
043228,000318: 6322 17624 TCF GSHIFT # 23 - GENERAL SHIFT INSTRUCTION.
043229,000319: 6323 16754 TCF VAD # 24 - VECTOR ADD.
043230,000320: 6324 16752 TCF VSU # 25 - VECTOR SUBTRACT.
043231,000321: 6325 17041 TCF BVSU # 26 - VECTOR SUBTRACT FROM.
043232,000322: 6326 17334 TCF DOT # 27 - VECTOR DOT PRODUCT.
043233,000323:
043234,000324: 6327 17463 TCF VXV # 30 - VECTOR CROSS PRODUCT.
043235,000325: 6330 17430 TCF VPROJ # 31 - VECTOR PROJECTION.
043236,000326: 6331 17010 TCF DSU # 32 - DP SUBTRACT.
043237,000327: 6332 17065 TCF BDSU # 33 - DP SUBTRACT FROM.
043238,000328: 6333 17000 TCF DAD # 34 - DP ADD.
043239,000329: 6334 16334 TCF +0 # 35 - AVAILABLE
043240,000330: 6335 17575 TCF DMP1 # 36 - DP MULTIPLY.
043241,000331: 6336 17616 TCF SETPD # 37 - SET PUSH DOWN POINTER (DIRECT ONLY)
043242,000332:
043243,000333: # CODES 10 AND 14 MUST NOT PUSH UP. CODE 04 MAY BE USED FOR VECTOR DECLARE BEFORE PUSHUP IF DESIRED.
043244,000334:
Page 1004 |
043246,000336: # THE FOLLOWING JUMP TABLE APPLIES TO INDEX, BRANCH, AND MISCELLANEOUS INSTRUCTIONS.
043247,000337:
043248,000338: 6337 12345 MISCJUMP TCF AXT # 00 - ADDRESS TO INDEX TRUE.
043249,000339: 6340 12352 TCF AXC # 01 - ADDRESS TO INDEX COMPLEMENTED.
043250,000340: 6341 12355 TCF LXA # 02 - LOAD INDEX FROM ERASABLE.
043251,000341: 6342 12361 TCF LXC # 03 - LOAD INDEX FROM COMPLEMENT OF ERAS.
043252,000342: 6343 12365 TCF SXA # 04 - STORE INDEX IN ERASABLE.
043253,000343: 6344 12373 TCF XCHX # 05 - EXCHANGE INDEX WITH ERASABLE.
043254,000344: 6345 12407 TCF INCR # 06 - INCREMENT INDEX REGISTER.
043255,000345: 6346 12416 TCF TIX # 07 - TRANSFER ON INDEX.
043256,000346:
043257,000347: 6347 12401 TCF XAD # 10 - INDEX REGISTER ADD FROM ERASABLE.
043258,000348: 6350 12412 TCF XSU # 11 - INDEX SUBTRACT FROM ERASABLE.
043259,000349: 6351 12470 TCF BZE/GOTO # 12 - BRANCH ZERO AND GOTO.
043260,000350: 6352 12475 TCF BPL/BMN # 13 - BRANCH PLUS AND BRANCH MINUS.
043261,000351: 6353 12450 TCF RTB/BHIZ # 14 - RETURN TO BASIC AND BRANCH HI ZERO.
043262,000352: 6354 12510 TCF CALL/ITA # 15 - CALL AND STORE QPRET.
043263,000353: 6355 12517 TCF SW/ # 16 - SWITCH INSTRUCTIONS AND AVAILABLE.
043264,000354: 6356 12460 TCF BOV(B) # 17 - BRANCH ON OVERFLOW TO BASIC OR INT.
043265,000355:
Page 1005 |
043267,000357: # THE FOLLOWING JUMP TABLE APPIES TO UNARY INSTRUCTIONS.
043268,000358:
043269,000359: 6357 COUNT* $$/INTER
043270,000360: 00,2000 BANK 0 # 00 - EXIT - DETECTED EARLIER.
043271,000361: 00,2000 13207 UNAJUMP TCF SQRT # 01 - SQUARE ROOT.
043272,000362: 00,2001 13530 TCF SINE # 02 - SIN.
043273,000363: 00,2002 13517 TCF COSINE # 03 - COS.
043274,000364: 00,2003 13610 TCF ARCSIN # 04 - ARC SIN.
043275,000365: 00,2004 13612 TCF ARCCOS # 05 - ARC COS.
043276,000366: 00,2005 13174 TCF DSQ # 06 - DP SQUARE.
043277,000367: 00,2006 12116 TCF ROUND # 07 - ROUND TO DP.
043278,000368:
043279,000369: 00,2007 17673 TCF COMP # 10 - COMPLEMENT VECTOR OR SCALAR.
043280,000370: 00,2010 13232 TCF VDEF # 11 - VECTOR DEFINE.
043281,000371: 00,2011 13023 TCF UNIT # 12 - UNIT VECTOR.
043282,000372: 00,2012 13176 TCF ABVALABS # 13 - LENGTH OF VECTOR OR MAG OF SCALAR.
043283,000373: 00,2013 13245 TCF VSQ # 14 - SQUARE OF LENGTH OF VECTOR.
043284,000374: 00,2014 16357 TCF STADR # 15 - PUSH UP ON STORE CODE.
043285,000375: 00,2015 13274 TCF RVQ # 16 - RETURN VIA QPRET.
043286,000376: 00,2016 13247 TCF PUSH # 17 - PUSH MPAC DOWN.
043287,000377:
Page 1006 |
043289,000379: # SECTION 2 LOAD AND STORE PACKAGE.
043290,000380:
043291,000381: # A SET OF EIGHT STORE CODES IS PROVIDED AS THE PRIMARY METHOD OF STORING THE MULTI-PURPOSE
043292,000382: # ACCUMULATOR (MPAC). IF IN THE DANZIG SECTION LOC REFERS TO AN ALGEBRAICALLY POSITIVE WORD, IT IS TAKEN AS A
043293,000383: # STORE CODE WITH A CORRESPONDING ERASABLE ADDRESS. MOST OF THESE CODES ARE TWO ADDRESS, SPECIFYING THAT THE WORD
043294,000384: # FOLLOWING THE STORE CODE IS TO BE USED AS AN ADDRESS FROM WHICH TO RE-LOAD MPAC. FOUR OPTIONS ARE AVAILABLE:
043295,000385:
043296,000386: # 1. STORE STORE MPAC. THE E ADDRESS MAY BE INDEXED.
043297,000387: # 2. STODL STORE MPAC AND RE-LOAD IT IN DP WITH THE NEXT ADDRESS (THE LOAD MAY BE INDEXED).
043298,000388: # 3. STOVL STORE MPAC AND RE-LOAD A VECTOR (AS ABOVE).
043299,000389: # 4. STCALL STORE AND DO A CALL (BOTH ADDRESSES MUST BE DIRECT HERE).
043300,000390:
043301,000391: # STODL AND STOVL WILL TAKE FROM THE PUSH-DOWN LIST IF NO LOAD ADDRESS IS GIVEN.
043302,000392:
043303,000393:
043304,000394: 6357 BLOCK 3
043305,000395:
043306,000396: 6357 COUNT* $$/INTER
043307,000397: 6357 30165 STADR CA BANKSET # THE STADR CODE (PUSHUP UP ON STORE
043308,000398: 6360 54004 TS FBANK # ADDRESS) ENTERS HERE.
043309,000399: 6361 24164 INCR LOC
043310,000400: 6362 50164 ITR1 INDEX LOC # THE STORECODE WAS STORED COMPLEMENTED TO
043311,000401: 6363 40000 CS 0 # MAKE IT LOOK LIKE AN OPCODE PAIR.
043312,000402: 6364 67752 AD NEGONE # (YUL CANT REMOVE 1 BECAUSE OF EARLY CCS)
043313,000403:
043314,000404: 6365 54116 DOSTORE TS ADDRWD
043315,000405: 6366 74356 MASK LOW11 # ENTRY FROM DISPATCHER. SAVE THE ERASABLE
043316,000406: 6367 56116 XCH ADDRWD # ADDRESS AND JUMP ON THE STORE CODE NO.
043317,000407: 6370 77725 MASK B12T14
043318,000408: 6371 00006 EXTEND
043319,000409: 6372 74747 MP BIT5 # EACH TRANSFER VECTOR ENTRY IS TWO WORDS.
043320,000410: 6373 50000 ITR0 INDEX A
043321,000411: 6374 16375 TCF STORJUMP
043322,000412:
Page 1007 |
043324,000414: # STORE CODE JUMP TABLE. CALLS THE APPROPRIATE STORING ROUTINE AND EXITS TO DANZIG OR TO ADDRESS WITH
043325,000415: # A SUPPLIED OPERATION CODE.
043326,000416:
043327,000417: # STORE STORE,1 AND STORE,2 RETURN TO DANZIG, THUS RESETTING THE EBANK TO ITS STATE AT INTPRET.
043328,000418:
043329,000419: 6375 06425 STORJUMP TC STORE # STORE.
043330,000420: 6376 16064 TCF DANZIG # PICK UP NEW OP CODE(S).
043331,000421: 6377 06417 TC STORE,1
043332,000422: 6400 16064 TCF DANZIG
043333,000423: 6401 06422 TC STORE,2
043334,000424: 6402 16064 TCF DANZIG
043335,000425:
043336,000426: 6403 06425 TC STORE # STODL.
043337,000427: 6404 16463 TCF DODLOAD
043338,000428:
043339,000429: 6405 06425 TC STORE # STODL WITH INDEXED LOAD ADDRESS.
043340,000430: 6406 16147 TCF DODLOAD*
043341,000431:
043342,000432: 6407 06425 TC STORE # STOVL.
043343,000433: 6410 16466 TCF DOVLOAD
043344,000434:
043345,000435: 6411 06425 TC STORE # STOVL WITH INDEXED LOAD ADDRESS.
043346,000436: 6412 16471 TCF DOVLOAD*
043347,000437: 6413 06425 TC STORE # STOTC.
043348,000438: 6414 34766 CAF CALLCODE
043349,000439: 6415 54020 TS CYR
043350,000440: 6416 16255 TCF 15BITADR # GET A 15 BIT ADDRESS.
043351,000441:
Page 1008 |
043353,000443: # STORE CODE ADDRESS PROCESSOR.
043354,000444:
043355,000445: 6417 50120 STORE,1 INDEX FIXLOC
043356,000446: 6420 40046 CS X1
043357,000447: 6421 16424 TCF PRESTORE
043358,000448:
043359,000449: 6422 50120 STORE,2 INDEX FIXLOC
043360,000450: 6423 40047 CS X2
043361,000451: 6424 26116 PRESTORE ADS ADDRWD # RESULTANT ADDRESS IS IN ERASABLE.
043362,000452:
043363,000453: 6425 40116 STORE CS ADDRWD
043364,000454: 6426 64772 AD DEC45
043365,000455: 6427 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
043366,000456: 6430 30120 CA FIXLOC # YES.
043367,000457: 6431 16436 TCF AHEAD5
043368,000458: 6432 35007 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
043369,000459: 6433 56116 XCH ADDRWD
043370,000460: 6434 54003 TS EBANK
043371,000461: 6435 74357 MASK LOW8
043372,000462: 6436 26116 AHEAD5 ADS ADDRWD
043373,000463:
Page 1009 |
043375,000465: # STORING ROUTINES. STORE DP, TP, OR VECTOR AS INDICATED BY MODE.
043376,000466:
043377,000467: 6437 00006 STARTSTO EXTEND # MPAC,+1 MUST BE STORED IN ANY EVENT.
043378,000468: # ITRACE (5) REFERS TO "STARTSTO".
043379,000469: 6440 30155 DCA MPAC
043380,000470: 6441 50116 INDEX ADDRWD
043381,000471: 6442 52001 DXCH 0
043382,000472:
043383,000473: 6443 10163 CCS MODE
043384,000474: 6444 16457 TCF TSTORE
043385,000475: 6445 00002 TC Q
043386,000476:
043387,000477: 6446 00006 VSTORE EXTEND
043388,000478: 6447 30160 DCA MPAC +3
043389,000479: 6450 50116 INDEX ADDRWD
043390,000480: 6451 52003 DXCH 2
043391,000481:
043392,000482: 6452 00006 EXTEND
043393,000483: 6453 30162 DCA MPAC +5
043394,000484: 6454 50116 INDEX ADDRWD
043395,000485: 6455 52005 DXCH 4
043396,000486: 6456 00002 TC Q
043397,000487:
043398,000488: 6457 30156 TSTORE CA MPAC +2
043399,000489: 6460 50116 INDEX ADDRWD
043400,000490: 6461 54002 TS 2
043401,000491: 6462 00002 TC Q
043402,000492:
Page 1010 |
043404,000494: # ROUTINES TO BEGIN PROCESSING OF THE SECOND ADDRESS ASSOCIATED WITH ALL STORE-TYPE CODES EXCEPT STORE
043405,000495: # ITSELF.
043406,000496:
043407,000497: 6463 37735 DODLOAD CAF DLOADCOD
043408,000498: 6464 54020 TS CYR
043409,000499: 6465 16111 TCF DIRADRES # GO GET A DIRECT ADDRESS.
043410,000500:
043411,000501: 6466 34735 DOVLOAD CAF VLOADCOD
043412,000502: 6467 54020 TS CYR
043413,000503: 6470 16111 TCF DIRADRES
043414,000504:
043415,000505: 6471 36112 DOVLOAD* CAF VLOAD*
043416,000506: 6472 16150 TCF DODLOAD* +1 # PROLOGUE TO INDEX ROUTINE.
043417,000507:
Page 1011 |
043419,000509: # THE FOLLOWING LOAD INSTRUCTIONS ARE PROVIDED FOR LOADING THE MULTI-PURPOSE ACCUMULATOR MPAC.
043420,000510:
043421,000511: 6473 50116 TLOAD INDEX ADDRWD
043422,000512: 6474 30002 CA 2 # LOAD A TRIPLE PRECISION ARGUMENT INTO
043423,000513: 6475 54156 TS MPAC +2 # THE FIRST THREE MPAC REGISTERS, WITH THE
043424,000514: 6476 00006 EXTEND # CONTENTS OF THE OTHER FOUR IRRELEVANT.
043425,000515: 6477 50116 INDEX ADDRWD
043426,000516: 6500 30001 DCA 0
043427,000517: 6501 52155 DXCH MPAC
043428,000518: 6502 34753 TMODE CAF ONE
043429,000519: 6503 16063 TCF NEWMODE # DECLARE TRIPLE PRECISION MODE.
043430,000520:
043431,000521: 6504 22007 SLOAD ZL # LOAD A SINGLE PRECISION NUMBER INTO
043432,000522: 6505 50116 INDEX ADDRWD # MPAC, SETTING MPAC+1,2 TO ZERO. THE
043433,000523: 6506 30000 CA 0 # CONTENTS OF THE REMAINING MPAC REGISTERS
043434,000524: 6507 16060 TCF SLOAD2 # ARE IRRELEVANT.
043435,000525:
043436,000526: 6510 00006 VLOAD EXTEND # LOAD A DOUBLE PRECISION VECTOR INTO
043437,000527: 6511 50116 INDEX ADDRWD # MPAC,+1, MPAC+3,4, AND MPAC+5,6. THE
043438,000528: 6512 30001 DCA 0 # CONTENTS OF MPAC +2 ARE IRRELEVANT.
043439,000529: 6513 52155 DXCH MPAC
043440,000530:
043441,000531: 6514 00006 ENDVLOAD EXTEND # PDVL COMES HERE TO FINISH UP FOR DP, TP.
043442,000532: 6515 50116 INDEX ADDRWD
043443,000533: 6516 30003 DCA 2
043444,000534: 6517 52160 DXCH MPAC +3
043445,000535:
043446,000536: 6520 00006 +4 EXTEND # TPDVL FINISHES HERE.
043447,000537: 6521 50116 INDEX ADDRWD
043448,000538: 6522 30005 DCA 4
043449,000539: 6523 52162 DXCH MPAC +5
043450,000540:
043451,000541: 6524 44753 VMODE CS ONE # DECLARE VECTOR MODE.
043452,000542: 6525 16063 TCF NEWMODE
043453,000543:
Page 1012 |
043455,000545: # THE FOLLOWING INSTRUCTIONS ARE PROVIDED FOR STORING OPERANDS IN THE PUSHDOWN LIST:
043456,000546:
043457,000547: # 1. PUSH PUSHDOWN AND NO LOAD.
043458,000548: # 2. PDDL PUSHDOWN AND DOUBLE PRECISION LOAD.
043459,000549: # 3. PDVL PUSHDOWN AND VECTOR LOAD.
043460,000550:
043461,000551: 6526 00006 PDDL EXTEND
043462,000552: 6527 50116 INDEX ADDRWD # LOAD MPAC,+1, PUSHING THE FORMER
043463,000553: 6530 30001 DCA 0 # CONTENTS DOWN.
043464,000554: 6531 52155 DXCH MPAC
043465,000555: 6532 50166 INDEX PUSHLOC
043466,000556: 6533 52001 DXCH 0
043467,000557:
043468,000558: 6534 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER APPRO-
043469,000559: 6535 36247 CAF NO.WDS # PRIATELY.
043470,000560: 6536 26166 ADS PUSHLOC
043471,000561:
043472,000562: 6537 10163 CCS MODE
043473,000563: 6540 16555 TCF ENDTPUSH
043474,000564: 6541 16553 TCF ENDDPUSH
043475,000565:
043476,000566: 6542 54163 TS MODE # NOW DP.
043477,000567: 6543 54156 ENDVPUSH TS MPAC +2
043478,000568: 6544 52160 DXCH MPAC +3 # PUSH DOWN THE REST OF THE VECTOR HERE.
043479,000569: 6545 50166 INDEX PUSHLOC
043480,000570: 6546 51775 DXCH 0 -4
043481,000571:
043482,000572: 6547 52162 DXCH MPAC +5
043483,000573: 6550 50166 INDEX PUSHLOC
043484,000574: 6551 51777 DXCH 0 -2
043485,000575:
043486,000576: 6552 16064 TCF DANZIG
043487,000577:
043488,000578: 6553 54156 ENDDPUSH TS MPAC +2 # SET MPAC +2 TO ZERO AND EXIT ON DP.
043489,000579: 6554 16064 TCF DANZIG
043490,000580:
043491,000581: 6555 54163 ENDTPUSH TS MODE
043492,000582: 6556 56156 XCH MPAC +2 # ON TRIPLE, SET MPAC +2 TO ZERO, PUSHING
043493,000583: 6557 50166 +2 INDEX PUSHLOC # DOWN THE OLD CONTENTS
043494,000584: 6560 53777 TS 0 -1
043495,000585: 6561 16064 TCF DANZIG
043496,000586:
Page 1013 |
043498,000588: # PDVL - PUSHDOWN AND VECTOR LOAD.
043499,000589:
043500,000590: 6562 00006 PDVL EXTEND # RELOAD MPAC AND PUSH DOWN ITS CONTENTS.
043501,000591: 6563 50116 INDEX ADDRWD
043502,000592: 6564 30001 DCA 0
043503,000593: 6565 52155 DXCH MPAC
043504,000594: 6566 50166 INDEX PUSHLOC
043505,000595: 6567 52001 DXCH 0
043506,000596:
043507,000597: 6570 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER.
043508,000598: 6571 36247 CAF NO.WDS
043509,000599: 6572 26166 ADS PUSHLOC
043510,000600:
043511,000601: 6573 10163 CCS MODE # TEST PAST MODE.
043512,000602: 6574 16613 TCF TPDVL
043513,000603: 6575 16514 TCF ENDVLOAD # JUST LOAD LAST FOUR REGISTERS ON DP.
043514,000604:
043515,000605: 6576 00006 VPDVL EXTEND # PUSHDOWN AND RE-LOAD LAST TWO COMPONENTS
043516,000606: 6577 50116 INDEX ADDRWD
043517,000607: 6600 30003 DCA 2
043518,000608: 6601 52160 DXCH MPAC +3
043519,000609: 6602 50166 INDEX PUSHLOC
043520,000610: 6603 51775 DXCH 0 -4
043521,000611:
043522,000612: 6604 00006 EXTEND
043523,000613: 6605 50116 INDEX ADDRWD
043524,000614: 6606 30005 DCA 4
043525,000615: 6607 52162 DXCH MPAC +5
043526,000616: 6610 50166 INDEX PUSHLOC
043527,000617: 6611 51777 DXCH 0 -2
043528,000618:
043529,000619: 6612 16064 TCF DANZIG
043530,000620:
043531,000621: 6613 00006 TPDVL EXTEND # ON TP, WE MUST LOAD THE Y COMPONENT
043532,000622: 6614 50116 INDEX ADDRWD # BEFORE STORING MPAC +2 IN CASE THIS IS A
043533,000623: 6615 30003 DCA 2 # PUSHUP.
043534,000624: 6616 52160 DXCH MPAC +3
043535,000625:
043536,000626: 6617 30156 CA MPAC +2
043537,000627: 6620 50166 INDEX PUSHLOC # IN DP.
043538,000628: 6621 53777 TS 0 -1
043539,000629: 6622 16520 TCF ENDVLOAD +4
043540,000630:
043541,000631: # SSP (STORE SINGLE PRECISION) IS EXECUTED HERE.
043542,000632:
043543,000633: 6623 24164 SSP INCR LOC # PICK UP THE WORD FOLLOWING THE GIVEN
043544,000634: 6624 50164 INDEX LOC # ADDRESS AND STORE IT AT X.
043545,000635: 6625 30000 CA 0
043546,000636: 6626 50116 STORE1 INDEX ADDRWD # SOME INDEX AND MISCELLANEOUS OPS END
043547,000637: 6627 54000 TS 0 # HERE.
043548,000638:
Page 1014 |
043550,000640: 6630 16064 TCF DANZIG
043551,000641:
Page 1015 |
043553,000643: # SEQUENCE CHANGING AND SUBROUTINE CALLING OPTIONS.
043554,000644:
043555,000645: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR SEQUENCING CHANGING, BRANCHING, AND CALLING SUBROUTINES:
043556,000646:
043557,000647: # 1. GOTO GO TO.
043558,000648: # 2. CALL CALL SUBROUTINE SETTING QPRET.
043559,000649: # 3. CGOTO COMPUTED GO TO.
043560,000650: # 4. CCALL COMPUTED CALL.
043561,000651: # 7. BPL BRANCH IF MPAC POSITIVE OR ZERO.
043562,000652: # 8. BZE BRANCH IF MPAC ZERO.
043563,000653: # 9. BMN BRANCH IF MPAC NEGATIVE NON-ZERO.
043564,000654:
043565,000655: 6631 24164 CCALL INCR LOC # MAINTAIN LOC FOR QPRET COMPUTATION.
043566,000656: 6632 50164 INDEX LOC
043567,000657: 6633 30000 CAF 0 # GET BASE ADDRESS OF CADR LIST.
043568,000658: 6634 50116 INDEX ADDRWD
043569,000659: 6635 60000 AD 0 # ADD INCREMENT.
043570,000660: 6636 54004 TS FBANK # SELECT DESIRED CADR.
043571,000661: 6637 75012 MASK LOW10
043572,000662: 6640 50000 INDEX A
043573,000663: 6641 32000 CAF 10000
043574,000664: 6642 54117 TS POLISH
043575,000665:
043576,000666: 6643 30165 CALL CA BANKSET # FOR ANY OF THE CALL OPTIONS, MAKE UP THE
043577,000667: 6644 74350 MASK BANKMASK # ADDRESS OF THE NEXT OP-CODE PAIR/STORE
043578,000668: 6645 64350 AD BANKMASK # CODE AND LEAVE IT IN QPRET. NOTE THAT
043579,000669: 6646 60164 AD LOC # BANKMASK = -(2000 - 1).
043580,000670: 6647 50120 INDEX FIXLOC
043581,000671: 6650 54052 TS QPRET
043582,000672:
043583,000673: 6651 30117 GOTO CA POLISH # BASIC BRANCHING SEQUENCE.
043584,000674: 6652 77745 +1 MASK HIGH4
043585,000675: 6653 00006 EXTEND
043586,000676: 6654 16665 BZF GOTOERS # SEE IF ADDRESS POINTS TO FIXED OR ERAS.
043587,000677: 6655 30165 +4 CA BANKSET # SET EBANK PART OF BBANK. NEXT, SET UP
043588,000678: 6656 54006 TS BBANK # FBANK. THE COMBINATION IS PICKED UP &
043589,000679: 6657 30117 CA POLISH # PUT INTO BANKSET AT INTPRET +2.
043590,000680: 6660 54004 TS FBANK
043591,000681: 6661 75012 MASK LOW10
043592,000682: 6662 64741 AD 2K
043593,000683: 6663 54164 TS LOC
043594,000684: 6664 16045 TCF INTPRET +3
043595,000685:
043596,000686: 6665 E3,1400 EBANK= 1400 # SO YUL DOESN'T CUSS THE "CA 1400" BELOW.
043597,000687:
043598,000688: 6665 30117 GOTOERS CA POLISH # THE GIVEN ADDRESS IS IN ERASABLE - SEE
043599,000689: 6666 66254 AD -ENDVAC # IF RELATIVE TO THE WORK AREA.
043600,000690: 6667 10000 CCS A
043601,000691: 6670 30117 CA POLISH # GENERAL ERASABLE.
043602,000692: 6671 16700 TCF GOTOGE
043603,000693:
Page 1016 |
043605,000695: 6672 30120 CA FIXLOC # WORK AREA.
043606,000696: 6673 60117 AD POLISH
043607,000697: 6674 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
043608,000698: 6675 30000 CA 0 # THE BRANCH ADDRESS.
043609,000699: 6676 54117 TS POLISH
043610,000700: 6677 16652 TCF GOTO +1 # ALLOWS ARBITRARY INDIRECTNESS LEVELS.
043611,000701:
043612,000702: 6700 54003 GOTOGE TS EBANK
043613,000703: 6701 74357 MASK LOW8
043614,000704: 6702 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
043615,000705: 6703 31400 CA 1400 # THE BRANCH ADDRESS.
043616,000706: 6704 54117 TS POLISH
043617,000707: 6705 16652 TCF GOTO +1
043618,000708:
043619,000709: 6706 50164 CGOTO INDEX LOC # COMPUTED GO TO. PICK UP ADDRESS OF CADR
043620,000710: 6707 30001 CA 1 # LIST.
043621,000711: 6710 50116 INDEX ADDRWD # ADD MODIFIER.
043622,000712: 6711 60000 AD 0
043623,000713: 6712 54004 TS FBANK # SELECT GOTO ADDRESS.
043624,000714: 6713 75012 MASK LOW10
043625,000715: 6714 50000 INDEX A
043626,000716: 6715 32000 CA 10000
043627,000717: 6716 54117 TS POLISH
043628,000718: 6717 16652 TCF GOTO +1 # WITH ADDRESS IN A.
043629,000719:
043630,000720: 6720 30165 SWBRANCH CA BANKSET # SWITCH INSTRUCTIONS WHICH ELECT TO
043631,000721: 6721 54004 TS FBANK # BRANCH COME HERE TO DO SO.
043632,000722: 6722 50164 INDEX LOC
043633,000723: 6723 30001 CA 1
043634,000724: 6724 54117 TS POLISH
043635,000725: 6725 16652 TCF GOTO +1
043636,000726:
Page 1017 |
043638,000728: # TRIPLE PRECISION BRANCHING ROUTINE. IF CALLING TC IS AT L, RETURN IS AS FOLLOWS:
043639,000729:
043640,000730: # L+1 IF MPAC IS GREATER THAN ZERO.
043641,000731: # L+2 IF MPAC IS EQUAL TO +0 OR -0.
043642,000732: # L+3 IF MPAC IS LESS THAN ZERO.
043643,000733:
043644,000734: 6726 10154 BRANCH CCS MPAC
043645,000735: 6727 00002 TC Q
043646,000736: 6730 16732 TCF +2 # ON ZERO.
043647,000737: 6731 16744 TCF NEG
043648,000738:
043649,000739: 6732 10155 CCS MPAC +1
043650,000740: 6733 00002 TC Q
043651,000741: 6734 16736 TCF +2
043652,000742: 6735 16744 TCF NEG
043653,000743:
043654,000744: 6736 10156 CCS MPAC +2
043655,000745: 6737 00002 TC Q
043656,000746: 6740 16742 TCF +2
043657,000747: 6741 16744 TCF NEG
043658,000748:
043659,000749: 6742 50002 Q+1 INDEX Q
043660,000750: 6743 00001 TC 1
043661,000751:
043662,000752: 6744 50002 NEG INDEX Q # IF FIRST NON-ZERO REGISTER WAS NEGATIVE.
043663,000753: 6745 00002 TC 2
043664,000754:
043665,000755: 6746 6744 Q+2 = NEG
043666,000756:
043667,000757: # ITRACE (3) REFERS TO "EXIT".
043668,000758:
043669,000759: 6746 30165 EXIT CA BANKSET # RESTORE USER'S BANK SETTING, AND LEAVE
043670,000760: 6747 54006 TS BBANK # INTERPRETIVE MODE.
043671,000761: 6750 50164 INDEX LOC
043672,000762: 6751 00001 TC 1
043673,000763:
Page 1018 |
043675,000765: # SECTION 3 - ADD/SUBTRACT PACKAGE.
043676,000766:
043677,000767: # THE FOLLOWING OPERATIONS ARE PROVIDED FOR ADDING TO AND SUBTRACTING FROM THE MULTI-PURPOSE ACCUMULATOR
043678,000768: # MPAC:
043679,000769:
043680,000770: # 1. DAD DOUBLE PRECISION ADD.
043681,000771: # 2. DSU DOUBLE PRECISION SUBTRACT.
043682,000772: # 3. BDSU DOUBLE PRECISION SUBTRACT FROM.
043683,000773:
043684,000774: # 4. TAD TRIPLE PRECISION ADD.
043685,000775:
043686,000776: # 5. VAD VECTOR ADD.
043687,000777: # 6. VSU VECTOR SUBTRACT.
043688,000778: # 7. BVSU VECTOR SUBTRACT FROM.
043689,000779:
043690,000780: # THE INTERPRETIVE OVERFLOW INDICATOR OVFIND IS SET NON-ZERO IF OVERFLOW OCCURS IN ANY OF THE ABOVE.
043691,000781:
043692,000782:
043693,000783: 6752 34735 VSU CAF BIT15 # CHANGES 0 TO DCS.
043694,000784: 6753 16755 TCF +2
043695,000785:
043696,000786: 6754 34355 VAD CAF PRIO30 # CHANGES 0 TO DCA.
043697,000787: 6755 26116 ADS ADDRWD
043698,000788: 6756 00006 EXTEND
043699,000789: 6757 50116 INDEX ADDRWD
043700,000790: 6760 00003 READ HISCALAR # DCA 2 OR DCS 2
043701,000791: 6761 20160 DAS MPAC +3
043702,000792: 6762 00006 EXTEND # CHECK OVERFLOW.
043703,000793: 6763 16765 BZF +2
043704,000794: 6764 07017 TC OVERFLWY
043705,000795:
043706,000796: 6765 00006 EXTEND
043707,000797: 6766 50116 INDEX ADDRWD
043708,000798: 6767 00005 READ CHAN5 # DCA 4 OR DCS 4
043709,000799: 6770 20162 DAS MPAC +5
043710,000800: 6771 00006 EXTEND
043711,000801: 6772 16774 BZF +2
043712,000802: 6773 07014 TC OVERFLWZ
043713,000803:
043714,000804: 6774 00006 EXTEND
043715,000805: 6775 50116 INDEX ADDRWD
043716,000806: 6776 00001 READ LCHAN # DCA 0 OR DCS 0
043717,000807: 6777 17003 TCF ENDVXV
043718,000808:
043719,000809: 7000 00006 DAD EXTEND
043720,000810: 7001 50116 INDEX ADDRWD
043721,000811: 7002 30001 DCA 0
043722,000812: 7003 20155 ENDVXV DAS MPAC # VXV FINISHES HERE.
043723,000813: 7004 00006 EXTEND
043724,000814: 7005 16064 BZF DANZIG
043725,000815:
Page 1019 |
043727,000817: 7006 07022 SETOVF TC OVERFLOW
043728,000818: 7007 16064 TCF DANZIG
043729,000819:
Page 1020 |
043731,000821: 7010 00006 DSU EXTEND
043732,000822: 7011 50116 INDEX ADDRWD
043733,000823: 7012 40001 DCS 0
043734,000824: 7013 17003 TCF ENDVXV
043735,000825:
043736,000826: 7014 54001 OVERFLWZ TS L # ENTRY FOR THIRD COMPONENT.
043737,000827: 7015 34756 CAF FIVE
043738,000828: 7016 17021 TCF +3
043739,000829:
043740,000830: 7017 54001 OVERFLWY TS L # ENTRY FOR SECOND COMPONENT.
043741,000831: 7020 36250 CAF THREE
043742,000832: 7021 56001 XCH L
043743,000833:
043744,000834: 7022 50000 OVERFLOW INDEX A # ENTRY FOR 1ST COMP OR DP (L=0).
043745,000835: 7023 44734 CS LIMITS # PICK UP POSMAX OR NEGMAX.
043746,000836: 7024 54130 TS BUF
043747,000837: 7025 00006 EXTEND
043748,000838: 7026 24000 AUG A # FORCE OVERFLOW.
043749,000839: 7027 50001 INDEX L
043750,000840: 7030 26155 ADS MPAC +1
043751,000841: 7031 54007 TS 7
043752,000842: 7032 34755 CAF ZERO
043753,000843: 7033 60130 AD BUF
043754,000844: 7034 50001 INDEX L
043755,000845: 7035 26154 ADS MPAC
043756,000846: 7036 54007 TS 7
043757,000847: 7037 00002 TC Q # NO OVERFLOW EXIT.
043758,000848: 7040 17155 TCF SETOVF2 # SET OVFIND AND EXIT.
043759,000849:
043760,000850: 7041 00006 BVSU EXTEND
043761,000851: 7042 50116 INDEX ADDRWD
043762,000852: 7043 30003 DCA 2
043763,000853: 7044 52160 DXCH MPAC +3
043764,000854: 7045 00006 EXTEND
043765,000855: 7046 40001 DCOM
043766,000856: 7047 20160 DAS MPAC +3
043767,000857: 7050 00006 EXTEND
043768,000858: 7051 17053 BZF +2
043769,000859: 7052 07017 TC OVERFLWY
043770,000860:
043771,000861: 7053 00006 EXTEND
043772,000862: 7054 50116 INDEX ADDRWD
043773,000863: 7055 30005 DCA 4
043774,000864: 7056 52162 DXCH MPAC +5
043775,000865: 7057 00006 EXTEND
043776,000866: 7060 40001 DCOM
043777,000867: 7061 20162 DAS MPAC +5
043778,000868: 7062 00006 EXTEND
043779,000869: 7063 17065 BZF +2
043780,000870: 7064 07014 TC OVERFLWZ
043781,000871:
Page 1021 |
043783,000873: 7065 00006 BDSU EXTEND
043784,000874: 7066 50116 INDEX ADDRWD
043785,000875: 7067 30001 DCA 0
043786,000876: 7070 52155 DXCH MPAC
043787,000877: 7071 00006 EXTEND
043788,000878: 7072 40001 DCOM
043789,000879: 7073 17003 TCF ENDVXV
043790,000880:
Page 1022 |
043792,000882: # TRIPLE PRECISION ADD ROUTINE.
043793,000883:
043794,000884: 7074 00006 TAD EXTEND
043795,000885: 7075 50116 INDEX ADDRWD
043796,000886: 7076 30002 DCA 1 # ADD MINOR PARTS FIRST.
043797,000887: 7077 20156 DAS MPAC +1
043798,000888: 7100 50116 INDEX ADDRWD
043799,000889: 7101 60000 AD 0
043800,000890: 7102 60154 AD MPAC
043801,000891: 7103 54154 TS MPAC
043802,000892: 7104 16064 TCF DANZIG
043803,000893:
043804,000894: 7105 17006 TCF SETOVF # SET OVFIND IF SUCH OCCURS.
043805,000895:
Page 1023 |
043807,000897: # ARITHMETIC SUBROUTINES REQUIRED IN FIXED-FIXED.
043808,000898:
043809,000899: # 1. DMPSUB DOUBLE PRECISION MULTIPLY. MULTIPLY THE CONTENTS OF MPAC,+1 BY THE DP WORD WHOSE ADDRESS
043810,000900: # IS IN ADDRWD AND LEAVE A TRIPLE PRECISION RESULT IN MPAC.
043811,000901: # 2. ROUNDSUB ROUND THE TRIPLE PRECISON CONTENTS OF MPAC TO DOUBLE PRECISION.
043812,000902: # 3. DOTSUB TAKE THE DOT PRODUCT OF THE VECTOR IN MPAC AND THE VECTOR WHOSE ADDRESS IS IN ADDRWD
043813,000903: # AND LEAVE THE TRIPLE PRECISION RESULT IN MPAC.
043814,000904: # 4. POLY USING THE CONTENTS OF MPAC AS A DP ARGUMENT, EVALUATE THE POLYNOMIAL WHOSE DEGREE AND
043815,000905: # COEFFICIENTS IMMEDIATELY FOLLOW THE TC POLY INSTRUCTION (SEE ROUTINE FOR DETAILS.)
043816,000906:
043817,000907: 7106 50002 DMP INDEX Q # BASIC SUBROUTINE FOR USE BY PINBALL, ETC
043818,000908: 7107 30000 CAF 0 # ADRES OF ARGUMENT FOLLOWS TC DMP .
043819,000909: 7110 24002 INCR Q
043820,000910: 7111 54116 -1 TS ADDRWD # (PROLOGUE FOR SETTING ADDRWD.)
043821,000911:
043822,000912: 7112 50116 DMPSUB INDEX ADDRWD # GET MINOR PART OF OPERAND AT C(ADDRWD).
043823,000913: 7113 30001 CA 1
043824,000914: 7114 54156 TS MPAC +2 # THIS WORKS FOR SQUARING MPAC AS WELL.
043825,000915: 7115 34755 CAF ZERO # SET MPAC +1 TO ZERO SO WE CAN ACCUMULATE
043826,000916: 7116 56155 XCH MPAC +1 # THE PARTIAL PRODUCTS WITH DAS
043827,000917: 7117 54135 TS MPTEMP # INSTRUCTIONS.
043828,000918: 7120 00006 EXTEND
043829,000919: 7121 70156 MP MPAC +2 # MINOR OF MPAC X MINOR OF C(ADDRWD).
043830,000920:
043831,000921: 7122 56156 XCH MPAC +2 # DISCARD MINOR PART OF ABOVE RESULT AND
043832,000922: 7123 00006 EXTEND # FORM MAJOR OF MPAC X MINOR OF C(ADDRWD).
043833,000923: 7124 70154 MP MPAC
043834,000924: 7125 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
043835,000925:
043836,000926: 7126 50116 INDEX ADDRWD # GET MAJOR PART OF ARGUMENT AT C(ADDRWD).
043837,000927: 7127 30000 CA 0
043838,000928: 7130 56135 XCH MPTEMP # SAVE AND BRING OUT MINOR OF MPAC.
043839,000929: 7131 00006 DMPSUB2 EXTEND
043840,000930: 7132 70135 MP MPTEMP # MAJOR OF C(ADDRWD) X MINOR OF MPAC.
043841,000931: 7133 20156 DAS MPAC +1 # ACCUMULATE, SETTING A TO NET OVERFLOW.
043842,000932:
043843,000933: 7134 56154 XCH MPAC # SETTING MPAC TO 0 OR +-1.
043844,000934: 7135 00006 EXTEND
043845,000935: 7136 70135 MP MPTEMP # MAJOR OF MPAC X MAJOR OF C(ADDRWD).
043846,000936: 7137 20155 DAS MPAC # GUARANTEED NO OVERFLOW.
043847,000937: 7140 00002 TC Q # 49 MCT = .573 MS. INCLUDING RETURN.
043848,000938:
Page 1024 |
043850,000940: # ROUND MPAC TO DOUBLE PRECISION, SETTING OVFIND ON THE RARE EVENT OF OVERFLOW.
043851,000941:
043852,000942: 7141 34755 ROUNDSUB CAF ZERO # SET MPAC +2 = 0 FOR SCALARS AND CHANGE
043853,000943: 7142 54163 +1 TS MODE # MODE TO DP.
043854,000944:
043855,000945: 7143 56156 VROUND XCH MPAC +2 # BUT WE NEEDNT TAKE THE TIME FOR VECTORS.
043856,000946: 7144 60000 DOUBLE
043857,000947: 7145 54001 TS L
043858,000948: 7146 00002 TC Q
043859,000949:
043860,000950: 7147 60155 AD MPAC +1 # ADD ROUNDING BIT IF MPAC +2 WAS GREATER
043861,000951: 7150 54155 TS MPAC +1 # THAN .5 IN MAGNITUDE.
043862,000952: 7151 00002 TC Q
043863,000953:
043864,000954: 7152 60154 AD MPAC # PROPAGATE INTERFLOW.
043865,000955: 7153 54154 TS MPAC
043866,000956: 7154 00002 TC Q
043867,000957:
043868,000958: 7155 54121 SETOVF2 TS OVFIND # (RARE).
043869,000959: 7156 00002 TC Q
043870,000960:
Page 1025 |
043872,000962: # THE DOT PRODUCT SUBROUTINE USUALLY FORMS THE DOT PRODUCT OF THE VECTOR IN MPAC WITH A STANDARD SIX
043873,000963: # REGISTER VECTOR WHOSE ADDRESS IS IN ADDRWD. IN THIS CASE C(DOTINC) ARE SET TO 2. VXM, HOWEVER, SETS C(DOTINC) TO
043874,000964: # 6 SO THAT DOTSUB DOTS MPAC WITH A COLUMN VECTOR OF THE MATRIX IN QUESTION IN THIS CASE.
043875,000965:
043876,000966:
043877,000967: 7157 34752 PREDOT CAF TWO # PROLOGUE TO SET DOTINC TO 2.
043878,000968: 7160 54136 TS DOTINC
043879,000969:
043880,000970: 7161 00006 DOTSUB EXTEND
043881,000971: 7162 22137 QXCH DOTRET # SAVE RETURN.
043882,000972: 7163 07112 TC DMPSUB # DOT X COMPONENTS.
043883,000973: 7164 52160 DXCH MPAC +3 # POSITION Y COMPONENT OF MPAC FOR
043884,000974: 7165 52155 DXCH MPAC # MULTIPLICATION WHILE SAVING RESULT IN
043885,000975: 7166 52131 DXCH BUF # THREE WORD BUFFER, BUF.
043886,000976: 7167 30156 CA MPAC +2
043887,000977: 7170 54132 TS BUF +2
043888,000978:
043889,000979: 7171 30136 CA DOTINC # ADVANCE ADDRWD TO Y COMPONENT OF
043890,000980: 7172 26116 ADS ADDRWD # OTHER ARGUMENT.
043891,000981: 7173 07112 TC DMPSUB
043892,000982: 7174 52156 DXCH MPAC +1 # ACCUMULATE PARTIAL PRODUCTS.
043893,000983: 7175 20132 DAS BUF +1
043894,000984: 7176 60154 AD MPAC
043895,000985: 7177 60130 AD BUF
043896,000986: 7200 54130 TS BUF
043897,000987: 7201 17203 TCF +2
043898,000988: 7202 54121 TS OVFIND # IF OVERFLOW OCCURS.
043899,000989:
043900,000990: 7203 52162 DXCH MPAC +5 # MULTIPLY Z COMPONENTS.
043901,000991: 7204 52155 DXCH MPAC
043902,000992: 7205 30136 CA DOTINC
043903,000993: 7206 26116 ADS ADDRWD
043904,000994: 7207 07112 TC DMPSUB
043905,000995: 7210 52132 ENDDOT DXCH BUF +1 # LEAVE FINAL ACCUMULATION IN MPAC.
043906,000996: 7211 20156 DAS MPAC +1
043907,000997: 7212 60154 AD MPAC
043908,000998: 7213 60130 AD BUF
043909,000999: 7214 54154 TS MPAC
043910,001000: 7215 00137 TC DOTRET
043911,001001:
043912,001002: 7216 07022 TC OVERFLOW # ON OVERFLOW HERE.
043913,001003: 7217 00137 TC DOTRET
043914,001004:
Page 1026 |
043916,001006: # DOUBLE PRECISION POLYNOMIAL EVALUATOR
043917,001007:
043918,001008: # N N-1
043919,001009: # THIS ROUTINE EVALUATES A X + A X + ... + A X + A LEAVING THE DP RESULT IN MPAC ON EXIT.
043920,001010: # N N-1 1 0
043921,001011:
043922,001012: # THE ROUTINE HAS TWO ENTRIES
043923,001013:
043924,001014: # 1. ENTRY THRU POWRSERS. THE COEFFICIENTS MAY BE EITHER IN FIXED OR ERASABLE, THE CALL IS BY
043925,001015: # TC POWRSERS, AND THE RETURN IS TO LOC(TC POWRSERS)+1. THE ENTERING DATA MUST BE AS FOLLOWS
043926,001016:
043927,001017: # A SP LOC-3 ADDRESS FOR REFERENCING COEF TABLE
043928,001018: # L SP N-1 N IS THE DEGREE OF THE POWER SERIES
043929,001019: # MPAC DP X ARGUMENT
043930,001020:
043931,001021: # LOC-2N DP A(0)
043932,001022: # ...
043933,001023: # LOC DP A(N)
043934,001024:
043935,001025: # 2. ENTRY THRU POLY. THE CALL TO POLY AND THE ENTERING DATA MUST BE AS FOLLOWS
043936,001026:
043937,001027: # MPAC DP X ARGUMENT
043938,001028:
043939,001029: # LOC TC POLY
043940,001030: # LOC+1 SP N-1
043941,001031: # LOC+2 DP A(0)
043942,001032: # ...
043943,001033: # LOC+2N+2 DP A(N) RETURN IS TO LOC+2N+4
043944,001034:
043945,001035: 7220 00006 POWRSERS EXTEND
043946,001036: 7221 22141 QXCH POLYRET # RETURN ADDRESS
043947,001037: 7222 54117 TS POLISH # POWER SERIES ADDRESS
043948,001038: 7223 22140 LXCH POLYCNT # N-1 TO COUNTER
043949,001039: 7224 17235 TCF POLYCOM # SKIP SET UP BY POLY
043950,001040:
043951,001041: 7225 50002 POLY INDEX Q
043952,001042: 7226 30000 CAF 0
043953,001043: 7227 54140 TS POLYCNT # N-1 TO COUNTER
043954,001044: 7230 60000 DOUBLE
043955,001045: 7231 60002 AD Q
043956,001046: 7232 54117 TS POLISH # L(A(N))-3 TO POLISH
043957,001047: 7233 64756 AD FIVE
043958,001048: 7234 54141 TS POLYRET # STORE RETURN ADDRESS
043959,001049:
043960,001050: 7235 36276 POLYCOM CAF LVBUF # INCOMING X WILL BE MOVED TO VBUF, SO
043961,001051: 7236 54116 TS ADDRWD # SET ADDRWD SO DMPSUB WILL MPY BY VBUF.
043962,001052:
043963,001053: 7237 00006 EXTEND
043964,001054: 7240 50117 INDEX POLISH
043965,001055: 7241 30004 DCA 3
043966,001056:
Page 1027 |
043968,001058: 7242 52155 DXCH MPAC # LOAD A(N) INTO MPAC,
043969,001059: 7243 52123 DXCH VBUF # SAVING X IN VBUF
043970,001060: 7244 17250 TCF POLY2
043971,001061:
043972,001062: 7245 54140 POLYLOOP TS POLYCNT # SAVE DECREMENTED LOOP COUNTER
043973,001063: 7246 44752 CS TWO
043974,001064: 7247 26117 ADS POLISH # REGRESS COEFFICIENT POINTER
043975,001065:
043976,001066: 7250 07112 POLY2 TC DMPSUB # MULTIPLY BY X
043977,001067: 7251 00006 EXTEND
043978,001068: 7252 50117 INDEX POLISH
043979,001069: 7253 30002 DCA 1 # ADD IN NEXT COEFFICIENT
043980,001070: 7254 20155 DAS MPAC # USERS RESPONSIBILITY TO ASSURE NO OVFLOW
043981,001071:
043982,001072: 7255 10140 CCS POLYCNT
043983,001073: 7256 17245 TCF POLYLOOP
043984,001074: 7257 00141 TC POLYRET # RETURN CALLER
043985,001075:
Page 1028 |
043987,001077: # MISCELLANEOUS MULTI-PRECISION ROUTINES REQUIRED IN FIXED-FIXED BUT NOT USED BY THE INTERPRETER.
043988,001078:
043989,001079: 7260 34755 DPAGREE CAF ZERO # DOUBLE PRECISION ENTRY -
043990,001080: 7261 54156 TS MPAC +2 # ZERO LOW-ORDER WORD
043991,001081:
043992,001082: 7262 22002 TPAGREE LXCH Q # FORCE SIGN AGREEMENT AMONG THE TRIPLE
043993,001083: 7263 06726 TC BRANCH # PRECISION CONTENTS OF MPAC. RETURNING
043994,001084: 7264 17270 TCF ARG+ # WITH SIGNUM OF THE INPUT IN A.
043995,001085: 7265 17310 TCF ARGZERO
043996,001086:
043997,001087: 7266 44733 CS POSMAX # IF NEGATIVE.
043998,001088: 7267 17271 TCF +2
043999,001089:
044000,001090: 7270 34733 ARG+ CAF POSMAX
044001,001091: 7271 54002 TS Q
044002,001092: 7272 00006 EXTEND
044003,001093: 7273 24000 AUG A # FORMS +-1.0.
044004,001094: 7274 60156 AD MPAC +2
044005,001095: 7275 54156 TS MPAC +2
044006,001096: 7276 34755 CAF ZERO
044007,001097: 7277 60002 AD Q
044008,001098: 7300 60155 AD MPAC +1
044009,001099: 7301 54155 TS MPAC +1
044010,001100: 7302 34755 CAF ZERO
044011,001101: 7303 60002 AD Q # Q STILL HAS POSMAX OR NEGMAX IN IT.
044012,001102: 7304 60154 AD MPAC
044013,001103: 7305 54154 ARGZERO2 TS MPAC # ALWAYS SKIPPING UNLESS ARGZERO.
044014,001104: 7306 54155 TS MPAC +1
044015,001105: 7307 00001 TC L # RETURN VIA L.
044016,001106:
044017,001107: 7310 54156 ARGZERO TS MPAC +2 # SET ALL THREE MPAC REGISTERS TO ZERO.
044018,001108: 7311 17305 TCF ARGZERO2
044019,001109:
044020,001110: # SHORTMP MULTIPLIES THE TP CONTENTS OF MPAC BY THE SINGLE PRECISION NUMBER ARRIVING IN A.
044021,001111:
044022,001112: 7312 54135 SHORTMP TS MPTEMP
044023,001113: 7313 00006 EXTEND
044024,001114: 7314 70156 MP MPAC +2
044025,001115: 7315 54156 TS MPAC +2
044026,001116: 7316 34755 SHORTMP2 CAF ZERO # SO SUBSEQUENT DAS WILL WORK.
044027,001117: 7317 56155 XCH MPAC +1
044028,001118: 7320 17131 TCF DMPSUB2
044029,001119:
Page 1029 |
044031,001121: # DMPNSUB MULTIPLIES THE DP FRACTION ARRIVING IN MPAC BY THE SP
044032,001122: # INTEGER ARRIVING IN A. THE DP PRODUCT DEPARTS BOTH IN MPAC AND IN
044033,001123: # A AND L. NOTE THAT DMPNSUB NORMALLY INCREASES THE MAGNITUDE OF THE
044034,001124: # CONTENTS OF MPAC. THE CUSTOMER MUST INSURE THAT B(A) X B(MPAC,MPAC+1)
044035,001125: # AND B(A) X B(MPAC) ARE LESS THAN 1 IN MAGNITUDE, WHERE B, AS IS OBVIOUS,
044036,001126: # INDICATES THE ARRIVING CONTENTS.
044037,001127:
044038,001128: 7321 54135 DMPNSUB TS DMPNTEMP
044039,001129: 7322 00006 EXTEND
044040,001130: 7323 70155 MP MPAC +1
044041,001131: 7324 52155 DXCH MPAC # LOW PRODUCT TO MPAC, HIGH FACTOR TO A
044042,001132: 7325 00006 EXTEND
044043,001133: 7326 70135 MP DMPNTEMP
044044,001134: 7327 30001 CA L
044045,001135: 7330 26154 ADS MPAC # COMPLETING THE PRODUCT IN MPAC
044046,001136: 7331 00006 EXTEND
044047,001137: 7332 30155 DCA MPAC # BRINGING THE PRODUCT INTO A AND L
044048,001138: 7333 00002 TC Q
044049,001139:
Page 1030 |
044051,001141: # MISCELLANEOUS VECTOR OPERATIONS. INCLUDED HERE ARE THE FOLLOWING:
044052,001142:
044053,001143: # 1. DOT DP VECTOR DOT PRODUCT.
044054,001144: # 2. VXV DP VECTOR CROSS PRODUCT.
044055,001145: # 3. VXSC DP VECTOR TIMES SCALAR.
044056,001146: # 4. V/SC DP VECTOR DIVIDED BY SCALAR.
044057,001147: # 5. VPROJ DP VECTOR PROJECTION. ( (MPAC.X)MPAC ).
044058,001148: # 6. VXM DP VECTOR POST-MULTIPLIED BY MATRIX.
044059,001149: # 7. MXV DP VECTOR PRE-MULTIPLIED BY MATRIX.
044060,001150:
044061,001151:
044062,001152: 7334 07157 DOT TC PREDOT # DO THE DOT PRODUCT AND EXIT, CHANGING
044063,001153: 7335 34755 DMODE CAF ZERO # THE MODE TO DP SCALAR.
044064,001154: 7336 16063 TCF NEWMODE
044065,001155:
044066,001156:
044067,001157: 7337 34752 MXV CAF TWO # SET UP MATINC AND DOTINC FOR ROW
044068,001158: 7340 54140 TS MATINC # VECTORS.
044069,001159: 7341 17345 TCF VXM/MXV # GO TO COMMON PORTION.
044070,001160:
044071,001161: 7342 44363 VXM CS TEN # SET MATINC AND DOTINC TO REFER TO MATRIX
044072,001162: 7343 54140 TS MATINC # AS THREE COLUMN VECTORS.
044073,001163: 7344 36245 CAF SIX
044074,001164:
Page 1031 |
044076,001166: # COMMON PORTION OF MXV AND VXM.
044077,001167:
044078,001168: 7345 54136 VXM/MXV TS DOTINC
044079,001169: # ITRACE (2) REFERS TO "VXM/MXV".
044080,001170: 7346 07535 TC MPACVBUF # SAVE VECTOR IN MPAC FOR FURTHER USE.
044081,001171:
044082,001172: 7347 07161 TC DOTSUB # GO DOT TO GET X COMPONENT OF ANSWER.
044083,001173: 7350 00006 EXTEND
044084,001174: 7351 30123 DCA VBUF # MOVE MPAC VECTOR BACK INTO MPAC, SAVING
044085,001175: 7352 52155 DXCH MPAC # NEW X COMPONENT IN BUF2.
044086,001176: 7353 52134 DXCH BUF2
044087,001177: 7354 00006 EXTEND
044088,001178: 7355 30125 DCA VBUF +2
044089,001179: 7356 52160 DXCH MPAC +3
044090,001180: 7357 00006 EXTEND
044091,001181: 7360 30127 DCA VBUF +4
044092,001182: 7361 52162 DXCH MPAC +5
044093,001183: 7362 30140 CA MATINC # INITIALIZE ADDRWD FOR NEXT DOT PRODUCT.
044094,001184: 7363 26116 ADS ADDRWD # FORMS BASE ADDRESS OF NEXT COLUMN(ROW).
044095,001185:
044096,001186: 7364 07161 TC DOTSUB
044097,001187: 7365 52123 DXCH VBUF # MOVE GIVEN VECTOR BACK TO MPAC, SAVING Y
044098,001188: 7366 52155 DXCH MPAC # COMPONENT OF ANSWER IN VBUF +2.
044099,001189: 7367 52125 DXCH VBUF +2
044100,001190: 7370 52160 DXCH MPAC +3
044101,001191: 7371 52127 DXCH VBUF +4
044102,001192: 7372 52162 DXCH MPAC +5
044103,001193: 7373 30140 CA MATINC # FORM ADDRESS OF LAST COLUMN OR ROW.
044104,001194: 7374 26116 ADS ADDRWD
044105,001195:
044106,001196: 7375 07161 TC DOTSUB
044107,001197: 7376 52134 DXCH BUF2 # ANSWER NOW COMPLETE. PUT COMPONENTS INTO
044108,001198: 7377 52155 DXCH MPAC # PROPER MPAC REGISTERS.
044109,001199: 7400 52162 DXCH MPAC +5
044110,001200: 7401 52125 DXCH VBUF +2
044111,001201: 7402 52160 DXCH MPAC +3
044112,001202: 7403 16064 TCF DANZIG # EXIT.
044113,001203:
Page 1032 |
044115,001205: # VXSC - VECTOR TIMES SCALAR.
044116,001206:
044117,001207: 7404 10163 VXSC CCS MODE # TEST PRESENT MODE.
044118,001208: 7405 17433 TCF DVXSC # SEPARATE ROUTINE WHEN SCALAR IS IN MPAC.
044119,001209: 7406 17433 TCF DVXSC
044120,001210:
044121,001211: 7407 07112 VVXSC TC DMPSUB # COMPUTE X COMPONENT
044122,001212: 7410 07143 TC VROUND # AND ROUND IT.
044123,001213: 7411 52160 DXCH MPAC +3 # PUT Y COMPONENT INTO MPAC SAVING MPAC IN
044124,001214: 7412 52155 DXCH MPAC # MPAC +3.
044125,001215: 7413 52160 DXCH MPAC +3
044126,001216:
044127,001217: 7414 07112 TC DMPSUB # DO SAME FOR Y AND Z COMPONENTS.
044128,001218: 7415 07143 TC VROUND
044129,001219: 7416 52162 DXCH MPAC +5
044130,001220: 7417 52155 DXCH MPAC
044131,001221: 7420 52162 DXCH MPAC +5
044132,001222:
044133,001223: 7421 07112 TC DMPSUB
044134,001224: 7422 07143 TC VROUND
044135,001225: 7423 52155 VROTATEX DXCH MPAC # EXIT USED TO RESTORE MPAC AFTER THIS
044136,001226: 7424 52162 DXCH MPAC +5 # TYPE OF ROTATION. CALLED BY VECTOR SHIFT
044137,001227: 7425 52160 DXCH MPAC +3 # RIGHT, V/SC, ETC.
044138,001228: 7426 52155 DXCH MPAC
044139,001229: 7427 16064 TCF DANZIG
044140,001230:
Page 1033 |
044142,001232: # DP VECTOR PROJECTION ROUTINE.
044143,001233:
044144,001234: 7430 07157 VPROJ TC PREDOT # (MPAC.X)MPAC IS COMPUTED AND LEFT IN
044145,001235: 7431 44751 CS FOUR # MPAC. DO DOT AND FALL INTO DVXSC.
044146,001236: 7432 26116 ADS ADDRWD
044147,001237:
044148,001238: # VXSC WHEN SCALAR ARRIVES IN MPAC AND VECTOR IS AT X.
044149,001239:
044150,001240: 7433 00006 DVXSC EXTEND # SAVE SCALAR IN MPAC +3 AND GET X
044151,001241: 7434 30155 DCA MPAC # COMPONENT OF ANSWER.
044152,001242: 7435 52160 DXCH MPAC +3
044153,001243: 7436 07112 TC DMPSUB
044154,001244: 7437 07143 TC VROUND
044155,001245:
044156,001246: 7440 34752 CAF TWO # ADVANCE ADDRWD TO Y COMPONENT OF X.
044157,001247: 7441 26116 ADS ADDRWD
044158,001248: 7442 00006 EXTEND
044159,001249: 7443 30160 DCA MPAC +3 # PUT SCALAR BACK INTO MPAC AND SAVE
044160,001250: 7444 52155 DXCH MPAC # X RESULT IN MPAC +5.
044161,001251: 7445 52162 DXCH MPAC +5
044162,001252: 7446 07112 TC DMPSUB
044163,001253: 7447 07143 TC VROUND
044164,001254:
044165,001255: 7450 34752 CAF TWO
044166,001256: 7451 26116 ADS ADDRWD # TO Z COMPONENT.
044167,001257: 7452 52160 DXCH MPAC +3 # BRING SCALAR BACK, PUTTING Y RESULT IN
044168,001258: 7453 52155 DXCH MPAC # THE PROPER PLACE.
044169,001259: 7454 52160 DXCH MPAC +3
044170,001260: 7455 07112 TC DMPSUB
044171,001261: 7456 07143 TC VROUND
044172,001262:
044173,001263: 7457 52155 DXCH MPAC # PUT Z COMPONENT IN PROPER PLACE, ALSO
044174,001264: 7460 52162 DXCH MPAC +5 # POSITIONING X.
044175,001265: 7461 52155 DXCH MPAC
044176,001266:
044177,001267: 7462 16524 TCF VMODE # MODE HAS CHANGED TO VECTOR.
044178,001268:
Page 1034 |
044180,001270: # THE VECTOR CROSS PRODUCT ROUTINE CALCULATES (X M -X M ,X M -X M ,X M -X M ) WHERE M IS THE VECTOR IN
044181,001271: # 3 2 2 3 1 3 3 1 2 1 1 2
044182,001272: # MPAC AND X THE VECTOR AT THE GIVEN ADDRESS.
044183,001273:
044184,001274: 7463 00006 VXV EXTEND
044185,001275: 7464 30162 DCA MPAC +5 # FORM UP M3X1, LEAVING M1 IN VBUF.
044186,001276: 7465 52155 DXCH MPAC
044187,001277: 7466 52123 DXCH VBUF
044188,001278: 7467 07112 TC DMPSUB # BY X1.
044189,001279:
044190,001280: 7470 00006 EXTEND
044191,001281: 7471 40160 DCS MPAC +3 # CALCULATE -X1M2, SAVING X1M3 IN VBUF +2.
044192,001282: 7472 52155 DXCH MPAC
044193,001283: 7473 52125 DXCH VBUF +2
044194,001284: 7474 07112 TC DMPSUB
044195,001285:
044196,001286: 7475 34752 CAF TWO # ADVANCE ADDRWD TO X2.
044197,001287: 7476 26116 ADS ADDRWD
044198,001288: 7477 00006 EXTEND
044199,001289: 7500 40162 DCS MPAC +5 # PREPARE TO GET -X2M3, SAVING -X1M2 IN
044200,001290: 7501 52155 DXCH MPAC # MPAC +5.
044201,001291: 7502 52162 DXCH MPAC +5
044202,001292: 7503 07112 TC DMPSUB
044203,001293:
044204,001294: 7504 00006 EXTEND
044205,001295: 7505 30123 DCA VBUF # GET X2M1, SAVING -X2M3 IN VBUF +4.
044206,001296: 7506 52155 DXCH MPAC
044207,001297: 7507 52127 DXCH VBUF +4
044208,001298: 7510 07112 TC DMPSUB
044209,001299:
044210,001300: 7511 34752 CAF TWO # ADVANCE ADDRWD TO X3.
044211,001301: 7512 26116 ADS ADDRWD
044212,001302: 7513 00006 EXTEND
044213,001303: 7514 40123 DCS VBUF # GET -X3M1, ADDING X2M1 TO MPAC +5 TO
044214,001304: 7515 52155 DXCH MPAC # COMPLETE THE Z COMPONENT OF THE ANSWER.
044215,001305: 7516 20162 DAS MPAC +5
044216,001306:
044217,001307: 7517 00006 EXTEND
044218,001308: 7520 17522 BZF +2
044219,001309: 7521 07014 TC OVERFLWZ
044220,001310:
044221,001311: 7522 07112 TC DMPSUB
044222,001312: 7523 52125 DXCH VBUF +2 # MOVE X1M3 TO MPAC +3 SETTING UP FOR X3M2
044223,001313: 7524 52160 DXCH MPAC +3 # AND ADD -X3M1 TO MPAC +3 TO COMPLETE THE
044224,001314: 7525 52155 DXCH MPAC # Y COMPONENT OF THE RESULT.
044225,001315: 7526 20160 DAS MPAC +3
044226,001316:
044227,001317: 7527 00006 EXTEND
044228,001318: 7530 17532 BZF +2
044229,001319:
Page 1035 |
044231,001321: 7531 07017 TC OVERFLWY
044232,001322:
044233,001323: 7532 07112 TC DMPSUB
044234,001324: 7533 52127 DXCH VBUF +4 # GO ADD -X2M3 TO X3M2 TO COMPLETE THE X
044235,001325: 7534 17003 TCF ENDVXV # COMPONENT (TAIL END OF DAD).
044236,001326:
044237,001327: # THE MPACVBUF SUBROUTINE SAVES THE VECTOR IN MPAC IN VBUF WITHOUT CLOBBERING MPAC.
044238,001328:
044239,001329: 7535 00006 MPACVBUF EXTEND # CALLED BY MXV, VXM, AND UNIT.
044240,001330: 7536 30155 DCA MPAC
044241,001331: 7537 52123 DXCH VBUF
044242,001332: 7540 00006 EXTEND
044243,001333: 7541 30160 DCA MPAC +3
044244,001334: 7542 52125 DXCH VBUF +2
044245,001335: 7543 00006 EXTEND
044246,001336: 7544 30162 DCA MPAC +5
044247,001337: 7545 52127 DXCH VBUF +4
044248,001338: 7546 00002 TC Q # RETURN TO CALLER.
044249,001339:
044250,001340: # DOUBLE PRECISION SIGN AGREE ROUTINE. ARRIVE WITH INPUT IN A+L. OUTPUT IS IN A + L.
044251,001341:
044252,001342: 7547 10000 ALSIGNAG CCS A # TEST UPPER PART.
044253,001343: 7550 17554 TCF UPPOS # IT IS POSITIVE
044254,001344: 7551 00002 TC Q # ZERO
044255,001345: 7552 17564 TCF UPNEG # NEGATIVE
044256,001346: 7553 00002 TC Q # ZERO
044257,001347:
044258,001348: 7554 56001 UPPOS XCH L # SAVE DECREMENTED UPPER PART.
044259,001349: 7555 64736 AD HALF
044260,001350: 7556 64736 AD HALF
044261,001351: 7557 54000 TS A # SKIPS ON OVERFLOW
044262,001352: 7560 17562 TCF +2
044263,001353: 7561 24001 INCR L # RESTORE UPPER TO ROIGINAL VALUE
044264,001354: 7562 56001 XCH L # SWAP A + L BACK.
044265,001355: 7563 00002 TC Q
044266,001356:
044267,001357: 7564 56001 UPNEG XCH L # SAVE COMPLEMENTED + DECREMENTED UPPER PT
044268,001358: 7565 64735 AD NEGMAX
044269,001359: 7566 67752 AD NEGONE
044270,001360: 7567 54000 TS A
044271,001361: 7570 17572 TCF +2 # DONT INCREMENT IF NO OVERFLOW.
044272,001362: 7571 24001 INCR L
044273,001363: 7572 56001 XCH L
044274,001364: 7573 40000 COM # MAKE NEGATIVE AGAIN.
044275,001365: 7574 00002 TC Q
044276,001366:
Page 1036 |
044278,001368: # INTERPRETIVE INSTRUCTIONS WHOSE EXECUTION CONSISTS OF PRINCIPALLY CALLING SUBROUTINES.
044279,001369:
044280,001370: 7575 07112 DMP1 TC DMPSUB # DMP INSTRUCTION.
044281,001371: 7576 16064 TCF DANZIG
044282,001372:
044283,001373: 7577 07112 DMPR TC DMPSUB
044284,001374: 7600 07142 TC ROUNDSUB +1 # (C(A) = +0).
044285,001375: 7601 16064 TCF DANZIG
044286,001376:
044287,001377: 7602 00006 DDV EXTEND
044288,001378: 7603 50116 INDEX ADDRWD # MOVE DIVIDEND INTO BUF.
044289,001379: 7604 30001 DCA 0
044290,001380: 7605 17612 TCF BDDV +4
044291,001381:
044292,001382: 7606 00006 BDDV EXTEND # MOVE DIVISOR INTO MPAC SAVING MPAC, THE
044293,001383: 7607 50116 INDEX ADDRWD # DIVIDEND, IN BUF.
044294,001384: 7610 30001 DCA 0
044295,001385: 7611 52155 DXCH MPAC
044296,001386: 7612 52131 +4 DXCH BUF
044297,001387: 7613 34755 CAF ZERO # DIVIDE ROUTINES IN BANK 0.
044298,001388: 7614 54004 TS FBANK
044299,001389: 7615 12353 TCF DDV/BDDV
044300,001390:
044301,001391: 7616 30116 SETPD CA ADDRWD # MUST SET TO WORK AREA, OR EBANK TROUBLE.
044302,001392: 7617 54166 TS PUSHLOC
044303,001393: 7620 16066 TCF NOIBNKSW # NO FBANK SWITCH REQUIRED.
044304,001394:
044305,001395: 7621 34755 TSLC CAF ZERO # SHIFTING ROUTINES LOCATED IN BANK 00.
044306,001396: 7622 54004 TS FBANK
044307,001397: 7623 12172 TCF TSLC2
044308,001398:
044309,001399: 7624 36077 GSHIFT CAF LOW7 # USED AS MASK AT GENSHIFT. THIS PROCESSES
044310,001400: 7625 54004 TS FBANK # ANY SHIFT INSTRUCTION (EXCEPT TSLC) WITH
044311,001401: 7626 12214 TCF GENSHIFT # AN ADDRESS (ROUTINES IN BANK 0).
044312,001402:
Page 1037 |
044314,001404: # THE FOLLOWING IS THE PROLOGUE TO V/SC. IF THE PRESENT MODE IS VECTOR, IT SAVES THE SCALAR AT X IN BUF
044315,001405: # AND CALLS THE V/SC ROUTINE IN BANK 0. IF THE PRESENT MODE IS SCALAR, IT MOVES THE VECTOR AT X INTO MPAC, SAVING
044316,001406: # THE SCALAR IN MPAC IN BUF BEFORE CALLING THE V/SC ROUTINE IN BANK 0.
044317,001407:
044318,001408: 7627 10163 V/SC CCS MODE
044319,001409: 7630 17641 TCF DV/SC # MOVE VECTOR INTO MPAC.
044320,001410: 7631 17641 TCF DV/SC
044321,001411:
044322,001412: 7632 00006 VV/SC EXTEND
044323,001413: 7633 50116 INDEX ADDRWD
044324,001414: 7634 30001 DCA 0
044325,001415: 7635 52131 V/SC1 DXCH BUF # IN BOTH CASES, VECTOR IS NOW IN MPAC AND
044326,001416: 7636 34755 CAF ZERO # SCALAR IN BUF.
044327,001417: 7637 54004 TS FBANK
044328,001418: 7640 12654 TCF V/SC2
044329,001419:
044330,001420: 7641 00006 DV/SC EXTEND
044331,001421: 7642 50116 INDEX ADDRWD
044332,001422: 7643 30003 DCA 2
044333,001423: 7644 52160 DXCH MPAC +3
044334,001424: 7645 00006 EXTEND
044335,001425: 7646 50116 INDEX ADDRWD
044336,001426: 7647 30005 DCA 4
044337,001427: 7650 52162 DXCH MPAC +5
044338,001428:
044339,001429: 7651 44753 CS ONE # CHANGE MODE TO VECTOR.
044340,001430: 7652 54163 TS MODE
044341,001431:
044342,001432: 7653 00006 EXTEND
044343,001433: 7654 50116 INDEX ADDRWD
044344,001434: 7655 30001 DCA 0
044345,001435: 7656 52155 DXCH MPAC
044346,001436: 7657 17635 TCF V/SC1 # FINISH PROLOGUE AT COMMON SECTION.
044347,001437:
Page 1038 |
044349,001439: # SIGN AND COMPLEMENT INSTRUCTIONS.
044350,001440:
044351,001441: 7660 50116 SIGN INDEX ADDRWD # CALL COMP INSTRUCTION IF WORD AT X IS
044352,001442: 7661 10000 CCS 0 # NEGATIVE NON-ZERO.
044353,001443: 7662 16064 TCF DANZIG
044354,001444: 7663 17665 TCF +2
044355,001445: 7664 17673 TCF COMP # DO THE COMPLEMENT.
044356,001446:
044357,001447: 7665 50116 INDEX ADDRWD
044358,001448: 7666 10001 CCSL CCS 1
044359,001449: 7667 16064 TCF DANZIG
044360,001450: 7670 16064 TCF DANZIG
044361,001451: 7671 17673 TCF COMP
044362,001452: 7672 16064 TCF DANZIG
044363,001453: 7673 00006 COMP EXTEND # COMPLEMENT DP MPAC IN EVERY CASE.
044364,001454: 7674 40155 DCS MPAC
044365,001455: 7675 52155 DXCH MPAC
044366,001456:
044367,001457: 7676 10163 CCS MODE # EITHER COMPLEMENT MPAC +3 OR THE REST OF
044368,001458: 7677 17710 TCF DCOMP # THE VECTOR ACCUMULATOR.
044369,001459: 7700 17710 TCF DCOMP
044370,001460:
044371,001461: 7701 00006 EXTEND # VECTOR COMPLEMENT.
044372,001462: 7702 40160 DCS MPAC +3
044373,001463: 7703 52160 DXCH MPAC +3
044374,001464: 7704 00006 EXTEND
044375,001465: 7705 40162 DCS MPAC +5
044376,001466: 7706 52162 DXCH MPAC +5
044377,001467: 7707 16064 TCF DANZIG
044378,001468:
044379,001469: 7710 40156 DCOMP CS MPAC +2
044380,001470: 7711 54156 TS MPAC +2
044381,001471: 7712 16064 TCF DANZIG
044382,001472:
Page 1039 |
044384,001474: # THE FOLLOWING SHORT SHIFT CODES REQUIRE NO ADDRESS WORD:
044385,001475:
044386,001476: # 1. SR1 TO SR4 SCALAR SHIFT RIGHT.
044387,001477: # 2. SR1R TO SR4R SCALAR SHIFT RIGHT AND ROUND.
044388,001478: # 3. SL1 TO SL4 SCALAR SHIFT LEFT.
044389,001479: # 4. SL1R TO SL4R SCALAR SHIFT LEFT AND ROUND.
044390,001480: # 5. VSR1 TO VSR8 VECTOR SHIFT RIGHT (ALWAYS ROUNDS).
044391,001481: # 6. VSL1 TO VSL8 VECTOR SHIFT LEFT (NEVER ROUNDS).
044392,001482:
044393,001483: # THE FOLLOWING CODES REQUIRE AN ADDRESS WHICH MAY BE INDEXED:*
044394,001484:
044395,001485: # 1. SR SCALAR SHIFT RIGHT.
044396,001486: # 2. SRR SCALAR SHIFT RIGHT AND ROUND.
044397,001487: # 3. SL SCALAR SHIFT LEFT.
044398,001488: # 4. SLR SCALAR SHIFT LEFT AND ROUND.
044399,001489: # 5. VSR VECTOR SHIFT RIGHT.
044400,001490: # 6. VSL VECTOR SHIFT LEFT.
044401,001491:
044402,001492: # * IF THE ADDRESS IS INDEXED, AND THE INDEX MODIFICATION RESULTS IN A NEGATIVE SHIFT COUNT, A SHIFT OF THE
044403,001493: # ABSOLUTE VALUE OF THE COUNT IS DONE IN THE OPPOSITE DIRECTION.
044404,001494:
044405,001495: 00,2017 BANK 00
044406,001496:
044407,001497: 00,2017 COUNT* $$/INTER
044408,001498: 00,2017 36245 SHORTT CAF SIX # SCALAR SHORT SHIFTS COME HERE. THE SHIFT
044409,001499: 00,2020 70020 MASK CYR # COUNT-1 IS NOW IN BITS 2-3 OF CYR. THE
044410,001500: 00,2021 54021 TS SR # ROUNDING BIT IS IN BIT1 AT THIS POINT.
044411,001501:
044412,001502: 00,2022 10020 CCS CYR # SEE IF RIGHT OR LEFT SHIFT DESIRED.
044413,001503: 00,2023 12101 TCF TSSL # SHIFT LEFT.
044414,001504:
044415,001505: 00,2024 00024 SRDDV DEC 20 B-14 # MPTEMP SETTING FOR SR BEFORE DDV.
044416,001506:
044417,001507: 00,2025 50021 TSSR INDEX SR # GET SHIFTING BIT.
044418,001508: 00,2026 34736 CAF BIT14
044419,001509: 00,2027 54135 TS MPTEMP
044420,001510:
044421,001511: 00,2030 10020 CCS CYR # SEE IF A ROUND IS DESIRED.
044422,001512: 00,2031 02050 RIGHTR TC MPACSRND # YES - SHIFT RIGHT AND ROUND.
044423,001513: 00,2032 16063 TCF NEWMODE # SET MODE TO DP (C(A) = 0).
044424,001514: 00,2033 30135 MPACSHR CA MPTEMP # DO A TRIPLE PRECISION SHIFT RIGHT.
044425,001515: 00,2034 00006 EXTEND
044426,001516: 00,2035 70156 MP MPAC +2
044427,001517: 00,2036 54156 +3 TS MPAC +2 # (EXIT FROM SQRT AND ABVAL).
044428,001518: 00,2037 30135 CA MPTEMP
044429,001519: 00,2040 00006 EXTEND
044430,001520: 00,2041 70154 MP MPAC # SHIFT MAJOR PART INTO A,L AND PLACE IN
044431,001521:
Page 1040 |
044433,001523: 00,2042 52155 DXCH MPAC # MPAC,+1.
044434,001524: 00,2043 30135 CA MPTEMP
044435,001525: 00,2044 00006 EXTEND
044436,001526: 00,2045 70001 MP L # ORIGINAL C(MPAC +1).
044437,001527: 00,2046 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
044438,001528: 00,2047 16064 TCF DANZIG
044439,001529:
044440,001530: # MPAC SHIFT RIGHT AND ROUND SUBROUTINES.
044441,001531:
044442,001532: 00,2050 30156 MPACSRND CA MPAC +2 # WE HAVE TO DO ALL THREE MULTIPLIES SINCE
044443,001533: 00,2051 00006 EXTEND # MPAC +1 AND MPAC +2 MIGHT HAVE SIGN
044444,001534: 00,2052 70135 MP MPTEMP # DISAGREEMENT WITH A SHIFT RIGHT OF 1.
044445,001535: 00,2053 56155 XCH MPAC +1
044446,001536: 00,2054 00006 EXTEND
044447,001537: 00,2055 70135 MP MPTEMP
044448,001538: 00,2056 56155 XCH MPAC +1 # TRIAL MINOR PART.
044449,001539: 00,2057 60001 AD L
044450,001540:
044451,001541: 00,2060 60000 VSHR2 DOUBLE # (FINISH VECTOR COMPONENT SHIFT RIGHT
044452,001542: 00,2061 54156 TS MPAC +2 # AND ROUND.
044453,001543: 00,2062 12064 TCF +2
044454,001544: 00,2063 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
044455,001545:
044456,001546: 00,2064 34755 CAF ZERO
044457,001547: 00,2065 54156 TS MPAC +2
044458,001548: 00,2066 56154 XCH MPAC # SETTING TO ZERO SO FOLLOWING DAS WORKS.
044459,001549: 00,2067 00006 EXTEND
044460,001550: 00,2070 70135 MP MPTEMP
044461,001551: 00,2071 20155 DAS MPAC # AGAIN NO OVERFLOW.
044462,001552: 00,2072 00002 TC Q
044463,001553:
044464,001554: 00,2073 30135 VSHRRND CA MPTEMP # ENTRY TO SHIFT RIGHT AND ROUND MPAC WHEN
044465,001555: 00,2074 00006 EXTEND # MPAC CONTAINS A VECTOR COMPONENT.
044466,001556: 00,2075 70155 MP MPAC +1
044467,001557: 00,2076 54155 TS MPAC +1
044468,001558: 00,2077 56001 XCH L
044469,001559: 00,2100 12060 TCF VSHR2 # GO ADD ONE IF NECESSARY AND FINISH.
044470,001560:
Page 1041 |
044472,001562: # ROUTINE FOR SHORT SCALAR SHIFT LEFT (AND MAYBE ROUND).
044473,001563:
044474,001564: 00,2101 30021 TSSL CA SR # GET SHIFT COUNT FOR SR.
044475,001565: 00,2102 54135 +1 TS MPTEMP
044476,001566:
044477,001567: 00,2103 00006 +2 EXTEND # ENTRY HERE FROM SL FOR SCALARS.
044478,001568: 00,2104 30156 DCA MPAC +1 # SHIFTING LEFT ONE PLACE AT A TIME IS
044479,001569: 00,2105 20156 DAS MPAC +1 # FASTER THAN DOING THE WHOLE SHIFT WITH
044480,001570: 00,2106 60154 AD MPAC # MULTIPLIES ASSUMING THAT FREQUENCY OF
044481,001571: 00,2107 60154 AD MPAC # SHIFT COUNTS GOES DOWN RAPIDLY AS A
044482,001572: 00,2110 54154 TS MPAC # FUNCTION OF THEIR MAGNITUDE.
044483,001573: 00,2111 12113 TCF +2
044484,001574: 00,2112 54121 TS OVFIND # OVERFLOW. (LEAVES OVERFLOW-CORRECTED
044485,001575: # RESULT ANYWAY).
044486,001576: 00,2113 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNT.
044487,001577: 00,2114 12102 TCF TSSL +1
044488,001578:
044489,001579: 00,2115 10020 CCS CYR # SEE IF ROUND WANTED.
044490,001580: 00,2116 07141 ROUND TC ROUNDSUB # YES - ROUND AND EXIT.
044491,001581: 00,2117 16064 TCF DANZIG # SL LEAVES A ZERO IN CYR FOR NO ROUND.
044492,001582: 00,2120 16064 TCF DANZIG # NO - EXIT IMMEDIATL
044493,001583:
Page 1042 |
044495,001585: # VECTOR SHIFTING ROUTINES.
044496,001586:
044497,001587: 00,2121 34757 SHORTV CAF LOW3 # SAVE 3 BIT SHIFT COUNT - 1 WITHOUT
044498,001588: 00,2122 70020 MASK CYR # EDITING CYR.
044499,001589: 00,2123 54135 TS MPTEMP
044500,001590: 00,2124 10020 CCS CYR # SEE IF LEFT OR RIGHT SHIFT.
044501,001591: 00,2125 12145 TCF VSSL # VECTOR SHIFT LEFT.
044502,001592: 00,2126 00176 OCT176 OCT 176 # USED IN PROCESSED SHIFTS WITH - COUNT.
044503,001593:
044504,001594: 00,2127 50135 VSSR INDEX MPTEMP # (ENTRY FROM SR). PICK UP SHIFTING BIT.
044505,001595: 00,2130 34736 CAF BIT14 # MPTEMP CONTAINS THE SHIFT COUNT - 1.
044506,001596: 00,2131 54135 TS MPTEMP
044507,001597: 00,2132 02073 TC VSHRRND # SHIFT X COMPONENT.
044508,001598:
044509,001599: 00,2133 52155 DXCH MPAC # SWAP X AND Y COMPONENTS.
044510,001600: 00,2134 52160 DXCH MPAC +3
044511,001601: 00,2135 52155 DXCH MPAC
044512,001602: 00,2136 02073 TC VSHRRND # SHIFT Y COMPONENT.
044513,001603:
044514,001604: 00,2137 52155 DXCH MPAC # SWAP Y AND Z COMPONENTS.
044515,001605: 00,2140 52162 DXCH MPAC +5
044516,001606: 00,2141 52155 DXCH MPAC
044517,001607: 00,2142 02073 TC VSHRRND # SHIFT Z COMPONENT.
044518,001608:
044519,001609: 00,2143 17423 TCF VROTATEX # RESTORE COMPONENTS TO PROPER PLACES.
044520,001610:
Page 1043 |
044522,001612: # VECTOR SHIFT LEFT - DONE ONE PLACE AT A TIME.
044523,001613:
044524,001614: 00,2144 54135 -1 TS MPTEMP # SHIFTING LOOP.
044525,001615:
044526,001616: 00,2145 00006 VSSL EXTEND
044527,001617: 00,2146 30155 DCA MPAC
044528,001618: 00,2147 20155 DAS MPAC
044529,001619: 00,2150 00006 EXTEND
044530,001620: 00,2151 12153 BZF +2
044531,001621: 00,2152 07022 TC OVERFLOW
044532,001622:
044533,001623: 00,2153 00006 EXTEND
044534,001624: 00,2154 30160 DCA MPAC +3
044535,001625: 00,2155 20160 DAS MPAC +3
044536,001626: 00,2156 00006 EXTEND
044537,001627: 00,2157 12161 BZF +2
044538,001628: 00,2160 07017 TC OVERFLWY
044539,001629:
044540,001630: 00,2161 00006 EXTEND
044541,001631: 00,2162 30162 DCA MPAC +5
044542,001632: 00,2163 20162 DAS MPAC +5
044543,001633: 00,2164 00006 EXTEND
044544,001634: 00,2165 12167 BZF +2
044545,001635: 00,2166 07014 TC OVERFLWZ
044546,001636:
044547,001637: 00,2167 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNTER.
044548,001638: 00,2170 12144 TCF VSSL -1
044549,001639: 00,2171 16064 TCF DANZIG # EXIT.
044550,001640:
Page 1044 |
044552,001642: # TSLC - TRIPLE SHIFT LEFT AND COUNT. SHIFTS MPAC LEFT UNTIL GREATER THAN .5 IN MAGNITUDE, LEAVING
044553,001643: # THE COMPLEMENT OF THE NUMBER OF SHIFTS REQUIRED IN X.
044554,001644:
044555,001645: 00,2172 54135 TSLC2 TS MPTEMP # START BY ZEROING SHIFT COUNT (IN A NOW).
044556,001646: 00,2173 06726 TC BRANCH # EXIT WITH NO SHIFTING IF ARGUMENT ZERO.
044557,001647: 00,2174 12176 TCF +2
044558,001648: 00,2175 12212 TCF ENDTSLC # STORES ZERO SHIFT COUNT IN THIS CASE.
044559,001649:
044560,001650: 00,2176 07262 TC TPAGREE # MAY CAUSE UPSHIFT OF ONE EXTRA PLACE.
044561,001651:
044562,001652: 00,2177 30154 CA MPAC # BEGIN NORMALIZATION LOOP.
044563,001653: 00,2200 12207 TCF TSLCTEST
044564,001654:
044565,001655: 00,2201 24135 TSLCLOOP INCR MPTEMP # INCREMENT SHIFT COUNTER.
044566,001656: 00,2202 00006 EXTEND
044567,001657: 00,2203 30156 DCA MPAC +1
044568,001658: 00,2204 20156 DAS MPAC +1
044569,001659: 00,2205 60154 AD MPAC
044570,001660: 00,2206 26154 ADS MPAC
044571,001661: 00,2207 60000 TSLCTEST DOUBLE # SEE IF (ANOTHER) SHIFT IS REQUIRED.
044572,001662: 00,2210 54000 OVSK
044573,001663: 00,2211 12201 TCF TSLCLOOP # YES - INCREMENT COUNT AND SHIFT AGAIN.
044574,001664:
044575,001665: 00,2212 40135 ENDTSLC CS MPTEMP
044576,001666: 00,2213 16626 TCF STORE1 # STORE SHIFT COUNT AND RETURN TO DANZIG.
044577,001667:
Page 1045 |
044579,001669: # THE FOLLOWING ROUTINES PROCESSES THE GENERAL SHIFT INSTRUCTIONS SR, SRR, SL, AND SLR.
044580,001670: # THE GIVEN ADDRESS IS DECODED AS FOLLOWS:
044581,001671:
044582,001672: # BITS 1-7 SHIFT COUNT (SUBADDRESS) LESS THAN 125 DECIMAL.
044583,001673: # BIT 8 PSEUDO SIGN BIT (DETECTS CHANGE IN SIGN IN INDEXED SHIFTS).
044584,001674: # BIT 9 0 FOR LEFT SHIFT, AND 1 FOR RIGHT SHIFT.
044585,001675: # BIT 10 1 FOR TERMINAL ROUND ON SCALAR SHIFTS, 0 OTHERWISE.
044586,001676: # BITS 11-13 0.
044587,001677: # BIT 14 1.
044588,001678: # BIT 15 0.
044589,001679:
044590,001680: # THE ABOVE ENCODING IS DONE BY THE YUL SYSTEM.
044591,001681:
044592,001682: 00,2214 70116 GENSHIFT MASK ADDRWD # GET SHIFT COUNT, TESTING FOR ZERO.
044593,001683: 00,2215 10000 CCS A # (ARRIVES WITH C(A) = LOW7).
044594,001684: 00,2216 12224 TCF GENSHFT2 # IF NON-ZERO, PROCEED WITH DECREMENTED CT
044595,001685:
044596,001686: 00,2217 34742 CAF BIT10 # ZERO SHIFT COUNT. NO SHIFTS NEEDED BUT
044597,001687: 00,2220 70116 MASK ADDRWD # WE MIGHT HAVE TO ROUND MPAC ON SLR AND
044598,001688: 00,2221 10000 CCS A # SRR (SCALAR ONLY).
044599,001689: 00,2222 07141 TC ROUNDSUB
044600,001690: 00,2223 16064 TCF DANZIG
044601,001691:
044602,001692: 00,2224 54135 GENSHFT2 TS MPTEMP # DECREMENTED SHIFT COUNT TO MPTEMP.
044603,001693: 00,2225 34744 CAF BIT8 # TEST MEANING OF LOW SEVEN BIT COUNT IN
044604,001694: 00,2226 00006 EXTEND # MPTEMP NOW.
044605,001695: 00,2227 70116 MP ADDRWD
044606,001696: 00,2230 76250 MASK LOW2 # JUMPS ON SHIFT DIRECTION (BIT8) AND
044607,001697: 00,2231 50000 INDEX A
044608,001698: 00,2232 12233 TCF +1 # ORIGINAL SHIFT DIRECTION (BIT 9).
044609,001699: 00,2233 12332 TCF RIGHT- # NEGATIVE SHIFT COUNT FOR SL OR SLR.
044610,001700: 00,2234 12342 TCF LEFT # SL OR SLR.
044611,001701: 00,2235 12336 TCF LEFT- # NEGATIVE SHIFT COUNT WITH SR OR SRR.
044612,001702:
Page 1046 |
044614,001704: # GENERAL SHIFT RIGHT.
044615,001705:
044616,001706: 00,2236 10163 RIGHT CCS MODE # SEE IF VECTOR OR SCALAR.
044617,001707: 00,2237 12277 TCF GENSCR
044618,001708: 00,2240 12277 TCF GENSCR
044619,001709:
044620,001710: 00,2241 30135 CA MPTEMP # SEE IF SHIFT COUNT LESS THAN 14D.
044621,001711: 00,2242 63733 VRIGHT2 AD NEG12
044622,001712: 00,2243 00006 EXTEND
044623,001713: 00,2244 62127 BZMF VSSR # IF SO, BRANCH AND SHIFT IMMEDIATELY.
044624,001714:
044625,001715: 00,2245 67752 AD NEGONE # IF NOT, REDUCE MPTEMP BY A TOTAL OF 14,
044626,001716: 00,2246 54135 TS MPTEMP # AND DO A SHIFT RIGHT AND ROUND BY 14.
044627,001717: 00,2247 34755 CAF ZERO # THE ROUND AT THIS STAGE MAY INTRODUCE A
044628,001718: 00,2250 54001 TS L # ONE BIT ERROR IN A SHIFT RIGHT 15D.
044629,001719: 00,2251 56154 XCH MPAC
044630,001720: 00,2252 56155 XCH MPAC +1
044631,001721: 00,2253 02272 TC SETROUND # X COMPONENT NOW SHIFTED, SO MAKE UP THE
044632,001722: 00,2254 20155 DAS MPAC # ROUNDING QUANTITY (0 IN A AND 0 OR +-1
044633,001723: # IN L).
044634,001724: 00,2255 56157 XCH MPAC +3 # REPEAT THE ABOVE PROCESS FOR Y AND Z.
044635,001725: 00,2256 56160 XCH MPAC +4
044636,001726: 00,2257 02272 TC SETROUND
044637,001727: 00,2260 20160 DAS MPAC +3 # NO OVERFLOW ON THESE ADDS.
044638,001728:
044639,001729: 00,2261 56161 XCH MPAC +5
044640,001730: 00,2262 56162 XCH MPAC +6
044641,001731: 00,2263 02272 TC SETROUND
044642,001732: 00,2264 20162 DAS MPAC +5
044643,001733:
044644,001734: 00,2265 10135 CCS MPTEMP # SEE IF DONE, DOING FINAL DECREMENT.
044645,001735: 00,2266 54135 TS MPTEMP
044646,001736: 00,2267 12242 TCF VRIGHT2
044647,001737: 00,2270 04604 BIASLO DEC .2974 B-1 # SQRT CONSTANT
044648,001738:
044649,001739: 00,2271 16064 TCF DANZIG
044650,001740:
044651,001741: 00,2272 60000 SETROUND DOUBLE # MAKES UP ROUNDING QUANTITY FROM ARRIVING
044652,001742: 00,2273 54156 TS MPAC +2 # C(A). L IS ZERO INITIALLY.
044653,001743: 00,2274 34755 CAF ZERO
044654,001744: 00,2275 56001 XCH L
044655,001745: 00,2276 00002 TC Q # RETURN AND DO THE DAS, RESETTING L TO 0.
044656,001746:
Page 1047 |
044658,001748: # PROCESS SR AND SRR FOR SCALARS.
044659,001749:
044660,001750: 00,2277 30135 GENSCR CA MPTEMP # SEE IF THE ORIGINAL SHIFT COUNT WAS LESS
044661,001751: 00,2300 63733 +1 AD NEG12 # THAN 14D.
044662,001752: 00,2301 00006 EXTEND
044663,001753: 00,2302 62322 BZMF DOSSHFT # DO THE SHIFT IMMEDIATELY IF SO.
044664,001754:
044665,001755: 00,2303 67752 +4 AD NEGONE # IF NOT, DECREMENT SHIFT COUNT BY 14D AND
044666,001756: 00,2304 54135 TS MPTEMP # SHIFT MPAC RIGHT 14 PLACES.
044667,001757: 00,2305 34755 CAF ZERO
044668,001758: 00,2306 56154 XCH MPAC
044669,001759: 00,2307 56155 XCH MPAC +1
044670,001760: 00,2310 54156 TS MPAC +2
044671,001761: 00,2311 10135 CCS MPTEMP # SEE IF FINISHED, DO FINAL DECREMENT.
044672,001762: 00,2312 54135 TS MPTEMP
044673,001763: 00,2313 02300 TC GENSCR +1
044674,001764: 00,2314 22650 SLOPEHI DEC .5884 # SQRT CONSTANT.
044675,001765: 00,2315 34742 CAF BIT10 # FINISHED WITH SHIFT. SEE IF ROUND
044676,001766: 00,2316 70116 MASK ADDRWD # WANTED.
044677,001767: 00,2317 10000 CCS A
044678,001768: 00,2320 07141 TC ROUNDSUB
044679,001769: 00,2321 16064 TCF DANZIG # DO SO AND/OR EXIT.
044680,001770:
044681,001771: 00,2322 50135 DOSSHFT INDEX MPTEMP # PICK UP SHIFTING BIT.
044682,001772: 00,2323 34736 CAF BIT14
044683,001773: 00,2324 54135 TS MPTEMP
044684,001774: 00,2325 34742 CAF BIT10 # SEE IF TERMINAL ROUND DESIRED.
044685,001775: 00,2326 70116 MASK ADDRWD
044686,001776: 00,2327 10000 CCS A
044687,001777: 00,2330 12031 TCF RIGHTR # YES.
044688,001778: 00,2331 12033 TCF MPACSHR # JUST SHIFT RIGHT.
044689,001779:
Page 1048 |
044691,001781: # PROCESS THE RIGHT- (SL(R) WITH A NEGATIVE COUNT), LEFT-, AND LEFT OPTIONS.
044692,001782:
044693,001783: 00,2332 40135 RIGHT- CS MPTEMP # GET ABSOLUTE VALUE - 1 OF SHIFT COUNT
044694,001784: 00,2333 62126 AD OCT176 # UNDERSTANDING THAT BIT8 (PSEUDO-SIGN)
044695,001785: 00,2334 54135 TS MPTEMP # WAS 1 INITIALLY.
044696,001786: 00,2335 12236 TCF RIGHT # DO NORMAL SHIFT RIGHT.
044697,001787:
044698,001788: 00,2336 42126 LEFT- CS OCT176 # SAME PROLOGUE TO LEFT FOR INDEXED RIGHT
044699,001789: 00,2337 60135 AD MPTEMP # SHIFTS WHOSE NET SHIFT COUNT IS NEGATIVE
044700,001790: 00,2340 40000 COM
044701,001791: 00,2341 54135 TS MPTEMP
044702,001792:
044703,001793: 00,2342 10163 LEFT CCS MODE # SINCE LEFT SHIFTING IS SONE ONE PLACE AT
044704,001794: 00,2343 12346 TCF GENSCL # A TIME, NO COMPARISON WITH 14 NEED BE
044705,001795: 00,2344 12346 TCF GENSCL # DONE. FOR SCALARS, SEE IF TERMINAL ROUND
044706,001796: 00,2345 12145 TCF VSSL # DESIRED. FOR VECTORS, SHIFT IMMEDIATELY.
044707,001797:
044708,001798: 00,2346 40116 GENSCL CS ADDRWD # PUT ROUNDING BIT (BIT 10 OF ADDRWD) INTO
044709,001799: 00,2347 00006 EXTEND # BIT 15 OF CYR WHERE THE ROUNDING BIT OF
044710,001800: 00,2350 74746 MP BIT6 # A SHORT SHIFT LEFT WOULD BE
044711,001801: 00,2351 54020 TS CYR
044712,001802: 00,2352 12103 TCF TSSL +2 # DO THE SHIFT.
044713,001803:
Page 1049 |
044715,001805: # SCALAR DIVISION INSTRUCTIONS, DDV AND BDDV, ARE EXECUTED HERE. AT THIS POINT, THE DIVIDEND IS IN MPAC
044716,001806: # AND THE DIVISOR IN BUF.
044717,001807:
044718,001808: 00,2353 44753 DDV/BDDV CS ONE # INITIALIZATION.
044719,001809: 00,2354 54136 TS DVSIGN # +-1 FOR POSITIVE QUOTIENT - -0 FOR NEG.
044720,001810: 00,2355 54137 TS DVNORMCT # DIVIDEND NORMALIZATION COUNT.
044721,001811: 00,2356 54140 TS MAXDVSW # NEAR-ONE DIVIDE FLAG.
044722,001812:
044723,001813: 00,2357 10130 CCS BUF # FORCE BUF POSITIVE WITH THE MAJOR PART
044724,001814: 00,2360 12516 TCF BUFPOS # NON-ZERO.
044725,001815: 00,2361 12363 TCF +2
044726,001816: 00,2362 12531 TCF BUFNEG
044727,001817:
044728,001818: 00,2363 54156 BUFZERO TS MPAC +2 # ZERO THIS.
044729,001819: 00,2364 07262 TC TPAGREE # FORCE SIGN AGREEMENT BEFORE OVERFLOW
044730,001820:
044731,001821: 00,2365 10154 CCS MPAC # TEST TO SEE IF MPAC NON-ZERO. (TOO BIG)
044732,001822: 00,2366 12414 TCF OVF+ # MAJOR PART OF DIVIDEND IS POSITIVE NON-0
044733,001823: 00,2367 12371 TCF +2
044734,001824: 00,2370 12413 TCF OVF+ -1 # MAJOR PART OF DIVIDEND IS NEG. NON-ZERO
044735,001825:
044736,001826: 00,2371 56131 XCH BUF +1 # SHIFT DIVIDEND AND DIVISOR LEFT 14.
044737,001827: 00,2372 56130 XCH BUF
044738,001828: 00,2373 56155 XCH MPAC +1
044739,001829: 00,2374 56154 XCH MPAC
044740,001830: 00,2375 10130 CCS BUF # TRY AGAIN ON FORMER MINOR PART.
044741,001831: 00,2376 12422 TCF BUF+
044742,001832: 00,2377 12401 TCF +2 # OVERFLOW ON ZERO DIVISOR.
044743,001833: 00,2400 12416 TCF BUF-
044744,001834:
044745,001835: 00,2401 40154 CS MPAC # SIGN OF MPAC DETERMINES SIGN OF RESULT.
044746,001836: 00,2402 00006 SGNDVOVF EXTEND
044747,001837: 00,2403 62405 BZMF +2
044748,001838: 00,2404 24136 INCR DVSIGN # NEGMAX IN MPAC PERHAPS.
044749,001839: 00,2405 34733 DVOVF CAF POSMAX # ON DIVISION OVERFLOW OF ANY SORT, SET
044750,001840: 00,2406 54154 TS MPAC # SET DP MPAC TO +-POSMAX.
044751,001841: 00,2407 02630 TC FINALDV +3
044752,001842: 00,2410 34753 CAF ONE # SET OVERFLOW INDICATOR AND EXIT.
044753,001843: 00,2411 54121 TS OVFIND
044754,001844: 00,2412 06064 TC DANZIG
044755,001845:
044756,001846: 00,2413 24136 -1 INCR DVSIGN
044757,001847: 00,2414 40131 OVF+ CS BUF +1 # LOAD LOWER ORDER PART OF DIVISOR.
044758,001848: 00,2415 12402 TCF SGNDVOVF # GET SIGN OF RESULT.
044759,001849:
044760,001850: 00,2416 00006 BUF- EXTEND # IF BUF IS NEGATIVE, COMPLEMENT IT AND
044761,001851: 00,2417 40131 DCS BUF # MAINTAIN DVSIGN FOR FINAL QUOTIENT SIGN.
044762,001852: 00,2420 52131 DXCH BUF
044763,001853: 00,2421 24136 INCR DVSIGN # NOW -0.
044764,001854:
Page 1050 |
044766,001856: 00,2422 10154 BUF+ CCS MPAC # FORCE MPAC POSITIVE, CHECKING FOR ZERO
044767,001857: 00,2423 12437 TCF MPAC+ # DIVIDEND IN THE PROCESS.
044768,001858: 00,2424 12426 TCF +2
044769,001859: 00,2425 12433 TCF MPAC-
044770,001860: 00,2426 10155 CCS MPAC +1
044771,001861: 00,2427 12437 TCF MPAC+
044772,001862: 00,2430 16064 TCF DANZIG # EXIT IMMEDIATELY ON ZERO DIVIDEND.
044773,001863: 00,2431 12433 TCF MPAC-
044774,001864: 00,2432 16064 TCF DANZIG
044775,001865:
044776,001866: 00,2433 00006 MPAC- EXTEND # FORCE MPAC POSITIVE AS BUF IN BUF-.
044777,001867: 00,2434 40155 DCS MPAC
044778,001868: 00,2435 52155 DXCH MPAC
044779,001869: 00,2436 24136 INCR DVSIGN # NOW +1 OR -0.
044780,001870:
Page 1051 |
044782,001872: 00,2437 40154 MPAC+ CS MPAC # CHECK FOR DIVISION OVERFLOW. IF THE
044783,001873: 00,2440 67752 AD NEGONE # MAJOR PART OF THE DIVIDEND IS LESS THAN
044784,001874: 00,2441 60130 AD BUF # THE MAJOR PART OF THE DIVISOR BY AT
044785,001875: 00,2442 10000 CCS A # LEAST TWO, WE CAN PROCEED IMMEDIATELY
044786,001876: 00,2443 12505 TCF DVNORM # WITHOUT NORMALIZATION PRODUCING A DVMAX.
044787,001877: 00,2444 60001 -1/2+2 OCT 60001 # USED IN SQRTSUB.
044788,001878:
044789,001879: 00,2445 12446 TCF +1 # IF THE ABOVE DOES NOT HOLD, FORCE SIGN
044790,001880: 00,2446 34736 CAF HALF # AGREEMENT IN NUMERATOR AND DENOMINATOR
044791,001881: 00,2447 60000 DOUBLE # TO FACILITATE OVERFLOW AND NEAR-ONE
044792,001882: 00,2450 60155 AD MPAC +1 # CHECKING.
044793,001883: 00,2451 54155 TS MPAC +1
044794,001884: 00,2452 34755 CAF ZERO
044795,001885: 00,2453 64733 AD POSMAX
044796,001886: 00,2454 26154 ADS MPAC
044797,001887:
044798,001888: 00,2455 34736 CAF HALF # SAME FOR BUF.
044799,001889: 00,2456 60000 DOUBLE
044800,001890: 00,2457 60131 AD BUF +1
044801,001891: 00,2460 54131 TS BUF +1
044802,001892: 00,2461 34755 CAF ZERO
044803,001893: 00,2462 64733 AD POSMAX
044804,001894: 00,2463 26130 ADS BUF
044805,001895:
044806,001896: 00,2464 40154 CS MPAC # CHECK MAGNITUDE OF SIGN-CORRECTED
044807,001897: 00,2465 60130 AD BUF # OPERANDS.
044808,001898: 00,2466 10000 CCS A
044809,001899: 00,2467 12505 TCF DVNORM # DIVIDE OK - WILL NOT BECOME MAXDV CASE.
044810,001900: 00,2470 00133 LBUF2 ADRES BUF2
044811,001901: 00,2471 12405 TCF DVOVF # DIVISOR NOT LESS THAN DIVIDEND - OVF.
044812,001902:
044813,001903: 00,2472 54140 TS MAXDVSW # IF THE MAJOR PARTS OF THE DIVIDEND AND
044814,001904: 00,2473 40155 CS MPAC +1 # DIVISOR ARE EQUAL, A SPECIAL APPROXIMA-
044815,001905: 00,2474 60131 AD BUF +1 # TION IS USED (PROVIDED THE DIVISION IS
044816,001906: 00,2475 00006 EXTEND # POSSIBLE, OF COURSE).
044817,001907: 00,2476 62405 BZMF DVOVF
044818,001908: 00,2477 12505 TCF DVNORM # IF NO OVERFLOW.
044819,001909:
Page 1052 |
044821,001911: 00,2500 00006 BUFNORM EXTEND # ADD -1 TO AUGMENT SHIFT COUNT AND SHIFT
044822,001912: 00,2501 24137 AUG DVNORMCT # LEFT ONE PLACE.
044823,001913: 00,2502 00006 EXTEND
044824,001914: 00,2503 30131 DCA BUF
044825,001915: 00,2504 20131 DAS BUF
Note: For the three previous statements operator and operand are circled with red ink (single "circle".) |
044827,001917:
044828,001918: 00,2505 30130 DVNORM CA BUF # SEE IF DIVISOR NORMALIZED YET.
044829,001919: 00,2506 60000 DOUBLE
044830,001920: 00,2507 54000 OVSK
044831,001921: 00,2510 12500 TCF BUFNORM # NO - SHIFT LEFT ONE AND TRY AGAIN.
044832,001922:
044833,001923: 00,2511 52155 DXCH MPAC # CALL DIVIDEND NORMALIZATION SEQUENCE
044834,001924: 00,2512 50137 INDEX DVNORMCT # PRIOR TO DOING THE DIVIDE.
044835,001925: 00,2513 02565 TC MAXTEST
044836,001926:
044837,001927: 00,2514 54156 TS MPAC +2 # RETURNS WITH DIVISION DONE AND C(A) = 0.
044838,001928: 00,2515 16064 TCF DANZIG
044839,001929:
044840,001930: 00,2516 10000 BUFPOS CCS A
044841,001931: 00,2517 12422 TCF BUF+ # TO BUF+ IF BUF IS GREATER THAN +1.
044842,001932:
044843,001933: 00,2520 40131 CS BUF +1 # IF BUF IS +1, FORCING SIGN AGREEMENT
044844,001934: 00,2521 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
044845,001935: 00,2522 62422 BZMF BUF+ # BRANCH IF SIGNS AGREE.
044846,001936:
044847,001937: 00,2523 34736 CA HALF # SIGNS DISAGREE. FORCE AGREEMENT.
044848,001938: 00,2524 60000 +6 DOUBLE
044849,001939: 00,2525 26131 ADS BUF +1
044850,001940: 00,2526 34755 CA ZERO
044851,001941: 00,2527 54130 TS BUF
044852,001942: 00,2530 12363 TCF BUFZERO
044853,001943:
044854,001944: 00,2531 10000 BUFNEG CCS A
044855,001945: 00,2532 12416 TCF BUF- # TO BUF- IF BUF IS LESS THAN -1.
044856,001946:
044857,001947: 00,2533 30131 CA BUF +1 # IF BUF IS -1, FORCING SIGN AGREEMENT
044858,001948: 00,2534 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
044859,001949: 00,2535 62416 BZMF BUF- # BRANCH IF SIGNS AGREE.
044860,001950:
044861,001951: 00,2536 44736 CS HALF # SIGNS DISAGREE. FORCE AGREEMENT.
044862,001952: 00,2537 12524 TCF BUFPOS +6
044863,001953:
Page 1053 |
044865,001955: # THE FOLLOWING ARE PROLOGUES TO SHIFT THE DIVIDEND ARRIVING IN A AND L BEFORE THE DIVIDE.
044866,001956:
044867,001957: 00,2540 22021 -21D LXCH SR # SPECIAL PROLOGUE FOR UNIT WHEN THE
044868,001958: 00,2541 00006 EXTEND # LENGTH OF THE ARGUMENT WAS NOT LESS THAN
044869,001959: 00,2542 74736 MP HALF # .5. IN THIS CASE, EACH COMPONENT MUST BE
044870,001960: 00,2543 56001 XCH L # SHIFTED RIGHT ONE TO PRODUCE A HALF-UNIT
044871,001961: 00,2544 60021 AD SR # VECTOR.
044872,001962: 00,2545 56001 XCH L
044873,001963: 00,2546 12571 TCF GENDDV +1 # WITH DP DIVIDEND IN A,L.
044874,001964:
044875,001965: 00,2547 20001 DDOUBL # PROLOGUE WHICH NORMALIZES THE DIVIDEND
044876,001966: 00,2550 20001 DDOUBL # WHEN IT IS KNOWN THAT NO DIVISION
044877,001967: 00,2551 20001 DDOUBL # OVERFLOW WILL OCCUR.
044878,001968: 00,2552 20001 DDOUBL
044879,001969: 00,2553 20001 DDOUBL
044880,001970: 00,2554 20001 DDOUBL
044881,001971: 00,2555 20001 DDOUBL
044882,001972: 00,2556 20001 DDOUBL
044883,001973: 00,2557 20001 DDOUBL
044884,001974: 00,2560 20001 DDOUBL
044885,001975: 00,2561 20001 DDOUBL
044886,001976: 00,2562 20001 DDOUBL
044887,001977: 00,2563 20001 DDOUBL
044888,001978: 00,2564 52155 DXCH MPAC
044889,001979:
044890,001980: 00,2565 10140 MAXTEST CCS MAXDVSW # 0 IF MAJORS MIGHT BE =, -1 OTHERWISE.
044891,001981: 00,2566 06552 BIASHI DEC .4192 B-1 # SQRT CONSTANTS
044892,001982:
044893,001983: 00,2567 12642 TCF MAXDV # CHECK TO SEE IF THEY ARE NOW EQUAL.
044894,001984:
Page 1054 |
044896,001986: # THE FOLLOWING IS A GENERAL PURPOSE DOUBLE PRECISION DIVISION ROUTINE. IT DIVIDES MPAC BY BUF AND LEAVES
044897,001987: # THE RESULT IN MPAC. THE FOLLOWING CONDITIONS MUST BE SATISFIED:
044898,001988:
044899,001989: # 1. THE DIVISOR (BUF) MUST BE POSITIVE AND NOT LESS THAN .5.
044900,001990:
044901,001991: # 2. THE DIVIDEND (MPAC) MUST BE POSITIVE WITH THE MAJOR PART OF MPAC STRICTLY LESS THAN THAT OF BUF
044902,001992: # (A SPECIAL APPROXIMATION, MAXDV, IS USED WHEN THE MAJOR PARTS ARE EQUAL).
044903,001993:
044904,001994: # UNDERSTANDING THAT A/B = Q + S(R/B) WHERE S = 2(-14) AND Q AND R ARE QUOTIENT AND REMAINDER, RESPEC-
044905,001995: # TIVELY, THE FOLLOWING APPROXIMATION IS OBTAINED BY MULTIPLYING ABOVE AND BELOW BY C - SD AND NEGLECTING TERMS OF
044906,001996: # ORDER S-SQUARED (POSSIBLY INTRODUCING ERROR INTO THE LOW TWO BITS OF THE RESULT). SIGN AGREEMENT IS UNNECESSARY.
044907,001997:
044908,001998: # A + SB . (R - QD) A + SB
044909,001999: # ------ = Q + S(------) WHERE Q AND R ARE QUOTIENT AND REMAINDER OF ------ RESPECTIVELY.
044910,002000: # C + SD ( C ) C
044911,002001:
044912,002002: 00,2570 52155 GENDDV DXCH MPAC # WE NEED A AND B ONLY FOR FIRST DV.
044913,002003: 00,2571 00006 +1 EXTEND # (SPECIAL UNIT PROLOGUE ENTERS HERE).
044914,002004: 00,2572 10130 DV BUF # A NOW CONTAINS Q AND L, R.
044915,002005: 00,2573 52155 DXCH MPAC
044916,002006:
044917,002007: 00,2574 40154 CS MPAC # FORM DIVIDEND FOR MINOR PART OF RESULT.
044918,002008: 00,2575 00006 EXTEND
044919,002009: 00,2576 70131 MP BUF +1
044920,002010: 00,2577 60155 AD MPAC +1 # OVERFLOW AT THIS POINT IS POSITIVE SINCE
044921,002011: 00,2600 54000 OVSK # R IS POSITIVE IN EVERY CASE.
044922,002012: 00,2601 12606 TCF +5
044923,002013:
044924,002014: 00,2602 00006 EXTEND # OVERFLOW CAN BE REMOVED BY SUBTRACTING C
044925,002015: 00,2603 60130 SU BUF # (BUF) ONCE SINCE R IS ALWAYS LESS THAN C
044926,002016: 00,2604 24154 INCR MPAC # IN THIS CASE. INCR COMPENSATES SUBTRACT.
044927,002017: 00,2605 12610 TCF +DOWN # (SINCE C(A) IS STILL POSITIVE).
044928,002018:
044929,002019: 00,2606 00006 +5 EXTEND # C(A) CAN BE MADE LESS THAN C IN MAGNI-
044930,002020: 00,2607 62620 BZMF -UP # TUDE BY DIMINISHING IT BY C (SINCE C IS
044931,002021: # NOT LESS THAN .5) UNLESS C(A) = 0.
044932,002022:
Page 1055 |
044934,002024: 00,2610 00006 +DOWN EXTEND
044935,002025: 00,2611 60130 SU BUF # IF POSITIVE, REDUCE ONLY IF NECESSARY
044936,002026: 00,2612 00006 EXTEND # SINCE THE COMPENSATING INCR MIGHT CAUSE
044937,002027: 00,2613 12616 BZF +3 # OVERFLOW.
044938,002028: 00,2614 00006 EXTEND # DONT SUBTRACT UNLESS RESULT IS POSITIVE
044939,002029: 00,2615 62624 BZMF ENDMAXDV # OR ZERO.
044940,002030:
044941,002031: 00,2616 24154 +3 INCR MPAC # KEEP SUBTRACT HERE AND COMPENSATE.
044942,002032: 00,2617 12625 TCF FINALDV
044943,002033:
044944,002034: 00,2620 00006 -UP EXTEND # IF ZERO, SET MINOR PART OF RESULT TO
044945,002035: 00,2621 12630 BZF FINALDV +3 # ZERO.
044946,002036:
044947,002037: 00,2622 00006 EXTEND # IF NEGATIVE, ADD C TO A, SUBTRACTING ONE
044948,002038: 00,2623 26154 DIM MPAC # TO COMPENSATE. DIM IS OK HERE SINCE THE
044949,002039: 00,2624 60130 ENDMAXDV AD BUF # MAJOR PART NEVER GOES NEGATIVE.
044950,002040:
Page 1056 |
044952,002042: 00,2625 22007 FINALDV ZL # DO DV TO OBTAIN MINOR PART OF RESULT.
044953,002043: 00,2626 00006 EXTEND
044954,002044: 00,2627 10130 DV BUF
044955,002045: 00,2630 54155 +3 TS MPAC +1
044956,002046:
044957,002047: 00,2631 10136 CCS DVSIGN # LEAVE RESULT POSITIVE UNLESS C(DVSIGN)=
044958,002048: 00,2632 00002 TC Q # -0.
044959,002049: 00,2633 00002 TC Q
044960,002050: 00,2634 00002 TC Q
044961,002051:
044962,002052: 00,2635 00006 EXTEND
044963,002053: 00,2636 40155 DCS MPAC
044964,002054: 00,2637 52155 DXCH MPAC
044965,002055: 00,2640 34755 CAF ZERO # SO WE ALWAYS RETURN WITH C(A) = 0.
044966,002056: 00,2641 00002 TC Q
044967,002057:
Page 1057 |
044969,002059: # IF THE MAJOR PARTS OF THE DIVISOR AND DIVIDEND ARE EQUAL, BUT THE MINOR PARTS ARE SUCH THAT THE
044970,002060: # DIVIDEND IS STRICTLY LESS THAN THE DIVISOR IN MAGNITUDE, THE FOLLOWING APPROXIMATION IS USED. THE ASSUMPTIONS
044971,002061: # ARE THE SAME AS THE GENERAL ROUTINE WITH THE ADDITION THAT SIGN AGREEMENT IS NECESSARY (B, C, & D POSITIVE).
044972,002062:
044973,002063: # C + SB . (C + B - D)
044974,002064: # ------ = 37777 + S(---------)
044975,002065: # C + SD ( C )
044976,002066:
044977,002067: # THE DIVISION MAY BE PERFORMED IMMEDIATELY SINCE B IS STRICTLY LESS THAN D AND C IS NOT LESS THAN .5.
044978,002068:
044979,002069:
044980,002070: 00,2642 40154 MAXDV CS MPAC # SEE IF MAXDV CASE STILL HOLDS AFTER
044981,002071: 00,2643 60130 AD BUF # NORMALIZATION.
044982,002072: 00,2644 00006 EXTEND
044983,002073: 00,2645 12647 BZF +2
044984,002074: 00,2646 12570 TCF GENDDV # MPAC NOW LESS THAN BUF - DIVIDE AS USUAL
044985,002075:
044986,002076: 00,2647 34733 +2 CAF POSMAX # SET MAJOR PART OF RESULT.
044987,002077: 00,2650 54154 TS MPAC
044988,002078:
044989,002079: 00,2651 40131 CS BUF +1 # FORM DIVIDEND OF MINOR PART OF RESULT.
044990,002080: 00,2652 60155 AD MPAC +1
044991,002081: 00,2653 12624 TCF ENDMAXDV # GO ADD C AND DO DIVIDE, ATTACHING SIGN
044992,002082: # BEFORE EXITING.
044993,002083:
Page 1058 |
044995,002085: # VECTOR DIVIDED BY SCALAR, V/SC, IS EXECUTED HERE. THE VECTOR IS NOW IN MPAC WITH SCALAR IN BUF.
044996,002086:
044997,002087: 00,2654 44753 V/SC2 CS ONE # INITIALIZE DIVIDEND NORMALIZATION COUNT
044998,002088: 00,2655 54137 TS DVNORMCT # AND DIVISION SIGN REGISTER.
044999,002089: 00,2656 54127 TS VBUF +5
045000,002090:
045001,002091: 00,2657 03010 TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
045002,002092:
045003,002093: 00,2660 52131 DXCH BUF
045004,002094: 00,2661 07547 TC ALSIGNAG # SIGN AGREE BUF
045005,002095: 00,2662 52131 DXCH BUF
045006,002096: 00,2663 10130 CCS BUF # FORCE DIVISOR POSITIVE WITH MAJOR PART
045007,002097: 00,2664 12721 TCF /BUF+ # NON-ZERO (IF POSSIBLE).
045008,002098: 00,2665 12667 TCF +2
045009,002099: 00,2666 12715 TCF /BUF-
045010,002100:
045011,002101: 00,2667 56131 XCH BUF +1 # SHIFT VECTOR AND SCALAR LEFT 14.
045012,002102: 00,2670 56130 XCH BUF
045013,002103: 00,2671 56155 XCH MPAC +1
045014,002104: 00,2672 56154 XCH MPAC
045015,002105: 00,2673 00006 EXTEND # CHECK FOR OVERFLOW IN EACH CASE.
045016,002106: 00,2674 12676 BZF +2
045017,002107: 00,2675 12405 TCF DVOVF
045018,002108:
045019,002109: 00,2676 56160 XCH MPAC +4
045020,002110: 00,2677 56157 XCH MPAC +3
045021,002111: 00,2700 00006 EXTEND
045022,002112: 00,2701 12703 BZF +2
045023,002113: 00,2702 12405 TCF DVOVF
045024,002114:
045025,002115: 00,2703 56162 XCH MPAC +6
045026,002116: 00,2704 56161 XCH MPAC +5
045027,002117: 00,2705 00006 EXTEND
045028,002118: 00,2706 12710 BZF +2
045029,002119: 00,2707 12405 TCF DVOVF
045030,002120:
045031,002121: 00,2710 10130 CCS BUF
045032,002122: 00,2711 12721 TCF /BUF+
045033,002123: 00,2712 12405 TCF DVOVF # ZERO DIVISOR - OVERFLOW.
045034,002124: 00,2713 12715 TCF /BUF-
045035,002125: 00,2714 12405 TCF DVOVF
045036,002126:
045037,002127: 00,2715 00006 /BUF- EXTEND # ON NEGATIVE, COMPLEMENT BUF AND MAINTAIN
045038,002128: 00,2716 40131 DCS BUF # DVSIGN IN VBUF +5.
045039,002129: 00,2717 52131 DXCH BUF
045040,002130: 00,2720 24127 INCR VBUF +5
045041,002131:
Page 1059 |
045043,002133: 00,2721 00006 /BUF+ EXTEND
045044,002134: 00,2722 30131 DCA BUF # LEAVE ABS(ORIG DIVISOR) IN BUF2
045045,002135: 00,2723 52134 DXCH BUF2 # FOR OVERFLOW TESTING
045046,002136: 00,2724 12732 TCF /NORM # NORMALIZE DIVISOR IN BUF.
045047,002137:
045048,002138: 00,2725 00006 /NORM2 EXTEND # IF LESS THAN .5, AUGMENT DVNORMCT AND
045049,002139: 00,2726 24137 AUG DVNORMCT # DOUBLE DIVISOR.
045050,002140: 00,2727 00006 EXTEND
045051,002141: 00,2730 30131 DCA BUF
045052,002142: 00,2731 20131 DAS BUF
045053,002143:
045054,002144: 00,2732 30130 /NORM CA BUF # SEE IF DIVISOR NORMALIZED.
045055,002145: 00,2733 60000 DOUBLE
045056,002146: 00,2734 54000 OVSK
045057,002147: 00,2735 12725 TCF /NORM2 # DOUBLE AND TRY AGAIN IF NOT.
045058,002148:
045059,002149: 00,2736 02750 TC V/SCDV # DO X COMPONENT DIVIDE.
045060,002150: 00,2737 52160 DXCH MPAC +3 # SUPPLY ARGUMENTS IN USUAL SEQUENCE.
045061,002151: 00,2740 52155 DXCH MPAC
045062,002152: 00,2741 52160 DXCH MPAC +3
045063,002153:
045064,002154: 00,2742 02750 TC V/SCDV # Y COMPONENT.
045065,002155: 00,2743 52162 DXCH MPAC +5
045066,002156: 00,2744 52155 DXCH MPAC
045067,002157: 00,2745 52162 DXCH MPAC +5
045068,002158:
045069,002159: 00,2746 02750 TC V/SCDV # Z COMPONENT.
045070,002160: 00,2747 17423 TCF VROTATEX # GO RE-ARRANGE COMPONENTS BEFORE EXIT.
045071,002161:
Page 1060 |
045073,002163: # SUBROUTINE USED BY V/SC TO DIVIDE VECTOR COMPONENT IN MPAC,+1 BY THE SCALAR GIVEN IN BUF.
045074,002164:
045075,002165: 00,2750 30127 V/SCDV CA VBUF +5 # REFLECTS SIGN OF SCALAR.
045076,002166: 00,2751 54136 TS DVSIGN
045077,002167:
045078,002168: 00,2752 10154 CCS MPAC # FORCE MPAC POSITIVE, EXITING ON ZERO.
045079,002169: 00,2753 12767 TCF /MPAC+
045080,002170: 00,2754 12756 TCF +2
045081,002171: 00,2755 12763 TCF /MPAC-
045082,002172:
045083,002173: 00,2756 10155 CCS MPAC +1
045084,002174: 00,2757 12767 TCF /MPAC+
045085,002175: 00,2760 00002 TC Q
045086,002176: 00,2761 12763 TCF /MPAC-
045087,002177: 00,2762 00002 TC Q
045088,002178:
045089,002179: 00,2763 00006 /MPAC- EXTEND # USUAL COMPLEMENTING AND SETTING OF SIGN.
045090,002180: 00,2764 40155 DCS MPAC
045091,002181: 00,2765 52155 DXCH MPAC
045092,002182: 00,2766 24136 INCR DVSIGN
045093,002183:
045094,002184: 00,2767 44753 /MPAC+ CS ONE # INITIALIZE NEAR-ONE SWITCH.
045095,002185: 00,2770 54140 TS MAXDVSW
045096,002186:
045097,002187: 00,2771 40154 CS MPAC # CHECK POSSIBLE OVERFLOW.
045098,002188: 00,2772 60133 AD BUF2 # UNNORMALIZED INPUT DIVISOR.
045099,002189: 00,2773 10000 CCS A
045100,002190: 00,2774 13004 TCF DDVCALL # NOT NEAR-ONE
045101,002191: 00,2775 12777 TCF +2 # +0 IS JUST POSSIBLE
045102,002192: 00,2776 12405 TCF DVOVF # NO HOPE
045103,002193: 00,2777 54140 TS MAXDVSW # SIGNAL POSSIBLE NEAR-ONE CASE
045104,002194: 00,3000 40155 CS MPAC +1 # SEE IF DIVISION CAN BE DONE
045105,002195: 00,3001 60134 AD BUF2 +1
045106,002196: 00,3002 00006 EXTEND
045107,002197: 00,3003 62405 BZMF DVOVF
045108,002198:
045109,002199: 00,3004 52155 DDVCALL DXCH MPAC # CALL PRE-DIVIDE NORMALIZATION.
045110,002200: 00,3005 50137 INDEX DVNORMCT
045111,002201: 00,3006 12565 TCF MAXTEST
045112,002202:
Page 1061 |
045114,002204: 00,3007 32506 SLOPELO DEC .8324
045115,002205:
045116,002206: 00,3010 56002 VECAGREE XCH Q # SAVE Q IN A
045117,002207: 00,3011 52155 DXCH MPAC
045118,002208: 00,3012 07547 TC ALSIGNAG # SIGNAGREE MPAC
045119,002209: 00,3013 52155 DXCH MPAC
045120,002210: 00,3014 52160 DXCH MPAC +3
045121,002211: 00,3015 07547 TC ALSIGNAG # SIGN AGREE MPAC +3
045122,002212: 00,3016 52160 DXCH MPAC +3
045123,002213: 00,3017 52162 DXCH MPAC +5
045124,002214: 00,3020 07547 TC ALSIGNAG # SIGNAGREE MPAC +5
045125,002215: 00,3021 52162 DXCH MPAC +5
045126,002216: 00,3022 00000 TC A
045127,002217:
Page 1062 |
045129,002219: # THE FOLLOWING ROUTINE EXECUTES THE UNIT INSTRUCTION, WHICH TAKES THE UNIT OF THE VECTOR IN MPAC.
045130,002220:
045131,002221: 00,3023 03010 UNIT TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
045132,002222: 00,3024 07535 TC MPACVBUF # SAVE ARGUMENT IN VBUF
045133,002223: 00,3025 34755 CAF ZERO # MUST SENSE OVERFLOW IN FOLLOWING DOT.
045134,002224: 00,3026 56121 XCH OVFIND
045135,002225: 00,3027 54141 TS TEM1
045136,002226: 00,3030 03317 TC VSQSUB # DOT MPAC WITH ITSELF.
045137,002227: 00,3031 30141 CA TEM1
045138,002228: 00,3032 56121 XCH OVFIND
045139,002229: 00,3033 00006 EXTEND
045140,002230: 00,3034 13036 BZF +2
045141,002231: 00,3035 12405 TCF DVOVF
045142,002232: 00,3036 00006 EXTEND
045143,002233: 00,3037 30155 DCA MPAC # LEAVE THE SQUARE OF THE LENGTH OF THE
045144,002234: 00,3040 50120 INDEX FIXLOC # ARGUMENT IN LVSQUARE.
045145,002235: 00,3041 52043 DXCH LVSQUARE
045146,002236:
045147,002237: 00,3042 03343 TC SQRTSUB # GO TAKE THE NORMALIZED SQUARE ROOT.
045148,002238:
045149,002239: 00,3043 10154 CCS MPAC # CHECK FOR UNIT OVERFLOW.
045150,002240: 00,3044 13051 TCF +5 # MPAC IS NOT LESS THAN .5 UNLESS
045151,002241: 00,3045 54001 TS L
045152,002242: 00,3046 50120 INDEX FIXLOC
045153,002243: 00,3047 52045 DXCH LV
045154,002244: 00,3050 12405 TCF DVOVF # INPUT TO SQRTSUB WAS 0.
045155,002245:
045156,002246: 00,3051 44317 CS FOURTEEN # SEE IF THE INPUT WAS SO SMALL THE THE
045157,002247: 00,3052 60135 AD MPTEMP # FIRST TWO REGISTERS OF THE SQUARE WERE 0
045158,002248: 00,3053 10000 CCS A
045159,002249: 00,3054 40000 COM # IF SO, SAVE THE NEGATIVE OF THE SHIFT
045160,002250: 00,3055 13133 TCF SMALL # COUNT -15D.
045161,002251:
045162,002252: 00,3056 13065 TCF LARGE # (THIS IS USUALLY THE CASE.)
045163,002253:
045164,002254: 00,3057 44761 CS THIRTEEN # IF THE SHIFT COUNT WAS EXACTLY 14, SET
045165,002255: 00,3060 54135 TS MPTEMP # THE PRE-DIVIDE NORM COUNT TO -13D.
045166,002256:
045167,002257: 00,3061 30154 CA MPAC # SHIFT THE LENGTH RIGHT 14 BEFORE STORING
045168,002258: 00,3062 54001 SMALL2 TS L # (SMALL EXITS TO THIS POINT).
045169,002259: 00,3063 34755 CAF ZERO
045170,002260: 00,3064 13112 TCF LARGE2 # GO TO STORE LENGTH AND PROCEED.
045171,002261:
045172,002262: 00,3065 10135 LARGE CCS MPTEMP # MOST ALL CASES COME HERE.
045173,002263: 00,3066 13074 TCF LARGE3 # SEE IF NO NORMALIZATION WAS REQUIRED BY
045174,002264:
045175,002265: 00,3067 42024 CS SRDDV # SQRT, AND IF SO, SET UP FOR A SHIFT
045176,002266: 00,3070 54135 TS MPTEMP # RIGHT 1 BEFORE DIVIDING TO PRODUCE
045177,002267: 00,3071 00006 EXTEND # THE DESIRED HALF UNIT VECTOR.
045178,002268: 00,3072 30155 DCA MPAC
045179,002269:
Page 1063 |
045181,002271: 00,3073 13112 TCF LARGE2
045182,002272:
Page 1064 |
045184,002274: 00,3074 40000 LARGE3 COM # LEAVE NEGATIVE OF SHIFT COUNT-1 FOR
045185,002275: 00,3075 54135 TS MPTEMP # PREDIVIDE LEFT SHIFT.
045186,002276:
045187,002277: 00,3076 40000 COM # PICK UP REQUIRED SHIFTING BIT TO UNNORM-
045188,002278: 00,3077 50000 INDEX A # ALIZE THE SQRT RESULT.
045189,002279: 00,3100 34736 CAF BIT14
045190,002280: 00,3101 54130 TS BUF
045191,002281: 00,3102 00006 EXTEND
045192,002282: 00,3103 70155 MP MPAC +1
045193,002283: 00,3104 56130 XCH BUF
045194,002284: 00,3105 00006 EXTEND # (UNNORMALIZE THE SQRT FOR LV).
045195,002285: 00,3106 70154 MP MPAC
045196,002286: 00,3107 56001 XCH L
045197,002287: 00,3110 60130 AD BUF
045198,002288: 00,3111 56001 XCH L
045199,002289:
045200,002290: 00,3112 50120 LARGE2 INDEX FIXLOC
045201,002291: 00,3113 52045 DXCH LV # LENGTH NOW STORED IN WORK AREA.
045202,002292:
045203,002293: 00,3114 44753 CS ONE
045204,002294: 00,3115 54140 TS MAXDVSW # NO MAXDV CASES IN UNIT.
045205,002295:
045206,002296: 00,3116 52123 DXCH VBUF # PREPARE X COMPONENT FOR DIVIDE, SETTING
045207,002297: 00,3117 52155 DXCH MPAC # LENGTH OF VECTOR AS DIVISOR IN BUF.
045208,002298: 00,3120 52131 DXCH BUF
045209,002299: 00,3121 03151 TC UNITDV
045210,002300:
045211,002301: 00,3122 52125 DXCH VBUF +2 # DO Y AND Z IN USUAL FASHION SO WE CAN
045212,002302: 00,3123 52155 DXCH MPAC # EXIT THROUGH VROTATEX.
045213,002303: 00,3124 52160 DXCH MPAC +3
045214,002304: 00,3125 03151 TC UNITDV
045215,002305:
045216,002306: 00,3126 52127 DXCH VBUF +4
045217,002307: 00,3127 52155 DXCH MPAC
045218,002308: 00,3130 52162 DXCH MPAC +5
045219,002309: 00,3131 03151 TC UNITDV
045220,002310: 00,3132 17423 TCF VROTATEX # AND EXIT.
045221,002311:
Page 1065 |
045223,002313: # IF THE LENGTH OF THE ARGUMENT VECTOR WAS LESS THAN 2(-28), EACH COMPONENT MUST BE SHIFTED LEFT AT LEAST
045224,002314: # 14 PLACES BEFORE THE DIVIDE. NOTE THAT IN THIS CASE, THE MAJOR PART OF EACH COMPONENT IS ZERO.
045225,002315:
045226,002316: 00,3133 54135 SMALL TS MPTEMP # NEGATIVE OF PRE-DIVIDE SHIFT COUNT.
045227,002317:
045228,002318: 00,3134 34755 CAF ZERO # SHIFT EACH COMPONENT LEFT 14.
045229,002319: 00,3135 56123 XCH VBUF +1
045230,002320: 00,3136 56122 XCH VBUF
045231,002321: 00,3137 56125 XCH VBUF +3
045232,002322: 00,3140 56124 XCH VBUF +2
045233,002323: 00,3141 56127 XCH VBUF +5
045234,002324: 00,3142 56126 XCH VBUF +4
045235,002325:
045236,002326: 00,3143 40135 CS MPTEMP
045237,002327: 00,3144 50000 INDEX A
045238,002328: 00,3145 34736 CAF BIT14
045239,002329: 00,3146 00006 EXTEND
045240,002330: 00,3147 70154 MP MPAC
045241,002331: 00,3150 13062 TCF SMALL2
045242,002332:
045243,002333: 00,3151 4761 THIRTEEN = OCT15
045244,002334: 00,3151 4317 FOURTEEN = OCT16
045245,002335: 00,3151 4317 OCT16 = R1D1
045246,002336:
Page 1066 |
045248,002338: # THE FOLLOWING ROUTINE SETS UP THE CALL TO THE DIVIDE ROUTINES.
045249,002339:
045250,002340: 00,3151 10154 UNITDV CCS MPAC # FORCE MPAC POSITIVE IF POSSIBLE, SETTING
045251,002341: 00,3152 13170 TCF UMPAC+ # DVSIGN ACCORDING TO THE SIGN OF MPAC
045252,002342: 00,3153 13155 TCF +2 # SINCE THE DIVISOR IS ALWAYS POSITIVE
045253,002343: 00,3154 13162 TCF UMPAC- # HERE.
045254,002344:
045255,002345: 00,3155 10155 CCS MPAC +1
045256,002346: 00,3156 13170 TCF UMPAC+
045257,002347: 00,3157 00002 TC Q # EXIT IMMEDIATELY ON ZERO.
045258,002348: 00,3160 13162 TCF UMPAC-
045259,002349: 00,3161 00002 TC Q
045260,002350:
045261,002351: 00,3162 44755 UMPAC- CS ZERO # IF NEGATIVE, SET -0 IN DVSIGN FOR FINAL
045262,002352: 00,3163 54136 TS DVSIGN # COMPLEMENT.
045263,002353: 00,3164 00006 EXTEND
045264,002354: 00,3165 40155 DCS MPAC # PICK UP ABSOLUTE VALUE OF ARG AND JUMP.
045265,002355: 00,3166 50135 INDEX MPTEMP
045266,002356: 00,3167 12564 TCF MAXTEST -1
045267,002357:
045268,002358: 00,3170 54136 UMPAC+ TS DVSIGN # SET DVSIGN FOR POSITIVE QUOTIENT.
045269,002359: 00,3171 52155 DXCH MPAC
045270,002360: 00,3172 50135 INDEX MPTEMP
045271,002361: 00,3173 12564 TCF MAXTEST -1
045272,002362:
Page 1067 |
045274,002364: # MISCELLANEOUS UNARY OPERATIONS.
045275,002365:
045276,002366: 00,3174 03300 DSQ TC DSQSUB # SQUARE THE DP CONTENTS OF MPAC.
045277,002367: 00,3175 16064 TCF DANZIG
045278,002368:
045279,002369: 00,3176 10163 ABVALABS CCS MODE # ABVAL OR ABS INSTRUCTION.
045280,002370: 00,3177 13226 TCF ABS # DO ABS ON SCALAR.
045281,002371: 00,3200 13226 TCF ABS
045282,002372:
045283,002373: 00,3201 03317 ABVAL TC VSQSUB # DOT MPAC WITH ITSELF.
045284,002374: 00,3202 22163 LXCH MODE # MODE IS NOW DP (L ZERO AFTER DAS).
045285,002375:
045286,002376: 00,3203 00006 EXTEND # STORE SQUARE OF LENGTH IN WORK AREA.
045287,002377: 00,3204 30155 DCA MPAC
045288,002378: 00,3205 50120 INDEX FIXLOC
045289,002379: 00,3206 52043 DXCH LVSQUARE
045290,002380:
Page 1068 |
045292,002382: # PROGRAM DESCRIPTION- SUBROUTINE SQRT
045293,002383: # FUNCTIONAL DESCRIPTION-DOUBLE PRECISION SQUARE ROOT ROUTINE
045294,002384: # THIS PROGRAM TAKES THE SQUARE ROOT OF THE 27 OR 28 MOST SIGNIFICANT BITS IN THE TRIPLE PRECISION SET OF
045295,002385: # NUMBERS-MPAC,MPAC+1,AND MPAC+2. THE ROOT IS RETURNED DOUBLE PRECISION IN MPAC AND MPAC+1.
045296,002386: # WARNING- THIS SUBROUTINE USES A TRIPLE PRECISION INPUT. THE PROGRAMMER MUST ASSURE THE CONTENTS OF MPAC+2
045297,002387: # ESPECIALLY IF THE CONTENTS OF MPAC IS SMALL OR ZERO. FOR DETAILS SEE STG MEMO NO.949.
045298,002388: # CALLING SEQUENCE- IN INTERPRETIVE MODE I.E., FOLLOWING TC INTPRET,SQRT NO ADDRESS IS ALLOWED
045299,002389: # INPUT SCALING THE BINARY POINT IS ASSUMED TO THE RIGHT OF BIT 15. THE ANSWER IS RETURNED WITH THE SAME SCALING
045300,002390: # SUBROUTINES- GENSCR,MPACSHR, SQRTSUB,ABORT
045301,002391: # ABORT EXIT MODE- ABORTS ON NEGATIVE INPUT -1.2X10E-4 (77775 OCTAL) OR LESS.
045302,002392: # DISPLAYS ERROR CODE 1302
045303,002393: # TC ABORT
045304,002394: # OCT 1302
045305,002395: # DEBRIS - LOCATIONS BUF,MPTEMP,ADDRWD ARE USED
045306,002396: 00,3207 03343 SQRT TC SQRTSUB # TAKE THE SQUARE ROOT OF MPAC.
045307,002397: 00,3210 10135 CCS MPTEMP # RETURNED NORMALIZED SQUARE ROOT. SEE IF
045308,002398: 00,3211 13213 TCF +2 # ANY UN-NORMALIZATION REQUIRED AND EXIT
045309,002399: 00,3212 16064 TCF DANZIG # IF NOT.
045310,002400:
045311,002401: 00,3213 63733 AD NEG12 # A RIGHT SHIFT OF MORE THAN 13 COULD BE
045312,002402: 00,3214 00006 EXTEND # REQUIRED IF INPUT WAS ZERO IN MPAC,+1.
045313,002403: 00,3215 63221 BZMF SQRTSHFT # GOES HERE IN MOST CASES.
045314,002404: 00,3216 22007 ZL # IF A LONG SHIFT IS REQUIRED, GO TO
045315,002405: 00,3217 22116 LXCH ADDRWD # GENERAL RIGHT SHIFT ROUTINES.
045316,002406: 00,3220 12303 TCF GENSCR +4 # ADDRWD WAS ZERO TO PREVENT ROUND.
045317,002407:
045318,002408: 00,3221 50135 SQRTSHFT INDEX MPTEMP # SELECT SHIFTING BIT AND EXIT THROUGH
045319,002409: 00,3222 34735 CAF BIT15 # SHIFT ROUTINES.
045320,002410: 00,3223 54135 TS MPTEMP
045321,002411: 00,3224 34755 CAF ZERO # TO ZERO MPAC +2 IN THE PROCESS.
045322,002412: 00,3225 12036 TCF MPACSHR +3
045323,002413:
045324,002414: 00,3226 06726 ABS TC BRANCH # TEST SIGN OF MPAC AND COMPLEMENT IF
045325,002415: 00,3227 16064 TCF DANZIG
045326,002416: 00,3230 16064 TCF DANZIG
045327,002417: 00,3231 17673 TCF COMP
045328,002418:
Page 1069 |
045330,002420: 00,3232 44751 VDEF CS FOUR # VECTOR DEFINE - ESSENTIALLY TREATS
045331,002421: 00,3233 26166 ADS PUSHLOC # SCALAR IN MPAC AS X COMPONENT, PUSHES UP
045332,002422: 00,3234 00006 EXTEND # FOR Y AND THEN AGAIN FOR Z.
045333,002423: 00,3235 50000 INDEX A
045334,002424: 00,3236 30003 DCA 2
045335,002425: 00,3237 52160 DXCH MPAC +3
045336,002426: 00,3240 00006 EXTEND
045337,002427: 00,3241 50166 INDEX PUSHLOC
045338,002428: 00,3242 30001 DCA 0
045339,002429: 00,3243 52162 DXCH MPAC +5
045340,002430: 00,3244 16524 TCF VMODE # MODE IS NON VECTOR.
045341,002431:
045342,002432: 00,3245 03317 VSQ TC VSQSUB # DOT MPAC WITH ITSELF.
045343,002433: 00,3246 17335 TCF DMODE # MODE IS NOW DP.
045344,002434:
045345,002435: 00,3247 00006 PUSH EXTEND # PUSH DOWN MPAC LEAVING IT LOADED.
045346,002436: 00,3250 30155 DCA MPAC
045347,002437: 00,3251 50166 INDEX PUSHLOC # PUSH DOWN FIRST TWO REGISTERS IN EACH
045348,002438: 00,3252 52001 DXCH 0
045349,002439:
045350,002440: 00,3253 50163 INDEX MODE # INCREMENT PUSHDOWN POINTER.
045351,002441: 00,3254 36247 CAF NO.WDS
045352,002442: 00,3255 26166 ADS PUSHLOC
045353,002443:
045354,002444: 00,3256 10163 CCS MODE
045355,002445: 00,3257 13272 TCF TPUSH # PUSH DOWN MPAC +2.
045356,002446: 00,3260 16064 TCF DANZIG # DONE FOR DP.
045357,002447:
045358,002448: 00,3261 00006 EXTEND # ON VECTOR, PUSH DOWN Y AND Z COMPONENTS.
045359,002449: 00,3262 30160 DCA MPAC +3
045360,002450: 00,3263 50166 INDEX PUSHLOC
045361,002451: 00,3264 51775 DXCH 0 -4
045362,002452: 00,3265 00006 EXTEND
045363,002453: 00,3266 30162 DCA MPAC +5
045364,002454: 00,3267 50166 INDEX PUSHLOC
045365,002455: 00,3270 51777 DXCH 0 -2
045366,002456: 00,3271 16064 TCF DANZIG
045367,002457:
045368,002458: 00,3272 30156 TPUSH CA MPAC +2
045369,002459: 00,3273 16557 TCF ENDTPUSH +2
045370,002460:
045371,002461: 00,3274 50120 RVQ INDEX FIXLOC # RVQ - RETURN IVA QPRET.
045372,002462: 00,3275 30052 CA QPRET
045373,002463: 00,3276 54117 TS POLISH
045374,002464: 00,3277 16655 TCF GOTO +4 # (ASSUME QPRET POINTS TO FIXED ONLY.)
045375,002465:
Page 1070 |
045377,002467: # THE FOLLOWING SUBROUTINES ARE USED IN SQUARING MPAC, IN BOTH THE SCALAR AND VECTOR SENSE. THEY ARE
045378,002468: # SPECIAL CASES OF DMPSUB AND DOTSUB, PUT IN TO SAVE SOME TIME.
045379,002469:
045380,002470: 00,3300 30155 DSQSUB CA MPAC +1 # SQUARES THE SCALAR CONTENTS OF MPAC.
045381,002471: 00,3301 00006 EXTEND
045382,002472: 00,3302 70000 SQUARE
045383,002473: 00,3303 54156 TS MPAC +2
045384,002474: 00,3304 34755 CAF ZERO # FORM 2(CROSS TERM).
045385,002475: 00,3305 56155 XCH MPAC +1
045386,002476: 00,3306 00006 EXTEND
045387,002477: 00,3307 70154 MP MPAC
045388,002478: 00,3310 20001 DDOUBL # AND MAYBE OVERFLOW.
045389,002479: 00,3311 20156 DAS MPAC +1 # AND SET A TO NET OVERFLOW.
045390,002480: 00,3312 56154 XCH MPAC
045391,002481: 00,3313 00006 EXTEND
045392,002482: 00,3314 70000 SQUARE
045393,002483: 00,3315 20155 DAS MPAC
045394,002484: 00,3316 00002 TC Q
045395,002485:
045396,002486: 00,3317 00006 VSQSUB EXTEND # DOTS THE VECTOR IN MPAC WITH ITSELF.
045397,002487: 00,3320 22137 QXCH DOTRET
045398,002488: 00,3321 03300 TC DSQSUB # SQUARE THE X COMPONENT.
045399,002489: 00,3322 52160 DXCH MPAC +3
045400,002490: 00,3323 52155 DXCH MPAC
045401,002491: 00,3324 52131 DXCH BUF # SO WE CAN END IN DOTSUB.
045402,002492: 00,3325 30156 CA MPAC +2
045403,002493: 00,3326 54132 TS BUF +2
045404,002494:
045405,002495: 00,3327 03300 TC DSQSUB # SQUARE Y COMPONENT.
045406,002496: 00,3330 52156 DXCH MPAC +1
045407,002497: 00,3331 20132 DAS BUF +1
045408,002498: 00,3332 60154 AD MPAC
045409,002499: 00,3333 60130 AD BUF
045410,002500: 00,3334 54130 TS BUF
045411,002501: 00,3335 13337 TCF +2
045412,002502: 00,3336 54121 TS OVFIND # IF OVERFLOW.
045413,002503:
045414,002504: 00,3337 52162 DXCH MPAC +5
045415,002505: 00,3340 52155 DXCH MPAC
045416,002506: 00,3341 03300 TC DSQSUB # SQUARE Z COMPONENT.
045417,002507: 00,3342 17210 TCF ENDDOT # END AS IN DOTSUB.
045418,002508:
Page 1071 |
045420,002510: # DOUBLE PRECISION SQUARE ROOT ROUTINE. TAKE THE SQUARE ROOT OF THE TRIPLE PRECISION (MPAC +2 USED ONLY
045421,002511: # IN NORMALIZATION) CONTENTS OF MPAC AND LEAVE THE NORMALIZED RESULT IN MPAC (C(MPAC) GREATER THAN OR EQUAL TO
045422,002512: # .5). THE RIGHT SHIFT COUNT (TO UNNORMALIZE) IS LEFT IN MPTEMP.
045423,002513:
045424,002514:
045425,002515: 00,3343 34755 SQRTSUB CAF ZERO # START BY ZEROING RIGHT SHIFT COUNT.
045426,002516: 00,3344 54135 TS MPTEMP
045427,002517:
045428,002518: 00,3345 10154 CCS MPAC # CHECK FOR POSITIVE ARGUMENT, SHIFTING
045429,002519: 00,3346 13405 TCF SMPAC+ # FIRST SIGNIFICANT MPAC REGISTER INTO
045430,002520: 00,3347 13351 TCF +2 # MPAC ITSELF.
045431,002521: 00,3350 13373 TCF SQRTNEG # SEE IF MAG OF ARGUMENT LESS THAN 10(-4).
045432,002522:
045433,002523: 00,3351 56156 XCH MPAC +2 # MPAC IS ZERO - SHIFT LEFT 14.
045434,002524: 00,3352 56155 XCH MPAC +1
045435,002525: 00,3353 54154 TS MPAC
045436,002526: 00,3354 34757 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
045437,002527: 00,3355 54135 TS MPTEMP
045438,002528:
045439,002529: 00,3356 10154 CCS MPAC # SEE IF MPAC NOW PNZ.
045440,002530: 00,3357 13405 TCF SMPAC+
045441,002531: 00,3360 13362 TCF +2
045442,002532: 00,3361 13376 TCF ZEROANS # NEGATIVE BUT LESS THAN 10(-4) IN MAG.
045443,002533:
045444,002534: 00,3362 56155 XCH MPAC +1 # ZERO - SHIFT LEFT 14 AGAIN.
045445,002535: 00,3363 54154 TS MPAC
045446,002536: 00,3364 34757 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
045447,002537: 00,3365 26135 ADS MPTEMP
045448,002538:
045449,002539: 00,3366 10154 CCS MPAC
045450,002540: 00,3367 13405 TCF SMPAC+
045451,002541: 00,3370 00002 TC Q # SQRT(0) = 0.
045452,002542: 00,3371 13376 TCF ZEROANS
045453,002543: 00,3372 13453 TCF FIXROOT # DO NOT LEAVE SQRTSUB WITH -0 IN MPAC.
045454,002544:
045455,002545:
045456,002546: 00,3373 10000 SQRTNEG CCS A # ARGUMENT IS NEGATIVE, BUT SEE IF SIGN-
045457,002547: 00,3374 13402 TCF SQRTABRT # CORRECTED ARGUMENT IS LESS THAN 10(-4)
045458,002548:
045459,002549: 00,3375 10155 CCS MPAC +1 # IN MAGNITUDE. IF SO, CALL ANSWER ZERO.
045460,002550: 00,3376 34755 ZEROANS CAF ZERO # FORCE ANSWER TO ZERO HERE.
045461,002551: 00,3377 13453 TCF FIXROOT
045462,002552: 00,3400 13402 TCF SQRTABRT
045463,002553: 00,3401 13453 TCF FIXROOT
045464,002554:
045465,002555: 00,3402 52165 SQRTABRT DXCH LOC
045466,002556: 00,3403 05716 TC POODOO1
045467,002557: 00,3404 21302 OCT 21302
045468,002558:
045469,002559: 00,3405 62444 SMPAC+ AD -1/2+2 # SEE IF ARGUMENT GREATER THAN OR EQUAL TO
045470,002560:
Page 1072 |
045472,002562: 00,3406 00006 EXTEND # .5.
045473,002563: 00,3407 63456 BZMF SRTEST # IF SO, SEE IF LESS THAN .25.
045474,002564:
045475,002565: 00,3410 52155 DXCH MPAC # WE WILL TAKE THE SQUARE ROOT OF MPAC/2.
045476,002566: 00,3411 22021 LXCH SR # SHIFT RIGHT 1 AND GO TO THE SQRT ROUTINE
045477,002567: 00,3412 00006 EXTEND
045478,002568: 00,3413 74736 MP HALF
045479,002569: 00,3414 52155 DXCH MPAC
045480,002570: 00,3415 56021 XCH SR
045481,002571: 00,3416 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
045482,002572:
045483,002573: 00,3417 32314 ARGHI CAF SLOPEHI # ARGUMENT BETWEEN .25 AND .5. GET A
045484,002574: 00,3420 00006 EXTEND # LINEAR APPROXIMATION FOR THIS RANGE.
045485,002575: 00,3421 70154 MP MPAC
045486,002576: 00,3422 62566 AD BIASHI # X0/2 = (MPAC/2)(SLOPEHI) + BIASHI/2.
045487,002577:
045488,002578: 00,3423 54130 +4 TS BUF # X0/2 (ARGLO ENTERS HERE).
045489,002579: 00,3424 30154 CA MPAC # SINGLE-PRECISION THROUGHOUT.
045490,002580: 00,3425 22007 ZL
045491,002581: 00,3426 00006 EXTEND
045492,002582: 00,3427 10130 DV BUF # (MPAC/2)/(X0/2)
045493,002583: 00,3430 00006 EXTEND
045494,002584: 00,3431 74736 MP HALF
045495,002585: 00,3432 26130 ADS BUF # X1 = X0/2 + .5(MPAC/2)/(X0/2).
045496,002586:
045497,002587: 00,3433 00006 EXTEND
045498,002588: 00,3434 74736 MP HALF # FORM UP X1/2.
045499,002589: 00,3435 52155 DXCH MPAC # SAVE AND BRING OUT ARGUMENT.
045500,002590: 00,3436 00006 EXTEND # TAKE DP QUOTIENT WITH X1.
045501,002591: 00,3437 10130 DV BUF
045502,002592: 00,3440 54131 TS BUF +1 # SAVE MAJOR PART OF QUOTIENT.
045503,002593: 00,3441 34755 CAF ZERO # FORM MINOR PART OF QUOTIENT USING
045504,002594: 00,3442 56001 XCH L # (REMAINDER,0).
045505,002595: 00,3443 00006 EXTEND
045506,002596: 00,3444 10130 DV BUF
045507,002597: 00,3445 54001 TS L # IN PREPARATION FOR DAS.
045508,002598: 00,3446 30131 CA BUF +1
045509,002599: 00,3447 20155 DAS MPAC # X2 = X1/2 + (MPAC/2)X1
045510,002600:
045511,002601: 00,3450 00006 EXTEND # OVERFLOWS IF ARG. NEAR POSMAX.
045512,002602: 00,3451 13455 BZF TCQBNK00
045513,002603: 00,3452 34733 CAF POSMAX
045514,002604: 00,3453 54154 FIXROOT TS MPAC
045515,002605: 00,3454 54155 TS MPAC +1
045516,002606: 00,3455 00002 TCQBNK00 TC Q # RETURN TO CALLER TO UNNORMALIZE, ETC.
045517,002607:
Page 1073 |
045519,002609: 00,3456 64737 SRTEST AD QUARTER # ARGUMENT WAS LESS THAN .5, SEE IF LESS
045520,002610: 00,3457 00006 EXTEND # THAN .25.
045521,002611: 00,3460 63502 BZMF SQRTNORM # IF SO, BEGIN NORMALIZATION.
045522,002612:
045523,002613: 00,3461 52155 DXCH MPAC # IF BETWEEN .5 AND .25, SHIFT RIGHT 1 AND
045524,002614: 00,3462 22021 LXCH SR # START AT ARGLO.
045525,002615: 00,3463 00006 EXTEND
045526,002616: 00,3464 74736 MP HALF
045527,002617: 00,3465 52155 DXCH MPAC
045528,002618: 00,3466 56021 XCH SR
045529,002619: 00,3467 26155 ADS MPAC +1 # NO OVERFLOW.
045530,002620:
045531,002621: 00,3470 33007 ARGLO CAF SLOPELO # (NORMALIZED) ARGUMENT BETWEEN .125 AND
045532,002622: 00,3471 00006 EXTEND # .25
045533,002623: 00,3472 70154 MP MPAC
045534,002624: 00,3473 62270 AD BIASLO
045535,002625: 00,3474 13423 TCF ARGHI +4 # BEGIN SQUARE ROOT.
045536,002626:
045537,002627: 00,3475 00006 SQRTNM2 EXTEND # SHIFT LEFT 2 AND INCREMENT RIGHT SHIFT
045538,002628: 00,3476 30156 DCA MPAC +1 # COUNT (FOR TERMINAL UNNORMALIZATION).
045539,002629: 00,3477 20156 DAS MPAC +1
045540,002630: 00,3500 60154 AD MPAC
045541,002631: 00,3501 26154 ADS MPAC # (NO OVERFLOW).
045542,002632:
045543,002633: 00,3502 24135 SQRTNORM INCR MPTEMP # FIRST TIME THROUGH, JUST SHIFT LEFT 1
045544,002634: 00,3503 00006 EXTEND # (PUTS IN EFFECTIVE RIGHT SHIFT SINCE
045545,002635: 00,3504 30156 DCA MPAC +1 # WE WANT MPAC/2).
045546,002636: 00,3505 20156 DAS MPAC +1
045547,002637: 00,3506 60154 AD MPAC
045548,002638: 00,3507 26154 ADS MPAC # (AGAIN NO OVERFLOW).
045549,002639: 00,3510 60000 DOUBLE
045550,002640: 00,3511 54022 TS CYL
045551,002641:
045552,002642: 00,3512 10022 NORMTEST CCS CYL # SEE IF ARGUMENT NOW NORMALIZED AT
045553,002643: 00,3513 10022 CCS CYL # GREATER THAN .125.
045554,002644: 00,3514 13475 TCF SQRTNM2 # NO - SHIFT LEFT 2 MORE AND TRY AGAIN.
045555,002645: 00,3515 13417 TCF ARGHI # YES - NOW BETWEEN .5 AND .25.
045556,002646: 00,3516 13470 TCF ARGLO # ARGUMENT NOW BETWEEN .25 AND .125.
045557,002647:
Page 1074 |
045559,002649: # TRIGONOMETRIC FUNCTION PACKAGE.
045560,002650:
045561,002651: # THE FOLLOWING TRIGONOMETRIC FUNCTIONS ARE AVAILABLE AS INTERPRETIVE OPERATIONS:
045562,002652:
045563,002653: # 1. SIN COMPUTES (1/2)SINE(2 PI MPAC).
045564,002654: # 2. COS COMPUTES (1/2)COSINE(2 PI MPAC).
045565,002655:
045566,002656: # 3. ASIN COMPUTES (1/2PI)ARCSINE(2 MPAC).
045567,002657: # 4. ACOS COMPUTES (1/2PI)ARCCOSINE(2 MPAC).
045568,002658:
045569,002659: # SIN-ASIN AND COS-ACOS ARE MUTUALLY INVERSE, IE SIN(ASIN(X)) = X.
045570,002660:
045571,002661:
045572,002662: 00,3517 06726 COSINE TC BRANCH # FINDS COSINE USING THE IDENTITY
045573,002663: 00,3520 13523 TCF +3 # COS(X) = SIN(PI/2 - ABS(X)).
045574,002664: 00,3521 13526 TCF PRESINE
045575,002665: 00,3522 13526 TCF PRESINE
045576,002666:
045577,002667: 00,3523 00006 +3 EXTEND
045578,002668: 00,3524 40155 DCS MPAC
045579,002669: 00,3525 52155 DXCH MPAC
045580,002670:
045581,002671: 00,3526 34737 PRESINE CAF QUARTER # PI/2 SCALED.
045582,002672: 00,3527 26154 ADS MPAC
045583,002673:
045584,002674:
045585,002675: 00,3530 52155 SINE DXCH MPAC # DOUBLE ARGUMENT.
045586,002676: 00,3531 20001 DDOUBL
045587,002677: 00,3532 54000 OVSK # SEE IF OVERFLOW PRESENT.
045588,002678: 00,3533 13536 TCF +3 # IF NOT, ARGUMENT OK AS IS.
045589,002679:
045590,002680: 00,3534 00006 EXTEND # IF SO, WE LOST (OR GAINED) PI, SO
045591,002681: 00,3535 40001 DCOM # COMPLEMENT MPAC USING THE IDENTITY
045592,002682: # SIN(X-(+)PI) = SIN(-X).
045593,002683: 00,3536 52155 +3 DXCH MPAC
045594,002684: 00,3537 30154 CA MPAC # SEE IF ARGUMENT GREATER THAN .5 IN
045595,002685: 00,3540 60000 DOUBLE # MAGNITUDE. IF SO, REDUCE IT TO LESS THAN
045596,002686: 00,3541 54001 TS L # .5 (+-PI/2 SCALED) AS FOLLOWS:
045597,002687: 00,3542 13553 TCF SN1
045598,002688:
045599,002689: 00,3543 50000 INDEX A # IF POSITIVE, FORM PI - X, IF NEGATIVE
045600,002690: 00,3544 34735 CAF NEG1/2 +1 # USE -PI -X.
045601,002691: 00,3545 60000 DOUBLE
045602,002692: 00,3546 00006 EXTEND
045603,002693: 00,3547 60154 SU MPAC # GUARANTEED NO OVERFLOW.
045604,002694: 00,3550 54154 TS MPAC
045605,002695: 00,3551 40155 CS MPAC +1
045606,002696: 00,3552 54155 TS MPAC +1
045607,002697:
Page 1075 |
045609,002699: 00,3553 00006 SN1 EXTEND # SET UP TO EVALUATE HASTINGS POLYNOMIAL
045610,002700: 00,3554 30155 DCA MPAC
045611,002701: 00,3555 52134 DXCH BUF2
045612,002702: 00,3556 03300 TC DSQSUB # SQUARE MPAC.
045613,002703:
045614,002704: 00,3557 07225 TC POLY # EVALUATE FOURTH ORDER POLYNOMIAL.
045615,002705: 00,3560 00003 DEC 3 B-14
045616,002706: 00,3561 14441 37325 2DEC +.3926990796
045617,002707:
045618,002708: 00,3563 53250 60764 2DEC -.6459637111
045619,002709:
045620,002710: 00,3565 12146 21276 2DEC +.318758717
045621,002711:
045622,002712: 00,3567 75466 71471 2DEC -.074780249
045623,002713:
045624,002714: 00,3571 00236 32757 2DEC +.009694988
045625,002715:
045626,002716: 00,3573 32470 CAF LBUF2 # MULTIPLY BY ARGUMENT AND SHIFT LEFT 2.
045627,002717: 00,3574 07111 TC DMPSUB -1
045628,002718:
045629,002719: 00,3575 00006 EXTEND
045630,002720: 00,3576 30156 DCA MPAC +1
045631,002721: 00,3577 20156 DAS MPAC +1
045632,002722: 00,3600 60154 AD MPAC
045633,002723: 00,3601 26154 ADS MPAC # NEITHER SHIFT OVERFLOWS.
045634,002724: 00,3602 00006 EXTEND
045635,002725: 00,3603 30156 DCA MPAC +1
045636,002726: 00,3604 20156 DAS MPAC +1
045637,002727: 00,3605 60154 AD MPAC
045638,002728: 00,3606 26154 ADS MPAC
045639,002729: 00,3607 16064 TCF DANZIG
045640,002730:
Page 1076 |
045642,002732: # ARCSIN/ARCCOS ROUTINE.
045643,002733:
045644,002734: 00,3610 33631 ARCSIN CAF LASINEX # COMPUTE ARCSIN BY USING THE IDENTITY
045645,002735: 00,3611 13613 TCF +2 # ARCSIN(X) = PI/2 - ARCCOS(X).
045646,002736:
045647,002737: 00,3612 33713 ARCCOS CAF LDANZIG # (EXITS IMMEDIATELY).
045648,002738: 00,3613 54136 TS ESCAPE
045649,002739: 00,3614 06726 TC BRANCH # TEST SIGN OF INPUT.
045650,002740: 00,3615 13625 TCF ACOSST # START IMMEDIATELY IF POSITIVE.
045651,002741: 00,3616 13731 TCF ACOSZERO # ARCCOS(0) = PI/2 = .25.
045652,002742: 00,3617 00006 EXTEND # IF NEGATIVE, USE THE IDENTITY
045653,002743: 00,3620 40155 DCS MPAC # ARCCOS(X) = PI - ARCCOS(-X), FORCING
045654,002744: 00,3621 52155 DXCH MPAC # ARGUMENT POSITIVE.
045655,002745: 00,3622 33734 CAF TCSUBTR # SET EXIT TO DO ABOVE BEFORE
045656,002746: 00,3623 56136 XCH ESCAPE # ARCSIN/ARCCOS CONSIDERATIONS.
045657,002747: 00,3624 54137 TS ESCAPE2
045658,002748:
045659,002749: 00,3625 44736 ACOSST CS HALF # TEST MAGNITUDE OF INPUT.
045660,002750: 00,3626 60154 AD MPAC
045661,002751: 00,3627 10000 CCS A
045662,002752: 00,3630 13721 TCF ACOSOVF # THIS IS PROBABLY AN OVERFLOW CASE.
045663,002753:
045664,002754: 00,3631 13707 LASINEX TCF ASINEX
045665,002755:
045666,002756: 00,3632 13642 TCF ACOSST2 # NO OVERFLOW - PROCEED.
045667,002757:
045668,002758: 00,3633 10155 CCS MPAC +1 # IF MAJOR PART IS .5, CALL ANSWER 0
045669,002759: 00,3634 34755 CAF ZERO # UNLESS MINOR PART NEGATIVE.
045670,002760: 00,3635 13637 TCF ACOS=0
045671,002761:
045672,002762: 00,3636 13642 TCF ACOSST2
045673,002763:
045674,002764: 00,3637 54155 ACOS=0 TS MPAC +1
045675,002765: 00,3640 54154 TS MPAC
045676,002766: 00,3641 00136 TC ESCAPE
045677,002767:
045678,002768: 00,3642 00006 ACOSST2 EXTEND # NOW THAT ARGUMENT IS IN PROPER RANGE,
045679,002769: 00,3643 40155 DCS MPAC # BEGIN COMPUTATION. USE HASTINGS
045680,002770: 00,3644 64736 AD HALF # APPROXIMATION ARCCOS(X) = SQRT(1-X)P(X)
045681,002771: 00,3645 52155 DXCH MPAC # IN A SCALED VERSION WHERE P(X) IS A
045682,002772: 00,3646 52134 DXCH BUF2 # SEVENTH ORDER POLYNOMIAL.
045683,002773:
045684,002774: 00,3647 03343 TC SQRTSUB # RETURNS WITH NORMALIZED SQUARE ROOT.
045685,002775:
045686,002776: 00,3650 10135 CCS MPTEMP # SEE IF UN-NORMALIZATION REQUIRED.
045687,002777: 00,3651 13714 TCF ACOSSHR # IF SO.
045688,002778:
Page 1077 |
045690,002780: 00,3652 52155 ACOS3 DXCH MPAC # SET UP FOR POLYNOMIAL EVALUATION.
045691,002781: 00,3653 52134 DXCH BUF2
045692,002782: 00,3654 52155 DXCH MPAC
045693,002783:
045694,002784: 00,3655 07225 TC POLY
045695,002785: 00,3656 00006 DEC 6 B-14
045696,002786: 00,3657 13240 23630 2DEC +.353553385 # COEFFICIENTS ARE C 2(+I)/PISQRT(2) WHERE
045697,002787:
045698,002788: 00,3661 74721 47775 2DEC* -.0483017006 B+1* # I
045699,002789:
045700,002790: 00,3663 02440 20237 2DEC* +.0200273085 B+2* # WHERE C STANDS FOR ORIGINAL COEFFS.
045701,002791:
045702,002792: 00,3665 75067 70742 2DEC* -.0112931863 B+3*
045703,002793:
045704,002794: 00,3667 03436 26756 2DEC* +.00695311612 B+4*
045705,002795:
045706,002796: 00,3671 74037 57640 2DEC* -.00384617957 B+5*
045707,002797:
045708,002798: 00,3673 03046 07143 2DEC* +.001501297736 B+6*
045709,002799:
045710,002800: 00,3675 76654 42244 2DEC* -.000284160334 B+7*
045711,002801:
045712,002802:
045713,002803: 00,3677 32470 CAF LBUF2 # DO FINAL MULTIPLY AND GO TO ANY
045714,002804: 00,3700 07111 TC DMPSUB -1 # EPILOGUE SEQUENCES.
045715,002805: 00,3701 00136 TC ESCAPE
045716,002806:
045717,002807: 00,3702 00006 SUBTR EXTEND # EPILOGUE FOR NEGATIVE INPUTS TO ARCCOS.
045718,002808: 00,3703 40155 DCS MPAC
045719,002809: 00,3704 64736 AD HALF # FORMS PI - ARCCOS(-X) = ARCCOS(X).
045720,002810: 00,3705 52155 DXCH MPAC
045721,002811: 00,3706 00137 TC ESCAPE2 # GO TO POSSIBLE ARCSIN EPILOGUE.
045722,002812:
045723,002813: 00,3707 00006 ASINEX EXTEND
045724,002814: 00,3710 40155 DCS MPAC # ARCSIN EPILOGUE - GET ARCSIN(X)
045725,002815: 00,3711 64737 AD QUARTER # = PI/2 - ARCCOS(X).
045726,002816: 00,3712 52155 DXCH MPAC
045727,002817: 00,3713 16064 LDANZIG TCF DANZIG
045728,002818:
Page 1078 |
045730,002820: 00,3714 50000 ACOSSHR INDEX A # THE SHIFT RIGHT IS LESS THAN 14 SINCE
045731,002821: 00,3715 34736 CAF BIT14 # THE INPUT WAS NON-ZERO DP.
045732,002822: 00,3716 54135 TS MPTEMP
045733,002823: 00,3717 02073 TC VSHRRND # DP SHIFT RIGHT AND ROUND.
045734,002824: 00,3720 13652 TCF ACOS3 # PROCEED.
045735,002825:
045736,002826: 00,3721 00006 ACOSOVF EXTEND # IF MAJOR PART WAS ONLY 1 MORE THAN .5,
045737,002827: 00,3722 13637 BZF ACOS=0 # CALL ANSWER ZERO.
045738,002828:
045739,002829: 00,3723 00006 ACOSABRT EXTEND # IF OVERFLOW, CALL ANSWER ZERO BUT
045740,002830: 00,3724 30165 DCA LOC # SOUND AN ALARM.
045741,002831: 00,3725 05722 TC ALARM1
045742,002832: 00,3726 01301 OCT 1301
045743,002833:
045744,002834: 00,3727 34755 CAF ZERO
045745,002835: 00,3730 13637 TCF ACOS=0
045746,002836:
045747,002837: 00,3731 34737 ACOSZERO CAF QUARTER # ACOS(0) = PI/2.
045748,002838: 00,3732 13640 TCF ACOS=0 +1 # SET MPAC AND EXIT VIA ESCAPE.
045749,002839:
045750,002840: 00,3733 77763 NEG12 DEC -12 B-14
045751,002841: 00,3734 13702 TCSUBTR TCF SUBTR
045752,002842:
Page 1079 |
045754,002844: # THE FOLLOWING INSTRUCTIONS ARE AVAILABLE FOR SETTING, MODIFYING, AND BRANCHING ON INDEX REGISTERS:
045755,002845:
045756,002846: # 1. AXT ADDRESS TO INDEX TRUE.
045757,002847: # 1. AXC ADDRESS TO INDEX COMPLEMENTED.
045758,002848: # 3. LXA LOAD INDEX FROM ERASABLE.
045759,002849: # 4. LXC LOAD INDEX COMPLEMENTED FROM ERASABLE.
045760,002850: # 5. SXA STORE INDEX IN ERASABLE.
045761,002851: # 6. XCHX EXCHANGE INDEX REIGSTER WITH ERASABLE.
045762,002852:
045763,002853: # 7. INCR INCREMENT INDEX REGISTER.
045764,002854: # 8. XAD ERASABLE ADD TO INDEX REGISTER.
045765,002855: # 9. XSU ERASABLE SUBTRACT FROM INDEX REGISTER.
045766,002856:
045767,002857: # 10. TIX BRANCH ON INDEX REGISTER AND DECREMENT.
045768,002858:
045769,002859:
045770,002860: 01,2345 BANK 01
045771,002861:
045772,002862: 01,2345 COUNT* $$/INTER
045773,002863: 01,2345 02442 AXT TC TAGSUB # SELECT APPROPRIATE INDEX REGISTER.
045774,002864: 01,2346 30117 CA POLISH
045775,002865: 01,2347 50130 XSTORE INDEX INDEXLOC # CONTAINS C(FIXLOC) OR C(FIXLOC)+1.
045776,002866: 01,2350 54046 TS X1
045777,002867: 01,2351 16064 TCF DANZIG
045778,002868:
045779,002869: 01,2352 02442 AXC TC TAGSUB
045780,002870: 01,2353 40117 CS POLISH
045781,002871: 01,2354 02347 TC XSTORE
045782,002872:
045783,002873: 01,2355 02430 LXA TC 15ADRERS # LOAD INDEX REGISTER FROM ERASABLE.
045784,002874: 01,2356 50117 INDEX POLISH
045785,002875: 01,2357 30000 CA 0
045786,002876: 01,2360 12347 TCF XSTORE
045787,002877:
045788,002878: 01,2361 02430 LXC TC 15ADRERS # LOAD NDX REG FROM ERASABLE COMPLEMENTED.
045789,002879: 01,2362 50117 INDEX POLISH
045790,002880: 01,2363 40000 CS 0
045791,002881: 01,2364 12347 TCF XSTORE
045792,002882:
045793,002883: 01,2365 02430 SXA TC 15ADRERS # STORE INDEX REGISTER IN ERASABLE.
045794,002884: 01,2366 50130 INDEX INDEXLOC
045795,002885: 01,2367 30046 CA X1
045796,002886: 01,2370 50117 MSTORE1 INDEX POLISH
045797,002887: 01,2371 54000 TS 0
045798,002888: 01,2372 16064 TCF DANZIG
045799,002889:
Page 1080 |
045801,002891: 01,2373 02430 XCHX TC 15ADRERS # EXCHANGE INDEX REGISTER WITH ERASABLE.
045802,002892: 01,2374 50117 INDEX POLISH
045803,002893: 01,2375 30000 CA 0
045804,002894: 01,2376 50130 INDEX INDEXLOC
045805,002895: 01,2377 56046 XCH X1
045806,002896: 01,2400 12370 TCF MSTORE1
045807,002897:
045808,002898: 01,2401 02430 XAD TC 15ADRERS # ADD ERASABLE TO INDEX REGISTER.
045809,002899: 01,2402 50117 INDEX POLISH
045810,002900: 01,2403 30000 CA 0
045811,002901: 01,2404 50130 XAD2 INDEX INDEXLOC
045812,002902: 01,2405 26046 ADS X1 # IGNORING OVERFLOWS.
045813,002903: 01,2406 16064 TCF DANZIG
045814,002904:
045815,002905: 01,2407 02442 INCR TC TAGSUB # INCREMENT INDEX REGISTER.
045816,002906: 01,2410 30117 CA POLISH
045817,002907: 01,2411 12404 TCF XAD2
045818,002908:
045819,002909: 01,2412 02430 XSU TC 15ADRERS # SUBTRACT ERASABLE FROM INDEX REGISTER.
045820,002910: 01,2413 50117 INDEX POLISH
045821,002911: 01,2414 40000 CS 0
045822,002912: 01,2415 12404 TCF XAD2
045823,002913:
045824,002914: 01,2416 02442 TIX TC TAGSUB # BRANCH AND DECREMENT ON INDEX.
045825,002915: 01,2417 50130 INDEX INDEXLOC
045826,002916: 01,2420 40050 CS S1
045827,002917: 01,2421 50130 INDEX INDEXLOC
045828,002918: 01,2422 60046 AD X1
045829,002919: 01,2423 00006 EXTEND # NO OPERATION IF DECREMENTED INDEX IS
045830,002920: 01,2424 66064 BZMF DANZIG # NEGATIVE OR ZERO.
045831,002921:
045832,002922: 01,2425 50130 DOTIXBR INDEX INDEXLOC
045833,002923: 01,2426 56046 XCH X1 # IGNORING OVERFLOWS.
045834,002924:
045835,002925: 01,2427 16651 TCF GOTO # DO THE BRANCH USING THE CADR IN POLISH.
045836,002926:
Page 1081 |
045838,002928: # SUBROUTINE TO CONVERT AN ERASABLE ADDRESS (11 BITS) TO AN EBANK SETTING AND SUBADDRESS.
045839,002929:
045840,002930: 01,2430 40117 15ADRERS CS POLISH
045841,002931: 01,2431 64772 AD DEC45
045842,002932: 01,2432 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
045843,002933: 01,2433 30120 CA FIXLOC # YES. ADD FIXLOC. EBANK OK AS IS.
045844,002934: 01,2434 12441 TCF +5
045845,002935:
045846,002936: 01,2435 35007 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
045847,002937: 01,2436 56117 XCH POLISH
045848,002938: 01,2437 54003 TS EBANK
045849,002939: 01,2440 74357 MASK LOW8
045850,002940: 01,2441 26117 +5 ADS POLISH # FALL INTO TAGSUB, AND RETURN VIA Q.
045851,002941:
045852,002942: # SUBROUTINE WHICH SETS THE ADDRESS OF THE SPECIFIED INDEX IN INDEXLOC. (ACTUALLY, THE ADDRESS -38D.)
045853,002943:
045854,002944: 01,2442 30120 TAGSUB CA FIXLOC
045855,002945: 01,2443 54130 TS INDEXLOC
045856,002946:
045857,002947: 01,2444 10020 CCS CYR # BIT 15 SPECIFIES INDEX.
045858,002948: 01,2445 24130 INCR INDEXLOC # 0 MEANS USE X2.
045859,002949: 01,2446 00002 TC Q
045860,002950: 01,2447 00002 TC Q # 1 FOR X1.
045861,002951:
Page 1082 |
045863,002953: # MISCELLANEOUS OPERATION CODES WITH DIRECT ADDRESSES. INCLUDED HERE ARE:
045864,002954:
045865,002955: # 1. ITA STORE QPRET (RETURN ADDRESS) IN ERASABLE.
045866,002956: # 2. CALL CALL A SUBROUTINE, LEAVING RETURN IN QPRET.
045867,002957: # 3. RTB RETURN TO BASIC LANGUAGE AT THE GIVEN ADDRESS.
045868,002958: # 4. BHIZ BRANCH IF THE HIGH ORDER OF MPAC IS ZERO (SINGLE PRECISION).
045869,002959: # 5. BOV BRANCH ON OVERFLOW.
045870,002960: # 6. GOTO SIMPLE SEQUENCE CHANGE.
045871,002961:
045872,002962: 01,2450 10020 RTB/BHIZ CCS CYR
045873,002963: 01,2451 30117 RTB CA POLISH
045874,002964: 01,2452 04621 TC SWCALL -1 # SO A "TC Q" FROM ROUTINE LEADS TO DANZIG
045875,002965:
045876,002966: 01,2453 10154 BHIZ CCS MPAC
045877,002967: 01,2454 16064 TCF DANZIG
045878,002968: 01,2455 16651 TCF GOTO
045879,002969: 01,2456 16064 TCF DANZIG
045880,002970: 01,2457 16651 TCF GOTO
045881,002971:
045882,002972: 01,2460 10121 BOV(B) CCS OVFIND # BRANCH ON OVERFLOW TO BASIC OR INTERP.
045883,002973: 01,2461 12463 TCF +2
045884,002974: 01,2462 16064 TCF DANZIG
045885,002975: 01,2463 54121 TS OVFIND
045886,002976: 01,2464 10020 CCS CYR
045887,002977: 01,2465 12451 TCF RTB # IF BASIC.
045888,002978: 01,2466 00360 B5TOB8 OCT 360
045889,002979: 01,2467 16651 TCF GOTO
045890,002980:
Page 1083 |
045892,002982: 01,2470 10020 BZE/GOTO CCS CYR # SEE WHICH OP-CODE IS DESIRED.
045893,002983: 01,2471 06726 TC BRANCH # DO BZE.
045894,002984: 01,2472 16064 TCF DANZIG
045895,002985: 01,2473 16651 TCF GOTO # DO GOTO.
045896,002986: 01,2474 16064 TCF DANZIG
045897,002987:
045898,002988: 01,2475 10020 BPL/BMN CCS CYR
045899,002989: 01,2476 12504 TCF BPL
045900,002990: 01,2477 12000 5B10 DEC 5 B+10 # SHIFTS OP CODE IN SWITCH INSTRUCTION ADR
045901,002991:
045902,002992: 01,2500 06726 TC BRANCH # DO BMN.
045903,002993: 01,2501 16064 TCF DANZIG
045904,002994: 01,2502 16064 TCF DANZIG
045905,002995: 01,2503 16651 TCF GOTO # ONLY IF NNZ.
Note: The above statement (operator and operand) have a single red underline in red |
045907,002997:
045908,002998: 01,2504 06726 BPL TC BRANCH
045909,002999: 01,2505 16651 TCF GOTO # IF POSITIVE OR ZERO.
045910,003000: 01,2506 16651 TCF GOTO
045911,003001: 01,2507 16064 TCF DANZIG
045912,003002:
045913,003003: 01,2510 10020 CALL/ITA CCS CYR
045914,003004: 01,2511 16643 TCF CALL
045915,003005:
045916,003006: 01,2512 05675 TC CCSHOLE
045917,003007: 01,2513 02430 TC 15ADRERS # STORE QPRET. (TAGSUB AFTER 15ADRERS IS
045918,003008: 01,2514 50120 INDEX FIXLOC # SLOW IN THIS CASE, BUT SAVES STORAGE.)
045919,003009: 01,2515 30052 CA QPRET
045920,003010: 01,2516 12370 TCF MSTORE1
045921,003011:
Page 1084 |
045923,003013: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR ALTERING AND TESTING INTERPRETIVE SWITCHES:
045924,003014:
045925,003015: # 00 BONSET SET A SWITCH AND DO A GOTO IF IT WAS ON.
045926,003016: # 01 SETGO SET A SWITCH AND DO A GOTO.
045927,003017: # 02 BOFSET SET A SWITCH AND DOA GOTO IF IT WAS OFF
045928,003018: # 03 SET SET A SWITCH.
045929,003019:
045930,003020: # 04 BONINV INVERT A SWITCH AND BRANCH IF IT WAS ON.
045931,003021: # 05 INVGO INVERT A SWITCH AND DO A GOTO.
045932,003022: # 06 BOFINV INVERT A SWITCH AND BRANCH IF IT WAS OFF
045933,003023: # 07 INVERT INVERT A SWITCH.
045934,003024:
045935,003025: # 10 BONCLR CLEAR A SWITCH AND BRANCH IF IT WAS ON.
045936,003026: # 11 CLRGO CLEAR A SWITCH AND DO A GOTO.
045937,003027: # 12 BOFCLR CLEAR A SWITCH AND BRANCH IF IT WAS OFF.
045938,003028: # 13 CLEAR CLEAR A SWITCH.
045939,003029:
045940,003030: # 14 BON BRANCH IF A SWITCH WAS ON.
045941,003031: # 16 BOFF BRANCH IF A SWITCH WAS OFF.
045942,003032:
045943,003033:
045944,003034: # THE ADDRESS SUPPLIED WITH THE SWITCH INSTRUCTION IS INTERPRETED AS FOLLOWS:
045945,003035:
045946,003036: # BITS 1-4 SWITCH BIT NUMBER (1-15).
045947,003037: # BITS 5-8 SWITCH OPERATION NUMBER.
045948,003038: # BITS 9- SWITCH WORD NUMBER (UP TO 64 SWITCH WORDS).
045949,003039:
045950,003040: # THE ADDRESS ITSELF IS MADE UP BY THE YUL SYSTEM ASSEMBLER. THE BRANCH INSTRUCTIONS REQUIRE TWO
045951,003041: # ADDRESSES, THE SECOND TAKEN AS THE DIRECT (OR INDIRECT IF IN ERASABLE) ADDRESS OF THE BRANCH.
045952,003042:
045953,003043:
045954,003044: 01,2517 34762 SWITCHES CAF LOW4 # LEAVE THE SWITCH BIT IN SWBIT.
045955,003045: 01,2520 70117 MASK POLISH
045956,003046: 01,2521 50000 INDEX A
045957,003047: 01,2522 34735 CAF BIT15 # (NUMBER FROM LEFT TO RIGHT.)
045958,003048: 01,2523 54131 TS SWBIT
045959,003049:
045960,003050: 01,2524 34745 CAF BIT7 # LEAVE THE SWITCH NUMBER IN SWWORD.
045961,003051: 01,2525 00006 EXTEND
045962,003052: 01,2526 70117 MP POLISH
045963,003053: 01,2527 54130 TS SWWORD
045964,003054:
045965,003055: 01,2530 00004 INHINT # DURING SWITCH CHANGE SO RUPT CAN USE TOO
045966,003056: 01,2531 50000 INDEX A # LEAVE THE SWITCH WORD ITSELF IN L.
045967,003057: 01,2532 30074 CA STATE
045968,003058: 01,2533 54002 TS Q # Q WILL BE USED AS A CHANNEL.
045969,003059:
Page 1085 |
045971,003061: 01,2534 34741 CAF BIT11
045972,003062: 01,2535 00006 EXTEND # DISPATCH SWITCH BIT OPERATION AS IN BITS
045973,003063: 01,2536 70117 MP POLISH # 7-8 OF POLISH.
045974,003064: 01,2537 72577 MASK B3TOB4 # GETS 4X2-BIT CODE.
045975,003065: 01,2540 50000 INDEX A
045976,003066: 01,2541 12542 TCF +1
045977,003067:
045978,003068: 01,2542 30131 +1 CA SWBIT # 00 - SET SWITCH IN QUESTION.
045979,003069: 01,2543 00006 EXTEND
045980,003070: 01,2544 04002 ROR QCHAN
045981,003071: 01,2545 12554 TCF SWSTORE
045982,003072:
045983,003073: 01,2546 30131 +5 CA SWBIT # 01 - INVERT SWITCH.
045984,003074: 01,2547 00006 EXTEND
045985,003075: 01,2550 06002 RXOR QCHAN
045986,003076: 01,2551 12554 TCF SWSTORE
045987,003077:
045988,003078: 01,2552 40131 +9D CS SWBIT # 10 - CLEAR.
045989,003079: 01,2553 70002 MASK Q
045990,003080: 01,2554 50130 SWSTORE INDEX SWWORD
045991,003081: 01,2555 54074 TS STATE # NEW SWITCH WORD.
045992,003082:
Page 1086 |
045994,003084: 01,2556 00003 +13D RELINT # 11 - NOOP.
045995,003085: 01,2557 34737 CAF BIT13
045996,003086: 01,2560 00006 EXTEND # DISPATCH SEQUCE CHANGING OR BRANCHING
045997,003087: 01,2561 70117 MP POLISH # CODE.
045998,003088: 01,2562 72577 MASK B3TOB4
045999,003089: 01,2563 50000 INDEX A
046000,003090: 01,2564 12565 TCF +1 # ORIGINALLY STORED IN BITS 5-6.
046001,003091:
046002,003092: 01,2565 40002 +1 CS Q # 00 - BRANCH IF ON.
046003,003093: 01,2566 70131 TEST MASK SWBIT
046004,003094: 01,2567 10000 CCS A
046005,003095: 01,2570 12600 TCF SWSKIP
046006,003096:
046007,003097: 01,2571 16720 +5 TCF SWBRANCH # 01 - GO TO.
046008,003098:
046009,003099: 01,2572 12600 TCF SWSKIP # HERE ONLY ON BIT 15.
046010,003100:
046011,003101: 01,2573 05675 TC CCSHOLE
046012,003102: 01,2574 05675 TC CCSHOLE
046013,003103:
046014,003104: 01,2575 30002 +9D CA Q # 10 - BRANCH IF OFF.
046015,003105: 01,2576 12566 TCF TEST
046016,003106:
046017,003107: 01,2577 00014 B3TOB4 OCT 0014
046018,003108: 01,2600 24164 SWSKIP INCR LOC
046019,003109:
046020,003110: 01,2601 01,2517 SW/ EQUALS SWITCHES
046021,003111:
046022,003112: 01,2601 16064 +13D TCF DANZIG # 11 - NOOP.
End of include-file INTERPRETER.agc. Parent file is MAIN.agc