# ifndef NO_WHAT
/*
 *      SCCS file type - Emulator Include File
 *
 *      What identification string:
 */
static char *_S_basicdefs = "@(#)EM_basicdefs.h	3.3";
# endif

/* un-define m4 built in macros */
#undef index

#define  AND  && 
#define  OR   || 
#define  NOT   ! 


#define KOOD  int

#define  NIL   -1 
#define  NULL   0 
#define  MAXINTEGER   32767 

/* commented out when C functions are not commented out and vice versa
 * (to comment out put '#' at beginning of "define" lines & move next line down
 */
#define decZ(x), ((--(*x)) ? FALSE : TRUE) 
#define inc(x), ((*x)++) 

#define NPROCS    5   /* used for coroutines , in CPP conditional compiles */

/*
 * Macros for accessing the PS, and for pulling out the saved PS and PC from
 * pseudo-interrupt vectors.  Put here for lack of a better idea where they
 * belong.
 */

#define  PREV_MODE          0030000
#define  CUR_MODE           0140000
#define  KERNEL_PREV_MODE   0000000
#define  SUPER_PREV_MODE    0010000
#define  USER_PREV_MODE     0030000
#define  KERNEL_CUR_MODE    0000000
#define  SUPER_CUR_MODE     0040000
#define  USER_CUR_MODE      0140000
#define  CBIT                   001
#define  TBIT                   020

#define  usr_pc        (((pseudo_int_vector *)PI_ADDRESS)[base_lev].interrupted_pc)
#define  usr_ps        (((pseudo_int_vector *)PI_ADDRESS)[base_lev].interrupted_ps)
#define  usr_hard_pc   (((pseudo_int_vector *)PI_ADDRESS)[hard_lev].interrupted_pc)
#define  usr_hard_ps   (((pseudo_int_vector *)PI_ADDRESS)[hard_lev].interrupted_ps)


/* macros and c definitions used to control debug printout */
/* set debug mask to the desired entries to be printed     */

int dbgmsk;             /* debug mask */

#define  dbg0          01             /* region/end region printouts */
#define  dbg1          02             /* Kernel emulator output KERfns*/
#define  dbg2          04             /* EFI */
#define  dbg3         010             /* ETTY */
#define  dbg4         020             /* ESG */
#define  dbg5         040             /* EIN */
#define  dbg6        0100             /* ECC */
#define  dbg7        0200             /* EEV */
#define  dbg8        0400             /* ESY */
#define  dbg9       01000             /* EPP */
#define  dbg10      02000             /* ETH */
#define  dbg11      04000             /* EBC */
#define  dbg12     010000             /* ECC (pseudo int trace) & ESC */
#define  dbg13     020000             /* EPS */
#define  dbg14     040000             /* EDI */
#define  dbg15    0100000             /* Kernel calls: set_pil */
# define debug0(a)      /* null */
# define debug1(a)      /* null */
#define  debug2 if(dbgmsk & dbg2)  printf
#define  debug3 if(dbgmsk & dbg3)  printf
#define  debug4 if(dbgmsk & dbg4)  printf
#define  debug5 if(dbgmsk & dbg5)  printf
#define  debug6 if(dbgmsk & dbg6)  printf
#define  debug7 if(dbgmsk & dbg7)  printf
#define  debug8 if(dbgmsk & dbg8)  printf
#define  debug9 if(dbgmsk & dbg9)  printf
#define  debug10 if(dbgmsk & dbg10)  printf
#define  debug11 if(dbgmsk & dbg11)  printf
#define  debug12 if(dbgmsk & dbg12)  printf
#define  debug13 if(dbgmsk & dbg13)  printf
#define  debug14 if(dbgmsk & dbg14)  printf
#define  debug15 if(dbgmsk & dbg15)  printf
