Source Code

000881,000001: # Copyright 2004 Ronald S. Burkey <info@sandroid.org> 000882,000002: # 000883,000003: # This file is part of yaAGC. 000884,000004: 000885,000005: # yaAGC is free software; you can redistribute it and/or modify 000886,000006: # it under the terms of the GNU General Public License as published by 000887,000007: # the Free Software Foundation; either version 2 of the License, or 000888,000008: # (at your option) any later version. 000889,000009: 000890,000010: # yaAGC is distributed in the hope that it will be useful, 000891,000011: # but WITHOUT ANY WARRANTY; without even the implied warranty of 000892,000012: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 000893,000013: # GNU General Public License for more details. 000894,000014: 000895,000015: # You should have received a copy of the GNU General Public License 000896,000016: # along with yaAGC; if not, write to the Free Software 000897,000017: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 000898,000018: 000899,000019: # Filename: ValidateADS.agc 000900,000020: # Purpose: This is the part of the validation suite which tests the 000901,000021: # ADS instruction. 000902,000022: # Mod history: 07/05/04 RSB. Began. 000903,000023: # 07/08/04 RSB. + and - overflow now block BZF. 000904,000024: 000905,000025: 5074 24061 INCR ERRNUM 000906,000026: 000907,000027: 5075 24062 INCR ERRSUB # 1 000908,000028: # First, start with -3*12345, and then add 12345 until 000909,000029: # we reach 3*12345, and check. 000910,000030: 5076 37712 CA SMALRNUM # 3 * 12345 (octal) 000911,000031: 5077 40000 COM # -3 * 12345. 000912,000032: 5100 54064 TS TEMPJ # TEMPJ is running sum. 000913,000033: 5101 37640 CA FIVE 000914,000034: 5102 54063 ADSLOOP1 TS TEMPI # TEMPI is loop counter. 000915,000035: 5103 37711 CA SMALNUM 000916,000036: 5104 26064 ADS TEMPJ 000917,000037: 5105 54000 OVSK # Overflow? 000918,000038: 5106 15110 TCF ADS1 000919,000039: 5107 15233 TCF VDSERROR 000920,000040: 5110 00006 ADS1 EXTEND # A and TEMPJ match? 000921,000041: 5111 60064 SU TEMPJ 000922,000042: 5112 00006 EXTEND 000923,000043: 5113 15115 BZF ADS2 000924,000044: 5114 15233 TCF VDSERROR 000925,000045: 5115 10063 ADS2 CCS TEMPI 000926,000046: 5116 15102 TCF ADSLOOP1 000927,000047: 5117 24062 INCR ERRSUB # 2 000928,000048: 5120 24062 INCR ERRSUB # 3 000929,000049: # Now compare. 000930,000050: 5121 37712 CA SMALRNUM 000931,000051: 5122 00006 EXTEND 000932,000052: 5123 60064 SU TEMPJ 000933,000053: 5124 00006 EXTEND 000934,000054: 5125 15127 BZF ADS3 000935,000055: 5126 15233 TCF VDSERROR 000936,000056: 5127 ADS3 000937,000057: 000938,000058: 5127 24062 INCR ERRSUB # 4 000939,000059: # Same, but in the opposite direction. 000940,000060: 5130 37712 CA SMALRNUM # 3 * 12345 (octal) 000941,000061: 5131 54064 TS TEMPJ # TEMPJ is running sum. 000942,000062: 5132 37640 CA FIVE 000943,000063: 5133 54063 ADSLOOP2 TS TEMPI # TEMPI is loop counter. 000944,000064: 5134 37711 CA SMALNUM 000945,000065: 5135 40000 COM 000946,000066: 5136 26064 ADS TEMPJ 000947,000067: 5137 54000 OVSK # Overflow? 000948,000068: 5140 15142 TCF ADS4 000949,000069: 5141 15233 TCF VDSERROR 000950,000070: 5142 00006 ADS4 EXTEND # A and TEMPJ match? 000951,000071: 5143 60064 SU TEMPJ 000952,000072: 5144 00006 EXTEND 000953,000073: 5145 15147 BZF ADS5 000954,000074: 5146 15233 TCF VDSERROR 000955,000075: 5147 10063 ADS5 CCS TEMPI 000956,000076: 5150 15133 TCF ADSLOOP2 000957,000077: 5151 24062 INCR ERRSUB # 5 000958,000078: 5152 24062 INCR ERRSUB # 6 000959,000079: # Now compare. 000960,000080: 5153 37712 CA SMALRNUM 000961,000081: 5154 40000 COM 000962,000082: 5155 00006 EXTEND 000963,000083: 5156 60064 SU TEMPJ 000964,000084: 5157 00006 EXTEND 000965,000085: 5160 15162 BZF ADS6 000966,000086: 5161 15233 TCF VDSERROR 000967,000087: 5162 ADS6 000968,000088: 000969,000089: 5162 24062 INCR ERRSUB # 7 000970,000090: # The steps above didn't generate overflow. We want to 000971,000091: # check out overflow now. 000972,000092: # + Overflow 000973,000093: 5163 37635 CA ONE 000974,000094: 5164 54001 TS L 000975,000095: 5165 37652 CA MAXP-1 000976,000096: 5166 60001 AD L 000977,000097: 5167 54000 OVSK 000978,000098: 5170 15172 TCF ADS7 000979,000099: 5171 15233 TCF VDSERROR 000980,000100: 5172 24062 ADS7 INCR ERRSUB # 10 octal 000981,000101: 5173 60001 AD L 000982,000102: 5174 54000 OVSK 000983,000103: 5175 15233 TCF VDSERROR 000984,000104: 5176 24062 INCR ERRSUB # 11 OCTAL 000985,000105: 5177 00006 EXTEND 000986,000106: 5200 15233 BZF VDSERROR 000987,000107: 5201 ADS8 000988,000108: 5201 24062 INCR ERRSUB # 12 000989,000109: # - Overflow 000990,000110: 5202 37631 CA NEGONE 000991,000111: 5203 54001 TS L 000992,000112: 5204 37656 CA MAXN-1 000993,000113: 5205 60001 AD L 000994,000114: 5206 54000 OVSK 000995,000115: 5207 15211 TCF ADS9 000996,000116: 5210 15233 TCF VDSERROR 000997,000117: 5211 24062 ADS9 INCR ERRSUB # 13 000998,000118: 5212 60001 AD L 000999,000119: 5213 54000 OVSK 001000,000120: 5214 15233 TCF VDSERROR 001001,000121: 5215 24062 INCR ERRSUB # 14 001002,000122: 5216 00006 EXTEND 001003,000123: 5217 15233 BZF VDSERROR 001004,000124: 5220 ADS10 001005,000125: 001006,000126: 5220 24062 INCR ERRSUB # 15 001007,000127: # Check that X + -X = -0. This isn't spec'd, but I've seen 001008,000128: # a comment somewhere that it is true. 001009,000129: 5221 37711 CA SMALNUM 001010,000130: 5222 40000 COM 001011,000131: 5223 54001 TS L 001012,000132: 5224 37711 CA SMALNUM 001013,000133: 5225 60001 AD L 001014,000134: 5226 10000 CCS A 001015,000135: 5227 15233 TCF VDSERROR 001016,000136: 5230 15233 TCF VDSERROR 001017,000137: 5231 15233 TCF VDSERROR 001018,000138: 001019,000139: 5232 15234 TCF +2 001020,000140: 5233 07437 VDSERROR TC ERRORDSP 001021,000141: 5234 30007 CA ZEROES 001022,000142: 5235 54062 TS ERRSUB 001023,000143: End of include-file ValidateADS.agc. Parent file is Validation.agc