home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / MAILBOX.ZIP / MPDOS.H < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-27  |  2.9 KB  |  82 lines

  1. /****************************************************************************/
  2. /* mpdos.h  -- EXTENSIONS TO TURBO C / MICROSOFT C dos.h INCLUDE (INTERFACE)*/
  3. /* Created:  8/1/87        Release:  0.7        Version:  06/27/88  */
  4. /****************************************************************************
  5. (c) Copyright 1987 by Michael Benjamin Parker           (USA SS# 557-49-4130)
  6.  
  7. All Rights Reserved unless specified in the following include files: */
  8. #include "mptsk.cpy" /*
  9.  
  10. DO NOT REMOVE OR ALTER THIS NOTICE AND ITS PROVISIONS.
  11. ****************************************************************************/
  12. /* OVERVIEW:
  13.  
  14. These are a set of extensions to the standard dos.h include file of
  15. Turbo C and Microsoft C.  Extensions implemented include:
  16.  
  17. A structure for holding the Intel 8088 flag register.
  18.  
  19. A procedure for retrieving the Intel 8088 flags.
  20.  
  21. Macros to get and set the current stack pointer (Turbo C only). */
  22. /****************************************************************************/
  23. /****************************************************************************/
  24. /****************************************************************************/
  25. #ifndef    MPDOS_H
  26. #define    MPDOS_H
  27.  
  28. #ifndef    DOS_H
  29. #define    DOS_H
  30. #include <dos.h>
  31. #endif    /* DOS_H */
  32. /****************************************************************************/
  33. typedef struct {
  34.     unsigned    CF:    1;
  35.     unsigned    :    1;
  36.     unsigned    PF:    1;
  37.     unsigned    :    1;
  38.     unsigned    AF:    1;
  39.     unsigned    :    1;
  40.     unsigned    ZF:    1;
  41.     unsigned    SF:    1;
  42.     unsigned    TF:    1;
  43.     unsigned    IF:    1;
  44.     unsigned    DF:    1;
  45.     unsigned    OF:    1;
  46.     unsigned    :    4;
  47. } _FLAGS;
  48. /****************************************************************************/
  49. typedef short _Cdecl (far *MPDOS_FLAGREAD)(void);
  50. extern    MPDOS_FLAGREAD    mpdos_flagread;
  51. #define _FLAG   (mpdos_flagread())
  52. /****************************************************************************/
  53. #define    _FLAG_CF    (0x0001)
  54. #define    _FLAG_PF    (0x0004)
  55. #define    _FLAG_AF    (0x0010)
  56. #define    _FLAG_ZF    (0x0040)
  57. #define    _FLAG_SF    (0x0080)
  58. #define    _FLAG_TF    (0x0100)
  59. #define    _FLAG_IF    (0x0200)
  60. #define    _FLAG_DF    (0x0400)
  61. #define    _FLAG_OF    (0x0800)
  62. /****************************************************************************/
  63. /****************************************************************************/
  64. #ifdef    __TURBOC__
  65.  
  66. /* STACK COMMANDS TAKE AND GET HUDGE POINTERS */
  67. #define    getstackptr()        (MK_FP(_SS,_SP))
  68. #define    setstackptr(ptr)        \
  69.     ptr+=    0;            \
  70.     _SP=    FP_OFF(ptr)-0x0010;    \
  71.     _SS=    FP_SEG(ptr)+0x0001
  72.  
  73. #endif
  74. /****************************************************************************/
  75. /****************************************************************************/
  76. #define    mpdos_vect(intr_no,new_interrupt)                \
  77.     getvect(intr_no);                                               \
  78.     setvect(intr_no,new_interrupt)
  79. /****************************************************************************/
  80. /****************************************************************************/
  81. #endif    /* MPDOS_H */
  82.