Dec 162017
C library fr. CL mag 3-87. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
$$DAT.ASM | 1078 | 469 | deflated |
$MAIN.ASM | 2269 | 1058 | deflated |
%AZTEC.INC | 11916 | 2841 | deflated |
%C86.INC | 9653 | 2429 | deflated |
ABORT.ASM | 503 | 273 | deflated |
CLOSE.ASM | 419 | 262 | deflated |
CREAT.ASM | 958 | 489 | deflated |
CROOT.ASM | 512 | 254 | deflated |
D2IO.H | 1031 | 489 | deflated |
D2IOH.INC | 2255 | 784 | deflated |
EXIT.ASM | 529 | 249 | deflated |
FCLOSE.ASM | 633 | 369 | deflated |
FGETC.ASM | 1745 | 809 | deflated |
FGETS.ASM | 751 | 443 | deflated |
FINFO.ASM | 2527 | 940 | deflated |
FOPEN.ASM | 2007 | 962 | deflated |
FPRINTF.ASM | 581 | 329 | deflated |
FPUTC.ASM | 1136 | 582 | deflated |
FPUTS.ASM | 679 | 320 | deflated |
FRDWR.ASM | 1202 | 558 | deflated |
FSEEK.ASM | 791 | 454 | deflated |
FTELL.ASM | 369 | 222 | deflated |
GETDRV.ASM | 666 | 346 | deflated |
GETS.ASM | 1099 | 290 | deflated |
GETW.ASM | 933 | 474 | deflated |
IOCTL.ASM | 442 | 273 | deflated |
ISDIGIT.ASM | 287 | 196 | deflated |
ISLOWER.ASM | 295 | 208 | deflated |
ISUPPER.ASM | 309 | 219 | deflated |
LBEGIN.ASM | 4733 | 1879 | deflated |
LSEEK.ASM | 444 | 271 | deflated |
MAKEFNM.ASM | 4070 | 962 | deflated |
OPEN.ASM | 841 | 470 | deflated |
PRINTF.ASM | 565 | 319 | deflated |
PUTS.ASM | 389 | 243 | deflated |
PUTW.ASM | 964 | 483 | deflated |
RDWR.ASM | 567 | 326 | deflated |
RENAME.ASM | 354 | 230 | deflated |
REWIND.ASM | 363 | 211 | deflated |
RINDEX.ASM | 494 | 305 | deflated |
SDATIM.ASM | 2401 | 978 | deflated |
SHRINK.MAP | 2330 | 918 | deflated |
SPRINTF.ASM | 553 | 312 | deflated |
STRCAT.ASM | 586 | 319 | deflated |
STRCHR.ASM | 408 | 262 | deflated |
STRCMP.ASM | 791 | 436 | deflated |
STRCPY.ASM | 598 | 346 | deflated |
STRLEN.ASM | 312 | 210 | deflated |
TIMER.ASM | 1012 | 551 | deflated |
TLBMAC.DOC | 17555 | 4950 | deflated |
TOLOWER.ASM | 297 | 211 | deflated |
TOUPPER.ASM | 308 | 214 | deflated |
UNGETC.ASM | 1006 | 529 | deflated |
UNLINK.ASM | 272 | 188 | deflated |
XTRMOD.ASM | 2886 | 828 | deflated |
_FMT.ASM | 9805 | 3372 | deflated |
_MAIN.ASM | 2106 | 845 | deflated |
_STRHAND.ASM | 936 | 515 | deflated |
_XN.ASM | 3981 | 1721 | deflated |
Download File TINYLIB.ZIP Here
Contents of the TLBMAC.DOC file
MAKING ASSEMBLER CODE PORTABLE
Tinylib uses compiler-specific "include" files to take care of all the
differences from one compiler's requirements to another. These files provide
standardized macros to generate ASM code that meets a specific compiler's
coding conventions. Separate include files for each compiler, and for each
memory model within any compiler that permits a choice, are required. At
present, include files for C86 V1.33 (small model), and for Aztec C V3.40
(large model) are provided.
Each file is a macro library. The one to be used should be copied with the
name "COMPILER.INC". Each separate module source file in the Tinylib package
begins with the directive "include compiler.inc", and makes extensive use of
these macro facilities to accomodate global-symbol name conventions, memory
models, storage allocation and reference, subroutine calling, and so forth.
The standard macros defined, their parameters (if any), and their actions are
described in the following paragraphs.
Macro Name: ttl
Parameters: modnam, vrsn, date, auth
Defines module name, title line, and revision status for the module.
Required as first macro in each module.
Macro Name: dseg
(no parameters)
Defines start of data segment, and establishes compiler-specific segment-name
or group-name.Required in each module even if data segment is not used.
Macro Name: exterr
(no parameters)
Declares global error value symbol (as external). Actual symbol used depends
on compiler's conventions. See also, , and .
Macro Name: defptr
Parameters: ptrnam
Defines as a global symbol and reserves space to store a pointer
value.May modify actual symbol as required by compiler conventions. Defines
symbol as a WORD for small or program model, or as a DWORD for large or data
model.
Macro Name: extv
Parameters: vname, type
Defines as a global symbol external to the current module. May
modify actual symbol as required by compiler conventions. Defines symbol type
as; no checks of are made. Can be used for CODE or DATA.
Macro Name: glblvl
Parameters: list
Permits several global symbols to be defined on one line of the source file.
Parameter
Tinylib uses compiler-specific "include" files to take care of all the
differences from one compiler's requirements to another. These files provide
standardized macros to generate ASM code that meets a specific compiler's
coding conventions. Separate include files for each compiler, and for each
memory model within any compiler that permits a choice, are required. At
present, include files for C86 V1.33 (small model), and for Aztec C V3.40
(large model) are provided.
Each file is a macro library. The one to be used should be copied with the
name "COMPILER.INC". Each separate module source file in the Tinylib package
begins with the directive "include compiler.inc", and makes extensive use of
these macro facilities to accomodate global-symbol name conventions, memory
models, storage allocation and reference, subroutine calling, and so forth.
The standard macros defined, their parameters (if any), and their actions are
described in the following paragraphs.
Macro Name: ttl
Parameters: modnam, vrsn, date, auth
Defines module name, title line, and revision status for the module.
Required as first macro in each module.
Macro Name: dseg
(no parameters)
Defines start of data segment, and establishes compiler-specific segment-name
or group-name.Required in each module even if data segment is not used.
Macro Name: exterr
(no parameters)
Declares global error value symbol (as external). Actual symbol used depends
on compiler's conventions. See also
Macro Name: defptr
Parameters: ptrnam
Defines
value.May modify actual symbol as required by compiler conventions. Defines
symbol as a WORD for small or program model, or as a DWORD for large or data
model.
Macro Name: extv
Parameters: vname, type
Defines
modify actual symbol as required by compiler conventions. Defines symbol type
as
Macro Name: glblvl
Parameters: list
Permits several global symbols to be defined on one line of the source file.
Parameter
- is a list of parameter sets for macro
- is empty.
Macro Name: glblv
Parameters: vname, type, val
Defines
compiler conventions. Defines symbol to be of type defined by
initialized to
Valid Types:
No other symbols may appear as the
Macro Name: cseg
(no parameters)
Defines end of data segment and start of code segment, and establishes
compiler-specific segment-name or group-name. Required in each module even if
code segment is not used.
Macro Name: xtfs
Parameters: list
Permits several external functions to be defined on one line of the source
file. Parameter
- is a list of parameters for macro
- is empty.
Macro Name: extf
Parameters: fname
Defines
Type (NEAR or FAR) is compiler-dependent and is automatically included. Symbol
may be modified to comply with compiler conventions.
Macro Name: moverr
Parameters: val
Sets global error value from
reference). Actual symbol used for global error value depends on compiler's
conventions. See
Macro Name: geterr
Parameters: val
Gets global error value into
reference. Actual symbol used for global error value depends on compiler's
conventions. See
Macro Name: saverr
(no parameters)
Copies global error value into stream table, assuming SI points to it.
Actual symbol used for global error value depends on compiler's conventions.
See
Macro Name: procdef
Parameters: pname, args
Defines a global procedure with name
conform to compiler's conventions. Saves BP and defines symbols to reference
arguments passed to procedure as specified by the
PROC block which must be closed with
NOT be nested.
Macro Name: dargs
Parameters: list
Interfaces procedure-defining macros
macro.Parameter
- is a list of parameter sets for macro
- is empty.
Macro Name: darg
Parameters: aname, type
Equates
typed assemblers such as MASM, defines symbol same as
suffixed to be actual offset value, and defines
Automatically maintains offset values using argument size obtained from
parameter.
Valid Types:
No other strings are valid for
Macro Name: locs
Parameters: list
Terminates set of
variable space. Parameter
- is a list of parameter sets for
macro should be used only once per procedure definition.
Macro Name: dclv
Parameters: lvnm, type, asiz
Defines
determined by
else
here; major difference between
values.
Valid Types:
No other strings are valid for
Macro Name: alias
Parameters: pname, altnam
Declares
for procedures such as "strchr()" and "index()". May modify actual symbol to
conform to compiler's global-symbol conventions.
Macro Name: entrdef
Parameters: pname
Declares
accepting the same list of arguments declared with macro
procedure's primary definition. May modify actual symbol to conform to
compiler's global-symbol conventions.
Macro Name: statdef
Parameters: pname, args
Local equivalent of
procedure as specified by the
be closed with
Macro Name: internal
Parameters: pname
Defines a static (local) procedure with name
Establishes PROC block which must be closed with
procedures may NOT be nested.
Macro Name: intrdef
Parameters: pname
Local equivalent of
for a local procedure, accepting the same list of arguments declared with macro
Macro Name: callit
Parameters: pname, args
Generates complete call sequence to global procedure
count of the number of bytes pushed, issues CALL (modifying
by compiler's conventions), and flushes stack upon return. Note that
list is processed left to right while C conventions usually require
reverse-order stacking; thus arguments must appear in the REVERSE of their
normal sequence in the
Macro Name: pushargs
Parameters: list
Interfaces procedure-calling macros such as
- is a list of parameter sets for macro
first parameter set, repeating until
- is empty. Thus the LAST parameter
set in the
- will be at the lowest stack address when this macro
terminates.
Macro Name: pusharg
Parameters: varib, type, segref
Pushes word or words specified by
arguments for a call to another procedure. Number of words pushed is specified
by parameter
a segment reference. Maintains count of number of bytes pushed for use in
flushing stack later.
Valid Types:
location
location
Must be 16-bit register; counts 2 bytes.
pointer register
omitted, uses default value for
Counts 4 bytes.
location
Word at
stack.Counts 2 bytes in small or program
model, 4 in data or large.
onto stack. Counts 2 bytes in small or
data model, 4 in program or large.
Segment address is pushed first, in large
or program model, followed by offset.
No other strings are valid for
Macro Name: pushptr
Parameters: pointer
For data or large model, pushes content of memory reference
the stack. For all models, pushes content of
Macro Name: popptr
Parameters: pointer
Inverse of macro
for all models. For data or large model, then pops from stack into
Macro Name: pshloc
Parameters: vnam
Pushes content of local variable
declared for
Macro Name: psharg
Parameters: anam
Pushes content of argument
referenced as a WORD.
Macro Name: pushreg
(no parameters)
Generates PUSH DI/PUSH SI and sets HAVEREG flag to indicate that registers
have been saved.
Macro Name: popreg
(no parameters)
If HAVEREG is clear, does nothing. If set, generates POP SI/POP DI and
clears HAVEREG flag to indicate that registers have been restored.
Macro Name: pushds
(no parameters)
In small or program model, does nothing. In large or data model, generates
PUSH DS and sets HAVEDS flag to indicate that DS has been saved.
Macro Name: popds
(no parameters)
In small or program model, or if HAVEDS flag is clear, does nothing.In
large or data model, if HAVEDS flag is set, generates POP DS and clears HAVEDS
flag to indicate that DS has been restored.
Macro Name: ldptr
Parameters: dest, argname, segref
Loads register
model, generates a MOV
is ignored.
In data or large models the macro is much more complex: If
a "LDS" instruction is generated. If it is "ES", a "LES" instruction results.
If
"DI", and any other value for the
If
generated. The first loads
from
Macro Name: svptr
Parameters: dest, argname, segref
Stores an arg pointer from registers
starting at
models. If
those described for macro
Macro Name: setptr
Parameters: ptrnam, sym, segref
Sets global, static, or auto memory location
ignored; if omitted large or data model macro will assign default. Note that
AX is destroyed.
Macro Name: ptrcpyinc
Parameters: from, to
Copies value pointed to by parameter
memory location
(and DX in the large or data model) for the transfer; fetches with macro
Macro Name: extraseg
(no parameters)
Forces ES to same value as DS, by PUSH/POP sequence.No other registers or
flags are affected.
Macro Name: gci
Parameters: ptrnam
Fetches single byte pointed to by
post-increments
incremented register back into
actions; if more than a couple of bytes are to be fetched, separate
LODSB, and
Macro Name: pci
Parameters: ptrnam
Inverse of
using DI register, and post-increments
apply.
Macro Name: gwi
Parameters: ptrnam
Same as
apply.
Macro Name: pwi
Parameters: ptrnam
Same as
apply.
Macro Name: caseb
Parameters: val, goto
Compares content of AL with parameter
reference, or register. If equal, branches to "short label"
Macro Name: casew
Parameters: val, goto
Same as
Macro Name: retptrm
Parameters: src
Generates code to return a pointer value in DX:AX. If CY flag is set when
this code is reached, a NULL pointer value is returned. If not, the value from
memory location
AX, and that from the following word is returned in DX. Uses macro
generate actual return code.
Macro Name: retptrr
Parameters: src,seg
Generates code to return a pointer value in DX:AX. If CY flag is set when
this code is reached, a NULL pointer value is returned. If not, the value from
that from
code.
Macro Name: retnull
(no parameters)
Generates code to return a NULL value in AX (and DX for large model). Uses
macro
Macro Name: retyes
(no parameters)
Generates code to return a value of 0001 in AX only.Uses macro
generate actual return code.
Macro Name: pret
(no parameters)
Restores BP and registers, then executes RET. Note that since
flags that indicate registers have been pushed, it must not be used more than
once per procedure. Since the other "ret" macros all invoke
of this group should be used.
Macro Name: iend
Parameters: pname
Ends definition of the static or internal procedure named
Macro Name: pend
Parameters: pname
Ends definition of the global procedure named
macro which began the definition).
Macro Name: finish
(no parameters)
Ends definition of the code segment and the module. Required for all
modules; must be last line of source file.
============= end of description =============
December 16, 2017
Add comments