home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / nasm20b / nasm_src / seg.h < prev    next >
C/C++ Source or Header  |  1993-01-19  |  2KB  |  55 lines

  1. /* ---------------------------------------------------------------------- */
  2. /*                   Copyright (C) 1991 by Natürlich!                     */
  3. /*                      This file is copyrighted!                         */
  4. /*                Refer to the documentation for details.                 */
  5. /* ---------------------------------------------------------------------- */
  6. #ifndef __SEGMENT
  7. #define __SEGMENT
  8.  
  9. #define S_RCODE         0           /* relocatable code          */
  10. #define S_SDATA         1           /* Static data               */
  11. #define S_RDATA         2           /* relocatable data (words)  */
  12. #define S_TDATA         3           /* relocatable data (dbytes) */
  13. #define S_DS            4           /* hole to leave             */
  14. #define S_ALIGN         5           /* align code on boundary    */
  15. #define S_RSTOP         0x40
  16. #define S_UNKNOWN       -1
  17. #define sis_code( x)    ((word) x->type < S_DS)
  18. #define sis_unknown( s) ((s)->type < 0)
  19. #define calc_index()    (p_index() - sp->index)
  20.  
  21. #if VERSION
  22. # define check_fseg( p, t)       \
  23.    if( runnable)                 \
  24.    {                             \
  25.       if( sis_unknown( p))       \
  26.          p->type = S_SDATA; /*1*/\
  27.    }                             \
  28.    else                          \
  29.       if( (t) != p->type)        \
  30.          if( sis_unknown( p))    \
  31.             p->type = t;         \
  32.          else                    \
  33.             build_rseg( t, 0)
  34.  
  35. # define check_dseg( p, t, val)  \
  36.    if( runnable)                 \
  37.    {                             \
  38.       if( sis_unknown( p))       \
  39.          p->type = S_SDATA;      \
  40.    }                             \
  41.    else                          \
  42.       if( (t) != p->type)        \
  43.          if( sis_unknown( p))    \
  44.          {                       \
  45.             p->type = t;         \
  46.             p->size = val;       \
  47.          }                       \
  48.          else                    \
  49.             build_rseg( t, val); \
  50.       else                       \
  51.          p->size += val
  52. # endif
  53. #endif
  54. /* 1 :  beats me why this should be S_SDATA (probably anything is OK !?) */
  55.