Source Code

000823,000001: # Copyright 2004 Ronald S. Burkey <info@sandroid.org> 000824,000002: # 000825,000003: # This file is part of yaAGC. 000826,000004: 000827,000005: # yaAGC is free software; you can redistribute it and/or modify 000828,000006: # it under the terms of the GNU General Public License as published by 000829,000007: # the Free Software Foundation; either version 2 of the License, or 000830,000008: # (at your option) any later version. 000831,000009: 000832,000010: # yaAGC is distributed in the hope that it will be useful, 000833,000011: # but WITHOUT ANY WARRANTY; without even the implied warranty of 000834,000012: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 000835,000013: # GNU General Public License for more details. 000836,000014: 000837,000015: # You should have received a copy of the GNU General Public License 000838,000016: # along with yaAGC; if not, write to the Free Software 000839,000017: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 000840,000018: 000841,000019: # Filename: ValidateADS.agc 000842,000020: # Purpose: This is the part of the validation suite which tests the 000843,000021: # ADS instruction. 000844,000022: # Mod history: 07/05/04 RSB. Began. 000845,000023: # 07/08/04 RSB. + and - overflow now block BZF. 000846,000024: 000847,000025: 5016 24061 INCR ERRNUM 000848,000026: 000849,000027: 5017 24062 INCR ERRSUB # 1 000850,000028: # First, start with -3*12345, and then add 12345 until 000851,000029: # we reach 3*12345, and check. 000852,000030: 5020 37504 CA SMALRNUM # 3 * 12345 (octal) 000853,000031: 5021 40000 COM # -3 * 12345. 000854,000032: 5022 54064 TS TEMPJ # TEMPJ is running sum. 000855,000033: 5023 37433 CA FIVE 000856,000034: 5024 54063 ADSLOOP1 TS TEMPI # TEMPI is loop counter. 000857,000035: 5025 37503 CA SMALNUM 000858,000036: 5026 26064 ADS TEMPJ 000859,000037: 5027 54000 OVSK # Overflow? 000860,000038: 5030 15032 TCF ADS1 000861,000039: 5031 15155 TCF VDSERROR 000862,000040: 5032 00006 ADS1 EXTEND # A and TEMPJ match? 000863,000041: 5033 60064 SU TEMPJ 000864,000042: 5034 00006 EXTEND 000865,000043: 5035 15037 BZF ADS2 000866,000044: 5036 15155 TCF VDSERROR 000867,000045: 5037 10063 ADS2 CCS TEMPI 000868,000046: 5040 15024 TCF ADSLOOP1 000869,000047: 5041 24062 INCR ERRSUB # 2 000870,000048: 5042 24062 INCR ERRSUB # 3 000871,000049: # Now compare. 000872,000050: 5043 37504 CA SMALRNUM 000873,000051: 5044 00006 EXTEND 000874,000052: 5045 60064 SU TEMPJ 000875,000053: 5046 00006 EXTEND 000876,000054: 5047 15051 BZF ADS3 000877,000055: 5050 15155 TCF VDSERROR 000878,000056: 5051 ADS3 000879,000057: 000880,000058: 5051 24062 INCR ERRSUB # 4 000881,000059: # Same, but in the opposite direction. 000882,000060: 5052 37504 CA SMALRNUM # 3 * 12345 (octal) 000883,000061: 5053 54064 TS TEMPJ # TEMPJ is running sum. 000884,000062: 5054 37433 CA FIVE 000885,000063: 5055 54063 ADSLOOP2 TS TEMPI # TEMPI is loop counter. 000886,000064: 5056 37503 CA SMALNUM 000887,000065: 5057 40000 COM 000888,000066: 5060 26064 ADS TEMPJ 000889,000067: 5061 54000 OVSK # Overflow? 000890,000068: 5062 15064 TCF ADS4 000891,000069: 5063 15155 TCF VDSERROR 000892,000070: 5064 00006 ADS4 EXTEND # A and TEMPJ match? 000893,000071: 5065 60064 SU TEMPJ 000894,000072: 5066 00006 EXTEND 000895,000073: 5067 15071 BZF ADS5 000896,000074: 5070 15155 TCF VDSERROR 000897,000075: 5071 10063 ADS5 CCS TEMPI 000898,000076: 5072 15055 TCF ADSLOOP2 000899,000077: 5073 24062 INCR ERRSUB # 5 000900,000078: 5074 24062 INCR ERRSUB # 6 000901,000079: # Now compare. 000902,000080: 5075 37504 CA SMALRNUM 000903,000081: 5076 40000 COM 000904,000082: 5077 00006 EXTEND 000905,000083: 5100 60064 SU TEMPJ 000906,000084: 5101 00006 EXTEND 000907,000085: 5102 15104 BZF ADS6 000908,000086: 5103 15155 TCF VDSERROR 000909,000087: 5104 ADS6 000910,000088: 000911,000089: 5104 24062 INCR ERRSUB # 7 000912,000090: # The steps above didn't generate overflow. We want to 000913,000091: # check out overflow now. 000914,000092: # + Overflow 000915,000093: 5105 37430 CA ONE 000916,000094: 5106 54001 TS L 000917,000095: 5107 37444 CA MAXP-1 000918,000096: 5110 60001 AD L 000919,000097: 5111 54000 OVSK 000920,000098: 5112 15114 TCF ADS7 000921,000099: 5113 15155 TCF VDSERROR 000922,000100: 5114 24062 ADS7 INCR ERRSUB # 10 octal 000923,000101: 5115 60001 AD L 000924,000102: 5116 54000 OVSK 000925,000103: 5117 15155 TCF VDSERROR 000926,000104: 5120 24062 INCR ERRSUB # 11 OCTAL 000927,000105: 5121 00006 EXTEND 000928,000106: 5122 15155 BZF VDSERROR 000929,000107: 5123 ADS8 000930,000108: 5123 24062 INCR ERRSUB # 12 000931,000109: # - Overflow 000932,000110: 5124 37424 CA NEGONE 000933,000111: 5125 54001 TS L 000934,000112: 5126 37450 CA MAXN-1 000935,000113: 5127 60001 AD L 000936,000114: 5130 54000 OVSK 000937,000115: 5131 15133 TCF ADS9 000938,000116: 5132 15155 TCF VDSERROR 000939,000117: 5133 24062 ADS9 INCR ERRSUB # 13 000940,000118: 5134 60001 AD L 000941,000119: 5135 54000 OVSK 000942,000120: 5136 15155 TCF VDSERROR 000943,000121: 5137 24062 INCR ERRSUB # 14 000944,000122: 5140 00006 EXTEND 000945,000123: 5141 15155 BZF VDSERROR 000946,000124: 5142 ADS10 000947,000125: 000948,000126: 5142 24062 INCR ERRSUB # 15 000949,000127: # Check that X + -X = -0. This isn't spec'd, but I've seen 000950,000128: # a comment somewhere that it is true. 000951,000129: 5143 37503 CA SMALNUM 000952,000130: 5144 40000 COM 000953,000131: 5145 54001 TS L 000954,000132: 5146 37503 CA SMALNUM 000955,000133: 5147 60001 AD L 000956,000134: 5150 10000 CCS A 000957,000135: 5151 15155 TCF VDSERROR 000958,000136: 5152 15155 TCF VDSERROR 000959,000137: 5153 15155 TCF VDSERROR 000960,000138: 000961,000139: 5154 15156 TCF +2 000962,000140: 5155 07240 VDSERROR TC ERRORDSP 000963,000141: 5156 30007 CA ZEROES 000964,000142: 5157 54062 TS ERRSUB 000965,000143: End of include-file ValidateADS.agc. Parent file is Validation.agc