Source Code
001779,000001: # Copyright 2004 Ronald S. Burkey <info@sandroid.org>
001780,000002: #
001781,000003: # This file is part of yaAGC.
001782,000004:
001783,000005: # yaAGC is free software; you can redistribute it and/or modify
001784,000006: # it under the terms of the GNU General Public License as published by
001785,000007: # the Free Software Foundation; either version 2 of the License, or
001786,000008: # (at your option) any later version.
001787,000009:
001788,000010: # yaAGC is distributed in the hope that it will be useful,
001789,000011: # but WITHOUT ANY WARRANTY; without even the implied warranty of
001790,000012: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
001791,000013: # GNU General Public License for more details.
001792,000014:
001793,000015: # You should have received a copy of the GNU General Public License
001794,000016: # along with yaAGC; if not, write to the Free Software
001795,000017: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
001796,000018:
001797,000019: # Filename: ValidateAD.agc
001798,000020: # Purpose: This is the part of the Validation program that validates
001799,000021: # just the AD instruction.
001800,000022: # Mod history: 07/05/04 RSB. Began.
001801,000023:
001802,000024: 6252 24061 INCR ERRNUM
001803,000025:
001804,000026: # First, just add a bunch of stuff and compare.
001805,000027: # We start with -3*12345 (octal) and add 12345
001806,000028: # until we reach 3*12345.
001807,000029: 6253 37503 CA SMALNUM
001808,000030: 6254 54065 TS TEMPK # TEMPK is the addend.
001809,000031: 6255 37504 CA SMALRNUM
001810,000032: 6256 40000 COM
001811,000033: 6257 54064 TS TEMPJ # TEMPJ is the running sum.
001812,000034: 6260 37433 CA FIVE
001813,000035: 6261 24062 INCR ERRSUB
001814,000036: 6262 54063 ADLOOP TS TEMPI # TEMPI is loop counter.
001815,000037: 6263 30064 CA TEMPJ
001816,000038: 6264 60065 AD TEMPK
001817,000039: 6265 54000 OVSK # Should be no overflow.
001818,000040: 6266 16270 TCF AD1
001819,000041: 6267 16355 TCF MADERROR # ERRSUB==1
001820,000042: 6270 54064 AD1 TS TEMPJ
001821,000043: 6271 10063 CCS TEMPI
001822,000044: 6272 16262 TCF ADLOOP
001823,000045: # Check if correct.
001824,000046: 6273 24062 INCR ERRSUB
001825,000047: 6274 30064 CA TEMPJ
001826,000048: 6275 40000 COM
001827,000049: 6276 67504 AD SMALRNUM
001828,000050: 6277 00006 EXTEND
001829,000051: 6300 16302 BZF AD2
001830,000052: 6301 16355 TCF MADERROR # ERRSUB==2
001831,000053: 6302 AD2
001832,000054:
001833,000055: # Now check +- overflow.
001834,000056: 6302 24062 INCR ERRSUB
001835,000057: 6303 37443 CA MAXP
001836,000058: 6304 67430 AD ONE
001837,000059: 6305 54000 OVSK
001838,000060: 6306 16355 TCF MADERROR # ERRSUB==3
001839,000061: 6307 24062 INCR ERRSUB
001840,000062: 6310 54001 TS L
001841,000063: 6311 16312 NOOP
001842,000064: 6312 30001 CA L
001843,000065: 6313 54063 TS TEMPI
001844,000066: 6314 16315 NOOP
001845,000067: 6315 10001 CCS L
001846,000068: 6316 16322 TCF +4
001847,000069: 6317 16355 TCF MADERROR # ERRSUB==4
001848,000070: 6320 16355 TCF MADERROR
001849,000071: 6321 16355 TCF MADERROR
001850,000072: 6322 24062 INCR ERRSUB
001851,000073: 6323 10063 CCS TEMPI
001852,000074: 6324 16355 TCF MADERROR # ERRSUB==5
001853,000075: 6325 16330 TCF +3
001854,000076: 6326 16355 TCF MADERROR
001855,000077: 6327 16355 TCF MADERROR
001856,000078: 6330 24062 AD3 INCR ERRSUB
001857,000079: 6331 37447 CA MAXN
001858,000080: 6332 67424 AD NEGONE
001859,000081: 6333 54000 OVSK
001860,000082: 6334 16355 TCF MADERROR # ERRSUB==6
001861,000083: 6335 24062 INCR ERRSUB
001862,000084: 6336 54001 TS L
001863,000085: 6337 16340 NOOP
001864,000086: 6340 30001 CA L
001865,000087: 6341 54063 TS TEMPI
001866,000088: 6342 16343 NOOP
001867,000089: 6343 10001 CCS L
001868,000090: 6344 16345 NOOP
001869,000091: 6345 16355 TCF MADERROR
001870,000092: 6346 16350 TCF +2
001871,000093: 6347 16355 TCF MADERROR # ERRSUB==7
001872,000094: 6350 10063 CCS TEMPI
001873,000095: 6351 16352 NOOP
001874,000096: 6352 16353 NOOP
001875,000097: 6353 16355 TCF MADERROR # ERRSUB==7
001876,000098:
001877,000099: # We don't need to check "AD A", as this is checked
001878,000100: # for the DOUBLE instruction.
001879,000101:
001880,000102: 6354 16356 TCF +2
001881,000103: 6355 07240 MADERROR TC ERRORDSP
001882,000104: 6356 30007 CA ZEROES
001883,000105: 6357 54062 TS ERRSUB
001884,000106:
End of include-file ValidateAD.agc. Parent file is Validation.agc