home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
LASTLOOK
/
LASTLOOK.DOC
< prev
next >
Wrap
Text File
|
1993-09-01
|
8KB
|
170 lines
LASTLOOK 1.02 - Takes one last look at TP programs before they ship.
Copyright (c) 1993, D.J. Murdoch.
Syntax:
LASTLOOK fileset [fileset] ...
will report on the compile options used in all files in the
fileset(s) if those could affect performance or limit your
audience.
Example:
You type "LASTLOOK lastlook", and you'll see the display:
LASTLOOK.EXE:
Has I/O checking ($I+).
Has stack checking ($S+).
Description:
A couple of times in the past year I've sent out programs that
had inappropriate compiler options, mostly through
carelessness. In one case the program required an 80286 or
better processor, when it was designed to run on anything; in
another it needed a numeric coprocessor, even though it didn't
do any floating point calculations.
I finally decided to write a program that can take a last
minute look at an .EXE, just to assure me that there's nothing
wrong with the way I've compiled it. LASTLOOK scans Turbo
Pascal .EXE files for signs of certain compiler options, and
reports on them.
Another use you might have for LASTLOOK could be to take a
first look at a new program you've just come across. If it
is written in Turbo/Borland Pascal, LASTLOOK can tell you
something about the hardware requirements.
What it looks for:
LASTLOOK does thirteen tests on the .EXE file. First, it
confirms that the file was compiled in Turbo/Borland Pascal.
(It should recognize any version from 4.0 to 7.0, and hopefully
newer ones too.)
If the program looks like it really is from TP, then the tests
begin. LASTLOOK checks whether it's a regular DOS executable
or a protected mode executable, and prints a warning if it
needs to use protected mode. (This will limit your audience,
and if it's DOS protected mode, means you'll have to include
the DPMI and RTM files with your distribution.)
LASTLOOK then checks whether you've included external debugging
information with your .EXE. You should never distribute a
program containing debug information; it'll be useless to most
people, and perhaps too useful to a few who notice it and use
it to reverse engineer your work.
While it's looking for debug information, it also looks out for
TurboVision-style resource files. If you use TurboVision
resources, you'll probably want to see the message telling you
that you've remembered to attach them. Because of the format
of the debug information, if you forgot to remove it first,
LASTLOOK (and TV!) won't be able to see your resource file.
The next check determines whether your program does floating
point calculations. If it does, you'll get a report either
that the program includes the coprocessor emulator (which tends
to bloat it), or that it doesn't, and requires a hardware
coprocessor to run.
The next test is another hardware test: LASTLOOK determines
whether your program requires a 286 or better chip to run. If
you want the widest audience, you probably don't want to limit
yourself to 286+ machines. On the other hand, some programs
just aren't worth running on an 8086; if that's the case, you
may want to take advantage of the 286 command set.
After that, LASTLOOK tries to determine whether your program
uses overlays. If it does, LASTLOOK reports whether it saw
an attached overlay file. If it can't find one, it gives a
warning, since it's so much more convenient for the user if you
attach the overlay file to the end of the .EXE.
What follows this are tests of whether you had debugging
options set when you compiled the .EXE. LASTLOOK checks for
$I+ (I/O checks), $Q+ (overflow checks), $R+ (range checks),
and $S+ (stack checks). When you know your program works
properly, you should turn these checks off. (Well, maybe: I
generally leave $S+ turned on; I'd rather suffer the
embarrassment of having my program abort with a run-time error
than trash somebody's disk by having a stack overflow and going
berserk. I also tend to leave $I+ turned on, because it's a
fairly cheap test, rarely turns up an error, and requires lots
of error-prone fiddling with IOResult if you turn it off. The
other two checks are much slower, and don't belong in
production software.)
Limitations:
None of the tests used above are infallible. Several of them
depend on disassembling some code, and looking for signs of
specific compiler options. The problem with this is that
LASTLOOK doesn't look at the whole program: it only
disassembles the main program block and the initialization
sections of the units that you use. If the bad options don't
happen to have affected the code in those parts of your
program, LASTLOOK will probably fail to detect them. It may
also fail to detect options if you're using anything other than
Borland Pascal 7.0 real mode or DOS protected mode. Some tests
work on the other versions of the TP compiler, some don't.
If you use assembler code in your initialization sections or
main block, you're very likely to confuse the LASTLOOK
disassembler; it only reliably disassembles the code that
comes from the TP compiler.
LASTLOOK uses about 140K of RAM when looking at a big program,
and can use a bit more when checking a protected mode program.
Try not to push it - it will skip some checks if it can't get
enough memory for them.
Acknowledgments:
LASTLOOK makes use of the disassembler written by William Peavy
which is used in his excellent TWU1 .TPU dumper, and also in
DUMPPROG, my general .EXE disassembler.
License:
LASTLOOK is *not* public domain software, but you may use it
for non-commercial purposes at no charge. You *may not* use
LASTLOOK to check your commercial programs without paying
for a commercial license.
You may distribute copies of the complete LASTLOOK package,
provided you charge no more than $5 for the diskette or other
media.
The commercial license is required when LASTLOOK is used in a
commercial or institutional or governmental setting. This
license costs only $20 (U.S. dollars drawn on a U.S. bank, or
Canadian dollars drawn on a Canadian bank; a postal money order
is also acceptable).
People purchasing the commercial license will also receive a
diskette of programs (freeware and shareware) that I've written
to support Turbo Pascal programming. See the included file
CONTENTS.TXT for the contents of the current disk. It tends to
change over time; if there's anything there that you want to be
sure to get, just mention it. Please specify preferred
diskette format when you order.
Send your orders to
D.J. Murdoch
337 Willingdon Ave.
Kingston, Ontario, Canada
K7L 4J3
Comments and bug reports may also be sent to that address, or
by electronic mail to
71631,122 on Compuserve
dmurdoch@mast.queensu.ca on Internet
DJ Murdoch at 1:249/99.5 on Fidonet.