+++ /dev/null
-#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
-}
-
-
+++ /dev/null
-extern void Timer2Handler (void) interrupt 5 using 1;
-extern unsigned long clock(void);
-extern void startTimer(void);
-
-#define CLOCKS_PER_SEC 1000
#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() */
#define DEBUG 0
#if DEBUG
-#define DPRINTF(_a) printf _a
+#define DPRINTF(_a) printf _a
#else
#define DPRINTF(_a)
#endif
REG int Number_Of_Runs;
unsigned long runTime;
-#ifdef SDCC_ds390
- startTimer();
-#endif
-
printf("[dhry]\n");
Next_Ptr_Glob = &_r[0];
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