home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 5
/
ctrom5b.zip
/
ctrom5b
/
PROGRAM
/
ASM
/
ALIB30A
/
ALIB1.DOC
< prev
next >
Wrap
Text File
|
1994-12-18
|
16KB
|
439 lines
ALIB Version 3.0
==================
Copyright (C) 1994 Owens Consulting and
Jeff Owens, 10-09-94
24551 Metzler Park
Estacada, OR 97023
kowens@teleport.com
What is it?
-------------
ALIB is a library of common functions needed by assembly
language programmers. Some of the functions included in
ALIB are:
* Database * Compression * Memory Manager
* Menuing * Floating Math * Hyper text
* Windowing * Hardware analysis
For years assembly language has been regarded as somewhat
tedious and difficult, but its small size, unlimited
freedom, and performance have kept it very much alive.
This library attempts to remove some of the tedium by
adding a set of high level functions to the programmers
arsenal. With ALIB it is possible to write DOS programs
in a few minutes.
Why was it written?
-------------------
ALIB was written because the author enjoys Assembler
and the sharing of code. Some of the code could be
improved, but it was felt that a free exchange or code
is more important than having perfect code. The author
encourages communication and questions from anyone who
shares these beliefs.
What hardware and software is needed?
-------------------------------------
For use with IBM PS/2, XT, PC and compatibles with DOS 2.1
or greater capability. The following software will be
needed to make use of ALIB:
1. Assembler for 8088,8086,80386, etc. Known assemblers
are: A86 (Shareware), MASM (Microsoft), TASM
(Borland), OPTASM (SLR Systems).
2. Linker to handle the .OBJ file produced by
the assembler. Linkers are usually sold
with the assembler except in the case of
A86.
3. Debugger for testing. Many assemblers have
a companion debugger which is sold separately.
All of these debuggers are adequate. The
old standby DOS DEBUG program will work, but
it needs symbolic capability for serious
work. The independently produced Periscope
debuggers are also very good.
How do I install it?
--------------------
To initially explore ALIB it is best to place it in a
separate directory and work with it there. No special
installation process is necessary. Eventually, the
library itself (ALIB.LIB) can be placed in a common
directory of assembly tools and the remaining files
archived.
What files make up ALIB?
------------------------
ALIB.LIB Library of functions
ALIB1.DOC General information
ALIB2.DOC Summary of library functions
ALIB3.DOC Detailed description of library functions
TEMPLATE.ASM Sample format for most programs
COMMON.INC Inputs for sample programs
MAC.INC Macros for sample programs
LOAN.ASM Sample program, computes loan parameters
LOAN.EXE
COMPRES.ASM Sample program, compress a file
COMPRES.EXE
RESTOR.ASM Sample program, uncompress a file
RESTOR.EXE
DISKINFO.ASM Sample program to display DOS disk info.
DISKINFO.EXE
EDREC.ASM Sample program & library utility (see file)
EDREC.EXE
HYPER.ASM Sample program to demonstrate hyper text
HYPER.DAT Hyper text data for HYPER.EXE
HYPER.EXE Sample program and tutorial
SCAN.ASM Sample program to scan disk files
SCAN.EXE
SORT.ASM Sample program to sort data in a file
SORT.EXE
TIMER.ASM Sample program to time code or programs
TIMER.EXE
MEMORY.ASM Sample program to show memory status
MEMORY.EXE
QUOTE.ASM Sample program to display a random quote
QUOTE.EXE
FILE_ID.DIZ Short description for BBS usage
What files help with understanding ALIB?
----------------------------------------
Assembly language programmers can get started by looking at
TEMPLATE.ASM and then using ALIB2.DOC, ALIB3.DOC and the sample
programs as reference maternal. Novice programmers should probably
execute the sample program called HYPER and study the material,
then study the sample programs, starting with TEMPLATE.ASM.
Is registration necessary?
--------------------------
Registration of ALIB is not required for personal or
commercial use. However, ALIB will not grow and improve
without some support. If you have a useful piece of code
or comment, please send it to the author for future updates.
Program and Manual by Jeff Owens
Owens Consulting, 24551 Metzler Park
Estacada Oregon 97023
kowens@teleport.com
Can I distribute ALIB to others?
--------------------------------
You are free to distribute this program, provided that
neither the program nor this document are changed, and the
program and this document are kept together. Only a
marginal fee may be asked for shipment and handling when
distributing. You are not allowed to sell this program.
What if problems occur?
-----------------------
Problems? What problems? After two years of work no
programmer wants to talk about problems. But, the truth
is that problems will occur. Either the documentation
will not be adequate, bugs will be found, or necessary
features will be missing. The answer to all these
problems is the same, either discard ALIB or support it.
My pledge is to support ALIB without any monetary gain as
long as there is a reasonable interest level.
Legal disclaimer
---------------
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO
THE QUALITY AND PERFORMANCE OF THE PRODUCT IS WITH YOU.
SHOULD THE PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
IN NO EVENT WILL OWENS CONSULTING, OR ANY OTHER PARTY WHO
MAY HAVE REDISTRIBUTED THE PRODUCT AS PERMITTED ABOVE, BE
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE PRODUCT (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF
THE PRODUCT TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
Limitations:
-------------
ALIB is definitely not for everyone. If you are interested in
graphic screens, buttons, etc. then look elsewhere. This
library is not for graphic applications. On the other
hand, lack of graphics greatly increases compatibility,
speed, and reduces code size.
ALIB is not designed to be accessed from other languages.
It is possible, but not advised. The use of registers,
memory, and display all are designed as if ALIB is the
main program.
ALIB is not designed for use with TSR (Terminate and
Stay Resident) programs. Most of the functions will
work with TSR's but those calling the memory manager
will not function.
And last but not least, the documentation for ALIB is
very breif and does not explain some of the more complicated
functions in sufficient detail for all audiences.
COMPRES & RESTOR
----------------
Purpose:
--------
COMPRES and RESTOR are sample program to show how huffman
compression works. Single files can be compressed by the
COMPRES program, then decompressed by the RESTOR program.
Using COMPRES & RESTOR
----------------------
To compress a file type "COMPRES file1 file2". The first
file (file1) is the file to be compressed and the
second file is what to call the result. RESTOR works
in the reverse. "RESTOR file1 file2" will decompress
file1 and put at file2.
Compression Overview
--------------------
The compression/decompression engines are initiated with a
pointer to two routines. One routine will feed data to the
engine and the other will store the output. Next, one call
to the compression entry point will continue compressing
until the input (feed) routine runs out of data.
Performance
-----------
Compression speed and size is respectable, but not competative
with programs such as PKZIP and ARJ. For most compression jobs
of less than a megabyte the speed will be acceptable.
DISKINFO
--------
Purpose:
--------
DISKINFO displays information which DOS is using to manage
disks. It may be useful for debugging a disk problem, but
will not be of interest to most programmers.
Using DISKINFO
--------------
DISKINFO does not have any parameters, and can be executed
simply by typeing "DISKINFO"
LOAN Payments
-------------
Purpose:
--------
LOAN is a sample program to show how floating point math can
be performed. It will calculate a 12 month table showing
what portions of payments go to principal and interest.
Using LOAN
----------
To calculate the loan parameters, type "LOAN"<Enter> and
enter the loan amount, principal, and interest. The
program will do the rest.
Floating Point Overview
-----------------------
LOAN operates by first allocating 8 floating variables. Then,
three of the variables are set to the payment amount, principal,
and interest respectivly. Each of the 8 allocated variables
are referenced by a number or token. The first variable is #1,
the second #2 etc. This makes it vary easy to add two variables
by just saying add #1 to #2. When, the calculations are done,
they are extracted by calling "text_out" to convert from
floating point format to a printable ascii text string.
EDREC (Edit Records)
--------------------
Purpose
-------
EDREC is both a sample program and ALIB utility program. Files
created by EDREC use ALIB database format which is also used by
hyper message and error displays. This greatly simplifies the
process of creating a file of error messages or help screens.
Using EDREC
-----------
EDREC can be started by typing EDREC or by typing EDREC followed
with a file name. If the file exists, EDREC will display the first
record and wait for input. If the file does not exist the record
window will be blank.
The data entered using EDREC is probably going to be displayed in
a window someday, so the window size should be selected to make
data entry easier. The record window size is set by the "Config"
menu option.
After setting the window size, select "Edit" to add or modify
records.
Database Format
---------------
EDREC creates records in a window which can be configured to any size.
Each record is variable length and terminated by a null (hex 00 char).
SORT
-------------
Purpose:
--------
Sort disk file using the "merge sort" algorithm.
Using sort
----------
SORT <file> <starting column> <length of sort field>
SORT reads the given file, sorts the records using the specified
column. One line ending with cr/lf is assumed to be one record.
Example: To sort all TEST.DAT using columns 1-5.
SORT test.dat 1 5
SCAN
-------------
Purpose:
--------
Scan disk for string.
Using newscan
----------
SCAN <files/path> <pattern>
SCAN starts searching from the current directory and checks each
each file which matches the <files/path> specification for the
<pattern>
Example: To scan all .ASM files in the current directory
for include files:
SCAN *.asm include
To scan all the files in the current and its subdirectories
for include files:
SCAN *.* include
The <files/path> parameter applies to both files and subdirectories.
Thus, if you type "SCAN X*.* include" it will look in the current
directory and all subdirectories which begin with "X" for files
which begin with "X"
HYPER.ASM
---------
Purpose:
--------
HYPER.ASM is intended to demonstrate a simple hyper database
which describes ALIB.LIB use.
Using HYPER.ASM
---------------
The files HYPER.EXE and HYPER.DAT must be in the same directory.
HYPER is started by typing "HYPER"<cr> without any parameters.
QUOTE.ASM
---------
Purpose:
--------
QUOTE.ASM is intended to demonstrate calling a random generator
and finding files located in same directory as executable.
It will display a random quote each time it is called.
Using QUOTE.ASM
---------------
The files QUOTE.EXE and QUOTE.DAT must be in the same directory.
QUOTE is started by typing "QUOTE"<cr> without any parameters.
MEMORY.ASM
----------
Purpose:
--------
MEMORY.ASM display the memory information available from
ALIB. Include are the MCB chain, and the size of DOS,
XMS, and EMS memory.
TIMER
-----
Purpose:
--------
TIMER is a sample program to show how the timer funcitons can
be used. The unmodified program will time the execution of
programs, but it can be modified to time code segments.
Using TIMER
----------
To time a program, type "TIMER <program name>"<Enter>
TIMER will execute the program and display the elapsed
time when the program exits.