X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fregression%2Fcompare10.c;h=b7178eb389832b155db5c2181bc2ee35f62d3f3b;hb=b49b8f5a2e8ac5cea3beb6e503159dd3d09f6728;hp=57541abcb3ed22f709fcb58ca4fcda55ab690abb;hpb=3933e81dce0294a133bee29f0d1d329dbd1365e1;p=fw%2Fsdcc diff --git a/src/regression/compare10.c b/src/regression/compare10.c index 57541abc..b7178eb3 100644 --- a/src/regression/compare10.c +++ b/src/regression/compare10.c @@ -1,5 +1,6 @@ -#define __16F873 -#include "p16f873.h" +#include "gpsim_assert.h" +#include "picregs.h" + // Signed comparisons of the form: (variable>=LIT) // // This regression test exercises all of the boundary @@ -8,9 +9,7 @@ // and each one has an astonishing capability of failing // a boundary condition. -unsigned char success = 0; unsigned char failures = 0; -unsigned char dummy = 0; unsigned char result = 0; //bit bit0 = 0; @@ -23,31 +22,6 @@ signed char char1 = 0; char long0 = 0; char long1 = 0; -/* copied from 16f877.inc file supplied with gpasm */ - -#define _CP_ALL 0x0FCF -#define _CP_HALF 0x1FDF -#define _CP_UPPER_256 0x2FEF -#define _CP_OFF 0x3FFF -#define _DEBUG_ON 0x37FF -#define _DEBUG_OFF 0x3FFF -#define _WRT_ENABLE_ON 0x3FFF -#define _WRT_ENABLE_OFF 0x3DFF -#define _CPD_ON 0x3EFF -#define _CPD_OFF 0x3FFF -#define _LVP_ON 0x3FFF -#define _LVP_OFF 0x3F7F -#define _BODEN_ON 0x3FFF -#define _BODEN_OFF 0x3FBF -#define _PWRTE_OFF 0x3FFF -#define _PWRTE_ON 0x3FF7 -#define _WDT_ON 0x3FFF -#define _WDT_OFF 0x3FFB -#define _LP_OSC 0x3FFC -#define _XT_OSC 0x3FFD -#define _HS_OSC 0x3FFE -#define _RC_OSC 0x3FFF - /* *** NOTE *** This particular test takes quite a while to run * ~ 10,000,000 instruction cycles. (2.5 seconds on a 20Mhz PIC). * The WDT will reset the CPU if it's enabled. So disable it... @@ -55,12 +29,13 @@ char long1 = 0; typedef unsigned int word; -word at 0x2007 CONFIG = _WDT_OFF & _PWRTE_ON; +//word at 0x2007 CONFIG = wdt_off & pwrte_on; void -done () +done() { - dummy++; + ASSERT(MANGLE(failures) == 0); + PASSED(); } @@ -340,6 +315,5 @@ main (void) int_compare1(); int_compare2(); - success = failures; done (); }