📄 asmlib.doc
字号:
ASMLIB 3.5 Programmer's Toolkit
tools for assembly-language programming
Copyright (C) 1991 - 1993 Douglas Herr - All rights reserved
What is ASMLIB?
ASMLIB is a library of assembly-language subroutines, linkable with
your .OBJ code. ASMLIB provides many tools to the assembly-language
programmer which eliminate much of the tedious and repetetive coding
that assembly-language programming is infamous for.
DISTRIBUTION AND REGISTRATION
ASMLIB is user-supported software, NOT public domain software.
Possession of the ASMLIB files entitles you to evaluate this product.
If, after evaluation, you choose to use ASMLIB subroutines in your
programs, you are expected to register with the library's author.
By registering, you will be entitled to use the latest version of ASMLIB,
you will be entitled to low-cost upgrades, you will have confidence that
the version of ASMLIB you are using has not been altered by others, and
you will be supporting my programming efforts.
Two levels of registration are available: For $25, you will recieve the
most recent version of ASMLIB (tiny, small, medium and huge models); for
$50 you will receive full source code to the ASMLIB subroutines along with
the assembled libraries. If you first register at the $25 level, you may
register for ASMLIB source code at any time for $25. Upgrades for either
level of registration are $10.
Register by sending the registration fee to:
Douglas Herr
P. O. Box 207
Sacramento, CA 95812
U.S.A.
Telephone (916) 721-8762
CompuServe 71247,3542
Please specify either 5 1/4 or 3 1/2 inch disks. Bug reports (if any)
should be sent to the same address. If you wish to contact me by
telephone, please call after 8:00 PM Pacific time so I can get my kids
in bed.
Registration is a LICENSE fee, not a purchase of ASMLIB. Registered users
may use ASMLIB or modified subroutines based on ASMLIB source code in their
own programs. Registered users may distribute programs using ASMLIB
subroutines without royalty payments.
ASMLIB object files, ASMLIB source code (unmodified or modified) and the
ASMLIB library and documentation remain the property of Douglas Herr.
ASMLIB source code, modified or unmodified, may not be re-distributed.
The ASMLIB3 shareware package includes these files:
ASMLIB.LIB the ASMLIB medium model library
ASMLIB.DOC this introductory file
DATA.DOC documentation for string and integer data manipulation
DISK.DOC documentation for disk & file subroutines
EMSXMS.DOC documentation for EMS and XMS subroutines
FLOAT.DOC documentation for floating-point subroutines
GRAPHICS.DOC documentation for ASMLIB graphics
INPUT.DOC documentation for keyboard input subroutines
MODE.DOC ASMLIB screen mode subroutines
MULTIWIN.DOC documentation for text-mode multi-window subroutines
SOLVE.DOC documentation for ASMLIB mathematical solutions
SYSTEM.DOC documentation for subroutines which determine PC status
TEXT.DOC documentation for text-mode video subroutines
STARTUP.ASM sample startup code
ASM.INC medium model INCLUDE file for STARTUP.ASM
ASMDEMO.ZIP archive of simple ASMLIB demonstration program
These files may be copied and distributed freely provided that all the
above files are distributed together in unmodified or archived form
and provided that distribution charges are less than $10.
LIMITED LIABILITY
Since I am unable to supervise all uses of ASMLIB, I cannot be held
responsible for any damages, either direct or incidental, resulting
from the use or abuse of ASMLIB. I have used ASMLIB subroutines on
a wide variety of equipment and have found the library to be highly
compatible with common PC equipment, but you must use this library at
your own risk. Try it before you buy it.
COMPATIBILITY
ASMLIB subroutines are intended for IBM PC, XT, AT, PS/2, and compatible
equipment in real mode with PC-DOS or MS-DOS operating systems. I cannot
provide support for use of ASMLIB on other equipment or with other operating
systems.
ABBREVIATIONS for video boards
MDA IBM-standard Monochrome Display Adapter
CGA IBM-standard Color Graphics Adapter (ugh!)
MCGA IBM-standard Multi-color Graphics Array
EGA IBM-standard Enhanced Graphics Adapter
VGA IBM-standard Video Graphics Array
SVGA VGA equipment with additional capabilities
ATT ATT 6300 and compatible Olivetti
HGC Hercules Graphics Card and compatibles
HGC+ Hercules Graphics Card Plus
InC Hercules InColor Card
OTHER ABBREVIATIONS
CF = Carry Flag
ZF = Zero Flag
SF = Sign Flag
ASSUMPTIONS
Unless otherwise stated, ASMLIB subroutines assume that:
1) All strings are terminated with a NUL character.
2) Subroutines with names including '$' trash registers, and are
intended primarily for ASMLIB's internal use. All '$' subroutines
require a near call. Documentation for '$' subroutines is in
SOURCE.DOC, provided to registered ASMLIB programmers.
3) ASMLIB subroutines without '$' in the name require a far call, and
are compatible with object files assembled with the
.model medium
directive. Subroutines in ASMSMALL.LIB, provided upon registration,
require a near call, and are compatible with object code assembled with
the
.model small
directive. Subroutines in ASMTINY.LIB, provided to registered
programmers, also require near calls and are intended for development
of .COM format programs. ASMTINY is compatile with object code assembled
with the TASM
.model tiny
directive. MASM users may use the TINY.INC include file to achieve the
same results. Subroutines in ASMHUGE.LIB, also provided upon
registration, includes support for data blocks > 64k. Support
for huge data is indicated in the description of each subroutine.
Aside from the MODEL.INC include file and parameters as required for
HUGE model programming, ASMLIB source code does not need any alteration
when changing memory models. All ASMLIB source code is compatible with
MASM 5.0, MASM 5.1 and TASM 2.01.
4) ASMLIB data types are:
chr 1 byte
str character string, normally terminated with ASCII 0 (NUL)
I2 2-byte signed integer
U2 2-byte unsigned integer
I4 4-byte signed integer
U4 4-byte unsigned integer
F4 4-byte floating point value, IEEE format
F8 8-byte floating point value, IEEE format
5) ASMLIB GRAPHICS subroutines assume DS:@DATA
HOW DO I USE ALL THIS NEAT STUFF?
Any program that calls an ASMLIB subroutine must declare the subroutine as
an external procedure, like this:
extrn gedit:proc ; tell assembler to assume that GEDIT is an external
; procedure to be linked later
I also find it handy to make LINK search through ASMLIB for object code,
rather than specifying ASMLIB on the command line. Do this with the
command
includelib asmlib.lib ; automatic search through ASMLIB for externals
in your calling program. See STARTUP.ASM. (Note: this may not work with
TASM 2.01 & TLINK. You will need to specify ASMLIB on the command line.)
CALLING ASMLIB FROM C PROGRAMS
It's easy to call ASMLIB subroutines from C if you follow these simple
rules (Turbo C examples):
1) Tell your C program that the ASMLIB subroutine is a PASCAL function
This makes the C compiler convert the subroutine name to upper case
and supresses the _leading _underscore in the subroutine name.
Example:
extern void pascal tprint();
2) In case of naming conflicts (such as strlen), declare the ASMLIB
subroutine in upper case and use upper case in the C code.
Example:
extern void pascal STRLEN();
.
.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -