Source Code

001837,000001: # Copyright 2004 Ronald S. Burkey <info@sandroid.org> 001838,000002: # 001839,000003: # This file is part of yaAGC. 001840,000004: 001841,000005: # yaAGC is free software; you can redistribute it and/or modify 001842,000006: # it under the terms of the GNU General Public License as published by 001843,000007: # the Free Software Foundation; either version 2 of the License, or 001844,000008: # (at your option) any later version. 001845,000009: 001846,000010: # yaAGC is distributed in the hope that it will be useful, 001847,000011: # but WITHOUT ANY WARRANTY; without even the implied warranty of 001848,000012: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 001849,000013: # GNU General Public License for more details. 001850,000014: 001851,000015: # You should have received a copy of the GNU General Public License 001852,000016: # along with yaAGC; if not, write to the Free Software 001853,000017: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 001854,000018: 001855,000019: # Filename: ValidateAD.agc 001856,000020: # Purpose: This is the part of the Validation program that validates 001857,000021: # just the AD instruction. 001858,000022: # Mod history: 07/05/04 RSB. Began. 001859,000023: 001860,000024: 6252 24061 INCR ERRNUM 001861,000025: 001862,000026: # First, just add a bunch of stuff and compare. 001863,000027: # We start with -3*12345 (octal) and add 12345 001864,000028: # until we reach 3*12345. 001865,000029: 6253 37711 CA SMALNUM 001866,000030: 6254 54065 TS TEMPK # TEMPK is the addend. 001867,000031: 6255 37712 CA SMALRNUM 001868,000032: 6256 40000 COM 001869,000033: 6257 54064 TS TEMPJ # TEMPJ is the running sum. 001870,000034: 6260 37640 CA FIVE 001871,000035: 6261 24062 INCR ERRSUB 001872,000036: 6262 54063 ADLOOP TS TEMPI # TEMPI is loop counter. 001873,000037: 6263 30064 CA TEMPJ 001874,000038: 6264 60065 AD TEMPK 001875,000039: 6265 54000 OVSK # Should be no overflow. 001876,000040: 6266 16270 TCF AD1 001877,000041: 6267 16355 TCF MADERROR # ERRSUB==1 001878,000042: 6270 54064 AD1 TS TEMPJ 001879,000043: 6271 10063 CCS TEMPI 001880,000044: 6272 16262 TCF ADLOOP 001881,000045: # Check if correct. 001882,000046: 6273 24062 INCR ERRSUB 001883,000047: 6274 30064 CA TEMPJ 001884,000048: 6275 40000 COM 001885,000049: 6276 67712 AD SMALRNUM 001886,000050: 6277 00006 EXTEND 001887,000051: 6300 16302 BZF AD2 001888,000052: 6301 16355 TCF MADERROR # ERRSUB==2 001889,000053: 6302 AD2 001890,000054: 001891,000055: # Now check +- overflow. 001892,000056: 6302 24062 INCR ERRSUB 001893,000057: 6303 37651 CA MAXP 001894,000058: 6304 67635 AD ONE 001895,000059: 6305 54000 OVSK 001896,000060: 6306 16355 TCF MADERROR # ERRSUB==3 001897,000061: 6307 24062 INCR ERRSUB 001898,000062: 6310 54002 TS Q 001899,000063: 6311 16312 NOOP 001900,000064: 6312 30002 CA Q 001901,000065: 6313 54063 TS TEMPI 001902,000066: 6314 16315 NOOP 001903,000067: 6315 10002 CCS Q 001904,000068: 6316 16322 TCF +4 001905,000069: 6317 16355 TCF MADERROR # ERRSUB==4 001906,000070: 6320 16355 TCF MADERROR 001907,000071: 6321 16355 TCF MADERROR 001908,000072: 6322 24062 INCR ERRSUB 001909,000073: 6323 10063 CCS TEMPI 001910,000074: 6324 16355 TCF MADERROR # ERRSUB==5 001911,000075: 6325 16330 TCF +3 001912,000076: 6326 16355 TCF MADERROR 001913,000077: 6327 16355 TCF MADERROR 001914,000078: 6330 24062 AD3 INCR ERRSUB 001915,000079: 6331 37655 CA MAXN 001916,000080: 6332 67631 AD NEGONE 001917,000081: 6333 54000 OVSK 001918,000082: 6334 16355 TCF MADERROR # ERRSUB==6 001919,000083: 6335 24062 INCR ERRSUB 001920,000084: 6336 54002 TS Q 001921,000085: 6337 16340 NOOP 001922,000086: 6340 30002 CA Q 001923,000087: 6341 54063 TS TEMPI 001924,000088: 6342 16343 NOOP 001925,000089: 6343 10002 CCS Q 001926,000090: 6344 16345 NOOP 001927,000091: 6345 16355 TCF MADERROR 001928,000092: 6346 16350 TCF +2 001929,000093: 6347 16355 TCF MADERROR # ERRSUB==7 001930,000094: 6350 10063 CCS TEMPI 001931,000095: 6351 16352 NOOP 001932,000096: 6352 16353 NOOP 001933,000097: 6353 16355 TCF MADERROR # ERRSUB==7 001934,000098: 001935,000099: # We don't need to check "AD A", as this is checked 001936,000100: # for the DOUBLE instruction. 001937,000101: 001938,000102: 6354 16356 TCF +2 001939,000103: 6355 07437 MADERROR TC ERRORDSP 001940,000104: 6356 30007 CA ZEROES 001941,000105: 6357 54062 TS ERRSUB 001942,000106: End of include-file ValidateAD.agc. Parent file is Validation.agc