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

  1. ;
  2. ; *** Listing 13-20 ***
  3. ;
  4. ; Zeros the high-bit of each byte in a 100-byte array,
  5. ; using in-line code.
  6. ;
  7.     jmp    Skip
  8. ;
  9. ARRAY_LENGTH    equ    100
  10. ByteArray    label    byte
  11.     db    ARRAY_LENGTH dup (80h)
  12. ;
  13. ; Clears the high bit of each byte in an array of
  14. ; length ARRAY_LENGTH.
  15. ;
  16. ; Input:
  17. ;    BX = pointer to the start of the array to clear
  18. ;
  19. ; Output: none
  20. ;
  21. ; Registers altered: AL, BX
  22. ;
  23. ClearHighBits:
  24.     mov    al,not 80h        ;pattern to clear
  25.                     ; high bits with
  26.     rept    ARRAY_LENGTH        ;# of bytes to clear
  27.     and    [bx],al            ;clear the high bit
  28.                     ; of this byte
  29.     inc    bx            ;point to the next
  30.                     ; byte
  31.     endm
  32.     ret
  33. ;
  34. Skip:
  35.     call    ZTimerOn
  36.     mov    bx,offset ByteArray
  37.                 ;array in which to clear
  38.                 ; high bits
  39.     call    ClearHighBits    ;clear the high bits of the
  40.                 ; bytes
  41.     call    ZTimerOff
  42.