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 >
Text File  |  1993-09-01  |  8KB  |  170 lines

  1. LASTLOOK 1.02 - Takes one last look at TP programs before they ship.
  2.  
  3. Copyright (c) 1993, D.J. Murdoch.
  4.  
  5. Syntax:
  6.  
  7.          LASTLOOK fileset [fileset] ...
  8.  
  9.          will report on the compile options used in all files in the
  10.          fileset(s) if those could affect performance or limit your
  11.          audience.
  12.  
  13. Example:
  14.  
  15.          You type "LASTLOOK lastlook", and you'll see the display:
  16.  
  17.             LASTLOOK.EXE:
  18.                     Has I/O checking ($I+).
  19.                     Has stack checking ($S+).
  20.  
  21.  
  22. Description:
  23.  
  24.          A couple of times in the past year I've sent out programs that
  25.          had inappropriate compiler options, mostly through
  26.          carelessness.  In one case the program required an 80286 or
  27.          better processor, when it was designed to run on anything; in
  28.          another it needed a numeric coprocessor, even though it didn't
  29.          do any floating point calculations.
  30.  
  31.          I finally decided to write a program that can take a last
  32.          minute look at an .EXE, just to assure me that there's nothing
  33.          wrong with the way I've compiled it.  LASTLOOK scans Turbo
  34.          Pascal .EXE files for signs of certain compiler options, and
  35.          reports on them.
  36.  
  37.          Another use you might have for LASTLOOK could be to take a
  38.          first look at a new program you've just come across.  If it
  39.          is written in Turbo/Borland Pascal, LASTLOOK can tell you
  40.          something about the hardware requirements.
  41.  
  42. What it looks for:
  43.  
  44.          LASTLOOK does thirteen tests on the .EXE file.  First, it
  45.          confirms that the file was compiled in Turbo/Borland Pascal.
  46.          (It should recognize any version from 4.0 to 7.0, and hopefully
  47.          newer ones too.)
  48.  
  49.          If the program looks like it really is from TP, then the tests
  50.          begin.  LASTLOOK checks whether it's a regular DOS executable
  51.          or a protected mode executable, and prints a warning if it
  52.          needs to use protected mode.  (This will limit your audience,
  53.          and if it's DOS protected mode, means you'll have to include
  54.          the DPMI and RTM files with your distribution.)
  55.  
  56.          LASTLOOK then checks whether you've included external debugging
  57.          information with your .EXE.  You should never distribute a
  58.          program containing debug information; it'll be useless to most
  59.          people, and perhaps too useful to a few who notice it and use
  60.          it to reverse engineer your work.
  61.  
  62.          While it's looking for debug information, it also looks out for
  63.          TurboVision-style resource files.  If you use TurboVision
  64.          resources, you'll probably want to see the message telling you
  65.          that you've remembered to attach them.  Because of the format
  66.          of the debug information, if you forgot to remove it first,
  67.          LASTLOOK (and TV!) won't be able to see your resource file.
  68.  
  69.          The next check determines whether your program does floating
  70.          point calculations.  If it does, you'll get a report either
  71.          that the program includes the coprocessor emulator (which tends
  72.          to bloat it), or that it doesn't, and requires a hardware
  73.          coprocessor to run.
  74.  
  75.          The next test is another hardware test:  LASTLOOK determines
  76.          whether your program requires a 286 or better chip to run.  If
  77.          you want the widest audience, you probably don't want to limit
  78.          yourself to 286+ machines.  On the other hand, some programs
  79.          just aren't worth running on an 8086; if that's the case, you
  80.          may want to take advantage of the 286 command set.
  81.  
  82.          After that, LASTLOOK tries to determine whether your program
  83.          uses overlays.   If it does, LASTLOOK reports whether it saw
  84.          an attached overlay file.  If it can't find one, it gives a
  85.          warning, since it's so much more convenient for the user if you
  86.          attach the overlay file to the end of the .EXE.
  87.  
  88.          What follows this are tests of whether you had debugging
  89.          options set when you compiled the .EXE.  LASTLOOK checks for
  90.          $I+ (I/O checks), $Q+ (overflow checks), $R+ (range checks),
  91.          and $S+ (stack checks).  When you know your program works
  92.          properly, you should turn these checks off.  (Well, maybe:  I
  93.          generally leave $S+ turned on; I'd rather suffer the
  94.          embarrassment of having my program abort with a run-time error
  95.          than trash somebody's disk by having a stack overflow and going
  96.          berserk.  I also tend to leave $I+ turned on, because it's a
  97.          fairly cheap test, rarely turns up an error, and requires lots
  98.          of error-prone fiddling with IOResult if you turn it off.  The
  99.          other two checks are much slower, and don't belong in
  100.          production software.)
  101.  
  102. Limitations:
  103.  
  104.          None of the tests used above are infallible. Several of them
  105.          depend on disassembling some code, and looking for signs of
  106.          specific compiler options.  The problem with this is that
  107.          LASTLOOK doesn't look at the whole program:  it only
  108.          disassembles the main program block and the initialization
  109.          sections of the units that you use.  If the bad options don't
  110.          happen to have affected the code in those parts of your
  111.          program, LASTLOOK will probably fail to detect them.  It may
  112.          also fail to detect options if you're using anything other than
  113.          Borland Pascal 7.0 real mode or DOS protected mode.  Some tests
  114.          work on the other versions of the TP compiler, some don't.
  115.  
  116.          If you use assembler code in your initialization sections or
  117.          main block, you're very likely to confuse the LASTLOOK
  118.          disassembler; it only reliably disassembles the code that
  119.          comes from the TP compiler.
  120.  
  121.          LASTLOOK uses about 140K of RAM when looking at a big program,
  122.          and can use a bit more when checking a protected mode program.
  123.          Try not to push it - it will skip some checks if it can't get
  124.          enough memory for them.
  125.  
  126. Acknowledgments:
  127.  
  128.          LASTLOOK makes use of the disassembler written by William Peavy
  129.          which is used in his excellent TWU1 .TPU dumper, and also in
  130.          DUMPPROG, my general .EXE disassembler.
  131.  
  132. License:
  133.  
  134.          LASTLOOK is *not* public domain software, but you may use it
  135.          for non-commercial purposes at no charge.  You *may not* use
  136.          LASTLOOK to check your commercial programs without paying
  137.          for a commercial license.
  138.  
  139.          You may distribute copies of the complete LASTLOOK package,
  140.          provided you charge no more than $5 for the diskette or other
  141.          media.
  142.  
  143.          The commercial license is required when LASTLOOK is used in a
  144.          commercial or institutional or governmental setting.  This
  145.          license costs only $20 (U.S. dollars drawn on a U.S. bank, or
  146.          Canadian dollars drawn on a Canadian bank; a postal money order
  147.          is also acceptable).
  148.  
  149.          People purchasing the commercial license will also receive a
  150.          diskette of programs (freeware and shareware) that I've written
  151.          to support Turbo Pascal programming.  See the included file
  152.          CONTENTS.TXT for the contents of the current disk.  It tends to
  153.          change over time; if there's anything there that you want to be
  154.          sure to get, just mention it.  Please specify preferred
  155.          diskette format when you order.
  156.  
  157.          Send your orders to
  158.  
  159.            D.J. Murdoch
  160.            337 Willingdon Ave.
  161.            Kingston, Ontario, Canada
  162.            K7L 4J3
  163.  
  164.          Comments and bug reports may also be sent to that address, or
  165.          by electronic mail to
  166.  
  167.            71631,122 on Compuserve
  168.            dmurdoch@mast.queensu.ca on Internet
  169.            DJ Murdoch at 1:249/99.5 on Fidonet.
  170.