home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / tcmac / tmacs.man < prev   
Text File  |  1987-07-11  |  6KB  |  191 lines

  1.  
  2.  
  3.  
  4. TMACS(3)              MASM Macros            TMACS(3)
  5.  
  6.  
  7.  
  8. NAME
  9.     model, segdef, cseg, endcs, dseg, endds, bseg, endbs, procedure,
  10.     endproc - MASM macros to automate the segmentation, procedure
  11.     preamble, and procedure epilog declarations required in order to
  12.     be Turbo C linkable
  13.  
  14. SYNOPSIS
  15.     include tmacs.asi
  16.  
  17.     model  model_name
  18.     segdef [ module_name ]
  19.     cseg   [ module_name ]
  20.     endcs  [ module_name ]
  21.     dseg   [ module_name ]
  22.     endds  [ module_name ]
  23.     bseg
  24.     endbs
  25.     procedure proc_name [, public? ]
  26.     endproc   proc_name
  27.  
  28. DESCRIPTION
  29.     Tmacs.asi is a MASM include file containing the definitions of
  30.     macros used to automate the segmentation and proc declarations
  31.     for MASM source files to be used with Turbo C. The macros are
  32.     designed to work correctly with all six memory models and to
  33.     allow the programmer to ignore the model dependent aspects of
  34.     these declarations. Other model dependent characteristics, such
  35.     as stack format, are currently not handled. The following macros
  36.     and parameters are defined:
  37.  
  38.     model model_name
  39.  
  40.     This macro is required and must be the first macro invoked. The
  41.     parameter model_name is also required and must be one of the
  42.     following: TINY, SMALL, COMPACT, MEDIUM, LARGE, or HUGE and must
  43.     be upper-case. This macro allows remaining macros to be model
  44.     independent. If model_name is not specified an error 94 is
  45.     generated.
  46.  
  47.     segdef [ module_name ]
  48.  
  49.     This macro is required and defines the order of the text, data,
  50.     and bss sements, defines dgroup, and defines the text segment
  51.     assume for the specified model. Its invocation should precede
  52.     the invocation of the remaining macros. The parameter
  53.     module_name is required only if the model specified is MEDIUM,
  54.     LARGE, or HUGE and is ignored otherwise. If the module name is
  55.     required and is not present an error 94 is generated. Since
  56.     module_name is ignored when not required, it's probably good
  57.     style to alway specify it. The module_name specified must also
  58.     be used in subsequent macros requiring a module_name parameter.
  59.  
  60.  
  61.  
  62.  
  63.                  [ 1 ]
  64.  
  65.  
  66.  
  67. TMACS(3)              MASM Macros            TMACS(3)
  68.  
  69.  
  70.  
  71.     cseg [ module_name ]
  72.  
  73.     This macro opens the text segment for code definition. The
  74.     parameter module_name is required only if the model specified is
  75.     MEDIUM, LARGE, or HUGE    and is ignored otherwise. If the module
  76.     name is required and is not present an error 94 is generated.
  77.     Since module_name is ignored when not required, it's probably
  78.     good style to alway specify it. The module_name specified must
  79.     match the module_name parameter to the segdef macro, though this
  80.     is not currently checked.
  81.  
  82.     endcs [ module_name ]
  83.  
  84.     This macro closes the text segment and must be correctly paired
  85.     with a preceding cseg macro invocation. The parameter
  86.     module_name is required only if the model specified is MEDIUM,
  87.     LARGE, or HUGE    and is ignored otherwise. If the module name is
  88.     required and is not present an error 94 is generated. Since
  89.     module_name is ignored when not required, it's probably good
  90.     style to alway specify it. The module_name specified must match
  91.     the module_name parameter to the segdef macro, though this is
  92.     not currently checked.
  93.  
  94.     dseg [ module_name ]
  95.  
  96.     This macro opens the data segment for data definition. The
  97.     parameter module_name is required only if the model specified is
  98.     HUGE  and is ignored otherwise. If the module name is required
  99.     and is not present an error 94 is generated. Since module_name
  100.     is ignored when not required, it's probably good style to alway
  101.     specify it. The module_name specified must match the module_name
  102.     parameter to the segdef macro, though this is not currently
  103.     checked.
  104.  
  105.     endds [ module_name ]
  106.  
  107.     This macro closes the data segment and must be correctly paired
  108.     with a preceding dseg macro invocation. The parameter
  109.     module_name is required only if the model specified is HUGE  and
  110.     is ignored otherwise. If the module name is required and is not
  111.     present an error 94 is generated. Since module_name is ignored
  112.     when not required, it's probably good style to alway specify it.
  113.     The module_name specified must match the module_name parameter
  114.     to the segdef macro, though this is not currently checked.
  115.  
  116.     bseg
  117.  
  118.     This macro opens the bss segment for data definition. Generally
  119.     this macro is not used but is provided in case it is needed. If
  120.     the model specified is HUGE, this macro has no effect.
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                  [ 2 ]
  127.  
  128.  
  129.  
  130. TMACS(3)              MASM Macros            TMACS(3)
  131.  
  132.  
  133.  
  134.     endbs
  135.  
  136.     This macro closes the bss segment and must be correctly paired
  137.     with a preceding bseg macro invocation. If the model specified
  138.     is HUGE, this macro has no effect.
  139.  
  140.     procedure proc_name [, public? ]
  141.  
  142.     This macro defines a proc header for the named proc and includes
  143.     preamble code to save the si, di, and bp registers, initialize
  144.     the bp register, and, in the HUGE model, save and initialize the
  145.     ds register. The parameter proc_name is required and an error 94
  146.     is generated if it is not specified. If the parameter public? is
  147.     non-empty, the proc_name wil have an underscore character
  148.     prepended to it and be declared as a public symbol.
  149.  
  150.     endproc proc_name
  151.  
  152.     This macro defines the epilog code and endp directive for the
  153.     named proc and must be correctly paired with a preceding
  154.     procedure macro invocation. The epilog code restores the si, di,
  155.     and bp registers and ,in the HUGE model, the ds register. The
  156.     parameter proc_name is required and an error 94 is generated if
  157.     it is not specified. Like the procedure macro, endproc prepends
  158.     an underscore to the proc_name if it was declared a public
  159.     symbol.
  160.  
  161. BUGS
  162.     There is a lot of symbol definition cross-checking between the
  163.     macros that needs to be done but isn't.
  164.  
  165.     The macro procedure uses the same model specification for all
  166.     procs. It will not allow you to define local procs as near and
  167.     public procs as far.
  168.  
  169. AUTHOR
  170.     Richard Hargrove
  171.     Texas Instruments, Inc.
  172.     P.O. Box 869305, m/s 8473
  173.     Plano, TX 75086
  174.     214/575-4128
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.                  [ 3 ]
  190.  
  191.