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

  1. ;
  2. ; *** Listing 13-6 ***
  3. ;
  4. ; Measures the time needed to set AL, based on the contents
  5. ; of DL, with test-and-branch code (a branch is required no
  6. ; matter what value DL contains).
  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    DLGreaterThan10, DLCheckDone
  15.     cmp    dl,10        ;is DL greater than 10?
  16.     ja    DLGreaterThan10    ;yes, so set AL to 1
  17.     sub    al,al        ;DL is <= 10
  18.     jmp    short DLCheckDone
  19. DLGreaterThan10:
  20.     mov    al,1        ;DL is greater than 10
  21. DLCheckDone:
  22.     endm
  23. ;
  24.     mov    dl,10    ;AL will always be set to 0
  25.     call    ZTimerOn
  26.     rept    1000
  27.     TEST_DL_AND_SET_AL
  28.     endm
  29.     call    ZTimerOff
  30.