home *** CD-ROM | disk | FTP | other *** search
/ Graphics Programming Black Book (Special Edition) / BlackBook.bin / disk1 / source / chapter22 / l22-7.asm < prev   
Assembly Source File  |  1997-06-18  |  536b  |  19 lines

  1. ; Listing 22.7.  L22-7.ASM
  2.  
  3. ClearS    proc    near
  4.     pop    dx        ;get the return address
  5.     pop    ax        ;put fill char into AL
  6.     pop    bx        ;get the attribute
  7.     mov    ah,bh        ;put attribute into AH
  8.     pop    cx        ;get the buffer size
  9.     pop    di        ;get the offset of the buffer origin
  10.     pop    es        ;get the segment of the buffer origin
  11.     mov    bx,es        ;put the segment where we can test it
  12.     or    bx,di        ;null pointer?
  13.     je    Bye        ;yes, so we're done
  14.     cld                ;make STOSW count up
  15.     rep    stosw        ;do the string store
  16. Bye:
  17.     jmp    dx        ;return to the calling code
  18. ClearS    endp
  19.