update for tinibios
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 10 May 2001 06:03:27 +0000 (06:03 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 10 May 2001 06:03:27 +0000 (06:03 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@794 4a8a32a2-be11-0410-ad9d-d568d2c75423

support/tests/dhrystone/clock.c [deleted file]
support/tests/dhrystone/clock.h [deleted file]
support/tests/dhrystone/dhry.c
support/tests/dhrystone/tini.mak

diff --git a/support/tests/dhrystone/clock.c b/support/tests/dhrystone/clock.c
deleted file mode 100644 (file)
index d2a759b..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <ds80c390.h>
-#include <stdio.h>
-
-#include "clock.h"
-
-volatile unsigned long milliSeconds=0;
-
-#define RELOAD_VALUE 18432000/2/CLOCKS_PER_SEC 
-
-void Timer2Handler (void) interrupt 5 using 1 {
-  TF2=0; // reset overflow flag
-  milliSeconds++;
-  // that's all for now :)
-}
-
-// we can't just use milliSeconds
-unsigned long clock(void) {
-  unsigned long ms;
-  ET2=0;
-  ms=milliSeconds;
-  ET2=1;
-  return ms;
-}
-
-void startTimer (void) 
-{
-  // initialise timer
-  ET2=0; // disable timer interrupts initially
-  T2CON=0; // stop, timer mode, autoreload
-  T2MOD&=0xf4;
-  
-  TL2=RTL2=(-RELOAD_VALUE)&0xff;
-  TH2=RTH2=(-RELOAD_VALUE)>>8;
-  TR2=1; // run
-
-  ET2=1; // enable timer interrupts
-}
-
-
diff --git a/support/tests/dhrystone/clock.h b/support/tests/dhrystone/clock.h
deleted file mode 100644 (file)
index 2d395dc..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-extern void Timer2Handler (void) interrupt 5 using 1;
-extern unsigned long clock(void);
-extern void startTimer(void);
-
-#define CLOCKS_PER_SEC 1000
index e9fb740452ec24b9543a8f98c22ba6de581497cb..0f19332b0e7fe9cd84f38025859f09c73f784f1f 100644 (file)
@@ -49,8 +49,9 @@
 #include <stdio.h>
 
 #ifdef SDCC_ds390
-#include "clock.h"
-#include <serial390.h>
+#include <tinibios.h>
+#define clock() ClockTicks()
+#define CLOCKS_PER_SEC 1000
 #undef PRINT_T_STATES
 #else
 /** For clock() */
@@ -71,7 +72,7 @@ void _printTStates(void);
 #define DEBUG  0
 
 #if DEBUG
-#define DPRINTF(_a)  printf _a
+#define DPRINTF(_a) printf _a
 #else
 #define DPRINTF(_a)
 #endif
@@ -116,10 +117,6 @@ int main(void)
     REG   int             Number_Of_Runs;
     unsigned  long runTime;
 
-#ifdef SDCC_ds390
-    startTimer();
-#endif
-    
     printf("[dhry]\n");
 
     Next_Ptr_Glob = &_r[0];
index be9bbacc6a3b6dc2fdcd3b5f42347680b5c94d4e..2a7eee0c8a0d21d15258b75c3e43a38851a1f22b 100644 (file)
@@ -2,9 +2,9 @@ CC = sdcc
 
 MFLAGS = -mds390 --model-flat24 --stack-10bit
 MFLAGS += -DREG= -DNOSTRUCTASSIGN -DNOENUM
-LFLAGS = --xram-loc 0x180000 --code-loc 0x10000 -Wl-r
+LFLAGS = --xram-loc 0x100080 --code-loc 0x10000 -Wl-r
 
-OBJECTS = dhry.rel clock.rel
+OBJECTS = dhry.rel
 
 all: dhry.hex