Source Code
This is the source-code for the Apollo 9 Command Module's Guidance Computer.
These files were derived originally from the scan from MIT's Dibner Institute's
now-discontinued website titled "History of Recent Science and Technology", which
in turn was originally created by Gary Neff, though his high-quality scans were
unfortunately reduced in legibility when presented online.
The markings on the front of the
printout imply that it was the original AGC developer Norm Brodeur's copy.
A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original
AGC developer Fred Martin. The source code was transcribed from
those images by Ron Burkey. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041 20'35 OCT. 28,1968Note that the date is the date of the printout, not the date of the program revision. |
048064,000002: ## Copyright: Public domain.
048065,000003: ## Filename: INTERPRETER.agc
048066,000004: ## Purpose: Part of the source code for Colossus, build 249.
048067,000005: ## It is part of the source code for the Command Module's (CM)
048068,000006: ## Apollo Guidance Computer (AGC), for Apollo 9.
048069,000007: ## Assembler: yaYUL
048070,000008: ## Reference: Starts on p. 1077
048071,000009: ## Contact: Ron Burkey <info@sandroid.org>.
048072,000010: ## Website: www.ibiblio.org/apollo.
048073,000011: ## Mod history: 08/28/04 RSB Adapted from corresponding Luminary 131 file.
048074,000012: ## 2010-10-24 JL Indentation fixes.
048075,000013: ## 2011-05-07 JL Removed workarounds.
048076,000014: ## 2017-01-06 RSB Page numbers now agree with those on the
048077,000015: ## original harcopy, as opposed to the PDF page
048078,000016: ## numbers in 1701.pdf.
048079,000017: ## 2017-01-14 RSB Cross-diff'd comment text (not whitespace)
048080,000018: ## vs the already-proofed corresponding Colossus
048081,000019: ## 237 and Comanche 55 source-code files
048082,000020: ## and corrected errors found.
048083,000021: ## 2017-02-05 RSB Back-ported comment corrections
048084,000022: ## identified while proofing Artemis 072.
048085,000023: ## 2017-03-15 RSB Comment-text fixes identified in 5-way
048086,000024: ## side-by-side diff of Luminary 69/99/116/131/210.
048087,000025:
048088,000026: ## The contents of the "Colossus249" files, in general, are transcribed
048089,000027: ## from a scanned copy of the program listing. Notations on this
048090,000028: ## document read, in part:
048091,000029: ##
048092,000030: ## Assemble revision 249 of AGC program Colossus by NASA
048093,000031: ## 2021111-041. October 28, 1968.
048094,000032: ##
048095,000033: ## This AGC program shall also be referred to as
048096,000034: ## Colossus 1A
048097,000035: ##
048098,000036: ## Prepared by
048099,000037: ## Massachusetts Institute of Technology
048100,000038: ## 75 Cambridge Parkway
048101,000039: ## Cambridge, Massachusetts
048102,000040: ## under NASA contract NAS 9-4065.
048103,000041: ##
048104,000042: ## Refer directly to the online document mentioned above for further information.
048105,000043: ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
048106,000044: ##
048107,000045: ## In some cases, where the source code for Luminary 131 overlaps that of
048108,000046: ## Colossus 249, this code is instead copied from the corresponding Luminary 131
048109,000047: ## source file, and then is proofed to incorporate any changes.
048110,000048:
Page 1077 |
048112,000050: # SECTION 1 DISPATCHER
048113,000051:
048114,000052: # ENTRY TO THE INTERPRETER. INTPRET SETS LOC TO THE FIRST INSTRUCTION, BANKSET TO THE BBANK OF THE
048115,000053: # OBJECT INTERPRETIVE PROGRAM, AND INTBIT15 TO THE BIT15 CONTENTS OF FBANK. INTERPRETIVE PROGRAMS MAY BE IN
048116,000054: # VIRTUALLY ALL BANKS PRESENT UNDER ANY SUPER-BANK SETTING, WITH THE RESTRICTION THAT PROGRAMS IN HIGH BANKS
048117,000055: # (BIT15 OF FBANK = 1) DO NOT REFER TO LOWBANKS, AND VICE-VERSA. THE INTERPRETER DOES NOT SWITCH SUPERBANKS.
048118,000056: # E-BANK SWITCHING OCCURS WHENEVER GENERAL ERASABLE (100-3777) IS ADDRESSED.
048119,000057:
048120,000058: 6006 BLOCK 03
048121,000059:
048122,000060: 6006 COUNT 03/INTER
048123,000061:
048124,000062: 6006 00003 INTPRET RELINT
048125,000063: 6007 00006 EXTEND # SET LOC TO THE WORD FOLLOWING THE TC.
048126,000064: 6010 22164 QXCH LOC
048127,000065: 6011 30006 +2 CA BBANK # INTERPRETIVE BRANCHES FINISH HERE.
048128,000066: 6012 54165 TS BANKSET
048129,000067: 6013 74674 MASK BIT15 # GET 15TH BIT FOR INDEXABLE ADDRESSES.
048130,000068: 6014 54115 TS INTBIT15
048131,000069:
048132,000070: 6015 54023 TS EDOP # MAKE SURE NO INSTRUCTIONS LEFT OVER
048133,000071:
048134,000072: 6016 16037 TCF NEWOPS # PICK UP OP CODE PAIR AND BEGIN.
048135,000073: 6017 22006 INTRSM LXCH BBANK # RESUME SUSPENDED INTERPRETIVE JOB
048136,000074: 6020 16011 TCF INTPRET +3
048137,000075:
048138,000076: # DLOAD LOADS MPAC, MPAC +1, LEAVING ZERO IN MPAC +2.
048139,000077:
048140,000078: 6021 00006 DLOAD EXTEND
048141,000079: 6022 50116 INDEX ADDRWD
048142,000080: 6023 30001 DCA 0 # LOAD DP C(C(ADDRWD)) INTO MPAC,MPAX +1
048143,000081: 6024 52155 SLOAD2 DXCH MPAC
048144,000082: 6025 34714 CAF ZERO # ZERO MPAC +2
048145,000083:
Page 1078 |
048147,000085: # AT THE END OF MOST INSTRUCTIONS, CONTROL IS GIVEN TO DANZIG TO DISPATCH THE NEXT OPERATION.
048148,000086:
048149,000087: 6026 54156 TS MPAC +2 # AND DECLARE DP MODE
048150,000088:
048151,000089: 6027 54163 NEWMODE TS MODE # PROLOGUE FOR MODE-CHANGING INSTRUCTIONS.
048152,000090:
048153,000091: 6030 30165 DANZIG CA BANKSET # SET BBANK BEFORE TESTING NEWJOB SO THAT
048154,000092: 6031 54006 TS BBANK # IT MAY BE SAVED DIRECTLY BY CHANJOB.
048155,000093:
048156,000094: 6032 10023 NOIBNKSW CCS EDOP # SEE IF AN ORDER CODE IS LEFT OVER FROM
048157,000095: 6033 16046 TCF OPJUMP # THE LAST PAIR RETRIEVED. IF SO, EXECUTE.
048158,000096: # EDOP IS SET TO ZERO ON ITS RE-EDITING.
048159,000097:
048160,000098: 6034 10067 CCS NEWJOB # SEE IF A JOB OF HIGHER PRIORITY IS
048161,000099: 6035 15063 TCF CHANG2 # PRESENT, AND IF SO, CHANGE JOBS.
048162,000100:
048163,000101: 6036 24164 INCR LOC # ADVANCE THE LOCATION COUNTER.
048164,000102:
048165,000103: # ITRACE (1) REFERS TO "NEWOPS".
048166,000104: 6037 50164 NEWOPS INDEX LOC # ENTRY TO BEGIN BY PICKING OP CODE PAIR.
048167,000105: 6040 30000 CA 0 # MAY BE AN OPCODE PAIR OR A STORE CODE.
048168,000106: 6041 10000 CCS A # TEST SIGN AND GET DABS(A).
048169,000107: 6042 16331 TCF DOSTORE # PROCESS STORE CODE.
048170,000108:
048171,000109: 6043 00177 LOW7 OCT 177
048172,000110:
048173,000111: 6044 54023 TS EDOP # OP CODE PAIR. LEAVE THE OTHER IN EDOP
048174,000112: 6045 76043 MASK LOW7 # WHERE CCS EDOP WILL HONOR IT NEXT.
048175,000113:
048176,000114: 6046 54020 OPJUMP TS CYR # LOWWD ENTERS HERE IF A RIGHT-HAND OP
048177,000115: 6047 10020 CCS CYR # CODE IS TO BE PROCESSED. TEST PREFICES.
048178,000116: 6050 16216 TCF OPJUMP2 # TEST SECOND PREFIX BIT.
048179,000117:
048180,000118: 6051 16712 TCF EXIT # +0 OP CODE IS EXIT.
048181,000119:
Page 1079 |
048183,000121: # PROCESS ADDRESSES WHICH MAY BE DIRECT, INDEXED, OR REFERENCE THE PUSHDOWN LIST.
048184,000122:
048185,000123: 6052 74712 ADDRESS MASK BIT1 # SEE IF ADDRESS IS INDEXED. CYR CONTAINED
048186,000124: 6053 10000 CCS A # 400XX, SO BIT 1 IS NOW AS IT WAS IN CYR.
048187,000125: 6054 16115 TCF INDEX # FORM INDEXED ADDRESS.
048188,000126:
048189,000127: 6055 50164 DIRADRES INDEX LOC # LOOK AHEAD TO NEXT WORD TO SEE IF
048190,000128: 6056 40001 OCT40001 CS 1 # ADDRESS IS GIVEN.
048191,000129: 6057 10000 CCS A
048192,000130: 6060 16164 TCF PUSHUP # IF NOT.
048193,000131:
048194,000132: 6061 77773 NEG4 DEC -4 B-14
048195,000133:
048196,000134: 6062 24164 INCR LOC # IF SO, TO SHOW WE PICKED UP A WORD.
048197,000135: 6063 54116 TS ADDRWD
048198,000136:
Page 1080 |
048200,000138: # FINAL DIGESTION OF DIRECT ADDRESSES OF OP CODES WITH 01 PREFIX IS DONE HERE. IN EACH CASE, THE
048201,000139: # REQUIRED 12-BIT SUB-ADDRESS IS LEFT IN ADDRWD, WITH ANY REQUIRED E OR F BANK SWITCHING DONE. ADDRESSES LESS
048202,000140: # 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.
048203,000141:
048204,000142: 6064 66220 AD -ENDVAC # SEE IF ADDRESS RELATIVE TO WORK AREA.
048205,000143: 6065 10000 CCS A
048206,000144: 6066 67712 AD -ENDERAS # IF NOT, SEE IF IN GENERAL ERASABLE.
048207,000145: 6067 16074 TCF IERASTST
048208,000146:
048209,000147: 6070 30120 NETZERO CA FIXLOC # IF SO, LEAVE THE MODIFIED ADDRESS IN
048210,000148: 6071 26116 ADS ADDRWD # ADDRWD AND DISPATCH.
048211,000149: 6072 50020 ITR15 INDEX CYR # THIS INDEX MAKES THE NEXT INSTRUCTION
048212,000150: 6073 76242 7 INDJUMP -1 # TCF INDJUMP + OP, EDITING CYR.
048213,000151:
048214,000152: 6074 00006 IERASTST EXTEND
048215,000153: 6075 66105 BZMF GEADDR # GO PROCESS GENERAL-ERASABLE ADDRESS.
048216,000154:
048217,000155: 6076 74747 MASK LOW10 # FIXED BANK ADDRESS. RESTORE AND ADD B15.
048218,000156: 6077 64747 AD LOW10 # SWITCH BANKS AND LEAVE SUBADDRESS IN
048219,000157: 6100 56116 XCH ADDRWD # ADDRWD FOR OPERAND RETRIEVAL. (THIS
048220,000158: 6101 60115 AD INTBIT15 # METHOD PRECLUDES USE OF THE LAST
048221,000159: 6102 54004 TS FBANK # LOCATION IN EACH FBANK.)
048222,000160: 6103 50020 ITR12 INDEX CYR
048223,000161: 6104 76242 7 INDJUMP -1
048224,000162:
048225,000163: 6105 74373 GEADDR MASK LOW8
048226,000164: 6106 64744 AD OCT1400
048227,000165: 6107 56116 XCH ADDRWD
048228,000166: 6110 54003 TS EBANK
048229,000167: 6111 50020 ITR10 INDEX CYR
048230,000168: 6112 76242 7 INDJUMP -1
048231,000169:
Page 1081 |
048233,000171: # THE FOLLOWING ROUTINE PROCESSES INTERPRETIVE INDEXED ADDRESSES. AN INTERPRETER INDEX REGISTER MAY
048234,000172: # CONTAIN THE ADDRESS OF ANY ERASABLE REGISTER (0-42 BEING RELATIVE TO THE VAC AREA) OR ANY INTERPRETIVE PROGRAM
048235,000173: # BANK, OR ANY INTEGER IN THAT RANGE.
048236,000174:
048237,000175: 6113 37702 DODLOAD* CAF DLOAD* # STODL* COMES HERE TO PROCESS LOAD ADR.
048238,000176: 6114 54020 TS CYR # (STOVL* ENTERS HERE).
048239,000177:
048240,000178: 6115 30120 INDEX CA FIXLOC # SET UP INDEX LOCATION.
048241,000179: 6116 54130 TS INDEXLOC
048242,000180: 6117 24164 INCR LOC # (ADDRESS ALWAYS GIVEN).
048243,000181: 6120 50164 INDEX LOC
048244,000182: 6121 40000 CS 0
048245,000183: 6122 10000 CCS A # INDEX 2 IF ADDRESS STORED COMPLEMENTED.
048246,000184: 6123 24130 INCR INDEXLOC
048247,000185: 6124 16125 NOOP
048248,000186:
048249,000187: 6125 54116 TS ADDRWD # 14 BIT ADDRESS TO ADDRWD.
048250,000188: 6126 77711 MASK HIGH4 # IF ADDRESS GREATER THAN 2K, ADD INTBIT15
048251,000189: 6127 00006 EXTEND
048252,000190: 6130 16133 BZF INDEX2
048253,000191: 6131 30115 CA INTBIT15
048254,000192: 6132 26116 ADS ADDRWD
048255,000193:
048256,000194: 6133 50130 INDEX2 INDEX INDEXLOC
048257,000195: 6134 40046 CS X1
048258,000196: 6135 26116 ADS ADDRWD # DO AUGMENT, IGNORING AND CORRECTING OVF.
048259,000197:
048260,000198: 6136 77713 MASK HIGH9 # SEE IF ADDRESS IS IN WORK AREA.
048261,000199: 6137 00006 EXTEND
048262,000200: 6140 16153 BZF INDWORK
048263,000201: 6141 77711 MASK HIGH4 # SEE IF IN FIXED BANK.
048264,000202: 6142 00006 EXTEND
048265,000203: 6143 16155 BZF INDERASE
048266,000204:
048267,000205: 6144 30116 CA ADDRWD # IN FIXED - SWITCH BANKS AND CREATE
048268,000206: 6145 54004 TS FBANK # SUB-ADDRESS.
048269,000207: 6146 74747 MASK LOW10
048270,000208: 6147 64700 AD 2K
048271,000209: 6150 54116 TS ADDRWD
048272,000210: 6151 50020 ITR11 INDEX CYR
048273,000211: 6152 36242 3 INDJUMP -1
048274,000212:
048275,000213: 6153 30120 INDWORK CA FIXLOC # MAKE ADDRWD RELATIVE TO WORK AREA.
048276,000214: 6154 16161 TCF ITR13 -1
048277,000215:
048278,000216: 6155 34744 INDERASE CA OCT1400
048279,000217: 6156 56116 XCH ADDRWD
048280,000218: 6157 54003 TS EBANK
048281,000219: 6160 74373 MASK LOW8
048282,000220: 6161 26116 -1 ADS ADDRWD
Page 1082 |
048284,000222: 6162 50020 ITR13 INDEX CYR
048285,000223: 6163 36242 3 INDJUMP -1
048286,000224:
Page 1083 |
048288,000226: # PUSH-UP ROUTINES. WHEN NO OPERAND ADDRESS IS GIVEN, THE APPROPRIATE OPERAND IS TAKEN FROM THE PUSH-DOWN
048289,000227: # LIST. IN MOST CASES THE MODE OF THE RESULT (VECTOR OR SCALAR) OF THE LAST ARITHMETIC OPERATION PERFORMED
048290,000228: # IS THE SAME AS THE TYPE OF OPERAND DESIRED (ALL ADD/SUBTRACT ETC.). EXCEPTIONS TO THIS GENERAL RULE ARE LISTED
048291,000229: # BELOW (NOTE THAT IN EVERY CASE THE MODE REGISTER IS LEFT INTACT):
048292,000230:
048293,000231: # 1. VXSC AND V/SC WANT THE OPPOSITE TYPE OF OPERAND, E.G., IF THE LAST OPERATION YIELDED A VECTOR
048294,000232: # RESULT, VXSC WANTS A SCALAR.
048295,000233:
048296,000234: # 2. THE LOAD CODES SHOULD LOAD THE ACCUMULATOR INDEPENDENT OF THE RESULT OF THE LAST OPERATION. THIS
048297,000235: # INCLUDES VLOAD, DLOAD, TLOAD, PDDL, AND PDVL (NO PUSHUP WITH SLOAD).
048298,000236:
048299,000237: # 3. SOME ARITHMETIC OPERATIONS REQUIRE A STANDARD TYPE OF OPERAND REGARDLESS OF THE PREVIOUS OPERATION.
048300,000238: # THIS INCLUDES SIGN WANTING DP AND TAD REQUIRING TP.
048301,000239:
048302,000240: 6164 34374 PUSHUP CAF OCT23 # IF THE LOW 5 BITS OF CYR ARE LESS THAN
048303,000241: 6165 70020 MASK CYR # 20, THIS OP REQUIRES SPECIAL ATTENTION.
048304,000242: 6166 66171 AD -OCT10 # (NO -0).
048305,000243: 6167 10000 CCS A
048306,000244: 6170 16202 TCF REGUP # FOR ALL CODES GREATER THAN OCT 7.
048307,000245:
048308,000246: 6171 77767 -OCT10 OCT -10
048309,000247:
048310,000248: 6172 66061 AD NEG4 # WE NOW HAVE 7 - OP CODE (MOD4). SEE IF
048311,000249: 6173 10000 CCS A # THE OP CODE (MOD4) IS THREE (REVERSE).
048312,000250: 6174 50000 INDEX A # NO - THE MODE IS DEFINITE. PICK UP THE
048313,000251: 6175 46213 CS NO.WDS
048314,000252: 6176 16204 TCF REGUP +2
048315,000253:
048316,000254: 6177 50163 INDEX MODE # FOR VXSC AND V/SC WE WANT THE REQUIRED
048317,000255: 6200 46211 CS REVCNT # PUSHLOC DECREMENT WITHOUT CHANGING THE
048318,000256: 6201 16204 TCF REGUP +2 # MODE AT THIS TIME.
048319,000257:
048320,000258: 6202 50163 REGUP INDEX MODE # MOST ALL OP CODES PUSHUP HERE.
048321,000259: 6203 46213 CS NO.WDS
048322,000260: 6204 26166 +2 ADS PUSHLOC
048323,000261: 6205 54116 TS ADDRWD
048324,000262: 6206 50020 ITR14 INDEX CYR
048325,000263: 6207 76242 7 INDJUMP -1 # (THE INDEX MAKES THIS A TCF.)
048326,000264:
048327,000265: 6210 00002 OCT 2 # REVERSE PUSHUP DECREMENT. VECTOR TAKES 2
048328,000266: 6211 00006 REVCNT OCT 6 # WORDS, SCALAR TAKES 6.
048329,000267: 6212 00006 OCT 6
048330,000268: 6213 00002 NO.WDS OCT 2 # CONVENTIONAL DECREMENT IS 6 WORDS VECTOR
048331,000269: 6214 00003 OCTAL3 OCT 3 # 2 IN DP, AND 3 IN TP.
048332,000270: 6215 00006 OCT 6
048333,000271:
Page 1084 |
048335,000273: # TEST THE SECOND PREFIX BIT TO SEE IF THIS IS A MISCELLANEOUS OR A UNARY/SHORT SHIFT OPERATION.
048336,000274:
048337,000275: 6216 10020 OPJUMP2 CCS CYR # TEST SECOND PREFIX BIT.
048338,000276: 6217 16232 TCF OPJUMP3 # TEST THIRD BIT TO SEE IF UNARY OR SHIFT.
048339,000277:
048340,000278: 6220 77722 -ENDVAC DEC -45 B-14
048341,000279:
048342,000280: # THE FOLLOWING ROUTINE PROCESSES ADDRESSES OF SUFFIX CLASS 10. THEY ARE BASICALLY WORK AREA ADDRESSES
048343,000281: # IN THE RANGE 0-52, ERASABLE ECADR CONSTANTS FROM 100-3777, AND FCADRS ABOVE THAT. ALL 15 BITS ARE AVAILABLE
048344,000282: # IN CONTRAST TO SUFFIX 1, IN WHICH ONLY THE LOW ORDER 14 ARE AVAILABLE.
048345,000283:
048346,000284: 6221 24164 15BITADR INCR LOC # (ENTRY HERE FROM STCALL).
048347,000285: 6222 50164 INDEX LOC # PICK UP ADDRESS WORD.
048348,000286: 6223 30000 CA 0
048349,000287: 6224 54117 TS POLISH # WE MAY NEED A SUBADDRESS LATER.
048350,000288:
048351,000289: 6225 34750 CAF LOW7+2K # THESE INSTRUCTIONS ARE IN BANK 1.
048352,000290: 6226 54004 TS FBANK
048353,000291: 6227 70020 MASK CYR
048354,000292: 6230 50000 ITR7 INDEX A
048355,000293: 6231 16303 TCF MISCJUMP
048356,000294:
Page 1085 |
048358,000296: # COMPLETE THE DISPATCHING OF UNARY AND SHORT SHIFT OPERATIONS.
048359,000297:
048360,000298: 6232 54004 OPJUMP3 TS FBANK # CALL IN BANK 0 (BITS 11-15 OF A ARE 0.)
048361,000299:
048362,000300: # ITRACE (6) REFERS TO "OPJUMP3".
048363,000301: 6233 10020 CCS CYR # TEST THIRD PREFIX BIT.
048364,000302: 6234 50000 INDEX A # THE DECREMENTED UNARY CODE IS IN BITS
048365,000303: 6235 12000 TCF UNAJUMP # 1-4 OF A (ZERO, EXIT, HAS BEEN DETECTED)
048366,000304:
048367,000305: 6236 10163 CCS MODE # ITS A SHORT SHIFT CODE. SEE IF PRESENT
048368,000306: 6237 12017 TCF SHORTT # SCALAR OR VECTOR.
048369,000307: 6240 12017 TCF SHORTT
048370,000308: 6241 12121 TCF SHORTV # CALLS THE APPROPRIATE ROUTINE.
048371,000309:
048372,000310: 6242 4364 FBANKMSK EQUALS BANKMASK
048373,000311: 6242 00122 LVBUF ADRES VBUF
048374,000312:
Page 1086 |
048376,000314: # THE FOLLOWING IS THE JUMP TABLE FOR OP CODES WHICH MAY HAVE INDEXABLE ADDRESSES OR MAY PUSH UP.
048377,000315:
048378,000316: 6243 16454 INDJUMP TCF VLOAD # 00 - LOAD MPAC WITH A VECTOR.
048379,000317: 6244 17040 TCF TAD # 01 - TRIPLE PRECISION ADD TO MPAC.
048380,000318: 6245 17624 TCF SIGN # 02 - COMPLEMENT MPAC (V OR SC) IF X NEG.
048381,000319: 6246 17350 TCF VXSC # 03 - VECTOR TIMES SCALAR.
048382,000320: 6247 16652 TCF CGOTO # 04 - COMPUTED GO TO.
048383,000321: 6250 16437 TCF TLOAD # 05 - LOAD MPAC WITH TRIPLE PRECISION.
048384,000322: 6251 16021 TCF DLOAD # 06 - LOAD MPAC WITH A DP SCALAR.
048385,000323: 6252 17573 TCF V/SC # 07 - VECTOR DIVIDED BY SCALAR.
048386,000324:
048387,000325: 6253 16450 TCF SLOAD # 10 - LOAD MPAC IN SINGLE PRECISION.
048388,000326: 6254 16567 TCF SSP # 11 - SET SINGLE PRECISION INTO X.
048389,000327: 6255 16472 TCF PDDL # 12 - PUSH DOWN MPAC AND RE-LOAD IN DP.
048390,000328: 6256 17303 TCF MXV # 13 - MATRIX POST-MULTIPLIED BY VECTOR.
048391,000329: 6257 16526 TCF PDVL # 14 - PUSH DOWN AND VECTORLOAD.
048392,000330: 6260 16575 TCF CCALL # 15 - COMPUTED CALL.
048393,000331: 6261 17306 TCF VXM # 16 - MATRIX PRE-MULTIPLIED BY VECTOR.
048394,000332: 6262 17565 TCF TSLC # 17 - NORMALIZE MPAC (SCALAR ONLY).
048395,000333:
048396,000334: 6263 17543 TCF DMPR # 20 - DP MULTIPLY AND ROUND.
048397,000335: 6264 17546 TCF DDV # 21 - DP DIVIDE BY.
048398,000336: 6265 17552 TCF BDDV # 22 - DP DIVIDE INTO.
048399,000337: 6266 17570 TCF GSHIFT # 23 - GENERAL SHIFT INSTRUCTION.
048400,000338: 6267 16720 TCF VAD # 24 - VECTOR ADD.
048401,000339: 6270 16716 TCF VSU # 25 - VECTOR SUBTRACT.
048402,000340: 6271 17005 TCF BVSU # 26 - VECTOR SUBTRACT FROM.
048403,000341: 6272 17300 TCF DOT # 27 - VECTOR DOT PRODUCT.
048404,000342:
048405,000343: 6273 17427 TCF VXV # 30 - VECTOR CROSS PRODUCT.
048406,000344: 6274 17374 TCF VPROJ # 31 - VECTOR PROJECTION.
048407,000345: 6275 16754 TCF DSU # 32 - DP SUBTRACT.
048408,000346: 6276 17031 TCF BDSU # 33 - DP SUBTRACT FROM.
048409,000347: 6277 16744 TCF DAD # 34 - DP ADD.
048410,000348: 6300 16300 TCF +0 # 35 - AVAILABLE
048411,000349: 6301 17541 TCF DMP1 # 36 - DP MULTIPLY.
048412,000350: 6302 17562 TCF SETPD # 37 - SET PUSH DOWN POINTER (DIRECT ONLY)
048413,000351:
048414,000352: # CODES 10 AND 14 MUST NOT PUSH UP. CODE 04 MAY BE USED FOR VECTOR DECLARE BEFORE PUSHUP IF DESIRED.
048415,000353:
Page 1087 |
048417,000355: # THE FOLLOWING JUMP TABLE APPLIES TO INDEX, BRANCH, AND MISCELLANEOUS INSTRUCTIONS.
048418,000356:
048419,000357: 6303 12371 MISCJUMP TCF AXT # 00 - ADDRESS TO INDEX TRUE.
048420,000358: 6304 12376 TCF AXC # 01 - ADDRESS TO INDEX COMPLEMENTED.
048421,000359: 6305 12401 TCF LXA # 02 - LOAD INDEX FROM ERASABLE.
048422,000360: 6306 12405 TCF LXC # 03 - LOAD INDEX FROM COMPLEMENT OF ERAS.
048423,000361: 6307 12411 TCF SXA # 04 - STORE INDEX IN ERASABLE.
048424,000362: 6310 12417 TCF XCHX # 05 - EXCHANGE INDEX WITH ERASABLE.
048425,000363: 6311 12433 TCF INCR # 06 - INCREMENT INDEX REGISTER.
048426,000364: 6312 12442 TCF TIX # 07 - TRANSFER ON INDEX.
048427,000365:
048428,000366: 6313 12425 TCF XAD # 10 - INDEX REGISTER ADD FROM ERASABLE.
048429,000367: 6314 12436 TCF XSU # 11 - INDEX SUBTRACT FROM ERASABLE.
048430,000368: 6315 12514 TCF BZE/GOTO # 12 - BRANCH ZERO AND GOTO.
048431,000369: 6316 12521 TCF BPL/BMN # 13 - BRANCH PLUS AND BRANCH MINUS.
048432,000370: 6317 12474 TCF RTB/BHIZ # 14 - RETURN TO BASIC AND BRANCH HI ZERO.
048433,000371: 6320 12534 TCF CALL/ITA # 15 - CALL AND STORE QPRET.
048434,000372: 6321 12543 TCF SW/ # 16 - SWITCH INSTRUCTIONS AND AVAILABLE.
048435,000373: 6322 12504 TCF BOV(B) # 17 - BRANCH ON OVERFLOW TO BASIC OR INT.
048436,000374:
Page 1088 |
048438,000376: # THE FOLLOWING JUMP TABLE APPIES TO UNARY INSTRUCTIONS.
048439,000377:
048440,000378: 6323 COUNT 00/INTER
048441,000379:
048442,000380: 00,2000 BANK 0 # 00 - EXIT - DETECTED EARLIER.
048443,000381: 00,2000 13207 UNAJUMP TCF SQRT # 01 - SQUARE ROOT.
048444,000382: 00,2001 13527 TCF SINE # 02 - SIN.
048445,000383: 00,2002 13516 TCF COSINE # 03 - COS.
048446,000384: 00,2003 13607 TCF ARCSIN # 04 - ARC SIN.
048447,000385: 00,2004 13611 TCF ARCCOS # 05 - ARC COS.
048448,000386: 00,2005 13174 TCF DSQ # 06 - DP SQUARE.
048449,000387: 00,2006 12116 TCF ROUND # 07 - ROUND TO DP.
048450,000388:
048451,000389: 00,2007 17637 TCF COMP # 10 - COMPLEMENT VECTOR OR SCALAR.
048452,000390: 00,2010 13232 TCF VDEF # 11 - VECTOR DEFINE.
048453,000391: 00,2011 13023 TCF UNIT # 12 - UNIT VECTOR.
048454,000392: 00,2012 13176 TCF ABVALABS # 13 - LENGTH OF VECTOR OR MAG OF SCALAR.
048455,000393: 00,2013 13245 TCF VSQ # 14 - SQUARE OF LENGTH OF VECTOR.
048456,000394: 00,2014 16323 TCF STADR # 15 - PUSH UP ON STORE CODE.
048457,000395: 00,2015 13274 TCF RVQ # 16 - RETURN VIA QPRET.
048458,000396: 00,2016 13247 TCF PUSH # 17 - PUSH MPAC DOWN.
048459,000397:
Page 1089 |
048461,000399: # SECTION 2 LOAD AND STORE PACKAGE.
048462,000400:
048463,000401: # A SET OF EIGHT STORE CODES IS PROVIDED AS THE PRIMARY METHOD OF STORING THE MULTI-PURPOSE
048464,000402: # ACCUMULATOR (MPAC). IF IN THE DANZIG SECTION LOC REFERS TO AN ALGEBRAICALLY POSITIVE WORD, IT IS TAKEN AS A
048465,000403: # STORE CODE WITH A CORRESPONDING ERASABLE ADDRESS. MOST OF THESE CODES ARE TWO ADDRESS, SPECIFYING THAT THE WORD
048466,000404: # FOLLOWING THE STORE CODE IS TO BE USED AS AN ADDRESS FROM WHICH TO RE-LOAD MPAC. FOUR OPTIONS ARE AVAILABLE:
048467,000405:
048468,000406: # 1. STORE STORE MPAC. THE E ADDRESS MAY BE INDEXED.
048469,000407: # 2. STODL STORE MPAC AND RE-LOAD IT IN DP WITH THE NEXT ADDRESS (THE LOAD MAY BE INDEXED).
048470,000408: # 3. STOVL STORE MPAC AND RE-LOAD A VECTOR (AS ABOVE).
048471,000409: # 4. STCALL STORE AND DO A CALL (BOTH ADDRESSES MUST BE DIRECT HERE).
048472,000410:
048473,000411: # STODL AND STOVL WILL TAKE FROM THE PUSH-DOWN LIST IF NO LOAD ADDRESS IS GIVEN.
048474,000412:
048475,000413: 6323 BLOCK 3
048476,000414:
048477,000415: 6323 COUNT 03/INTER
048478,000416:
048479,000417: 6323 30165 STADR CA BANKSET # THE STADR CODE (PUSHUP UP ON STORE
048480,000418: 6324 54004 TS FBANK # ADDRESS) ENTERS HERE.
048481,000419: 6325 24164 INCR LOC
048482,000420: 6326 50164 ITR1 INDEX LOC # THE STORECODE WAS STORED COMPLEMENTED TO
048483,000421: 6327 40000 CS 0 # MAKE IT LOOK LIKE AN OPCODE PAIR.
048484,000422: 6330 67716 AD NEGONE # (YUL CANT REMOVE 1 BECAUSE OF EARLY CCS)
048485,000423:
048486,000424: 6331 54116 DOSTORE TS ADDRWD
048487,000425: 6332 74372 MASK LOW11 # ENTRY FROM DISPATCHER. SAVE THE ERASABLE
048488,000426: 6333 56116 XCH ADDRWD # ADDRESS AND JUMP ON THE STORE CODE NO.
048489,000427: 6334 77671 MASK B12T14
048490,000428: 6335 00006 EXTEND
048491,000429: 6336 74706 MP BIT5 # EACH TRANSFER VECTOR ENTRY IS TWO WORDS.
048492,000430: 6337 50000 ITR0 INDEX A
048493,000431: 6340 16341 TCF STORJUMP
048494,000432:
Page 1090 |
048496,000434: # STORE CODE JUMP TABLE. CALLS THE APPROPRIATE STORING ROUTINE AND EXITS TO DANZIG OR TO ADDRESS WITH
048497,000435: # A SUPPLIED OPERATION CODE.
048498,000436:
048499,000437: # STORE STORE,1 AND STORE,2 RETURN TO DANZIG, THUS RESETTING THE EBANK TO ITS STATE AT INTPRET.
048500,000438:
048501,000439: 6341 06371 STORJUMP TC STORE # STORE.
048502,000440: 6342 16030 TCF DANZIG # PICK UP NEW OP CODE(S).
048503,000441: 6343 06363 TC STORE,1
048504,000442: 6344 16030 TCF DANZIG
048505,000443: 6345 06366 TC STORE,2
048506,000444: 6346 16030 TCF DANZIG
048507,000445:
048508,000446: 6347 06371 TC STORE # STODL.
048509,000447: 6350 16427 TCF DODLOAD
048510,000448:
048511,000449: 6351 06371 TC STORE # STODL WITH INDEXED LOAD ADDRESS.
048512,000450: 6352 16113 TCF DODLOAD*
048513,000451:
048514,000452: 6353 06371 TC STORE # STOVL.
048515,000453: 6354 16432 TCF DOVLOAD
048516,000454:
048517,000455: 6355 06371 TC STORE # STOVL WITH INDEXED LOAD ADDRESS.
048518,000456: 6356 16435 TCF DOVLOAD*
048519,000457: 6357 06371 TC STORE # STOTC.
048520,000458: 6360 34723 CAF CALLCODE
048521,000459: 6361 54020 TS CYR
048522,000460: 6362 16221 TCF 15BITADR # GET A 15 BIT ADDRESS.
048523,000461:
Page 1091 |
048525,000463: # STORE CODE ADDRESS PROCESSOR.
048526,000464:
048527,000465: 6363 50120 STORE,1 INDEX FIXLOC
048528,000466: 6364 40046 CS X1
048529,000467: 6365 16370 TCF PRESTORE
048530,000468:
048531,000469: 6366 50120 STORE,2 INDEX FIXLOC
048532,000470: 6367 40047 CS X2
048533,000471: 6370 26116 PRESTORE ADS ADDRWD # RESULTANT ADDRESS IS IN ERASABLE.
048534,000472:
048535,000473: 6371 40116 STORE CS ADDRWD
048536,000474: 6372 64727 AD DEC45
048537,000475: 6373 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
048538,000476: 6374 30120 CA FIXLOC # YES.
048539,000477: 6375 16402 TCF AHEAD5
048540,000478: 6376 34744 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
048541,000479: 6377 56116 XCH ADDRWD
048542,000480: 6400 54003 TS EBANK
048543,000481: 6401 74373 MASK LOW8
048544,000482: 6402 26116 AHEAD5 ADS ADDRWD
048545,000483:
Page 1092 |
048547,000485: # STORING ROUTINES. STORE DP, TP, OR VECTOR AS INDICATED BY MODE.
048548,000486:
048549,000487: 6403 00006 STARTSTO EXTEND # MPAC,+1 MUST BE STORED IN ANY EVENT.
048550,000488: # ITRACE (5) REFERS TO "STARTSTO".
048551,000489: 6404 30155 DCA MPAC
048552,000490: 6405 50116 INDEX ADDRWD
048553,000491: 6406 52001 DXCH 0
048554,000492:
048555,000493: 6407 10163 CCS MODE
048556,000494: 6410 16423 TCF TSTORE
048557,000495: 6411 00002 TC Q
048558,000496:
048559,000497: 6412 00006 VSTORE EXTEND
048560,000498: 6413 30160 DCA MPAC +3
048561,000499: 6414 50116 INDEX ADDRWD
048562,000500: 6415 52003 DXCH 2
048563,000501:
048564,000502: 6416 00006 EXTEND
048565,000503: 6417 30162 DCA MPAC +5
048566,000504: 6420 50116 INDEX ADDRWD
048567,000505: 6421 52005 DXCH 4
048568,000506: 6422 00002 TC Q
048569,000507:
048570,000508: 6423 30156 TSTORE CA MPAC +2
048571,000509: 6424 50116 INDEX ADDRWD
048572,000510: 6425 54002 TS 2
048573,000511: 6426 00002 TC Q
048574,000512:
Page 1093 |
048576,000514: # ROUTINES TO BEGIN PROCESSING OF THE SECOND ADDRESS ASSOCIATED WITH ALL STORE-TYPE CODES EXCEPT STORE
048577,000515: # ITSELF.
048578,000516:
048579,000517: 6427 37701 DODLOAD CAF DLOADCOD
048580,000518: 6430 54020 TS CYR
048581,000519: 6431 16055 TCF DIRADRES # GO GET A DIRECT ADDRESS.
048582,000520:
048583,000521: 6432 34674 DOVLOAD CAF VLOADCOD
048584,000522: 6433 54020 TS CYR
048585,000523: 6434 16055 TCF DIRADRES
048586,000524:
048587,000525: 6435 36056 DOVLOAD* CAF VLOAD*
048588,000526: 6436 16114 TCF DODLOAD* +1 # PROLOGUE TO INDEX ROUTINE.
048589,000527:
Page 1094 |
048591,000529: # THE FOLLOWING LOAD INSTRUCTIONS ARE PROVIDED FOR LOADING THE MULTI-PURPOSE ACCUMULATOR MPAC.
048592,000530:
048593,000531: 6437 50116 TLOAD INDEX ADDRWD
048594,000532: 6440 30002 CA 2 # LOAD A TRIPLE PRECISION ARGUMENT INTO
048595,000533: 6441 54156 TS MPAC +2 # THE FIRST THREE MPAC REGISTERS, WITH THE
048596,000534: 6442 00006 EXTEND # CONTENTS OF THE OTHER FOUR IRRELEVANT.
048597,000535: 6443 50116 INDEX ADDRWD
048598,000536: 6444 30001 DCA 0
048599,000537: 6445 52155 DXCH MPAC
048600,000538: 6446 34712 TMODE CAF ONE
048601,000539: 6447 16027 TCF NEWMODE # DECLARE TRIPLE PRECISION MODE.
048602,000540:
048603,000541: 6450 22007 SLOAD ZL # LOAD A SINGLE PRECISION NUMBER INTO
048604,000542: 6451 50116 INDEX ADDRWD # MPAC, SETTING MPAC+1,2 TO ZERO. THE
048605,000543: 6452 30000 CA 0 # CONTENTS OF THE REMAINING MPAC REGISTERS
048606,000544: 6453 16024 TCF SLOAD2 # ARE IRRELEVANT.
048607,000545:
048608,000546: 6454 00006 VLOAD EXTEND # LOAD A DOUBLE PRECISION VECTOR INTO
048609,000547: 6455 50116 INDEX ADDRWD # MPAC,+1, MPAC+3,4, AND MPAC+5,6. THE
048610,000548: 6456 30001 DCA 0 # CONTENTS OF MPAC +2 ARE IRRELEVANT.
048611,000549: 6457 52155 DXCH MPAC
048612,000550:
048613,000551: 6460 00006 ENDVLOAD EXTEND # PDVL COMES HERE TO FINISH UP FOR DP, TP.
048614,000552: 6461 50116 INDEX ADDRWD
048615,000553: 6462 30003 DCA 2
048616,000554: 6463 52160 DXCH MPAC +3
048617,000555:
048618,000556: 6464 00006 +4 EXTEND # TPDVL FINISHES HERE.
048619,000557: 6465 50116 INDEX ADDRWD
048620,000558: 6466 30005 DCA 4
048621,000559: 6467 52162 DXCH MPAC +5
048622,000560:
048623,000561: 6470 44712 VMODE CS ONE # DECLARE VECTOR MODE.
048624,000562: 6471 16027 TCF NEWMODE
048625,000563:
Page 1095 |
048627,000565: # THE FOLLOWING INSTRUCTIONS ARE PROVIDED FOR STORING OPERANDS IN THE PUSHDOWN LIST:
048628,000566: # 1. PUSH PUSHDOWN AND NO LOAD.
048629,000567: # 2. PDDL PUSHDOWN AND DOUBLE PRECISION LOAD.
048630,000568: # 3. PDVL PUSHDOWN AND VECTOR LOAD.
048631,000569:
048632,000570: 6472 00006 PDDL EXTEND
048633,000571: 6473 50116 INDEX ADDRWD # LOAD MPAC,+1, PUSHING THE FORMER
048634,000572: 6474 30001 DCA 0 # CONTENTS DOWN.
048635,000573: 6475 52155 DXCH MPAC
048636,000574: 6476 50166 INDEX PUSHLOC
048637,000575: 6477 52001 DXCH 0
048638,000576:
048639,000577: 6500 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER APPRO-
048640,000578: 6501 36213 CAF NO.WDS # PRIATELY.
048641,000579: 6502 26166 ADS PUSHLOC
048642,000580:
048643,000581: 6503 10163 CCS MODE
048644,000582: 6504 16521 TCF ENDTPUSH
048645,000583: 6505 16517 TCF ENDDPUSH
048646,000584:
048647,000585: 6506 54163 TS MODE # NOW DP.
048648,000586: 6507 54156 ENDVPUSH TS MPAC +2
048649,000587: 6510 52160 DXCH MPAC +3 # PUSH DOWN THE REST OF THE VECTOR HERE.
048650,000588: 6511 50166 INDEX PUSHLOC
048651,000589: 6512 51775 DXCH 0 -4
048652,000590:
048653,000591: 6513 52162 DXCH MPAC +5
048654,000592: 6514 50166 INDEX PUSHLOC
048655,000593: 6515 51777 DXCH 0 -2
048656,000594:
048657,000595: 6516 16030 TCF DANZIG
048658,000596:
048659,000597: 6517 54156 ENDDPUSH TS MPAC +2 # SET MPAC +2 TO ZERO AND EXIT ON DP.
048660,000598: 6520 16030 TCF DANZIG
048661,000599:
048662,000600: 6521 54163 ENDTPUSH TS MODE
048663,000601: 6522 56156 XCH MPAC +2 # ON TRIPLE, SET MPAC +2 TO ZERO, PUSHING
048664,000602: 6523 50166 +2 INDEX PUSHLOC # DOWN THE OLD CONTENTS
048665,000603: 6524 53777 TS 0 -1
048666,000604: 6525 16030 TCF DANZIG
048667,000605:
Page 1096 |
048669,000607: # PDVL - PUSHDOWN AND VECTOR LOAD.
048670,000608:
048671,000609: 6526 00006 PDVL EXTEND # RELOAD MPAC AND PUSH DOWN ITS CONTENTS.
048672,000610: 6527 50116 INDEX ADDRWD
048673,000611: 6530 30001 DCA 0
048674,000612: 6531 52155 DXCH MPAC
048675,000613: 6532 50166 INDEX PUSHLOC
048676,000614: 6533 52001 DXCH 0
048677,000615:
048678,000616: 6534 50163 INDEX MODE # ADVANCE THE PUSHDOWN POINTER.
048679,000617: 6535 36213 CAF NO.WDS
048680,000618: 6536 26166 ADS PUSHLOC
048681,000619:
048682,000620: 6537 10163 CCS MODE # TEST PAST MODE.
048683,000621: 6540 16557 TCF TPDVL
048684,000622: 6541 16460 TCF ENDVLOAD # JUST LOAD LAST FOUR REGISTERS ON DP.
048685,000623:
048686,000624: 6542 00006 VPDVL EXTEND # PUSHDOWN AND RE-LOAD LAST TWO COMPONENTS
048687,000625: 6543 50116 INDEX ADDRWD
048688,000626: 6544 30003 DCA 2
048689,000627: 6545 52160 DXCH MPAC +3
048690,000628: 6546 50166 INDEX PUSHLOC
048691,000629: 6547 51775 DXCH 0 -4
048692,000630:
048693,000631: 6550 00006 EXTEND
048694,000632: 6551 50116 INDEX ADDRWD
048695,000633: 6552 30005 DCA 4
048696,000634: 6553 52162 DXCH MPAC +5
048697,000635: 6554 50166 INDEX PUSHLOC
048698,000636: 6555 51777 DXCH 0 -2
048699,000637:
048700,000638: 6556 16030 TCF DANZIG
048701,000639:
048702,000640: 6557 00006 TPDVL EXTEND # ON TP, WE MUST LOAD THE Y COMPONENT
048703,000641: 6560 50116 INDEX ADDRWD # BEFORE STORING MPAC +2 IN CASE THIS IS A
048704,000642: 6561 30003 DCA 2 # PUSHUP.
048705,000643: 6562 52160 DXCH MPAC +3
048706,000644:
048707,000645: 6563 30156 CA MPAC +2
048708,000646: 6564 50166 INDEX PUSHLOC # IN DP.
048709,000647: 6565 53777 TS 0 -1
048710,000648: 6566 16464 TCF ENDVLOAD +4
048711,000649:
048712,000650: # SSP (STORE SINGLE PRECISION) IS EXECUTED HERE.
048713,000651:
048714,000652: 6567 24164 SSP INCR LOC # PICK UP THE WORD FOLLOWING THE GIVEN
048715,000653: 6570 50164 INDEX LOC # ADDRESS AND STORE IT AT X.
048716,000654: 6571 30000 CA 0
048717,000655: 6572 50116 STORE1 INDEX ADDRWD # SOME INDEX AND MISCELLANEOUS OPS END
048718,000656: 6573 54000 TS 0 # HERE.
Page 1097 |
048720,000658: 6574 16030 TCF DANZIG
048721,000659:
Page 1098 |
048723,000661: # SEQUENCE CHANGING AND SUBROUTINE CALLING OPTIONS.
048724,000662:
048725,000663: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR SEQUENCING CHANGING, BRANCHING, AND CALLING SUBROUTINES:
048726,000664: # 1. GOTO GO TO.
048727,000665: # 2. CALL CALL SUBROUTINE SETTING QPRET.
048728,000666: # 3. CGOTO COMPUTED GO TO.
048729,000667: # 4. CCALL COMPUTED CALL.
048730,000668: # 7. BPL BRANCH IF MPAC POSITIVE OR ZERO.
048731,000669: # 8. BZE BRANCH IF MPAC ZERO.
048732,000670: # 9. BMN BRANCH IF MPAC NEGATIVE NON-ZERO.
048733,000671:
048734,000672: 6575 24164 CCALL INCR LOC # MAINTAIN LOC FOR QPRET COMPUTATION.
048735,000673: 6576 50164 INDEX LOC
048736,000674: 6577 30000 CAF 0 # GET BASE ADDRESS OF CADR LIST.
048737,000675: 6600 50116 INDEX ADDRWD
048738,000676: 6601 60000 AD 0 # ADD INCREMENT.
048739,000677: 6602 54004 TS FBANK # SELECT DESIRED CADR.
048740,000678: 6603 74747 MASK LOW10
048741,000679: 6604 50000 INDEX A
048742,000680: 6605 32000 CAF 10000
048743,000681: 6606 54117 TS POLISH
048744,000682:
048745,000683: 6607 30165 CALL CA BANKSET # FOR ANY OF THE CALL OPTIONS, MAKE UP THE
048746,000684: 6610 74364 MASK BANKMASK # ADDRESS OF THE NEXT OP-CODE PAIR/STORE
048747,000685: 6611 64364 AD BANKMASK # CODE AND LEAVE IT IN QPRET. NOTE THAT
048748,000686: 6612 60164 AD LOC # BANKMASK = -(2000 - 1).
048749,000687: 6613 50120 INDEX FIXLOC
048750,000688: 6614 54052 TS QPRET
048751,000689:
048752,000690: 6615 30117 GOTO CA POLISH # BASIC BRANCHING SEQUENCE.
048753,000691: 6616 77711 +1 MASK HIGH4
048754,000692: 6617 00006 EXTEND
048755,000693: 6620 16631 BZF GOTOERS # SEE IF ADDRESS POINTS TO FIXED OR ERAS.
048756,000694: 6621 30165 +4 CA BANKSET # SET EBANK PART OF BBANK. NEXT, SET UP
048757,000695: 6622 54006 TS BBANK # FBANK. THE COMBINATION IS PICKED UP &
048758,000696: 6623 30117 CA POLISH # PUT INTO BANKSET AT INTPRET +2.
048759,000697: 6624 54004 TS FBANK
048760,000698: 6625 74747 MASK LOW10
048761,000699: 6626 64700 AD 2K
048762,000700: 6627 54164 TS LOC
048763,000701: 6630 16011 TCF INTPRET +3
048764,000702:
048765,000703: 6631 E3,1400 EBANK= 1400 # SO YUL DOESN'T CUSS THE "CA 1400" BELOW.
048766,000704:
048767,000705: 6631 30117 GOTOERS CA POLISH # THE GIVEN ADDRESS IS IN ERASABLE - SEE
048768,000706: 6632 66220 AD -ENDVAC # IF RELATIVE TO THE WORK AREA.
048769,000707: 6633 10000 CCS A
048770,000708: 6634 30117 CA POLISH # GENERAL ERASABLE.
048771,000709: 6635 16644 TCF GOTOGE
048772,000710:
Page 1099 |
048774,000712: 6636 30120 CA FIXLOC # WORK AREA.
048775,000713: 6637 60117 AD POLISH
048776,000714: 6640 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
048777,000715: 6641 30000 CA 0 # THE BRANCH ADDRESS.
048778,000716: 6642 54117 TS POLISH
048779,000717: 6643 16616 TCF GOTO +1 # ALLOWS ARBITRARY INDIRECTNESS LEVELS.
048780,000718:
048781,000719: 6644 54003 GOTOGE TS EBANK
048782,000720: 6645 74373 MASK LOW8
048783,000721: 6646 50000 INDEX A # USE THE GIVEN ADDRESS AS THE ADDRESS OF
048784,000722: 6647 31400 CA 1400 # THE BRANCH ADDRESS.
048785,000723: 6650 54117 TS POLISH
048786,000724: 6651 16616 TCF GOTO +1
048787,000725:
048788,000726: 6652 50164 CGOTO INDEX LOC # COMPUTED GO TO. PICK UP ADDRESS OF CADR
048789,000727: 6653 30001 CA 1 # LIST.
048790,000728: 6654 50116 INDEX ADDRWD # ADD MODIFIER.
048791,000729: 6655 60000 AD 0
048792,000730: 6656 54004 TS FBANK # SELECT GOTO ADDRESS.
048793,000731: 6657 74747 MASK LOW10
048794,000732: 6660 50000 INDEX A
048795,000733: 6661 32000 CA 10000
048796,000734: 6662 54117 TS POLISH
048797,000735: 6663 16616 TCF GOTO +1 # WITH ADDRESS IN A.
048798,000736:
048799,000737: 6664 30165 SWBRANCH CA BANKSET # SWITCH INSTRUCTIONS WHICH ELECT TO
048800,000738: 6665 54004 TS FBANK # BRANCH COME HERE TO DO SO.
048801,000739: 6666 50164 INDEX LOC
048802,000740: 6667 30001 CA 1
048803,000741: 6670 54117 TS POLISH
048804,000742: 6671 16616 TCF GOTO +1
048805,000743:
Page 1100 |
048807,000745: # TRIPLE PRECISION BRANCHING ROUTINE. IF CALLING TC IS AT L, RETURN IS AS FOLLOWS:
048808,000746: # L+1 IF MPAC IS GREATER THAN ZERO.
048809,000747: # L+2 IF MPAC IS EQUAL TO +0 OR -0.
048810,000748: # L+3 IF MPAC IS LESS THAN ZERO.
048811,000749:
048812,000750: 6672 10154 BRANCH CCS MPAC
048813,000751: 6673 00002 TC Q
048814,000752: 6674 16676 TCF +2 # ON ZERO.
048815,000753: 6675 16710 TCF NEG
048816,000754:
048817,000755: 6676 10155 CCS MPAC +1
048818,000756: 6677 00002 TC Q
048819,000757: 6700 16702 TCF +2
048820,000758: 6701 16710 TCF NEG
048821,000759:
048822,000760: 6702 10156 CCS MPAC +2
048823,000761: 6703 00002 TC Q
048824,000762: 6704 16706 TCF +2
048825,000763: 6705 16710 TCF NEG
048826,000764:
048827,000765: 6706 50002 Q+1 INDEX Q
048828,000766: 6707 00001 TC 1
048829,000767:
048830,000768: 6710 50002 NEG INDEX Q # IF FIRST NON-ZERO REGISTER WAS NEGATIVE.
048831,000769: 6711 00002 TC 2
048832,000770: 6712 6710 Q+2 = NEG
048833,000771:
048834,000772: # ITRACE (3) REFERS TO "EXIT".
048835,000773:
048836,000774: 6712 30165 EXIT CA BANKSET # RESTORE USER'S BANK SETTING, AND LEAVE
048837,000775: 6713 54006 TS BBANK # INTERPRETIVE MODE.
048838,000776: 6714 50164 INDEX LOC
048839,000777: 6715 00001 TC 1
048840,000778:
Page 1101 |
048842,000780: # SECTION 3 - ADD/SUBTRACT PACKAGE.
048843,000781:
048844,000782: # THE FOLLOWING OPERATIONS ARE PROVIDED FOR ADDING TO AND SUBTRACTING FROM THE MULTI-PURPOSE ACCUMULATOR
048845,000783: # MPAC:
048846,000784: # 1. DAD DOUBLE PRECISION ADD.
048847,000785: # 2. DSU DOUBLE PRECISION SUBTRACT.
048848,000786: # 3. BDSU DOUBLE PRECISION SUBTRACT FROM.
048849,000787: # 4. TAD TRIPLE PRECISION ADD.
048850,000788: # 5. VAD VECTOR ADD.
048851,000789: # 6. VSU VECTOR SUBTRACT.
048852,000790: # 7. BVSU VECTOR SUBTRACT FROM.
048853,000791: # THE INTERPRETIVE OVERFLOW INDICATOR OVFIND IS SET NON-ZERO IF OVERFLOW OCCURS IN ANY OF THE ABOVE.
048854,000792:
048855,000793: 6716 34674 VSU CAF BIT15 # CHANGES 0 TO DCS.
048856,000794: 6717 16721 TCF +2
048857,000795:
048858,000796: 6720 34371 VAD CAF PRIO30 # CHANGES 0 TO DCA.
048859,000797: 6721 26116 ADS ADDRWD
048860,000798: 6722 00006 EXTEND
048861,000799: 6723 50116 INDEX ADDRWD
048862,000800: 6724 00003 READ HISCALAR # DCA 2 OR DCS 2
048863,000801: 6725 20160 DAS MPAC +3
048864,000802: 6726 00006 EXTEND # CHECK OVERFLOW.
048865,000803: 6727 16731 BZF +2
048866,000804: 6730 06763 TC OVERFLWY
048867,000805:
048868,000806: 6731 00006 EXTEND
048869,000807: 6732 50116 INDEX ADDRWD
048870,000808: 6733 00005 READ CHAN5 # DCA 4 OR DCS 4
048871,000809: 6734 20162 DAS MPAC +5
048872,000810: 6735 00006 EXTEND
048873,000811: 6736 16740 BZF +2
048874,000812: 6737 06760 TC OVERFLWZ
048875,000813:
048876,000814: 6740 00006 EXTEND
048877,000815: 6741 50116 INDEX ADDRWD
048878,000816: 6742 00001 READ LCHAN # DCA 0 OR DCS 0
048879,000817: 6743 16747 TCF ENDVXV
048880,000818:
048881,000819: 6744 00006 DAD EXTEND
048882,000820: 6745 50116 INDEX ADDRWD
048883,000821: 6746 30001 DCA 0
048884,000822: 6747 20155 ENDVXV DAS MPAC # VXV FINISHES HERE.
048885,000823: 6750 00006 EXTEND
048886,000824: 6751 16030 BZF DANZIG
048887,000825:
Page 1102 |
048889,000827: 6752 06766 SETOVF TC OVERFLOW
048890,000828: 6753 16030 TCF DANZIG
048891,000829:
Page 1103 |
048893,000831: 6754 00006 DSU EXTEND
048894,000832: 6755 50116 INDEX ADDRWD
048895,000833: 6756 40001 DCS 0
048896,000834: 6757 16747 TCF ENDVXV
048897,000835:
048898,000836: 6760 54001 OVERFLWZ TS L # ENTRY FOR THIRD COMPONENT.
048899,000837: 6761 34715 CAF FIVE
048900,000838: 6762 16765 TCF +3
048901,000839:
048902,000840: 6763 54001 OVERFLWY TS L # ENTRY FOR SECOND COMPONENT.
048903,000841: 6764 36214 CAF THREE
048904,000842: 6765 56001 XCH L
048905,000843:
048906,000844: 6766 50000 OVERFLOW INDEX A # ENTRY FOR 1ST COMP OR DP (L=0).
048907,000845: 6767 44673 CS LIMITS # PICK UP POSMAX OR NEGMAX.
048908,000846: 6770 54130 TS BUF
048909,000847: 6771 00006 EXTEND
048910,000848: 6772 24000 AUG A # FORCE OVERFLOW.
048911,000849: 6773 50001 INDEX L
048912,000850: 6774 26155 ADS MPAC +1
048913,000851: 6775 54007 TS 7
048914,000852: 6776 34714 CAF ZERO
048915,000853: 6777 60130 AD BUF
048916,000854: 7000 50001 INDEX L
048917,000855: 7001 26154 ADS MPAC
048918,000856: 7002 54007 TS 7
048919,000857: 7003 00002 TC Q # NO OVERFLOW EXIT.
048920,000858: 7004 17121 TCF SETOVF2 # SET OVFIND AND EXIT.
048921,000859:
048922,000860: 7005 00006 BVSU EXTEND
048923,000861: 7006 50116 INDEX ADDRWD
048924,000862: 7007 30003 DCA 2
048925,000863: 7010 52160 DXCH MPAC +3
048926,000864: 7011 00006 EXTEND
048927,000865: 7012 40001 DCOM
048928,000866: 7013 20160 DAS MPAC +3
048929,000867: 7014 00006 EXTEND
048930,000868: 7015 17017 BZF +2
048931,000869: 7016 06763 TC OVERFLWY
048932,000870:
048933,000871: 7017 00006 EXTEND
048934,000872: 7020 50116 INDEX ADDRWD
048935,000873: 7021 30005 DCA 4
048936,000874: 7022 52162 DXCH MPAC +5
048937,000875: 7023 00006 EXTEND
048938,000876: 7024 40001 DCOM
048939,000877: 7025 20162 DAS MPAC +5
048940,000878: 7026 00006 EXTEND
048941,000879: 7027 17031 BZF +2
048942,000880: 7030 06760 TC OVERFLWZ
048943,000881:
Page 1104 |
048945,000883: 7031 00006 BDSU EXTEND
048946,000884: 7032 50116 INDEX ADDRWD
048947,000885: 7033 30001 DCA 0
048948,000886: 7034 52155 DXCH MPAC
048949,000887: 7035 00006 EXTEND
048950,000888: 7036 40001 DCOM
048951,000889: 7037 16747 TCF ENDVXV
048952,000890:
Page 1105 |
048954,000892: # TRIPLE PRECISION ADD ROUTINE.
048955,000893:
048956,000894: 7040 00006 TAD EXTEND
048957,000895: 7041 50116 INDEX ADDRWD
048958,000896: 7042 30002 DCA 1 # ADD MINOR PARTS FIRST.
048959,000897: 7043 20156 DAS MPAC +1
048960,000898: 7044 50116 INDEX ADDRWD
048961,000899: 7045 60000 AD 0
048962,000900: 7046 60154 AD MPAC
048963,000901: 7047 54154 TS MPAC
048964,000902: 7050 16030 TCF DANZIG
048965,000903:
048966,000904: 7051 16752 TCF SETOVF # SET OVFIND IF SUCH OCCURS.
048967,000905:
Page 1106 |
048969,000907: # ARITHMETIC SUBROUTINES REQUIRED IN FIXED-FIXED.
048970,000908: # 1. DMPSUB DOUBLE PRECISION MULTIPLY. MULTIPLY THE CONTENTS OF MPAC,+1 BY THE DP WORD WHOSE ADDRESS
048971,000909: # IS IN ADDRWD AND LEAVE A TRIPLE PRECISION RESULT IN MPAC.
048972,000910: # 2. ROUNDSUB ROUND THE TRIPLE PRECISON CONTENTS OF MPAC TO DOUBLE PRECISION.
048973,000911: # 3. DOTSUB TAKE THE DOT PRODUCT OF THE VECTOR IN MPAC AND THE VECTOR WHOSE ADDRESS IS IN ADDRWD
048974,000912: # AND LEAVE THE TRIPLE PRECISION RESULT IN MPAC.
048975,000913: # 4. POLY USING THE CONTENTS OF MPAC AS A DP ARGUMENT, EVALUATE THE POLYNOMIAL WHOSE DEGREE AND
048976,000914: # COEFFICIENTS IMMEDIATELY FOLLOW THE TC POLY INSTRUCTION (SEE ROUTINE FOR DETAILS.)
048977,000915:
048978,000916: 7052 50002 DMP INDEX Q # BASIC SUBROUTINE FOR USE BY PINBALL, ETC
048979,000917: 7053 30000 CAF 0 # ADRES OF ARGUMENT FOLLOWS TC DMP .
048980,000918: 7054 24002 INCR Q
048981,000919: 7055 54116 -1 TS ADDRWD # (PROLOGUE FOR SETTING ADDRWD.)
048982,000920:
048983,000921: 7056 50116 DMPSUB INDEX ADDRWD # GET MINOR PART OF OPERAND AT C(ADDRWD).
048984,000922: 7057 30001 CA 1
048985,000923: 7060 54156 TS MPAC +2 # THIS WORKS FOR SQUARING MPAC AS WELL.
048986,000924: 7061 34714 CAF ZERO # SET MPAC +1 TO ZERO SO WE CAN ACCUMULATE
048987,000925: 7062 56155 XCH MPAC +1 # THE PARTIAL PRODUCTS WITH DAS
048988,000926: 7063 54135 TS MPTEMP # INSTRUCTIONS.
048989,000927: 7064 00006 EXTEND
048990,000928: 7065 70156 MP MPAC +2 # MINOR OF MPAC X MINOR OF C(ADDRWD).
048991,000929:
048992,000930: 7066 56156 XCH MPAC +2 # DISCARD MINOR PART OF ABOVE RESULT AND
048993,000931: 7067 00006 EXTEND # FORM MAJOR OF MPAC X MINOR OF C(ADDRWD).
048994,000932: 7070 70154 MP MPAC
048995,000933: 7071 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
048996,000934:
048997,000935: 7072 50116 INDEX ADDRWD # GET MAJOR PART OF ARGUMENT AT C(ADDRWD).
048998,000936: 7073 30000 CA 0
048999,000937: 7074 56135 XCH MPTEMP # SAVE AND BRING OUT MINOR OF MPAC.
049000,000938: 7075 00006 DMPSUB2 EXTEND
049001,000939: 7076 70135 MP MPTEMP # MAJOR OF C(ADDRWD) X MINOR OF MPAC.
049002,000940: 7077 20156 DAS MPAC +1 # ACCUMULATE, SETTING A TO NET OVERFLOW.
049003,000941:
049004,000942: 7100 56154 XCH MPAC # SETTING MPAC TO 0 OR +-1.
049005,000943: 7101 00006 EXTEND
049006,000944: 7102 70135 MP MPTEMP # MAJOR OF MPAC X MAJOR OF C(ADDRWD).
049007,000945: 7103 20155 DAS MPAC # GUARANTEED NO OVERFLOW.
049008,000946: 7104 00002 TC Q # 49 MCT = .573 MS. INCLUDING RETURN.
049009,000947:
Page 1107 |
049011,000949: # ROUND MPAC TO DOUBLE PRECISION, SETTING OVFIND ON THE RARE EVENT OF OVERFLOW.
049012,000950:
049013,000951: 7105 34714 ROUNDSUB CAF ZERO # SET MPAC +2 = 0 FOR SCALARS AND CHANGE
049014,000952: 7106 54163 +1 TS MODE # MODE TO DP.
049015,000953:
049016,000954: 7107 56156 VROUND XCH MPAC +2 # BUT WE NEEDNT TAKE THE TIME FOR VECTORS.
049017,000955: 7110 60000 DOUBLE
049018,000956: 7111 54001 TS L
049019,000957: 7112 00002 TC Q
049020,000958:
049021,000959: 7113 60155 AD MPAC +1 # ADD ROUNDING BIT IF MPAC +2 WAS GREATER
049022,000960: 7114 54155 TS MPAC +1 # THAN .5 IN MAGNITUDE.
049023,000961: 7115 00002 TC Q
049024,000962:
049025,000963: 7116 60154 AD MPAC # PROPAGATE INTERFLOW.
049026,000964: 7117 54154 TS MPAC
049027,000965: 7120 00002 TC Q
049028,000966:
049029,000967: 7121 54121 SETOVF2 TS OVFIND # (RARE).
049030,000968: 7122 00002 TC Q
049031,000969:
Page 1108 |
049033,000971: # THE DOT PRODUCT SUBROUTINE USUALLY FORMS THE DOT PRODUCT OF THE VECTOR IN MPAC WITH A STANDARD SIX
049034,000972: # REGISTER VECTOR WHOSE ADDRESS IS IN ADDRWD. IN THIS CASE C(DOTINC) ARE SET TO 2. VXM, HOWEVER, SETS C(DOTINC) TO
049035,000973: # 6 SO THAT DOTSUB DOTS MPAC WITH A COLUMN VECTOR OF THE MATRIX IN QUESTION IN THIS CASE.
049036,000974:
049037,000975: 7123 34711 PREDOT CAF TWO # PROLOGUE TO SET DOTINC TO 2.
049038,000976: 7124 54136 TS DOTINC
049039,000977:
049040,000978: 7125 00006 DOTSUB EXTEND
049041,000979: 7126 22137 QXCH DOTRET # SAVE RETURN.
049042,000980: 7127 07056 TC DMPSUB # DOT X COMPONENTS.
049043,000981: 7130 52160 DXCH MPAC +3 # POSITION Y COMPONENT OF MPAC FOR
049044,000982: 7131 52155 DXCH MPAC # MULTIPLICATION WHILE SAVING RESULT IN
049045,000983: 7132 52131 DXCH BUF # THREE WORD BUFFER, BUF.
049046,000984: 7133 30156 CA MPAC +2
049047,000985: 7134 54132 TS BUF +2
049048,000986:
049049,000987: 7135 30136 CA DOTINC # ADVANCE ADDRWD TO Y COMPONENT OF
049050,000988: 7136 26116 ADS ADDRWD # OTHER ARGUMENT.
049051,000989: 7137 07056 TC DMPSUB
049052,000990: 7140 52156 DXCH MPAC +1 # ACCUMULATE PARTIAL PRODUCTS.
049053,000991: 7141 20132 DAS BUF +1
049054,000992: 7142 60154 AD MPAC
049055,000993: 7143 60130 AD BUF
049056,000994: 7144 54130 TS BUF
049057,000995: 7145 17147 TCF +2
049058,000996: 7146 54121 TS OVFIND # IF OVERFLOW OCCURS.
049059,000997:
049060,000998: 7147 52162 DXCH MPAC +5 # MULTIPLY Z COMPONENTS.
049061,000999: 7150 52155 DXCH MPAC
049062,001000: 7151 30136 CA DOTINC
049063,001001: 7152 26116 ADS ADDRWD
049064,001002: 7153 07056 TC DMPSUB
049065,001003: 7154 52132 ENDDOT DXCH BUF +1 # LEAVE FINAL ACCUMULATION IN MPAC.
049066,001004: 7155 20156 DAS MPAC +1
049067,001005: 7156 60154 AD MPAC
049068,001006: 7157 60130 AD BUF
049069,001007: 7160 54154 TS MPAC
049070,001008: 7161 00137 TC DOTRET
049071,001009:
049072,001010: 7162 06766 TC OVERFLOW # ON OVERFLOW HERE.
049073,001011: 7163 00137 TC DOTRET
049074,001012:
Page 1109 |
049076,001014: # DOUBLE PRECISION POLYNOMIAL EVALUATOR
049077,001015: # N N-1
049078,001016: # THIS ROUTINE EVALUATES A X + A X + ... + A X + A LEAVING THE DP RESULT IN MPAC ON EXIT.
049079,001017: # N N-1 1 0
049080,001018:
049081,001019: # THE ROUTINE HAS TWO ENTRIES
049082,001020:
049083,001021: # 1. ENTRY THRU POWRSERS. THE COEFFICIENTS MAY BE EITHER IN FIXED OR ERASABLE, THE CALL IS BY
049084,001022: # TC POWRSERS, AND THE RETURN IS TO LOC(TC POWRSERS)+1. THE ENTERING DATA MUST BE AS FOLLOWS
049085,001023: # A SP LOC-3 ADDRESS FOR REFERENCING COEF TABLE
049086,001024: # L SP N-1 N IS THE DEGREE OF THE POWER SERIES
049087,001025: # MPAC DP X ARGUMENT
049088,001026: # LOC-2N DP A(0)
049089,001027: # ...
049090,001028: # LOC DP A(N)
049091,001029:
049092,001030: # 2. ENTRY THRU POLY. THE CALL TO POLY AND THE ENTERING DATA MUST BE AS FOLLOWS
049093,001031: # MPAC DP X ARGUMENT
049094,001032: # LOC TC POLY
049095,001033: # LOC+1 SP N-1
049096,001034: # LOC+2 DP A(0)
049097,001035: # ...
049098,001036: # LOC+2N+2 DP A(N) RETURN IS TO LOC+2N+4
049099,001037:
049100,001038: 7164 00006 POWRSERS EXTEND
049101,001039: 7165 22141 QXCH POLYRET # RETURN ADDRESS
049102,001040: 7166 54117 TS POLISH # POWER SERIES ADDRESS
049103,001041: 7167 22140 LXCH POLYCNT # N-1 TO COUNTER
049104,001042: 7170 17201 TCF POLYCOM # SKIP SET UP BY POLY
049105,001043:
049106,001044: 7171 50002 POLY INDEX Q
049107,001045: 7172 30000 CAF 0
049108,001046: 7173 54140 TS POLYCNT # N-1 TO COUNTER
049109,001047: 7174 60000 DOUBLE
049110,001048: 7175 60002 AD Q
049111,001049: 7176 54117 TS POLISH # L(A(N))-3 TO POLISH
049112,001050: 7177 64715 AD FIVE
049113,001051: 7200 54141 TS POLYRET # STORE RETURN ADDRESS
049114,001052:
049115,001053: 7201 36242 POLYCOM CAF LVBUF # INCOMING X WILL BE MOVED TO VBUF, SO
049116,001054: 7202 54116 TS ADDRWD # SET ADDRWD SO DMPSUB WILL MPY BY VBUF.
049117,001055:
049118,001056: 7203 00006 EXTEND
049119,001057: 7204 50117 INDEX POLISH
049120,001058: 7205 30004 DCA 3
049121,001059:
Page 1110 |
049123,001061: 7206 52155 DXCH MPAC # LOAD A(N) INTO MPAC,
049124,001062: 7207 52123 DXCH VBUF # SAVING X IN VBUF
049125,001063: 7210 17214 TCF POLY2
049126,001064:
049127,001065: 7211 54140 POLYLOOP TS POLYCNT # SAVE DECREMENTED LOOP COUNTER
049128,001066: 7212 44711 CS TWO
049129,001067: 7213 26117 ADS POLISH # REGRESS COEFFICIENT POINTER
049130,001068:
049131,001069: 7214 07056 POLY2 TC DMPSUB # MULTIPLY BY X
049132,001070: 7215 00006 EXTEND
049133,001071: 7216 50117 INDEX POLISH
049134,001072: 7217 30002 DCA 1 # ADD IN NEXT COEFFICIENT
049135,001073: 7220 20155 DAS MPAC # USERS RESPONSIBILITY TO ASSURE NO OVFLOW
049136,001074:
049137,001075: 7221 10140 CCS POLYCNT
049138,001076: 7222 17211 TCF POLYLOOP
049139,001077: 7223 00141 TC POLYRET # RETURN CALLER
049140,001078:
Page 1111 |
049142,001080: # MISCELLANEOUS MULTI-PRECISION ROUTINES REQUIRED IN FIXED-FIXED BUT NOT USED BY THE INTERPRETER.
049143,001081:
049144,001082: 7224 34714 DPAGREE CAF ZERO # DOUBLE PRECISION ENTRY -
049145,001083: 7225 54156 TS MPAC +2 # ZERO LOW-ORDER WORD
049146,001084:
049147,001085: 7226 22002 TPAGREE LXCH Q # FORCE SIGN AGREEMENT AMONG THE TRIPLE
049148,001086: 7227 06672 TC BRANCH # PRECISION CONTENTS OF MPAC. RETURNING
049149,001087: 7230 17234 TCF ARG+ # WITH SIGNUM OF THE INPUT IN A.
049150,001088: 7231 17254 TCF ARGZERO
049151,001089:
049152,001090: 7232 44672 CS POSMAX # IF NEGATIVE.
049153,001091: 7233 17235 TCF +2
049154,001092:
049155,001093: 7234 34672 ARG+ CAF POSMAX
049156,001094: 7235 54002 TS Q
049157,001095: 7236 00006 EXTEND
049158,001096: 7237 24000 AUG A # FORMS +-1.0.
049159,001097: 7240 60156 AD MPAC +2
049160,001098: 7241 54156 TS MPAC +2
049161,001099: 7242 34714 CAF ZERO
049162,001100: 7243 60002 AD Q
049163,001101: 7244 60155 AD MPAC +1
049164,001102: 7245 54155 TS MPAC +1
049165,001103: 7246 34714 CAF ZERO
049166,001104: 7247 60002 AD Q # Q STILL HAS POSMAX OR NEGMAX IN IT.
049167,001105: 7250 60154 AD MPAC
049168,001106: 7251 54154 ARGZERO2 TS MPAC # ALWAYS SKIPPING UNLESS ARGZERO.
049169,001107: 7252 54155 TS MPAC +1
049170,001108: 7253 00001 TC L # RETURN VIA L.
049171,001109:
049172,001110: 7254 54156 ARGZERO TS MPAC +2 # SET ALL THREE MPAC REGISTERS TO ZERO.
049173,001111: 7255 17251 TCF ARGZERO2
049174,001112:
049175,001113: # SHORTMP MULTIPLIES THE TP CONTENTS OF MPAC BY THE SINGLE PRECISION NUMBER ARRIVING IN A.
049176,001114:
049177,001115: 7256 54135 SHORTMP TS MPTEMP
049178,001116: 7257 00006 EXTEND
049179,001117: 7260 70156 MP MPAC +2
049180,001118: 7261 54156 TS MPAC +2
049181,001119: 7262 34714 SHORTMP2 CAF ZERO # SO SUBSEQUENT DAS WILL WORK.
049182,001120: 7263 56155 XCH MPAC +1
049183,001121: 7264 17075 TCF DMPSUB2
049184,001122:
Page 1112 |
049186,001124: # DMPNSUB MULTIPLIES THE DP FRACTION ARRIVING IN MPAC BY THE SP
049187,001125: # INTEGER ARRIVING IN A. THE DP PRODUCT DEPARTS BOTH IN MPAC AND IN
049188,001126: # A AND L. NOTE THAT DMPNSUB NORMALLY INCREASES THE MAGNITUDE OF THE
049189,001127: # CONTENTS OF MPAC. THE CUSTOMER MUST INSURE THAT B(A) X B(MPAC,MPAC+1)
049190,001128: # AND B(A) X B(MPAC) ARE LESS THAN 1 IN MAGNITUDE, WHERE B, AS IS OBVIOUS,
049191,001129: # INDICATES THE ARRIVING CONTENTS.
049192,001130:
049193,001131: 7265 54135 DMPNSUB TS DMPNTEMP
049194,001132: 7266 00006 EXTEND
049195,001133: 7267 70155 MP MPAC +1
049196,001134: 7270 52155 DXCH MPAC # LOW PRODUCT TO MPAC, HIGH FACTOR TO A
049197,001135: 7271 00006 EXTEND
049198,001136: 7272 70135 MP DMPNTEMP
049199,001137: 7273 30001 CA L
049200,001138: 7274 26154 ADS MPAC # COMPLETING THE PRODUCT IN MPAC
049201,001139: 7275 00006 EXTEND
049202,001140: 7276 30155 DCA MPAC # BRINGING THE PRODUCT INTO A AND L
049203,001141: 7277 00002 TC Q
049204,001142:
Page 1113 |
049206,001144: # MISCELLANEOUS VECTOR OPERATIONS. INCLUDED HERE ARE THE FOLLOWING:
049207,001145: # 1. DOT DP VECTOR DOT PRODUCT.
049208,001146: # 2. VXV DP VECTOR CROSS PRODUCT.
049209,001147: # 3. VXSC DP VECTOR TIMES SCALAR.
049210,001148: # 4. V/SC DP VECTOR DIVIDED BY SCALAR.
049211,001149: # 5. VPROJ DP VECTOR PROJECTION. ( (MPAC.X)MPAC ).
049212,001150: # 6. VXM DP VECTOR POST-MULTIPLIED BY MATRIX.
049213,001151: # 7. MXV DP VECTOR PRE-MULTIPLIED BY MATRIX.
049214,001152:
049215,001153: 7300 07123 DOT TC PREDOT # DO THE DOT PRODUCT AND EXIT, CHANGING
049216,001154: 7301 34714 DMODE CAF ZERO # THE MODE TO DP SCALAR.
049217,001155: 7302 16027 TCF NEWMODE
049218,001156:
049219,001157: 7303 34711 MXV CAF TWO # SET UP MATINC AND DOTINC FOR ROW
049220,001158: 7304 54140 TS MATINC # VECTORS.
049221,001159: 7305 17311 TCF VXM/MXV # GO TO COMMON PORTION.
049222,001160:
049223,001161: 7306 44377 VXM CS TEN # SET MATINC AND DOTINC TO REFER TO MATRIX
049224,001162: 7307 54140 TS MATINC # AS THREE COLUMN VECTORS.
049225,001163: 7310 36211 CAF SIX
049226,001164:
Page 1114 |
049228,001166: # COMMON PORTION OF MXV AND VXM.
049229,001167:
049230,001168: 7311 54136 VXM/MXV TS DOTINC
049231,001169:
049232,001170: # ITRACE (2) REFERS TO "VXM/MXV".
049233,001171:
049234,001172: 7312 07501 TC MPACVBUF # SAVE VECTOR IN MPAC FOR FURTHER USE.
049235,001173:
049236,001174: 7313 07125 TC DOTSUB # GO DOT TO GET X COMPONENT OF ANSWER.
049237,001175: 7314 00006 EXTEND
049238,001176: 7315 30123 DCA VBUF # MOVE MPAC VECTOR BACK INTO MPAC, SAVING
049239,001177: 7316 52155 DXCH MPAC # NEW X COMPONENT IN BUF2.
049240,001178: 7317 52134 DXCH BUF2
049241,001179: 7320 00006 EXTEND
049242,001180: 7321 30125 DCA VBUF +2
049243,001181: 7322 52160 DXCH MPAC +3
049244,001182: 7323 00006 EXTEND
049245,001183: 7324 30127 DCA VBUF +4
049246,001184: 7325 52162 DXCH MPAC +5
049247,001185: 7326 30140 CA MATINC # INITIALIZE ADDRWD FOR NEXT DOT PRODUCT.
049248,001186: 7327 26116 ADS ADDRWD # FORMS BASE ADDRESS OF NEXT COLUMN(ROW).
049249,001187:
049250,001188: 7330 07125 TC DOTSUB
049251,001189: 7331 52123 DXCH VBUF # MOVE GIVEN VECTOR BACK TO MPAC, SAVING Y
049252,001190: 7332 52155 DXCH MPAC # COMPONENT OF ANSWER IN VBUF +2.
049253,001191: 7333 52125 DXCH VBUF +2
049254,001192: 7334 52160 DXCH MPAC +3
049255,001193: 7335 52127 DXCH VBUF +4
049256,001194: 7336 52162 DXCH MPAC +5
049257,001195: 7337 30140 CA MATINC # FORM ADDRESS OF LAST COLUMN OR ROW.
049258,001196: 7340 26116 ADS ADDRWD
049259,001197:
049260,001198: 7341 07125 TC DOTSUB
049261,001199: 7342 52134 DXCH BUF2 # ANSWER NOW COMPLETE. PUT COMPONENTS INTO
049262,001200: 7343 52155 DXCH MPAC # PROPER MPAC REGISTERS.
049263,001201: 7344 52162 DXCH MPAC +5
049264,001202: 7345 52125 DXCH VBUF +2
049265,001203: 7346 52160 DXCH MPAC +3
049266,001204: 7347 16030 TCF DANZIG # EXIT.
049267,001205:
Page 1115 |
049269,001207: # VXSC - VECTOR TIMES SCALAR.
049270,001208:
049271,001209: 7350 10163 VXSC CCS MODE # TEST PRESENT MODE.
049272,001210: 7351 17377 TCF DVXSC # SEPARATE ROUTINE WHEN SCALAR IS IN MPAC.
049273,001211: 7352 17377 TCF DVXSC
049274,001212:
049275,001213: 7353 07056 VVXSC TC DMPSUB # COMPUTE X COMPONENT
049276,001214: 7354 07107 TC VROUND # AND ROUND IT.
049277,001215: 7355 52160 DXCH MPAC +3 # PUT Y COMPONENT INTO MPAC SAVING MPAC IN
049278,001216: 7356 52155 DXCH MPAC # MPAC +3.
049279,001217: 7357 52160 DXCH MPAC +3
049280,001218:
049281,001219: 7360 07056 TC DMPSUB # DO SAME FOR Y AND Z COMPONENTS.
049282,001220: 7361 07107 TC VROUND
049283,001221: 7362 52162 DXCH MPAC +5
049284,001222: 7363 52155 DXCH MPAC
049285,001223: 7364 52162 DXCH MPAC +5
049286,001224:
049287,001225: 7365 07056 TC DMPSUB
049288,001226: 7366 07107 TC VROUND
049289,001227: 7367 52155 VROTATEX DXCH MPAC # EXIT USED TO RESTORE MPAC AFTER THIS
049290,001228: 7370 52162 DXCH MPAC +5 # TYPE OF ROTATION. CALLED BY VECTOR SHIFT
049291,001229: 7371 52160 DXCH MPAC +3 # RIGHT, V/SC, ETC.
049292,001230: 7372 52155 DXCH MPAC
049293,001231: 7373 16030 TCF DANZIG
049294,001232:
Page 1116 |
049296,001234: # DP VECTOR PROJECTION ROUTINE.
049297,001235:
049298,001236: 7374 07123 VPROJ TC PREDOT # (MPAC.X)MPAC IS COMPUTED AND LEFT IN
049299,001237: 7375 44710 CS FOUR # MPAC. DO DOT AND FALL INTO DVXSC.
049300,001238: 7376 26116 ADS ADDRWD
049301,001239:
049302,001240: # VXSC WHEN SCALAR ARRIVES IN MPAC AND VECTOR IS AT X.
049303,001241:
049304,001242: 7377 00006 DVXSC EXTEND # SAVE SCALAR IN MPAC +3 AND GET X
049305,001243: 7400 30155 DCA MPAC # COMPONENT OF ANSWER.
049306,001244: 7401 52160 DXCH MPAC +3
049307,001245: 7402 07056 TC DMPSUB
049308,001246: 7403 07107 TC VROUND
049309,001247:
049310,001248: 7404 34711 CAF TWO # ADVANCE ADDRWD TO Y COMPONENT OF X.
049311,001249: 7405 26116 ADS ADDRWD
049312,001250: 7406 00006 EXTEND
049313,001251: 7407 30160 DCA MPAC +3 # PUT SCALAR BACK INTO MPAC AND SAVE
049314,001252: 7410 52155 DXCH MPAC # X RESULT IN MPAC +5.
049315,001253: 7411 52162 DXCH MPAC +5
049316,001254: 7412 07056 TC DMPSUB
049317,001255: 7413 07107 TC VROUND
049318,001256:
049319,001257: 7414 34711 CAF TWO
049320,001258: 7415 26116 ADS ADDRWD # TO Z COMPONENT.
049321,001259: 7416 52160 DXCH MPAC +3 # BRING SCALAR BACK, PUTTING Y RESULT IN
049322,001260: 7417 52155 DXCH MPAC # THE PROPER PLACE.
049323,001261: 7420 52160 DXCH MPAC +3
049324,001262: 7421 07056 TC DMPSUB
049325,001263: 7422 07107 TC VROUND
049326,001264:
049327,001265: 7423 52155 DXCH MPAC # PUT Z COMPONENT IN PROPER PLACE, ALSO
049328,001266: 7424 52162 DXCH MPAC +5 # POSITIONING X.
049329,001267: 7425 52155 DXCH MPAC
049330,001268:
049331,001269: 7426 16470 TCF VMODE # MODE HAS CHANGED TO VECTOR.
049332,001270:
Page 1117 |
049334,001272: # THE VECTOR CROSS PRODUCT ROUTINE CALCULATES (X M -X M ,X M -X M ,X M -X M ) WHERE M IS THE VECTOR IN
049335,001273: # 3 2 2 3 1 3 3 1 2 1 1 2
049336,001274: # MPAC AND X THE VECTOR AT THE GIVEN ADDRESS.
049337,001275:
049338,001276: 7427 00006 VXV EXTEND
049339,001277: 7430 30162 DCA MPAC +5 # FORM UP M3X1, LEAVING M1 IN VBUF.
049340,001278: 7431 52155 DXCH MPAC
049341,001279: 7432 52123 DXCH VBUF
049342,001280: 7433 07056 TC DMPSUB # BY X1.
049343,001281:
049344,001282: 7434 00006 EXTEND
049345,001283: 7435 40160 DCS MPAC +3 # CALCULATE -X1M2, SAVING X1M3 IN VBUF +2.
049346,001284: 7436 52155 DXCH MPAC
049347,001285: 7437 52125 DXCH VBUF +2
049348,001286: 7440 07056 TC DMPSUB
049349,001287:
049350,001288: 7441 34711 CAF TWO # ADVANCE ADDRWD TO X2.
049351,001289: 7442 26116 ADS ADDRWD
049352,001290: 7443 00006 EXTEND
049353,001291: 7444 40162 DCS MPAC +5 # PREPARE TO GET -X2M3, SAVING -X1M2 IN
049354,001292: 7445 52155 DXCH MPAC # MPAC +5.
049355,001293: 7446 52162 DXCH MPAC +5
049356,001294: 7447 07056 TC DMPSUB
049357,001295:
049358,001296: 7450 00006 EXTEND
049359,001297: 7451 30123 DCA VBUF # GET X2M1, SAVING -X2M3 IN VBUF +4.
049360,001298: 7452 52155 DXCH MPAC
049361,001299: 7453 52127 DXCH VBUF +4
049362,001300: 7454 07056 TC DMPSUB
049363,001301:
049364,001302: 7455 34711 CAF TWO # ADVANCE ADDRWD TO X3.
049365,001303: 7456 26116 ADS ADDRWD
049366,001304: 7457 00006 EXTEND
049367,001305: 7460 40123 DCS VBUF # GET -X3M1, ADDING X2M1 TO MPAC +5 TO
049368,001306: 7461 52155 DXCH MPAC # COMPLETE THE Z COMPONENT OF THE ANSWER.
049369,001307: 7462 20162 DAS MPAC +5
049370,001308:
049371,001309: 7463 00006 EXTEND
049372,001310: 7464 17466 BZF +2
049373,001311: 7465 06760 TC OVERFLWZ
049374,001312:
049375,001313: 7466 07056 TC DMPSUB
049376,001314: 7467 52125 DXCH VBUF +2 # MOVE X1M3 TO MPAC +3 SETTING UP FOR X3M2
049377,001315: 7470 52160 DXCH MPAC +3 # AND ADD -X3M1 TO MPAC +3 TO COMPLETE THE
049378,001316: 7471 52155 DXCH MPAC # Y COMPONENT OF THE RESULT.
049379,001317: 7472 20160 DAS MPAC +3
049380,001318:
049381,001319: 7473 00006 EXTEND
049382,001320: 7474 17476 BZF +2
Page 1118 |
049384,001322: 7475 06763 TC OVERFLWY
049385,001323:
049386,001324: 7476 07056 TC DMPSUB
049387,001325: 7477 52127 DXCH VBUF +4 # GO ADD -X2M3 TO X3M2 TO COMPLETE THE X
049388,001326: 7500 16747 TCF ENDVXV # COMPONENT (TAIL END OF DAD).
049389,001327:
049390,001328: # THE MPACVBUF SUBROUTINE SAVES THE VECTOR IN MPAC IN VBUF WITHOUT CLOBBERING MPAC.
049391,001329:
049392,001330: 7501 00006 MPACVBUF EXTEND # CALLED BY MXV, VXM, AND UNIT.
049393,001331: 7502 30155 DCA MPAC
049394,001332: 7503 52123 DXCH VBUF
049395,001333: 7504 00006 EXTEND
049396,001334: 7505 30160 DCA MPAC +3
049397,001335: 7506 52125 DXCH VBUF +2
049398,001336: 7507 00006 EXTEND
049399,001337: 7510 30162 DCA MPAC +5
049400,001338: 7511 52127 DXCH VBUF +4
049401,001339: 7512 00002 TC Q # RETURN TO CALLER.
049402,001340:
049403,001341: # DOUBLE PRECISION SIGN AGREE ROUTINE. ARRIVE WITH INPUT IN A+L. OUTPUT IS IN A + L.
049404,001342:
049405,001343: 7513 10000 ALSIGNAG CCS A # TEST UPPER PART.
049406,001344: 7514 17520 TCF UPPOS # IT IS POSITIVE
049407,001345: 7515 00002 TC Q # ZERO
049408,001346: 7516 17530 TCF UPNEG # NEGATIVE
049409,001347: 7517 00002 TC Q # ZERO
049410,001348:
049411,001349: 7520 56001 UPPOS XCH L # SAVE DECREMENTED UPPER PART.
049412,001350: 7521 64675 AD HALF
049413,001351: 7522 64675 AD HALF
049414,001352: 7523 54000 TS A # SKIPS ON OVERFLOW
049415,001353: 7524 17526 TCF +2
049416,001354: 7525 24001 INCR L # RESTORE UPPER TO ROIGINAL VALUE
049417,001355: 7526 56001 XCH L # SWAP A + L BACK.
049418,001356: 7527 00002 TC Q
049419,001357:
049420,001358: 7530 56001 UPNEG XCH L # SAVE COMPLEMENTED + DECREMENTED UPPER PT
049421,001359: 7531 64674 AD NEGMAX
049422,001360: 7532 67716 AD NEGONE
049423,001361: 7533 54000 TS A
049424,001362: 7534 17536 TCF +2 # DONT INCREMENT IF NO OVERFLOW.
049425,001363: 7535 24001 INCR L
049426,001364: 7536 56001 XCH L
049427,001365: 7537 40000 COM # MAKE NEGATIVE AGAIN.
049428,001366: 7540 00002 TC Q
049429,001367:
Page 1119 |
049431,001369: # INTERPRETIVE INSTRUCTIONS WHOSE EXECUTION CONSISTS OF PRINCIPALLY CALLING SUBROUTINES.
049432,001370:
049433,001371: 7541 07056 DMP1 TC DMPSUB # DMP INSTRUCTION.
049434,001372: 7542 16030 TCF DANZIG
049435,001373:
049436,001374: 7543 07056 DMPR TC DMPSUB
049437,001375: 7544 07106 TC ROUNDSUB +1 # (C(A) = +0).
049438,001376: 7545 16030 TCF DANZIG
049439,001377:
049440,001378: 7546 00006 DDV EXTEND
049441,001379: 7547 50116 INDEX ADDRWD # MOVE DIVIDEND INTO BUF.
049442,001380: 7550 30001 DCA 0
049443,001381: 7551 17556 TCF BDDV +4
049444,001382:
049445,001383: 7552 00006 BDDV EXTEND # MOVE DIVISOR INTO MPAC SAVING MPAC, THE
049446,001384: 7553 50116 INDEX ADDRWD # DIVIDEND, IN BUF.
049447,001385: 7554 30001 DCA 0
049448,001386: 7555 52155 DXCH MPAC
049449,001387: 7556 52131 +4 DXCH BUF
049450,001388: 7557 34714 CAF ZERO # DIVIDE ROUTINES IN BANK 0.
049451,001389: 7560 54004 TS FBANK
049452,001390: 7561 12353 TCF DDV/BDDV
049453,001391:
049454,001392: 7562 30116 SETPD CA ADDRWD # MUST SET TO WORK AREA, OR EBANK TROUBLE.
049455,001393: 7563 54166 TS PUSHLOC
049456,001394: 7564 16032 TCF NOIBNKSW # NO FBANK SWITCH REQUIRED.
049457,001395:
049458,001396: 7565 34714 TSLC CAF ZERO # SHIFTING ROUTINES LOCATED IN BANK 00.
049459,001397: 7566 54004 TS FBANK
049460,001398: 7567 12172 TCF TSLC2
049461,001399:
049462,001400: 7570 36043 GSHIFT CAF LOW7 # USED AS MASK AT GENSHIFT. THIS PROCESSES
049463,001401: 7571 54004 TS FBANK # ANY SHIFT INSTRUCTION (EXCEPT TSLC) WITH
049464,001402: 7572 12214 TCF GENSHIFT # AN ADDRESS (ROUTINES IN BANK 0).
049465,001403:
Page 1120 |
049467,001405: # THE FOLLOWING IS THE PROLOGUE TO V/SC. IF THE PRESENT MODE IS VECTOR, IT SAVES THE SCALAR AT X IN BUF
049468,001406: # AND CALLS THE V/SC ROUTINE IN BANK 0. IF THE PRESENT MODE IS SCALAR, IT MOVES THE VECTOR AT X INTO MPAC, SAVING
049469,001407: # THE SCALAR IN MPAC IN BUF BEFORE CALLING THE V/SC ROUTINE IN BANK 0.
049470,001408:
049471,001409: 7573 10163 V/SC CCS MODE
049472,001410: 7574 17605 TCF DV/SC # MOVE VECTOR INTO MPAC.
049473,001411: 7575 17605 TCF DV/SC
049474,001412:
049475,001413: 7576 00006 VV/SC EXTEND
049476,001414: 7577 50116 INDEX ADDRWD
049477,001415: 7600 30001 DCA 0
049478,001416: 7601 52131 V/SC1 DXCH BUF # IN BOTH CASES, VECTOR IS NOW IN MPAC AND
049479,001417: 7602 34714 CAF ZERO # SCALAR IN BUF.
049480,001418: 7603 54004 TS FBANK
049481,001419: 7604 12654 TCF V/SC2
049482,001420:
049483,001421: 7605 00006 DV/SC EXTEND
049484,001422: 7606 50116 INDEX ADDRWD
049485,001423: 7607 30003 DCA 2
049486,001424: 7610 52160 DXCH MPAC +3
049487,001425: 7611 00006 EXTEND
049488,001426: 7612 50116 INDEX ADDRWD
049489,001427: 7613 30005 DCA 4
049490,001428: 7614 52162 DXCH MPAC +5
049491,001429:
049492,001430: 7615 44712 CS ONE # CHANGE MODE TO VECTOR.
049493,001431: 7616 54163 TS MODE
049494,001432:
049495,001433: 7617 00006 EXTEND
049496,001434: 7620 50116 INDEX ADDRWD
049497,001435: 7621 30001 DCA 0
049498,001436: 7622 52155 DXCH MPAC
049499,001437: 7623 17601 TCF V/SC1 # FINISH PROLOGUE AT COMMON SECTION.
049500,001438:
Page 1121 |
049502,001440: # SIGN AND COMPLEMENT INSTRUCTIONS.
049503,001441:
049504,001442: 7624 50116 SIGN INDEX ADDRWD # CALL COMP INSTRUCTION IF WORD AT X IS
049505,001443: 7625 10000 CCS 0 # NEGATIVE NON-ZERO.
049506,001444: 7626 16030 TCF DANZIG
049507,001445: 7627 17631 TCF +2
049508,001446: 7630 17637 TCF COMP # DO THE COMPLEMENT.
049509,001447:
049510,001448: 7631 50116 INDEX ADDRWD
049511,001449: 7632 10001 CCSL CCS 1
049512,001450: 7633 16030 TCF DANZIG
049513,001451: 7634 16030 TCF DANZIG
049514,001452: 7635 17637 TCF COMP
049515,001453: 7636 16030 TCF DANZIG
049516,001454: 7637 00006 COMP EXTEND # COMPLEMENT DP MPAC IN EVERY CASE.
049517,001455: 7640 40155 DCS MPAC
049518,001456: 7641 52155 DXCH MPAC
049519,001457:
049520,001458: 7642 10163 CCS MODE # EITHER COMPLEMENT MPAC +3 OR THE REST OF
049521,001459: 7643 17654 TCF DCOMP # THE VECTOR ACCUMULATOR.
049522,001460: 7644 17654 TCF DCOMP
049523,001461:
049524,001462: 7645 00006 EXTEND # VECTOR COMPLEMENT.
049525,001463: 7646 40160 DCS MPAC +3
049526,001464: 7647 52160 DXCH MPAC +3
049527,001465: 7650 00006 EXTEND
049528,001466: 7651 40162 DCS MPAC +5
049529,001467: 7652 52162 DXCH MPAC +5
049530,001468: 7653 16030 TCF DANZIG
049531,001469:
049532,001470: 7654 40156 DCOMP CS MPAC +2
049533,001471: 7655 54156 TS MPAC +2
049534,001472: 7656 16030 TCF DANZIG
049535,001473:
Page 1122 |
049537,001475: # THE FOLLOWING SHORT SHIFT CODES REQUIRE NO ADDRESS WORD:
049538,001476: # 1. SR1 TO SR4 SCALAR SHIFT RIGHT.
049539,001477: # 2. SR1R TO SR4R SCALAR SHIFT RIGHT AND ROUND.
049540,001478: # 3. SL1 TO SL4 SCALAR SHIFT LEFT.
049541,001479: # 4. SL1R TO SL4R SCALAR SHIFT LEFT AND ROUND.
049542,001480: # 5. VSR1 TO VSR8 VECTOR SHIFT RIGHT (ALWAYS ROUNDS).
049543,001481: # 6. VSL1 TO VSL8 VECTOR SHIFT LEFT (NEVER ROUNDS).
049544,001482: # THE FOLLOWING CODES REQUIRE AN ADDRESS WHICH MAY BE INDEXED:*
049545,001483: # 1. SR SCALAR SHIFT RIGHT.
049546,001484: # 2. SRR SCALAR SHIFT RIGHT AND ROUND.
049547,001485: # 3. SL SCALAR SHIFT LEFT.
049548,001486: # 4. SLR SCALAR SHIFT LEFT AND ROUND.
049549,001487: # 5. VSR VECTOR SHIFT RIGHT.
049550,001488: # 6. VSL VECTOR SHIFT LEFT.
049551,001489: # * IF THE ADDRESS IS INDEXED, AND THE INDEX MODIFICATION RESULTS IN A NEGATIVE SHIFT COUNT, A SHIFT OF THE
049552,001490: # ABSOLUTE VALUE OF THE COUNT IS DONE IN THE OPPOSITE DIRECTION.
049553,001491:
049554,001492: 00,2017 BANK 00
049555,001493:
049556,001494: 00,2017 COUNT 00/INTER
049557,001495:
049558,001496: 00,2017 36211 SHORTT CAF SIX # SCALAR SHORT SHIFTS COME HERE. THE SHIFT
049559,001497: 00,2020 70020 MASK CYR # COUNT-1 IS NOW IN BITS 2-3 OF CYR. THE
049560,001498: 00,2021 54021 TS SR # ROUNDING BIT IS IN BIT1 AT THIS POINT.
049561,001499:
049562,001500: 00,2022 10020 CCS CYR # SEE IF RIGHT OR LEFT SHIFT DESIRED.
049563,001501: 00,2023 12101 TCF TSSL # SHIFT LEFT.
049564,001502:
049565,001503: 00,2024 00024 SRDDV DEC 20 B-14 # MPTEMP SETTING FOR SR BEFORE DDV.
049566,001504:
049567,001505: 00,2025 50021 TSSR INDEX SR # GET SHIFTING BIT.
049568,001506: 00,2026 34675 CAF BIT14
049569,001507: 00,2027 54135 TS MPTEMP
049570,001508:
049571,001509: 00,2030 10020 CCS CYR # SEE IF A ROUND IS DESIRED.
049572,001510: 00,2031 02050 RIGHTR TC MPACSRND # YES - SHIFT RIGHT AND ROUND.
049573,001511: 00,2032 16027 TCF NEWMODE # SET MODE TO DP (C(A) = 0).
049574,001512: 00,2033 30135 MPACSHR CA MPTEMP # DO A TRIPLE PRECISION SHIFT RIGHT.
049575,001513: 00,2034 00006 EXTEND
049576,001514: 00,2035 70156 MP MPAC +2
049577,001515: 00,2036 54156 +3 TS MPAC +2 # (EXIT FROM SQRT AND ABVAL).
049578,001516: 00,2037 30135 CA MPTEMP
049579,001517: 00,2040 00006 EXTEND
Page 1123 |
049581,001519: 00,2041 70154 MP MPAC # SHIFT MAJOR PART INTO A,L AND PLACE IN
049582,001520: 00,2042 52155 DXCH MPAC # MPAC,+1.
049583,001521: 00,2043 30135 CA MPTEMP
049584,001522: 00,2044 00006 EXTEND
049585,001523: 00,2045 70001 MP L # ORIGINAL C(MPAC +1).
049586,001524: 00,2046 20156 DAS MPAC +1 # GUARANTEED NO OVERFLOW.
049587,001525: 00,2047 16030 TCF DANZIG
049588,001526:
049589,001527: # MPAC SHIFT RIGHT AND ROUND SUBROUTINES.
049590,001528:
049591,001529: 00,2050 30156 MPACSRND CA MPAC +2 # WE HAVE TO DO ALL THREE MULTIPLIES SINCE
049592,001530: 00,2051 00006 EXTEND # MPAC +1 AND MPAC +2 MIGHT HAVE SIGN
049593,001531: 00,2052 70135 MP MPTEMP # DISAGREEMENT WITH A SHIFT RIGHT OF 1.
049594,001532: 00,2053 56155 XCH MPAC +1
049595,001533: 00,2054 00006 EXTEND
049596,001534: 00,2055 70135 MP MPTEMP
049597,001535: 00,2056 56155 XCH MPAC +1 # TRIAL MINOR PART.
049598,001536: 00,2057 60001 AD L
049599,001537:
049600,001538: 00,2060 60000 VSHR2 DOUBLE # (FINISH VECTOR COMPONENT SHIFT RIGHT
049601,001539: 00,2061 54156 TS MPAC +2 # AND ROUND.
049602,001540: 00,2062 12064 TCF +2
049603,001541: 00,2063 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
049604,001542:
049605,001543: 00,2064 34714 CAF ZERO
049606,001544: 00,2065 54156 TS MPAC +2
049607,001545: 00,2066 56154 XCH MPAC # SETTING TO ZERO SO FOLLOWING DAS WORKS.
049608,001546: 00,2067 00006 EXTEND
049609,001547: 00,2070 70135 MP MPTEMP
049610,001548: 00,2071 20155 DAS MPAC # AGAIN NO OVERFLOW.
049611,001549: 00,2072 00002 TC Q
049612,001550:
049613,001551: 00,2073 30135 VSHRRND CA MPTEMP # ENTRY TO SHIFT RIGHT AND ROUND MPAC WHEN
049614,001552: 00,2074 00006 EXTEND # MPAC CONTAINS A VECTOR COMPONENT.
049615,001553: 00,2075 70155 MP MPAC +1
049616,001554: 00,2076 54155 TS MPAC +1
049617,001555: 00,2077 56001 XCH L
049618,001556: 00,2100 12060 TCF VSHR2 # GO ADD ONE IF NECESSARY AND FINISH.
049619,001557:
Page 1124 |
049621,001559: # ROUTINE FOR SHORT SCALAR SHIFT LEFT (AND MAYBE ROUND).
049622,001560:
049623,001561: 00,2101 30021 TSSL CA SR # GET SHIFT COUNT FOR SR.
049624,001562: 00,2102 54135 +1 TS MPTEMP
049625,001563:
049626,001564: 00,2103 00006 +2 EXTEND # ENTRY HERE FROM SL FOR SCALARS.
049627,001565: 00,2104 30156 DCA MPAC +1 # SHIFTING LEFT ONE PLACE AT A TIME IS
049628,001566: 00,2105 20156 DAS MPAC +1 # FASTER THAN DOING THE WHOLE SHIFT WITH
049629,001567: 00,2106 60154 AD MPAC # MULTIPLIES ASSUMING THAT FREQUENCY OF
049630,001568: 00,2107 60154 AD MPAC # SHIFT COUNTS GOES DOWN RAPIDLY AS A
049631,001569: 00,2110 54154 TS MPAC # FUNCTION OF THEIR MAGNITUDE.
049632,001570: 00,2111 12113 TCF +2
049633,001571: 00,2112 54121 TS OVFIND # OVERFLOW. (LEAVES OVERFLOW-CORRECTED
049634,001572: # RESULT ANYWAY).
049635,001573: 00,2113 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNT.
049636,001574: 00,2114 12102 TCF TSSL +1
049637,001575:
049638,001576: 00,2115 10020 CCS CYR # SEE IF ROUND WANTED.
049639,001577: 00,2116 07105 ROUND TC ROUNDSUB # YES - ROUND AND EXIT.
049640,001578: 00,2117 16030 TCF DANZIG # SL LEAVES A ZERO IN CYR FOR NO ROUND.
049641,001579: 00,2120 16030 TCF DANZIG # NO - EXIT IMMEDIATL
049642,001580:
Page 1125 |
049644,001582: # VECTOR SHIFTING ROUTINES.
049645,001583:
049646,001584: 00,2121 34716 SHORTV CAF LOW3 # SAVE 3 BIT SHIFT COUNT - 1 WITHOUT
049647,001585: 00,2122 70020 MASK CYR # EDITING CYR.
049648,001586: 00,2123 54135 TS MPTEMP
049649,001587: 00,2124 10020 CCS CYR # SEE IF LEFT OR RIGHT SHIFT.
049650,001588: 00,2125 12145 TCF VSSL # VECTOR SHIFT LEFT.
049651,001589: 00,2126 00176 OCT176 OCT 176 # USED IN PROCESSED SHIFTS WITH - COUNT.
049652,001590:
049653,001591: 00,2127 50135 VSSR INDEX MPTEMP # (ENTRY FROM SR). PICK UP SHIFTING BIT.
049654,001592: 00,2130 34675 CAF BIT14 # MPTEMP CONTAINS THE SHIFT COUNT - 1.
049655,001593: 00,2131 54135 TS MPTEMP
049656,001594: 00,2132 02073 TC VSHRRND # SHIFT X COMPONENT.
049657,001595:
049658,001596: 00,2133 52155 DXCH MPAC # SWAP X AND Y COMPONENTS.
049659,001597: 00,2134 52160 DXCH MPAC +3
049660,001598: 00,2135 52155 DXCH MPAC
049661,001599: 00,2136 02073 TC VSHRRND # SHIFT Y COMPONENT.
049662,001600:
049663,001601: 00,2137 52155 DXCH MPAC # SWAP Y AND Z COMPONENTS.
049664,001602: 00,2140 52162 DXCH MPAC +5
049665,001603: 00,2141 52155 DXCH MPAC
049666,001604: 00,2142 02073 TC VSHRRND # SHIFT Z COMPONENT.
049667,001605:
049668,001606: 00,2143 17367 TCF VROTATEX # RESTORE COMPONENTS TO PROPER PLACES.
049669,001607:
Page 1126 |
049671,001609: # VECTOR SHIFT LEFT - DONE ONE PLACE AT A TIME.
049672,001610:
049673,001611: 00,2144 54135 -1 TS MPTEMP # SHIFTING LOOP.
049674,001612:
049675,001613: 00,2145 00006 VSSL EXTEND
049676,001614: 00,2146 30155 DCA MPAC
049677,001615: 00,2147 20155 DAS MPAC
049678,001616: 00,2150 00006 EXTEND
049679,001617: 00,2151 12153 BZF +2
049680,001618: 00,2152 06766 TC OVERFLOW
049681,001619:
049682,001620: 00,2153 00006 EXTEND
049683,001621: 00,2154 30160 DCA MPAC +3
049684,001622: 00,2155 20160 DAS MPAC +3
049685,001623: 00,2156 00006 EXTEND
049686,001624: 00,2157 12161 BZF +2
049687,001625: 00,2160 06763 TC OVERFLWY
049688,001626:
049689,001627: 00,2161 00006 EXTEND
049690,001628: 00,2162 30162 DCA MPAC +5
049691,001629: 00,2163 20162 DAS MPAC +5
049692,001630: 00,2164 00006 EXTEND
049693,001631: 00,2165 12167 BZF +2
049694,001632: 00,2166 06760 TC OVERFLWZ
049695,001633:
049696,001634: 00,2167 10135 CCS MPTEMP # LOOP ON DECREMENTED SHIFT COUNTER.
049697,001635: 00,2170 12144 TCF VSSL -1
049698,001636: 00,2171 16030 TCF DANZIG # EXIT.
049699,001637:
Page 1127 |
049701,001639: # TSLC - TRIPLE SHIFT LEFT AND COUNT. SHIFTS MPAC LEFT UNTIL GREATER THAN .5 IN MAGNITUDE, LEAVING
049702,001640: # THE COMPLEMENT OF THE NUMBER OF SHIFTS REQUIRED IN X.
049703,001641:
049704,001642: 00,2172 54135 TSLC2 TS MPTEMP # START BY ZEROING SHIFT COUNT (IN A NOW).
049705,001643: 00,2173 06672 TC BRANCH # EXIT WITH NO SHIFTING IF ARGUMENT ZERO.
049706,001644: 00,2174 12176 TCF +2
049707,001645: 00,2175 12212 TCF ENDTSLC # STORES ZERO SHIFT COUNT IN THIS CASE.
049708,001646:
049709,001647: 00,2176 07226 TC TPAGREE # MAY CAUSE UPSHIFT OF ONE EXTRA PLACE.
049710,001648:
049711,001649: 00,2177 30154 CA MPAC # BEGIN NORMALIZATION LOOP.
049712,001650: 00,2200 12207 TCF TSLCTEST
049713,001651:
049714,001652: 00,2201 24135 TSLCLOOP INCR MPTEMP # INCREMENT SHIFT COUNTER.
049715,001653: 00,2202 00006 EXTEND
049716,001654: 00,2203 30156 DCA MPAC +1
049717,001655: 00,2204 20156 DAS MPAC +1
049718,001656: 00,2205 60154 AD MPAC
049719,001657: 00,2206 26154 ADS MPAC
049720,001658: 00,2207 60000 TSLCTEST DOUBLE # SEE IF (ANOTHER) SHIFT IS REQUIRED.
049721,001659: 00,2210 54000 OVSK
049722,001660: 00,2211 12201 TCF TSLCLOOP # YES - INCREMENT COUNT AND SHIFT AGAIN.
049723,001661:
049724,001662: 00,2212 40135 ENDTSLC CS MPTEMP
049725,001663: 00,2213 16572 TCF STORE1 # STORE SHIFT COUNT AND RETURN TO DANZIG.
049726,001664:
Page 1128 |
049728,001666: # THE FOLLOWING ROUTINES PROCESSES THE GENERAL SHIFT INSTRUCTIONS SR, SRR, SL, AND SLR.
049729,001667: # THE GIVEN ADDRESS IS DECODED AS FOLLOWS:
049730,001668: # BITS 1-7 SHIFT COUNT (SUBADDRESS) LESS THAN 125 DECIMAL.
049731,001669: # BIT 8 PSEUDO SIGN BIT (DETECTS CHANGE IN SIGN IN INDEXED SHIFTS).
049732,001670: # BIT 9 0 FOR LEFT SHIFT, AND 1 FOR RIGHT SHIFT.
049733,001671: # BIT 10 1 FOR TERMINAL ROUND ON SCALAR SHIFTS, 0 OTHERWISE.
049734,001672: # BITS 11-13 0.
049735,001673: # BIT 14 1.
049736,001674: # BIT 15 0.
049737,001675: # THE ABOVE ENCODING IS DONE BY THE YUL SYSTEM.
049738,001676:
049739,001677: 00,2214 70116 GENSHIFT MASK ADDRWD # GET SHIFT COUNT, TESTING FOR ZERO.
049740,001678: 00,2215 10000 CCS A # (ARRIVES WITH C(A) = LOW7).
049741,001679: 00,2216 12224 TCF GENSHFT2 # IF NON-ZERO, PROCEED WITH DECREMENTED CT
049742,001680:
049743,001681: 00,2217 34701 CAF BIT10 # ZERO SHIFT COUNT. NO SHIFTS NEEDED BUT
049744,001682: 00,2220 70116 MASK ADDRWD # WE MIGHT HAVE TO ROUND MPAC ON SLR AND
049745,001683: 00,2221 10000 CCS A # SRR (SCALAR ONLY).
049746,001684: 00,2222 07105 TC ROUNDSUB
049747,001685: 00,2223 16030 TCF DANZIG
049748,001686:
049749,001687: 00,2224 54135 GENSHFT2 TS MPTEMP # DECREMENTED SHIFT COUNT TO MPTEMP.
049750,001688: 00,2225 34703 CAF BIT8 # TEST MEANING OF LOW SEVEN BIT COUNT IN
049751,001689: 00,2226 00006 EXTEND # MPTEMP NOW.
049752,001690: 00,2227 70116 MP ADDRWD
049753,001691: 00,2230 76214 MASK LOW2 # JUMPS ON SHIFT DIRECTION (BIT8) AND
049754,001692: 00,2231 50000 INDEX A
049755,001693: 00,2232 12233 TCF +1 # ORIGINAL SHIFT DIRECTION (BIT 9).
049756,001694: 00,2233 12332 TCF RIGHT- # NEGATIVE SHIFT COUNT FOR SL OR SLR.
049757,001695: 00,2234 12342 TCF LEFT # SL OR SLR.
049758,001696: 00,2235 12336 TCF LEFT- # NEGATIVE SHIFT COUNT WITH SR OR SRR.
049759,001697:
Page 1129 |
049761,001699: # GENERAL SHIFT RIGHT.
049762,001700:
049763,001701: 00,2236 10163 RIGHT CCS MODE # SEE IF VECTOR OR SCALAR.
049764,001702: 00,2237 12277 TCF GENSCR
049765,001703: 00,2240 12277 TCF GENSCR
049766,001704:
049767,001705: 00,2241 30135 CA MPTEMP # SEE IF SHIFT COUNT LESS THAN 14D.
049768,001706: 00,2242 63730 VRIGHT2 AD NEG12
049769,001707: 00,2243 00006 EXTEND
049770,001708: 00,2244 62127 BZMF VSSR # IF SO, BRANCH AND SHIFT IMMEDIATELY.
049771,001709:
049772,001710: 00,2245 67716 AD NEGONE # IF NOT, REDUCE MPTEMP BY A TOTAL OF 14,
049773,001711: 00,2246 54135 TS MPTEMP # AND DO A SHIFT RIGHT AND ROUND BY 14.
049774,001712: 00,2247 34714 CAF ZERO # THE ROUND AT THIS STAGE MAY INTRODUCE A
049775,001713: 00,2250 54001 TS L # ONE BIT ERROR IN A SHIFT RIGHT 15D.
049776,001714: 00,2251 56154 XCH MPAC
049777,001715: 00,2252 56155 XCH MPAC +1
049778,001716: 00,2253 02272 TC SETROUND # X COMPONENT NOW SHIFTED, SO MAKE UP THE
049779,001717: 00,2254 20155 DAS MPAC # ROUNDING QUANTITY (0 IN A AND 0 OR +-1
049780,001718: # IN L).
049781,001719: 00,2255 56157 XCH MPAC +3 # REPEAT THE ABOVE PROCESS FOR Y AND Z.
049782,001720: 00,2256 56160 XCH MPAC +4
049783,001721: 00,2257 02272 TC SETROUND
049784,001722: 00,2260 20160 DAS MPAC +3 # NO OVERFLOW ON THESE ADDS.
049785,001723:
049786,001724: 00,2261 56161 XCH MPAC +5
049787,001725: 00,2262 56162 XCH MPAC +6
049788,001726: 00,2263 02272 TC SETROUND
049789,001727: 00,2264 20162 DAS MPAC +5
049790,001728:
049791,001729: 00,2265 10135 CCS MPTEMP # SEE IF DONE, DOING FINAL DECREMENT.
049792,001730: 00,2266 54135 TS MPTEMP
049793,001731: 00,2267 12242 TCF VRIGHT2
049794,001732: 00,2270 04604 BIASLO DEC .2974 B-1 # SQRT CONSTANT
049795,001733:
049796,001734: 00,2271 16030 TCF DANZIG
049797,001735:
049798,001736: 00,2272 60000 SETROUND DOUBLE # MAKES UP ROUNDING QUANTITY FROM ARRIVING
049799,001737: 00,2273 54156 TS MPAC +2 # C(A). L IS ZERO INITIALLY.
049800,001738: 00,2274 34714 CAF ZERO
049801,001739: 00,2275 56001 XCH L
049802,001740: 00,2276 00002 TC Q # RETURN AND DO THE DAS, RESETTING L TO 0.
049803,001741:
Page 1130 |
049805,001743: # PROCESS SR AND SRR FOR SCALARS.
049806,001744:
049807,001745: 00,2277 30135 GENSCR CA MPTEMP # SEE IF THE ORIGINAL SHIFT COUNT WAS LESS
049808,001746: 00,2300 63730 +1 AD NEG12 # THAN 14D.
049809,001747: 00,2301 00006 EXTEND
049810,001748: 00,2302 62322 BZMF DOSSHFT # DO THE SHIFT IMMEDIATELY IF SO.
049811,001749:
049812,001750: 00,2303 67716 +4 AD NEGONE # IF NOT, DECREMENT SHIFT COUNT BY 14D AND
049813,001751: 00,2304 54135 TS MPTEMP # SHIFT MPAC RIGHT 14 PLACES.
049814,001752: 00,2305 34714 CAF ZERO
049815,001753: 00,2306 56154 XCH MPAC
049816,001754: 00,2307 56155 XCH MPAC +1
049817,001755: 00,2310 54156 TS MPAC +2
049818,001756: 00,2311 10135 CCS MPTEMP # SEE IF FINISHED, DO FINAL DECREMENT.
049819,001757: 00,2312 54135 TS MPTEMP
049820,001758: 00,2313 02300 TC GENSCR +1
049821,001759: 00,2314 22650 SLOPEHI DEC .5884 # SQRT CONSTANT.
049822,001760: 00,2315 34701 CAF BIT10 # FINISHED WITH SHIFT. SEE IF ROUND
049823,001761: 00,2316 70116 MASK ADDRWD # WANTED.
049824,001762: 00,2317 10000 CCS A
049825,001763: 00,2320 07105 TC ROUNDSUB
049826,001764: 00,2321 16030 TCF DANZIG # DO SO AND/OR EXIT.
049827,001765:
049828,001766: 00,2322 50135 DOSSHFT INDEX MPTEMP # PICK UP SHIFTING BIT.
049829,001767: 00,2323 34675 CAF BIT14
049830,001768: 00,2324 54135 TS MPTEMP
049831,001769: 00,2325 34701 CAF BIT10 # SEE IF TERMINAL ROUND DESIRED.
049832,001770: 00,2326 70116 MASK ADDRWD
049833,001771: 00,2327 10000 CCS A
049834,001772: 00,2330 12031 TCF RIGHTR # YES.
049835,001773: 00,2331 12033 TCF MPACSHR # JUST SHIFT RIGHT.
049836,001774:
Page 1131 |
049838,001776: # PROCESS THE RIGHT- (SL(R) WITH A NEGATIVE COUNT), LEFT-, AND LEFT OPTIONS.
049839,001777:
049840,001778: 00,2332 40135 RIGHT- CS MPTEMP # GET ABSOLUTE VALUE - 1 OF SHIFT COUNT
049841,001779: 00,2333 62126 AD OCT176 # UNDERSTANDING THAT BIT8 (PSEUDO-SIGN)
049842,001780: 00,2334 54135 TS MPTEMP # WAS 1 INITIALLY.
049843,001781: 00,2335 12236 TCF RIGHT # DO NORMAL SHIFT RIGHT.
049844,001782:
049845,001783: 00,2336 42126 LEFT- CS OCT176 # SAME PROLOGUE TO LEFT FOR INDEXED RIGHT
049846,001784: 00,2337 60135 AD MPTEMP # SHIFTS WHOSE NET SHIFT COUNT IS NEGATIVE
049847,001785: 00,2340 40000 COM
049848,001786: 00,2341 54135 TS MPTEMP
049849,001787:
049850,001788: 00,2342 10163 LEFT CCS MODE # SINCE LEFT SHIFTING IS SONE ONE PLACE AT
049851,001789: 00,2343 12346 TCF GENSCL # A TIME, NO COMPARISON WITH 14 NEED BE
049852,001790: 00,2344 12346 TCF GENSCL # DONE. FOR SCALARS, SEE IF TERMINAL ROUND
049853,001791: 00,2345 12145 TCF VSSL # DESIRED. FOR VECTORS, SHIFT IMMEDIATELY.
049854,001792:
049855,001793: 00,2346 40116 GENSCL CS ADDRWD # PUT ROUNDING BIT (BIT 10 OF ADDRWD) INTO
049856,001794: 00,2347 00006 EXTEND # BIT 15 OF CYR WHERE THE ROUNDING BIT OF
049857,001795: 00,2350 74705 MP BIT6 # A SHORT SHIFT LEFT WOULD BE
049858,001796: 00,2351 54020 TS CYR
049859,001797: 00,2352 12103 TCF TSSL +2 # DO THE SHIFT.
049860,001798:
Page 1132 |
049862,001800: # SCALAR DIVISION INSTRUCTIONS, DDV AND BDDV, ARE EXECUTED HERE. AT THIS POINT, THE DIVIDEND IS IN MPAC
049863,001801: # AND THE DIVISOR IN BUF.
049864,001802:
049865,001803: 00,2353 44712 DDV/BDDV CS ONE # INITIALIZATION.
049866,001804: 00,2354 54136 TS DVSIGN # +-1 FOR POSITIVE QUOTIENT - -0 FOR NEG.
049867,001805: 00,2355 54137 TS DVNORMCT # DIVIDEND NORMALIZATION COUNT.
049868,001806: 00,2356 54140 TS MAXDVSW # NEAR-ONE DIVIDE FLAG.
049869,001807:
049870,001808: 00,2357 10130 CCS BUF # FORCE BUF POSITIVE WITH THE MAJOR PART
049871,001809: 00,2360 12516 TCF BUFPOS # NON-ZERO.
049872,001810: 00,2361 12363 TCF +2
049873,001811: 00,2362 12531 TCF BUFNEG
049874,001812:
049875,001813: 00,2363 54156 BUFZERO TS MPAC +2 # ZERO THIS.
049876,001814: 00,2364 07226 TC TPAGREE # FORCE SIGN AGREEMENT BEFORE OVERFLOW
049877,001815:
049878,001816: 00,2365 10154 CCS MPAC # TEST TO SEE IF MPAC NON-ZERO. (TOO BIG)
049879,001817: 00,2366 12414 TCF OVF+ # MAJOR PART OF DIVIDEND IS POSITIVE NON-0
049880,001818: 00,2367 12371 TCF +2
049881,001819: 00,2370 12413 TCF OVF+ -1 # MAJOR PART OF DIVIDEND IS NEG. NON-ZERO
049882,001820:
049883,001821: 00,2371 56131 XCH BUF +1 # SHIFT DIVIDEND AND DIVISOR LEFT 14.
049884,001822: 00,2372 56130 XCH BUF
049885,001823: 00,2373 56155 XCH MPAC +1
049886,001824: 00,2374 56154 XCH MPAC
049887,001825: 00,2375 10130 CCS BUF # TRY AGAIN ON FORMER MINOR PART.
049888,001826: 00,2376 12422 TCF BUF+
049889,001827: 00,2377 12401 TCF +2 # OVERFLOW ON ZERO DIVISOR.
049890,001828: 00,2400 12416 TCF BUF-
049891,001829:
049892,001830: 00,2401 40154 CS MPAC # SIGN OF MPAC DETERMINES SIGN OF RESULT.
049893,001831: 00,2402 00006 SGNDVOVF EXTEND
049894,001832: 00,2403 62405 BZMF +2
049895,001833: 00,2404 24136 INCR DVSIGN # NEGMAX IN MPAC PERHAPS.
049896,001834: 00,2405 34672 DVOVF CAF POSMAX # ON DIVISION OVERFLOW OF ANY SORT, SET
049897,001835: 00,2406 54154 TS MPAC # SET DP MPAC TO +-POSMAX.
049898,001836: 00,2407 02630 TC FINALDV +3
049899,001837: 00,2410 34712 CAF ONE # SET OVERFLOW INDICATOR AND EXIT.
049900,001838: 00,2411 54121 TS OVFIND
049901,001839: 00,2412 06030 TC DANZIG
049902,001840:
049903,001841: 00,2413 24136 -1 INCR DVSIGN
049904,001842: 00,2414 40131 OVF+ CS BUF +1 # LOAD LOWER ORDER PART OF DIVISOR.
049905,001843: 00,2415 12402 TCF SGNDVOVF # GET SIGN OF RESULT.
049906,001844:
049907,001845: 00,2416 00006 BUF- EXTEND # IF BUF IS NEGATIVE, COMPLEMENT IT AND
049908,001846: 00,2417 40131 DCS BUF # MAINTAIN DVSIGN FOR FINAL QUOTIENT SIGN.
049909,001847: 00,2420 52131 DXCH BUF
049910,001848: 00,2421 24136 INCR DVSIGN # NOW -0.
049911,001849:
Page 1133 |
049913,001851: 00,2422 10154 BUF+ CCS MPAC # FORCE MPAC POSITIVE, CHECKING FOR ZERO
049914,001852: 00,2423 12437 TCF MPAC+ # DIVIDEND IN THE PROCESS.
049915,001853: 00,2424 12426 TCF +2
049916,001854: 00,2425 12433 TCF MPAC-
049917,001855: 00,2426 10155 CCS MPAC +1
049918,001856: 00,2427 12437 TCF MPAC+
049919,001857: 00,2430 16030 TCF DANZIG # EXIT IMMEDIATELY ON ZERO DIVIDEND.
049920,001858: 00,2431 12433 TCF MPAC-
049921,001859: 00,2432 16030 TCF DANZIG
049922,001860:
049923,001861: 00,2433 00006 MPAC- EXTEND # FORCE MPAC POSITIVE AS BUF IN BUF-.
049924,001862: 00,2434 40155 DCS MPAC
049925,001863: 00,2435 52155 DXCH MPAC
049926,001864: 00,2436 24136 INCR DVSIGN # NOW +1 OR -0.
049927,001865:
Page 1134 |
049929,001867: 00,2437 40154 MPAC+ CS MPAC # CHECK FOR DIVISION OVERFLOW. IF THE
049930,001868: 00,2440 67716 AD NEGONE # MAJOR PART OF THE DIVIDEND IS LESS THAN
049931,001869: 00,2441 60130 AD BUF # THE MAJOR PART OF THE DIVISOR BY AT
049932,001870: 00,2442 10000 CCS A # LEAST TWO, WE CAN PROCEED IMMEDIATELY
049933,001871: 00,2443 12505 TCF DVNORM # WITHOUT NORMALIZATION PRODUCING A DVMAX.
049934,001872: 00,2444 60001 -1/2+2 OCT 60001 # USED IN SQRTSUB.
049935,001873:
049936,001874: 00,2445 12446 TCF +1 # IF THE ABOVE DOES NOT HOLD, FORCE SIGN
049937,001875: 00,2446 34675 CAF HALF # AGREEMENT IN NUMERATOR AND DENOMINATOR
049938,001876: 00,2447 60000 DOUBLE # TO FACILITATE OVERFLOW AND NEAR-ONE
049939,001877: 00,2450 60155 AD MPAC +1 # CHECKING.
049940,001878: 00,2451 54155 TS MPAC +1
049941,001879: 00,2452 34714 CAF ZERO
049942,001880: 00,2453 64672 AD POSMAX
049943,001881: 00,2454 26154 ADS MPAC
049944,001882:
049945,001883: 00,2455 34675 CAF HALF # SAME FOR BUF.
049946,001884: 00,2456 60000 DOUBLE
049947,001885: 00,2457 60131 AD BUF +1
049948,001886: 00,2460 54131 TS BUF +1
049949,001887: 00,2461 34714 CAF ZERO
049950,001888: 00,2462 64672 AD POSMAX
049951,001889: 00,2463 26130 ADS BUF
049952,001890:
049953,001891: 00,2464 40154 CS MPAC # CHECK MAGNITUDE OF SIGN-CORRECTED
049954,001892: 00,2465 60130 AD BUF # OPERANDS.
049955,001893: 00,2466 10000 CCS A
049956,001894: 00,2467 12505 TCF DVNORM # DIVIDE OK - WILL NOT BECOME MAXDV CASE.
049957,001895: 00,2470 00133 LBUF2 ADRES BUF2
049958,001896: 00,2471 12405 TCF DVOVF # DIVISOR NOT LESS THAN DIVIDEND - OVF.
049959,001897:
049960,001898: 00,2472 54140 TS MAXDVSW # IF THE MAJOR PARTS OF THE DIVIDEND AND
049961,001899: 00,2473 40155 CS MPAC +1 # DIVISOR ARE EQUAL, A SPECIAL APPROXIMA-
049962,001900: 00,2474 60131 AD BUF +1 # TION IS USED (PROVIDED THE DIVISION IS
049963,001901: 00,2475 00006 EXTEND # POSSIBLE, OF COURSE).
049964,001902: 00,2476 62405 BZMF DVOVF
049965,001903: 00,2477 12505 TCF DVNORM # IF NO OVERFLOW.
049966,001904:
Page 1135 |
049968,001906: 00,2500 00006 BUFNORM EXTEND # ADD -1 TO AUGMENT SHIFT COUNT AND SHIFT
049969,001907: 00,2501 24137 AUG DVNORMCT # LEFT ONE PLACE.
049970,001908: 00,2502 00006 EXTEND
049971,001909: 00,2503 30131 DCA BUF
049972,001910: 00,2504 20131 DAS BUF
049973,001911:
049974,001912: 00,2505 30130 DVNORM CA BUF # SEE IF DIVISOR NORMALIZED YET.
049975,001913: 00,2506 60000 DOUBLE
049976,001914: 00,2507 54000 OVSK
049977,001915: 00,2510 12500 TCF BUFNORM # NO - SHIFT LEFT ONE AND TRY AGAIN.
049978,001916:
049979,001917: 00,2511 52155 DXCH MPAC # CALL DIVIDEND NORMALIZATION SEQUENCE
049980,001918: 00,2512 50137 INDEX DVNORMCT # PRIOR TO DOING THE DIVIDE.
049981,001919: 00,2513 02565 TC MAXTEST
049982,001920:
049983,001921: 00,2514 54156 TS MPAC +2 # RETURNS WITH DIVISION DONE AND C(A) = 0.
049984,001922: 00,2515 16030 TCF DANZIG
049985,001923:
049986,001924: 00,2516 10000 BUFPOS CCS A
049987,001925: 00,2517 12422 TCF BUF+ # TO BUF+ IF BUF IS GREATER THAN +1.
049988,001926:
049989,001927: 00,2520 40131 CS BUF +1 # IF BUF IS +1, FORCING SIGN AGREEMENT
049990,001928: 00,2521 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
049991,001929: 00,2522 62422 BZMF BUF+ # BRANCH IF SIGNS AGREE.
049992,001930:
049993,001931: 00,2523 34675 CA HALF # SIGNS DISAGREE. FORCE AGREEMENT.
049994,001932: 00,2524 60000 +6 DOUBLE
049995,001933: 00,2525 26131 ADS BUF +1
049996,001934: 00,2526 34714 CA ZERO
049997,001935: 00,2527 54130 TS BUF
049998,001936: 00,2530 12363 TCF BUFZERO
049999,001937:
050000,001938: 00,2531 10000 BUFNEG CCS A
050001,001939: 00,2532 12416 TCF BUF- # TO BUF- IF BUF IS LESS THAN -1.
050002,001940:
050003,001941: 00,2533 30131 CA BUF +1 # IF BUF IS -1, FORCING SIGN AGREEMENT
050004,001942: 00,2534 00006 EXTEND # MAY CAUSE BUF TO BECOME ZERO.
050005,001943: 00,2535 62416 BZMF BUF- # BRANCH IF SIGNS AGREE.
050006,001944:
050007,001945: 00,2536 44675 CS HALF # SIGNS DISAGREE. FORCE AGREEMENT.
050008,001946: 00,2537 12524 TCF BUFPOS +6
050009,001947:
Page 1136 |
050011,001949: # THE FOLLOWING ARE PROLOGUES TO SHIFT THE DIVIDEND ARRIVING IN A AND L BEFORE THE DIVIDE.
050012,001950:
050013,001951: 00,2540 22021 -21D LXCH SR # SPECIAL PROLOGUE FOR UNIT WHEN THE
050014,001952: 00,2541 00006 EXTEND # LENGTH OF THE ARGUMENT WAS NOT LESS THAN
050015,001953: 00,2542 74675 MP HALF # .5. IN THIS CASE, EACH COMPONENT MUST BE
050016,001954: 00,2543 56001 XCH L # SHIFTED RIGHT ONE TO PRODUCE A HALF-UNIT
050017,001955: 00,2544 60021 AD SR # VECTOR.
050018,001956: 00,2545 56001 XCH L
050019,001957: 00,2546 12571 TCF GENDDV +1 # WITH DP DIVIDEND IN A,L.
050020,001958:
050021,001959: 00,2547 20001 DDOUBL # PROLOGUE WHICH NORMALIZES THE DIVIDEND
050022,001960: 00,2550 20001 DDOUBL # WHEN IT IS KNOWN THAT NO DIVISION
050023,001961: 00,2551 20001 DDOUBL # OVERFLOW WILL OCCUR.
050024,001962: 00,2552 20001 DDOUBL
050025,001963: 00,2553 20001 DDOUBL
050026,001964: 00,2554 20001 DDOUBL
050027,001965: 00,2555 20001 DDOUBL
050028,001966: 00,2556 20001 DDOUBL
050029,001967: 00,2557 20001 DDOUBL
050030,001968: 00,2560 20001 DDOUBL
050031,001969: 00,2561 20001 DDOUBL
050032,001970: 00,2562 20001 DDOUBL
050033,001971: 00,2563 20001 DDOUBL
050034,001972: 00,2564 52155 DXCH MPAC
050035,001973:
050036,001974: 00,2565 10140 MAXTEST CCS MAXDVSW # 0 IF MAJORS MIGHT BE =, -1 OTHERWISE.
050037,001975: 00,2566 06552 BIASHI DEC .4192 B-1 # SQRT CONSTANTS
050038,001976:
050039,001977: 00,2567 12642 TCF MAXDV # CHECK TO SEE IF THEY ARE NOW EQUAL.
050040,001978:
Page 1137 |
050042,001980: # THE FOLLOWING IS A GENERAL PURPOSE DOUBLE PRECISION DIVISION ROUTINE. IT DIVIDES MPAC BY BUF AND LEAVES
050043,001981: # THE RESULT IN MPAC. THE FOLLOWING CONDITIONS MUST BE SATISFIED:
050044,001982:
050045,001983: # 1. THE DIVISOR (BUF) MUST BE POSITIVE AND NOT LESS THAN .5.
050046,001984:
050047,001985: # 2. THE DIVIDEND (MPAC) MUST BE POSITIVE WITH THE MAJOR PART OF MPAC STRICTLY LESS THAN THAT OF BUF
050048,001986: # (A SPECIAL APPROXIMATION, MAXDV, IS USED WHEN THE MAJOR PARTS ARE EQUAL).
050049,001987:
050050,001988: # UNDERSTANDING THAT A/B = Q + S(R/B) WHERE S = 2(-14) AND Q AND R ARE QUOTIENT AND REMAINDER, RESPEC-
050051,001989: # TIVELY, THE FOLLOWING APPROXIMATION IS OBTAINED BY MULTIPLYING ABOVE AND BELOW BY C - SD AND NEGLECTING TERMS OF
050052,001990: # ORDER S-SQUARED (POSSIBLY INTRODUCING ERROR INTO THE LOW TWO BITS OF THE RESULT). SIGN AGREEMENT IS UNNECESSARY.
050053,001991:
050054,001992: # A + SB . (R - QD) A + SB
050055,001993: # ------ = Q + S(------) WHERE Q AND R ARE QUOTIENT AND REMAINDER OF ------ RESPECTIVELY.
050056,001994: # C + SD ( C ) C
050057,001995:
050058,001996: 00,2570 52155 GENDDV DXCH MPAC # WE NEED A AND B ONLY FOR FIRST DV.
050059,001997: 00,2571 00006 +1 EXTEND # (SPECIAL UNIT PROLOGUE ENTERS HERE).
050060,001998: 00,2572 10130 DV BUF # A NOW CONTAINS Q AND L, R.
050061,001999: 00,2573 52155 DXCH MPAC
050062,002000:
050063,002001: 00,2574 40154 CS MPAC # FORM DIVIDEND FOR MINOR PART OF RESULT.
050064,002002: 00,2575 00006 EXTEND
050065,002003: 00,2576 70131 MP BUF +1
050066,002004: 00,2577 60155 AD MPAC +1 # OVERFLOW AT THIS POINT IS POSITIVE SINCE
050067,002005: 00,2600 54000 OVSK # R IS POSITIVE IN EVERY CASE.
050068,002006: 00,2601 12606 TCF +5
050069,002007:
050070,002008: 00,2602 00006 EXTEND # OVERFLOW CAN BE REMOVED BY SUBTRACTING C
050071,002009: 00,2603 60130 SU BUF # (BUF) ONCE SINCE R IS ALWAYS LESS THAN C
050072,002010: 00,2604 24154 INCR MPAC # IN THIS CASE. INCR COMPENSATES SUBTRACT.
050073,002011: 00,2605 12610 TCF +DOWN # (SINCE C(A) IS STILL POSITIVE).
050074,002012:
050075,002013: 00,2606 00006 +5 EXTEND # C(A) CAN BE MADE LESS THAN C IN MAGNI-
050076,002014: 00,2607 62620 BZMF -UP # TUDE BY DIMINISHING IT BY C (SINCE C IS
050077,002015: # NOT LESS THAN .5) UNLESS C(A) = 0.
050078,002016:
Page 1138 |
050080,002018: 00,2610 00006 +DOWN EXTEND
050081,002019: 00,2611 60130 SU BUF # IF POSITIVE, REDUCE ONLY IF NECESSARY
050082,002020: 00,2612 00006 EXTEND # SINCE THE COMPENSATING INCR MIGHT CAUSE
050083,002021: 00,2613 12616 BZF +3 # OVERFLOW.
050084,002022: 00,2614 00006 EXTEND # DONT SUBTRACT UNLESS RESULT IS POSITIVE
050085,002023: 00,2615 62624 BZMF ENDMAXDV # OR ZERO.
050086,002024:
050087,002025: 00,2616 24154 +3 INCR MPAC # KEEP SUBTRACT HERE AND COMPENSATE.
050088,002026: 00,2617 12625 TCF FINALDV
050089,002027:
050090,002028: 00,2620 00006 -UP EXTEND # IF ZERO, SET MINOR PART OF RESULT TO
050091,002029: 00,2621 12630 BZF FINALDV +3 # ZERO.
050092,002030:
050093,002031: 00,2622 00006 EXTEND # IF NEGATIVE, ADD C TO A, SUBTRACTING ONE
050094,002032: 00,2623 26154 DIM MPAC # TO COMPENSATE. DIM IS OK HERE SINCE THE
050095,002033: 00,2624 60130 ENDMAXDV AD BUF # MAJOR PART NEVER GOES NEGATIVE.
050096,002034:
Page 1139 |
050098,002036: 00,2625 22007 FINALDV ZL # DO DV TO OBTAIN MINOR PART OF RESULT.
050099,002037: 00,2626 00006 EXTEND
050100,002038: 00,2627 10130 DV BUF
050101,002039: 00,2630 54155 +3 TS MPAC +1
050102,002040:
050103,002041: 00,2631 10136 CCS DVSIGN # LEAVE RESULT POSITIVE UNLESS C(DVSIGN)=
050104,002042: 00,2632 00002 TC Q # -0.
050105,002043: 00,2633 00002 TC Q
050106,002044: 00,2634 00002 TC Q
050107,002045:
050108,002046: 00,2635 00006 EXTEND
050109,002047: 00,2636 40155 DCS MPAC
050110,002048: 00,2637 52155 DXCH MPAC
050111,002049: 00,2640 34714 CAF ZERO # SO WE ALWAYS RETURN WITH C(A) = 0.
050112,002050: 00,2641 00002 TC Q
050113,002051:
Page 1140 |
050115,002053: # IF THE MAJOR PARTS OF THE DIVISOR AND DIVIDEND ARE EQUAL, BUT THE MINOR PARTS ARE SUCH THAT THE
050116,002054: # DIVIDEND IS STRICTLY LESS THAN THE DIVISOR IN MAGNITUDE, THE FOLLOWING APPROXIMATION IS USED. THE ASSUMPTIONS
050117,002055: # ARE THE SAME AS THE GENERAL ROUTINE WITH THE ADDITION THAT SIGN AGREEMENT IS NECESSARY (B, C, & D POSITIVE).
050118,002056:
050119,002057: # C + SB . (C + B - D)
050120,002058: # ------ = 37777 + S(---------)
050121,002059: # C + SD ( C )
050122,002060:
050123,002061: # THE DIVISION MAY BE PERFORMED IMMEDIATELY SINCE B IS STRICTLY LESS THAN D AND C IS NOT LESS THAN .5.
050124,002062:
050125,002063: 00,2642 40154 MAXDV CS MPAC # SEE IF MAXDV CASE STILL HOLDS AFTER
050126,002064: 00,2643 60130 AD BUF # NORMALIZATION.
050127,002065: 00,2644 00006 EXTEND
050128,002066: 00,2645 12647 BZF +2
050129,002067: 00,2646 12570 TCF GENDDV # MPAC NOW LESS THAN BUF - DIVIDE AS USUAL
050130,002068:
050131,002069: 00,2647 34672 +2 CAF POSMAX # SET MAJOR PART OF RESULT.
050132,002070: 00,2650 54154 TS MPAC
050133,002071:
050134,002072: 00,2651 40131 CS BUF +1 # FORM DIVIDEND OF MINOR PART OF RESULT.
050135,002073: 00,2652 60155 AD MPAC +1
050136,002074: 00,2653 12624 TCF ENDMAXDV # GO ADD C AND DO DIVIDE, ATTACHING SIGN
050137,002075: # BEFORE EXITING.
050138,002076:
Page 1141 |
050140,002078: # VECTOR DIVIDED BY SCALAR, V/SC, IS EXECUTED HERE. THE VECTOR IS NOW IN MPAC WITH SCALAR IN BUF.
050141,002079:
050142,002080: 00,2654 44712 V/SC2 CS ONE # INITIALIZE DIVIDEND NORMALIZATION COUNT
050143,002081: 00,2655 54137 TS DVNORMCT # AND DIVISION SIGN REGISTER.
050144,002082: 00,2656 54127 TS VBUF +5
050145,002083:
050146,002084: 00,2657 03010 TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
050147,002085:
050148,002086: 00,2660 52131 DXCH BUF
050149,002087: 00,2661 07513 TC ALSIGNAG # SIGN AGREE BUF
050150,002088: 00,2662 52131 DXCH BUF
050151,002089: 00,2663 10130 CCS BUF # FORCE DIVISOR POSITIVE WITH MAJOR PART
050152,002090: 00,2664 12721 TCF /BUF+ # NON-ZERO (IF POSSIBLE).
050153,002091: 00,2665 12667 TCF +2
050154,002092: 00,2666 12715 TCF /BUF-
050155,002093:
050156,002094: 00,2667 56131 XCH BUF +1 # SHIFT VECTOR AND SCALAR LEFT 14.
050157,002095: 00,2670 56130 XCH BUF
050158,002096: 00,2671 56155 XCH MPAC +1
050159,002097: 00,2672 56154 XCH MPAC
050160,002098: 00,2673 00006 EXTEND # CHECK FOR OVERFLOW IN EACH CASE.
050161,002099: 00,2674 12676 BZF +2
050162,002100: 00,2675 12405 TCF DVOVF
050163,002101:
050164,002102: 00,2676 56160 XCH MPAC +4
050165,002103: 00,2677 56157 XCH MPAC +3
050166,002104: 00,2700 00006 EXTEND
050167,002105: 00,2701 12703 BZF +2
050168,002106: 00,2702 12405 TCF DVOVF
050169,002107:
050170,002108: 00,2703 56162 XCH MPAC +6
050171,002109: 00,2704 56161 XCH MPAC +5
050172,002110: 00,2705 00006 EXTEND
050173,002111: 00,2706 12710 BZF +2
050174,002112: 00,2707 12405 TCF DVOVF
050175,002113:
050176,002114: 00,2710 10130 CCS BUF
050177,002115: 00,2711 12721 TCF /BUF+
050178,002116: 00,2712 12405 TCF DVOVF # ZERO DIVISOR - OVERFLOW.
050179,002117: 00,2713 12715 TCF /BUF-
050180,002118: 00,2714 12405 TCF DVOVF
050181,002119:
050182,002120: 00,2715 00006 /BUF- EXTEND # ON NEGATIVE, COMPLEMENT BUF AND MAINTAIN
050183,002121: 00,2716 40131 DCS BUF # DVSIGN IN VBUF +5.
050184,002122: 00,2717 52131 DXCH BUF
050185,002123: 00,2720 24127 INCR VBUF +5
050186,002124:
Page 1142 |
050188,002126: 00,2721 00006 /BUF+ EXTEND
050189,002127: 00,2722 30131 DCA BUF # LEAVE ABS(ORIG DIVISOR) IN BUF2
050190,002128: 00,2723 52134 DXCH BUF2 # FOR OVERFLOW TESTING
050191,002129: 00,2724 12732 TCF /NORM # NORMALIZE DIVISOR IN BUF.
050192,002130:
050193,002131: 00,2725 00006 /NORM2 EXTEND # IF LESS THAN .5, AUGMENT DVNORMCT AND
050194,002132: 00,2726 24137 AUG DVNORMCT # DOUBLE DIVISOR.
050195,002133: 00,2727 00006 EXTEND
050196,002134: 00,2730 30131 DCA BUF
050197,002135: 00,2731 20131 DAS BUF
050198,002136:
050199,002137: 00,2732 30130 /NORM CA BUF # SEE IF DIVISOR NORMALIZED.
050200,002138: 00,2733 60000 DOUBLE
050201,002139: 00,2734 54000 OVSK
050202,002140: 00,2735 12725 TCF /NORM2 # DOUBLE AND TRY AGAIN IF NOT.
050203,002141:
050204,002142: 00,2736 02750 TC V/SCDV # DO X COMPONENT DIVIDE.
050205,002143: 00,2737 52160 DXCH MPAC +3 # SUPPLY ARGUMENTS IN USUAL SEQUENCE.
050206,002144: 00,2740 52155 DXCH MPAC
050207,002145: 00,2741 52160 DXCH MPAC +3
050208,002146:
050209,002147: 00,2742 02750 TC V/SCDV # Y COMPONENT.
050210,002148: 00,2743 52162 DXCH MPAC +5
050211,002149: 00,2744 52155 DXCH MPAC
050212,002150: 00,2745 52162 DXCH MPAC +5
050213,002151:
050214,002152: 00,2746 02750 TC V/SCDV # Z COMPONENT.
050215,002153: 00,2747 17367 TCF VROTATEX # GO RE-ARRANGE COMPONENTS BEFORE EXIT.
050216,002154:
Page 1143 |
050218,002156: # SUBROUTINE USED BY V/SC TO DIVIDE VECTOR COMPONENT IN MPAC,+1 BY THE SCALAR GIVEN IN BUF.
050219,002157:
050220,002158: 00,2750 30127 V/SCDV CA VBUF +5 # REFLECTS SIGN OF SCALAR.
050221,002159: 00,2751 54136 TS DVSIGN
050222,002160:
050223,002161: 00,2752 10154 CCS MPAC # FORCE MPAC POSITIVE, EXITING ON ZERO.
050224,002162: 00,2753 12767 TCF /MPAC+
050225,002163: 00,2754 12756 TCF +2
050226,002164: 00,2755 12763 TCF /MPAC-
050227,002165:
050228,002166: 00,2756 10155 CCS MPAC +1
050229,002167: 00,2757 12767 TCF /MPAC+
050230,002168: 00,2760 00002 TC Q
050231,002169: 00,2761 12763 TCF /MPAC-
050232,002170: 00,2762 00002 TC Q
050233,002171:
050234,002172: 00,2763 00006 /MPAC- EXTEND # USUAL COMPLEMENTING AND SETTING OF SIGN.
050235,002173: 00,2764 40155 DCS MPAC
050236,002174: 00,2765 52155 DXCH MPAC
050237,002175: 00,2766 24136 INCR DVSIGN
050238,002176:
050239,002177: 00,2767 44712 /MPAC+ CS ONE # INITIALIZE NEAR-ONE SWITCH.
050240,002178: 00,2770 54140 TS MAXDVSW
050241,002179:
050242,002180: 00,2771 40154 CS MPAC # CHECK POSSIBLE OVERFLOW.
050243,002181: 00,2772 60133 AD BUF2 # UNNORMALIZED INPUT DIVISOR.
050244,002182: 00,2773 10000 CCS A
050245,002183: 00,2774 13004 TCF DDVCALL # NOT NEAR-ONE
050246,002184: 00,2775 12777 TCF +2 # +0 IS JUST POSSIBLE
050247,002185: 00,2776 12405 TCF DVOVF # NO HOPE
050248,002186: 00,2777 54140 TS MAXDVSW # SIGNAL POSSIBLE NEAR-ONE CASE
050249,002187: 00,3000 40155 CS MPAC +1 # SEE IF DIVISION CAN BE DONE
050250,002188: 00,3001 60134 AD BUF2 +1
050251,002189: 00,3002 00006 EXTEND
050252,002190: 00,3003 62405 BZMF DVOVF
050253,002191:
050254,002192: 00,3004 52155 DDVCALL DXCH MPAC # CALL PRE-DIVIDE NORMALIZATION.
050255,002193: 00,3005 50137 INDEX DVNORMCT
050256,002194: 00,3006 12565 TCF MAXTEST
050257,002195:
Page 1144 |
050259,002197: 00,3007 32506 SLOPELO DEC .8324
050260,002198:
050261,002199: 00,3010 56002 VECAGREE XCH Q # SAVE Q IN A
050262,002200: 00,3011 52155 DXCH MPAC
050263,002201: 00,3012 07513 TC ALSIGNAG # SIGNAGREE MPAC
050264,002202: 00,3013 52155 DXCH MPAC
050265,002203: 00,3014 52160 DXCH MPAC +3
050266,002204: 00,3015 07513 TC ALSIGNAG # SIGN AGREE MPAC +3
050267,002205: 00,3016 52160 DXCH MPAC +3
050268,002206: 00,3017 52162 DXCH MPAC +5
050269,002207: 00,3020 07513 TC ALSIGNAG # SIGNAGREE MPAC +5
050270,002208: 00,3021 52162 DXCH MPAC +5
050271,002209: 00,3022 00000 TC A
050272,002210:
Page 1145 |
050274,002212: # THE FOLLOWING ROUTINE EXECUTES THE UNIT INSTRUCTION, WHICH TAKES THE UNIT OF THE VECTOR IN MPAC.
050275,002213:
050276,002214: 00,3023 03010 UNIT TC VECAGREE # FORCE SIGN AGREEMENT IN VECTOR
050277,002215: 00,3024 07501 TC MPACVBUF # SAVE ARGUMENT IN VBUF
050278,002216: 00,3025 34714 CAF ZERO # MUST SENSE OVERFLOW IN FOLLOWING DOT.
050279,002217: 00,3026 56121 XCH OVFIND
050280,002218: 00,3027 54141 TS TEM1
050281,002219: 00,3030 03317 TC VSQSUB # DOT MPAC WITH ITSELF.
050282,002220: 00,3031 30141 CA TEM1
050283,002221: 00,3032 56121 XCH OVFIND
050284,002222: 00,3033 00006 EXTEND
050285,002223: 00,3034 13036 BZF +2
050286,002224: 00,3035 12405 TCF DVOVF
050287,002225: 00,3036 00006 EXTEND
050288,002226: 00,3037 30155 DCA MPAC # LEAVE THE SQUARE OF THE LENGTH OF THE
050289,002227: 00,3040 50120 INDEX FIXLOC # ARGUMENT IN LVSQUARE.
050290,002228: 00,3041 52043 DXCH LVSQUARE
050291,002229:
050292,002230: 00,3042 03343 TC SQRTSUB # GO TAKE THE NORMALIZED SQUARE ROOT.
050293,002231:
050294,002232: 00,3043 10154 CCS MPAC # CHECK FOR UNIT OVERFLOW.
050295,002233: 00,3044 13051 TCF +5 # MPAC IS NOT LESS THAN .5 UNLESS
050296,002234: 00,3045 54001 TS L
050297,002235: 00,3046 50120 INDEX FIXLOC
050298,002236: 00,3047 52045 DXCH LV
050299,002237: 00,3050 12405 TCF DVOVF # INPUT TO SQRTSUB WAS 0.
050300,002238:
050301,002239: 00,3051 44333 CS FOURTEEN # SEE IF THE INPUT WAS SO SMALL THE THE
050302,002240: 00,3052 60135 AD MPTEMP # FIRST TWO REGISTERS OF THE SQUARE WERE 0
050303,002241: 00,3053 10000 CCS A
050304,002242: 00,3054 40000 COM # IF SO, SAVE THE NEGATIVE OF THE SHIFT
050305,002243: 00,3055 13133 TCF SMALL # COUNT -15D.
050306,002244:
050307,002245: 00,3056 13065 TCF LARGE # (THIS IS USUALLY THE CASE.)
050308,002246:
050309,002247: 00,3057 44720 CS THIRTEEN # IF THE SHIFT COUNT WAS EXACTLY 14, SET
050310,002248: 00,3060 54135 TS MPTEMP # THE PRE-DIVIDE NORM COUNT TO -13D.
050311,002249:
050312,002250: 00,3061 30154 CA MPAC # SHIFT THE LENGTH RIGHT 14 BEFORE STORING
050313,002251: 00,3062 54001 SMALL2 TS L # (SMALL EXITS TO THIS POINT).
050314,002252: 00,3063 34714 CAF ZERO
050315,002253: 00,3064 13112 TCF LARGE2 # GO TO STORE LENGTH AND PROCEED.
050316,002254:
050317,002255: 00,3065 10135 LARGE CCS MPTEMP # MOST ALL CASES COME HERE.
050318,002256: 00,3066 13074 TCF LARGE3 # SEE IF NO NORMALIZATION WAS REQUIRED BY
050319,002257: 00,3067 42024 CS SRDDV # SQRT, AND IF SO, SET UP FOR A SHIFT
050320,002258: 00,3070 54135 TS MPTEMP # RIGHT 1 BEFORE DIVIDING TO PRODUCE
050321,002259: 00,3071 00006 EXTEND # THE DESIRED HALF UNIT VECTOR.
050322,002260: 00,3072 30155 DCA MPAC
Page 1146 |
050324,002262: 00,3073 13112 TCF LARGE2
050325,002263:
Page 1147 |
050327,002265: 00,3074 40000 LARGE3 COM # LEAVE NEGATIVE OF SHIFT COUNT-1 FOR
050328,002266: 00,3075 54135 TS MPTEMP # PREDIVIDE LEFT SHIFT.
050329,002267:
050330,002268: 00,3076 40000 COM # PICK UP REQUIRED SHIFTING BIT TO UNNORM-
050331,002269: 00,3077 50000 INDEX A # ALIZE THE SQRT RESULT.
050332,002270: 00,3100 34675 CAF BIT14
050333,002271: 00,3101 54130 TS BUF
050334,002272: 00,3102 00006 EXTEND
050335,002273: 00,3103 70155 MP MPAC +1
050336,002274: 00,3104 56130 XCH BUF
050337,002275: 00,3105 00006 EXTEND # (UNNORMALIZE THE SQRT FOR LV).
050338,002276: 00,3106 70154 MP MPAC
050339,002277: 00,3107 56001 XCH L
050340,002278: 00,3110 60130 AD BUF
050341,002279: 00,3111 56001 XCH L
050342,002280:
050343,002281: 00,3112 50120 LARGE2 INDEX FIXLOC
050344,002282: 00,3113 52045 DXCH LV # LENGTH NOW STORED IN WORK AREA.
050345,002283:
050346,002284: 00,3114 44712 CS ONE
050347,002285: 00,3115 54140 TS MAXDVSW # NO MAXDV CASES IN UNIT.
050348,002286:
050349,002287: 00,3116 52123 DXCH VBUF # PREPARE X COMPONENT FOR DIVIDE, SETTING
050350,002288: 00,3117 52155 DXCH MPAC # LENGTH OF VECTOR AS DIVISOR IN BUF.
050351,002289: 00,3120 52131 DXCH BUF
050352,002290: 00,3121 03151 TC UNITDV
050353,002291:
050354,002292: 00,3122 52125 DXCH VBUF +2 # DO Y AND Z IN USUAL FASHION SO WE CAN
050355,002293: 00,3123 52155 DXCH MPAC # EXIT THROUGH VROTATEX.
050356,002294: 00,3124 52160 DXCH MPAC +3
050357,002295: 00,3125 03151 TC UNITDV
050358,002296:
050359,002297: 00,3126 52127 DXCH VBUF +4
050360,002298: 00,3127 52155 DXCH MPAC
050361,002299: 00,3130 52162 DXCH MPAC +5
050362,002300: 00,3131 03151 TC UNITDV
050363,002301: 00,3132 17367 TCF VROTATEX # AND EXIT.
050364,002302:
Page 1148 |
050366,002304: # IF THE LENGTH OF THE ARGUMENT VECTOR WAS LESS THAN 2(-28), EACH COMPONENT MUST BE SHIFTED LEFT AT LEAST
050367,002305: # 14 PLACES BEFORE THE DIVIDE. NOTE THAT IN THIS CASE, THE MAJOR PART OF EACH COMPONENT IS ZERO.
050368,002306:
050369,002307: 00,3133 54135 SMALL TS MPTEMP # NEGATIVE OF PRE-DIVIDE SHIFT COUNT.
050370,002308:
050371,002309: 00,3134 34714 CAF ZERO # SHIFT EACH COMPONENT LEFT 14.
050372,002310: 00,3135 56123 XCH VBUF +1
050373,002311: 00,3136 56122 XCH VBUF
050374,002312: 00,3137 56125 XCH VBUF +3
050375,002313: 00,3140 56124 XCH VBUF +2
050376,002314: 00,3141 56127 XCH VBUF +5
050377,002315: 00,3142 56126 XCH VBUF +4
050378,002316:
050379,002317: 00,3143 40135 CS MPTEMP
050380,002318: 00,3144 50000 INDEX A
050381,002319: 00,3145 34675 CAF BIT14
050382,002320: 00,3146 00006 EXTEND
050383,002321: 00,3147 70154 MP MPAC
050384,002322: 00,3150 13062 TCF SMALL2
050385,002323:
050386,002324: 00,3151 4720 THIRTEEN = OCT15
050387,002325: 00,3151 4333 FOURTEEN = OCT16
050388,002326: 00,3151 4333 OCT16 = R1D1
050389,002327:
Page 1149 |
050391,002329: # THE FOLLOWING ROUTINE SETS UP THE CALL TO THE DIVIDE ROUTINES.
050392,002330:
050393,002331: 00,3151 10154 UNITDV CCS MPAC # FORCE MPAC POSITIVE IF POSSIBLE, SETTING
050394,002332: 00,3152 13170 TCF UMPAC+ # DVSIGN ACCORDING TO THE SIGN OF MPAC
050395,002333: 00,3153 13155 TCF +2 # SINCE THE DIVISOR IS ALWAYS POSITIVE
050396,002334: 00,3154 13162 TCF UMPAC- # HERE.
050397,002335:
050398,002336: 00,3155 10155 CCS MPAC +1
050399,002337: 00,3156 13170 TCF UMPAC+
050400,002338: 00,3157 00002 TC Q # EXIT IMMEDIATELY ON ZERO.
050401,002339: 00,3160 13162 TCF UMPAC-
050402,002340: 00,3161 00002 TC Q
050403,002341:
050404,002342: 00,3162 44714 UMPAC- CS ZERO # IF NEGATIVE, SET -0 IN DVSIGN FOR FINAL
050405,002343: 00,3163 54136 TS DVSIGN # COMPLEMENT.
050406,002344: 00,3164 00006 EXTEND
050407,002345: 00,3165 40155 DCS MPAC # PICK UP ABSOLUTE VALUE OF ARG AND JUMP.
050408,002346: 00,3166 50135 INDEX MPTEMP
050409,002347: 00,3167 12564 TCF MAXTEST -1
050410,002348:
050411,002349: 00,3170 54136 UMPAC+ TS DVSIGN # SET DVSIGN FOR POSITIVE QUOTIENT.
050412,002350: 00,3171 52155 DXCH MPAC
050413,002351: 00,3172 50135 INDEX MPTEMP
050414,002352: 00,3173 12564 TCF MAXTEST -1
050415,002353:
Page 1150 |
050417,002355: # MISCELLANEOUS UNARY OPERATIONS.
050418,002356:
050419,002357: 00,3174 03300 DSQ TC DSQSUB # SQUARE THE DP CONTENTS OF MPAC.
050420,002358: 00,3175 16030 TCF DANZIG
050421,002359:
050422,002360: 00,3176 10163 ABVALABS CCS MODE # ABVAL OR ABS INSTRUCTION.
050423,002361: 00,3177 13226 TCF ABS # DO ABS ON SCALAR.
050424,002362: 00,3200 13226 TCF ABS
050425,002363:
050426,002364: 00,3201 03317 ABVAL TC VSQSUB # DOT MPAC WITH ITSELF.
050427,002365: 00,3202 22163 LXCH MODE # MODE IS NOW DP (L ZERO AFTER DAS).
050428,002366:
050429,002367: 00,3203 00006 EXTEND # STORE SQUARE OF LENGTH IN WORK AREA.
050430,002368: 00,3204 30155 DCA MPAC
050431,002369: 00,3205 50120 INDEX FIXLOC
050432,002370: 00,3206 52043 DXCH LVSQUARE
050433,002371:
Page 1151 |
050435,002373: # PROGRAM DESCRIPTION - SUBROUTINE SQRT
050436,002374:
050437,002375: # FUNCTIONAL DESCRIPTION - DOUBLE PRECISION SQUARE ROOT ROUTINE
050438,002376: # THIS PROGRAM TAKES THE SQUARE ROOT OF THE 27 OR 28 MOST SIGNIFICANT BITS IN THE TRIPLE PRECISION SET OF
050439,002377: # NUMBERS - MPAC, MPAC+1, AND MPAC+2. THE ROOT IS RETURNED DOUBLE PRECISION IN MPAC AND MPAC+1.
050440,002378:
050441,002379: # WARNING - THIS SUBROUTINE USES A TRIPLE PRECISION INPUT. THE PROGRAMMER MUST ASSURE THE CONTENTS OF MPAC+2
050442,002380: # ESPECIALLY IF THE CONTENTS OF MPAC IS SMALL OR ZERO. FOR DETAILS SEE STG MEMO NO.949.
050443,002381:
050444,002382: # CALLING SEQUENCE - IN INTERPRETIVE MODE I.E., FOLLOWING TC INTPRET,SQRT NO ADDRESS IS ALLOWED
050445,002383: # INPUT SCALING THE BINARY POINT IS ASSUMED TO THE RIGHT OF BIT 15. THE ANSWER IS RETURNED WITH THE SAME SCALING
050446,002384:
050447,002385: # SUBROUTINES - GENSCR, MPACSHR, SQRTSUB, ABORT
050448,002386:
050449,002387: # ABORT EXIT MODE - ABORTS ON NEGATIVE INPUT -1.2X10E-4 (77775 OCTAL) OR LESS.
050450,002388: # DISPLAYS ERROR CODE 1302
050451,002389: # TC ABORT
050452,002390: # OCT 1302
050453,002391:
050454,002392: # DEBRIS - LOCATIONS BUF, MPTEMP, ADDRWD ARE USED
050455,002393:
050456,002394: 00,3207 03343 SQRT TC SQRTSUB # TAKE THE SQUARE ROOT OF MPAC.
050457,002395: 00,3210 10135 CCS MPTEMP # RETURNED NORMALIZED SQUARE ROOT. SEE IF
050458,002396: 00,3211 13213 TCF +2 # ANY UN-NORMALIZATION REQUIRED AND EXIT
050459,002397: 00,3212 16030 TCF DANZIG # IF NOT.
050460,002398:
050461,002399: 00,3213 63730 AD NEG12 # A RIGHT SHIFT OF MORE THAN 13 COULD BE
050462,002400: 00,3214 00006 EXTEND # REQUIRED IF INPUT WAS ZERO IN MPAC,+1.
050463,002401: 00,3215 63221 BZMF SQRTSHFT # GOES HERE IN MOST CASES.
050464,002402: 00,3216 22007 ZL # IF A LONG SHIFT IS REQUIRED, GO TO
050465,002403: 00,3217 22116 LXCH ADDRWD # GENERAL RIGHT SHIFT ROUTINES.
050466,002404: 00,3220 12303 TCF GENSCR +4 # ADDRWD WAS ZERO TO PREVENT ROUND.
050467,002405:
050468,002406: 00,3221 50135 SQRTSHFT INDEX MPTEMP # SELECT SHIFTING BIT AND EXIT THROUGH
050469,002407: 00,3222 34674 CAF BIT15 # SHIFT ROUTINES.
050470,002408: 00,3223 54135 TS MPTEMP
050471,002409: 00,3224 34714 CAF ZERO # TO ZERO MPAC +2 IN THE PROCESS.
050472,002410: 00,3225 12036 TCF MPACSHR +3
050473,002411:
050474,002412: 00,3226 06672 ABS TC BRANCH # TEST SIGN OF MPAC AND COMPLEMENT IF
050475,002413: 00,3227 16030 TCF DANZIG
050476,002414: 00,3230 16030 TCF DANZIG
050477,002415: 00,3231 17637 TCF COMP
050478,002416:
Page 1152 |
050480,002418: 00,3232 44710 VDEF CS FOUR # VECTOR DEFINE - ESSENTIALLY TREATS
050481,002419: 00,3233 26166 ADS PUSHLOC # SCALAR IN MPAC AS X COMPONENT, PUSHES UP
050482,002420: 00,3234 00006 EXTEND # FOR Y AND THEN AGAIN FOR Z.
050483,002421: 00,3235 50000 INDEX A
050484,002422: 00,3236 30003 DCA 2
050485,002423: 00,3237 52160 DXCH MPAC +3
050486,002424: 00,3240 00006 EXTEND
050487,002425: 00,3241 50166 INDEX PUSHLOC
050488,002426: 00,3242 30001 DCA 0
050489,002427: 00,3243 52162 DXCH MPAC +5
050490,002428: 00,3244 16470 TCF VMODE # MODE IS NON VECTOR.
050491,002429:
050492,002430: 00,3245 03317 VSQ TC VSQSUB # DOT MPAC WITH ITSELF.
050493,002431: 00,3246 17301 TCF DMODE # MODE IS NOW DP.
050494,002432:
050495,002433: 00,3247 00006 PUSH EXTEND # PUSH DOWN MPAC LEAVING IT LOADED.
050496,002434: 00,3250 30155 DCA MPAC
050497,002435: 00,3251 50166 INDEX PUSHLOC # PUSH DOWN FIRST TWO REGISTERS IN EACH
050498,002436: 00,3252 52001 DXCH 0
050499,002437:
050500,002438: 00,3253 50163 INDEX MODE # INCREMENT PUSHDOWN POINTER.
050501,002439: 00,3254 36213 CAF NO.WDS
050502,002440: 00,3255 26166 ADS PUSHLOC
050503,002441:
050504,002442: 00,3256 10163 CCS MODE
050505,002443: 00,3257 13272 TCF TPUSH # PUSH DOWN MPAC +2.
050506,002444: 00,3260 16030 TCF DANZIG # DONE FOR DP.
050507,002445:
050508,002446: 00,3261 00006 EXTEND # ON VECTOR, PUSH DOWN Y AND Z COMPONENTS.
050509,002447: 00,3262 30160 DCA MPAC +3
050510,002448: 00,3263 50166 INDEX PUSHLOC
050511,002449: 00,3264 51775 DXCH 0 -4
050512,002450: 00,3265 00006 EXTEND
050513,002451: 00,3266 30162 DCA MPAC +5
050514,002452: 00,3267 50166 INDEX PUSHLOC
050515,002453: 00,3270 51777 DXCH 0 -2
050516,002454: 00,3271 16030 TCF DANZIG
050517,002455:
050518,002456: 00,3272 30156 TPUSH CA MPAC +2
050519,002457: 00,3273 16523 TCF ENDTPUSH +2
050520,002458:
050521,002459: 00,3274 50120 RVQ INDEX FIXLOC # RVQ - RETURN IVA QPRET.
050522,002460: 00,3275 30052 CA QPRET
050523,002461: 00,3276 54117 TS POLISH
050524,002462: 00,3277 16621 TCF GOTO +4 # (ASSUME QPRET POINTS TO FIXED ONLY.)
050525,002463:
Page 1153 |
050527,002465: # THE FOLLOWING SUBROUTINES ARE USED IN SQUARING MPAC, IN BOTH THE SCALAR AND VECTOR SENSE. THEY ARE
050528,002466: # SPECIAL CASES OF DMPSUB AND DOTSUB, PUT IN TO SAVE SOME TIME.
050529,002467:
050530,002468: 00,3300 30155 DSQSUB CA MPAC +1 # SQUARES THE SCALAR CONTENTS OF MPAC.
050531,002469: 00,3301 00006 EXTEND
050532,002470: 00,3302 70000 SQUARE
050533,002471: 00,3303 54156 TS MPAC +2
050534,002472: 00,3304 34714 CAF ZERO # FORM 2(CROSS TERM).
050535,002473: 00,3305 56155 XCH MPAC +1
050536,002474: 00,3306 00006 EXTEND
050537,002475: 00,3307 70154 MP MPAC
050538,002476: 00,3310 20001 DDOUBL # AND MAYBE OVERFLOW.
050539,002477: 00,3311 20156 DAS MPAC +1 # AND SET A TO NET OVERFLOW.
050540,002478: 00,3312 56154 XCH MPAC
050541,002479: 00,3313 00006 EXTEND
050542,002480: 00,3314 70000 SQUARE
050543,002481: 00,3315 20155 DAS MPAC
050544,002482: 00,3316 00002 TC Q
050545,002483:
050546,002484: 00,3317 00006 VSQSUB EXTEND # DOTS THE VECTOR IN MPAC WITH ITSELF.
050547,002485: 00,3320 22137 QXCH DOTRET
050548,002486: 00,3321 03300 TC DSQSUB # SQUARE THE X COMPONENT.
050549,002487: 00,3322 52160 DXCH MPAC +3
050550,002488: 00,3323 52155 DXCH MPAC
050551,002489: 00,3324 52131 DXCH BUF # SO WE CAN END IN DOTSUB.
050552,002490: 00,3325 30156 CA MPAC +2
050553,002491: 00,3326 54132 TS BUF +2
050554,002492:
050555,002493: 00,3327 03300 TC DSQSUB # SQUARE Y COMPONENT.
050556,002494: 00,3330 52156 DXCH MPAC +1
050557,002495: 00,3331 20132 DAS BUF +1
050558,002496: 00,3332 60154 AD MPAC
050559,002497: 00,3333 60130 AD BUF
050560,002498: 00,3334 54130 TS BUF
050561,002499: 00,3335 13337 TCF +2
050562,002500: 00,3336 54121 TS OVFIND # IF OVERFLOW.
050563,002501:
050564,002502: 00,3337 52162 DXCH MPAC +5
050565,002503: 00,3340 52155 DXCH MPAC
050566,002504: 00,3341 03300 TC DSQSUB # SQUARE Z COMPONENT.
050567,002505: 00,3342 17154 TCF ENDDOT # END AS IN DOTSUB.
050568,002506:
Page 1154 |
050570,002508: # DOUBLE PRECISION SQUARE ROOT ROUTINE. TAKE THE SQUARE ROOT OF THE TRIPLE PRECISION (MPAC +2 USED ONLY
050571,002509: # IN NORMALIZATION) CONTENTS OF MPAC AND LEAVE THE NORMALIZED RESULT IN MPAC (C(MPAC) GREATER THAN OR EQUAL TO
050572,002510: # .5). THE RIGHT SHIFT COUNT (TO UNNORMALIZE) IS LEFT IN MPTEMP.
050573,002511:
050574,002512: 00,3343 34714 SQRTSUB CAF ZERO # START BY ZEROING RIGHT SHIFT COUNT.
050575,002513: 00,3344 54135 TS MPTEMP
050576,002514:
050577,002515: 00,3345 10154 CCS MPAC # CHECK FOR POSITIVE ARGUMENT, SHIFTING
050578,002516: 00,3346 13404 TCF SMPAC+ # FIRST SIGNIFICANT MPAC REGISTER INTO
050579,002517: 00,3347 13351 TCF +2 # MPAC ITSELF.
050580,002518: 00,3350 13373 TCF SQRTNEG # SEE IF MAG OF ARGUMENT LESS THAN 10(-4).
050581,002519:
050582,002520: 00,3351 56156 XCH MPAC +2 # MPAC IS ZERO - SHIFT LEFT 14.
050583,002521: 00,3352 56155 XCH MPAC +1
050584,002522: 00,3353 54154 TS MPAC
050585,002523: 00,3354 34716 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
050586,002524: 00,3355 54135 TS MPTEMP
050587,002525:
050588,002526: 00,3356 10154 CCS MPAC # SEE IF MPAC NOW PNZ.
050589,002527: 00,3357 13404 TCF SMPAC+
050590,002528: 00,3360 13362 TCF +2
050591,002529: 00,3361 13376 TCF ZEROANS # NEGATIVE BUT LESS THAN 10(-4) IN MAG.
050592,002530:
050593,002531: 00,3362 56155 XCH MPAC +1 # ZERO - SHIFT LEFT 14 AGAIN.
050594,002532: 00,3363 54154 TS MPAC
050595,002533: 00,3364 34716 CAF SEVEN # AUGMENT RIGHT SHIFT COUNTER.
050596,002534: 00,3365 26135 ADS MPTEMP
050597,002535:
050598,002536: 00,3366 10154 CCS MPAC
050599,002537: 00,3367 13404 TCF SMPAC+
050600,002538: 00,3370 00002 TC Q # SQRT(0) = 0.
050601,002539: 00,3371 13376 TCF ZEROANS
050602,002540: 00,3372 13452 TCF FIXROOT # DO NOT LEAVE SQRTSUB WITH -0 IN MPAC.
050603,002541:
050604,002542: 00,3373 10000 SQRTNEG CCS A # ARGUMENT IS NEGATIVE, BUT SEE IF SIGN-
050605,002543: 00,3374 13402 TCF SQRTABRT # CORRECTED ARGUMENT IS LESS THAN 10(-4)
050606,002544:
050607,002545: 00,3375 10155 CCS MPAC +1 # IN MAGNITUDE. IF SO, CALL ANSWER ZERO.
050608,002546: 00,3376 34714 ZEROANS CAF ZERO # FORCE ANSWER TO ZERO HERE.
050609,002547: 00,3377 13452 TCF FIXROOT
050610,002548: 00,3400 13402 TCF SQRTABRT
050611,002549: 00,3401 13452 TCF FIXROOT
050612,002550:
050613,002551: 00,3402 05622 SQRTABRT TC POODOO
050614,002552: 00,3403 01302 OCT 01302
050615,002553:
Page 1155 |
050617,002555: 00,3404 62444 SMPAC+ AD -1/2+2 # SEE IF ARGUMENT GREATER THAN OR EQUAL TO
050618,002556: 00,3405 00006 EXTEND # .5.
050619,002557: 00,3406 63455 BZMF SRTEST # IF SO, SEE IF LESS THAN .25.
050620,002558:
050621,002559: 00,3407 52155 DXCH MPAC # WE WILL TAKE THE SQUARE ROOT OF MPAC/2.
050622,002560: 00,3410 22021 LXCH SR # SHIFT RIGHT 1 AND GO TO THE SQRT ROUTINE
050623,002561: 00,3411 00006 EXTEND
050624,002562: 00,3412 74675 MP HALF
050625,002563: 00,3413 52155 DXCH MPAC
050626,002564: 00,3414 56021 XCH SR
050627,002565: 00,3415 26155 ADS MPAC +1 # GUARANTEED NO OVERFLOW.
050628,002566:
050629,002567: 00,3416 32314 ARGHI CAF SLOPEHI # ARGUMENT BETWEEN .25 AND .5. GET A
050630,002568: 00,3417 00006 EXTEND # LINEAR APPROXIMATION FOR THIS RANGE.
050631,002569: 00,3420 70154 MP MPAC
050632,002570: 00,3421 62566 AD BIASHI # X0/2 = (MPAC/2)(SLOPEHI) + BIASHI/2.
050633,002571:
050634,002572: 00,3422 54130 +4 TS BUF # X0/2 (ARGLO ENTERS HERE).
050635,002573: 00,3423 30154 CA MPAC # SINGLE-PRECISION THROUGHOUT.
050636,002574: 00,3424 22007 ZL
050637,002575: 00,3425 00006 EXTEND
050638,002576: 00,3426 10130 DV BUF # (MPAC/2)/(X0/2)
050639,002577: 00,3427 00006 EXTEND
050640,002578: 00,3430 74675 MP HALF
050641,002579: 00,3431 26130 ADS BUF # X1 = X0/2 + .5(MPAC/2)/(X0/2).
050642,002580:
050643,002581: 00,3432 00006 EXTEND
050644,002582: 00,3433 74675 MP HALF # FORM UP X1/2.
050645,002583: 00,3434 52155 DXCH MPAC # SAVE AND BRING OUT ARGUMENT.
050646,002584: 00,3435 00006 EXTEND # TAKE DP QUOTIENT WITH X1.
050647,002585: 00,3436 10130 DV BUF
050648,002586: 00,3437 54131 TS BUF +1 # SAVE MAJOR PART OF QUOTIENT.
050649,002587: 00,3440 34714 CAF ZERO # FORM MINOR PART OF QUOTIENT USING
050650,002588: 00,3441 56001 XCH L # (REMAINDER,0).
050651,002589: 00,3442 00006 EXTEND
050652,002590: 00,3443 10130 DV BUF
050653,002591: 00,3444 54001 TS L # IN PREPARATION FOR DAS.
050654,002592: 00,3445 30131 CA BUF +1
050655,002593: 00,3446 20155 DAS MPAC # X2 = X1/2 + (MPAC/2)X1
050656,002594:
050657,002595: 00,3447 00006 EXTEND # OVERFLOWS IF ARG. NEAR POSMAX.
050658,002596: 00,3450 13454 BZF TCQBNK00
050659,002597: 00,3451 34672 CAF POSMAX
050660,002598: 00,3452 54154 FIXROOT TS MPAC
050661,002599: 00,3453 54155 TS MPAC +1
050662,002600: 00,3454 00002 TCQBNK00 TC Q # RETURN TO CALLER TO UNNORMALIZE, ETC.
050663,002601:
Page 1156 |
050665,002603: 00,3455 64676 SRTEST AD QUARTER # ARGUMENT WAS LESS THAN .5, SEE IF LESS
050666,002604: 00,3456 00006 EXTEND # THAN .25.
050667,002605: 00,3457 63501 BZMF SQRTNORM # IF SO, BEGIN NORMALIZATION.
050668,002606:
050669,002607: 00,3460 52155 DXCH MPAC # IF BETWEEN .5 AND .25, SHIFT RIGHT 1 AND
050670,002608: 00,3461 22021 LXCH SR # START AT ARGLO.
050671,002609: 00,3462 00006 EXTEND
050672,002610: 00,3463 74675 MP HALF
050673,002611: 00,3464 52155 DXCH MPAC
050674,002612: 00,3465 56021 XCH SR
050675,002613: 00,3466 26155 ADS MPAC +1 # NO OVERFLOW.
050676,002614:
050677,002615: 00,3467 33007 ARGLO CAF SLOPELO # (NORMALIZED) ARGUMENT BETWEEN .125 AND
050678,002616: 00,3470 00006 EXTEND # .25
050679,002617: 00,3471 70154 MP MPAC
050680,002618: 00,3472 62270 AD BIASLO
050681,002619: 00,3473 13422 TCF ARGHI +4 # BEGIN SQUARE ROOT.
050682,002620:
050683,002621: 00,3474 00006 SQRTNM2 EXTEND # SHIFT LEFT 2 AND INCREMENT RIGHT SHIFT
050684,002622: 00,3475 30156 DCA MPAC +1 # COUNT (FOR TERMINAL UNNORMALIZATION).
050685,002623: 00,3476 20156 DAS MPAC +1
050686,002624: 00,3477 60154 AD MPAC
050687,002625: 00,3500 26154 ADS MPAC # (NO OVERFLOW).
050688,002626:
050689,002627: 00,3501 24135 SQRTNORM INCR MPTEMP # FIRST TIME THROUGH, JUST SHIFT LEFT 1
050690,002628: 00,3502 00006 EXTEND # (PUTS IN EFFECTIVE RIGHT SHIFT SINCE
050691,002629: 00,3503 30156 DCA MPAC +1 # WE WANT MPAC/2).
050692,002630: 00,3504 20156 DAS MPAC +1
050693,002631: 00,3505 60154 AD MPAC
050694,002632: 00,3506 26154 ADS MPAC # (AGAIN NO OVERFLOW).
050695,002633: 00,3507 60000 DOUBLE
050696,002634: 00,3510 54022 TS CYL
050697,002635:
050698,002636: 00,3511 10022 NORMTEST CCS CYL # SEE IF ARGUMENT NOW NORMALIZED AT
050699,002637: 00,3512 10022 CCS CYL # GREATER THAN .125.
050700,002638: 00,3513 13474 TCF SQRTNM2 # NO - SHIFT LEFT 2 MORE AND TRY AGAIN.
050701,002639: 00,3514 13416 TCF ARGHI # YES - NOW BETWEEN .5 AND .25.
050702,002640: 00,3515 13467 TCF ARGLO # ARGUMENT NOW BETWEEN .25 AND .125.
050703,002641:
Page 1157 |
050705,002643: # TRIGONOMETRIC FUNCTION PACKAGE.
050706,002644: # THE FOLLOWING TRIGONOMETRIC FUNCTIONS ARE AVAILABLE AS INTERPRETIVE OPERATIONS:
050707,002645: # 1. SIN COMPUTES (1/2)SINE(2 PI MPAC).
050708,002646: # 2. COS COMPUTES (1/2)COSINE(2 PI MPAC).
050709,002647: # 3. ASIN COMPUTES (1/2PI)ARCSINE(2 MPAC).
050710,002648: # 4. ACOS COMPUTES (1/2PI)ARCCOSINE(2 MPAC).
050711,002649:
050712,002650: # SIN-ASIN AND COS-ACOS ARE MUTUALLY INVERSE, IE SIN(ASIN(X)) = X.
050713,002651:
050714,002652: 00,3516 06672 COSINE TC BRANCH # FINDS COSINE USING THE IDENTITY
050715,002653: 00,3517 13522 TCF +3 # COS(X) = SIN(PI/2 - ABS(X)).
050716,002654: 00,3520 13525 TCF PRESINE
050717,002655: 00,3521 13525 TCF PRESINE
050718,002656:
050719,002657: 00,3522 00006 +3 EXTEND
050720,002658: 00,3523 40155 DCS MPAC
050721,002659: 00,3524 52155 DXCH MPAC
050722,002660:
050723,002661: 00,3525 34676 PRESINE CAF QUARTER # PI/2 SCALED.
050724,002662: 00,3526 26154 ADS MPAC
050725,002663:
050726,002664: 00,3527 52155 SINE DXCH MPAC # DOUBLE ARGUMENT.
050727,002665: 00,3530 20001 DDOUBL
050728,002666: 00,3531 54000 OVSK # SEE IF OVERFLOW PRESENT.
050729,002667: 00,3532 13535 TCF +3 # IF NOT, ARGUMENT OK AS IS.
050730,002668:
050731,002669: 00,3533 00006 EXTEND # IF SO, WE LOST (OR GAINED) PI, SO
050732,002670: 00,3534 40001 DCOM # COMPLEMENT MPAC USING THE IDENTITY
050733,002671: # SIN(X-(+)PI) = SIN(-X).
050734,002672: 00,3535 52155 +3 DXCH MPAC
050735,002673: 00,3536 30154 CA MPAC # SEE IF ARGUMENT GREATER THAN .5 IN
050736,002674: 00,3537 60000 DOUBLE # MAGNITUDE. IF SO, REDUCE IT TO LESS THAN
050737,002675: 00,3540 54001 TS L # .5 (+-PI/2 SCALED) AS FOLLOWS:
050738,002676: 00,3541 13552 TCF SN1
050739,002677:
050740,002678: 00,3542 50000 INDEX A # IF POSITIVE, FORM PI - X, IF NEGATIVE
050741,002679: 00,3543 34674 CAF NEG1/2 +1 # USE -PI -X.
050742,002680: 00,3544 60000 DOUBLE
050743,002681: 00,3545 00006 EXTEND
050744,002682: 00,3546 60154 SU MPAC # GUARANTEED NO OVERFLOW.
050745,002683: 00,3547 54154 TS MPAC
050746,002684: 00,3550 40155 CS MPAC +1
050747,002685: 00,3551 54155 TS MPAC +1
050748,002686:
Page 1158 |
050750,002688: 00,3552 00006 SN1 EXTEND # SET UP TO EVALUATE HASTINGS POLYNOMIAL
050751,002689: 00,3553 30155 DCA MPAC
050752,002690: 00,3554 52134 DXCH BUF2
050753,002691: 00,3555 03300 TC DSQSUB # SQUARE MPAC.
050754,002692:
050755,002693: 00,3556 07171 TC POLY # EVALUATE FOURTH ORDER POLYNOMIAL.
050756,002694: 00,3557 00003 DEC 3 B-14
050757,002695: 00,3560 14441 37325 2DEC +.3926990796
050758,002696: 00,3562 53250 60764 2DEC -.6459637111
050759,002697: 00,3564 12146 21276 2DEC +.318758717
050760,002698: 00,3566 75466 71471 2DEC -.074780249
050761,002699: 00,3570 00236 32757 2DEC +.009694988
050762,002700:
050763,002701: 00,3572 32470 CAF LBUF2 # MULTIPLY BY ARGUMENT AND SHIFT LEFT 2.
050764,002702: 00,3573 07055 TC DMPSUB -1
050765,002703:
050766,002704: 00,3574 00006 EXTEND
050767,002705: 00,3575 30156 DCA MPAC +1
050768,002706: 00,3576 20156 DAS MPAC +1
050769,002707: 00,3577 60154 AD MPAC
050770,002708: 00,3600 26154 ADS MPAC # NEITHER SHIFT OVERFLOWS.
050771,002709: 00,3601 00006 EXTEND
050772,002710: 00,3602 30156 DCA MPAC +1
050773,002711: 00,3603 20156 DAS MPAC +1
050774,002712: 00,3604 60154 AD MPAC
050775,002713: 00,3605 26154 ADS MPAC
050776,002714: 00,3606 16030 TCF DANZIG
050777,002715:
Page 1159 |
050779,002717: # ARCSIN/ARCCOS ROUTINE.
050780,002718:
050781,002719: 00,3607 33630 ARCSIN CAF LASINEX # COMPUTE ARCSIN BY USING THE IDENTITY
050782,002720: 00,3610 13612 TCF +2 # ARCSIN(X) = PI/2 - ARCCOS(X).
050783,002721:
050784,002722: 00,3611 33712 ARCCOS CAF LDANZIG # (EXITS IMMEDIATELY).
050785,002723: 00,3612 54136 TS ESCAPE
050786,002724: 00,3613 06672 TC BRANCH # TEST SIGN OF INPUT.
050787,002725: 00,3614 13624 TCF ACOSST # START IMMEDIATELY IF POSITIVE.
050788,002726: 00,3615 13726 TCF ACOSZERO # ARCCOS(0) = PI/2 = .25.
050789,002727: 00,3616 00006 EXTEND # IF NEGATIVE, USE THE IDENTITY
050790,002728: 00,3617 40155 DCS MPAC # ARCCOS(X) = PI - ARCCOS(-X), FORCING
050791,002729: 00,3620 52155 DXCH MPAC # ARGUMENT POSITIVE.
050792,002730: 00,3621 33731 CAF TCSUBTR # SET EXIT TO DO ABOVE BEFORE
050793,002731: 00,3622 56136 XCH ESCAPE # ARCSIN/ARCCOS CONSIDERATIONS.
050794,002732: 00,3623 54137 TS ESCAPE2
050795,002733:
050796,002734: 00,3624 44675 ACOSST CS HALF # TEST MAGNITUDE OF INPUT.
050797,002735: 00,3625 60154 AD MPAC
050798,002736: 00,3626 10000 CCS A
050799,002737: 00,3627 13720 TCF ACOSOVF # THIS IS PROBABLY AN OVERFLOW CASE.
050800,002738:
050801,002739: 00,3630 13706 LASINEX TCF ASINEX
050802,002740:
050803,002741: 00,3631 13641 TCF ACOSST2 # NO OVERFLOW - PROCEED.
050804,002742:
050805,002743: 00,3632 10155 CCS MPAC +1 # IF MAJOR PART IS .5, CALL ANSWER 0
050806,002744: 00,3633 34714 CAF ZERO # UNLESS MINOR PART NEGATIVE.
050807,002745: 00,3634 13636 TCF ACOS=0
050808,002746:
050809,002747: 00,3635 13641 TCF ACOSST2
050810,002748:
050811,002749: 00,3636 54155 ACOS=0 TS MPAC +1
050812,002750: 00,3637 54154 TS MPAC
050813,002751: 00,3640 00136 TC ESCAPE
050814,002752:
050815,002753: 00,3641 00006 ACOSST2 EXTEND # NOW THAT ARGUMENT IS IN PROPER RANGE,
050816,002754: 00,3642 40155 DCS MPAC # BEGIN COMPUTATION. USE HASTINGS
050817,002755: 00,3643 64675 AD HALF # APPROXIMATION ARCCOS(X) = SQRT(1-X)P(X)
050818,002756: 00,3644 52155 DXCH MPAC # IN A SCALED VERSION WHERE P(X) IS A
050819,002757: 00,3645 52134 DXCH BUF2 # SEVENTH ORDER POLYNOMIAL.
050820,002758:
050821,002759: 00,3646 03343 TC SQRTSUB # RETURNS WITH NORMALIZED SQUARE ROOT.
050822,002760:
050823,002761: 00,3647 10135 CCS MPTEMP # SEE IF UN-NORMALIZATION REQUIRED.
050824,002762: 00,3650 13713 TCF ACOSSHR # IF SO.
050825,002763:
Page 1160 |
050827,002765: 00,3651 52155 ACOS3 DXCH MPAC # SET UP FOR POLYNOMIAL EVALUATION.
050828,002766: 00,3652 52134 DXCH BUF2
050829,002767: 00,3653 52155 DXCH MPAC
050830,002768:
050831,002769: 00,3654 07171 TC POLY
050832,002770: 00,3655 00006 DEC 6 B-14
050833,002771: 00,3656 13240 23630 2DEC +.353553385 # COEFFICIENTS ARE C 2(+I)/PISQRT(2) WHERE
050834,002772: 00,3660 74721 47775 2DEC* -.0483017006 B+1* # I
050835,002773: 00,3662 02440 20237 2DEC* +.0200273085 B+2* # WHERE C STANDS FOR ORIGINAL COEFFS.
050836,002774: 00,3664 75067 70742 2DEC* -.0112931863 B+3*
050837,002775: 00,3666 03436 26756 2DEC* +.00695311612 B+4*
050838,002776: 00,3670 74037 57640 2DEC* -.00384617957 B+5*
050839,002777: 00,3672 03046 07143 2DEC* +.001501297736 B+6*
050840,002778: 00,3674 76654 42244 2DEC* -.000284160334 B+7*
050841,002779:
050842,002780: 00,3676 32470 CAF LBUF2 # DO FINAL MULTIPLY AND GO TO ANY
050843,002781: 00,3677 07055 TC DMPSUB -1 # EPILOGUE SEQUENCES.
050844,002782: 00,3700 00136 TC ESCAPE
050845,002783:
050846,002784: 00,3701 00006 SUBTR EXTEND # EPILOGUE FOR NEGATIVE INPUTS TO ARCCOS.
050847,002785: 00,3702 40155 DCS MPAC
050848,002786: 00,3703 64675 AD HALF # FORMS PI - ARCCOS(-X) = ARCCOS(X).
050849,002787: 00,3704 52155 DXCH MPAC
050850,002788: 00,3705 00137 TC ESCAPE2 # GO TO POSSIBLE ARCSIN EPILOGUE.
050851,002789:
050852,002790: 00,3706 00006 ASINEX EXTEND
050853,002791: 00,3707 40155 DCS MPAC # ARCSIN EPILOGUE - GET ARCSIN(X)
050854,002792: 00,3710 64676 AD QUARTER # = PI/2 - ARCCOS(X).
050855,002793: 00,3711 52155 DXCH MPAC
050856,002794: 00,3712 16030 LDANZIG TCF DANZIG
050857,002795:
Page 1161 |
050859,002797: 00,3713 50000 ACOSSHR INDEX A # THE SHIFT RIGHT IS LESS THAN 14 SINCE
050860,002798: 00,3714 34675 CAF BIT14 # THE INPUT WAS NON-ZERO DP.
050861,002799: 00,3715 54135 TS MPTEMP
050862,002800: 00,3716 02073 TC VSHRRND # DP SHIFT RIGHT AND ROUND.
050863,002801: 00,3717 13651 TCF ACOS3 # PROCEED.
050864,002802:
050865,002803: 00,3720 00006 ACOSOVF EXTEND # IF MAJOR PART WAS ONLY 1 MORE THAN .5,
050866,002804: 00,3721 13636 BZF ACOS=0 # CALL ANSWER ZERO.
050867,002805:
050868,002806: 00,3722 05537 ACOSABRT TC ALARM # IF OVERFLOW, CALL ANSWER ZERO BUT
050869,002807: 00,3723 01301 OCT 1301 # SOUND AN ALARM.
050870,002808:
050871,002809: 00,3724 34714 CAF ZERO
050872,002810: 00,3725 13636 TCF ACOS=0
050873,002811:
050874,002812: 00,3726 34676 ACOSZERO CAF QUARTER # ACOS(0) = PI/2.
050875,002813: 00,3727 13637 TCF ACOS=0 +1 # SET MPAC AND EXIT VIA ESCAPE.
050876,002814:
050877,002815: 00,3730 77763 NEG12 DEC -12 B-14
050878,002816: 00,3731 13701 TCSUBTR TCF SUBTR
050879,002817:
Page 1162 |
050881,002819: # THE FOLLOWING INSTRUCTIONS ARE AVAILABLE FOR SETTING, MODIFYING, AND BRANCHING ON INDEX REGISTERS:
050882,002820: # 1. AXT ADDRESS TO INDEX TRUE.
050883,002821: # 1. AXC ADDRESS TO INDEX COMPLEMENTED.
050884,002822: # 3. LXA LOAD INDEX FROM ERASABLE.
050885,002823: # 4. LXC LOAD INDEX COMPLEMENTED FROM ERASABLE.
050886,002824: # 5. SXA STORE INDEX IN ERASABLE.
050887,002825: # 6. XCHX EXCHANGE INDEX REIGSTER WITH ERASABLE.
050888,002826: # 7. INCR INCREMENT INDEX REGISTER.
050889,002827: # 8. XAD ERASABLE ADD TO INDEX REGISTER.
050890,002828: # 9. XSU ERASABLE SUBTRACT FROM INDEX REGISTER.
050891,002829: # 10. TIX BRANCH ON INDEX REGISTER AND DECREMENT.
050892,002830:
050893,002831: 01,2371 BANK 01
050894,002832:
050895,002833: 01,2371 COUNT 01/INTER
050896,002834:
050897,002835: 01,2371 02466 AXT TC TAGSUB # SELECT APPROPRIATE INDEX REGISTER.
050898,002836: 01,2372 30117 CA POLISH
050899,002837: 01,2373 50130 XSTORE INDEX INDEXLOC # CONTAINS C(FIXLOC) OR C(FIXLOC)+1.
050900,002838: 01,2374 54046 TS X1
050901,002839: 01,2375 16030 TCF DANZIG
050902,002840:
050903,002841: 01,2376 02466 AXC TC TAGSUB
050904,002842: 01,2377 40117 CS POLISH
050905,002843: 01,2400 02373 TC XSTORE
050906,002844:
050907,002845: 01,2401 02454 LXA TC 15ADRERS # LOAD INDEX REGISTER FROM ERASABLE.
050908,002846: 01,2402 50117 INDEX POLISH
050909,002847: 01,2403 30000 CA 0
050910,002848: 01,2404 12373 TCF XSTORE
050911,002849:
050912,002850: 01,2405 02454 LXC TC 15ADRERS # LOAD NDX REG FROM ERASABLE COMPLEMENTED.
050913,002851: 01,2406 50117 INDEX POLISH
050914,002852: 01,2407 40000 CS 0
050915,002853: 01,2410 12373 TCF XSTORE
050916,002854:
050917,002855: 01,2411 02454 SXA TC 15ADRERS # STORE INDEX REGISTER IN ERASABLE.
050918,002856: 01,2412 50130 INDEX INDEXLOC
050919,002857: 01,2413 30046 CA X1
050920,002858: 01,2414 50117 MSTORE1 INDEX POLISH
050921,002859: 01,2415 54000 TS 0
050922,002860: 01,2416 16030 TCF DANZIG
050923,002861:
Page 1163 |
050925,002863: 01,2417 02454 XCHX TC 15ADRERS # EXCHANGE INDEX REGISTER WITH ERASABLE.
050926,002864: 01,2420 50117 INDEX POLISH
050927,002865: 01,2421 30000 CA 0
050928,002866: 01,2422 50130 INDEX INDEXLOC
050929,002867: 01,2423 56046 XCH X1
050930,002868: 01,2424 12414 TCF MSTORE1
050931,002869:
050932,002870: 01,2425 02454 XAD TC 15ADRERS # ADD ERASABLE TO INDEX REGISTER.
050933,002871: 01,2426 50117 INDEX POLISH
050934,002872: 01,2427 30000 CA 0
050935,002873: 01,2430 50130 XAD2 INDEX INDEXLOC
050936,002874: 01,2431 26046 ADS X1 # IGNORING OVERFLOWS.
050937,002875: 01,2432 16030 TCF DANZIG
050938,002876:
050939,002877: 01,2433 02466 INCR TC TAGSUB # INCREMENT INDEX REGISTER.
050940,002878: 01,2434 30117 CA POLISH
050941,002879: 01,2435 12430 TCF XAD2
050942,002880:
050943,002881: 01,2436 02454 XSU TC 15ADRERS # SUBTRACT ERASABLE FROM INDEX REGISTER.
050944,002882: 01,2437 50117 INDEX POLISH
050945,002883: 01,2440 40000 CS 0
050946,002884: 01,2441 12430 TCF XAD2
050947,002885:
050948,002886: 01,2442 02466 TIX TC TAGSUB # BRANCH AND DECREMENT ON INDEX.
050949,002887: 01,2443 50130 INDEX INDEXLOC
050950,002888: 01,2444 40050 CS S1
050951,002889: 01,2445 50130 INDEX INDEXLOC
050952,002890: 01,2446 60046 AD X1
050953,002891: 01,2447 00006 EXTEND # NO OPERATION IF DECREMENTED INDEX IS
050954,002892: 01,2450 66030 BZMF DANZIG # NEGATIVE OR ZERO.
050955,002893:
050956,002894: 01,2451 50130 DOTIXBR INDEX INDEXLOC
050957,002895: 01,2452 56046 XCH X1 # IGNORING OVERFLOWS.
050958,002896:
050959,002897: 01,2453 16615 TCF GOTO # DO THE BRANCH USING THE CADR IN POLISH.
050960,002898:
Page 1164 |
050962,002900: # SUBROUTINE TO CONVERT AN ERASABLE ADDRESS (11 BITS) TO AN EBANK SETTING AND SUBADDRESS.
050963,002901:
050964,002902: 01,2454 40117 15ADRERS CS POLISH
050965,002903: 01,2455 64727 AD DEC45
050966,002904: 01,2456 10000 CCS A # DOES THE ADDRESS POINT TO THE WORK AREA?
050967,002905: 01,2457 30120 CA FIXLOC # YES. ADD FIXLOC. EBANK OK AS IS.
050968,002906: 01,2460 12465 TCF +5
050969,002907:
050970,002908: 01,2461 34744 CA OCT1400 # NO. SET EBANK & MAKE UP SUBADDRESS.
050971,002909: 01,2462 56117 XCH POLISH
050972,002910: 01,2463 54003 TS EBANK
050973,002911: 01,2464 74373 MASK LOW8
050974,002912: 01,2465 26117 +5 ADS POLISH # FALL INTO TAGSUB, AND RETURN VIA Q.
050975,002913:
050976,002914: # SUBROUTINE WHICH SETS THE ADDRESS OF THE SPECIFIED INDEX IN INDEXLOC. (ACTUALLY, THE ADDRESS -38D.)
050977,002915:
050978,002916: 01,2466 30120 TAGSUB CA FIXLOC
050979,002917: 01,2467 54130 TS INDEXLOC
050980,002918:
050981,002919: 01,2470 10020 CCS CYR # BIT 15 SPECIFIES INDEX.
050982,002920: 01,2471 24130 INCR INDEXLOC # 0 MEANS USE X2.
050983,002921: 01,2472 00002 TC Q
050984,002922: 01,2473 00002 TC Q # 1 FOR X1.
050985,002923:
Page 1165 |
050987,002925: # MISCELLANEOUS OPERATION CODES WITH DIRECT ADDRESSES. INCLUDED HERE ARE:
050988,002926: # 1. ITA STORE QPRET (RETURN ADDRESS) IN ERASABLE.
050989,002927: # 2. CALL CALL A SUBROUTINE, LEAVING RETURN IN QPRET.
050990,002928: # 3. RTB RETURN TO BASIC LANGUAGE AT THE GIVEN ADDRESS.
050991,002929: # 4. BHIZ BRANCH IF THE HIGHORDER OF MPAC IS ZERO (SINGLE PRECISION).
050992,002930: # 5. BOV BRANCH ON OVERFLOW.
050993,002931: # 6. GOTO SIMPLE SEQUENCE CHANGE.
050994,002932:
050995,002933: 01,2474 10020 RTB/BHIZ CCS CYR
050996,002934: 01,2475 30117 RTB CA POLISH
050997,002935: 01,2476 04560 TC SWCALL -1 # SO A "TC Q" FROM ROUTINE LEADS TO DANZIG
050998,002936:
050999,002937: 01,2477 10154 BHIZ CCS MPAC
051000,002938: 01,2500 16030 TCF DANZIG
051001,002939: 01,2501 16615 TCF GOTO
051002,002940: 01,2502 16030 TCF DANZIG
051003,002941: 01,2503 16615 TCF GOTO
051004,002942:
051005,002943: 01,2504 10121 BOV(B) CCS OVFIND # BRANCH ON OVERFLOW TO BASIC OR INTERP.
051006,002944: 01,2505 12507 TCF +2
051007,002945: 01,2506 16030 TCF DANZIG
051008,002946: 01,2507 54121 TS OVFIND
051009,002947: 01,2510 10020 CCS CYR
051010,002948: 01,2511 12475 TCF RTB # IF BASIC.
051011,002949: 01,2512 00360 B5TOBB OCT 360
051012,002950: 01,2513 16615 TCF GOTO
051013,002951:
Page 1166 |
051015,002953: 01,2514 10020 BZE/GOTO CCS CYR # SEE WHICH OP-CODE IS DESIRED.
051016,002954: 01,2515 06672 TC BRANCH # DO BZE.
051017,002955: 01,2516 16030 TCF DANZIG
051018,002956: 01,2517 16615 TCF GOTO # DO GOTO.
051019,002957: 01,2520 16030 TCF DANZIG
051020,002958:
051021,002959: 01,2521 10020 BPL/BMN CCS CYR
051022,002960: 01,2522 12530 TCF BPL
051023,002961: 01,2523 12000 5B10 DEC 5 B+10 # SHIFTS OP CODE IN SWITCH INSTRUCTION ADR
051024,002962:
051025,002963: 01,2524 06672 TC BRANCH # DO BMN.
051026,002964: 01,2525 16030 TCF DANZIG
051027,002965: 01,2526 16030 TCF DANZIG
051028,002966: 01,2527 16615 TCF GOTO # ONLY IF NNZ.
051029,002967:
051030,002968: 01,2530 06672 BPL TC BRANCH
051031,002969: 01,2531 16615 TCF GOTO # IF POSITIVE OR ZERO.
051032,002970: 01,2532 16615 TCF GOTO
051033,002971: 01,2533 16030 TCF DANZIG
051034,002972:
051035,002973: 01,2534 10020 CALL/ITA CCS CYR
051036,002974: 01,2535 16607 TCF CALL
051037,002975:
051038,002976: 01,2536 05640 TC CCSHOLE
051039,002977: 01,2537 02454 TC 15ADRERS # STORE QPRET. (TAGSUB AFTER 15ADRERS IS
051040,002978: 01,2540 50120 INDEX FIXLOC # SLOW IN THIS CASE, BUT SAVES STORAGE.)
051041,002979: 01,2541 30052 CA QPRET
051042,002980: 01,2542 12414 TCF MSTORE1
051043,002981:
Page 1167 |
051045,002983: # THE FOLLOWING OPERATIONS ARE AVAILABLE FOR ALTERING AND TESTING INTERPRETIVE SWITCHES:
051046,002984: # 00 BONSET SET A SWITCH AND DO A GOTO IF IT WAS ON.
051047,002985: # 01 SETGO SET A SWITCH AND DO A GOTO.
051048,002986: # 02 BOFSET SET A SWITCH AND DOA GOTO IF IT WAS OFF
051049,002987: # 03 SET SET A SWITCH.
051050,002988: # 04 BONINV INVERT A SWITCH AND BRANCH IF IT WAS ON.
051051,002989: # 05 INVGO INVERT A SWITCH AND DO A GOTO.
051052,002990: # 06 BOFINV INVERT A SWITCH AND BRANCH IF IT WAS OFF
051053,002991: # 07 INVERT INVERT A SWITCH.
051054,002992: # 10 BONCLR CLEAR A SWITCH AND BRANCH IF IT WAS ON.
051055,002993: # 11 CLRGO CLEAR A SWITCH AND DO A GOTO.
051056,002994: # 12 BOFCLR CLEAR A SWITCH AND BRANCH IF IT WAS OFF.
051057,002995: # 13 CLEAR CLEAR A SWITCH.
051058,002996: # 14 BON BRANCH IF A SWITCH WAS ON.
051059,002997: # 16 BOFF BRANCH IF A SWITCH WAS OFF.
051060,002998: # THE ADDRESS SUPPLIED WITH THE SWITCH INSTRUCTION IS INTERPRETED AS FOLLOWS:
051061,002999: # BITS 1-4 SWITCH BIT NUMBER (1-15).
051062,003000: # BITS 5-8 SWITCH OPERATION NUMBER.
051063,003001: # BITS 9- SWITCH WORD NUMBER (UP TO 64 SWITCH WORDS).
051064,003002: # THE ADDRESS ITSELF IS MADE UP BY THE YUL SYSTEM ASSEMBLER. THE BRANCH INSTRUCTIONS REQUIRE TWO
051065,003003: # ADDRESSES, THE SECOND TAKEN AS THE DIRECT (OR INDIRECT IF IN ERASABLE) ADDRESS OF THE BRANCH.
051066,003004:
051067,003005: 01,2543 34721 SWITCHES CAF LOW4 # LEAVE THE SWITCH BIT IN SWBIT.
051068,003006: 01,2544 70117 MASK POLISH
051069,003007: 01,2545 50000 INDEX A
051070,003008: 01,2546 34674 CAF BIT15 # (NUMBER FROM LEFT TO RIGHT.)
051071,003009: 01,2547 54131 TS SWBIT
051072,003010:
051073,003011: 01,2550 34704 CAF BIT7 # LEAVE THE SWITCH NUMBER IN SWWORD.
051074,003012: 01,2551 00006 EXTEND
051075,003013: 01,2552 70117 MP POLISH
051076,003014: 01,2553 54130 TS SWWORD
051077,003015:
051078,003016: 01,2554 00004 INHINT # DURING SWITCH CHANGE SO RUPT CAN USE TOO
051079,003017: 01,2555 50000 INDEX A # LEAVE THE SWITCH WORD ITSELF IN L.
051080,003018: 01,2556 30074 CA STATE
051081,003019: 01,2557 54002 TS Q # Q WILL BE USED AS A CHANNEL.
Page 1168 |
051083,003021: 01,2560 34700 CAF BIT11
051084,003022: 01,2561 00006 EXTEND # DISPATCH SWITCH BIT OPERATION AS IN BITS
051085,003023: 01,2562 70117 MP POLISH # 7-8 OF POLISH.
051086,003024: 01,2563 72623 MASK B3TOB4 # GETS 4X2-BIT CODE.
051087,003025: 01,2564 50000 INDEX A
051088,003026: 01,2565 12566 TCF +1
051089,003027:
051090,003028: 01,2566 30131 +1 CA SWBIT # 00 - SET SWITCH IN QUESTION.
051091,003029: 01,2567 00006 EXTEND
051092,003030: 01,2570 04002 ROR QCHAN
051093,003031: 01,2571 12600 TCF SWSTORE
051094,003032:
051095,003033: 01,2572 30131 +5 CA SWBIT # 01 - INVERT SWITCH.
051096,003034: 01,2573 00006 EXTEND
051097,003035: 01,2574 06002 RXOR QCHAN
051098,003036: 01,2575 12600 TCF SWSTORE
051099,003037:
051100,003038: 01,2576 40131 +9D CS SWBIT # 10 - CLEAR.
051101,003039: 01,2577 70002 MASK Q
051102,003040: 01,2600 50130 SWSTORE INDEX SWWORD
051103,003041: 01,2601 54074 TS STATE # NEW SWITCH WORD.
051104,003042:
Page 1169 |
051106,003044: 01,2602 00003 +13D RELINT # 11 - NOOP.
051107,003045: 01,2603 34676 CAF BIT13
051108,003046: 01,2604 00006 EXTEND # DISPATCH SEQUCE CHANGING OR BRANCHING
051109,003047: 01,2605 70117 MP POLISH # CODE.
051110,003048: 01,2606 72623 MASK B3TOB4
051111,003049: 01,2607 50000 INDEX A
051112,003050: 01,2610 12611 TCF +1 # ORIGINALLY STORED IN BITS 5-6.
051113,003051:
051114,003052: 01,2611 40002 +1 CS Q # 00 - BRANCH IF ON.
051115,003053: 01,2612 70131 TEST MASK SWBIT
051116,003054: 01,2613 10000 CCS A
051117,003055: 01,2614 12624 TCF SWSKIP
051118,003056:
051119,003057: 01,2615 16664 +5 TCF SWBRANCH # 01 - GO TO.
051120,003058:
051121,003059: 01,2616 12624 TCF SWSKIP # HERE ONLY ON BIT 15.
051122,003060:
051123,003061: 01,2617 05640 TC CCSHOLE
051124,003062: 01,2620 05640 TC CCSHOLE
051125,003063:
051126,003064: 01,2621 30002 +9D CA Q # 10 - BRANCH IF OFF.
051127,003065: 01,2622 12612 TCF TEST
051128,003066:
051129,003067: 01,2623 00014 B3TOB4 OCT 0014
051130,003068: 01,2624 24164 SWSKIP INCR LOC
051131,003069:
051132,003070: 01,2625 01,2543 SW/ EQUALS SWITCHES
051133,003071:
051134,003072: 01,2625 16030 +13D TCF DANZIG # 11 - NOOP.
051135,003073:
End of include-file INTERPRETER.agc. Parent file is MAIN.agc