Dec 062017
 
Replacement system unit for Turbo Pascal V6.0. Speeds up certain integer and string operations.
File SYS60A.ZIP from The Programmer’s Corner in
Category Pascal Source Code
Replacement system unit for Turbo Pascal V6.0. Speeds up certain integer and string operations.
File Name File Size Zip Size Zip Type
LICENSE.LIC 2399 882 deflated
RATE60A.PAS 6358 2108 deflated
STATMENT.LIC 4349 1933 deflated
SYS60A.BAT 2721 916 deflated
SYS60A.DOC 31927 10046 deflated
SYS60A.TPU 31680 20043 deflated
TOPRINT.TXT 349 210 deflated

Download File SYS60A.ZIP Here

Contents of the SYS60A.DOC file




















TURBO PASCAL 6.0
SYS60A.TPU
INSTALLATION GUIDE

Version 6.0a
March 26, 1991

Copyright (C) 1990-1991 Eagle Performance Software
All Rights Reserved.



_______
____|__ | (tm)
--| | |-------------------
| ____|__ | Association of
| | |_| Shareware
|__| o | Professionals
-----| | |---------------------
|___|___| MEMBER


SYSTEM Unit Installation Guide, Version 6.0a



T A B L E O F C O N T E N T S

1. INTRODUCTION . . . . . . . . . . . . . . . . . . . . . 3
Features . . . . . . . . . . . . . . . . . . . . . . 3
Philosophy . . . . . . . . . . . . . . . . . . . . . 3
Licensing . . . . . . . . . . . . . . . . . . . . . . 3
Discounts . . . . . . . . . . . . . . . . . . . . . . 4
Customer Service . . . . . . . . . . . . . . . . . . 4
ASP . . . . . . . . . . . . . . . . . . . . . . . . . 5

2. GETTING STARTED . . . . . . . . . . . . . . . . . . . . 6
Distribution Files . . . . . . . . . . . . . . . . . 6
Installation . . . . . . . . . . . . . . . . . . . . 6

3. PERFORMANCE . . . . . . . . . . . . . . . . . . . . . . 8
LongInt Math . . . . . . . . . . . . . . . . . . . . 8
Decimal / String Conversions . . . . . . . . . . . . 8
String handling . . . . . . . . . . . . . . . . . . . 8
Set Handling . . . . . . . . . . . . . . . . . . . . 9
Other Improvements . . . . . . . . . . . . . . . . . 9
Code Size . . . . . . . . . . . . . . . . . . . . . . 10
Greater Speeds . . . . . . . . . . . . . . . . . . . 10

4. SPEED TESTING . . . . . . . . . . . . . . . . . . . . . 11
Profiler . . . . . . . . . . . . . . . . . . . . . . 11
Rate Timer . . . . . . . . . . . . . . . . . . . . . 11

APPENDIX A: Application Products . . . . . . . . . . . . . 13

APPENDIX B: Revision History . . . . . . . . . . . . . . . 16

























2
SYSTEM Unit Installation Guide, Version 6.0a


1. I N T R O D U C T I O N


FEATURES

Welcome to SYS60 replacement unit for Turbo Pascal 6.0!

How would you like to speed up your Turbo Pascal 6.0 programs without
changing a single line of code? You have just found the easiest way to do
it! SYS60 replaces the SYSTEM.TPU in your TURBO.TPL library with our unit
which has much faster algorithms for over 32 built-in procedures and
functions like Pos and Div. See as much as 800% increase in speed!

How can you do it? Simply run a batch file to replace your SYSTEM.TPU.
Then any program you compile will automatically have the faster algorithms
- no code to change. And you get the exact same results - only faster!


PHILOSOPHY

The RTL - Borland has been gracious enough to make the Run-Time Library
(RTL) assembler source code available to any user for their own
modifications (for a license fee of $195). There are six units specific to
TP 6.0 in the RTL and the SYSTEM unit is by far the most significant. But
why would anyone want to take the time for a critical look at this
fundamental code? Most programmers are trying to stay busy and produce
applications. But after getting a copy for ourselves, we noticed that
there were some ways that we could trim the amount of time that the CPU
spends on a number of SYSTEM routines. And if these routines can be sped
up, then your overall applications can be sped up as well - without
changing any of your source code.

