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

  1. ;
  2. ; *** Listing 13-7 ***
  3. ;
  4. ; Measures the time needed to set AL, based on the contents
  5. ; of DL, with preload code (a branch is required in only one
  6. ; of the two possible cases).
  7. ;
  8. ;----------------------------------------------------------
  9. ; Macro to perform the test of DL and setting of AL.
  10. ; It's necessary to use a macro because the LOCAL directive
  11. ; doesn't work properly inside REPT blocks with MASM.
  12. ;
  13. TEST_DL_AND_SET_AL    macro
  14.     local    DLCheckDone
  15.     sub    al,al        ;assume DL <= 10
  16.     cmp    dl,10        ;is DL greater than 10?
  17.     jbe    DLCheckDone    ;no, so AL is already set
  18.     mov    al,1        ;DL is greater than 10
  19. DLCheckDone:
  20.     endm
  21. ;
  22.     mov    dl,10    ;AL will always be set to 0
  23.     call    ZTimerOn
  24.     rept    1000
  25.     TEST_DL_AND_SET_AL
  26.     endm
  27.     call    ZTimerOff
  28.