Source Code

000387,000001: # Copyright 2004 Ronald S. Burkey <info@sandroid.org> 000388,000002: # 000389,000003: # This file is part of yaAGC. 000390,000004: 000391,000005: # yaAGC is free software; you can redistribute it and/or modify 000392,000006: # it under the terms of the GNU General Public License as published by 000393,000007: # the Free Software Foundation; either version 2 of the License, or 000394,000008: # (at your option) any later version. 000395,000009: 000396,000010: # yaAGC is distributed in the hope that it will be useful, 000397,000011: # but WITHOUT ANY WARRANTY; without even the implied warranty of 000398,000012: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 000399,000013: # GNU General Public License for more details. 000400,000014: 000401,000015: # You should have received a copy of the GNU General Public License 000402,000016: # along with yaAGC; if not, write to the Free Software 000403,000017: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 000404,000018: 000405,000019: # Filename: ValidateDAS.agc 000406,000020: # Purpose: This is the portion of the Validation program that attempts 000407,000021: # to validate the DAS instruction 000408,000022: # Mod history: 07/04/04 RSB. Began. 000409,000023: 000410,000024: # (Test 6.) What we do here is just add 000411,000025: # various numbers and check the result, including some 000412,000026: # boundary cases that generate +- overflow. 000413,000027: 4332 24061 INCR ERRNUM 000414,000028: 000415,000029: 4333 00006 EXTEND 000416,000030: 4334 37670 DCA BIGRNUM # Get 123454321 * 14 (octal). 000417,000031: 4335 00006 EXTEND 000418,000032: 4336 40001 DCOM # 123454321 * -14. 000419,000033: 4337 52065 DXCH TEMPJ # Save at TEMPJ,TEMPK 000420,000034: 4340 37644 CA TWNTHREE # TEMPI is loop counter. 000421,000035: 000422,000036: # First check the normal case. 000423,000037: # The idea here is that we start with -14*123454321, go to 000424,000038: # -13*123454321, ..., -0, +1*123454321, ..., +14*123454321. 000425,000039: # Then we compare the results. 000426,000040: 4341 24062 INCR ERRSUB # 1 000427,000041: 4342 54063 DASLOOP TS TEMPI 000428,000042: 4343 00006 EXTEND # Update the running sum. 000429,000043: 4344 37666 DCA BIGNUM 000430,000044: 4345 20065 DAS TEMPJ 000431,000045: 4346 00006 EXTEND # Overflow? 000432,000046: 4347 14351 BZF DASNOV1 000433,000047: 4350 14646 TCF VDAERROR 000434,000048: 4351 30001 DASNOV1 CA L # L-reg 0? 000435,000049: 4352 00006 EXTEND 000436,000050: 4353 14355 BZF DASNOV1A 000437,000051: 4354 14646 TCF VDAERROR 000438,000052: 4355 10063 DASNOV1A CCS TEMPI 000439,000053: 4356 14342 TCF DASLOOP 000440,000054: 4357 24062 INCR ERRSUB # 2 000441,000055: 4360 00006 EXTEND # Compare. 000442,000056: 4361 37670 DCA BIGRNUM 000443,000057: 4362 00006 EXTEND 000444,000058: 4363 60064 SU TEMPJ 000445,000059: 4364 00006 EXTEND 000446,000060: 4365 14367 BZF DASOK1 000447,000061: 4366 14646 TCF VDAERROR 000448,000062: 4367 24062 DASOK1 INCR ERRSUB # 3 000449,000063: 4370 30001 CA L 000450,000064: 4371 00006 EXTEND 000451,000065: 4372 60065 SU TEMPK 000452,000066: 4373 00006 EXTEND 000453,000067: 4374 14376 BZF DASOK2 000454,000068: 4375 14646 TCF VDAERROR 000455,000069: 4376 DASOK2 000456,000070: 4376 30007 CA ZEROES 000457,000071: 4377 54062 TS ERRSUB 000458,000072: 000459,000073: # (Test 7.) Now we check boundary cases where +- overflow are 000460,000074: # generated. Also, we check that adding +-0 doesn't change 000461,000075: # the result. 000462,000076: 4400 24061 INCR ERRNUM 000463,000077: 4401 24062 INCR ERRSUB # 1 000464,000078: # Add +-0 to next-to-highest DP integer. 000465,000079: 4402 00006 EXTEND 000466,000080: 4403 37706 DCA DBMAXP-1 # Next-to-highest + DP. 000467,000081: 4404 52065 DXCH TEMPJ # Store in erasable. 000468,000082: # ... first, +0. 000469,000083: 4405 00006 EXTEND # Let's add +0 to it. 000470,000084: 4406 37672 DCA DBZERO 000471,000085: 4407 20065 DAS TEMPJ 000472,000086: 4410 00006 EXTEND # Overflow? 000473,000087: 4411 14413 BZF DASOK3 000474,000088: 4412 14646 TCF VDAERROR 000475,000089: 4413 24062 DASOK3 INCR ERRSUB # 2 000476,000090: 4414 00006 EXTEND 000477,000091: 4415 37706 DCA DBMAXP-1 # Check if unchanged. 000478,000092: 4416 00006 EXTEND # MS word first. 000479,000093: 4417 60064 SU TEMPJ 000480,000094: 4420 00006 EXTEND 000481,000095: 4421 14423 BZF DASOK4 000482,000096: 4422 14646 TCF VDAERROR 000483,000097: 4423 24062 DASOK4 INCR ERRSUB # 3 000484,000098: 4424 30001 CA L # LS word. 000485,000099: 4425 00006 EXTEND 000486,000100: 4426 60065 SU TEMPK 000487,000101: 4427 00006 EXTEND 000488,000102: 4430 14432 BZF DASOK5 000489,000103: 4431 14646 TCF VDAERROR 000490,000104: # ... now, -0. 000491,000105: 4432 24062 DASOK5 INCR ERRSUB # 4 000492,000106: 4433 00006 EXTEND # Let's add -0 to it. 000493,000107: 4434 37674 DCA DBMZERO 000494,000108: 4435 20065 DAS TEMPJ 000495,000109: 4436 00006 EXTEND # Overflow? 000496,000110: 4437 14441 BZF DASOK6 000497,000111: 4440 14646 TCF VDAERROR 000498,000112: 4441 24062 DASOK6 INCR ERRSUB # 5 000499,000113: 4442 00006 EXTEND 000500,000114: 4443 37706 DCA DBMAXP-1 # Check if unchanged. 000501,000115: 4444 00006 EXTEND # MS word first. 000502,000116: 4445 60064 SU TEMPJ 000503,000117: 4446 00006 EXTEND 000504,000118: 4447 14451 BZF DASOK7 000505,000119: 4450 14646 TCF VDAERROR 000506,000120: 4451 24062 DASOK7 INCR ERRSUB # 6 000507,000121: 4452 30001 CA L # LS word. 000508,000122: 4453 00006 EXTEND 000509,000123: 4454 60065 SU TEMPK 000510,000124: 4455 00006 EXTEND 000511,000125: 4456 14460 BZF DASOK8 000512,000126: 4457 14646 TCF VDAERROR 000513,000127: 4460 DASOK8 000514,000128: # Now add +1, and make sure no overflow. 000515,000129: 4460 24062 INCR ERRSUB # 7 000516,000130: 4461 00006 EXTEND # Let's add +1 to it. 000517,000131: 4462 37676 DCA DBONE 000518,000132: 4463 20065 DAS TEMPJ 000519,000133: 4464 00006 EXTEND # Overflow? 000520,000134: 4465 14467 BZF DASOK9 000521,000135: 4466 14646 TCF VDAERROR 000522,000136: 4467 24062 DASOK9 INCR ERRSUB # 10 octal 000523,000137: 4470 00006 EXTEND 000524,000138: 4471 37702 DCA DBMAXP # Check result. 000525,000139: 4472 00006 EXTEND # MS word first. 000526,000140: 4473 60064 SU TEMPJ 000527,000141: 4474 00006 EXTEND 000528,000142: 4475 14477 BZF DASOK10 000529,000143: 4476 14646 TCF VDAERROR 000530,000144: 4477 24062 DASOK10 INCR ERRSUB # 11 octal 000531,000145: 4500 30001 CA L # LS word. 000532,000146: 4501 00006 EXTEND 000533,000147: 4502 60065 SU TEMPK 000534,000148: 4503 00006 EXTEND 000535,000149: 4504 14506 BZF DASOK11 000536,000150: 4505 14646 TCF VDAERROR 000537,000151: 4506 DASOK11 000538,000152: # Now add +1 again, and make sure there is overflow and 000539,000153: # there is wraparound to +0. 000540,000154: 4506 24062 INCR ERRSUB # 12 000541,000155: 4507 00006 EXTEND # Let's add +1 to it. 000542,000156: 4510 37676 DCA DBONE 000543,000157: 4511 20065 DAS TEMPJ 000544,000158: 4512 67631 AD NEGONE # Positive overflow? 000545,000159: 4513 00006 EXTEND # Overflow? 000546,000160: 4514 14516 BZF DASOK12 000547,000161: 4515 14646 TCF VDAERROR 000548,000162: 4516 24062 DASOK12 INCR ERRSUB # 13 000549,000163: 4517 00006 EXTEND 000550,000164: 4520 37672 DCA DBZERO # Check result. 000551,000165: 4521 00006 EXTEND # MS word first. 000552,000166: 4522 60064 SU TEMPJ 000553,000167: 4523 00006 EXTEND 000554,000168: 4524 14526 BZF DASOK13 000555,000169: 4525 14646 TCF VDAERROR 000556,000170: 4526 24062 DASOK13 INCR ERRSUB # 14 000557,000171: 4527 30001 CA L # LS word. 000558,000172: 4530 00006 EXTEND 000559,000173: 4531 60065 SU TEMPK 000560,000174: 4532 00006 EXTEND 000561,000175: 4533 14535 BZF DASOK14 000562,000176: 4534 14646 TCF VDAERROR 000563,000177: 4535 DASOK14 000564,000178: # Same thing now, but with negative values. 000565,000179: 4535 24062 INCR ERRSUB # 15 000566,000180: 4536 00006 EXTEND 000567,000181: 4537 37710 DCA DBMAXN-1 000568,000182: 4540 52065 DXCH TEMPJ 000569,000183: # Now add -1, and make sure no overflow. 000570,000184: 4541 00006 EXTEND # Let's add -1 to it. 000571,000185: 4542 37700 DCA DBMONE 000572,000186: 4543 20065 DAS TEMPJ 000573,000187: 4544 00006 EXTEND # Overflow? 000574,000188: 4545 14547 BZF DASOK15 000575,000189: 4546 14646 TCF VDAERROR 000576,000190: 4547 24062 DASOK15 INCR ERRSUB # 16 000577,000191: 4550 00006 EXTEND 000578,000192: 4551 37704 DCA DBMAXN # Check result. 000579,000193: 4552 00006 EXTEND # MS word first. 000580,000194: 4553 60064 SU TEMPJ 000581,000195: 4554 00006 EXTEND 000582,000196: 4555 14557 BZF DASOK16 000583,000197: 4556 14646 TCF VDAERROR 000584,000198: 4557 24062 DASOK16 INCR ERRSUB # 17 000585,000199: 4560 30001 CA L # LS word. 000586,000200: 4561 00006 EXTEND 000587,000201: 4562 60065 SU TEMPK 000588,000202: 4563 00006 EXTEND 000589,000203: 4564 14566 BZF DASOK17 000590,000204: 4565 14646 TCF VDAERROR 000591,000205: 4566 DASOK17 000592,000206: # Now add -1 again, and make sure there is pos. overflow and 000593,000207: # there is wraparound to -0. 000594,000208: 4566 24062 INCR ERRSUB # 20 octal 000595,000209: 4567 00006 EXTEND # Let's add -1 to it. 000596,000210: 4570 37700 DCA DBMONE 000597,000211: 4571 20065 DAS TEMPJ 000598,000212: 4572 67635 AD ONE 000599,000213: 4573 00006 EXTEND # Overflow? 000600,000214: 4574 14576 BZF DASOK18 000601,000215: 4575 14646 TCF VDAERROR 000602,000216: 4576 24062 DASOK18 INCR ERRSUB # 21 octal 000603,000217: 4577 00006 EXTEND 000604,000218: 4600 37674 DCA DBMZERO # Check result. 000605,000219: 4601 00006 EXTEND # MS word first. 000606,000220: 4602 60064 SU TEMPJ 000607,000221: 4603 00006 EXTEND 000608,000222: 4604 14606 BZF DASOK19 000609,000223: 4605 14646 TCF VDAERROR 000610,000224: 4606 24062 DASOK19 INCR ERRSUB # 22 000611,000225: 4607 30001 CA L # LS word. 000612,000226: 4610 00006 EXTEND 000613,000227: 4611 60065 SU TEMPK 000614,000228: 4612 00006 EXTEND 000615,000229: 4613 14615 BZF DASOK20 000616,000230: 4614 14646 TCF VDAERROR 000617,000231: 4615 DASOK20 000618,000232: 000619,000233: 4615 30007 CA ZEROES 000620,000234: 4616 54062 TS ERRSUB 000621,000235: 000622,000236: # (Test 8.) Now we check cases where the signs of the more-significant 000623,000237: # and less-significant words disagree. 000624,000238: 4617 24061 INCR ERRNUM 000625,000239: 000626,000240: # Check that X + -X = -0. This isn't spec'd, but I've seen 000627,000241: # a comment somewhere that it is true. 000628,000242: 4620 24062 INCR ERRSUB # 1 000629,000243: 4621 00006 EXTEND 000630,000244: 4622 37666 DCA BIGNUM 000631,000245: 4623 00006 EXTEND 000632,000246: 4624 40001 DCOM 000633,000247: 4625 52065 DXCH TEMPJ 000634,000248: 4626 00006 EXTEND 000635,000249: 4627 37666 DCA BIGNUM 000636,000250: 4630 20065 DAS TEMPJ 000637,000251: 4631 30064 CA TEMPJ 000638,000252: 4632 10000 CCS A 000639,000253: 4633 14646 TCF VDAERROR 000640,000254: 4634 14646 TCF VDAERROR 000641,000255: 4635 14646 TCF VDAERROR 000642,000256: 4636 24062 INCR ERRSUB # 2 000643,000257: 4637 30065 CA TEMPK 000644,000258: 4640 10000 CCS A 000645,000259: 4641 14646 TCF VDAERROR 000646,000260: 4642 14646 TCF VDAERROR 000647,000261: 4643 14646 TCF VDAERROR 000648,000262: 000649,000263: 4644 14647 TCF +3 000650,000264: 4645 00010 TSTEIGHT DEC 8 B-14 000651,000265: 4646 07437 VDAERROR TC ERRORDSP 000652,000266: 4647 34645 CA TSTEIGHT 000653,000267: 4650 54061 TS ERRNUM 000654,000268: 4651 30007 CA ZEROES 000655,000269: 4652 54062 TS ERRSUB 000656,000270: End of include-file ValidateDAS.agc. Parent file is Validation.agc