The Critical Look - We decided to take whatever time it took to go back
over the SYSTEM unit to produce the fastest code possible. Here are some
of the things we considered:

. Created 16-bit transfer methods in lieu of 8-bit.
. Replaced PUSH/POP with MOV.
. Combined register/flag operations.
. Reduced routine CALLs.
. Tightened clocks in intensive loops.
. Tested for CPU in use.
. Used CPU registers in lieu of stack.
. Used pass-through conditional jumps.
. Eliminated redundant jumps.

In some routines, this would reduce the amount of code to achieve the same
operation. In others, a few extra bytes greatly increased the speed.
SYS60 is the final result of this effort.


LICENSING

Registration - These routines and the documentation have been released for


Chapter 1, Introduction Page 3
SYSTEM Unit Installation Guide, Version 6.0a


distribution as Shareware. You have been given the chance to sample the
full capability of SYS without risk! If you find that SYS is a valuable
tool, then you are expected to register. You will find a reasonable
licensing schedule found in LICENSE.LIC to meet private or commercial
needs.

Source Code - Due to Borland's License Agreement on the Run-Time
Library (RTL), we are not authorized to release source code based on the
RTL no matter what modifications we have made. So, at the current time,
the source code will not be available for release and will just be managed
by Eagle Performance Software. Please contacts us for the latest
developments.

Commercial Version - This may be our last shareware version. Future
versions will be sold commercially.


DISCOUNTS

Should you register before June 31, 1991, you will be sent an even
faster system unit than the one supplied in this archive. Plus, you will
get a 20% extra discount on our STRG61 string handling unit when you
register at the same time.


CUSTOMER SERVICE

If you have questions, comments, or suggestions, the Eagle can be contacted
by four means - (1) telephone, (2) CompuServe, (3) The Eagle BBS, or
(4) mail.

Telephone - To contact the Eagle, you can reach us by phone at
(214) 539-7855 on weekdays and Saturday from 9:00 a.m. to 7:00 p.m. CST.

CompuServe - Another means is through CompuServe. For personal contact,
Jordan Gallagher [73557,2342] or Jim LeMay [76011,217] can be reached
through CIS MAIL.

The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539-
9878, at connections of 1200/2400/9600 MNP5/V.42bis N81.

Mail - For registration or problems, please write:

Eagle Performance Software
P.O. Box 292786
Lewisville, TX 75029-2786

In your written request for resolving problems, be sure to include:

. A diskette of compilable source code of the problem.
. The Eagle product and version number.
. The computer CPU.




Chapter 1, Introduction Page 4
SYSTEM Unit Installation Guide, Version 6.0a


ASP

SYS is a shareware program conforming to the standards of the Association
of Shareware Professionals (ASP). You can get more information about ASP
by writing to:

Association of Shareware Professionals
545 Grover Road
Muskegon, MI 49442

This program is produced by a member of the Association of Shareware
Professionals (ASP). ASP wants to make sure that the shareware principle
works for you. If you are unable to resolve a shareware-related problem
with an ASP member by contacting the member directly, ASP may be able to
help. The ASP Ombudsman can help you resolve a dispute or problem with an
ASP member, but does not provide technical support for member's products.
Please write to:

ASP Ombudsman
545 Grover Road
Muskegon, MI 49442

or send a CompuServe message via CIS MAIL to ASP Ombudsman 70007,3536.

































Chapter 1, Introduction Page 5
SYSTEM Unit Installation Guide, Version 6.0a


2. G E T T I N G S T A R T E D

This section will acquaint you with the files on distribution disk and show
you how to install the new SYSTEM.TPU.


DISTRIBUTION FILES

In this version, SYS60A.ZIP contains:

Sys60a .bat: Automatic installation batch file.
Sys60a .tpu: System replacement unit.
Sys60a .doc: This file.
Rate60a .pas: A simple, accurate time test routine for
reps/second.
ToPrint .txt: Instructions for printing docs.
License .lic: Order form.
Statment.lic: Statement for license terms and conditions.

Files have been archived using PKZIP. They should be authentically
verified after extraction with our company name - Eagle Performance
Software.


INSTALLATION

