home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / CRUNCH10.ZIP / CLEAR.ASM next >
Encoding:
Assembly Source File  |  1988-11-05  |  790 b   |  20 lines

  1. ;
  2. ;  This routine may be called to clear the hash table
  3. ;
  4.             mov     cx,256          ;clear the 1st 256 entries
  5.             les     di,[>HashTable] ;ES:DI points to first table entry
  6.             mov     si,di           ;save offset in SI for later
  7. Looper:     mov     ax,cx
  8.             dec     ax              ;get index of entry to clear
  9.             mov     dx,5            ;entries are 5 bytes long
  10.             mul     dx              ;convert ax to an offset
  11.             mov     di,si           ;get starting offset of table
  12.             add     di,ax           ;es:di points to entry to be cleared
  13.             mov     ax,-1           ;clear pointers to -1
  14.             cld
  15.             stosw
  16.             stosw
  17.             stosb
  18.             loop    Looper
  19. Done:
  20.