home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / source / chapter3-p1 / pztime.bat < prev    next >
DOS Batch File  |  1997-06-18  |  3KB  |  66 lines

  1. echo off
  2. rem
  3. rem *** Listing 3-4 ***
  4. rem
  5. rem ***************************************************************
  6. rem * Batch file PZTIME.BAT, which builds and runs the precision  *
  7. rem * Zen timer program PZTEST.EXE to time the code named as the  *
  8. rem * command-line parameter. Listing 3-1 must be named           *
  9. rem * PZTIMER.ASM, and Listing 3-2 must be named PZTEST.ASM. To   *
  10. rem * time the code in LST3-3, you'd type the DOS command:        *
  11. rem *                                                             *
  12. rem * pztime lst3-3                                               *
  13. rem *                                                             *
  14. rem * Note that MASM and LINK must be in the current directory or *
  15. rem * on the current path in order for this batch file to work.   *
  16. rem *                                                             *
  17. rem * To use this batch file with the Turbo Assembler, change     *
  18. rem * the two masm commands to tasm and change the link command   *
  19. rem * to tlink.                                                   *
  20. rem *                                                             *
  21. rem * This batch file can be speeded up by assembling PZTIMER.ASM *
  22. rem * once, then removing the lines:                              *
  23. rem *                                                             *
  24. rem * masm pztimer;                                               *
  25. rem * if errorlevel 1 goto errorend                               *
  26. rem *                                                             *
  27. rem * from this file.                                             *
  28. rem *                                                             *
  29. rem * By Michael Abrash                                           *
  30. rem ***************************************************************
  31. rem
  32. rem Make sure a file to test was specified.
  33. rem
  34. if not x%1==x goto ckexist
  35. echo ***************************************************************
  36. echo * Please specify a file to test.                              *
  37. echo ***************************************************************
  38. goto end
  39. rem
  40. rem Make sure the file exists.
  41. rem
  42. :ckexist
  43. if exist %1 goto docopy
  44. echo ***************************************************************
  45. echo * The specified file, "%1," doesn't exist.
  46. echo ***************************************************************
  47. goto end
  48. rem
  49. rem copy the file to measure to TESTCODE.
  50. rem
  51. :docopy
  52. copy %1 testcode
  53. masm pztest;
  54. if errorlevel 1 goto errorend
  55. masm pztimer;
  56. if errorlevel 1 goto errorend
  57. link pztest+pztimer;
  58. if errorlevel 1 goto errorend
  59. pztest
  60. goto end
  61. :errorend
  62. echo ***************************************************************
  63. echo * An error occurred while building the precision Zen timer.   *
  64. echo ***************************************************************
  65. :end
  66.