home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
assemblr
/
library
/
tcmac
/
tmacs.man
< prev
Wrap
Text File
|
1987-07-11
|
6KB
|
191 lines
TMACS(3) MASM Macros TMACS(3)
NAME
model, segdef, cseg, endcs, dseg, endds, bseg, endbs, procedure,
endproc - MASM macros to automate the segmentation, procedure
preamble, and procedure epilog declarations required in order to
be Turbo C linkable
SYNOPSIS
include tmacs.asi
model model_name
segdef [ module_name ]
cseg [ module_name ]
endcs [ module_name ]
dseg [ module_name ]
endds [ module_name ]
bseg
endbs
procedure proc_name [, public? ]
endproc proc_name
DESCRIPTION
Tmacs.asi is a MASM include file containing the definitions of
macros used to automate the segmentation and proc declarations
for MASM source files to be used with Turbo C. The macros are
designed to work correctly with all six memory models and to
allow the programmer to ignore the model dependent aspects of
these declarations. Other model dependent characteristics, such
as stack format, are currently not handled. The following macros
and parameters are defined:
model model_name
This macro is required and must be the first macro invoked. The
parameter model_name is also required and must be one of the
following: TINY, SMALL, COMPACT, MEDIUM, LARGE, or HUGE and must
be upper-case. This macro allows remaining macros to be model
independent. If model_name is not specified an error 94 is
generated.
segdef [ module_name ]
This macro is required and defines the order of the text, data,
and bss sements, defines dgroup, and defines the text segment
assume for the specified model. Its invocation should precede
the invocation of the remaining macros. The parameter
module_name is required only if the model specified is MEDIUM,
LARGE, or HUGE and is ignored otherwise. If the module name is
required and is not present an error 94 is generated. Since
module_name is ignored when not required, it's probably good
style to alway specify it. The module_name specified must also
be used in subsequent macros requiring a module_name parameter.
[ 1 ]
TMACS(3) MASM Macros TMACS(3)
cseg [ module_name ]
This macro opens the text segment for code definition. The
parameter module_name is required only if the model specified is
MEDIUM, LARGE, or HUGE and is ignored otherwise. If the module
name is required and is not present an error 94 is generated.
Since module_name is ignored when not required, it's probably
good style to alway specify it. The module_name specified must
match the module_name parameter to the segdef macro, though this
is not currently checked.
endcs [ module_name ]
This macro closes the text segment and must be correctly paired
with a preceding cseg macro invocation. The parameter
module_name is required only if the model specified is MEDIUM,
LARGE, or HUGE and is ignored otherwise. If the module name is
required and is not present an error 94 is generated. Since
module_name is ignored when not required, it's probably good
style to alway specify it. The module_name specified must match
the module_name parameter to the segdef macro, though this is
not currently checked.
dseg [ module_name ]
This macro opens the data segment for data definition. The
parameter module_name is required only if the model specified is
HUGE and is ignored otherwise. If the module name is required
and is not present an error 94 is generated. Since module_name
is ignored when not required, it's probably good style to alway
specify it. The module_name specified must match the module_name
parameter to the segdef macro, though this is not currently
checked.
endds [ module_name ]
This macro closes the data segment and must be correctly paired
with a preceding dseg macro invocation. The parameter
module_name is required only if the model specified is HUGE and
is ignored otherwise. If the module name is required and is not
present an error 94 is generated. Since module_name is ignored
when not required, it's probably good style to alway specify it.
The module_name specified must match the module_name parameter
to the segdef macro, though this is not currently checked.
bseg
This macro opens the bss segment for data definition. Generally
this macro is not used but is provided in case it is needed. If
the model specified is HUGE, this macro has no effect.
[ 2 ]
TMACS(3) MASM Macros TMACS(3)
endbs
This macro closes the bss segment and must be correctly paired
with a preceding bseg macro invocation. If the model specified
is HUGE, this macro has no effect.
procedure proc_name [, public? ]
This macro defines a proc header for the named proc and includes
preamble code to save the si, di, and bp registers, initialize
the bp register, and, in the HUGE model, save and initialize the
ds register. The parameter proc_name is required and an error 94
is generated if it is not specified. If the parameter public? is
non-empty, the proc_name wil have an underscore character
prepended to it and be declared as a public symbol.
endproc proc_name
This macro defines the epilog code and endp directive for the
named proc and must be correctly paired with a preceding
procedure macro invocation. The epilog code restores the si, di,
and bp registers and ,in the HUGE model, the ds register. The
parameter proc_name is required and an error 94 is generated if
it is not specified. Like the procedure macro, endproc prepends
an underscore to the proc_name if it was declared a public
symbol.
BUGS
There is a lot of symbol definition cross-checking between the
macros that needs to be done but isn't.
The macro procedure uses the same model specification for all
procs. It will not allow you to define local procs as near and
public procs as far.
AUTHOR
Richard Hargrove
Texas Instruments, Inc.
P.O. Box 869305, m/s 8473
Plano, TX 75086
214/575-4128
[ 3 ]