home *** CD-ROM | disk | FTP | other *** search
/ BBS 1 / BBS#1.iso / for-dos / exe2c.ha / EXEC-2-C.H < prev    next >
Text File  |  1992-07-18  |  4KB  |  142 lines

  1.  
  2. /*
  3.  ***************************************************************************
  4.  *                                                                         *
  5.  *   EXEC-2-C.H - include file for sources restored by EXEX-2-C utility.   *
  6.  *   Copyright (c) The Austin Code Works & Polyglot International,         *
  7.  *                Jerusalem, 1991                            *
  8.  *                                                                         *
  9.  ***************************************************************************
  10.  */
  11.  
  12.  
  13.  
  14. #define        UP    1
  15. #define        DOWN    0
  16.  
  17.  
  18. typedef         unsigned int    Word;
  19. typedef         unsigned char   Byte;
  20. typedef        unsigned long   Dword;
  21. typedef         int              (*FNC)();    /* pointer to function type */
  22.  
  23. /*
  24.  *  Used to split the Dword to higher && lower part
  25.  */
  26. #define        HIGH_WRD(w)             (*((Word*)&(w) + 1))
  27. #define        LWR_WRD(w)        ((Word)(w))
  28.  
  29. /*
  30.  * Higher && lower bits of Word or Byte
  31.  */
  32.  
  33. typedef struct {
  34.         /*--- first byte ---*/
  35.         Word    lwr_bit    : 1;
  36.         Word    dummy1  : 6;
  37.         Word    byte_hgh_bit : 1;
  38.         /*--- second byte ---*/
  39.         Word    dummy2  : 7;
  40.         Word    word_hgh_bit : 1;
  41.                     } Bits_t;
  42.  
  43. #define        Lwr_bit(a)        ((Bits_t)(a).lwr_bit)
  44. #define        High_bit(a)        (sizeof(a) == sizeof(Word) ?        \
  45.                         ((Bits_t)(a).word_hgh_bit):\
  46.                         ((Bits_t)(a).byte_hgh_bit))
  47.  
  48.  
  49. /*---------------------------------------------------------------------------*\
  50.  |          REGISTER SIMULATION                         |
  51. \*---------------------------------------------------------------------------*/
  52.  
  53. #ifdef  notdef
  54.  
  55. struct WORDREGS {
  56.         unsigned int    _ax_, _bx_, _cx_, _dx_, _si_, _di_, _bp_, _sp_,
  57.                         _cs_, _ss_, _ds_, _es_, _cflag_, _flags_;
  58. };
  59.  
  60. struct BYTEREGS {
  61.         unsigned char   _al_, _ah_, _bl_, _bh_, _cl_, _ch_, _dl_, _dh_;
  62. };
  63.  
  64. typedef union   Regs    {
  65.         struct  WORDREGS x;
  66.         struct  BYTEREGS h;
  67.                         }       REGS;
  68.  
  69. #define         ax      reg.x._ax_
  70. #define         bx      ((Byte*)reg.x._bx_)
  71. #define         cx      reg.x._cx_
  72. #define         dx      reg.x._dx_
  73.  
  74. #define     si      ((Byte*)reg.x._si_)
  75. #define     di    ((Byte*)reg.x._di_)
  76.  
  77. #define         ah      reg.h._ah_
  78. #define         al      reg.h._al_
  79. #define         bh      reg.h._bh_
  80. #define         bl      reg.h._bl_
  81. #define         ch      reg.h._ch_
  82. #define         cl      reg.h._cl_
  83. #define         dh      reg.h._dh_
  84. #define         dl      reg.h._dl_
  85.  
  86. #define         cs      reg.x._cs_
  87. #define         es      reg.x._es_
  88. #define         ds      reg.x._ds_
  89. #define         ss      reg.x._ss_
  90.  
  91. #define         bp      ((Byte*)reg.x._bp_)
  92. #define         sp      reg.x._sp_
  93. #else
  94.  
  95. #define        HIGH_BYTE(w)        (*((Byte*)&(w)+1))
  96. #define        LWR_BYTE(w)        ((Byte)(w))
  97.  
  98.  
  99. Word    ax, cx, dx, cs, ss, ds, es;
  100. Byte      *bx, *si, *di, *bp, *sp;
  101.  
  102. #define        ah    HIGH_BYTE( ax )
  103. #define        al    LWR_BYTE(  ax )
  104. #define        bh    HIGH_BYTE( bx )
  105. #define        bl    LWR_BYTE(  bx )
  106. #define        ch    HIGH_BYTE( cx )
  107. #define        cl    LWR_BYTE(  cx )
  108. #define        dh    HIGH_BYTE( dx )
  109. #define        dl    LWR_BYTE(  dx )
  110.  
  111. #endif
  112.  
  113. extern Byte *MK_FP();
  114.  
  115. /*---------------------------------------------------------------------------*\
  116.  |          Declaration of the internal variables                  |
  117. \*---------------------------------------------------------------------------*/
  118.  
  119. #ifdef notdef
  120. /*
  121.  * register simulation variable
  122.  */
  123. REGS          reg;
  124. #endif
  125.  
  126. /*
  127.  * temporary var used for MULT ant DIV group
  128.  */
  129. Dword        long_mul;
  130.  
  131. /*
  132.  * temporary vars used for string operations
  133.  */
  134. char far *src;
  135. char far *dst;
  136.  
  137. /*
  138.  * general use temporary vars
  139.  */
  140. Word i;
  141.  
  142.