#ifndef __diag__
# define __diag__

/*
 * Dispatch table entry structure
 */
#if (NON_DE_AVAILABLE)
    struct int_desc {
	unsigned	short	mod;
	unsigned	short	offset;
};
#else
    struct int_desc {
	void (* funcp)();
};
#endif

struct statistic{
    int  runs,fails;
} ;


struct shadow { /* shadow registers definition  */
    volatile unsigned char  ecr;
    volatile unsigned short cfr;
    volatile unsigned short vcr;
    volatile unsigned short lcr;
    volatile unsigned short cnd;
};


#define P_BASE 2

extern struct int_desc diag_dispatch__[64];
extern unsigned cur_divisor__;
extern char error[80];
extern char msg__[80];
extern struct shadow shadow;
extern boolean	  verbose_flag;
extern boolean	  debug_flag;
extern boolean	  cache_flag;
#  pragma interrupt (default_handler__);
#ifndef DIAG_PORT
#define	    DIAG_PORT	0
#endif
#ifndef DIAG_BAUD
#define DIAG_BAUD cur_divisor__
#endif
extern void diag_interface__();
extern void default_handler__ ();
extern test_dispatch__(/* test_list, loop, halt_on_error */);
extern void print_str(/* line */);
extern void bin_to_hex__(/* bin, hex, size */);
#endif