To install the new system unit, simply run the SYS60A.BAT file in your
TP60 directory. But just to make you feel comfortable about running it,
we'll explain what it does first.

1. It creates a back-up copy of your current library
TURBO.TPL in a file called TPL-BOR.TPL. (BOR = Borland)
2. It then creates a second copy of this library in a file
called TPL-EPS.TPL. (EPS = Eagle Performance Software)
3. Then it modifies TPL-EPS.TPL by installing the new
SYSTEM.TPU.
4. Finally, TPL-EPS.TPL is copied to TURBO.TPL.
5. As a clean-up measure, SYSTEM.TPU is deleted. So be sure
you have your original ZIP file of SYS60A.TPU.

The installation only needs to be done one time. In fact, it won't let you
do it more than once. Should you ever want to go back to your original
library, simply copy TPL-BOR.TPL to TURBO.TPL. To install, do the
following steps:

1. Go to your TP directory and be sure that TURBO.TPL
exists.
2. Also, be sure that TPUMOVER.EXE is on your path.
3. If you are upgrading to a new version of SYS, be sure
that TURBO.TPL is considered your "original" library. (If
not, copy TPL-BOR.TPL to TURBO.TPL.)
4. Also be sure that there are NO files named SYSTEM.TPU,
TPL-BOR.TPL, or TPL-EPS.TPL in this directory.
5. Copy SYS60A.TPU and SYS60A.BAT into this directory.


Chapter 2, Getting Started Page 6
SYSTEM Unit Installation Guide, Version 6.0a


6. Run SYS60A.BAT.
7. Compile your programs as usual.

Recompiling - To get the new system into your programs, simply recompile
your program to create an EXE file. There is no need to rebuild TPUs.
Since SYS60 was designed as drop-in replacement, its interface was not
modified. This means all pre-compiled TPUs will compile as is.

No Learning Curve - That's all there is to making your programs run faster.
No code changes and no new routines to learn about. If your programs
intensively use the improved routines, the speed increase will really be
noticeable.












































Chapter 2, Getting Started Page 7
SYSTEM Unit Installation Guide, Version 6.0a


3. P E R F O R M A N C E

This section will show you which algorithms were improved and the range of
speed improvements. Speed increases were checked on a 386/20Hz computer.
Values will vary between applications and hardware.


LONGINT MATH

Long integer math speed is greatly improved. Intel 80386 users will
enjoy even greater speed since the algorithms check for the CPU. A source
code line like the following:

i1 := abs(i2 * i3 div i4 mod i5);

would get these increases in speed:

