Intel 386 Computer Hardware User Manual


 
Intel386™ EX EMBEDDED MICROPROCESSOR USER’S MANUAL
C-6
C.2 EXAMPLE CODE DEFINES
/*********************** Global typedef **********************/
typedef unsigned char BYTE; /* 8-bit value */
typedef unsigned short WORD; /* 16-bit value */
typedef unsigned long DWORD; /* 32-bit value */
/******************** Global Used defines ********************/
/* Error Flags */
#define E_OK 0
#define E_INVALID_DEVICE 1
#define E_INVALID_VECTOR 2
#define E_BADVECTOR 3
#define INTERRUPT_ISR 1
#define TRAP_ISR 2
#define IDT_ALIAS 2 /* Only valid for protected mode */
#define TRAP_TYPE 0x8f00 /* Only valid for protected mode */
#define INTR_TYPE 0x8e00 /* Only valid for protected mode */
#define LOBYTE(w) ((BYTE)(w))
#define HIBYTE(w) ((BYTE)(((WORD)(w) >> 8) & 0xFF))
#define LOWORD(l) ((WORD)(DWORD)(l))
#define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
/*** Bit Masks ***/
#define BIT0MSK 0x1
#define BIT1MSK 0x2
#define BIT2MSK 0x4
#define BIT3MSK 0x8
#define BIT4MSK 0x10
#define BIT5MSK 0x20
#define BIT6MSK 0x40
#define BIT7MSK 0x80
/*** Global Function ***/
extern void _EnableExtIOMem(void);
/******* Interrupt Control Unit configuration defines ********/
/* ICU Modes */
#define ICU_SFNM 0x10
#define ICU_AUTOEOI 0x2
#define ICU_TRIGGER_LEVEL 0x8
#define ICU_TRIGGER_EDGE 0x0
/* ICU Master Pins */