home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / modem / byepc300.arc / BYEXMDM.ARC / MODEL.H < prev    next >
Text File  |  1987-04-20  |  2KB  |  74 lines

  1. ;---------------------------------------------------------------------------
  2. ; <MODEL.H> -- This file is the memory model header file used with
  3. ;  assembly models that interface to 'C' programs. To select the
  4. ;  model required, set the equates as follows:
  5. ;
  6. ;   model:            equates:
  7. ;
  8. ; {small}            _LDATA = NO    _LCODE = NO
  9. ; {medium}            _LDATA = NO    _LCODE = YES
  10. ; {compact}            _LDATA = YES   _LCODE = NO
  11. ; {large}            _LDATA = YES   _LCODE = YES
  12. ;
  13. ;---------------------------------------------------------------------------
  14. ;
  15. ;---------------------------------------------------------------------------
  16. ;  Memory Model selector for Microsoft C v3.0, ASM files.
  17. ;---------------------------------------------------------------------------
  18. ;
  19. ;_LDATA  equ    NO           ; data area size
  20. ;_LCODE  equ    NO           ; code pointers far.
  21. ;
  22. ;---------------------------------------------------------------------------
  23. ;  Argument Base address on stack:
  24. ;---------------------------------------------------------------------------
  25. ;
  26. if    _LCODE
  27. @ab    =    6
  28. else
  29. @ab    =    4          ;..if near call
  30. endif
  31. ;
  32. ;---------------------------------------------------------------------------
  33. ;  _LCODE and _LDATA are defined above.
  34. ;
  35. ;  The DSEG and PSEG macros are defined to generate the appropriate GROUP
  36. ;  and SEGMENT statements for the compiler and memory model in use.
  37. ;  In addition, ENDDS and ENDPS are used to end these segments.
  38. ;---------------------------------------------------------------------------
  39. ;
  40. if (not _LCODE)
  41.  
  42. pseg    macro
  43. _TEXT segment byte public 'CODE'
  44. assume cs:_TEXT
  45.     endm
  46.  
  47. endps    macro
  48. _TEXT    ends
  49.     endm
  50.  endif        ; end if not _LCODE
  51.  
  52.  
  53.  if _LCODE
  54. pseg    macro x
  55. x&_TEXT segment byte public 'CODE'
  56. assume cs:x&_TEXT
  57.     endm
  58.  
  59. endps    macro x
  60. x&_TEXT ends
  61.     endm
  62.  endif        ; end if _LCODE
  63.  
  64. dseg    macro
  65. DGROUP    group    _DATA
  66. _DATA    segment word public 'DATA'
  67.     assume ds:DGROUP
  68.     endm
  69.  
  70. endds    macro
  71. _DATA    ends
  72.     endm
  73.  
  74.