Operation Increase
---------------------------- --------
* 15%
div / mod (16-bit cpu's) 250-630%
div / mod (32-bit cpu's) 800%
abs 5%


DECIMAL / STRING CONVERSIONS

Conversions from string to scalars and vice-versa are improved in speed as
well. The improvement is readily noticed. Scalars are bytes, short
integers, integers, words, and long integers. Some values of reals are
also affected, but it is minimal. The procedures Str and Val are directly
affected as well as conversions in Read, ReadLn, Write, and WriteLn
statements. Intel 80386 users will also notice an additional increase in
speed since the routine detects the CPU in operation.

Procedure Increase
---------------------------- --------
Str (scalar) 40-100%
Str (scalar) (32-bit cpu's) 115-205%
Val (scalar) 19%


STRING HANDLING

String handling is improved mostly by using 16-bit transfers instead of
just 8-bit handling. Plus, the algorithms are more efficient. The
longer the string, the more apparent the increase in speed. The speed
increases below reflect the maximum increase on 255-char strings:








Chapter 3, Performance Page 8
SYSTEM Unit Installation Guide, Version 6.0a


Operation Increase Comments
---------------------------- ---------- -------------------------
Loading, storing, moving up to 70% (such as ":=" )
Comparing up to 70% (such as Str1 Pos up to 340%
Concat up to 63%
Copy up to 34%
Insert / Delete up to 400%
Covert char to string 8%


SET HANDLING

Set handling is also improved slightly overall, but the variable range is
improved greatly. Improvements are as follows:

Operation Increase
---------------------------- ----------
Subset/superset relation up to 18%
Intersection 8%
Union 8%
Add variable range up to 850%
Add component 5%
Difference 7%



OTHER IMPROVEMENTS

Other procedures have also been improved with more efficient preparation
for DOS interfaces. But depending on your version of DOS and the
efficiency of your hardware, you may or may not see any difference in
speed:

Procedure / Function Increase
---------------------------- ----------
Assign (text files) up to 4%
FilePos 240%
FileSize 17%
Rename up to 120%
Read/ReadLn (text files) up to 60%
Write/WriteLn (text files) up to 330%

Text Files - If you use text files, you will be able to see much greater
results with this unit. Procedures like Write and WriteLn use several
routines that are transparent to the programmer. This includes writing
strings, characters, integers, and reals.

SetTextBuf - TIP: If you haven't already learned about it, read up on the
SetTextBuf procedure on page 140 of the Turbo Pascal Reference Guide. A
16k buffer along with SYS60 can increase your writing speeds 10 times or
more. For example:





Chapter 3, Performance Page 9
SYSTEM Unit Installation Guide, Version 6.0a


var
TF1: text;
Buf: array[1..16384] of char;
begin
Assign (TF1,'file1');
SetTextBuf (TF1,Buf); { Place it right after Assign }
Rewrite (TF1);
{ ... }
Close (TF1);
end.

By default, the optional size parameter for SetTextBuf is not required in
the above example. However, if you chose to use untyped pointers, then the
size parameter is mandatory:

var
TF1: text;
BufPtr: pointer
begin
GetMem (BufPtr,10000);
Assign (TF1,'file1');
SetTextBuf (TF1,BufPtr^,10000); { Size parameter required here }
Rewrite (TF1);
{ ... }
Close (TF1);
end.

If the size was not specified, by default, the buffer size is set to zero
cutting off all disk I/O and leaving your programs in an endless loop. The
Library Reference Guide does not mention this. On the other hand, the use
of typed pointers does not require a size parameter.

Objects - Copying of objects is also improved up to 95%.


CODE SIZE

Should your programs use all of the new features, they would increase in
size by only 320 bytes - not a bad trade-off for the speed! You can check
your own actual increase in size, but be sure to turn off all debugging
before comparing.


GREATER SPEEDS

Should you decide to register, you will be sent an even faster system unit
with the added features of variable and memory handling increases of up to
95%. Plus, you can register for STRG61 string unit at a 20% discount
before June 31, 1990.







Chapter 3, Performance Page 10
SYSTEM Unit Installation Guide, Version 6.0a


4. S P E E D T E S T I N G


PROFILER

The easiest way to see differences in speed is to run your program through
a profiler program such as the one provided by Borland called Turbo
Profiler (TPROF). This program is provided with Turbo Assembler/Debugger
2.0 or a later version. It will display the actual time used in the time-
sensitive portions of your code that you want to observe. This tool can
give you the proof you need to see speed improvements.

Quick Samples - Some sections of code may be too fast for TPROF to give a
measurable value. If you do use it for very quick areas or individual
lines, our experience shows that an "enable" operation must be placed on
the first line and a "disable" after the last line. For example, suppose
you wanted to measure the time duration of lines 200 and 201:

LongInt1 := LongInt2; { Line 199 }
e> LongInt3 := LongInt2 div LongInt4; { Line 200 }
=> LongInt5 := LongInt6; { Line 201 }
d> LongInt7 := LongInt5; { Line 202 }
delay (1000); { Line 203 }

If you did not place a "disable" on line 202, the time duration of lines
202 and onward would have been included on line 201. This would make you
think that line 201 took 1 full second to run because the delay of line 203
would have been included. Lines 200-201 are so fast that TPROF says that
they both took 0.0000 seconds. For something like this when there is only
a few lines of code to measure, consider using the rate timer provided with
SYS instead.


RATE TIMER

Should you not have access to a profiling tool, a simple rate timer program
has been included called RATE60.PAS so you can test your own code
sequences. This routine may actually be more helpful than Turbo Profiler,
since RATE can display more resolution.

Rate Timer - RATE60.PAS is a rate timer as opposed to an event timer. A
rate timer measures how many events occurred during a single duration,
while an event timer measures the duration of a single event. RATE has a
high resolution of +/-1 repetition and is particularly suited for short
events (<.01 seconds).

Insert Code - The program is already set to run testing the DIV operation.
If you run it as is, the program will run about 2 seconds and and return
the result of "Reps/Second". This tells how many times the sequence of
code was executed in a second. The higher the number of reps, the faster
the speed. You can test the program under either TPL-BOR.TPL or
TPL-EPS.TPL by simply copying the appropriate file to TURBO.TPL. The
increase in speed can be seen by comparing the results between the two
system units. You can modify the code in the "Insert Code" area to test


Chapter 4, Speed Testing Page 11
SYSTEM Unit Installation Guide, Version 6.0a


any sequence of code you want.

Reset Variables - Sometimes you will need to reset a variable to its
original value before testing again. Since you don't want the time it
takes to reset the variables to affect the results, they should be
subtracted out. The RATE60 program automatically does this. For example,
if you were to test the DELETE procedure, you code may look something like
the following:

fillchar (MyStr,256,'a');
MyStr[0] := 255;
Delete (MyStr,1,1);

The first two lines do the job of resetting the MyStr variable. Instead of
placing these two lines in the "Insert Code" area, they should be placed
in the ResetVariables procedure. Only the last line should be placed in
the "Insert Code" area. If you check out the code, you'll see that the
ResetVariables procedure is used for both resetting the variables and is
later subtracted out of the final result. This gives you a true value for
"Reps/Second".

Init - Different from repeatedly resetting a variables, use the Init
procedure for a one time initialization. This will allow you to preserve
a given value throughout the testing process.

RepsPerSec - The variable RepsPerSec (or R) is the variable to observe in
your watch window for the final results which is also output to the screen.
It is probably easier to enter "R" into the watch window than RepsPerSec.
Use either one and see how much SYS60 improves your speed!



























Chapter 4, Speed Testing Page 12
SYSTEM Unit Installation Guide, Version 6.0a


A P P E N D I X A : A P P L I C A T I O N P R O D U C T S


Eagle Performance Software has developed identical products for both Turbo
C and Turbo Pascal. Our pledge is to provide you quality products with
unparalleled performance and ease of use. All registered users receive the
complete source code when a signed license agreement is returned. (SYS is
currently not eligible for source code release. Contact us for latest
developments.)


STRG

STRG - Extremely-high speed string processing routines for strings,
characters, and all types of numbers including case, classification,
comparison, conversions, copy, count, delete, format, justification,
membership, parse, position, replace, search, sort, tabbing, ASCIIZ, many
with match/ignore case and many more - 111 routines in 6.3kb or less.

File name CIS Name Compiler
----------- ---------- --------
STRG57.ZIP STRG57.ZIP TP55
STRG61A.ZIP STRG61.ZIP TP60


QWIK

QWIK - For direct screen video, QWIK is the highest performance screen
writing tools available today for all text modes in any video
configuration. QWIK provides capabilities far beyond those in the
unit/library that comes with your compiler. Here are some of the
features:

- Writes on all IBM compatible computers, displays and adapters
including MDA, CGA, EGA, MCGA, VGA, 8514/A, Hercules and 3270 PC.
- Superior video detection routine.
- Eliminates snow and flicker.
- Writes directly to the screen in absolute rather than relative
coordinates.
- Writes in all text modes and column modes.
- Writes on all video pages.
- Writes on virtual screens in RAM.
- Writes text and attribute, text only, or attribute only.
- Reads strings, characters and attributes.
- Uses End-Of-String (EOS) marker for quick string chaining.
- Provides standardized cursor shapes for all adapters.
- Enhanced cursor movement.
- Compatible with DESQview and similar multi-tasking environments.
- Over 650% faster than standard direct screen writing.
- Only 2.7k bytes of code if all 43 utilities are used.
- Optimized by the compiler and drops unused code.
- Used in all other Eagle products.
- Excellent documentation like this document.



Appendix A: Application Products Page 13
SYSTEM Unit Installation Guide, Version 6.0a


Here are the product versions:

File name CIS Name Compiler
----------- ---------- --------
QWIK56.ARC QWIK55.ARC TP4-5.5
QWIK60.ARC QWIK60.ARC TP60
QWIKC21.ARC QWKC21.ARC TC2


WNDW

WNDW - For multi-level virtual windows, WNDW is the highest
performance window utilities available today. WNDW avoids the excess
code of windows as objects. It offers very powerful utilities for
full window control and management you probably never thought
possible. They are simple and yet very powerful with high speed and
tight code. With WNDW, you can choose the absolute writing routines
of QWIK, the window-relative writing routines of WNDW, and even
customize your own. Here are some of the features you will discover:

- Uses the powerful direct screen writing routines of QWIK.
- Up to 254 fixed or virtual windows can be on the screen at one
time.
- Extremely high-speed virtual screens in RAM (up to 40 times
faster).
- Virtual windows are fully updated on screen, even if covered.
Screens can scroll underneath one another right on the screen at
very high speeds!
- Virtual windows have virtual titles.
- Fully supported hidden windows saved in RAM.
- Fully supports all video pages.
- Adjustable-rate moving, resizing, and scrolling.
- All windows can be randomly accessed, not just stacked or tiled.
- 28 window-relative writing routines.
- 15 different border styles with shadow and zoom effects.
- Full line drawing procedures.
- Full cursor mode control for each window.
- Writes in all text modes and column modes.
- Only 13k bytes of code if all 69 utilities are used.
- Used in all other Eagle products.
- Excellent documentation like this document.

Here are the product versions:

File name CIS Name Compiler
----------- ---------- --------
WNDW55.ARC WNDW55.ARC TP4-5.5
WNDWC21.ARC WNDC21.ARC TC2


PULL

PULL - For multi-level pull-down menus, PULL is fully featured and fully
configurable. Includes execute, single, and multiple choice menus,


Appendix A: Application Products Page 14
SYSTEM Unit Installation Guide, Version 6.0a


unlimited nested submenus, data entry windows, help windows, directory
windows, message system, and fully completed interfaces. Some of the
features are:

- Uses QWIK and WNDW.
- Work window(s) and complete interface for menus
- Pull-down menus with 3 menu modes and 8 line modes
- Pull-down file directory
- Highlighted command letters
- Unlimited levels of submenus
- Unlimited data entry windows for 9 types of data
- Data entry for the work window(s)
Free field entry with either fixed column or flexible column
length.
Full editing capability including insert cursor mode
Full field selection with cursor keys
Automatic NumLock for numerical data entry
Right or left justification for data entry output
Error messages for invalid data entries
Error messages for data entries out of range
- Automatic sizes and locations for menus.
- Operation by cursor keys or command keys
- Pull/Pop between work window and nested submenu(s)
- Programmable control of pull and pop sequences
- Context-sensitive help
- Message lines for prompts and processing
- Full working shell for user development
- Excellent documentation like this document.

Here are the product versions:

File name CIS Name Compiler
----------- ---------- --------
PULL55.ARC PULL55.ARC TP4-5.5
PULLC21.ARC PULC21.ARC TC2


ON-LINE SERVICES

CompuServe - All updated files and later versions that are shareware can be
found on the CompuServe Borland Forums (GO BPROGA for TP and GO BPROGB for
TC).

The Eagle BBS - You can also contact us on our 24-hour BBS at (214) 539-
9878, at connections of 1200/2400/9600 MNP5/V.42bis N81.











Appendix A: Application Products Page 15
SYSTEM Unit Installation Guide, Version 6.0a


A P P E N D I X B : R E V I S I O N H I S T O R Y

REVISIONS:

Version 6.0 (02-20-91):
. Initial release

| Version 6.0a (03-26-91):
| . Fixed variable range set routine. Last value was considered 1-based
| and stayed one short of the given range. Reset to 0-based. (This was
| already fixed in a previous version. Old and new source was
| inadvertently swapped.)
| . Read/ReadLn used incorrect file pointer with local string variables.
| . Added TOPRINT.TXT file for printing instructions.


CREDITS:

The original Turbo Pascal Runtime Library is copyright (C) 1991 by Borland
International, Inc.

Modification is copyright (C) 1991 by James H. LeMay for Eagle Performance
Software. All Rights Reserved. Protected by the United States Copyright
Laws.
































Appendix B: Revision History Page 16


 December 6, 2017  Add comments

Leave a Reply