home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / tcrnd11.arc / TC.ASI < prev   
Text File  |  1987-12-06  |  2KB  |  184 lines

  1.  
  2. $equ macro a,b
  3.  a equ <b>
  4.  endm
  5.  
  6. ifndef __NAME__
  7.  ifdef @filename
  8.   $equ __NAME__,%@filename
  9.  else
  10.   __NAME__ equ <>
  11.  endif
  12. endif
  13.  
  14. ifdef __TINY__
  15.  __SMALL__ equ 1
  16. endif
  17.  
  18. ifdef __SMALL__
  19.  __LPROG__ equ 0
  20.  __LDATA__ equ 0
  21. endif
  22.  
  23. ifdef __MEDIUM__
  24.  __LPROG__ equ 1
  25.  __LDATA__ equ 0
  26. endif
  27.  
  28. ifdef __COMPACT__
  29.  __LPROG__ equ 0
  30.  __LDATA__ equ 1
  31. endif
  32.  
  33. ifdef __LARGE__
  34.  __LPROG__ equ 1
  35.  __LDATA__ equ 1
  36. endif
  37.  
  38. ifdef __HUGE__
  39.  __LPROG__ equ 1
  40.  __LDATA__ equ 1
  41. endif
  42.  
  43. ifndef __LPROG__
  44.  %out !No model specified---assembling for COMPACT model.
  45.  __COMPACT__ equ <>
  46.  __LPROG__ equ 0
  47.  __LDATA__ equ 1
  48. endif
  49.  
  50. if __LPROG__
  51.  $equ __CNAME__,%__NAME__
  52. else
  53.  __CNAME__ equ <>
  54. endif
  55.  
  56. if __LPROG__
  57.  ifdef __HUGE__
  58.   @a equ 8
  59.  else
  60.   @a equ 6
  61.  endif
  62.  @f equ 4
  63. else
  64.  @a equ 4
  65.  @f equ 2
  66. endif
  67.  
  68. if __LDATA__
  69.  @d equ 4
  70. else
  71.  @d equ 2
  72. endif
  73.  
  74. $cseg macro cnm
  75.  cnm&_text segment byte public 'code'
  76.  endm
  77.  
  78. @cseg macro
  79.  $cseg %__CNAME__
  80.  endm
  81.  
  82. @endc macro
  83.  @curseg ends
  84.  endm
  85.  
  86. $dseg macro nm
  87.  ifdef __HUGE__
  88.   nm&_data segment word public 'data'
  89.  else
  90.   _data segment word public 'data'
  91.  endif
  92.  endm
  93.  
  94. @dseg macro
  95.  $dseg %__NAME__
  96.  endm
  97.  
  98. @endd macro
  99.  @curseg ends
  100.  endm
  101.  
  102. $bseg macro nm
  103.  ifdef __HUGE__
  104.   nm&_data segment word public 'data'
  105.  else
  106.   _bss segment word public 'bss'
  107.  endif
  108.  endm
  109.  
  110. @bseg macro
  111.  $bseg %__NAME__
  112.  endm
  113.  
  114. @endb macro
  115.  @curseg ends
  116.  endm
  117.  
  118. $header macro nm,cnm
  119.  name nm
  120.  @cseg
  121.  ifdef __HUGE__
  122.   assume cs:nm&_text,ds:nm&_data
  123.   dgroup equ <ds>
  124.  else
  125.   dgroup group _data,_bss
  126.   if __LDATA__
  127.    assume cs:cnm&_text,ds:dgroup
  128.   else
  129.    assume cs:cnm&_text,ds:dgroup,ss:dgroup
  130.   endif
  131.  endif
  132.  @endc
  133.  @dseg
  134.  @endd
  135.  ifndef __HUGE__
  136.   @bseg
  137.   @endb
  138.  endif
  139.  endm
  140.  
  141. @header macro
  142.  $header %__NAME__,%__CNAME__
  143.  endm
  144.  
  145. @proc macro name
  146.  local n
  147.  public _&name
  148.  if __LPROG__
  149.   _&name proc far
  150.  else
  151.   _&name proc near
  152.  endif
  153.  endm
  154.  
  155. $enter macro nm
  156.  ifdef __HUGE__
  157.   push ds
  158.   push bp
  159.   mov bp,nm&_data
  160.   mov ds,bp
  161.   mov bp,sp
  162.  else
  163.   push bp
  164.   mov bp,sp
  165.  endif
  166.  endm
  167.  
  168. @enter macro
  169.  $enter %__NAME__
  170.  endm
  171.  
  172. @leave macro
  173.  pop bp
  174.  ifdef __HUGE__
  175.   pop ds
  176.  endif
  177.  ret
  178.  endm
  179.  
  180. @endp macro name
  181.  _&name endp
  182.  endm
  183.  
  184.