home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / zendisk2.zip / PZTEST.ASM < prev    next >
Assembly Source File  |  1990-02-15  |  938b  |  41 lines

  1. ;
  2. ; *** Listing 2-2 ***
  3. ;
  4. ; Program to measure performance of code that takes less than
  5. ; 54 ms to execute. (PZTEST.ASM)
  6. ;
  7. ; Link with PZTIMER.ASM (Listing 2-1). PZTEST.BAT (Listing 2-4)
  8. ; can be used to assemble and link both files. Code to be
  9. ; measured must be in the file TESTCODE; Listing 2-3 shows
  10. ; a sample TESTCODE file.
  11. ;
  12. ; By Michael Abrash 4/26/89
  13. ;
  14. mystack    segment    para stack 'STACK'
  15.     db    512 dup(?)
  16. mystack    ends
  17. ;
  18. Code    segment    para public 'CODE'
  19.     assume    cs:Code, ds:Code
  20.     extrn    ZTimerOn:near, ZTimerOff:near, ZTimerReport:near
  21. Start    proc    near
  22.     push    cs
  23.     pop    ds    ;set DS to point to the code segment,
  24.             ; so data as well as code can easily
  25.             ; be included in TESTCODE
  26. ;
  27.     include    TESTCODE ;code to be measured, including
  28.             ; calls to ZTimerOn and ZTimerOff
  29. ;
  30. ; Display the results.
  31. ;
  32.     call    ZTimerReport
  33. ;
  34. ; Terminate the program.
  35. ;
  36.     mov    ah,4ch
  37.     int    21h
  38. Start    endp
  39. Code    ends
  40.     end    Start
  41.