intro.txt

来自「汇编编程艺术」· 文本 代码 · 共 479 行 · 第 1/2 页

TXT
479
字号
		by the wrong name).

Version 34-	Fixed several problems in the documentation.  Some other
11/18/94	minor bug fixes including changing the CPUID name to
		CPUIDENT (to avoid conflict with Pentium CPUID instruction).
		Also modified IBML to use CPUIDENT rather than CPUID.

Version 35-	Fixed a problem with a signed comparison in the pattern
		matching code.  It turned out that if you failed on the
		first character of a string, it bombed the system.  Also
		changed the doc on patterns to fix an error.

Version 36-	Fixed a bug in the FREAD routine.  There are known bugs in
4/4/95		the floating point package, but cannot get a sample example
		to determine cause.

==============================================================================


ROUTINES WE WOULD LIKE TO HAVE:
*******************************

If you're interested in adding some routines to this
package, GREAT!  Here are some suggestions.

1) Routines which manipulate directories (read/write/etc.)
2) We did it already!
3) Length-prefixed strings package.
4) A graphics package.
5) An object-oriented programming class library.
6) Floating point functions (e.g., SIN, COS, etc.)
7) Just about anything else appearing in a HLL "standard" library.
If you've got any ideas, we would  love to discuss them with you.  The best
way to reach us is through the E-MAIL addresses above.


MISSING ROUTINES TO BE SUPPLIED IN THE FUTURE:
**********************************************


	Table Package
TblInit-	Initializes a particular table.
TblEnter-	Enters an item into a table.
TblLookup-	Looks up an item in a table.
TblFree-	Free up memory in use by a table.

	Tree Package
<pretty much the same routines as the list package>

	Set Package
<Generic set routines (not just character set routines) similar to cset pkg>


	Processes Package
Sleep-		Delays a process for some period of time.
YieldTo-	Transfers control to a specific process.
Forkm-		Allocates new PCB on the heap.
Sync-		Halts a process until another process dies.
Join-		Merges two processes together.
wait & release-	Semaphore/synchronization primitives.


	80386 Optimized Code
Despite the disclaimer about speed earlier in this document, we do have
plans to rewrite this routine for speed at some point in the future.
At that time we will write the code specifically for 80386 and later
processors (the code will probably be optimized for Pentium/586 processors
at that time).  Stay tuned.


HOW TO USE THE STANDARD LIBRARY:
********************************

When you are ready to begin programming with the library, you should
copy the shell.asm file, provided in the package, to another file in
which you will be working, i.e. myprog.asm.  The shell.asm file sets
up the machine (segments, etc.) as the UCR Standard Library expects
them.  Results are undefined for other setups.  Therefore, I strongly
suggest, that when you begin using these routines, you follow the
shell.asm format.  Later, when you are familiar with the software,
you may wish to create your own shell.asm file, but it is wise to
initially use the one provided.  The shell.asm file has comments which
tell you where to place your code, variables, etc.

There is an include file stdlib.a which
you should include in every assembly you perform which calls the stdlib
routines.  SHELL.ASM already includes this file.  *YOU MUST PLACE THE
INCLUDE STATEMENT OUTSIDE OF ANY SEGMENTS IN YOUR PROGRAM*.  Preferably
as the first line of your program (just like SHELL.ASM).  If you place
this include directive inside a segment, certain assemblers/linkers
(especially MASM) will not properly assemble and link your programs.
They will assemble and link without error, but the resulting program
will not execute correctly.

The STDLIB.A file contains macros you can use to call each of the routines
in the standard library.  For example, to call PRINTF you would use the
statement
		printf
		db	"format string",0
		db	other,vars

rather than "calling" printf.  Printf is actually a macro, you cannot call
it directly (all of the standard library routines have names like "sl_printf"
and the macro issues a call to the appropriate routine).  These macros have
two main purposes-- first, the differentiate calls to the standard library
routines (i.e., no "call" instruction is the difference); and second, they
contain some extra code to perform "smart linking" with MASM 5.1 & earlier,
TASM, and OPTASM.  MASM 6.0 supports a new directive, extrndef, which
eliminates the need for this extra code, but the extra code works nonetheless.

Starting with version 27, many of the standard library macros were separated
into smaller files.  This speeds up assembly when you don't need *all* of
the routines in the library (the macro file is getting quite large).
STDLIB.A still exists and still loads everything, but you should get in the
habit of specifying the smaller files instead.  For MASM 6.0 users, a
special set of include files "*.a6" are now available.  MASM 6.0 seems to
run out of memory if you include "stdlib.a6" (which includes everything) so
you may have to include only those files you actually use.


