Source Code
These source code files are a reconstruction of Sundance, the Apollo 9 LM (Lunar Module) AGC
(Apollo Guidance Computer) flight software, created from binary dumps of original core rope
program modules, as follows:
Since only binary dumps (rather than listings) of Sundance are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing. |
039135,000002: ## Copyright: Public domain.
039136,000003: ## Filename: INTERPRETER.agc
039137,000004: ## Purpose: A section of a reconstructed, mixed version of Sundance
039138,000005: ## It is part of the reconstructed source code for the Lunar
039139,000006: ## Module's (LM) Apollo Guidance Computer (AGC) for Apollo 9.
039140,000007: ## No original listings of this program are available;
039141,000008: ## instead, this file was created via disassembly of dumps
039142,000009: ## of various revisions of Sundance core rope modules.
039143,000010: ## Assembler: yaYUL
039144,000011: ## Contact: Ron Burkey <info@sandroid.org>.
039145,000012: ## Website: www.ibiblio.org/apollo/index.html
039146,000013: ## Mod history: 2020-06-17 MAS Created from Luminary 69.
039147,000014: ## 2021-05-30 ABS Added ITR0 location symbol to match previous
039148,000015: ## and subsequent version scans.
039149,000016: ## B5TOBB -> B5TOB8
039150,000017:
039151,000018: ## Sundance 292
039152,000019:
039153,000020: # SECTION 1 DISPATCHER
039154,000021:
039155,000022: # ENTRY TO THE INTERPRETER. INTPRET SETS LOC TO THE FIRST INSTRUCTION, BANKSET TO THE BBANK OF THE
039156,000023: # OBJECT INTERPRETIVE PROGRAM, AND INTBIT15 TO THE BIT15 CONTENTS OF FBANK. INTERPRETIVE PROGRAMS MAY BE IN
039157,000024: # VIRTUALLY ALL BANKS PRESENT UNDER ANY SUPER-BANK SETTING, WITH THE RESTRICTION THAT PROGRAMS IN HIGH BANKS
039158,000025: # (BIT15 OF FBANK = 1) DO NOT REFER TO LOWBANKS, AND VICE-VERSA. THE INTERPRETER DOES NOT SWITCH SUPERBANKS.
039159,000026: # E-BANK SWITCHING OCCURS WHENEVER GENERAL ERASABLE (100 - 3777) IS ADDRESSED.
039160,000027:
039161,000028: 6014 BLOCK 03
039162,000029:
039163,000030: 6014 COUNT* $$/INTER
039164,000031: 6014 00006 INTPRET EXTEND # SET LOC TO THE WORD FOLLOWING THE TC.
039165,000032: 6015 22164 QXCH LOC
039166,000033:
039167,000034: 6016 30006 +2 CA BBANK # INTERPRETIVE BRANCHES FINISH HERE.
039168,000035: 6017 54165 TS BANKSET
039169,000036: 6020 75010 MASK BIT15 # GET 15TH BIT FOR INDEXABLE ADDRESSES.
039170,000037: 6021 54115 TS INTBIT15
039171,000038:
039172,000039: 6022 54023 TS EDOP # MAKE SURE NO INSTRUCTIONS LEFT OVER
039173,000040:
039174,000041: 6023 16044 TCF NEWOPS # PICK UP OP CODE PAIR AND BEGIN.
039175,000042:
039176,000043:
039177,000044: 6024 22006 INTRSM LXCH BBANK # RESUME SUSPENDED INTERPRETIVE JOB
039178,000045: 6025 16016 TCF INTPRET +2
039179,000046: # DLOAD LOADS MPAC, MPAC +1, LEAVING ZERO IN MPAC +2.
039180,000047:
039181,000048: 6026 00006 DLOAD EXTEND
039182,000049: 6027 50116 INDEX ADDRWD
039183,000050: 6030 30001 DCA 0 # LOAD DP C(C(ADDRWD)) INTO MPAC,MPAX +1
039184,000051: 6031 52155 SLOAD2 DXCH MPAC
039185,000052: 6032 35030 CAF ZERO # ZERO MPAC +2
039186,000053:
039187,000054: # AT THE END OF MOST INSTRUCTIONS, CONTROL IS GIVEN TO DANZIG TO DISPATCH THE NEXT OPERATION.
039188,000055:
039189,000056: 6033 54156 TS MPAC +2 # AND DECLARE DP MODE
039190,000057:
039191,000058: 6034 54163 NEWMODE TS MODE # PROLOGUE FOR MODE-CHANGING INSTRUCTIONS.
039192,000059:
039193,000060: 6035 30165 DANZIG CA BANKSET # SET BBANK BEFORE TESTING NEWJOB SO THAT
039194,000061: 6036 54006 TS BBANK # IT MAY BE SAVED DIRECTLY BY CHANJOB.
039195,000062:
039196,000063: 6037 10023 NOIBNKSW CCS EDOP # SEE IF AN ORDER CODE IS LEFT OVER FROM
039197,000064: 6040 16053 TCF OPJUMP # THE LAST PAIR RETRIEVED. IF SO, EXECUTE.
039198,000065: # EDOP IS SET TO ZERO ON ITS RE-EDITING.
039199,000066:
039200,000067: 6041 10067 CCS NEWJOB # SEE IF A JOB OF HIGHER PRIORITY IS
039201,000068: 6042 15176 TCF CHANG2 # PRESENT, AND IF SO, CHANGE JOBS.
039202,000069:
039203,000070: 6043 24164 INCR LOC # ADVANCE THE LOCATION COUNTER.
039204,000071: # ITRACE (1) REFERS TO "NEWOPS".
039205,000072: 6044 50164 NEWOPS INDEX LOC # ENTRY TO BEGIN BY PICKING OP CODE PAIR.
039206,000073: 6045 30000 CA 0 # MAY BE AN OPCODE PAIR OR A STORE CODE.
039207,000074: 6046 10000 CCS A # TEST SIGN AND GET DABS(A).
039208,000075: 6047 16336 TCF DOSTORE # PROCESS STORE CODE.
039209,000076:
039210,000077: 6050 00177 LOW7 OCT 177
039211,000078:
039212,000079: 6051 54023 TS EDOP # OP CODE PAIR. LEAVE THE OTHER IN EDOP
039213,000080: 6052 76050 MASK LOW7 # WHERE CCS EDOP WILL HONOR IT NEXT.
039214,000081:
039215,000082: 6053 54020 OPJUMP TS CYR # LOWWD ENTERS HERE IF A RIGHT-HAND OP
039216,000083: 6054 10020 CCS CYR # CODE IS TO BE PROCESSED. TEST PREFICES.
039217,000084: 6055 16223 TCF OPJUMP2 # TEST SECOND PREFIX BIT.
039218,000085:
039219,000086: 6056 16717 TCF EXIT # +0 OP CODE IS EXIT.
039220,000087:
039221,000088: # PROCESS ADDRESSES WHICH MAY BE DIRECT, INDEXED, OR REFERENCE THE PUSHDOWN LIST.
039222,000089:
039223,000090: 6057 75026 ADDRESS MASK BIT1 # SEE IF ADDRESS IS INDEXED. CYR CONTAINED
039224,000091: 6060 10000 CCS A # 400XX, SO BIT 1 IS NOW AS IT WAS IN CYR.
039225,000092: 6061 16122 TCF INDEX # FORM INDEXED ADDRESS.
039226,000093:
039227,000094: 6062 50164 DIRADRES INDEX LOC # LOOK AHEAD TO NEXT WORD TO SEE IF
039228,000095: 6063 40001 OCT40001 CS 1 # ADDRESS IS GIVEN.
039229,000096: 6064 10000 CCS A
039230,000097: 6065 16171 TCF PUSHUP # IF NOT.
039231,000098:
039232,000099: 6066 77773 NEG4 DEC -4 B-14
039233,000100:
039234,000101: 6067 24164 INCR LOC # IF SO, TO SHOW WE PICKED UP A WORD.
039235,000102: 6070 54116 TS ADDRWD
039236,000103:
039237,000104: # FINAL DIGESTION OF DIRECT ADDRESSES OF OP CODES WITH 01 PREFIX IS DONE HERE. IN EACH CASE, THE
039238,000105: # REQUIRED 12-BIT SUB-ADDRESS IS LEFT IN ADDRWD, WITH ANY REQUIRED E OR F BANK SWITCHING DONE. ADDRESSES LESS
039239,000106: # THAN 45D ARE TAKEN TO BE RELATIVE TO THE WORK AREA. THE OP CODE IS NOW IN BITS 1-5 OF CYR WITH BIT 14 = 1.
039240,000107:
039241,000108:
039242,000109: 6071 66225 AD -ENDVAC # SEE IF ADDRESS RELATIVE TO WORK AREA.
039243,000110: 6072 10000 CCS A
039244,000111: 6073 67714 AD -ENDERAS # IF NOT, SEE IF IN GENERAL ERASABLE.
039245,000112: 6074 16101 TCF IERASTST
039246,000113:
039247,000114: 6075 30120 NETZERO CA FIXLOC # IF SO, LEAVE THE MODIFIED ADDRESS IN
039248,000115: 6076 26116 ADS ADDRWD # ADDRWD AND DISPATCH.
039249,000116: 6077 50020 ITR15 INDEX CYR # THIS INDEX MAKES THE NEXT INSTRUCTION
039250,000117: 6100 76247 7 INDJUMP -1 # TCF INDJUMP + OP, EDITING CYR.
039251,000118:
039252,000119: 6101 00006 IERASTST EXTEND
039253,000120: 6102 66112 BZMF GEADDR # GO PROCESS GENERAL-ERASABLE ADDRESS.
039254,000121:
039255,000122: 6103 75062 MASK LOW10 # FIXED BANK ADDRESS. RESTORE AND ADD B15.
039256,000123: 6104 65062 AD LOW10 # SWITCH BANKS AND LEAVE SUBADDRESS IN
039257,000124: 6105 56116 XCH ADDRWD # ADDRWD FOR OPERAND RETRIEVAL. (THIS
039258,000125: 6106 60115 AD INTBIT15 # METHOD PRECLUDES USE OF THE LAST
039259,000126: 6107 54004 TS FBANK # LOCATION IN EACH FBANK.)
039260,000127: 6110 50020 ITR12 INDEX CYR
039261,000128: 6111 76247 7 INDJUMP -1
039262,000129:
039263,000130: 6112 74371 GEADDR MASK LOW8
039264,000131: 6113 65057 AD OCT1400
039265,000132: 6114 56116 XCH ADDRWD
039266,000133: 6115 54003 TS EBANK
039267,000134: 6116 50020 ITR10 INDEX CYR
039268,000135: 6117 76247 7 INDJUMP -1
039269,000136:
039270,000137: # THE FOLLOWING ROUTINE PROCESSES INTERPRETIVE INDEXED ADDRESSES. AN INTERPRETER INDEX REGISTER MAY
039271,000138: # CONTAIN THE ADDRESS OF ANY ERASABLE REGISTER (0-42 BEING RELATIVE TO THE VAC AREA) OR ANY INTERPRETIVE PROGRAM
039272,000139: # BANK, OR ANY INTEGER IN THAT RANGE.
039273,000140:
039274,000141: 6120 37705 DODLOAD* CAF DLOAD* # STODL* COMES HERE TO PROCESS LOAD ADR.
039275,000142: 6121 54020 TS CYR # (STOVL* ENTERS HERE).
039276,000143:
039277,000144: 6122 30120 INDEX CA FIXLOC # SET UP INDEX LOCATION.
039278,000145: 6123 54130 TS INDEXLOC
039279,000146: 6124 24164 INCR LOC # (ADDRESS ALWAYS GIVEN).
039280,000147: 6125 50164 INDEX LOC
039281,000148: 6126 40000 CS 0
039282,000149: 6127 10000 CCS A # INDEX 2 IF ADDRESS STORED COMPLEMENTED.
039283,000150: 6130 24130 INCR INDEXLOC
039284,000151: 6131 16132 NOOP
039285,000152:
039286,000153: 6132 54116 TS ADDRWD # 14 BIT ADDRESS TO ADDRWD.
039287,000154: 6133 77713 MASK HIGH4 # IF ADDRESS GREATER THAN 2K, ADD INTBIT15
039288,000155: 6134 00006 EXTEND
039289,000156: 6135 16140 BZF INDEX2
039290,000157: 6136 30115 CA INTBIT15
039291,000158: 6137 26116 ADS ADDRWD
039292,000159:
039293,000160: 6140 50130 INDEX2 INDEX INDEXLOC
039294,000161: 6141 40046 CS X1
039295,000162: 6142 26116 ADS ADDRWD # DO AUGMENT, IGNORING AND CORRECTING OVF.
039296,000163:
039297,000164: 6143 77715 MASK HIGH9 # SEE IF ADDRESS IS IN WORK AREA.
039298,000165: 6144 00006 EXTEND
039299,000166: 6145 16160 BZF INDWORK
039300,000167: 6146 77713 MASK HIGH4 # SEE IF IN FIXED BANK.
039301,000168: 6147 00006 EXTEND
039302,000169: 6150 16162 BZF INDERASE
039303,000170:
039304,000171: 6151 30116 CA ADDRWD # IN FIXED - SWITCH BANKS AND CREATE
039305,000172: 6152 54004 TS FBANK # SUB-ADDRESS.
039306,000173: 6153 75062 MASK LOW10
039307,000174: 6154 65014 AD 2K
039308,000175: 6155 54116 TS ADDRWD
039309,000176: 6156 50020 ITR11 INDEX CYR
039310,000177: 6157 36247 3 INDJUMP -1
039311,000178:
039312,000179: 6160 30120 INDWORK CA FIXLOC # MAKE ADDRWD RELATIVE TO WORK AREA.
039313,000180: 6161 16166 TCF ITR13 -1
039314,000181:
039315,000182: 6162 35057 INDERASE CA OCT1400
039316,000183: 6163 56116 XCH ADDRWD
039317,000184: 6164 54003 TS EBANK
039318,000185: 6165 74371 MASK LOW8
039319,000186: 6166 26116 -1 ADS ADDRWD
039320,000187: 6167 50020 ITR13 INDEX CYR
039321,000188: 6170 36247 3 INDJUMP -1
039322,000189:
039323,000190: # PUSH-UP ROUTINES. WHEN NO OPERAND ADDRESS IS GIVEN, THE APPROPRIATE OPERAND IS TAKEN FROM THE PUSH-DOWN
039324,000191: # LIST. IN MOST CASES THE MODE OF THE RESULT (VECTOR OR SCALAR) OF THE LAST ARITHMETIC OPERATION PERFORMED
039325,000192: # IS THE SAME AS THE TYPE OF OPERAND DESIRED (ALL ADD/SUBTRACT ETC.). EXCEPTIONS TO THIS GENERAL RULE ARE LISTED
039326,000193: # BELOW (NOTE THAT IN EVERY CASE THE MODE REGISTER IS LEFT INTACT):
039327,000194:
039328,000195: # 1. VXSC AND V/SC WANT THE OPPOSITE TYPE OF OPERAND, E.G., IF THE LAST OPERATION YIELDED A VECTOR
039329,000196: # RESULT, VXSC WANTS A SCALAR.
039330,000197:
039331,000198: # 2. THE LOAD CODES SHOULD LOAD THE ACCUMULATOR INDEPENDENT OF THE RESULT OF THE LAST OPERATION. THIS
039332,000199: # INCLUDES VLOAD, DLOAD, TLOAD, PDDL, AND PDVL (NO PUSHUP WITH SLOAD).
039333,000200:
039334,000201: # 3. SOME ARITHMETIC OPERATIONS REQUIRE A STANDARD TYPE OF OPERAND REGARDLESS OF THE PREVIOUS OPERATION.
039335,000202: # THIS INCLUDES SIGN WANTING DP AND TAD REQUIRING TP.
039336,000203:
039337,000204: 6171 34372 PUSHUP CAF OCT23 # IF THE LOW 5 BITS OF CYR ARE LESS THAN
039338,000205: 6172 70020 MASK CYR # 20, THIS OP REQUIRES SPECIAL ATTENTION.
039339,000206: 6173 66176 AD -OCT10 # (NO -0).
039340,000207: 6174 10000 CCS A
039341,000208: 6175 16207 TCF REGUP # FOR ALL CODES GREATER THAN OCT 7.
039342,000209:
039343,000210: 6176 77767 -OCT10 OCT -10
039344,000211:
039345,000212: 6177 66066 AD NEG4 # WE NOW HAVE 7 - OP CODE(MOD4). SEE IF
039346,000213: 6200 10000 CCS A # THE OP CODE (MOD4) IS THREE (REVERSE).
039347,000214: 6201 50000 INDEX A # NO - THE MODE IS DEFINITE. PICK UP THE
039348,000215: 6202 46220 CS NO.WDS
039349,000216: 6203 16211 TCF REGUP +2
039350,000217:
039351,000218: 6204 50163 INDEX MODE # FOR VXSC AND V/SC WE WANT THE REQUIRED
039352,000219: 6205 46216 CS REVCNT # PUSHLOC DECREMENT WITHOUT CHANGING THE
039353,000220: 6206 16211 TCF REGUP +2 # MODE AT THIS TIME.
039354,000221:
039355,000222: 6207 50163 REGUP INDEX MODE # MOST ALL OP CODES PUSHUP HERE.
039356,000223: 6210 46220 CS NO.WDS
039357,000224: 6211 26166 +2 ADS PUSHLOC
039358,000225: 6212 54116 TS ADDRWD
039359,000226: 6213 50020 ITR14 INDEX CYR
039360,000227: 6214 76247 7 INDJUMP -1 # (THE INDEX MAKES THIS A TCF.)
039361,000228:
039362,000229: 6215 00002 OCT 2 # REVERSE PUSHUP DECREMENT. VECTOR TAKES 2
039363,000230: 6216 00006 REVCNT OCT 6 # WORDS, SCALAR TAKES 6.
039364,000231: 6217 00006 OCT 6
039365,000232: 6220 00002 NO.WDS OCT 2 # CONVENTIONAL DECREMENT IS 6 WORDS VECTOR
039366,000233: 6221 00003 OCTAL3 OCT 3 # 2 IN DP, AND 3 IN TP.
039367,000234: 6222 00006 OCT 6
039368,000235:
039369,000236: # TEST THE SECOND PREFIX BIT TO SEE IF THIS IS A MISCELLANEOUS OR A UNARY/SHORT SHIFT OPERATION.
039370,000237:
039371,000238: 6223 10020 OPJUMP2 CCS CYR # TEST SECOND PREFIX BIT.
039372,000239: 6224 16237 TCF OPJUMP3 # TEST THIRD BIT TO SEE IF UNARY OR SHIFT.
039373,000240:
039374,000241: 6225 77722 -ENDVAC DEC -45 B-14
039375,000242:
039376,000243: # THE FOLLOWING ROUTINE PROCESSES ADDRESSES OF SUFFIX CLASS 10. THEY ARE BASICALLY WORK AREA ADDRESSES
039377,000244: # IN THE RANGE 0 - 52, ERASABLE ECADR CONSTANTS FROM 100 - 3777, AND FCADRS ABOVE THAT. ALL 15 BITS ARE AVAILABLE
039378,000245: # IN CONTRAST TO SUFFIX 1, IN WHICH ONLY THE LOW ORDER 14 ARE AVAILABLE.
039379,000246:
039380,000247: 6226 24164 15BITADR INCR LOC # (ENTRY HERE FROM STCALL).
039381,000248: 6227 50164 INDEX LOC # PICK UP ADDRESS WORD.
039382,000249: 6230 30000 CA 0
039383,000250: 6231 54117 TS POLISH # WE MAY NEED A SUBADDRESS LATER.
039384,000251:
039385,000252: 6232 35063 CAF LOW7+2K # THESE INSTRUCTIONS ARE IN BANK 1.
039386,000253: 6233 54004 TS FBANK
039387,000254: 6234 70020 MASK CYR
039388,000255: 6235 50000 ITR7 INDEX A
039389,000256: 6236 16310 TCF MISCJUMP
039390,000257:
039391,000258: # COMPLETE THE DISPATCHING OF UNARY AND SHORT SHIFT OPERATIONS.
039392,000259:
039393,000260: 6237 54004 OPJUMP3 TS FBANK # CALL IN BANK 0 (BITS 11-15 OF A ARE 0.)
039394,000261: # ITRACE (6) REFERS TO "OPJUMP3".
039395,000262: 6240 10020 CCS CYR # TEST THIRD PREFIX BIT.
039396,000263: 6241 50000 INDEX A # THE DECREMENTED UNARY CODE IS IN BITS
039397,000264: 6242 12000 TCF UNAJUMP # 1-4 OF A (ZERO, EXIT, HAS BEEN DETECTED)
039398,000265:
039399,000266: 6243 10163 CCS MODE # ITS A SHORT SHIFT CODE. SEE IF PRESENT
039400,000267: 6244 12017 TCF SHORTT # SCALAR OR VECTOR.
039401,000268: 6245 12017 TCF SHORTT
039402,000269: 6246 12121 TCF SHORTV # CALLS THE APPROPRIATE ROUTINE.
039403,000270:
039404,000271:
039405,000272: 6247 4362 FBANKMSK EQUALS BANKMASK
039406,000273: 6247 00122 LVBUF ADRES VBUF
039407,000274:
039408,000275: # THE FOLLOWING IS THE JUMP TABLE FOR OP CODES WHICH MAY HAVE INDEXABLE ADDRESSES OR MAY PUSH UP.
039409,000276:
039410,000277: 6250 16461 INDJUMP TCF VLOAD # 00 - LOAD MPAC WITH A VECTOR.
039411,000278: 6251 17045 TCF TAD # 01 - TRIPLE PRECISION ADD TO MPAC.
039412,000279: 6252 17627 TCF SIGN # 02 - COMPLEMENT MPAC (V OR SC) IF X NEG.
039413,000280: 6253 17353 TCF VXSC # 03 - VECTOR TIMES SCALAR.
039414,000281: 6254 16657 TCF CGOTO # 04 - COMPUTED GO TO.
039415,000282: 6255 16444 TCF TLOAD # 05 - LOAD MPAC WITH TRIPLE PRECISION.
039416,000283: 6256 16026 TCF DLOAD # 06 - LOAD MPAC WITH A DP SCALAR.
039417,000284: 6257 17576 TCF V/SC # 07 - VECTOR DIVIDED BY SCALAR.
039418,000285:
039419,000286: 6260 16455 TCF SLOAD # 10 - LOAD MPACIN SINGLE PRECISION.
039420,000287: 6261 16574 TCF SSP # 11 - SET SINGLE PRECISION INTO X.
039421,000288: 6262 16477 TCF PDDL # 12 - PUSH DOWN MPAC AND RE-LOAD IN DP.
039422,000289: 6263 17306 TCF MXV # 13 - MATRIX POST-MULTIPLIED BY VECTOR.
039423,000290: 6264 16533 TCF PDVL # 14 - PUSH DOWN AND VECTOR LOAD.
039424,000291: 6265 16602 TCF CCALL # 15 - COMPUTED CALL.
039425,000292: 6266 17311 TCF VXM # 16 - MATRIX PRE-MULTIPLIED BY VECTOR.
039426,000293: 6267 17570 TCF TSLC # 17 - NORMALIZE MPAC (SCALAR ONLY).
039427,000294:
039428,000295: 6270 17546 TCF DMPR # 20 - DP MULTIPLY AND ROUND.
039429,000296: 6271 17551 TCF DDV # 21 - DP DIVIDE BY.
039430,000297: 6272 17555 TCF BDDV # 22 - DP DIVIDE INTO.
039431,000298: 6273 17573 TCF GSHIFT # 23 - GENERAL SHIFT INSTRUCTION.
039432,000299: 6274 16725 TCF VAD # 24 - VECTOR ADD.
039433,000300: 6275 16723 TCF VSU # 25 - VECTOR SUBTRACT.
039434,000301: 6276 17012 TCF BVSU # 26 - VECTOR SUBTRACT FROM.
039435,000302: 6277 17303 TCF DOT # 27 - VECTOR DOT PRODUCT.
039436,000303:
039437,000304: 6300 17432 TCF VXV # 30 - VECTOR CROSS PRODUCT.
039438,000305: 6301 17377 TCF VPROJ # 31 - VECTOR PROJECTION.
039439,000306: 6302 16761 TCF DSU # 32 - DP SUBTRACT.
039440,000307: 6303 17036 TCF BDSU # 33 - DP SUBTRACT FROM.
039441,000308: 6304 16751 TCF DAD # 34 - DP ADD.
039442,000309: 6305 16305 TCF +0 # 35 - AVAILABLE
039443,000310: 6306 17544 TCF DMP1 # 36 - DP MULTIPLY.
039444,000311: 6307 17565 TCF SETPD # 37 - SET PUSH DOWN POINTER (DIRECT ONLY)
039445,000312:
039446,000313: # CODES 10 AND 14 MUST NOT PUSH UP. CODE 04 MAY BE USED FOR VECTOR DECLARE BEFORE PUSHUP IF DESIRED.
039447,000314:
039448,000315: # THE FOLLOWING JUMP TABLE APPLIES TO INDEX, BRANCH, AND MISCELLANEOUS INSTRUCTIONS.
039449,000316:
039450,000317: 6310 12165 MISCJUMP TCF AXT # 00 - ADDRESS TO INDEX TRUE.
039451,000318: 6311 12172 TCF AXC # 01 - ADDRESS TO INDEX COMPLEMENTED.
039452,000319: 6312 12175 TCF LXA # 02 - LOAD INDEX FROM ERASABLE.
039453,000320: 6313 12201 TCF LXC # 03 - LOAD INDEX FROM COMPLEMENT OF ERAS.
039454,000321: 6314 12205 TCF SXA # 04 - STORE INDEX IN ERASABLE.
039455,000322: 6315 12213 TCF XCHX # 05 - EXCHANGE INDEX WITH ERASABLE.
039456,000323: 6316 12227 TCF INCR # 06 - INCREMENT INDEX REGISTER.
039457,000324: 6317 12236 TCF TIX # 07 - TRANSFER ON INDEX.
039458,000325:
039459,000326: 6320 12221 TCF XAD # 10 - INDEX REGISTER ADD FROM ERASABLE.
039460,000327: 6321 12232 TCF XSU # 11 - INDEX SUBTRACT FROM ERASABLE.
039461,000328: 6322 12310 TCF BZE/GOTO # 12 - BRANCH ZERO AND GOTO.
039462,000329: 6323 12315 TCF BPL/BMN # 13 - BRANCH PLUS AND BRANCH MINUS.
039463,000330: 6324 12270 TCF RTB/BHIZ # 14 - RETURN TO BASIC AND BRANCH HI ZERO.
039464,000331: 6325 12330 TCF CALL/ITA # 15 - CALL AND STORE QPRET.
039465,000332: 6326 12337 TCF SW/ # 16 - SWITCH INSTRUCTIONS AND AVAILABLE.
039466,000333: 6327 12300 TCF BOV(B) # 17 - BRANCH ON OVERFLOW TO BASIC OR INT.
039467,000334:
039468,000335: # THE FOLLOWING JUMP TABLE APPIES TO UNARY INSTRUCTIONS.
039469,000336:
039470,000337: 6330 COUNT* $$/INTER
039471,000338: 00,2000 BANK 0 # 00 - EXIT - DETECTED EARLIER.
039472,000339: 00,2000 13207 UNAJUMP TCF SQRT # 01 - SQUARE ROOT.
039473,000340: 00,2001 13527 TCF SINE # 02 - SIN.
039474,000341: 00,2002 13516 TCF COSINE # 03 - COS.
039475,000342: 00,2003 13607 TCF ARCSIN # 04 - ARC SIN.
039476,000343: 00,2004 13611 TCF ARCCOS # 05 - ARC COS.
039477,000344: 00,2005 13174 TCF DSQ # 06 - DP SQUARE.
039478,000345: 00,2006 12116 TCF ROUND # 07 - ROUND TO DP.
039479,000346:
039480,000347: 00,2007 17642 TCF COMP # 10 - COMPLEMENT VECTOR OR SCALAR.
039481,000348: 00,2010 13232 TCF VDEF # 11 - VECTOR DEFINE.
039482,000349: 00,2011 13023 TCF UNIT # 12 - UNIT VECTOR.
039483,000350: 00,2012 13176 TCF ABVALABS # 13 - LENGTH OF VECTOR OR MAG OF SCALAR.
039484,000351: 00,2013 13245 TCF VSQ # 14 - SQUARE OF LENGTH OF VECTOR.
039485,000352: 00,2014 16330 TCF STADR # 15 - PUSH UP ON STORE CODE.
039486,000353: 00,2015 13274 TCF RVQ # 16 - RETURN VIA QPRET.
039487,000354: 00,2016 13247 TCF PUSH # 17 - PUSH MPAC DOWN.
039488,000355:
039489,000356: # SECTION 2 LOAD AND STORE PACKAGE.
039490,000357:
039491,000358: # A SET OF EIGHT STORE CODES IS PROVIDED AS THE PRIMARY METHOD OF STORING THE MULTI-PURPOSE
039492,000359: # ACCUMULATOR (MPAC). IF IN THE DANZIG SECTION LOC REFERS TO AN ALGEBRAICALLY POSITIVE WORD, IT IS TAKEN AS A
039493,000360: # STORE CODE WITH A CORRESPONDING ERASABLE ADDRESS. MOST OF THESE CODES ARE TWO ADDRESS, SPECIFYING THAT THE WORD
039494,000361: # FOLLOWING THE STORE CODE IS TO BE USED AS AN ADDRESS FROM WHICH TO RE-LOAD MPAC. FOUR OPTIONS ARE AVAILABLE:
039495,000362:
039496,000363: # 1. STORE STORE MPAC. THE E ADDRESS MAY BE INDEXED.
039497,000364: # 2. STODL STORE MPAC AND RE-LOAD IT IN DP WITH THE NEXT ADDRESS (THE LOAD MAY BE INDEXED).
039498,000365: # 3. STOVL STORE MPAC AND RE-LOAD A VECTOR (AS ABOVE).
039499,000366: # 4. STCALL STORE AND DO A CALL (BOTH ADDRESSES MUST BE DIRECT HERE).
039500,000367:
039501,000368: # STODL AND STOVL WILL TAKE FROM THE PUSH-DOWN LIST IF NO LOAD ADDRESS IS GIVEN.
039502,000369:
039503,000370: 6330 BLOCK 3
039504,000371:
039505,000372: 6330 COUNT* $$/INTER
039506,000373: 6330 30165 STADR CA BANKSET # THE STADR CODE (PUSHUP UP ON STORE
039507,000374: 6331 54004 TS FBANK # ADDRESS) ENTERS HERE.
039508,000375: 6332 24164 INCR LOC
039509,000376: 6333 50164 ITR1 INDEX LOC # THE STORECODE WAS STORED COMPLEMENTED TO
039510,000377: 6334 40000 CS 0 # MAKE IT LOOK LIKE AN OPCODE PAIR.
039511,000378: 6335 67721 AD NEGONE # (YUL CANT REMOVE 1 BECAUSE OF EARLY CCS)
039512,000379:
039513,000380: 6336 54116 DOSTORE TS ADDRWD
039514,000381: 6337 74370 MASK LOW11 # ENTRY FROM DISPATCHER. SAVE THE ERASABLE
039515,000382: 6340 56116 XCH ADDRWD # ADDRESS AND JUMP ON THE STORE CODE NO.
039516,000383: 6341 77674 MASK B12T14
039517,000384: 6342 00006 EXTEND
039518,000385: 6343 75022 MP BIT5 # EACH TRANSFER VECTOR ENTRY IS TWO WORDS.
039519,000386: 6344 50000 ITR0 INDEX A
039520,000387: 6345 16346 TCF STORJUMP
039521,000388:
039522,000389: # STORE CODE JUMP TABLE. CALLS THE APPROPRIATE STORING ROUTINE AND EXITS TO DANZIG OR TO ADDRESS WITH
039523,000390: # A SUPPLIED OPERATION CODE.
039524,000391:
039525,000392: # STORE STORE,1 AND STORE,2 RETURN TO DANZIG, THUS RESETTING THE EBANK TO ITS STATE AT INTPRET.
039526,000393:
039527,000394: 6346 06376 STORJUMP TC STORE # STORE.
039528,000395: 6347 16035 TCF DANZIG # PICK UP NEW OP CODE(S).
039529,000396: 6350 06370 TC STORE,1
039530,000397: 6351 16035 TCF DANZIG
039531,000398: 6352 06373 TC STORE,2
039532,000399: 6353 16035 TCF DANZIG
039533,000400:
039534,000401: 6354 06376 TC STORE # STODL.
039535,000402: 6355 16434 TCF DODLOAD
039536,000403:
039537,000404: 6356 06376 TC STORE # STODL WITH INDEXED LOAD ADDRESS.
039538,000405: 6357 16120 TCF DODLOAD*
039539,000406:
039540,000407: 6360 06376 TC STORE # STOVL.
039541,000408: 6361 16437 TCF DOVLOAD
039542,000409:
039543,000410: 6362 06376 TC STORE # STOVL WITH INDEXED LOAD ADDRESS.
039544,000411: 6363 16442 TCF DOVLOAD*
039545,000412: 6364 06376 TC STORE # STOTC.
039546,000413: 6365 35036 CAF CALLCODE
039547,000414: 6366 54020 TS CYR
039548,000415: 6367 16226 TCF 15BITADR # GET A 15 BIT ADDRESS.
039549,000416:
039550,000417: # STORE CODE ADDRESS PROCESSOR.
039551,000418:
039552,000419: 6370 50120 STORE,1 INDEX FIXLOC
039553,000420: 6371 40046 CS X1
039554,000421: 6372 16375 TCF PRESTORE
039555,000422:
039556,000423: 6373 50120 STORE,2 INDEX FIXLOC
039557,000424: 6374 40047 CS X2
039558,000425: 6375 26116 PRESTORE ADS ADDRWD # RESULTANT ADDRESS IS IN ERASABLE.
039559,000426:
039560,000427: 6376 40116 STORE CS ADDRWD
039561,000428: 6377 65042 AD DEC45
039562,000429: 6400 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
039563,000430: 6401 30120 CA FIXLOC # YES.
039564,000431: 6402 16407 TCF AHEAD5
039565,000432: 6403 35057 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
039566,000433: 6404 56116 XCH ADDRWD
039567,000434: 6405 54003 TS EBANK
039568,000435: 6406 74371 MASK LOW8
039569,000436: 6407 26116 AHEAD5 ADS ADDRWD
039570,000437:
039571,000438: # STORING ROUTINES. STORE DP, TP, OR VECTOR AS INDICATED BY MODE.
039572,000439:
039573,000440: 6410 00006 STARTSTO EXTEND # MPAC,+1 MUST BE STORED IN ANY EVENT.
039574,000441: # ITRACE (5) REFERS TO "STARTSTO".
039575,000442: 6411 30155 DCA MPAC
039576,000443: 6412 50116 INDEX ADDRWD
039577,000444: 6413 52001 DXCH 0
039578,000445:
039579,000446: 6414 10163 CCS MODE
039580,000447: 6415 16430 TCF TSTORE
039581,000448: 6416 00002 TC Q
039582,000449:
039583,000450: 6417 00006 VSTORE EXTEND
039584,000451: 6420 30160 DCA MPAC +3
039585,000452: 6421 50116 INDEX ADDRWD
039586,000453: 6422 52003 DXCH 2
039587,000454:
039588,000455: 6423 00006 EXTEND
039589,000456: 6424 30162 DCA MPAC +5
039590,000457: 6425 50116 INDEX ADDRWD
039591,000458: 6426 52005 DXCH 4
039592,000459: 6427 00002 TC Q
039593,000460:
039594,000461: 6430 30156 TSTORE CA MPAC +2
039595,000462: 6431 50116 INDEX ADDRWD
039596,000463: 6432 54002 TS 2
039597,000464: 6433 00002 TC Q
039598,000465:
039599,000466: # ROUTINES TO BEGIN PROCESSING OF THE SECOND ADDRESS ASSOCIATED WITH ALL STORE-TYPE CODES EXCEPT STORE
039600,000467: # ITSELF.
039601,000468:
039602,000469: 6434 37704 DODLOAD CAF DLOADCOD
039603,000470: 6435 54020 TS CYR
039604,000471: 6436 16062 TCF DIRADRES # GO GET A DIRECT ADDRESS.
039605,000472:
039606,000473: 6437 35010 DOVLOAD CAF VLOADCOD
039607,000474: 6440 54020 TS CYR
039608,000475: 6441 16062 TCF DIRADRES
039609,000476:
039610,000477: 6442 36063 DOVLOAD* CAF VLOAD*
039611,000478: 6443 16121 TCF DODLOAD* +1 # PROLOGUE TO INDEX ROUTINE.
039612,000479:
039613,000480: # THE FOLLOWING LOAD INSTRUCTIONS ARE PROVIDED FOR LOADING THE MULTI-PURPOSE ACCUMULATOR MPAC.
039614,000481:
039615,000482: 6444 50116 TLOAD INDEX ADDRWD
039616,000483: 6445 30002 CA 2 # LOAD A TRIPLE PRECISION ARGUMENT INTO
039617,000484: 6446 54156 TS MPAC +2 # THE FIRST THREE MPAC REGISTERS, WITH THE
039618,000485: 6447 00006 EXTEND # CONTENTS OF THE OTHER FOUR IRRELEVANT.
039619,000486: 6450 50116 INDEX ADDRWD
039620,000487: 6451 30001 DCA 0
039621,000488: 6452 52155 DXCH MPAC
039622,000489: 6453 35026 TMODE CAF ONE
039623,000490: 6454 16034 TCF NEWMODE # DECLARE TRIPLE PRECISION MODE.
039624,000491:
039625,000492: 6455 22007 SLOAD ZL # LOAD A SINGLE PRECISION NUMBER INTO
039626,000493: 6456 50116 INDEX ADDRWD # MPAC, SETTING MPAC+1,2 TO ZERO. THE
039627,000494: 6457 30000 CA 0 # CONTENTS OF THE REMAINING MPAC REGISTERS
039628,000495: 6460 16031 TCF SLOAD2 # ARE IRRELEVANT.
039629,000496:
039630,000497: 6461 00006 VLOAD EXTEND # LOAD A DOUBLE PRECISION VECTOR INTO
039631,000498: 6462 50116 INDEX ADDRWD # MPAC,+1, MPAC+3,4, AND MPAC+5,6. THE
039632,000499: 6463 30001 DCA 0 # CONTENTS OF MPAC +2 ARE IRRELEVANT.
039633,000500: 6464 52155 DXCH MPAC
039634,000501:
039635,000502: 6465 00006 ENDVLOAD EXTEND # PDVL COMES HERE TO FINISH UP FOR DP, TP.
039636,000503: 6466 50116 INDEX ADDRWD
039637,000504: 6467 30003 DCA 2
039638,000505: 6470 52160 DXCH MPAC +3
039639,000506:
039640,000507: 6471 00006 +4 EXTEND # TPDVL FINISHES HERE.
039641,000508: 6472 50116 INDEX ADDRWD
039642,000509: 6473 30005 DCA 4
039643,000510: 6474 52162 DXCH MPAC +5
039644,000511:
039645,000512: 6475 45026 VMODE CS ONE # DECLARE VECTOR MODE.
039646,000513: 6476 16034 TCF NEWMODE
039647,000514:
039648,000515: # THE FOLLOWING INSTRUCTIONS ARE PROVIDED FOR STORING OPERANDS IN THE PUSHDOWN LIST:
039649,000516:
039650,000517: # 1. PUSH PUSHDOWN AND NO LOAD.
039651,000518: # 2. PDDL PUSHDOWN AND DOUBLE PRECISION LOAD.
039652,000519: # 3. PDVL PUSHDOWN AND VECTOR LOAD.
039653,000520:
039654,000521: 6477 00006 PDDL EXTEND
039655,000522: 6500 50116 INDEX ADDRWD # LOAD MPAC,+1, PUSHING THE FORMER
039656,000523: 6501 30001 DCA 0 # CONTENTS DOWN.
039657,000524: 6502 52155 DXCH MPAC
039658,000525: 6503 50166 INDEX PUSHLOC
039659,000526: 6504 52001 DXCH 0
039660,000527:
039661,000528: 6505 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER APPRO-
039662,000529: 6506 36220 CAF NO.WDS # PRIATELY.
039663,000530: 6507 26166 ADS PUSHLOC
039664,000531:
039665,000532: 6510 10163 CCS MODE
039666,000533: 6511 16526 TCF ENDTPUSH
039667,000534: 6512 16524 TCF ENDDPUSH
039668,000535:
039669,000536: 6513 54163 TS MODE # NOW DP.
039670,000537: 6514 54156 ENDVPUSH TS MPAC +2
039671,000538: 6515 52160 DXCH MPAC +3 # PUSH DOWN THE REST OF THE VECTOR HERE.
039672,000539: 6516 50166 INDEX PUSHLOC
039673,000540: 6517 51775 DXCH 0 -4
039674,000541:
039675,000542: 6520 52162 DXCH MPAC +5
039676,000543: 6521 50166 INDEX PUSHLOC
039677,000544: 6522 51777 DXCH 0 -2
039678,000545:
039679,000546: 6523 16035 TCF DANZIG
039680,000547:
039681,000548: 6524 54156 ENDDPUSH TS MPAC +2 # SET MPAC +2 TO ZERO AND EXIT ON DP.
039682,000549: 6525 16035 TCF DANZIG
039683,000550:
039684,000551: 6526 54163 ENDTPUSH TS MODE
039685,000552: 6527 56156 XCH MPAC +2 # ON TRIPLE, SET MPAC +2 TO ZERO, PUSHING
039686,000553: 6530 50166 +2 INDEX PUSHLOC # DOWN THE OLD CONTENTS
039687,000554: 6531 53777 TS 0 -1
039688,000555: 6532 16035 TCF DANZIG
039689,000556:
039690,000557: # PDVL - PUSHDOWN AND VECTOR LOAD.
039691,000558:
039692,000559: 6533 00006 PDVL EXTEND # RELOAD MPAC AND PUSH DOWN ITS CONTENTS.
039693,000560: 6534 50116 INDEX ADDRWD
039694,000561: 6535 30001 DCA 0
039695,000562: 6536 52155 DXCH MPAC
039696,000563: 6537 50166 INDEX PUSHLOC
039697,000564: 6540 52001 DXCH 0
039698,000565:
039699,000566: 6541 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER.
039700,000567: 6542 36220 CAF NO.WDS
039701,000568: 6543 26166 ADS PUSHLOC
039702,000569:
039703,000570: 6544 10163 CCS MODE # TEST PAST MODE.
039704,000571: 6545 16564 TCF TPDVL
039705,000572: 6546 16465 TCF ENDVLOAD # JUST LOAD LAST FOUR REGISTERS ON DP.
039706,000573:
039707,000574: 6547 00006 VPDVL EXTEND # PUSHDOWN AND RE-LOAD LAST TWO COMPONENTS
039708,000575: 6550 50116 INDEX ADDRWD
039709,000576: 6551 30003 DCA 2
039710,000577: 6552 52160 DXCH MPAC +3
039711,000578: 6553 50166 INDEX PUSHLOC
039712,000579: 6554 51775 DXCH 0 -4
039713,000580:
039714,000581: 6555 00006 EXTEND
039715,000582: 6556 50116 INDEX ADDRWD
039716,000583: 6557 30005 DCA 4
039717,000584: 6560 52162 DXCH MPAC +5
039718,000585: 6561 50166 INDEX PUSHLOC
039719,000586: 6562 51777 DXCH 0 -2
039720,000587:
039721,000588: 6563 16035 TCF DANZIG
039722,000589:
039723,000590: 6564 00006 TPDVL EXTEND # ON TP, WE MUST LOAD THE Y COMPONENT
039724,000591: 6565 50116 INDEX ADDRWD # BEFORE STORING MPAC +2 IN CASE THIS IS A
039725,000592: 6566 30003 DCA 2 # PUSHUP.
039726,000593: 6567 52160 DXCH MPAC +3
039727,000594:
039728,000595: 6570 30156 CA MPAC +2
039729,000596: 6571 50166 INDEX PUSHLOC # IN DP.
039730,000597: 6572 53777 TS 0 -1
039731,000598: 6573 16471 TCF ENDVLOAD +4
039732,000599:
039733,000600: # SSP (STORE SINGLE PRECISION) IS EXECUTED HERE.
039734,000601:
039735,000602: 6574 24164 SSP INCR LOC # PICK UP THE WORD FOLLOWING THE GIVEN
039736,000603: 6575 50164 INDEX LOC # ADDRESS AND STORE IT AT X.
039737,000604: 6576 30000 CA 0
039738,000605: 6577 50116 STORE1 INDEX ADDRWD # SOME INDEX AND MISCELLANEOUS OPS END
039739,000606: 6600 54000 TS 0 # HERE.
039740,000607: 6601 16035 TCF DANZIG
039741,000608:
039742,000609: # SEQUENCE CHANGING AND SUBROUTINE CALLING OPTIONS.
039743,000610:
039744,000611: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR SEQUENCING CHANGING, BRANCHING, AND CALLING SUBROUTINES:
039745,000612:
039746,000613: # 1. GOTO GO TO.
039747,000614: # 2. CALL CALL SUBROUTINE SETTING QPRET.
039748,000615: # 3. CGOTO COMPUTED GO TO.
039749,000616: # 4. CCALL COMPUTED CALL.
039750,000617: # 7. BPL BRANCH IF MPAC POSITIVE OR ZERO.
039751,000618: # 8. BZE BRANCH IF MPAC ZERO.
039752,000619: # 9. BMN BRANCH IF MPAC NEGATIVE NON-ZERO.
039753,000620:
039754,000621: 6602 24164 CCALL INCR LOC # MAINTAIN LOC FOR QPRET COMPUTATION.
039755,000622: 6603 50164 INDEX LOC
039756,000623: 6604 30000 CAF 0 # GET BASE ADDRESS OF CADR LIST.
039757,000624: 6605 50116 INDEX ADDRWD
039758,000625: 6606 60000 AD 0 # ADD INCREMENT.
039759,000626: 6607 54004 TS FBANK # SELECT DESIRED CADR.
039760,000627: 6610 75062 MASK LOW10
039761,000628: 6611 50000 INDEX A
039762,000629: 6612 32000 CAF 10000
039763,000630: 6613 54117 TS POLISH
039764,000631:
039765,000632: 6614 30165 CALL CA BANKSET # FOR ANY OF THE CALL OPTIONS, MAKE UP THE
039766,000633: 6615 74362 MASK BANKMASK # ADDRESS OF THE NEXT OP-CODE PAIR/STORE
039767,000634: 6616 64362 AD BANKMASK # CODE AND LEAVE IT IN QPRET. NOTE THAT
039768,000635: 6617 60164 AD LOC # BANKMASK = -(2000 - 1).
039769,000636: 6620 50120 INDEX FIXLOC
039770,000637: 6621 54052 TS QPRET
039771,000638:
039772,000639: 6622 30117 GOTO CA POLISH # BASIC BRANCHING SEQUENCE.
039773,000640: 6623 77713 +1 MASK HIGH4
039774,000641: 6624 00006 EXTEND
039775,000642: 6625 16636 BZF GOTOERS # SEE IF ADDRESS POINTS TO FIXED OR ERAS.
039776,000643: 6626 30165 +4 CA BANKSET # SET EBANK PART OF BBANK. NEXT, SET UP
039777,000644: 6627 54006 TS BBANK # FBANK. THE COMBINATION IS PICKED UP &
039778,000645: 6630 30117 CA POLISH # PUT INTO BANKSET AT INTPRET +2.
039779,000646: 6631 54004 TS FBANK
039780,000647: 6632 75062 MASK LOW10
039781,000648: 6633 65014 AD 2K
039782,000649: 6634 54164 TS LOC
039783,000650: 6635 16016 TCF INTPRET +2
039784,000651:
039785,000652: 6636 E3,1400 EBANK= 1400 # SO YUL DOESN'T CUSS THE "CA 1400" BELOW.
039786,000653:
039787,000654: 6636 30117 GOTOERS CA POLISH # THE GIVEN ADDRESS IS IN ERASABLE - SEE
039788,000655: 6637 66225 AD -ENDVAC # IF RELATIVE TO THE WORK AREA.
039789,000656: 6640 10000 CCS A
039790,000657: 6641 30117 CA POLISH # GENERAL ERASABLE.
039791,000658: 6642 16651 TCF GOTOGE
039792,000659:
039793,000660: 6643 30120 CA FIXLOC # WORK AREA.
039794,000661: 6644 60117 AD POLISH
039795,000662: 6645 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
039796,000663: 6646 30000 CA 0 # THE BRANCH ADDRESS.
039797,000664: 6647 54117 TS POLISH
039798,000665: 6650 16623 TCF GOTO +1 # ALLOWS ARBITRARY INDIRECTNESS LEVELS.
039799,000666:
039800,000667: 6651 54003 GOTOGE TS EBANK
039801,000668: 6652 74371 MASK LOW8
039802,000669: 6653 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
039803,000670: 6654 31400 CA 1400 # THE BRANCH ADDRESS.
039804,000671: 6655 54117 TS POLISH
039805,000672: 6656 16623 TCF GOTO +1
039806,000673:
039807,000674: 6657 50164 CGOTO INDEX LOC # COMPUTED GO TO. PICK UP ADDRESS OF CADR
039808,000675: 6660 30001 CA 1 # LIST.
039809,000676: 6661 50116 INDEX ADDRWD # ADD MODIFIER.
039810,000677: 6662 60000 AD 0
039811,000678: 6663 54004 TS FBANK # SELECT GOTO ADDRESS.
039812,000679: 6664 75062 MASK LOW10
039813,000680: 6665 50000 INDEX A
039814,000681: 6666 32000 CA 10000
039815,000682: 6667 54117 TS POLISH
039816,000683: 6670 16623 TCF GOTO +1 # WITH ADDRESS IN A.
039817,000684:
039818,000685: 6671 30165 SWBRANCH CA BANKSET # SWITCH INSTRUCTIONS WHICH ELECT TO
039819,000686: 6672 54004 TS FBANK # BRANCH COME HERE TO DO SO.
039820,000687: 6673 50164 INDEX LOC
039821,000688: 6674 30001 CA 1
039822,000689: 6675 54117 TS POLISH
039823,000690: 6676 16623 TCF GOTO +1
039824,000691:
039825,000692: # TRIPLE PRECISION BRANCHING ROUTINE. IF CALLING TC IS AT L, RETURN IS AS FOLLOWS:
039826,000693:
039827,000694: # L+1 IF MPAC IS GREATER THAN ZERO.
039828,000695: # L+2 IF MPAC IS EQUAL TO +0 OR -0.
039829,000696: # L+3 IF MPAC IS LESS THAN ZERO.
039830,000697:
039831,000698:
039832,000699: 6677 10154 BRANCH CCS MPAC
039833,000700: 6700 00002 TC Q
039834,000701: 6701 16703 TCF +2 # ON ZERO.
039835,000702: 6702 16715 TCF NEG
039836,000703:
039837,000704: 6703 10155 CCS MPAC +1
039838,000705: 6704 00002 TC Q
039839,000706: 6705 16707 TCF +2
039840,000707: 6706 16715 TCF NEG
039841,000708:
039842,000709: 6707 10156 CCS MPAC +2
039843,000710: 6710 00002 TC Q
039844,000711: 6711 16713 TCF +2
039845,000712: 6712 16715 TCF NEG
039846,000713:
039847,000714: 6713 50002 Q+1 INDEX Q
039848,000715: 6714 00001 TC 1
039849,000716:
039850,000717: 6715 50002 NEG INDEX Q # IF FIRST NON-ZERO REGISTER WAS NEGATIVE.
039851,000718: 6716 00002 TC 2
039852,000719:
039853,000720:
039854,000721: 6717 6715 Q+2 = NEG
039855,000722:
039856,000723: # ITRACE (3) REFERS TO "EXIT".
039857,000724: 6717 30165 EXIT CA BANKSET # RESTORE USER'S BANK SETTING, AND LEAVE
039858,000725: 6720 54006 TS BBANK # INTERPRETIVE MODE.
039859,000726: 6721 50164 INDEX LOC
039860,000727: 6722 00001 TC 1
039861,000728:
039862,000729: # SECTION 3 - ADD/SUBTRACT PACKAGE.
039863,000730:
039864,000731: # THE FOLLOWING OPERATIONS ARE PROVIDED FOR ADDING TO AND SUBTRACTING FROM THE MULTI-PURPOSE ACCUMULATOR
039865,000732: # MPAC:
039866,000733:
039867,000734: # 1. DAD DOUBLE PRECISION ADD.
039868,000735: # 2. DSU DOUBLE PRECISION SUBTRACT.
039869,000736: # 3. BDSU DOUBLE PRECISION SUBTRACT FROM.
039870,000737:
039871,000738: # 4. TAD TRIPLE PRECISION ADD.
039872,000739:
039873,000740: # 5. VAD VECTOR ADD.
039874,000741: # 6. VSU VECTOR SUBTRACT.
039875,000742: # 7. BVSU VECTOR SUBTRACT FROM.
039876,000743:
039877,000744: # THE INTERPRETIVE OVERFLOW INDICATOR OVFIND IS SET NON-ZERO IF OVERFLOW OCCURS IN ANY OF THE ABOVE.
039878,000745:
039879,000746: 6723 35010 VSU CAF BIT15 # CHANGES 0 TO DCS.
039880,000747: 6724 16726 TCF +2
039881,000748:
039882,000749: 6725 34367 VAD CAF PRIO30 # CHANGES 0 TO DCA.
039883,000750: 6726 26116 ADS ADDRWD
039884,000751: 6727 00006 EXTEND
039885,000752: 6730 50116 INDEX ADDRWD
039886,000753: 6731 00003 READ HISCALAR # DCA 2 OR DCS 2
039887,000754: 6732 20160 DAS MPAC +3
039888,000755: 6733 00006 EXTEND # CHECK OVERFLOW.
039889,000756: 6734 16736 BZF +2
039890,000757: 6735 06770 TC OVERFLWY
039891,000758:
039892,000759: 6736 00006 EXTEND
039893,000760: 6737 50116 INDEX ADDRWD
039894,000761: 6740 00005 READ CHAN5 # DCA 4 OR DCS 4
039895,000762: 6741 20162 DAS MPAC +5
039896,000763: 6742 00006 EXTEND
039897,000764: 6743 16745 BZF +2
039898,000765: 6744 06765 TC OVERFLWZ
039899,000766:
039900,000767: 6745 00006 EXTEND
039901,000768: 6746 50116 INDEX ADDRWD
039902,000769: 6747 00001 READ LCHAN # DCA 0 OR DCS 0
039903,000770: 6750 16754 TCF ENDVXV
039904,000771:
039905,000772: 6751 00006 DAD EXTEND
039906,000773: 6752 50116 INDEX ADDRWD
039907,000774: 6753 30001 DCA 0
039908,000775: 6754 20155 ENDVXV DAS MPAC # VXV FINISHES HERE.
039909,000776: 6755 00006 EXTEND
039910,000777: 6756 16035 BZF DANZIG
039911,000778:
039912,000779: 6757 06773 SETOVF TC OVERFLOW
039913,000780: 6760 16035 TCF DANZIG
039914,000781:
039915,000782: 6761 00006 DSU EXTEND
039916,000783: 6762 50116 INDEX ADDRWD
039917,000784: 6763 40001 DCS 0
039918,000785: 6764 16754 TCF ENDVXV
039919,000786:
039920,000787: 6765 54001 OVERFLWZ TS L # ENTRY FOR THIRD COMPONENT.
039921,000788: 6766 35031 CAF FIVE
039922,000789: 6767 16772 TCF +3
039923,000790:
039924,000791: 6770 54001 OVERFLWY TS L # ENTRY FOR SECOND COMPONENT.
039925,000792: 6771 36221 CAF THREE
039926,000793: 6772 56001 XCH L
039927,000794:
039928,000795: 6773 50000 OVERFLOW INDEX A # ENTRY FOR 1ST COMP OR DP (L=0).
039929,000796: 6774 45007 CS LIMITS # PICK UP POSMAX OR NEGMAX.
039930,000797: 6775 54130 TS BUF
039931,000798: 6776 00006 EXTEND
039932,000799: 6777 24000 AUG A # FORCE OVERFLOW.
039933,000800: 7000 50001 INDEX L
039934,000801: 7001 26155 ADS MPAC +1
039935,000802: 7002 54007 TS 7
039936,000803: 7003 35030 CAF ZERO
039937,000804: 7004 60130 AD BUF
039938,000805: 7005 50001 INDEX L
039939,000806: 7006 26154 ADS MPAC
039940,000807: 7007 54007 TS 7
039941,000808: 7010 00002 TC Q # NO OVERFLOW EXIT.
039942,000809: 7011 17126 TCF SETOVF2 # SET OVFIND AND EXIT.
039943,000810:
039944,000811: 7012 00006 BVSU EXTEND
039945,000812: 7013 50116 INDEX ADDRWD
039946,000813: 7014 30003 DCA 2
039947,000814: 7015 52160 DXCH MPAC +3
039948,000815: 7016 00006 EXTEND
039949,000816: 7017 40001 DCOM
039950,000817: 7020 20160 DAS MPAC +3
039951,000818: 7021 00006 EXTEND
039952,000819: 7022 17024 BZF +2
039953,000820: 7023 06770 TC OVERFLWY
039954,000821:
039955,000822: 7024 00006 EXTEND
039956,000823: 7025 50116 INDEX ADDRWD
039957,000824: 7026 30005 DCA 4
039958,000825: 7027 52162 DXCH MPAC +5
039959,000826: 7030 00006 EXTEND
039960,000827: 7031 40001 DCOM
039961,000828: 7032 20162 DAS MPAC +5
039962,000829: 7033 00006 EXTEND
039963,000830: 7034 17036 BZF +2
039964,000831: 7035 06765 TC OVERFLWZ
039965,000832:
039966,000833: 7036 00006 BDSU EXTEND
039967,000834: 7037 50116 INDEX ADDRWD
039968,000835: 7040 30001 DCA 0
039969,000836: 7041 52155 DXCH MPAC
039970,000837: 7042 00006 EXTEND
039971,000838: 7043 40001 DCOM
039972,000839: 7044 16754 TCF ENDVXV
039973,000840:
039974,000841: # TRIPLE PRECISION ADD ROUTINE.
039975,000842:
039976,000843: 7045 00006 TAD EXTEND
039977,000844: 7046 50116 INDEX ADDRWD
039978,000845: 7047 30002 DCA 1 # ADD MINOR PARTS FIRST.
039979,000846: 7050 20156 DAS MPAC +1
039980,000847: 7051 50116 INDEX ADDRWD
039981,000848: 7052 60000 AD 0
039982,000849: 7053 60154 AD MPAC
039983,000850: 7054 54154 TS MPAC
039984,000851: 7055 16035 TCF DANZIG
039985,000852:
039986,000853: 7056 16757 TCF SETOVF # SET OVFIND IF SUCH OCCURS.
039987,000854:
039988,000855: # ARITHMETIC SUBROUTINES REQUIRED IN FIXED-FIXED.
039989,000856:
039990,000857: # 1. DMPSUB DOUBLE PRECISION MULTIPLY. MULTIPLY THE CONTENTS OF MPAC,+1 BY THE DP WORD WHOSE ADDRESS
039991,000858: # IS IN ADDRWD AND LEAVE A TRIPLE PRECISION RESULT IN MPAC.
039992,000859: # 2. ROUNDSUB ROUND THE TRIPLE PRECISON CONTENTS OF MPAC TO DOUBLE PRECISION.
039993,000860: # 3. DOTSUB TAKE THE DOT PRODUCT OF THE VECTOR IN MPAC AND THE VECTOR WHOSE ADDRESS IS IN ADDRWD
039994,000861: # AND LEAVE THE TRIPLE PRECISION RESULT IN MPAC.
039995,000862: # 4. POLY USING THE CONTENTS OF MPAC AS A DP ARGUMENT, EVALUATE THE POLYNOMIAL WHOSE DEGREE AND
039996,000863: # COEFFICIENTS IMMEDIATELY FOLLOW THE TC POLY INSTRUCTION (SEE ROUTINE FOR DETAILS.)
039997,000864:
039998,000865:
039999,000866: 7057 50002 DMP INDEX Q # BASIC SUBROUTINE FOR USE BY PINBALL, ETC
040000,000867: 7060 30000 CAF 0 # ADRES OF ARGUMENT FOLLOWS TC DMP .
040001,000868: 7061 24002 INCR Q
040002,000869: 7062 54116 -1 TS ADDRWD # (PROLOGUE FOR SETTING ADDRWD.)
040003,000870:
040004,000871: 7063 50116 DMPSUB INDEX ADDRWD # GET MINOR PART OF OPERAND AT C(ADDRWD).
040005,000872: 7064 30001 CA 1
040006,000873: 7065 54156 TS MPAC +2 # THIS WORKS FOR SQUARING MPAC AS WELL.
040007,000874: 7066 35030 CAF ZERO # SET MPAC +1 TO ZERO SO WE CAN ACCUMULATE
040008,000875: 7067 56155 XCH MPAC +1 # THE PARTIAL PRODUCTS WITH DAS
040009,000876: 7070 54135 TS MPTEMP # INSTRUCTIONS.
040010,000877: 7071 00006 EXTEND
040011,000878: 7072 70156 MP MPAC +2 # MINOR OF MPAC X MINOR OF C(ADDRWD).
040012,000879:
040013,000880: 7073 56156 XCH MPAC +2 # DISCARD MINOR PART OF ABOVE RESULT AND
040014,000881: 7074 00006 EXTEND # FORM MAJOR OF MPAC X MINOR OF C(ADDRWD).
040015,000882: 7075 70154 MP MPAC
040016,000883: 7076 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
040017,000884:
040018,000885: 7077 50116 INDEX ADDRWD # GET MAJOR PART OF ARGUMENT AT C(ADDRWD).
040019,000886: 7100 30000 CA 0
040020,000887: 7101 56135 XCH MPTEMP # SAVE AND BRING OUT MINOR OF MPAC.
040021,000888: 7102 00006 DMPSUB2 EXTEND
040022,000889: 7103 70135 MP MPTEMP # MAJOR OF C(ADDRWD) X MINOR OF MPAC.
040023,000890: 7104 20156 DAS MPAC +1 # ACCUMULATE, SETTING A TO NET OVERFLOW.
040024,000891:
040025,000892: 7105 56154 XCH MPAC # SETTING MPAC TO 0 OR +-1.
040026,000893: 7106 00006 EXTEND
040027,000894: 7107 70135 MP MPTEMP # MAJOR OF MPAC X MAJOR OF C(ADDRWD).
040028,000895: 7110 20155 DAS MPAC # GUARANTEED NO OVERFLOW.
040029,000896: 7111 00002 TC Q # 49 MCT = .573 MS. INCLUDING RETURN.
040030,000897:
040031,000898: # ROUND MPAC TO DOUBLE PRECISION, SETTING OVFIND ON THE RARE EVENT OF OVERFLOW.
040032,000899:
040033,000900: 7112 35030 ROUNDSUB CAF ZERO # SET MPAC +2 = 0 FOR SCALARS AND CHANGE
040034,000901: 7113 54163 +1 TS MODE # MODE TO DP.
040035,000902:
040036,000903: 7114 56156 VROUND XCH MPAC +2 # BUT WE NEEDNT TAKE THE TIME FOR VECTORS.
040037,000904: 7115 60000 DOUBLE
040038,000905: 7116 54001 TS L
040039,000906: 7117 00002 TC Q
040040,000907:
040041,000908: 7120 60155 AD MPAC +1 # ADD ROUNDING BIT IF MPAC +2 WAS GREATER
040042,000909: 7121 54155 TS MPAC +1 # THAN .5 IN MAGNITUDE.
040043,000910: 7122 00002 TC Q
040044,000911:
040045,000912: 7123 60154 AD MPAC # PROPAGATE INTERFLOW.
040046,000913: 7124 54154 TS MPAC
040047,000914: 7125 00002 TC Q
040048,000915:
040049,000916: 7126 54121 SETOVF2 TS OVFIND # (RARE).
040050,000917: 7127 00002 TC Q
040051,000918:
040052,000919: # THE DOT PRODUCT SUBROUTINE USUALLY FORMS THE DOT PRODUCT OF THE VECTOR IN MPAC WITH A STANDARD SIX
040053,000920: # REGISTER VECTOR WHOSE ADDRESS IS IN ADDRWD. IN THIS CASE C(DOTINC) ARE SET TO 2. VXM, HOWEVER, SETS C(DOTINC) TO
040054,000921: # 6 SO THAT DOTSUB DOTS MPAC WITH A COLUMN VECTOR OF THE MATRIX IN QUESTION IN THIS CASE.
040055,000922:
040056,000923:
040057,000924: 7130 35025 PREDOT CAF TWO # PROLOGUE TO SET DOTINC TO 2.
040058,000925: 7131 54136 TS DOTINC
040059,000926:
040060,000927: 7132 00006 DOTSUB EXTEND
040061,000928: 7133 22137 QXCH DOTRET # SAVE RETURN.
040062,000929: 7134 07063 TC DMPSUB # DOT X COMPONENTS.
040063,000930: 7135 52160 DXCH MPAC +3 # POSITION Y COMPONENT OF MPAC FOR
040064,000931: 7136 52155 DXCH MPAC # MULTIPLICATION WHILE SAVING RESULT IN
040065,000932: 7137 52131 DXCH BUF # THREE WORD BUFFER, BUF.
040066,000933: 7140 30156 CA MPAC +2
040067,000934: 7141 54132 TS BUF +2
040068,000935:
040069,000936: 7142 30136 CA DOTINC # ADVANCE ADDRWD TO Y COMPONENT OF
040070,000937: 7143 26116 ADS ADDRWD # OTHER ARGUMENT.
040071,000938: 7144 07063 TC DMPSUB
040072,000939: 7145 52156 DXCH MPAC +1 # ACCUMULATE PARTIAL PRODUCTS.
040073,000940: 7146 20132 DAS BUF +1
040074,000941: 7147 60154 AD MPAC
040075,000942: 7150 60130 AD BUF
040076,000943: 7151 54130 TS BUF
040077,000944: 7152 17154 TCF +2
040078,000945: 7153 54121 TS OVFIND # IF OVERFLOW OCCURS.
040079,000946:
040080,000947: 7154 52162 DXCH MPAC +5 # MULTIPLY Z COMPONENTS.
040081,000948: 7155 52155 DXCH MPAC
040082,000949: 7156 30136 CA DOTINC
040083,000950: 7157 26116 ADS ADDRWD
040084,000951: 7160 07063 TC DMPSUB
040085,000952: 7161 52132 ENDDOT DXCH BUF +1 # LEAVE FINAL ACCUMULATION IN MPAC.
040086,000953: 7162 20156 DAS MPAC +1
040087,000954: 7163 60154 AD MPAC
040088,000955: 7164 60130 AD BUF
040089,000956: 7165 54154 TS MPAC
040090,000957: 7166 00137 TC DOTRET
040091,000958:
040092,000959: 7167 06773 TC OVERFLOW # ON OVERFLOW HERE.
040093,000960: 7170 00137 TC DOTRET
040094,000961:
040095,000962: # DOUBLE PRECISION POLYNOMIAL EVALUATOR
040096,000963:
040097,000964: # N N-1
040098,000965: # THIS ROUTINE EVALUATES A X + A X + ... + A X + A LEAVING THE DP RESULT IN MPAC ON EXIT.
040099,000966: # N N-1 1 0
040100,000967:
040101,000968: # THE ROUTINE HAS TWO ENTRIES
040102,000969:
040103,000970: # 1. ENTRY THRU POWRSERS. THE COEFFICIENTS MAY BE EITHER IN FIXED OR ERASABLE, THE CALL IS BY
040104,000971: # TC POWRSERS, AND THE RETURN IS TO LOC(TC POWRSERS)+1. THE ENTERING DATA MUST BE AS FOLLOWS
040105,000972:
040106,000973: # A SP LOC-3 ADDRESS FOR REFERENCING COEF TABLE
040107,000974: # L SP N-1 N IS THE DEGREE OF THE POWER SERIES
040108,000975: # MPAC DP X ARGUMENT
040109,000976:
040110,000977: # LOC-2N DP A(0)
040111,000978: # ...
040112,000979: # LOC DP A(N)
040113,000980:
040114,000981: # 2. ENTRY THRU POLY. THE CALL TO POLY AND THE ENTERING DATA MUST BE AS FOLLOWS
040115,000982:
040116,000983: # MPAC DP X ARGUMENT
040117,000984: # LOC TC POLY
040118,000985: # LOC+1 SP N-1
040119,000986: # LOC+2 DP A(0)
040120,000987: # ...
040121,000988: # LOC+2N+2 DP A(N) RETURN IS TO LOC+2N+4
040122,000989:
040123,000990: 7171 00006 POWRSERS EXTEND
040124,000991: 7172 22141 QXCH POLYRET # RETURN ADDRESS
040125,000992: 7173 54117 TS POLISH # POWER SERIES ADDRESS
040126,000993: 7174 22140 LXCH POLYCNT # N-1 TO COUNTER
040127,000994: 7175 17206 TCF POLYCOM # SKIP SET UP BY POLY
040128,000995:
040129,000996: 7176 50002 POLY INDEX Q
040130,000997: 7177 30000 CAF 0
040131,000998: 7200 54140 TS POLYCNT # N-1 TO COUNTER
040132,000999: 7201 60000 DOUBLE
040133,001000: 7202 60002 AD Q
040134,001001: 7203 54117 TS POLISH # L(A(N))-3 TO POLISH
040135,001002: 7204 65031 AD FIVE
040136,001003: 7205 54141 TS POLYRET # STORE RETURN ADDRESS
040137,001004:
040138,001005: 7206 36247 POLYCOM CAF LVBUF # INCOMING X WILL BE MOVED TO VBUF, SO
040139,001006: 7207 54116 TS ADDRWD # SET ADDRWD SO DMPSUB WILL MPY BY VBUF.
040140,001007:
040141,001008: 7210 00006 EXTEND
040142,001009: 7211 50117 INDEX POLISH
040143,001010: 7212 30004 DCA 3
040144,001011: 7213 52155 DXCH MPAC # LOAD A(N) INTO MPAC,
040145,001012: 7214 52123 DXCH VBUF # SAVING X IN VBUF
040146,001013: 7215 17221 TCF POLY2
040147,001014:
040148,001015: 7216 54140 POLYLOOP TS POLYCNT # SAVE DECREMENTED LOOP COUNTER
040149,001016: 7217 45025 CS TWO
040150,001017: 7220 26117 ADS POLISH # REGRESS COEFFICIENT POINTER
040151,001018:
040152,001019: 7221 07063 POLY2 TC DMPSUB # MULTIPLY BY X
040153,001020: 7222 00006 EXTEND
040154,001021: 7223 50117 INDEX POLISH
040155,001022: 7224 30002 DCA 1 # ADD IN NEXT COEFFICIENT
040156,001023: 7225 20155 DAS MPAC # USERS RESPONSIBILITY TO ASSURE NO OVFLOW
040157,001024:
040158,001025: 7226 10140 CCS POLYCNT
040159,001026: 7227 17216 TCF POLYLOOP
040160,001027: 7230 00141 TC POLYRET # RETURN CALLER
040161,001028:
040162,001029: # MISCELLANEOUS MULTI-PRECISION ROUTINES REQUIRED IN FIXED-FIXED BUT NOT USED BY THE INTERPRETER.
040163,001030:
040164,001031: 7231 22002 TPAGREE LXCH Q # FORCE SIGN AGREEMENT AMONG THE TRIPLE
040165,001032: 7232 06677 TC BRANCH # PRECISION CONTENTS OF MPAC. RETURNING
040166,001033: 7233 17237 TCF ARG+ # WITH SIGNUM OF THE INPUT IN A.
040167,001034: 7234 17257 TCF ARGZERO
040168,001035:
040169,001036: 7235 45006 CS POSMAX # IF NEGATIVE.
040170,001037: 7236 17240 TCF +2
040171,001038:
040172,001039: 7237 35006 ARG+ CAF POSMAX
040173,001040: 7240 54002 TS Q
040174,001041: 7241 00006 EXTEND
040175,001042: 7242 24000 AUG A # FORMS +-1.0.
040176,001043: 7243 60156 AD MPAC +2
040177,001044: 7244 54156 TS MPAC +2
040178,001045: 7245 35030 CAF ZERO
040179,001046: 7246 60002 AD Q
040180,001047: 7247 60155 AD MPAC +1
040181,001048: 7250 54155 TS MPAC +1
040182,001049: 7251 35030 CAF ZERO
040183,001050: 7252 60002 AD Q # Q STILL HAS POSMAX OR NEGMAX IN IT.
040184,001051: 7253 60154 AD MPAC
040185,001052: 7254 54154 ARGZERO2 TS MPAC # ALWAYS SKIPPING UNLESS ARGZERO.
040186,001053: 7255 54155 TS MPAC +1
040187,001054: 7256 00001 TC L # RETURN VIA L.
040188,001055:
040189,001056: 7257 54156 ARGZERO TS MPAC +2 # SET ALL THREE MPAC REGISTERS TO ZERO.
040190,001057: 7260 17254 TCF ARGZERO2
040191,001058:
040192,001059: # SHORTMP MULTIPLIES THE TP CONTENTS OF MPAC BY THE SINGLE PRECISION NUMBER ARRIVING IN A.
040193,001060:
040194,001061: 7261 54135 SHORTMP TS MPTEMP
040195,001062: 7262 00006 EXTEND
040196,001063: 7263 70156 MP MPAC +2
040197,001064: 7264 54156 TS MPAC +2
040198,001065: 7265 35030 SHORTMP2 CAF ZERO # SO SUBSEQUENT DAS WILL WORK.
040199,001066: 7266 56155 XCH MPAC +1
040200,001067: 7267 17102 TCF DMPSUB2
040201,001068:
040202,001069: # DMPNSUB MULTIPLIES THE DP FRACTION ARRIVING IN MPAC BY THE SP
040203,001070: # INTEGER ARRIVING IN A. THE DP PRODUCT DEPARTS BOTH IN MPAC AND IN
040204,001071: # A AND L. NOTE THAT DMPNSUB NORMALLY INCREASES THE MAGNITUDE OF THE
040205,001072: # CONTENTS OF MPAC. THE CUSTOMER MUST INSURE THAT B(A) X B(MPAC,MPAC+1)
040206,001073: # AND B(A) X B(MPAC) ARE LESS THAN 1 IN MAGNITUDE, WHERE B, AS IS OBVIOUS,
040207,001074: # INDICATES THE ARRIVING CONTENTS.
040208,001075:
040209,001076: 7270 54135 DMPNSUB TS DMPNTEMP
040210,001077: 7271 00006 EXTEND
040211,001078: 7272 70155 MP MPAC +1
040212,001079: 7273 52155 DXCH MPAC # LOW PRODUCT TO MPAC, HIGH FACTOR TO A
040213,001080: 7274 00006 EXTEND
040214,001081: 7275 70135 MP DMPNTEMP
040215,001082: 7276 30001 CA L
040216,001083: 7277 26154 ADS MPAC # COMPLETING THE PRODUCT IN MPAC
040217,001084: 7300 00006 EXTEND
040218,001085: 7301 30155 DCA MPAC # BRINGING THE PRODUCT INTO A AND L
040219,001086: 7302 00002 TC Q
040220,001087:
040221,001088: # MISCELLANEOUS VECTOR OPERATIONS. INCLUDED HERE ARE THE FOLLOWING:
040222,001089:
040223,001090: # 1. DOT DP VECTOR DOT PRODUCT.
040224,001091: # 2. VXV DP VECTOR CROSS PRODUCT.
040225,001092: # 3. VXSC DP VECTOR TIMES SCALAR.
040226,001093: # 4. V/SC DP VECTOR DIVIDED BY SCALAR.
040227,001094: # 5. VPROJ DP VECTOR PROJECTION. ( (MPAC.X)MPAC ).
040228,001095: # 6. VXM DP VECTOR POST-MULTIPLIED BY MATRIX.
040229,001096: # 7. MXV DP VECTOR PRE-MULTIPLIED BY MATRIX.
040230,001097:
040231,001098:
040232,001099: 7303 07130 DOT TC PREDOT # DO THE DOT PRODUCT AND EXIT, CHANGING
040233,001100: 7304 35030 DMODE CAF ZERO # THE MODE TO DP SCALAR.
040234,001101: 7305 16034 TCF NEWMODE
040235,001102:
040236,001103:
040237,001104: 7306 35025 MXV CAF TWO # SET UP MATINC AND DOTINC FOR ROW
040238,001105: 7307 54140 TS MATINC # VECTORS.
040239,001106: 7310 17314 TCF VXM/MXV # GO TO COMMON PORTION.
040240,001107:
040241,001108: 7311 44375 VXM CS TEN # SET MATINC AND DOTINC TO REFER TO MATRIX
040242,001109: 7312 54140 TS MATINC # AS THREE COLUMN VECTORS.
040243,001110: 7313 36216 CAF SIX
040244,001111:
040245,001112: # COMMON PORTION OF MXV AND VXM.
040246,001113:
040247,001114: 7314 54136 VXM/MXV TS DOTINC
040248,001115: # ITRACE (2) REFERS TO "VXM/MXV".
040249,001116: 7315 07504 TC MPACVBUF # SAVE VECTOR IN MPAC FOR FURTHER USE.
040250,001117:
040251,001118: 7316 07132 TC DOTSUB # GO DOT TO GET X COMPONENT OF ANSWER.
040252,001119: 7317 00006 EXTEND
040253,001120: 7320 30123 DCA VBUF # MOVE MPAC VECTOR BACK INTO MPAC, SAVING
040254,001121: 7321 52155 DXCH MPAC # NEW X COMPONENT IN BUF2.
040255,001122: 7322 52134 DXCH BUF2
040256,001123: 7323 00006 EXTEND
040257,001124: 7324 30125 DCA VBUF +2
040258,001125: 7325 52160 DXCH MPAC +3
040259,001126: 7326 00006 EXTEND
040260,001127: 7327 30127 DCA VBUF +4
040261,001128: 7330 52162 DXCH MPAC +5
040262,001129: 7331 30140 CA MATINC # INITIALIZE ADDRWD FOR NEXT DOT PRODUCT.
040263,001130: 7332 26116 ADS ADDRWD # FORMS BASE ADDRESS OF NEXT COLUMN(ROW).
040264,001131:
040265,001132: 7333 07132 TC DOTSUB
040266,001133: 7334 52123 DXCH VBUF # MOVE GIVEN VECTOR BACK TO MPAC, SAVING Y
040267,001134: 7335 52155 DXCH MPAC # COMPONENT OF ANSWER IN VBUF +2.
040268,001135: 7336 52125 DXCH VBUF +2
040269,001136: 7337 52160 DXCH MPAC +3
040270,001137: 7340 52127 DXCH VBUF +4
040271,001138: 7341 52162 DXCH MPAC +5
040272,001139: 7342 30140 CA MATINC # FORM ADDRESS OF LAST COLUMN OR ROW.
040273,001140: 7343 26116 ADS ADDRWD
040274,001141:
040275,001142: 7344 07132 TC DOTSUB
040276,001143: 7345 52134 DXCH BUF2 # ANSWER NOW COMPLETE. PUT COMPONENTS INTO
040277,001144: 7346 52155 DXCH MPAC # PROPER MPAC REGISTERS.
040278,001145: 7347 52162 DXCH MPAC +5
040279,001146: 7350 52125 DXCH VBUF +2
040280,001147: 7351 52160 DXCH MPAC +3
040281,001148: 7352 16035 TCF DANZIG # EXIT.
040282,001149:
040283,001150: # VXSC - VECTOR TIMES SCALAR.
040284,001151:
040285,001152: 7353 10163 VXSC CCS MODE # TEST PRESENT MODE.
040286,001153: 7354 17402 TCF DVXSC # SEPARATE ROUTINE WHEN SCALAR IS IN MPAC.
040287,001154: 7355 17402 TCF DVXSC
040288,001155:
040289,001156: 7356 07063 VVXSC TC DMPSUB # COMPUTE X COMPONENT
040290,001157: 7357 07114 TC VROUND # AND ROUND IT.
040291,001158: 7360 52160 DXCH MPAC +3 # PUT Y COMPONENT INTO MPAC SAVING MPAC IN
040292,001159: 7361 52155 DXCH MPAC # MPAC +3.
040293,001160: 7362 52160 DXCH MPAC +3
040294,001161:
040295,001162: 7363 07063 TC DMPSUB # DO SAME FOR Y AND Z COMPONENTS.
040296,001163: 7364 07114 TC VROUND
040297,001164: 7365 52162 DXCH MPAC +5
040298,001165: 7366 52155 DXCH MPAC
040299,001166: 7367 52162 DXCH MPAC +5
040300,001167:
040301,001168: 7370 07063 TC DMPSUB
040302,001169: 7371 07114 TC VROUND
040303,001170: 7372 52155 VROTATEX DXCH MPAC # EXIT USED TO RESTORE MPAC AFTER THIS
040304,001171: 7373 52162 DXCH MPAC +5 # TYPE OF ROTATION. CALLED BY VECTOR SHIFT
040305,001172: 7374 52160 DXCH MPAC +3 # RIGHT, V/SC, ETC.
040306,001173: 7375 52155 DXCH MPAC
040307,001174: 7376 16035 TCF DANZIG
040308,001175:
040309,001176: # DP VECTOR PROJECTION ROUTINE.
040310,001177:
040311,001178: 7377 07130 VPROJ TC PREDOT # (MPAC.X)MPAC IS COMPUTED AND LEFT IN
040312,001179: 7400 45024 CS FOUR # MPAC. DO DOT AND FALL INTO DVXSC.
040313,001180: 7401 26116 ADS ADDRWD
040314,001181:
040315,001182: # VXSC WHEN SCALAR ARRIVES IN MPAC AND VECTOR IS AT X.
040316,001183:
040317,001184: 7402 00006 DVXSC EXTEND # SAVE SCALAR IN MPAC +3 AND GET X
040318,001185: 7403 30155 DCA MPAC # COMPONENT OF ANSWER.
040319,001186: 7404 52160 DXCH MPAC +3
040320,001187: 7405 07063 TC DMPSUB
040321,001188: 7406 07114 TC VROUND
040322,001189:
040323,001190: 7407 35025 CAF TWO # ADVANCE ADDRWD TO Y COMPONENT OF X.
040324,001191: 7410 26116 ADS ADDRWD
040325,001192: 7411 00006 EXTEND
040326,001193: 7412 30160 DCA MPAC +3 # PUT SCALAR BACK INTO MPAC AND SAVE
040327,001194: 7413 52155 DXCH MPAC # X RESULT IN MPAC +5.
040328,001195: 7414 52162 DXCH MPAC +5
040329,001196: 7415 07063 TC DMPSUB
040330,001197: 7416 07114 TC VROUND
040331,001198:
040332,001199: 7417 35025 CAF TWO
040333,001200: 7420 26116 ADS ADDRWD # TO Z COMPONENT.
040334,001201: 7421 52160 DXCH MPAC +3 # BRING SCALAR BACK, PUTTING Y RESULT IN
040335,001202: 7422 52155 DXCH MPAC # THE PROPER PLACE.
040336,001203: 7423 52160 DXCH MPAC +3
040337,001204: 7424 07063 TC DMPSUB
040338,001205: 7425 07114 TC VROUND
040339,001206:
040340,001207: 7426 52155 DXCH MPAC # PUT Z COMPONENT IN PROPER PLACE, ALSO
040341,001208: 7427 52162 DXCH MPAC +5 # POSITIONING X.
040342,001209: 7430 52155 DXCH MPAC
040343,001210:
040344,001211: 7431 16475 TCF VMODE # MODE HAS CHANGED TO VECTOR.
040345,001212:
040346,001213: # THE VECTOR CROSS PRODUCT ROUTINE CALCULATES (X M -X M ,X M -X M ,X M -X M ) WHERE M IS THE VECTOR IN
040347,001214: # 3 2 2 3 1 3 3 1 2 1 1 2
040348,001215: # MPAC AND X THE VECTOR AT THE GIVEN ADDRESS.
040349,001216:
040350,001217:
040351,001218: 7432 00006 VXV EXTEND
040352,001219: 7433 30162 DCA MPAC +5 # FORM UP M3X1, LEAVING M1 IN VBUF.
040353,001220: 7434 52155 DXCH MPAC
040354,001221: 7435 52123 DXCH VBUF
040355,001222: 7436 07063 TC DMPSUB # BY X1.
040356,001223:
040357,001224: 7437 00006 EXTEND
040358,001225: 7440 40160 DCS MPAC +3 # CALCULATE -X1M2, SAVING X1M3 IN VBUF +2.
040359,001226: 7441 52155 DXCH MPAC
040360,001227: 7442 52125 DXCH VBUF +2
040361,001228: 7443 07063 TC DMPSUB
040362,001229:
040363,001230: 7444 35025 CAF TWO # ADVANCE ADDRWD TO X2.
040364,001231: 7445 26116 ADS ADDRWD
040365,001232: 7446 00006 EXTEND
040366,001233: 7447 40162 DCS MPAC +5 # PREPARE TO GET -X2M3, SAVING -X1M2 IN
040367,001234: 7450 52155 DXCH MPAC # MPAC +5.
040368,001235: 7451 52162 DXCH MPAC +5
040369,001236: 7452 07063 TC DMPSUB
040370,001237:
040371,001238: 7453 00006 EXTEND
040372,001239: 7454 30123 DCA VBUF # GET X2M1, SAVING -X2M3 IN VBUF +4.
040373,001240: 7455 52155 DXCH MPAC
040374,001241: 7456 52127 DXCH VBUF +4
040375,001242: 7457 07063 TC DMPSUB
040376,001243:
040377,001244: 7460 35025 CAF TWO # ADVANCE ADDRWD TO X3.
040378,001245: 7461 26116 ADS ADDRWD
040379,001246: 7462 00006 EXTEND
040380,001247: 7463 40123 DCS VBUF # GET -X3M1, ADDING X2M1 TO MPAC +5 TO
040381,001248: 7464 52155 DXCH MPAC # COMPLETE THE Z COMPONENT OF THE ANSWER.
040382,001249: 7465 20162 DAS MPAC +5
040383,001250:
040384,001251: 7466 00006 EXTEND
040385,001252: 7467 17471 BZF +2
040386,001253: 7470 06765 TC OVERFLWZ
040387,001254:
040388,001255: 7471 07063 TC DMPSUB
040389,001256: 7472 52125 DXCH VBUF +2 # MOVE X1M3 TO MPAC +3 SETTING UP FOR X3M2
040390,001257: 7473 52160 DXCH MPAC +3 # AND ADD -X3M1 TO MPAC +3 TO COMPLETE THE
040391,001258: 7474 52155 DXCH MPAC # Y COMPONENT OF THE RESULT.
040392,001259: 7475 20160 DAS MPAC +3
040393,001260:
040394,001261: 7476 00006 EXTEND
040395,001262: 7477 17501 BZF +2
040396,001263: 7500 06770 TC OVERFLWY
040397,001264:
040398,001265: 7501 07063 TC DMPSUB
040399,001266: 7502 52127 DXCH VBUF +4 # GO ADD -X2M3 TO X3M2 TO COMPLETE THE X
040400,001267: 7503 16754 TCF ENDVXV # COMPONENT (TAIL END OF DAD).
040401,001268:
040402,001269: # THE MPACVBUF SUBROUTINE SAVES THE VECTOR IN MPAC IN VBUF WITHOUT CLOBBERING MPAC.
040403,001270:
040404,001271: 7504 00006 MPACVBUF EXTEND # CALLED BY MXV, VXM, AND UNIT.
040405,001272: 7505 30155 DCA MPAC
040406,001273: 7506 52123 DXCH VBUF
040407,001274: 7507 00006 EXTEND
040408,001275: 7510 30160 DCA MPAC +3
040409,001276: 7511 52125 DXCH VBUF +2
040410,001277: 7512 00006 EXTEND
040411,001278: 7513 30162 DCA MPAC +5
040412,001279: 7514 52127 DXCH VBUF +4
040413,001280: 7515 00002 TC Q # RETURN TO CALLER.
040414,001281:
040415,001282:
040416,001283: # DOUBLE PRECISION SIGN AGREE ROUTINE. ARRIVE WITH INPUT IN A+L. OUTPUT IS IN A + L.
040417,001284:
040418,001285: 7516 10000 ALSIGNAG CCS A # TEST UPPER PART.
040419,001286: 7517 17523 TCF UPPOS # IT IS POSITIVE
040420,001287: 7520 00002 TC Q # ZERO
040421,001288: 7521 17533 TCF UPNEG # NEGATIVE
040422,001289: 7522 00002 TC Q # ZERO
040423,001290:
040424,001291: 7523 56001 UPPOS XCH L # SAVE DECREMENTED UPPER PART.
040425,001292: 7524 65011 AD HALF
040426,001293: 7525 65011 AD HALF
040427,001294: 7526 54000 TS A # SKIPS ON OVERFLOW
040428,001295: 7527 17531 TCF +2
040429,001296: 7530 24001 INCR L # RESTORE UPPER TO ROIGINAL VALUE
040430,001297: 7531 56001 XCH L # SWAP A + L BACK.
040431,001298: 7532 00002 TC Q
040432,001299:
040433,001300: 7533 56001 UPNEG XCH L # SAVE COMPLEMENTED + DECREMENTED UPPER PT
040434,001301: 7534 65010 AD NEGMAX
040435,001302: 7535 67721 AD NEGONE
040436,001303: 7536 54000 TS A
040437,001304: 7537 17541 TCF +2 # DONT INCREMENT IF NO OVERFLOW.
040438,001305: 7540 24001 INCR L
040439,001306: 7541 56001 XCH L
040440,001307: 7542 40000 COM # MAKE NEGATIVE AGAIN.
040441,001308: 7543 00002 TC Q
040442,001309:
040443,001310: # INTERPRETIVE INSTRUCTIONS WHOSE EXECUTION CONSISTS OF PRINCIPALLY CALLING SUBROUTINES.
040444,001311:
040445,001312: 7544 07063 DMP1 TC DMPSUB # DMP INSTRUCTION.
040446,001313: 7545 16035 TCF DANZIG
040447,001314:
040448,001315: 7546 07063 DMPR TC DMPSUB
040449,001316: 7547 07113 TC ROUNDSUB +1 # (C(A) = +0).
040450,001317: 7550 16035 TCF DANZIG
040451,001318:
040452,001319: 7551 00006 DDV EXTEND
040453,001320: 7552 50116 INDEX ADDRWD # MOVE DIVIDEND INTO BUF.
040454,001321: 7553 30001 DCA 0
040455,001322: 7554 17561 TCF BDDV +4
040456,001323:
040457,001324: 7555 00006 BDDV EXTEND # MOVE DIVISOR INTO MPAC SAVING MPAC, THE
040458,001325: 7556 50116 INDEX ADDRWD # DIVIDEND, IN BUF.
040459,001326: 7557 30001 DCA 0
040460,001327: 7560 52155 DXCH MPAC
040461,001328: 7561 52131 +4 DXCH BUF
040462,001329: 7562 35030 CAF ZERO # DIVIDE ROUTINES IN BANK 0.
040463,001330: 7563 54004 TS FBANK
040464,001331: 7564 12353 TCF DDV/BDDV
040465,001332:
040466,001333: 7565 30116 SETPD CA ADDRWD # MUST SET TO WORK AREA, OR EBANK TROUBLE.
040467,001334: 7566 54166 TS PUSHLOC
040468,001335: 7567 16037 TCF NOIBNKSW # NO FBANK SWITCH REQUIRED.
040469,001336:
040470,001337: 7570 35030 TSLC CAF ZERO # SHIFTING ROUTINES LOCATED IN BANK 00.
040471,001338: 7571 54004 TS FBANK
040472,001339: 7572 12172 TCF TSLC2
040473,001340:
040474,001341: 7573 36050 GSHIFT CAF LOW7 # USED AS MASK AT GENSHIFT. THIS PROCESSES
040475,001342: 7574 54004 TS FBANK # ANY SHIFT INSTRUCTION (EXCEPT TSLC) WITH
040476,001343: 7575 12214 TCF GENSHIFT # AN ADDRESS (ROUTINES IN BANK 0).
040477,001344:
040478,001345: # THE FOLLOWING IS THE PROLOGUE TO V/SC. IF THE PRESENT MODE IS VECTOR, IT SAVES THE SCALAR AT X IN BUF
040479,001346: # AND CALLS THE V/SC ROUTINE IN BANK 0. IF THE PRESENT MODE IS SCALAR, IT MOVES THE VECTOR AT X INTO MPAC, SAVING
040480,001347: # THE SCALAR IN MPAC IN BUF BEFORE CALLING THE V/SC ROUTINE IN BANK 0.
040481,001348:
040482,001349: 7576 10163 V/SC CCS MODE
040483,001350: 7577 17610 TCF DV/SC # MOVE VECTOR INTO MPAC.
040484,001351: 7600 17610 TCF DV/SC
040485,001352:
040486,001353: 7601 00006 VV/SC EXTEND
040487,001354: 7602 50116 INDEX ADDRWD
040488,001355: 7603 30001 DCA 0
040489,001356: 7604 52131 V/SC1 DXCH BUF # IN BOTH CASES, VECTOR IS NOW IN MPAC AND
040490,001357: 7605 35030 CAF ZERO # SCALAR IN BUF.
040491,001358: 7606 54004 TS FBANK
040492,001359: 7607 12654 TCF V/SC2
040493,001360:
040494,001361: 7610 00006 DV/SC EXTEND
040495,001362: 7611 50116 INDEX ADDRWD
040496,001363: 7612 30003 DCA 2
040497,001364: 7613 52160 DXCH MPAC +3
040498,001365: 7614 00006 EXTEND
040499,001366: 7615 50116 INDEX ADDRWD
040500,001367: 7616 30005 DCA 4
040501,001368: 7617 52162 DXCH MPAC +5
040502,001369:
040503,001370: 7620 45026 CS ONE # CHANGE MODE TO VECTOR.
040504,001371: 7621 54163 TS MODE
040505,001372:
040506,001373: 7622 00006 EXTEND
040507,001374: 7623 50116 INDEX ADDRWD
040508,001375: 7624 30001 DCA 0
040509,001376: 7625 52155 DXCH MPAC
040510,001377: 7626 17604 TCF V/SC1 # FINISH PROLOGUE AT COMMON SECTION.
040511,001378:
040512,001379: # SIGN AND COMPLEMENT INSTRUCTIONS.
040513,001380:
040514,001381: 7627 50116 SIGN INDEX ADDRWD # CALL COMP INSTRUCTION IF WORD AT X IS
040515,001382: 7630 10000 CCS 0 # NEGATIVE NON-ZERO.
040516,001383: 7631 16035 TCF DANZIG
040517,001384: 7632 17634 TCF +2
040518,001385: 7633 17642 TCF COMP # DO THE COMPLEMENT.
040519,001386:
040520,001387: 7634 50116 INDEX ADDRWD
040521,001388: 7635 10001 CCSL CCS 1
040522,001389: 7636 16035 TCF DANZIG
040523,001390: 7637 16035 TCF DANZIG
040524,001391: 7640 17642 TCF COMP
040525,001392: 7641 16035 TCF DANZIG
040526,001393: 7642 00006 COMP EXTEND # COMPLEMENT DP MPAC IN EVERY CASE.
040527,001394: 7643 40155 DCS MPAC
040528,001395: 7644 52155 DXCH MPAC
040529,001396:
040530,001397: 7645 10163 CCS MODE # EITHER COMPLEMENT MPAC +3 OR THE REST OF
040531,001398: 7646 17657 TCF DCOMP # THE VECTOR ACCUMULATOR.
040532,001399: 7647 17657 TCF DCOMP
040533,001400:
040534,001401: 7650 00006 EXTEND # VECTOR COMPLEMENT.
040535,001402: 7651 40160 DCS MPAC +3
040536,001403: 7652 52160 DXCH MPAC +3
040537,001404: 7653 00006 EXTEND
040538,001405: 7654 40162 DCS MPAC +5
040539,001406: 7655 52162 DXCH MPAC +5
040540,001407: 7656 16035 TCF DANZIG
040541,001408:
040542,001409: 7657 40156 DCOMP CS MPAC +2
040543,001410: 7660 54156 TS MPAC +2
040544,001411: 7661 16035 TCF DANZIG
040545,001412:
040546,001413: # THE FOLLOWING SHORT SHIFT CODES REQUIRE NO ADDRESS WORD:
040547,001414:
040548,001415: # 1. SR1 TO SR4 SCALAR SHIFT RIGHT.
040549,001416: # 2. SR1R TO SR4R SCALAR SHIFT RIGHT AND ROUND.
040550,001417: # 3. SL1 TO SL4 SCALAR SHIFT LEFT.
040551,001418: # 4. SL1R TO SL4R SCALAR SHIFT LEFT AND ROUND.
040552,001419:
040553,001420: # 5. VSR1 TO VSR8 VECTOR SHIFT RIGHT (ALWAYS ROUNDS).
040554,001421: # 6. VSL1 TO VSL8 VECTOR SHIFT LEFT (NEVER ROUNDS).
040555,001422:
040556,001423: # THE FOLLOWING CODES REQUIRE AN ADDRESS WHICH MAY BE INDEXED:*
040557,001424:
040558,001425: # 1. SR SCALAR SHIFT RIGHT.
040559,001426: # 2. SRR SCALAR SHIFT RIGHT AND ROUND.
040560,001427: # 3. SL SCALAR SHIFT LEFT.
040561,001428: # 4. SLR SCALAR SHIFT LEFT AND ROUND.
040562,001429:
040563,001430: # 5. VSR VECTOR SHIFT RIGHT.
040564,001431: # 6. VSL VECTOR SHIFT LEFT.
040565,001432:
040566,001433: # * IF THE ADDRESS IS INDEXED, AND THE INDEX MODIFICATION RESULTS IN A NEGATIVE SHIFT COUNT, A SHIFT OF THE
040567,001434: # ABSOLUTE VALUE OF THE COUNT IS DONE IN THE OPPOSITE DIRECTION.
040568,001435:
040569,001436:
040570,001437: 00,2017 BANK 00
040571,001438:
040572,001439: 00,2017 COUNT* $$/INTER
040573,001440: 00,2017 36216 SHORTT CAF SIX # SCALAR SHORT SHIFTS COME HERE. THE SHIFT
040574,001441: 00,2020 70020 MASK CYR # COUNT-1 IS NOW IN BITS 2-3 OF CYR. THE
040575,001442: 00,2021 54021 TS SR # ROUNDING BIT IS IN BIT1 AT THIS POINT.
040576,001443:
040577,001444: 00,2022 10020 CCS CYR # SEE IF RIGHT OR LEFT SHIFT DESIRED.
040578,001445: 00,2023 12101 TCF TSSL # SHIFT LEFT.
040579,001446:
040580,001447: 00,2024 00024 SRDDV DEC 20 B-14 # MPTEMP SETTING FOR SR BEFORE DDV.
040581,001448:
040582,001449: 00,2025 50021 TSSR INDEX SR # GET SHIFTING BIT.
040583,001450: 00,2026 35011 CAF BIT14
040584,001451: 00,2027 54135 TS MPTEMP
040585,001452:
040586,001453: 00,2030 10020 CCS CYR # SEE IF A ROUND IS DESIRED.
040587,001454: 00,2031 02050 RIGHTR TC MPACSRND # YES - SHIFT RIGHT AND ROUND.
040588,001455: 00,2032 16034 TCF NEWMODE # SET MODE TO DP (C(A) = 0).
040589,001456: 00,2033 30135 MPACSHR CA MPTEMP # DO A TRIPLE PRECISION SHIFT RIGHT.
040590,001457: 00,2034 00006 EXTEND
040591,001458: 00,2035 70156 MP MPAC +2
040592,001459: 00,2036 54156 +3 TS MPAC +2 # (EXIT FROM SQRT AND ABVAL).
040593,001460: 00,2037 30135 CA MPTEMP
040594,001461: 00,2040 00006 EXTEND
040595,001462: 00,2041 70154 MP MPAC # SHIFT MAJOR PART INTO A,L AND PLACE IN
040596,001463: 00,2042 52155 DXCH MPAC # MPAC,+1.
040597,001464: 00,2043 30135 CA MPTEMP
040598,001465: 00,2044 00006 EXTEND
040599,001466: 00,2045 70001 MP L # ORIGINAL C(MPAC +1).
040600,001467: 00,2046 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
040601,001468: 00,2047 16035 TCF DANZIG
040602,001469:
040603,001470: # MPAC SHIFT RIGHT AND ROUND SUBROUTINES.
040604,001471:
040605,001472: 00,2050 30156 MPACSRND CA MPAC +2 # WE HAVE TO DO ALL THREE MULTIPLIES SINCE
040606,001473: 00,2051 00006 EXTEND # MPAC +1 AND MPAC +2 MIGHT HAVE SIGN
040607,001474: 00,2052 70135 MP MPTEMP # DISAGREEMENT WITH A SHIFT RIGHT OF 1.
040608,001475: 00,2053 56155 XCH MPAC +1
040609,001476: 00,2054 00006 EXTEND
040610,001477: 00,2055 70135 MP MPTEMP
040611,001478: 00,2056 56155 XCH MPAC +1 # TRIAL MINOR PART.
040612,001479: 00,2057 60001 AD L
040613,001480:
040614,001481: 00,2060 60000 VSHR2 DOUBLE # (FINISH VECTOR COMPONENT SHIFT RIGHT
040615,001482: 00,2061 54156 TS MPAC +2 # AND ROUND.
040616,001483: 00,2062 12064 TCF +2
040617,001484: 00,2063 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
040618,001485:
040619,001486: 00,2064 35030 CAF ZERO
040620,001487: 00,2065 54156 TS MPAC +2
040621,001488: 00,2066 56154 XCH MPAC # SETTING TO ZERO SO FOLLOWING DAS WORKS.
040622,001489: 00,2067 00006 EXTEND
040623,001490: 00,2070 70135 MP MPTEMP
040624,001491: 00,2071 20155 DAS MPAC # AGAIN NO OVERFLOW.
040625,001492: 00,2072 00002 TC Q
040626,001493:
040627,001494: 00,2073 30135 VSHRRND CA MPTEMP # ENTRY TO SHIFT RIGHT AND ROUND MPAC WHEN
040628,001495: 00,2074 00006 EXTEND # MPAC CONTAINS A VECTOR COMPONENT.
040629,001496: 00,2075 70155 MP MPAC +1
040630,001497: 00,2076 54155 TS MPAC +1
040631,001498: 00,2077 56001 XCH L
040632,001499: 00,2100 12060 TCF VSHR2 # GO ADD ONE IF NECESSARY AND FINISH.
040633,001500:
040634,001501: # ROUTINE FOR SHORT SCALAR SHIFT LEFT (AND MAYBE ROUND).
040635,001502:
040636,001503: 00,2101 30021 TSSL CA SR # GET SHIFT COUNT FOR SR.
040637,001504: 00,2102 54135 +1 TS MPTEMP
040638,001505:
040639,001506: 00,2103 00006 +2 EXTEND # ENTRY HERE FROM SL FOR SCALARS.
040640,001507: 00,2104 30156 DCA MPAC +1 # SHIFTING LEFT ONE PLACE AT A TIME IS
040641,001508: 00,2105 20156 DAS MPAC +1 # FASTER THAN DOING THE WHOLE SHIFT WITH
040642,001509: 00,2106 60154 AD MPAC # MULTIPLIES ASSUMING THAT FREQUENCY OF
040643,001510: 00,2107 60154 AD MPAC # SHIFT COUNTS GOES DOWN RAPIDLY AS A
040644,001511: 00,2110 54154 TS MPAC # FUNCTION OF THEIR MAGNITUDE.
040645,001512: 00,2111 12113 TCF +2
040646,001513: 00,2112 54121 TS OVFIND # OVERFLOW. (LEAVES OVERFLOW-CORRECTED
040647,001514: # RESULT ANYWAY).
040648,001515: 00,2113 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNT.
040649,001516: 00,2114 12102 TCF TSSL +1
040650,001517:
040651,001518: 00,2115 10020 CCS CYR # SEE IF ROUND WANTED.
040652,001519: 00,2116 07112 ROUND TC ROUNDSUB # YES - ROUND AND EXIT.
040653,001520: 00,2117 16035 TCF DANZIG # SL LEAVES A ZERO IN CYR FOR NO ROUND.
040654,001521: 00,2120 16035 TCF DANZIG # NO - EXIT IMMEDIATL
040655,001522:
040656,001523: # VECTOR SHIFTING ROUTINES.
040657,001524:
040658,001525: 00,2121 35032 SHORTV CAF LOW3 # SAVE 3 BIT SHIFT COUNT - 1 WITHOUT
040659,001526: 00,2122 70020 MASK CYR # EDITING CYR.
040660,001527: 00,2123 54135 TS MPTEMP
040661,001528: 00,2124 10020 CCS CYR # SEE IF LEFT OR RIGHT SHIFT.
040662,001529: 00,2125 12145 TCF VSSL # VECTOR SHIFT LEFT.
040663,001530: 00,2126 00176 OCT176 OCT 176 # USED IN PROCESSED SHIFTS WITH - COUNT.
040664,001531:
040665,001532: 00,2127 50135 VSSR INDEX MPTEMP # (ENTRY FROM SR). PICK UP SHIFTING BIT.
040666,001533: 00,2130 35011 CAF BIT14 # MPTEMP CONTAINS THE SHIFT COUNT - 1.
040667,001534: 00,2131 54135 TS MPTEMP
040668,001535: 00,2132 02073 TC VSHRRND # SHIFT X COMPONENT.
040669,001536:
040670,001537: 00,2133 52155 DXCH MPAC # SWAP X AND Y COMPONENTS.
040671,001538: 00,2134 52160 DXCH MPAC +3
040672,001539: 00,2135 52155 DXCH MPAC
040673,001540: 00,2136 02073 TC VSHRRND # SHIFT Y COMPONENT.
040674,001541:
040675,001542: 00,2137 52155 DXCH MPAC # SWAP Y AND Z COMPONENTS.
040676,001543: 00,2140 52162 DXCH MPAC +5
040677,001544: 00,2141 52155 DXCH MPAC
040678,001545: 00,2142 02073 TC VSHRRND # SHIFT Z COMPONENT.
040679,001546:
040680,001547: 00,2143 17372 TCF VROTATEX # RESTORE COMPONENTS TO PROPER PLACES.
040681,001548:
040682,001549: # VECTOR SHIFT LEFT - DONE ONE PLACE AT A TIME.
040683,001550:
040684,001551: 00,2144 54135 -1 TS MPTEMP # SHIFTING LOOP.
040685,001552:
040686,001553: 00,2145 00006 VSSL EXTEND
040687,001554: 00,2146 30155 DCA MPAC
040688,001555: 00,2147 20155 DAS MPAC
040689,001556: 00,2150 00006 EXTEND
040690,001557: 00,2151 12153 BZF +2
040691,001558: 00,2152 06773 TC OVERFLOW
040692,001559:
040693,001560: 00,2153 00006 EXTEND
040694,001561: 00,2154 30160 DCA MPAC +3
040695,001562: 00,2155 20160 DAS MPAC +3
040696,001563: 00,2156 00006 EXTEND
040697,001564: 00,2157 12161 BZF +2
040698,001565: 00,2160 06770 TC OVERFLWY
040699,001566:
040700,001567: 00,2161 00006 EXTEND
040701,001568: 00,2162 30162 DCA MPAC +5
040702,001569: 00,2163 20162 DAS MPAC +5
040703,001570: 00,2164 00006 EXTEND
040704,001571: 00,2165 12167 BZF +2
040705,001572: 00,2166 06765 TC OVERFLWZ
040706,001573:
040707,001574: 00,2167 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNTER.
040708,001575: 00,2170 12144 TCF VSSL -1
040709,001576: 00,2171 16035 TCF DANZIG # EXIT.
040710,001577:
040711,001578: # TSLC - TRIPLE SHIFT LEFT AND COUNT. SHIFTS MPAC LEFT UNTIL GREATER THAN .5 IN MAGNITUDE, LEAVING
040712,001579: # THE COMPLEMENT OF THE NUMBER OF SHIFTS REQUIRED IN X.
040713,001580:
040714,001581: 00,2172 54135 TSLC2 TS MPTEMP # START BY ZEROING SHIFT COUNT (IN A NOW).
040715,001582: 00,2173 06677 TC BRANCH # EXIT WITH NO SHIFTING IF ARGUMENT ZERO.
040716,001583: 00,2174 12176 TCF +2
040717,001584: 00,2175 12212 TCF ENDTSLC # STORES ZERO SHIFT COUNT IN THIS CASE.
040718,001585:
040719,001586: 00,2176 07231 TC TPAGREE # MAY CAUSE UPSHIFT OF ONE EXTRA PLACE.
040720,001587:
040721,001588: 00,2177 30154 CA MPAC # BEGIN NORMALIZATION LOOP.
040722,001589: 00,2200 12207 TCF TSLCTEST
040723,001590:
040724,001591: 00,2201 24135 TSLCLOOP INCR MPTEMP # INCREMENT SHIFT COUNTER.
040725,001592: 00,2202 00006 EXTEND
040726,001593: 00,2203 30156 DCA MPAC +1
040727,001594: 00,2204 20156 DAS MPAC +1
040728,001595: 00,2205 60154 AD MPAC
040729,001596: 00,2206 26154 ADS MPAC
040730,001597: 00,2207 60000 TSLCTEST DOUBLE # SEE IF (ANOTHER) SHIFT IS REQUIRED.
040731,001598: 00,2210 54000 OVSK
040732,001599: 00,2211 12201 TCF TSLCLOOP # YES - INCREMENT COUNT AND SHIFT AGAIN.
040733,001600:
040734,001601: 00,2212 40135 ENDTSLC CS MPTEMP
040735,001602: 00,2213 16577 TCF STORE1 # STORE SHIFT COUNT AND RETURN TO DANZIG.
040736,001603:
040737,001604: # THE FOLLOWING ROUTINES PROCESSES THE GENERAL SHIFT INSTRUCTIONS SR, SRR, SL, AND SLR.
040738,001605: # THE GIVEN ADDRESS IS DECODED AS FOLLOWS:
040739,001606:
040740,001607: # BITS 1-7 SHIFT COUNT (SUBADDRESS) LESS THAN 125 DECIMAL.
040741,001608: # BIT 8 PSEUDO SIGN BIT (DETECTS CHANGE IN SIGN IN INDEXED SHIFTS).
040742,001609: # BIT 9 0 FOR LEFT SHIFT, AND 1 FOR RIGHT SHIFT.
040743,001610: # BIT 10 1 FOR TERMINAL ROUND ON SCALAR SHIFTS, 0 OTHERWISE.
040744,001611: # BITS 11-13 0.
040745,001612: # BIT 14 1.
040746,001613: # BIT 15 0.
040747,001614:
040748,001615: # THE ABOVE ENCODING IS DONE BY THE YUL SYSTEM.
040749,001616:
040750,001617: 00,2214 70116 GENSHIFT MASK ADDRWD # GET SHIFT COUNT, TESTING FOR ZERO.
040751,001618: 00,2215 10000 CCS A # (ARRIVES WITH C(A) = LOW7).
040752,001619: 00,2216 12224 TCF GENSHFT2 # IF NON-ZERO, PROCEED WITH DECREMENTED CT
040753,001620:
040754,001621: 00,2217 35015 CAF BIT10 # ZERO SHIFT COUNT. NO SHIFTS NEEDED BUT
040755,001622: 00,2220 70116 MASK ADDRWD # WE MIGHT HAVE TO ROUND MPAC ON SLR AND
040756,001623: 00,2221 10000 CCS A # SRR (SCALAR ONLY).
040757,001624: 00,2222 07112 TC ROUNDSUB
040758,001625: 00,2223 16035 TCF DANZIG
040759,001626:
040760,001627: 00,2224 54135 GENSHFT2 TS MPTEMP # DECREMENTED SHIFT COUNT TO MPTEMP.
040761,001628: 00,2225 35017 CAF BIT8 # TEST MEANING OF LOW SEVEN BIT COUNT IN
040762,001629: 00,2226 00006 EXTEND # MPTEMP NOW.
040763,001630: 00,2227 70116 MP ADDRWD
040764,001631: 00,2230 76221 MASK LOW2 # JUMPS ON SHIFT DIRECTION (BIT8) AND
040765,001632: 00,2231 50000 INDEX A
040766,001633: 00,2232 12233 TCF +1 # ORIGINAL SHIFT DIRECTION (BIT 9).
040767,001634: 00,2233 12332 TCF RIGHT- # NEGATIVE SHIFT COUNT FOR SL OR SLR.
040768,001635: 00,2234 12342 TCF LEFT # SL OR SLR.
040769,001636: 00,2235 12336 TCF LEFT- # NEGATIVE SHIFT COUNT WITH SR OR SRR.
040770,001637:
040771,001638: # GENERAL SHIFT RIGHT.
040772,001639:
040773,001640: 00,2236 10163 RIGHT CCS MODE # SEE IF VECTOR OR SCALAR.
040774,001641: 00,2237 12277 TCF GENSCR
040775,001642: 00,2240 12277 TCF GENSCR
040776,001643:
040777,001644: 00,2241 30135 CA MPTEMP # SEE IF SHIFT COUNT LESS THAN 14D.
040778,001645: 00,2242 63726 VRIGHT2 AD NEG12
040779,001646: 00,2243 00006 EXTEND
040780,001647: 00,2244 62127 BZMF VSSR # IF SO, BRANCH AND SHIFT IMMEDIATELY.
040781,001648:
040782,001649: 00,2245 67721 AD NEGONE # IF NOT, REDUCE MPTEMP BY A TOTAL OF 14,
040783,001650: 00,2246 54135 TS MPTEMP # AND DO A SHIFT RIGHT AND ROUND BY 14.
040784,001651: 00,2247 35030 CAF ZERO # THE ROUND AT THIS STAGE MAY INTRODUCE A
040785,001652: 00,2250 54001 TS L # ONE BIT ERROR IN A SHIFT RIGHT 15D.
040786,001653: 00,2251 56154 XCH MPAC
040787,001654: 00,2252 56155 XCH MPAC +1
040788,001655: 00,2253 02272 TC SETROUND # X COMPONENT NOW SHIFTED, SO MAKE UP THE
040789,001656: 00,2254 20155 DAS MPAC # ROUNDING QUANTITY (0 IN A AND 0 OR +-1
040790,001657: # IN L).
040791,001658: 00,2255 56157 XCH MPAC +3 # REPEAT THE ABOVE PROCESS FOR Y AND Z.
040792,001659: 00,2256 56160 XCH MPAC +4
040793,001660: 00,2257 02272 TC SETROUND
040794,001661: 00,2260 20160 DAS MPAC +3 # NO OVERFLOW ON THESE ADDS.
040795,001662:
040796,001663: 00,2261 56161 XCH MPAC +5
040797,001664: 00,2262 56162 XCH MPAC +6
040798,001665: 00,2263 02272 TC SETROUND
040799,001666: 00,2264 20162 DAS MPAC +5
040800,001667:
040801,001668: 00,2265 10135 CCS MPTEMP # SEE IF DONE, DOING FINAL DECREMENT.
040802,001669: 00,2266 54135 TS MPTEMP
040803,001670: 00,2267 12242 TCF VRIGHT2
040804,001671: 00,2270 04604 BIASLO DEC .2974 B-1 # SQRT CONSTANT
040805,001672:
040806,001673: 00,2271 16035 TCF DANZIG
040807,001674:
040808,001675:
040809,001676: 00,2272 60000 SETROUND DOUBLE # MAKES UP ROUNDING QUANTITY FROM ARRIVING
040810,001677: 00,2273 54156 TS MPAC +2 # C(A). L IS ZERO INITIALLY.
040811,001678: 00,2274 35030 CAF ZERO
040812,001679: 00,2275 56001 XCH L
040813,001680: 00,2276 00002 TC Q # RETURN AND DO THE DAS, RESETTING L TO 0.
040814,001681:
040815,001682: # PROCESS SR AND SRR FOR SCALARS.
040816,001683:
040817,001684: 00,2277 30135 GENSCR CA MPTEMP # SEE IF THE ORIGINAL SHIFT COUNT WAS LESS
040818,001685: 00,2300 63726 +1 AD NEG12 # THAN 14D.
040819,001686: 00,2301 00006 EXTEND
040820,001687: 00,2302 62322 BZMF DOSSHFT # DO THE SHIFT IMMEDIATELY IF SO.
040821,001688:
040822,001689: 00,2303 67721 +4 AD NEGONE # IF NOT, DECREMENT SHIFT COUNT BY 14D AND
040823,001690: 00,2304 54135 TS MPTEMP # SHIFT MPAC RIGHT 14 PLACES.
040824,001691: 00,2305 35030 CAF ZERO
040825,001692: 00,2306 56154 XCH MPAC
040826,001693: 00,2307 56155 XCH MPAC +1
040827,001694: 00,2310 54156 TS MPAC +2
040828,001695: 00,2311 10135 CCS MPTEMP # SEE IF FINISHED, DO FINAL DECREMENT.
040829,001696: 00,2312 54135 TS MPTEMP
040830,001697: 00,2313 02300 TC GENSCR +1
040831,001698: 00,2314 22650 SLOPEHI DEC .5884 # SQRT CONSTANT.
040832,001699: 00,2315 35015 CAF BIT10 # FINISHED WITH SHIFT. SEE IF ROUND
040833,001700: 00,2316 70116 MASK ADDRWD # WANTED.
040834,001701: 00,2317 10000 CCS A
040835,001702: 00,2320 07112 TC ROUNDSUB
040836,001703: 00,2321 16035 TCF DANZIG # DO SO AND/OR EXIT.
040837,001704:
040838,001705: 00,2322 50135 DOSSHFT INDEX MPTEMP # PICK UP SHIFTING BIT.
040839,001706: 00,2323 35011 CAF BIT14
040840,001707: 00,2324 54135 TS MPTEMP
040841,001708: 00,2325 35015 CAF BIT10 # SEE IF TERMINAL ROUND DESIRED.
040842,001709: 00,2326 70116 MASK ADDRWD
040843,001710: 00,2327 10000 CCS A
040844,001711: 00,2330 12031 TCF RIGHTR # YES.
040845,001712: 00,2331 12033 TCF MPACSHR # JUST SHIFT RIGHT.
040846,001713:
040847,001714: # PROCESS THE RIGHT- (SL(R) WITH A NEGATIVE COUNT), LEFT-, AND LEFT OPTIONS.
040848,001715:
040849,001716: 00,2332 40135 RIGHT- CS MPTEMP # GET ABSOLUTE VALUE - 1 OF SHIFT COUNT
040850,001717: 00,2333 62126 AD OCT176 # UNDERSTANDING THAT BIT8 (PSEUDO-SIGN)
040851,001718: 00,2334 54135 TS MPTEMP # WAS 1 INITIALLY.
040852,001719: 00,2335 12236 TCF RIGHT # DO NORMAL SHIFT RIGHT.
040853,001720:
040854,001721: 00,2336 42126 LEFT- CS OCT176 # SAME PROLOGUE TO LEFT FOR INDEXED RIGHT
040855,001722: 00,2337 60135 AD MPTEMP # SHIFTS WHOSE NET SHIFT COUNT IS NEGATIVE
040856,001723: 00,2340 40000 COM
040857,001724: 00,2341 54135 TS MPTEMP
040858,001725:
040859,001726: 00,2342 10163 LEFT CCS MODE # SINCE LEFT SHIFTING IS SONE ONE PLACE AT
040860,001727: 00,2343 12346 TCF GENSCL # A TIME, NO COMPARISON WITH 14 NEED BE
040861,001728: 00,2344 12346 TCF GENSCL # DONE. FOR SCALARS, SEE IF TERMINAL ROUND
040862,001729: 00,2345 12145 TCF VSSL # DESIRED. FOR VECTORS, SHIFT IMMEDIATELY.
040863,001730:
040864,001731: 00,2346 40116 GENSCL CS ADDRWD # PUT ROUNDING BIT (BIT 10 OF ADDRWD) INTO
040865,001732: 00,2347 00006 EXTEND # BIT 15 OF CYR WHERE THE ROUNDING BIT OF
040866,001733: 00,2350 75021 MP BIT6 # A SHORT SHIFT LEFT WOULD BE
040867,001734: 00,2351 54020 TS CYR
040868,001735: 00,2352 12103 TCF TSSL +2 # DO THE SHIFT.
040869,001736:
040870,001737: # SCALAR DIVISION INSTRUCTIONS, DDV AND BDDV, ARE EXECUTED HERE. AT THIS POINT, THE DIVIDEND IS IN MPAC
040871,001738: # AND THE DIVISOR IN BUF.
040872,001739:
040873,001740: 00,2353 45026 DDV/BDDV CS ONE # INITIALIZATION.
040874,001741: 00,2354 54136 TS DVSIGN # +-1 FOR POSITIVE QUOTIENT - -0 FOR NEG.
040875,001742: 00,2355 54137 TS DVNORMCT # DIVIDEND NORMALIZATION COUNT.
040876,001743: 00,2356 54140 TS MAXDVSW # NEAR-ONE DIVIDE FLAG.
040877,001744:
040878,001745: 00,2357 10130 CCS BUF # FORCE BUF POSITIVE WITH THE MAJOR PART
040879,001746: 00,2360 12516 TCF BUFPOS # NON-ZERO.
040880,001747: 00,2361 12363 TCF +2
040881,001748: 00,2362 12531 TCF BUFNEG
040882,001749:
040883,001750: 00,2363 54156 BUFZERO TS MPAC +2 # ZERO THIS.
040884,001751: 00,2364 07231 TC TPAGREE # FORCE SIGN AGREEMENT BEFORE OVERFLOW
040885,001752:
040886,001753: 00,2365 10154 CCS MPAC # TEST TO SEE IF MPAC NON-ZERO. (TOO BIG)
040887,001754: 00,2366 12414 TCF OVF+ # MAJOR PART OF DIVIDEND IS POSITIVE NON-0
040888,001755: 00,2367 12371 TCF +2
040889,001756: 00,2370 12413 TCF OVF+ -1 # MAJOR PART OF DIVIDEND IS NEG. NON-ZERO
040890,001757:
040891,001758: 00,2371 56131 XCH BUF +1 # SHIFT DIVIDEND AND DIVISOR LEFT 14.
040892,001759: 00,2372 56130 XCH BUF
040893,001760: 00,2373 56155 XCH MPAC +1
040894,001761: 00,2374 56154 XCH MPAC
040895,001762: 00,2375 10130 CCS BUF # TRY AGAIN ON FORMER MINOR PART.
040896,001763: 00,2376 12422 TCF BUF+
040897,001764: 00,2377 12401 TCF +2 # OVERFLOW ON ZERO DIVISOR.
040898,001765: 00,2400 12416 TCF BUF-
040899,001766:
040900,001767: 00,2401 40154 CS MPAC # SIGN OF MPAC DETERMINES SIGN OF RESULT.
040901,001768: 00,2402 00006 SGNDVOVF EXTEND
040902,001769: 00,2403 62405 BZMF +2
040903,001770: 00,2404 24136 INCR DVSIGN # NEGMAX IN MPAC PERHAPS.
040904,001771: 00,2405 35006 DVOVF CAF POSMAX # ON DIVISION OVERFLOW OF ANY SORT, SET
040905,001772: 00,2406 54154 TS MPAC # SET DP MPAC TO +-POSMAX.
040906,001773: 00,2407 02630 TC FINALDV +3
040907,001774: 00,2410 35026 CAF ONE # SET OVERFLOW INDICATOR AND EXIT.
040908,001775: 00,2411 54121 TS OVFIND
040909,001776: 00,2412 06035 TC DANZIG
040910,001777:
040911,001778: 00,2413 24136 -1 INCR DVSIGN
040912,001779: 00,2414 40131 OVF+ CS BUF +1 # LOAD LOWER ORDER PART OF DIVISOR.
040913,001780: 00,2415 12402 TCF SGNDVOVF # GET SIGN OF RESULT.
040914,001781:
040915,001782: 00,2416 00006 BUF- EXTEND # IF BUF IS NEGATIVE, COMPLEMENT IT AND
040916,001783: 00,2417 40131 DCS BUF # MAINTAIN DVSIGN FOR FINAL QUOTIENT SIGN.
040917,001784: 00,2420 52131 DXCH BUF
040918,001785: 00,2421 24136 INCR DVSIGN # NOW -0.
040919,001786:
040920,001787: 00,2422 10154 BUF+ CCS MPAC # FORCE MPAC POSITIVE, CHECKING FOR ZERO
040921,001788: 00,2423 12437 TCF MPAC+ # DIVIDEND IN THE PROCESS.
040922,001789: 00,2424 12426 TCF +2
040923,001790: 00,2425 12433 TCF MPAC-
040924,001791: 00,2426 10155 CCS MPAC +1
040925,001792: 00,2427 12437 TCF MPAC+
040926,001793: 00,2430 16035 TCF DANZIG # EXIT IMMEDIATELY ON ZERO DIVIDEND.
040927,001794: 00,2431 12433 TCF MPAC-
040928,001795: 00,2432 16035 TCF DANZIG
040929,001796:
040930,001797: 00,2433 00006 MPAC- EXTEND # FORCE MPAC POSITIVE AS BUF IN BUF-.
040931,001798: 00,2434 40155 DCS MPAC
040932,001799: 00,2435 52155 DXCH MPAC
040933,001800: 00,2436 24136 INCR DVSIGN # NOW +1 OR -0.
040934,001801:
040935,001802: 00,2437 40154 MPAC+ CS MPAC # CHECK FOR DIVISION OVERFLOW. IF THE
040936,001803: 00,2440 67721 AD NEGONE # MAJOR PART OF THE DIVIDEND IS LESS THAN
040937,001804: 00,2441 60130 AD BUF # THE MAJOR PART OF THE DIVISOR BY AT
040938,001805: 00,2442 10000 CCS A # LEAST TWO, WE CAN PROCEED IMMEDIATELY
040939,001806: 00,2443 12505 TCF DVNORM # WITHOUT NORMALIZATION PRODUCING A DVMAX.
040940,001807: 00,2444 60001 -1/2+2 OCT 60001 # USED IN SQRTSUB.
040941,001808:
040942,001809: 00,2445 12446 TCF +1 # IF THE ABOVE DOES NOT HOLD, FORCE SIGN
040943,001810: 00,2446 35011 CAF HALF # AGREEMENT IN NUMERATOR AND DENOMINATOR
040944,001811: 00,2447 60000 DOUBLE # TO FACILITATE OVERFLOW AND NEAR-ONE
040945,001812: 00,2450 60155 AD MPAC +1 # CHECKING.
040946,001813: 00,2451 54155 TS MPAC +1
040947,001814: 00,2452 35030 CAF ZERO
040948,001815: 00,2453 65006 AD POSMAX
040949,001816: 00,2454 26154 ADS MPAC
040950,001817:
040951,001818: 00,2455 35011 CAF HALF # SAME FOR BUF.
040952,001819: 00,2456 60000 DOUBLE
040953,001820: 00,2457 60131 AD BUF +1
040954,001821: 00,2460 54131 TS BUF +1
040955,001822: 00,2461 35030 CAF ZERO
040956,001823: 00,2462 65006 AD POSMAX
040957,001824: 00,2463 26130 ADS BUF
040958,001825:
040959,001826: 00,2464 40154 CS MPAC # CHECK MAGNITUDE OF SIGN-CORRECTED
040960,001827: 00,2465 60130 AD BUF # OPERANDS.
040961,001828: 00,2466 10000 CCS A
040962,001829: 00,2467 12505 TCF DVNORM # DIVIDE OK - WILL NOT BECOME MAXDV CASE.
040963,001830: 00,2470 00133 LBUF2 ADRES BUF2
040964,001831: 00,2471 12405 TCF DVOVF # DIVISOR NOT LESS THAN DIVIDEND - OVF.
040965,001832:
040966,001833: 00,2472 54140 TS MAXDVSW # IF THE MAJOR PARTS OF THE DIVIDEND AND
040967,001834: 00,2473 40155 CS MPAC +1 # DIVISOR ARE EQUAL, A SPECIAL APPROXIMA-
040968,001835: 00,2474 60131 AD BUF +1 # TION IS USED (PROVIDED THE DIVISION IS
040969,001836: 00,2475 00006 EXTEND # POSSIBLE, OF COURSE).
040970,001837: 00,2476 62405 BZMF DVOVF
040971,001838: 00,2477 12505 TCF DVNORM # IF NO OVERFLOW.
040972,001839:
040973,001840: 00,2500 00006 BUFNORM EXTEND # ADD -1 TO AUGMENT SHIFT COUNT AND SHIFT
040974,001841: 00,2501 24137 AUG DVNORMCT # LEFT ONE PLACE.
040975,001842: 00,2502 00006 EXTEND
040976,001843: 00,2503 30131 DCA BUF
040977,001844: 00,2504 20131 DAS BUF
040978,001845:
040979,001846: 00,2505 30130 DVNORM CA BUF # SEE IF DIVISOR NORMALIZED YET.
040980,001847: 00,2506 60000 DOUBLE
040981,001848: 00,2507 54000 OVSK
040982,001849: 00,2510 12500 TCF BUFNORM # NO - SHIFT LEFT ONE AND TRY AGAIN.
040983,001850:
040984,001851: 00,2511 52155 DXCH MPAC # CALL DIVIDEND NORMALIZATION SEQUENCE
040985,001852: 00,2512 50137 INDEX DVNORMCT # PRIOR TO DOING THE DIVIDE.
040986,001853: 00,2513 02565 TC MAXTEST
040987,001854:
040988,001855: 00,2514 54156 TS MPAC +2 # RETURNS WITH DIVISION DONE AND C(A) = 0.
040989,001856: 00,2515 16035 TCF DANZIG
040990,001857:
040991,001858: 00,2516 10000 BUFPOS CCS A
040992,001859: 00,2517 12422 TCF BUF+ # TO BUF+ IF BUF IS GREATER THAN +1.
040993,001860:
040994,001861: 00,2520 40131 CS BUF +1 # IF BUF IS +1, FORCING SIGN AGREEMENT
040995,001862: 00,2521 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
040996,001863: 00,2522 62422 BZMF BUF+ # BRANCH IF SIGNS AGREE.
040997,001864:
040998,001865: 00,2523 35011 CA HALF # SIGNS DISAGREE. FORCE AGREEMENT.
040999,001866: 00,2524 60000 +6 DOUBLE
041000,001867: 00,2525 26131 ADS BUF +1
041001,001868: 00,2526 35030 CA ZERO
041002,001869: 00,2527 54130 TS BUF
041003,001870: 00,2530 12363 TCF BUFZERO
041004,001871:
041005,001872:
041006,001873: 00,2531 10000 BUFNEG CCS A
041007,001874: 00,2532 12416 TCF BUF- # TO BUF- IF BUF IS LESS THAN -1.
041008,001875:
041009,001876: 00,2533 30131 CA BUF +1 # IF BUF IS -1, FORCING SIGN AGREEMENT
041010,001877: 00,2534 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
041011,001878: 00,2535 62416 BZMF BUF- # BRANCH IF SIGNS AGREE.
041012,001879:
041013,001880: 00,2536 45011 CS HALF # SIGNS DISAGREE. FORCE AGREEMENT.
041014,001881: 00,2537 12524 TCF BUFPOS +6
041015,001882:
041016,001883: # THE FOLLOWING ARE PROLOGUES TO SHIFT THE DIVIDEND ARRIVING IN A AND L BEFORE THE DIVIDE.
041017,001884:
041018,001885: 00,2540 22021 -21D LXCH SR # SPECIAL PROLOGUE FOR UNIT WHEN THE
041019,001886: 00,2541 00006 EXTEND # LENGTH OF THE ARGUMENT WAS NOT LESS THAN
041020,001887: 00,2542 75011 MP HALF # .5. IN THIS CASE, EACH COMPONENT MUST BE
041021,001888: 00,2543 56001 XCH L # SHIFTED RIGHT ONE TO PRODUCE A HALF-UNIT
041022,001889: 00,2544 60021 AD SR # VECTOR.
041023,001890: 00,2545 56001 XCH L
041024,001891: 00,2546 12571 TCF GENDDV +1 # WITH DP DIVIDEND IN A,L.
041025,001892:
041026,001893: 00,2547 20001 DDOUBL # PROLOGUE WHICH NORMALIZES THE DIVIDEND
041027,001894: 00,2550 20001 DDOUBL # WHEN IT IS KNOWN THAT NO DIVISION
041028,001895: 00,2551 20001 DDOUBL # OVERFLOW WILL OCCUR.
041029,001896: 00,2552 20001 DDOUBL
041030,001897: 00,2553 20001 DDOUBL
041031,001898: 00,2554 20001 DDOUBL
041032,001899: 00,2555 20001 DDOUBL
041033,001900: 00,2556 20001 DDOUBL
041034,001901: 00,2557 20001 DDOUBL
041035,001902: 00,2560 20001 DDOUBL
041036,001903: 00,2561 20001 DDOUBL
041037,001904: 00,2562 20001 DDOUBL
041038,001905: 00,2563 20001 DDOUBL
041039,001906: 00,2564 52155 DXCH MPAC
041040,001907:
041041,001908: 00,2565 10140 MAXTEST CCS MAXDVSW # 0 IF MAJORS MIGHT BE =, -1 OTHERWISE.
041042,001909: 00,2566 06552 BIASHI DEC .4192 B-1 # SQRT CONSTANTS
041043,001910:
041044,001911: 00,2567 12642 TCF MAXDV # CHECK TO SEE IF THEY ARE NOW EQUAL.
041045,001912:
041046,001913: # THE FOLLOWING IS A GENERAL PURPOSE DOUBLE PRECISION DIVISION ROUTINE. IT DIVIDES MPAC BY BUF AND LEAVES
041047,001914: # THE RESULT IN MPAC. THE FOLLOWING CONDITIONS MUST BE SATISFIED:
041048,001915:
041049,001916: # 1. THE DIVISOR (BUF) MUST BE POSITIVE AND NOT LESS THAN .5.
041050,001917:
041051,001918: # 2. THE DIVIDEND (MPAC) MUST BE POSITIVE WITH THE MAJOR PART OF MPAC STRICTLY LESS THAN THAT OF BUF
041052,001919: # (A SPECIAL APPROXIMATION, MAXDV, IS USED WHEN THE MAJOR PARTS ARE EQUAL).
041053,001920:
041054,001921: # UNDERSTANDING THAT A/B = Q + S(R/B) WHERE S = 2(-14) AND Q AND R ARE QUOTIENT AND REMAINDER, RESPEC-
041055,001922: # TIVELY, THE FOLLOWING APPROXIMATION IS OBTAINED BY MULTIPLYING ABOVE AND BELOW BY C - SD AND NEGLECTING TERMS OF
041056,001923: # ORDER S-SQUARED (POSSIBLY INTRODUCING ERROR INTO THE LOW TWO BITS OF THE RESULT). SIGN AGREEMENT IS UNNECESSARY.
041057,001924:
041058,001925: # A + SB . (R - QD) A + SB
041059,001926: # ------ = Q + S(------) WHERE Q AND R ARE QUOTIENT AND REMAINDER OF ------ RESPECTIVELY.
041060,001927: # C + SD ( C ) C
041061,001928:
041062,001929:
041063,001930: 00,2570 52155 GENDDV DXCH MPAC # WE NEED A AND B ONLY FOR FIRST DV.
041064,001931: 00,2571 00006 +1 EXTEND # (SPECIAL UNIT PROLOGUE ENTERS HERE).
041065,001932: 00,2572 10130 DV BUF # A NOW CONTAINS Q AND L, R.
041066,001933: 00,2573 52155 DXCH MPAC
041067,001934:
041068,001935: 00,2574 40154 CS MPAC # FORM DIVIDEND FOR MINOR PART OF RESULT.
041069,001936: 00,2575 00006 EXTEND
041070,001937: 00,2576 70131 MP BUF +1
041071,001938: 00,2577 60155 AD MPAC +1 # OVERFLOW AT THIS POINT IS POSITIVE SINCE
041072,001939: 00,2600 54000 OVSK # R IS POSITIVE IN EVERY CASE.
041073,001940: 00,2601 12606 TCF +5
041074,001941:
041075,001942: 00,2602 00006 EXTEND # OVERFLOW CAN BE REMOVED BY SUBTRACTING C
041076,001943: 00,2603 60130 SU BUF # (BUF) ONCE SINCE R IS ALWAYS LESS THAN C
041077,001944: 00,2604 24154 INCR MPAC # IN THIS CASE. INCR COMPENSATES SUBTRACT.
041078,001945: 00,2605 12610 TCF +DOWN # (SINCE C(A) IS STILL POSITIVE).
041079,001946:
041080,001947: 00,2606 00006 +5 EXTEND # C(A) CAN BE MADE LESS THAN C IN MAGNI-
041081,001948: 00,2607 62620 BZMF -UP # TUDE BY DIMINISHING IT BY C (SINCE C IS
041082,001949: # NOT LESS THAN .5) UNLESS C(A) = 0.
041083,001950:
041084,001951: 00,2610 00006 +DOWN EXTEND
041085,001952: 00,2611 60130 SU BUF # IF POSITIVE, REDUCE ONLY IF NECESSARY
041086,001953: 00,2612 00006 EXTEND # SINCE THE COMPENSATING INCR MIGHT CAUSE
041087,001954: 00,2613 12616 BZF +3 # OVERFLOW.
041088,001955: 00,2614 00006 EXTEND # DONT SUBTRACT UNLESS RESULT IS POSITIVE
041089,001956: 00,2615 62624 BZMF ENDMAXDV # OR ZERO.
041090,001957:
041091,001958: 00,2616 24154 +3 INCR MPAC # KEEP SUBTRACT HERE AND COMPENSATE.
041092,001959: 00,2617 12625 TCF FINALDV
041093,001960:
041094,001961: 00,2620 00006 -UP EXTEND # IF ZERO, SET MINOR PART OF RESULT TO
041095,001962: 00,2621 12630 BZF FINALDV +3 # ZERO.
041096,001963:
041097,001964: 00,2622 00006 EXTEND # IF NEGATIVE, ADD C TO A, SUBTRACTING ONE
041098,001965: 00,2623 26154 DIM MPAC # TO COMPENSATE. DIM IS OK HERE SINCE THE
041099,001966: 00,2624 60130 ENDMAXDV AD BUF # MAJOR PART NEVER GOES NEGATIVE.
041100,001967:
041101,001968: 00,2625 22007 FINALDV ZL # DO DV TO OBTAIN MINOR PART OF RESULT.
041102,001969: 00,2626 00006 EXTEND
041103,001970: 00,2627 10130 DV BUF
041104,001971: 00,2630 54155 +3 TS MPAC +1
041105,001972:
041106,001973: 00,2631 10136 CCS DVSIGN # LEAVE RESULT POSITIVE UNLESS C(DVSIGN)=
041107,001974: 00,2632 00002 TC Q # -0.
041108,001975: 00,2633 00002 TC Q
041109,001976: 00,2634 00002 TC Q
041110,001977:
041111,001978: 00,2635 00006 EXTEND
041112,001979: 00,2636 40155 DCS MPAC
041113,001980: 00,2637 52155 DXCH MPAC
041114,001981: 00,2640 35030 CAF ZERO # SO WE ALWAYS RETURN WITH C(A) = 0.
041115,001982: 00,2641 00002 TC Q
041116,001983:
041117,001984: # IF THE MAJOR PARTS OF THE DIVISOR AND DIVIDEND ARE EQUAL, BUT THE MINOR PARTS ARE SUCH THAT THE
041118,001985: # DIVIDEND IS STRICTLY LESS THAN THE DIVISOR IN MAGNITUDE, THE FOLLOWING APPROXIMATION IS USED. THE ASSUMPTIONS
041119,001986: # ARE THE SAME AS THE GENERAL ROUTINE WITH THE ADDITION THAT SIGN AGREEMENT IS NECESSARY (B, C, & D POSITIVE).
041120,001987:
041121,001988: # C + SB . (C + B - D)
041122,001989: # ------ = 37777 + S(---------)
041123,001990: # C + SD ( C )
041124,001991:
041125,001992: # THE DIVISION MAY BE PERFORMED IMMEDIATELY SINCE B IS STRICTLY LESS THAN D AND C IS NOT LESS THAN .5.
041126,001993:
041127,001994:
041128,001995: 00,2642 40154 MAXDV CS MPAC # SEE IF MAXDV CASE STILL HOLDS AFTER
041129,001996: 00,2643 60130 AD BUF # NORMALIZATION.
041130,001997: 00,2644 00006 EXTEND
041131,001998: 00,2645 12647 BZF +2
041132,001999: 00,2646 12570 TCF GENDDV # MPAC NOW LESS THAN BUF - DIVIDE AS USUAL
041133,002000:
041134,002001: 00,2647 35006 +2 CAF POSMAX # SET MAJOR PART OF RESULT.
041135,002002: 00,2650 54154 TS MPAC
041136,002003:
041137,002004: 00,2651 40131 CS BUF +1 # FORM DIVIDEND OF MINOR PART OF RESULT.
041138,002005: 00,2652 60155 AD MPAC +1
041139,002006: 00,2653 12624 TCF ENDMAXDV # GO ADD C AND DO DIVIDE, ATTACHING SIGN
041140,002007: # BEFORE EXITING.
041141,002008:
041142,002009: # VECTOR DIVIDED BY SCALAR, V/SC, IS EXECUTED HERE. THE VECTOR IS NOW IN MPAC WITH SCALAR IN BUF.
041143,002010:
041144,002011: 00,2654 45026 V/SC2 CS ONE # INITIALIZE DIVIDEND NORMALIZATION COUNT
041145,002012: 00,2655 54137 TS DVNORMCT # AND DIVISION SIGN REGISTER.
041146,002013: 00,2656 54127 TS VBUF +5
041147,002014:
041148,002015: 00,2657 03010 TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
041149,002016:
041150,002017: 00,2660 52131 DXCH BUF
041151,002018: 00,2661 07516 TC ALSIGNAG # SIGN AGREE BUF
041152,002019: 00,2662 52131 DXCH BUF
041153,002020: 00,2663 10130 CCS BUF # FORCE DIVISOR POSITIVE WITH MAJOR PART
041154,002021: 00,2664 12721 TCF /BUF+ # NON-ZERO (IF POSSIBLE).
041155,002022: 00,2665 12667 TCF +2
041156,002023: 00,2666 12715 TCF /BUF-
041157,002024:
041158,002025: 00,2667 56131 XCH BUF +1 # SHIFT VECTOR AND SCALAR LEFT 14.
041159,002026: 00,2670 56130 XCH BUF
041160,002027: 00,2671 56155 XCH MPAC +1
041161,002028: 00,2672 56154 XCH MPAC
041162,002029: 00,2673 00006 EXTEND # CHECK FOR OVERFLOW IN EACH CASE.
041163,002030: 00,2674 12676 BZF +2
041164,002031: 00,2675 12405 TCF DVOVF
041165,002032:
041166,002033: 00,2676 56160 XCH MPAC +4
041167,002034: 00,2677 56157 XCH MPAC +3
041168,002035: 00,2700 00006 EXTEND
041169,002036: 00,2701 12703 BZF +2
041170,002037: 00,2702 12405 TCF DVOVF
041171,002038:
041172,002039: 00,2703 56162 XCH MPAC +6
041173,002040: 00,2704 56161 XCH MPAC +5
041174,002041: 00,2705 00006 EXTEND
041175,002042: 00,2706 12710 BZF +2
041176,002043: 00,2707 12405 TCF DVOVF
041177,002044:
041178,002045: 00,2710 10130 CCS BUF
041179,002046: 00,2711 12721 TCF /BUF+
041180,002047: 00,2712 12405 TCF DVOVF # ZERO DIVISOR - OVERFLOW.
041181,002048: 00,2713 12715 TCF /BUF-
041182,002049: 00,2714 12405 TCF DVOVF
041183,002050:
041184,002051: 00,2715 00006 /BUF- EXTEND # ON NEGATIVE, COMPLEMENT BUF AND MAINTAIN
041185,002052: 00,2716 40131 DCS BUF # DVSIGN IN VBUF +5.
041186,002053: 00,2717 52131 DXCH BUF
041187,002054: 00,2720 24127 INCR VBUF +5
041188,002055:
041189,002056: 00,2721 00006 /BUF+ EXTEND
041190,002057: 00,2722 30131 DCA BUF # LEAVE ABS(ORIG DIVISOR) IN BUF2
041191,002058: 00,2723 52134 DXCH BUF2 # FOR OVERFLOW TESTING
041192,002059: 00,2724 12732 TCF /NORM # NORMALIZE DIVISOR IN BUF.
041193,002060:
041194,002061: 00,2725 00006 /NORM2 EXTEND # IF LESS THAN .5, AUGMENT DVNORMCT AND
041195,002062: 00,2726 24137 AUG DVNORMCT # DOUBLE DIVISOR.
041196,002063: 00,2727 00006 EXTEND
041197,002064: 00,2730 30131 DCA BUF
041198,002065: 00,2731 20131 DAS BUF
041199,002066:
041200,002067: 00,2732 30130 /NORM CA BUF # SEE IF DIVISOR NORMALIZED.
041201,002068: 00,2733 60000 DOUBLE
041202,002069: 00,2734 54000 OVSK
041203,002070: 00,2735 12725 TCF /NORM2 # DOUBLE AND TRY AGAIN IF NOT.
041204,002071:
041205,002072: 00,2736 02750 TC V/SCDV # DO X COMPONENT DIVIDE.
041206,002073: 00,2737 52160 DXCH MPAC +3 # SUPPLY ARGUMENTS IN USUAL SEQUENCE.
041207,002074: 00,2740 52155 DXCH MPAC
041208,002075: 00,2741 52160 DXCH MPAC +3
041209,002076:
041210,002077: 00,2742 02750 TC V/SCDV # Y COMPONENT.
041211,002078: 00,2743 52162 DXCH MPAC +5
041212,002079: 00,2744 52155 DXCH MPAC
041213,002080: 00,2745 52162 DXCH MPAC +5
041214,002081:
041215,002082: 00,2746 02750 TC V/SCDV # Z COMPONENT.
041216,002083: 00,2747 17372 TCF VROTATEX # GO RE-ARRANGE COMPONENTS BEFORE EXIT.
041217,002084:
041218,002085: # SUBROUTINE USED BY V/SC TO DIVIDE VECTOR COMPONENT IN MPAC,+1 BY THE SCALAR GIVEN IN BUF.
041219,002086:
041220,002087: 00,2750 30127 V/SCDV CA VBUF +5 # REFLECTS SIGN OF SCALAR.
041221,002088: 00,2751 54136 TS DVSIGN
041222,002089:
041223,002090: 00,2752 10154 CCS MPAC # FORCE MPAC POSITIVE, EXITING ON ZERO.
041224,002091: 00,2753 12767 TCF /MPAC+
041225,002092: 00,2754 12756 TCF +2
041226,002093: 00,2755 12763 TCF /MPAC-
041227,002094:
041228,002095: 00,2756 10155 CCS MPAC +1
041229,002096: 00,2757 12767 TCF /MPAC+
041230,002097: 00,2760 00002 TC Q
041231,002098: 00,2761 12763 TCF /MPAC-
041232,002099: 00,2762 00002 TC Q
041233,002100:
041234,002101: 00,2763 00006 /MPAC- EXTEND # USUAL COMPLEMENTING AND SETTING OF SIGN.
041235,002102: 00,2764 40155 DCS MPAC
041236,002103: 00,2765 52155 DXCH MPAC
041237,002104: 00,2766 24136 INCR DVSIGN
041238,002105:
041239,002106: 00,2767 45026 /MPAC+ CS ONE # INITIALIZE NEAR-ONE SWITCH.
041240,002107: 00,2770 54140 TS MAXDVSW
041241,002108:
041242,002109: 00,2771 40154 CS MPAC # CHECK POSSIBLE OVERFLOW.
041243,002110: 00,2772 60133 AD BUF2 # UNNORMALIZED INPUT DIVISOR.
041244,002111: 00,2773 10000 CCS A
041245,002112: 00,2774 13004 TCF DDVCALL # NOT NEAR-ONE
041246,002113: 00,2775 12777 TCF +2 # +0 IS JUST POSSIBLE
041247,002114: 00,2776 12405 TCF DVOVF # NO HOPE
041248,002115: 00,2777 54140 TS MAXDVSW # SIGNAL POSSIBLE NEAR-ONE CASE
041249,002116: 00,3000 40155 CS MPAC +1 # SEE IF DIVISION CAN BE DONE
041250,002117: 00,3001 60134 AD BUF2 +1
041251,002118: 00,3002 00006 EXTEND
041252,002119: 00,3003 62405 BZMF DVOVF
041253,002120:
041254,002121: 00,3004 52155 DDVCALL DXCH MPAC # CALL PRE-DIVIDE NORMALIZATION.
041255,002122: 00,3005 50137 INDEX DVNORMCT
041256,002123: 00,3006 12565 TCF MAXTEST
041257,002124:
041258,002125: 00,3007 32506 SLOPELO DEC .8324
041259,002126:
041260,002127: 00,3010 56002 VECAGREE XCH Q # SAVE Q IN A
041261,002128: 00,3011 52155 DXCH MPAC
041262,002129: 00,3012 07516 TC ALSIGNAG # SIGNAGREE MPAC
041263,002130: 00,3013 52155 DXCH MPAC
041264,002131: 00,3014 52160 DXCH MPAC +3
041265,002132: 00,3015 07516 TC ALSIGNAG # SIGN AGREE MPAC +3
041266,002133: 00,3016 52160 DXCH MPAC +3
041267,002134: 00,3017 52162 DXCH MPAC +5
041268,002135: 00,3020 07516 TC ALSIGNAG # SIGNAGREE MPAC +5
041269,002136: 00,3021 52162 DXCH MPAC +5
041270,002137: 00,3022 00000 TC A
041271,002138:
041272,002139: # THE FOLLOWING ROUTINE EXECUTES THE UNIT INSTRUCTION, WHICH TAKES THE UNIT OF THE VECTOR IN MPAC.
041273,002140:
041274,002141: 00,3023 03010 UNIT TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
041275,002142: 00,3024 07504 TC MPACVBUF # SAVE ARGUMENT IN VBUF
041276,002143: 00,3025 35030 CAF ZERO # MUST SENSE OVERFLOW IN FOLLOWING DOT.
041277,002144: 00,3026 56121 XCH OVFIND
041278,002145: 00,3027 54141 TS TEM1
041279,002146: 00,3030 03317 TC VSQSUB # DOT MPAC WITH ITSELF.
041280,002147: 00,3031 30141 CA TEM1
041281,002148: 00,3032 56121 XCH OVFIND
041282,002149: 00,3033 00006 EXTEND
041283,002150: 00,3034 13036 BZF +2
041284,002151: 00,3035 12405 TCF DVOVF
041285,002152: 00,3036 00006 EXTEND
041286,002153: 00,3037 30155 DCA MPAC # LEAVE THE SQUARE OF THE LENGTH OF THE
041287,002154: 00,3040 50120 INDEX FIXLOC # ARGUMENT IN LVSQUARE.
041288,002155: 00,3041 52043 DXCH LVSQUARE
041289,002156:
041290,002157: 00,3042 03343 TC SQRTSUB # GO TAKE THE NORMALIZED SQUARE ROOT.
041291,002158:
041292,002159: 00,3043 10154 CCS MPAC # CHECK FOR UNIT OVERFLOW.
041293,002160: 00,3044 13051 TCF +5 # MPAC IS NOT LESS THAN .5 UNLESS
041294,002161: 00,3045 54001 TS L
041295,002162: 00,3046 50120 INDEX FIXLOC
041296,002163: 00,3047 52045 DXCH LV
041297,002164: 00,3050 12405 TCF DVOVF # INPUT TO SQRTSUB WAS 0.
041298,002165:
041299,002166: 00,3051 44331 CS FOURTEEN # SEE IF THE INPUT WAS SO SMALL THE THE
041300,002167: 00,3052 60135 AD MPTEMP # FIRST TWO REGISTERS OF THE SQUARE WERE 0
041301,002168: 00,3053 10000 CCS A
041302,002169: 00,3054 40000 COM # IF SO, SAVE THE NEGATIVE OF THE SHIFT
041303,002170: 00,3055 13133 TCF SMALL # COUNT -15D.
041304,002171:
041305,002172: 00,3056 13065 TCF LARGE # (THIS IS USUALLY THE CASE.)
041306,002173:
041307,002174: 00,3057 45034 CS THIRTEEN # IF THE SHIFT COUNT WAS EXACTLY 14, SET
041308,002175: 00,3060 54135 TS MPTEMP # THE PRE-DIVIDE NORM COUNT TO -13D.
041309,002176:
041310,002177: 00,3061 30154 CA MPAC # SHIFT THE LENGTH RIGHT 14 BEFORE STORING
041311,002178: 00,3062 54001 SMALL2 TS L # (SMALL EXITS TO THIS POINT).
041312,002179: 00,3063 35030 CAF ZERO
041313,002180: 00,3064 13112 TCF LARGE2 # GO TO STORE LENGTH AND PROCEED.
041314,002181:
041315,002182: 00,3065 10135 LARGE CCS MPTEMP # MOST ALL CASES COME HERE.
041316,002183: 00,3066 13074 TCF LARGE3 # SEE IF NO NORMALIZATION WAS REQUIRED BY
041317,002184:
041318,002185: 00,3067 42024 CS SRDDV # SQRT, AND IF SO, SET UP FOR A SHIFT
041319,002186: 00,3070 54135 TS MPTEMP # RIGHT 1 BEFORE DIVIDING TO PRODUCE
041320,002187: 00,3071 00006 EXTEND # THE DESIRED HALF UNIT VECTOR.
041321,002188: 00,3072 30155 DCA MPAC
041322,002189: 00,3073 13112 TCF LARGE2
041323,002190:
041324,002191: 00,3074 40000 LARGE3 COM # LEAVE NEGATIVE OF SHIFT COUNT-1 FOR
041325,002192: 00,3075 54135 TS MPTEMP # PREDIVIDE LEFT SHIFT.
041326,002193:
041327,002194: 00,3076 40000 COM # PICK UP REQUIRED SHIFTING BIT TO UNNORM-
041328,002195: 00,3077 50000 INDEX A # ALIZE THE SQRT RESULT.
041329,002196: 00,3100 35011 CAF BIT14
041330,002197: 00,3101 54130 TS BUF
041331,002198: 00,3102 00006 EXTEND
041332,002199: 00,3103 70155 MP MPAC +1
041333,002200: 00,3104 56130 XCH BUF
041334,002201: 00,3105 00006 EXTEND # (UNNORMALIZE THE SQRT FOR LV).
041335,002202: 00,3106 70154 MP MPAC
041336,002203: 00,3107 56001 XCH L
041337,002204: 00,3110 60130 AD BUF
041338,002205: 00,3111 56001 XCH L
041339,002206:
041340,002207: 00,3112 50120 LARGE2 INDEX FIXLOC
041341,002208: 00,3113 52045 DXCH LV # LENGTH NOW STORED IN WORK AREA.
041342,002209:
041343,002210: 00,3114 45026 CS ONE
041344,002211: 00,3115 54140 TS MAXDVSW # NO MAXDV CASES IN UNIT.
041345,002212:
041346,002213: 00,3116 52123 DXCH VBUF # PREPARE X COMPONENT FOR DIVIDE, SETTING
041347,002214: 00,3117 52155 DXCH MPAC # LENGTH OF VECTOR AS DIVISOR IN BUF.
041348,002215: 00,3120 52131 DXCH BUF
041349,002216: 00,3121 03151 TC UNITDV
041350,002217:
041351,002218: 00,3122 52125 DXCH VBUF +2 # DO Y AND Z IN USUAL FASHION SO WE CAN
041352,002219: 00,3123 52155 DXCH MPAC # EXIT THROUGH VROTATEX.
041353,002220: 00,3124 52160 DXCH MPAC +3
041354,002221: 00,3125 03151 TC UNITDV
041355,002222:
041356,002223: 00,3126 52127 DXCH VBUF +4
041357,002224: 00,3127 52155 DXCH MPAC
041358,002225: 00,3130 52162 DXCH MPAC +5
041359,002226: 00,3131 03151 TC UNITDV
041360,002227: 00,3132 17372 TCF VROTATEX # AND EXIT.
041361,002228:
041362,002229: # IF THE LENGTH OF THE ARGUMENT VECTOR WAS LESS THAN 2(-28), EACH COMPONENT MUST BE SHIFTED LEFT AT LEAST
041363,002230: # 14 PLACES BEFORE THE DIVIDE. NOTE THAT IN THIS CASE, THE MAJOR PART OF EACH COMPONENT IS ZERO.
041364,002231:
041365,002232: 00,3133 54135 SMALL TS MPTEMP # NEGATIVE OF PRE-DIVIDE SHIFT COUNT.
041366,002233:
041367,002234: 00,3134 35030 CAF ZERO # SHIFT EACH COMPONENT LEFT 14.
041368,002235: 00,3135 56123 XCH VBUF +1
041369,002236: 00,3136 56122 XCH VBUF
041370,002237: 00,3137 56125 XCH VBUF +3
041371,002238: 00,3140 56124 XCH VBUF +2
041372,002239: 00,3141 56127 XCH VBUF +5
041373,002240: 00,3142 56126 XCH VBUF +4
041374,002241:
041375,002242: 00,3143 40135 CS MPTEMP
041376,002243: 00,3144 50000 INDEX A
041377,002244: 00,3145 35011 CAF BIT14
041378,002245: 00,3146 00006 EXTEND
041379,002246: 00,3147 70154 MP MPAC
041380,002247: 00,3150 13062 TCF SMALL2
041381,002248:
041382,002249: 00,3151 5034 THIRTEEN = OCT15
041383,002250: 00,3151 4331 FOURTEEN = OCT16
041384,002251: 00,3151 4331 OCT16 = R1D1
041385,002252:
041386,002253: # THE FOLLOWING ROUTINE SETS UP THE CALL TO THE DIVIDE ROUTINES.
041387,002254:
041388,002255: 00,3151 10154 UNITDV CCS MPAC # FORCE MPAC POSITIVE IF POSSIBLE, SETTING
041389,002256: 00,3152 13170 TCF UMPAC+ # DVSIGN ACCORDING TO THE SIGN OF MPAC
041390,002257: 00,3153 13155 TCF +2 # SINCE THE DIVISOR IS ALWAYS POSITIVE
041391,002258: 00,3154 13162 TCF UMPAC- # HERE.
041392,002259:
041393,002260: 00,3155 10155 CCS MPAC +1
041394,002261: 00,3156 13170 TCF UMPAC+
041395,002262: 00,3157 00002 TC Q # EXIT IMMEDIATELY ON ZERO.
041396,002263: 00,3160 13162 TCF UMPAC-
041397,002264: 00,3161 00002 TC Q
041398,002265:
041399,002266: 00,3162 45030 UMPAC- CS ZERO # IF NEGATIVE, SET -0 IN DVSIGN FOR FINAL
041400,002267: 00,3163 54136 TS DVSIGN # COMPLEMENT.
041401,002268: 00,3164 00006 EXTEND
041402,002269: 00,3165 40155 DCS MPAC # PICK UP ABSOLUTE VALUE OF ARG AND JUMP.
041403,002270: 00,3166 50135 INDEX MPTEMP
041404,002271: 00,3167 12564 TCF MAXTEST -1
041405,002272:
041406,002273: 00,3170 54136 UMPAC+ TS DVSIGN # SET DVSIGN FOR POSITIVE QUOTIENT.
041407,002274: 00,3171 52155 DXCH MPAC
041408,002275: 00,3172 50135 INDEX MPTEMP
041409,002276: 00,3173 12564 TCF MAXTEST -1
041410,002277:
041411,002278: # MISCELLANEOUS UNARY OPERATIONS.
041412,002279:
041413,002280: 00,3174 03300 DSQ TC DSQSUB # SQUARE THE DP CONTENTS OF MPAC.
041414,002281: 00,3175 16035 TCF DANZIG
041415,002282:
041416,002283: 00,3176 10163 ABVALABS CCS MODE # ABVAL OR ABS INSTRUCTION.
041417,002284: 00,3177 13226 TCF ABS # DO ABS ON SCALAR.
041418,002285: 00,3200 13226 TCF ABS
041419,002286:
041420,002287: 00,3201 03317 ABVAL TC VSQSUB # DOT MPAC WITH ITSELF.
041421,002288: 00,3202 22163 LXCH MODE # MODE IS NOW DP (L ZERO AFTER DAS).
041422,002289:
041423,002290: 00,3203 00006 EXTEND # STORE SQUARE OF LENGTH IN WORK AREA.
041424,002291: 00,3204 30155 DCA MPAC
041425,002292: 00,3205 50120 INDEX FIXLOC
041426,002293: 00,3206 52043 DXCH LVSQUARE
041427,002294:
041428,002295: # PROGRAM DESCRIPTION- SUBROUTINE SQRT
041429,002296: # FUNCTIONAL DESCRIPTION-DOUBLE PRECISION SQUARE ROOT ROUTINE
041430,002297: # THIS PROGRAM TAKES THE SQUARE ROOT OF THE 27 OR 28 MOST SIGNIFICANT BITS IN THE TRIPLE PRECISION SET OF
041431,002298: # NUMBERS-MPAC,MPAC+1,AND MPAC+2. THE ROOT IS RETURNED DOUBLE PRECISION IN MPAC AND MPAC+1.
041432,002299: # WARNING- THIS SUBROUTINE USES A TRIPLE PRECISION INPUT. THE PROGRAMMER MUST ASSURE THE CONTENTS OF MPAC+2
041433,002300: # ESPECIALLY IF THE CONTENTS OF MPAC IS SMALL OR ZERO. FOR DETAILS SEE STG MEMO NO.949.
041434,002301: # CALLING SEQUENCE- IN INTERPRETIVE MODE I.E., FOLLOWING TC INTPRET,SQRT NO ADDRESS IS ALLOWED
041435,002302: # INPUT SCALING THE BINARY POINT IS ASSUMED TO THE RIGHT OF BIT 15. THE ANSWER IS RETURNED WITH THE SAME SCALING
041436,002303: # SUBROUTINES- GENSCR,MPACSHR, SQRTSUB,ABORT
041437,002304: # ABORT EXIT MODE- ABORTS ON NEGATIVE INPUT -1.2X10E-4 (77775 OCTAL) OR LESS.
041438,002305: # DISPLAYS ERROR CODE 1302
041439,002306: # TC ABORT
041440,002307: # OCT 1302
041441,002308: # DEBRIS - LOCATIONS BUF,MPTEMP,ADDRWD ARE USED
041442,002309: 00,3207 03343 SQRT TC SQRTSUB # TAKE THE SQUARE ROOT OF MPAC.
041443,002310: 00,3210 10135 CCS MPTEMP # RETURNED NORMALIZED SQUARE ROOT. SEE IF
041444,002311: 00,3211 13213 TCF +2 # ANY UN-NORMALIZATION REQUIRED AND EXIT
041445,002312: 00,3212 16035 TCF DANZIG # IF NOT.
041446,002313:
041447,002314: 00,3213 63726 AD NEG12 # A RIGHT SHIFT OF MORE THAN 13 COULD BE
041448,002315: 00,3214 00006 EXTEND # REQUIRED IF INPUT WAS ZERO IN MPAC,+1.
041449,002316: 00,3215 63221 BZMF SQRTSHFT # GOES HERE IN MOST CASES.
041450,002317: 00,3216 22007 ZL # IF A LONG SHIFT IS REQUIRED, GO TO
041451,002318: 00,3217 22116 LXCH ADDRWD # GENERAL RIGHT SHIFT ROUTINES.
041452,002319: 00,3220 12303 TCF GENSCR +4 # ADDRWD WAS ZERO TO PREVENT ROUND.
041453,002320:
041454,002321: 00,3221 50135 SQRTSHFT INDEX MPTEMP # SELECT SHIFTING BIT AND EXIT THROUGH
041455,002322: 00,3222 35010 CAF BIT15 # SHIFT ROUTINES.
041456,002323: 00,3223 54135 TS MPTEMP
041457,002324: 00,3224 35030 CAF ZERO # TO ZERO MPAC +2 IN THE PROCESS.
041458,002325: 00,3225 12036 TCF MPACSHR +3
041459,002326:
041460,002327: 00,3226 06677 ABS TC BRANCH # TEST SIGN OF MPAC AND COMPLEMENT IF
041461,002328: 00,3227 16035 TCF DANZIG
041462,002329: 00,3230 16035 TCF DANZIG
041463,002330: 00,3231 17642 TCF COMP
041464,002331:
041465,002332: 00,3232 45024 VDEF CS FOUR # VECTOR DEFINE - ESSENTIALLY TREATS
041466,002333: 00,3233 26166 ADS PUSHLOC # SCALAR IN MPAC AS X COMPONENT, PUSHES UP
041467,002334: 00,3234 00006 EXTEND # FOR Y AND THEN AGAIN FOR Z.
041468,002335: 00,3235 50000 INDEX A
041469,002336: 00,3236 30003 DCA 2
041470,002337: 00,3237 52160 DXCH MPAC +3
041471,002338: 00,3240 00006 EXTEND
041472,002339: 00,3241 50166 INDEX PUSHLOC
041473,002340: 00,3242 30001 DCA 0
041474,002341: 00,3243 52162 DXCH MPAC +5
041475,002342: 00,3244 16475 TCF VMODE # MODE IS NON VECTOR.
041476,002343:
041477,002344: 00,3245 03317 VSQ TC VSQSUB # DOT MPAC WITH ITSELF.
041478,002345: 00,3246 17304 TCF DMODE # MODE IS NOW DP.
041479,002346:
041480,002347: 00,3247 00006 PUSH EXTEND # PUSH DOWN MPAC LEAVING IT LOADED.
041481,002348: 00,3250 30155 DCA MPAC
041482,002349: 00,3251 50166 INDEX PUSHLOC # PUSH DOWN FIRST TWO REGISTERS IN EACH
041483,002350: 00,3252 52001 DXCH 0
041484,002351:
041485,002352: 00,3253 50163 INDEX MODE # INCREMENT PUSHDOWN POINTER.
041486,002353: 00,3254 36220 CAF NO.WDS
041487,002354: 00,3255 26166 ADS PUSHLOC
041488,002355:
041489,002356: 00,3256 10163 CCS MODE
041490,002357: 00,3257 13272 TCF TPUSH # PUSH DOWN MPAC +2.
041491,002358: 00,3260 16035 TCF DANZIG # DONE FOR DP.
041492,002359:
041493,002360: 00,3261 00006 EXTEND # ON VECTOR, PUSH DOWN Y AND Z COMPONENTS.
041494,002361: 00,3262 30160 DCA MPAC +3
041495,002362: 00,3263 50166 INDEX PUSHLOC
041496,002363: 00,3264 51775 DXCH 0 -4
041497,002364: 00,3265 00006 EXTEND
041498,002365: 00,3266 30162 DCA MPAC +5
041499,002366: 00,3267 50166 INDEX PUSHLOC
041500,002367: 00,3270 51777 DXCH 0 -2
041501,002368: 00,3271 16035 TCF DANZIG
041502,002369:
041503,002370: 00,3272 30156 TPUSH CA MPAC +2
041504,002371: 00,3273 16530 TCF ENDTPUSH +2
041505,002372:
041506,002373: 00,3274 50120 RVQ INDEX FIXLOC # RVQ - RETURN IVA QPRET.
041507,002374: 00,3275 30052 CA QPRET
041508,002375: 00,3276 54117 TS POLISH
041509,002376: 00,3277 16626 TCF GOTO +4 # (ASSUME QPRET POINTS TO FIXED ONLY.)
041510,002377:
041511,002378: # THE FOLLOWING SUBROUTINES ARE USED IN SQUARING MPAC, IN BOTH THE SCALAR AND VECTOR SENSE. THEY ARE
041512,002379: # SPECIAL CASES OF DMPSUB AND DOTSUB, PUT IN TO SAVE SOME TIME.
041513,002380:
041514,002381: 00,3300 30155 DSQSUB CA MPAC +1 # SQUARES THE SCALAR CONTENTS OF MPAC.
041515,002382: 00,3301 00006 EXTEND
041516,002383: 00,3302 70000 SQUARE
041517,002384: 00,3303 54156 TS MPAC +2
041518,002385: 00,3304 35030 CAF ZERO # FORM 2(CROSS TERM).
041519,002386: 00,3305 56155 XCH MPAC +1
041520,002387: 00,3306 00006 EXTEND
041521,002388: 00,3307 70154 MP MPAC
041522,002389: 00,3310 20001 DDOUBL # AND MAYBE OVERFLOW.
041523,002390: 00,3311 20156 DAS MPAC +1 # AND SET A TO NET OVERFLOW.
041524,002391: 00,3312 56154 XCH MPAC
041525,002392: 00,3313 00006 EXTEND
041526,002393: 00,3314 70000 SQUARE
041527,002394: 00,3315 20155 DAS MPAC
041528,002395: 00,3316 00002 TC Q
041529,002396:
041530,002397: 00,3317 00006 VSQSUB EXTEND # DOTS THE VECTOR IN MPAC WITH ITSELF.
041531,002398: 00,3320 22137 QXCH DOTRET
041532,002399: 00,3321 03300 TC DSQSUB # SQUARE THE X COMPONENT.
041533,002400: 00,3322 52160 DXCH MPAC +3
041534,002401: 00,3323 52155 DXCH MPAC
041535,002402: 00,3324 52131 DXCH BUF # SO WE CAN END IN DOTSUB.
041536,002403: 00,3325 30156 CA MPAC +2
041537,002404: 00,3326 54132 TS BUF +2
041538,002405:
041539,002406: 00,3327 03300 TC DSQSUB # SQUARE Y COMPONENT.
041540,002407: 00,3330 52156 DXCH MPAC +1
041541,002408: 00,3331 20132 DAS BUF +1
041542,002409: 00,3332 60154 AD MPAC
041543,002410: 00,3333 60130 AD BUF
041544,002411: 00,3334 54130 TS BUF
041545,002412: 00,3335 13337 TCF +2
041546,002413: 00,3336 54121 TS OVFIND # IF OVERFLOW.
041547,002414:
041548,002415: 00,3337 52162 DXCH MPAC +5
041549,002416: 00,3340 52155 DXCH MPAC
041550,002417: 00,3341 03300 TC DSQSUB # SQUARE Z COMPONENT.
041551,002418: 00,3342 17161 TCF ENDDOT # END AS IN DOTSUB.
041552,002419:
041553,002420: # DOUBLE PRECISION SQUARE ROOT ROUTINE. TAKE THE SQUARE ROOT OF THE TRIPLE PRECISION (MPAC +2 USED ONLY
041554,002421: # IN NORMALIZATION) CONTENTS OF MPAC AND LEAVE THE NORMALIZED RESULT IN MPAC (C(MPAC) GREATER THAN OR EQUAL TO
041555,002422: # .5). THE RIGHT SHIFT COUNT (TO UNNORMALIZE) IS LEFT IN MPTEMP.
041556,002423:
041557,002424:
041558,002425: 00,3343 35030 SQRTSUB CAF ZERO # START BY ZEROING RIGHT SHIFT COUNT.
041559,002426: 00,3344 54135 TS MPTEMP
041560,002427:
041561,002428: 00,3345 10154 CCS MPAC # CHECK FOR POSITIVE ARGUMENT, SHIFTING
041562,002429: 00,3346 13404 TCF SMPAC+ # FIRST SIGNIFICANT MPAC REGISTER INTO
041563,002430: 00,3347 13351 TCF +2 # MPAC ITSELF.
041564,002431: 00,3350 13373 TCF SQRTNEG # SEE IF MAG OF ARGUMENT LESS THAN 10(-4).
041565,002432:
041566,002433: 00,3351 56156 XCH MPAC +2 # MPAC IS ZERO - SHIFT LEFT 14.
041567,002434: 00,3352 56155 XCH MPAC +1
041568,002435: 00,3353 54154 TS MPAC
041569,002436: 00,3354 35032 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
041570,002437: 00,3355 54135 TS MPTEMP
041571,002438:
041572,002439: 00,3356 10154 CCS MPAC # SEE IF MPAC NOW PNZ.
041573,002440: 00,3357 13404 TCF SMPAC+
041574,002441: 00,3360 13362 TCF +2
041575,002442: 00,3361 13376 TCF ZEROANS # NEGATIVE BUT LESS THAN 10(-4) IN MAG.
041576,002443:
041577,002444: 00,3362 56155 XCH MPAC +1 # ZERO - SHIFT LEFT 14 AGAIN.
041578,002445: 00,3363 54154 TS MPAC
041579,002446: 00,3364 35032 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
041580,002447: 00,3365 26135 ADS MPTEMP
041581,002448:
041582,002449: 00,3366 10154 CCS MPAC
041583,002450: 00,3367 13404 TCF SMPAC+
041584,002451: 00,3370 00002 TC Q # SQRT(0) = 0.
041585,002452: 00,3371 13376 TCF ZEROANS
041586,002453: 00,3372 13452 TCF FIXROOT # DO NOT LEAVE SQRTSUB WITH -0 IN MPAC.
041587,002454:
041588,002455:
041589,002456: 00,3373 10000 SQRTNEG CCS A # ARGUMENT IS NEGATIVE, BUT SEE IF SIGN-
041590,002457: 00,3374 13402 TCF SQRTABRT # CORRECTED ARGUMENT IS LESS THAN 10(-4)
041591,002458:
041592,002459: 00,3375 10155 CCS MPAC +1 # IN MAGNITUDE. IF SO, CALL ANSWER ZERO.
041593,002460: 00,3376 35030 ZEROANS CAF ZERO # FORCE ANSWER TO ZERO HERE.
041594,002461: 00,3377 13452 TCF FIXROOT
041595,002462: 00,3400 13402 TCF SQRTABRT
041596,002463: 00,3401 13452 TCF FIXROOT
041597,002464:
041598,002465: 00,3402 05713 SQRTABRT TC ABORT
041599,002466: 00,3403 01302 OCT 1302
041600,002467:
041601,002468: 00,3404 62444 SMPAC+ AD -1/2+2 # SEE IF ARGUMENT GREATER THAN OR EQUAL TO
041602,002469: 00,3405 00006 EXTEND # .5.
041603,002470: 00,3406 63455 BZMF SRTEST # IF SO, SEE IF LESS THAN .25.
041604,002471:
041605,002472: 00,3407 52155 DXCH MPAC # WE WILL TAKE THE SQUARE ROOT OF MPAC/2.
041606,002473: 00,3410 22021 LXCH SR # SHIFT RIGHT 1 AND GO TO THE SQRT ROUTINE
041607,002474: 00,3411 00006 EXTEND
041608,002475: 00,3412 75011 MP HALF
041609,002476: 00,3413 52155 DXCH MPAC
041610,002477: 00,3414 56021 XCH SR
041611,002478: 00,3415 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
041612,002479:
041613,002480: 00,3416 32314 ARGHI CAF SLOPEHI # ARGUMENT BETWEEN .25 AND .5. GET A
041614,002481: 00,3417 00006 EXTEND # LINEAR APPROXIMATION FOR THIS RANGE.
041615,002482: 00,3420 70154 MP MPAC
041616,002483: 00,3421 62566 AD BIASHI # X0/2 = (MPAC/2)(SLOPEHI) + BIASHI/2.
041617,002484:
041618,002485: 00,3422 54130 +4 TS BUF # X0/2 (ARGLO ENTERS HERE).
041619,002486: 00,3423 30154 CA MPAC # SINGLE-PRECISION THROUGHOUT.
041620,002487: 00,3424 22007 ZL
041621,002488: 00,3425 00006 EXTEND
041622,002489: 00,3426 10130 DV BUF # (MPAC/2)/(X0/2)
041623,002490: 00,3427 00006 EXTEND
041624,002491: 00,3430 75011 MP HALF
041625,002492: 00,3431 26130 ADS BUF # X1 = X0/2 + .5(MPAC/2)/(X0/2).
041626,002493:
041627,002494: 00,3432 00006 EXTEND
041628,002495: 00,3433 75011 MP HALF # FORM UP X1/2.
041629,002496: 00,3434 52155 DXCH MPAC # SAVE AND BRING OUT ARGUMENT.
041630,002497: 00,3435 00006 EXTEND # TAKE DP QUOTIENT WITH X1.
041631,002498: 00,3436 10130 DV BUF
041632,002499: 00,3437 54131 TS BUF +1 # SAVE MAJOR PART OF QUOTIENT.
041633,002500: 00,3440 35030 CAF ZERO # FORM MINOR PART OF QUOTIENT USING
041634,002501: 00,3441 56001 XCH L # (REMAINDER,0).
041635,002502: 00,3442 00006 EXTEND
041636,002503: 00,3443 10130 DV BUF
041637,002504: 00,3444 54001 TS L # IN PREPARATION FOR DAS.
041638,002505: 00,3445 30131 CA BUF +1
041639,002506: 00,3446 20155 DAS MPAC # X2 = X1/2 + (MPAC/2)X1
041640,002507:
041641,002508: 00,3447 00006 EXTEND # OVERFLOWS IF ARG. NEAR POSMAX.
041642,002509: 00,3450 13454 BZF TCQBNK00
041643,002510: 00,3451 35006 CAF POSMAX
041644,002511: 00,3452 54154 FIXROOT TS MPAC
041645,002512: 00,3453 54155 TS MPAC +1
041646,002513: 00,3454 00002 TCQBNK00 TC Q # RETURN TO CALLER TO UNNORMALIZE, ETC.
041647,002514:
041648,002515: 00,3455 65012 SRTEST AD QUARTER # ARGUMENT WAS LESS THAN .5, SEE IF LESS
041649,002516: 00,3456 00006 EXTEND # THAN .25.
041650,002517: 00,3457 63501 BZMF SQRTNORM # IF SO, BEGIN NORMALIZATION.
041651,002518:
041652,002519: 00,3460 52155 DXCH MPAC # IF BETWEEN .5 AND .25, SHIFT RIGHT 1 AND
041653,002520: 00,3461 22021 LXCH SR # START AT ARGLO.
041654,002521: 00,3462 00006 EXTEND
041655,002522: 00,3463 75011 MP HALF
041656,002523: 00,3464 52155 DXCH MPAC
041657,002524: 00,3465 56021 XCH SR
041658,002525: 00,3466 26155 ADS MPAC +1 # NO OVERFLOW.
041659,002526:
041660,002527: 00,3467 33007 ARGLO CAF SLOPELO # (NORMALIZED) ARGUMENT BETWEEN .125 AND
041661,002528: 00,3470 00006 EXTEND # .25
041662,002529: 00,3471 70154 MP MPAC
041663,002530: 00,3472 62270 AD BIASLO
041664,002531: 00,3473 13422 TCF ARGHI +4 # BEGIN SQUARE ROOT.
041665,002532:
041666,002533: 00,3474 00006 SQRTNM2 EXTEND # SHIFT LEFT 2 AND INCREMENT RIGHT SHIFT
041667,002534: 00,3475 30156 DCA MPAC +1 # COUNT (FOR TERMINAL UNNORMALIZATION).
041668,002535: 00,3476 20156 DAS MPAC +1
041669,002536: 00,3477 60154 AD MPAC
041670,002537: 00,3500 26154 ADS MPAC # (NO OVERFLOW).
041671,002538:
041672,002539: 00,3501 24135 SQRTNORM INCR MPTEMP # FIRST TIME THROUGH, JUST SHIFT LEFT 1
041673,002540: 00,3502 00006 EXTEND # (PUTS IN EFFECTIVE RIGHT SHIFT SINCE
041674,002541: 00,3503 30156 DCA MPAC +1 # WE WANT MPAC/2).
041675,002542: 00,3504 20156 DAS MPAC +1
041676,002543: 00,3505 60154 AD MPAC
041677,002544: 00,3506 26154 ADS MPAC # (AGAIN NO OVERFLOW).
041678,002545: 00,3507 60000 DOUBLE
041679,002546: 00,3510 54022 TS CYL
041680,002547:
041681,002548: 00,3511 10022 NORMTEST CCS CYL # SEE IF ARGUMENT NOW NORMALIZED AT
041682,002549: 00,3512 10022 CCS CYL # GREATER THAN .125.
041683,002550: 00,3513 13474 TCF SQRTNM2 # NO - SHIFT LEFT 2 MORE AND TRY AGAIN.
041684,002551: 00,3514 13416 TCF ARGHI # YES - NOW BETWEEN .5 AND .25.
041685,002552: 00,3515 13467 TCF ARGLO # ARGUMENT NOW BETWEEN .25 AND .125.
041686,002553:
041687,002554: # TRIGONOMETRIC FUNCTION PACKAGE.
041688,002555:
041689,002556: # THE FOLLOWING TRIGONOMETRIC FUNCTIONS ARE AVAILABLE AS INTERPRETIVE OPERATIONS:
041690,002557:
041691,002558: # 1. SIN COMPUTES (1/2)SINE(2 PI MPAC).
041692,002559: # 2. COS COMPUTES (1/2)COSINE(2 PI MPAC).
041693,002560:
041694,002561: # 3. ASIN COMPUTES (1/2PI)ARCSINE(2 MPAC).
041695,002562: # 4. ACOS COMPUTES (1/2PI)ARCCOSINE(2 MPAC).
041696,002563:
041697,002564: # SIN-ASIN AND COS-ACOS ARE MUTUALLY INVERSE, IE SIN(ASIN(X)) = X.
041698,002565:
041699,002566:
041700,002567: 00,3516 06677 COSINE TC BRANCH # FINDS COSINE USING THE IDENTITY
041701,002568: 00,3517 13522 TCF +3 # COS(X) = SIN(PI/2 - ABS(X)).
041702,002569: 00,3520 13525 TCF PRESINE
041703,002570: 00,3521 13525 TCF PRESINE
041704,002571:
041705,002572: 00,3522 00006 +3 EXTEND
041706,002573: 00,3523 40155 DCS MPAC
041707,002574: 00,3524 52155 DXCH MPAC
041708,002575:
041709,002576: 00,3525 35012 PRESINE CAF QUARTER # PI/2 SCALED.
041710,002577: 00,3526 26154 ADS MPAC
041711,002578:
041712,002579:
041713,002580: 00,3527 52155 SINE DXCH MPAC # DOUBLE ARGUMENT.
041714,002581: 00,3530 20001 DDOUBL
041715,002582: 00,3531 54000 OVSK # SEE IF OVERFLOW PRESENT.
041716,002583: 00,3532 13535 TCF +3 # IF NOT, ARGUMENT OK AS IS.
041717,002584:
041718,002585: 00,3533 00006 EXTEND # IF SO, WE LOST (OR GAINED) PI, SO
041719,002586: 00,3534 40001 DCOM # COMPLEMENT MPAC USING THE IDENTITY
041720,002587: # SIN(X-(+)PI) = SIN(-X).
041721,002588: 00,3535 52155 +3 DXCH MPAC
041722,002589: 00,3536 30154 CA MPAC # SEE IF ARGUMENT GREATER THAN .5 IN
041723,002590: 00,3537 60000 DOUBLE # MAGNITUDE. IF SO, REDUCE IT TO LESS THAN
041724,002591: 00,3540 54001 TS L # .5 (+-PI/2 SCALED) AS FOLLOWS:
041725,002592: 00,3541 13552 TCF SN1
041726,002593:
041727,002594: 00,3542 50000 INDEX A # IF POSITIVE, FORM PI - X, IF NEGATIVE
041728,002595: 00,3543 35010 CAF NEG1/2 +1 # USE -PI - X.
041729,002596: 00,3544 60000 DOUBLE
041730,002597: 00,3545 00006 EXTEND
041731,002598: 00,3546 60154 SU MPAC # GUARANTEED NO OVERFLOW.
041732,002599: 00,3547 54154 TS MPAC
041733,002600: 00,3550 40155 CS MPAC +1
041734,002601: 00,3551 54155 TS MPAC +1
041735,002602:
041736,002603: 00,3552 00006 SN1 EXTEND # SET UP TO EVALUATE HASTINGS POLYNOMIAL
041737,002604: 00,3553 30155 DCA MPAC
041738,002605: 00,3554 52134 DXCH BUF2
041739,002606: 00,3555 03300 TC DSQSUB # SQUARE MPAC.
041740,002607:
041741,002608: 00,3556 07176 TC POLY # EVALUATE FOURTH ORDER POLYNOMIAL.
041742,002609: 00,3557 00003 DEC 3 B-14
041743,002610: 00,3560 14441 37325 2DEC +.3926990796
041744,002611:
041745,002612: 00,3562 53250 60764 2DEC -.6459637111
041746,002613:
041747,002614: 00,3564 12146 21276 2DEC +.318758717
041748,002615:
041749,002616: 00,3566 75466 71471 2DEC -.074780249
041750,002617:
041751,002618: 00,3570 00236 32757 2DEC +.009694988
041752,002619:
041753,002620: 00,3572 32470 CAF LBUF2 # MULTIPLY BY ARGUMENT AND SHIFT LEFT 2.
041754,002621: 00,3573 07062 TC DMPSUB -1
041755,002622:
041756,002623: 00,3574 00006 EXTEND
041757,002624: 00,3575 30156 DCA MPAC +1
041758,002625: 00,3576 20156 DAS MPAC +1
041759,002626: 00,3577 60154 AD MPAC
041760,002627: 00,3600 26154 ADS MPAC # NEITHER SHIFT OVERFLOWS.
041761,002628: 00,3601 00006 EXTEND
041762,002629: 00,3602 30156 DCA MPAC +1
041763,002630: 00,3603 20156 DAS MPAC +1
041764,002631: 00,3604 60154 AD MPAC
041765,002632: 00,3605 26154 ADS MPAC
041766,002633: 00,3606 16035 TCF DANZIG
041767,002634:
041768,002635: # ARCSIN/ARCCOS ROUTINE.
041769,002636:
041770,002637: 00,3607 33630 ARCSIN CAF LASINEX # COMPUTE ARCSIN BY USING THE IDENTITY
041771,002638: 00,3610 13612 TCF +2 # ARCSIN(X) = PI/2 - ARCCOS(X).
041772,002639:
041773,002640: 00,3611 33712 ARCCOS CAF LDANZIG # (EXITS IMMEDIATELY).
041774,002641: 00,3612 54136 TS ESCAPE
041775,002642: 00,3613 06677 TC BRANCH # TEST SIGN OF INPUT.
041776,002643: 00,3614 13624 TCF ACOSST # START IMMEDIATELY IF POSITIVE.
041777,002644: 00,3615 13724 TCF ACOSZERO # ARCCOS(0) = PI/2 = .25.
041778,002645: 00,3616 00006 EXTEND # IF NEGATIVE, USE THE IDENTITY
041779,002646: 00,3617 40155 DCS MPAC # ARCCOS(X) = PI - ARCCOS(-X), FORCING
041780,002647: 00,3620 52155 DXCH MPAC # ARGUMENT POSITIVE.
041781,002648: 00,3621 33727 CAF TCSUBTR # SET EXIT TO DO ABOVE BEFORE
041782,002649: 00,3622 56136 XCH ESCAPE # ARCSIN/ARCCOS CONSIDERATIONS.
041783,002650: 00,3623 54137 TS ESCAPE2
041784,002651:
041785,002652: 00,3624 45011 ACOSST CS HALF # TEST MAGNITUDE OF INPUT.
041786,002653: 00,3625 60154 AD MPAC
041787,002654: 00,3626 10000 CCS A
041788,002655: 00,3627 13720 TCF ACOSOVF # THIS IS PROBABLY AN OVERFLOW CASE.
041789,002656:
041790,002657: 00,3630 13706 LASINEX TCF ASINEX
041791,002658:
041792,002659: 00,3631 13641 TCF ACOSST2 # NO OVERFLOW - PROCEED.
041793,002660:
041794,002661: 00,3632 10155 CCS MPAC +1 # IF MAJOR PART IS .5, CALL ANSWER 0
041795,002662: 00,3633 35030 CAF ZERO # UNLESS MINOR PART NEGATIVE.
041796,002663: 00,3634 13636 TCF ACOS=0
041797,002664:
041798,002665: 00,3635 13641 TCF ACOSST2
041799,002666:
041800,002667: 00,3636 54155 ACOS=0 TS MPAC +1
041801,002668: 00,3637 54154 TS MPAC
041802,002669: 00,3640 00136 TC ESCAPE
041803,002670:
041804,002671: 00,3641 00006 ACOSST2 EXTEND # NOW THAT ARGUMENT IS IN PROPER RANGE,
041805,002672: 00,3642 40155 DCS MPAC # BEGIN COMPUTATION. USE HASTINGS
041806,002673: 00,3643 65011 AD HALF # APPROXIMATION ARCCOS(X) = SQRT(1-X)P(X)
041807,002674: 00,3644 52155 DXCH MPAC # IN A SCALED VERSION WHERE P(X) IS A
041808,002675: 00,3645 52134 DXCH BUF2 # SEVENTH ORDER POLYNOMIAL.
041809,002676:
041810,002677: 00,3646 03343 TC SQRTSUB # RETURNS WITH NORMALIZED SQUARE ROOT.
041811,002678:
041812,002679: 00,3647 10135 CCS MPTEMP # SEE IF UN-NORMALIZATION REQUIRED.
041813,002680: 00,3650 13713 TCF ACOSSHR # IF SO.
041814,002681:
041815,002682: 00,3651 52155 ACOS3 DXCH MPAC # SET UP FOR POLYNOMIAL EVALUATION.
041816,002683: 00,3652 52134 DXCH BUF2
041817,002684: 00,3653 52155 DXCH MPAC
041818,002685:
041819,002686: 00,3654 07176 TC POLY
041820,002687: 00,3655 00006 DEC 6 B-14
041821,002688: 00,3656 13240 23630 2DEC +.353553385 # COEFFICIENTS ARE C 2(+I)/PISQRT(2) WHERE
041822,002689:
041823,002690: 00,3660 74721 47775 2DEC* -.0483017006 B+1* # I
041824,002691:
041825,002692: 00,3662 02440 20237 2DEC* +.0200273085 B+2* # WHERE C STANDS FOR ORIGINAL COEFFS.
041826,002693:
041827,002694: 00,3664 75067 70742 2DEC* -.0112931863 B+3*
041828,002695:
041829,002696: 00,3666 03436 26756 2DEC* +.00695311612 B+4*
041830,002697:
041831,002698: 00,3670 74037 57640 2DEC* -.00384617957 B+5*
041832,002699:
041833,002700: 00,3672 03046 07143 2DEC* +.001501297736 B+6*
041834,002701:
041835,002702: 00,3674 76654 42244 2DEC* -.000284160334 B+7*
041836,002703:
041837,002704:
041838,002705: 00,3676 32470 CAF LBUF2 # DO FINAL MULTIPLY AND GO TO ANY
041839,002706: 00,3677 07062 TC DMPSUB -1 # EPILOGUE SEQUENCES.
041840,002707: 00,3700 00136 TC ESCAPE
041841,002708:
041842,002709: 00,3701 00006 SUBTR EXTEND # EPILOGUE FOR NEGATIVE INPUTS TO ARCCOS.
041843,002710: 00,3702 40155 DCS MPAC
041844,002711: 00,3703 65011 AD HALF # FORMS PI - ARCCOS(-X) = ARCCOS(X).
041845,002712: 00,3704 52155 DXCH MPAC
041846,002713: 00,3705 00137 TC ESCAPE2 # GO TO POSSIBLE ARCSIN EPILOGUE.
041847,002714:
041848,002715: 00,3706 00006 ASINEX EXTEND
041849,002716: 00,3707 40155 DCS MPAC # ARCSIN EPILOGUE - GET ARCSIN(X)
041850,002717: 00,3710 65012 AD QUARTER # = PI/2 - ARCCOS(X).
041851,002718: 00,3711 52155 DXCH MPAC
041852,002719: 00,3712 16035 LDANZIG TCF DANZIG
041853,002720:
041854,002721: 00,3713 50000 ACOSSHR INDEX A # THE SHIFT RIGHT IS LESS THAN 14 SINCE
041855,002722: 00,3714 35011 CAF BIT14 # THE INPUT WAS NON-ZERO DP.
041856,002723: 00,3715 54135 TS MPTEMP
041857,002724: 00,3716 02073 TC VSHRRND # DP SHIFT RIGHT AND ROUND.
041858,002725: 00,3717 13651 TCF ACOS3 # PROCEED.
041859,002726:
041860,002727: 00,3720 00006 ACOSOVF EXTEND # IF MAJOR PART WAS ONLY 1 MORE THAN .5,
041861,002728: 00,3721 13636 BZF ACOS=0 # CALL ANSWER ZERO.
041862,002729:
041863,002730: 00,3722 05713 ACOSABRT TC ABORT
041864,002731: 00,3723 01301 OCT 1301
041865,002732:
041866,002733: 00,3724 35012 ACOSZERO CAF QUARTER # ACOS(0) = PI/2.
041867,002734: 00,3725 13637 TCF ACOS=0 +1 # SET MPAC AND EXIT VIA ESCAPE.
041868,002735:
041869,002736: 00,3726 77763 NEG12 DEC -12 B-14
041870,002737: 00,3727 13701 TCSUBTR TCF SUBTR
041871,002738:
041872,002739: # THE FOLLOWING INSTRUCTIONS ARE AVAILABLE FOR SETTING, MODIFYING, AND BRANCHING ON INDEX REGISTERS:
041873,002740:
041874,002741: # 1. AXT ADDRESS TO INDEX TRUE.
041875,002742: # 1. AXC ADDRESS TO INDEX COMPLEMENTED.
041876,002743: # 3. LXA LOAD INDEX FROM ERASABLE.
041877,002744: # 4. LXC LOAD INDEX COMPLEMENTED FROM ERASABLE.
041878,002745: # 5. SXA STORE INDEX IN ERASABLE.
041879,002746: # 6. XCHX EXCHANGE INDEX REIGSTER WITH ERASABLE.
041880,002747:
041881,002748: # 7. INCR INCREMENT INDEX REGISTER.
041882,002749: # 8. XAD ERASABLE ADD TO INDEX REGISTER.
041883,002750: # 9. XSU ERASABLE SUBTRACT FROM INDEX REGISTER.
041884,002751:
041885,002752: # 10. TIX BRANCH ON INDEX REGISTER AND DECREMENT.
041886,002753:
041887,002754: 01,2165 BANK 01
041888,002755:
041889,002756: 01,2165 COUNT* $$/INTER
041890,002757: 01,2165 02262 AXT TC TAGSUB # SELECT APPROPRIATE INDEX REGISTER.
041891,002758: 01,2166 30117 CA POLISH
041892,002759: 01,2167 50130 XSTORE INDEX INDEXLOC # CONTAINS C(FIXLOC) OR C(FIXLOC)+1.
041893,002760: 01,2170 54046 TS X1
041894,002761: 01,2171 16035 TCF DANZIG
041895,002762:
041896,002763: 01,2172 02262 AXC TC TAGSUB
041897,002764: 01,2173 40117 CS POLISH
041898,002765: 01,2174 02167 TC XSTORE
041899,002766:
041900,002767: 01,2175 02250 LXA TC 15ADRERS # LOAD INDEX REGISTER FROM ERASABLE.
041901,002768: 01,2176 50117 INDEX POLISH
041902,002769: 01,2177 30000 CA 0
041903,002770: 01,2200 12167 TCF XSTORE
041904,002771:
041905,002772: 01,2201 02250 LXC TC 15ADRERS # LOAD NDX REG FROM ERASABLE COMPLEMENTED.
041906,002773: 01,2202 50117 INDEX POLISH
041907,002774: 01,2203 40000 CS 0
041908,002775: 01,2204 12167 TCF XSTORE
041909,002776:
041910,002777: 01,2205 02250 SXA TC 15ADRERS # STORE INDEX REGISTER IN ERASABLE.
041911,002778: 01,2206 50130 INDEX INDEXLOC
041912,002779: 01,2207 30046 CA X1
041913,002780: 01,2210 50117 MSTORE1 INDEX POLISH
041914,002781: 01,2211 54000 TS 0
041915,002782: 01,2212 16035 TCF DANZIG
041916,002783:
041917,002784: 01,2213 02250 XCHX TC 15ADRERS # EXCHANGE INDEX REGISTER WITH ERASABLE.
041918,002785: 01,2214 50117 INDEX POLISH
041919,002786: 01,2215 30000 CA 0
041920,002787: 01,2216 50130 INDEX INDEXLOC
041921,002788: 01,2217 56046 XCH X1
041922,002789: 01,2220 12210 TCF MSTORE1
041923,002790:
041924,002791: 01,2221 02250 XAD TC 15ADRERS # ADD ERASABLE TO INDEX REGISTER.
041925,002792: 01,2222 50117 INDEX POLISH
041926,002793: 01,2223 30000 CA 0
041927,002794: 01,2224 50130 XAD2 INDEX INDEXLOC
041928,002795: 01,2225 26046 ADS X1 # IGNORING OVERFLOWS.
041929,002796: 01,2226 16035 TCF DANZIG
041930,002797:
041931,002798: 01,2227 02262 INCR TC TAGSUB # INCREMENT INDEX REGISTER.
041932,002799: 01,2230 30117 CA POLISH
041933,002800: 01,2231 12224 TCF XAD2
041934,002801:
041935,002802: 01,2232 02250 XSU TC 15ADRERS # SUBTRACT ERASABLE FROM INDEX REGISTER.
041936,002803: 01,2233 50117 INDEX POLISH
041937,002804: 01,2234 40000 CS 0
041938,002805: 01,2235 12224 TCF XAD2
041939,002806:
041940,002807: 01,2236 02262 TIX TC TAGSUB # BRANCH AND DECREMENT ON INDEX.
041941,002808: 01,2237 50130 INDEX INDEXLOC
041942,002809: 01,2240 40050 CS S1
041943,002810: 01,2241 50130 INDEX INDEXLOC
041944,002811: 01,2242 60046 AD X1
041945,002812: 01,2243 00006 EXTEND # NO OPERATION IF DECREMENTED INDEX IS
041946,002813: 01,2244 66035 BZMF DANZIG # NEGATIVE OR ZERO.
041947,002814:
041948,002815: 01,2245 50130 DOTIXBR INDEX INDEXLOC
041949,002816: 01,2246 56046 XCH X1 # IGNORING OVERFLOWS.
041950,002817:
041951,002818: 01,2247 16622 TCF GOTO # DO THE BRANCH USING THE CADR IN POLISH.
041952,002819:
041953,002820: # SUBROUTINE TO CONVERT AN ERASABLE ADDRESS (11 BITS) TO AN EBANK SETTING AND SUBADDRESS.
041954,002821:
041955,002822: 01,2250 40117 15ADRERS CS POLISH
041956,002823: 01,2251 65042 AD DEC45
041957,002824: 01,2252 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
041958,002825: 01,2253 30120 CA FIXLOC # YES. ADD FIXLOC. EBANK OK AS IS.
041959,002826: 01,2254 12261 TCF +5
041960,002827:
041961,002828: 01,2255 35057 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
041962,002829: 01,2256 56117 XCH POLISH
041963,002830: 01,2257 54003 TS EBANK
041964,002831: 01,2260 74371 MASK LOW8
041965,002832: 01,2261 26117 +5 ADS POLISH # FALL INTO TAGSUB, AND RETURN VIA Q.
041966,002833:
041967,002834: # SUBROUTINE WHICH SETS THE ADDRESS OF THE SPECIFIED INDEX IN INDEXLOC. (ACTUALLY, THE ADDRESS -38D.)
041968,002835:
041969,002836: 01,2262 30120 TAGSUB CA FIXLOC
041970,002837: 01,2263 54130 TS INDEXLOC
041971,002838:
041972,002839: 01,2264 10020 CCS CYR # BIT 15 SPECIFIES INDEX.
041973,002840: 01,2265 24130 INCR INDEXLOC # 0 MEANS USE X2.
041974,002841: 01,2266 00002 TC Q
041975,002842: 01,2267 00002 TC Q # 1 FOR X1.
041976,002843:
041977,002844: # MISCELLANEOUS OPERATION CODES WITH DIRECT ADDRESSES. INCLUDED HERE ARE:
041978,002845:
041979,002846: # 1. ITA STORE QPRET (RETURN ADDRESS) IN ERASABLE.
041980,002847: # 2. CALL CALL A SUBROUTINE, LEAVING RETURN IN QPRET.
041981,002848: # 3. RTB RETURN TO BASIC LANGUAGE AT THE GIVEN ADDRESS.
041982,002849: # 4. BHIZ BRANCH IF THE HIGH ORDER OF MPAC IS ZERO (SINGLE PRECISION).
041983,002850: # 5. BOV BRANCH ON OVERFLOW.
041984,002851: # 6. GOTO SIMPLE SEQUENCE CHANGE.
041985,002852:
041986,002853: 01,2270 10020 RTB/BHIZ CCS CYR
041987,002854: 01,2271 30117 RTB CA POLISH
041988,002855: 01,2272 14677 TCF BANKJUMP # CALL BASIC ROUTINE.
041989,002856:
041990,002857: 01,2273 10154 BHIZ CCS MPAC
041991,002858: 01,2274 16035 TCF DANZIG
041992,002859: 01,2275 16622 TCF GOTO
041993,002860: 01,2276 16035 TCF DANZIG
041994,002861: 01,2277 16622 TCF GOTO
041995,002862:
041996,002863: 01,2300 10121 BOV(B) CCS OVFIND # BRANCH ON OVERFLOW TO BASIC OR INTERP.
041997,002864: 01,2301 12303 TCF +2
041998,002865: 01,2302 16035 TCF DANZIG
041999,002866: 01,2303 54121 TS OVFIND
042000,002867: 01,2304 10020 CCS CYR
042001,002868: 01,2305 12271 TCF RTB # IF BASIC.
042002,002869: 01,2306 00360 B5TOB8 OCT 360
042003,002870: 01,2307 16622 TCF GOTO
042004,002871:
042005,002872: 01,2310 10020 BZE/GOTO CCS CYR # SEE WHICH OP-CODE IS DESIRED.
042006,002873: 01,2311 06677 TC BRANCH # DO BZE.
042007,002874: 01,2312 16035 TCF DANZIG
042008,002875: 01,2313 16622 TCF GOTO # DO GOTO.
042009,002876: 01,2314 16035 TCF DANZIG
042010,002877:
042011,002878: 01,2315 10020 BPL/BMN CCS CYR
042012,002879: 01,2316 12324 TCF BPL
042013,002880: 01,2317 12000 5B10 DEC 5 B+10 # SHIFTS OP CODE IN SWITCH INSTRUCTION ADR
042014,002881:
042015,002882: 01,2320 06677 TC BRANCH # DO BMN.
042016,002883: 01,2321 16035 TCF DANZIG
042017,002884: 01,2322 16035 TCF DANZIG
042018,002885: 01,2323 16622 TCF GOTO # ONLY IF NNZ.
042019,002886:
042020,002887: 01,2324 06677 BPL TC BRANCH
042021,002888: 01,2325 16622 TCF GOTO # IF POSITIVE OR ZERO.
042022,002889: 01,2326 16622 TCF GOTO
042023,002890: 01,2327 16035 TCF DANZIG
042024,002891:
042025,002892: 01,2330 10020 CALL/ITA CCS CYR
042026,002893: 01,2331 16614 TCF CALL
042027,002894:
042028,002895: 01,2332 05723 TC CCSHOLE
042029,002896: 01,2333 02250 TC 15ADRERS # STORE QPRET. (TAGSUB AFTER 15ADRERS IS
042030,002897: 01,2334 50120 INDEX FIXLOC # SLOW IN THIS CASE, BUT SAVES STORAGE.)
042031,002898: 01,2335 30052 CA QPRET
042032,002899: 01,2336 12210 TCF MSTORE1
042033,002900:
042034,002901: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR ALTERING AND TESTING INTERPRETIVE SWITCHES:
042035,002902:
042036,002903: # 00 BONSET SET A SWITCH AND DO A GOTO IF IT WAS ON.
042037,002904: # 01 SETGO SET A SWITCH AND DO A GOTO.
042038,002905: # 02 BOFSET SET A SWITCH AND DOA GOTO IF IT WAS OFF
042039,002906: # 03 SET SET A SWITCH.
042040,002907:
042041,002908: # 04 BONINV INVERT A SWITCH AND BRANCH IF IT WAS ON.
042042,002909: # 05 INVGO INVERT A SWITCH AND DO A GOTO.
042043,002910: # 06 BOFINV INVERT A SWITCH AND BRANCH IF IT WAS OFF
042044,002911: # 07 INVERT INVERT A SWITCH.
042045,002912:
042046,002913: # 10 BONCLR CLEAR A SWITCH AND BRANCH IF IT WAS ON.
042047,002914: # 11 CLRGO CLEAR A SWITCH AND DO A GOTO.
042048,002915: # 12 BOFCLR CLEAR A SWITCH AND BRANCH IF IT WAS OFF.
042049,002916: # 13 CLEAR CLEAR A SWITCH.
042050,002917:
042051,002918: # 14 BON BRANCH IF A SWITCH WAS ON.
042052,002919: # 16 BOFF BRANCH IF A SWITCH WAS OFF.
042053,002920:
042054,002921:
042055,002922: # THE ADDRESS SUPPLIED WITH THE SWITCH INSTRUCTION IS INTERPRETED AS FOLLOWS:
042056,002923:
042057,002924: # BITS 1-4 SWITCH BIT NUMBER (1-15).
042058,002925: # BITS 5-8 SWITCH OPERATION NUMBER.
042059,002926: # BITS 9- SWITCH WORD NUMBER (UP TO 64 SWITCH WORDS).
042060,002927:
042061,002928: # THE ADDRESS ITSELF IS MADE UP BY THE YUL SYSTEM ASSEMBLER. THE BRANCH INSTRUCTIONS REQUIRE TWO
042062,002929: # ADDRESSES, THE SECOND TAKEN AS THE DIRECT (OR INDIRECT IF IN ERASABLE) ADDRESS OF THE BRANCH.
042063,002930:
042064,002931:
042065,002932: 01,2337 35035 SWITCHES CAF LOW4 # LEAVE THE SWITCH BIT IN SWBIT .
042066,002933: 01,2340 70117 MASK POLISH
042067,002934: 01,2341 50000 INDEX A
042068,002935: 01,2342 35010 CAF BIT15 # (NUMBER FROM LEFT TO RIGHT.)
042069,002936: 01,2343 54131 TS SWBIT
042070,002937:
042071,002938: 01,2344 35020 CAF BIT7 # LEAVE THE SWITCH NUMBER IN SWWORD.
042072,002939: 01,2345 00006 EXTEND
042073,002940: 01,2346 70117 MP POLISH
042074,002941: 01,2347 54130 TS SWWORD
042075,002942:
042076,002943: 01,2350 00004 INHINT # DURING SWITCH CHANGE SO RUPT CAN USE TOO
042077,002944: 01,2351 50000 INDEX A # LEAVE THE SWITCH WORD ITSELF IN L.
042078,002945: 01,2352 30074 CA STATE
042079,002946: 01,2353 54002 TS Q # Q WILL BE USED AS A CHANNEL.
042080,002947: 01,2354 35014 CAF BIT11
042081,002948: 01,2355 00006 EXTEND # DISPATCH SWITCH BIT OPERATION AS IN BITS
042082,002949: 01,2356 70117 MP POLISH # 7-8 OF POLISH.
042083,002950: 01,2357 72417 MASK B3TOB4 # GETS 4X2-BIT CODE.
042084,002951: 01,2360 50000 INDEX A
042085,002952: 01,2361 12362 TCF +1
042086,002953:
042087,002954: 01,2362 30131 +1 CA SWBIT # 00 - SET SWITCH IN QUESTION.
042088,002955: 01,2363 00006 EXTEND
042089,002956: 01,2364 04002 ROR QCHAN
042090,002957: 01,2365 12374 TCF SWSTORE
042091,002958:
042092,002959: 01,2366 30131 +5 CA SWBIT # 01 - INVERT SWITCH.
042093,002960: 01,2367 00006 EXTEND
042094,002961: 01,2370 06002 RXOR QCHAN
042095,002962: 01,2371 12374 TCF SWSTORE
042096,002963:
042097,002964: 01,2372 40131 +9D CS SWBIT # 10 - CLEAR.
042098,002965: 01,2373 70002 MASK Q
042099,002966: 01,2374 50130 SWSTORE INDEX SWWORD
042100,002967: 01,2375 54074 TS STATE # NEW SWITCH WORD.
042101,002968:
042102,002969: 01,2376 00003 +13D RELINT # 11 - NOOP.
042103,002970: 01,2377 35012 CAF BIT13
042104,002971: 01,2400 00006 EXTEND # DISPATCH SEQUCE CHANGING OR BRANCHING
042105,002972: 01,2401 70117 MP POLISH # CODE.
042106,002973: 01,2402 72417 MASK B3TOB4
042107,002974: 01,2403 50000 INDEX A
042108,002975: 01,2404 12405 TCF +1 # ORIGINALLY STORED IN BITS 5-6.
042109,002976:
042110,002977: 01,2405 40002 +1 CS Q # 00 - BRANCH IF ON.
042111,002978: 01,2406 70131 TEST MASK SWBIT
042112,002979: 01,2407 10000 CCS A
042113,002980: 01,2410 12420 TCF SWSKIP
042114,002981:
042115,002982: 01,2411 16671 +5 TCF SWBRANCH # 01 - GO TO.
042116,002983:
042117,002984: 01,2412 12420 TCF SWSKIP # HERE ONLY ON BIT 15.
042118,002985:
042119,002986: 01,2413 05723 TC CCSHOLE
042120,002987: 01,2414 05723 TC CCSHOLE
042121,002988:
042122,002989: 01,2415 30002 +9D CA Q # 10 - BRANCH IF OFF.
042123,002990: 01,2416 12406 TCF TEST
042124,002991:
042125,002992: 01,2417 00014 B3TOB4 OCT 0014
042126,002993: 01,2420 24164 SWSKIP INCR LOC
042127,002994:
042128,002995: 01,2421 01,2337 SW/ EQUALS SWITCHES
042129,002996:
042130,002997: 01,2421 16035 +13D TCF DANZIG # 11 - NOOP.
End of include-file INTERPRETER.agc. Parent file is MAIN.agc