#include <tinibios.h>
#define clock() ClockTicks()
#define CLOCKS_PER_SEC 1000
-#undef PRINT_T_STATES
#define memcpy(d,s,l) memcpyx(d,s,l)
-#elif defined(__z80)
+#elif defined(__z80) || defined(__gbz80)
unsigned int _clock(void);
#define clock _clock
#define CLOCKS_PER_SEC 100
-#define PRINT_T_STATES 1
#else
/** For clock() */
#include <time.h>
#include <types.h>
-#define PRINT_T_STATES
-#endif
-
-/** Print the number of t-states this program has been executing for.
- Optional :)
-*/
-#ifdef PRINT_T_STATES
-void _printTStates(void);
#endif
/** Set to one to print more messages about expected values etc.
/* Used instead of malloc() */
static Rec_Type _r[2];
+void mark(void)
+{
+}
+
void Proc_1 (REG Rec_Pointer Ptr_Val_Par);
void Proc_2 (One_Fifty *Int_Par_Ref);
void Proc_5 (void);
/* 32766 is the highest value for a 16 bitter */
#if DEBUG
- Number_Of_Runs = 3;
+ Number_Of_Runs = 1;
#else
Number_Of_Runs = 32766;
#endif
DPRINTF(("Int_1_Loc %d == 3, Int_2_Loc %d == 3, Int_3_Loc %d == 7\n",
Int_1_Loc, Int_2_Loc, Int_3_Loc));
- Int_2_Loc = Int_2_Loc * Int_1_Loc;
- Int_1_Loc = Int_2_Loc / Int_3_Loc;
- Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc;
+ Int_2_Loc = Int_2_Loc * Int_1_Loc; /* i2 = 3 * 3 = 9 */
+ Int_1_Loc = Int_2_Loc / Int_3_Loc; /* i1 = 9 / 7 = 1 */
+ Int_2_Loc = 7 * (Int_2_Loc - Int_3_Loc) - Int_1_Loc; /* i2 = 7 * (9 - 7) - 1 */
/* Int_1_Loc == 1, Int_2_Loc == 13, Int_3_Loc == 7 */
DPRINTF(("Int_1_Loc %d == 1, Int_2_Loc %d == 13, Int_3_Loc %d == 7\n",
Int_1_Loc, Int_2_Loc, Int_3_Loc));
DPRINTF(("Looping.\n"));
} /* loop "for Run_Index" */
-#ifdef PRINT_T_STATES
- _printTStates();
-#endif
-
printf("Run_Index = %d\n", Run_Index);
runTime = clock() - runTime;
printf (" should be: %d\n", (int)7);
printf ("Enum_Loc: %d\n", Enum_Loc);
printf (" should be: %d\n", (int)1);
- printf ("Str_1_Loc: %s\n", (char _generic *)Str_1_Loc);
+ printf ("Str_1_Loc: %s\n", (char *)Str_1_Loc);
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
- printf ("Str_2_Loc: %s\n", (char _generic *)Str_2_Loc);
+ printf ("Str_2_Loc: %s\n", (char *)Str_2_Loc);
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
printf ("\n");
#endif
#if 1
printf("Number of runs: %u. runTime: %u.\n", Number_Of_Runs, (unsigned)runTime);
+ mark();
printf("Dhrystones/s = %u\n", (unsigned)((unsigned long)Number_Of_Runs / (runTime/CLOCKS_PER_SEC)));
printf("MIPS = d/s/1757 = (sigh, need floats...)\n");
#endif
/* Local variable, initialized with Ptr_Val_Par->Ptr_Comp, */
/* corresponds to "rename" in Ada, "with" in Pascal */
- structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
+#if !defined(SDCC_ds390)
+ structassign (*Ptr_Val_Par->Ptr_Comp, *Ptr_Glob);
+#else
+ /* I have no idea why this is necessary... */
+ memcpyx((void xdata *)*Ptr_Val_Par->Ptr_Comp, (void xdata *)*Ptr_Glob,
+ sizeof(Rec_Type));
+#endif
Ptr_Val_Par->variant.var_1.Int_Comp = 5;
Next_Record->variant.var_1.Int_Comp
= Ptr_Val_Par->variant.var_1.Int_Comp;