home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_02 / 2n02018a < prev    next >
Text File  |  1991-01-01  |  2KB  |  62 lines

  1. #define UCHAR  unsigned char
  2. #define ULONG  unsigned long
  3. #define UINT   unsigned int
  4. #define USHORT unsigned short int
  5.  
  6. #define FP_MAK(fp, off, seg)   \
  7. ((*(((USHORT *)&(fp)) + \
  8. sizeof(UINT)/sizeof(USHORT)) = \
  9. (USHORT) (seg)), (*(UINT *)&(fp) = (UINT)(off)))
  10.  
  11. #define RFP_MAK(rfp, off, seg)   \
  12. (*(((USHORT *)&(rfp)) + 1) = \
  13. (USHORT)(seg)),(*(USHORT *)&(rfp) = (USHORT)(off))
  14.  
  15. #define RFP_LINEAR(rfp) \
  16. (((rfp) & 0xFFFF) + (((rfp) & 0xFFFF0000) >> 12))
  17.  
  18. #define MAKE_WORD(hc, lc) \
  19. ((((USHORT)(hc)) << 8) + (USHORT)(lc))
  20. #define HIGH_BYTE(word)   ((UCHAR)((word) >> 8))
  21. #define LOW_BYTE(word)    ((UCHAR)((word) & 0xFF))
  22.  
  23. #define DOS_REALMODE 0
  24. #define PHARLAP_386  1
  25. #define ERGO_OS286   2
  26. #define ERGO_OS386   3
  27.  
  28. #ifdef __HIGHC__
  29.    #define max _max
  30.    #define min _min
  31. #endif
  32.  
  33. #ifdef __WATCOMC__
  34.    #ifdef  __386__
  35.       #define  AX     eax
  36.       #define  BX     ebx
  37.       #define  CX     ecx
  38.       #define  DX     edx
  39.       #define  DI     edi
  40.       #define  SI     esi
  41.       #define  int86  int386
  42.       #define  int86x int386x
  43.       #pragma aux OUR_C "_*" \
  44.          parm caller []         \
  45.          value struct float struct routine [eax]  \
  46.         modify [eax ebx ecx edx esi edi fs gs];
  47.    #else
  48.       #pragma aux OUR_C "_*" \
  49.          parm caller []      \
  50.      value struct float struct routine [ax] \
  51.         modify [ax bx cx dx es si di];
  52.    #endif
  53. #else
  54.    #define  AX  ax
  55.    #define  BX  bx
  56.    #define  CX  cx
  57.    #define  DX  dx
  58.    #define  DI  di
  59.    #define  SI  si
  60. #endif
  61.  
  62.