All of the standard library routines, and most of their local data values,
are in a segment named "stdlib".  You should not create such a segment unless
you plan on adding new routines to the standard library.


Note: 	if you want to use the pattern matching functions provided in the
	pattern matching package, you will need to include the following
	statement somewhere *after* the "include stdlib.a" or
	"include pattern.a" statement:

			matchfunc

	This declares the necessary external names required by the pattern
	matching operations.  The SHELL.ASM file contains a commented-out
	line with this statement.  If you use pattern matching in programs
	which start out as SHELL.ASM you can simply uncomment this line.



HOW THE STANDARD LIBRARY IS ORGANIZED:
**************************************

The documentation spec sheets for each of the standard library routines appear
in other files provided with the standard library.  We've organized these
routines by category.  The categories supported to date include

	Standard Input Routines
	Standard Output Routines
	Conversion Routines
	Utility Routines
	String Handling Routines
	Memory Management Routines
	Character Set Routines
	Floating Point Routines
	File I/O
	Miscellaneous Routines
	Time & Date Routines
	Smart List Routines
	Serial Port I/O
	Pattern Matching Package
	Process Package



IF YOU WANT TO PLAY WITH THE SOURCE LISTINGS
********************************************

Most users will probably use the standard library routines in object form
and never worry about the actual implementation.  If you, on the other hand,
want to get "under the hood" and take a look at how this code was written
(perhaps to fix a bug), all the source listings are provided with this
release.

We assemble the library for final distribution using TASM 3.0 with the
"/M3",  "/jjumps", and "/ic:\stdlib\include" command line options.  If you
do not specify these options you will probably get an assembly error.

All initial development of these routines was done with MASM.  By writing the
code with MASM and then assembling the final release version with TASM we
could verify that the code worked with both assemblers.

That is, at least, until MASM 6.0 came along.  All new routines written since
the introduction of MASM 6.0 were developed with MASM 6.0 and assembled with
TASM 3.0.  They should compile with MASM 5.1 as well (though we haven't
verified this).  HOWEVER, older routines written before the release of MASM 6
will probably not assemble properly under MASM 6.0 unless you specify the
MASM 5.1 compatibility options.  Furthermore, routines written after the
release of MASM 6.0 take advantage of MASM/TASM's "branch out of range"
automatic correction and may produce errors when assembled under MASM 5.1.

Moral of the story-- If you're still using MASM 5.1 (or earlier) or TASM 2.0
(or earlier), *upgrade*!

Given the divergent paths that MASM 6.0 and TASM 3.0 are taking, it is
unlikely that we will continue to provide all future code in a form which
compiles under both assemblers.  The windowing package we've created (but
have not released), for example, will only assemble under MASM 6.0.  We will
always make sure that the object code works with any assembler/linker out
there, but it's unlikely we will continue to support both MASM and TASM
at the source level for TASM indefinitely (unless BORLAND gives us good
reason to do otherwise, like having a MASM 6.x compatibility mode).  Sorry,
it's just too much work for so little return.

Of course, if you would volunteer to translate our MASM 6 code to TASM,
we'd be more than happy to give you full credit for your work.

Currently (6/93), MASM 6.0 and MASM 6.1 have some severe bugs which create
some major problems.  As soon as a stable release appears we will convert
specifically to MASM 6.x.

Acknowledgements
================

There are far too many people who have their fingers in this package to
give full credit to everyone involved.  Futhermore, this section was
added long after many hard-working people's efforts were forgotten.
If you are one of these people, send me (rhyde) email and I will
certainly rectify this situation.

Most of the routines in the library were written by Randy Hyde.
Those routines authored by someone else contain appropriate notes in the
comments found in the source listing.

Many thanks to those who have found problems in routines in the library.
This includes the students in CS 191x, CS 185, CS 162ABC, and CS 13 at
UC Riverside.  They have made important contributions to this library
and their efforts are not forgotten.

Special thanks to the CS 191x class at UC Riverside who reorganized the
documentation from its original sorry state.  Special thanks to Steve
Shah for his quick reference guide.

Last, but certainly not least, praise and glory to our Lord for giving us
all the talent to achieve this...

In the future, I will endeavor to keep this section up to date and provide
personal acknowledgements to those who have contributed to the success of
this library.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?