home *** CD-ROM | disk | FTP | other *** search
- ;--------------------------------------------
- ;HASH--Procedure to hash a four byte string
- ;
- ; Input: AX := first two bytes of string
- ; BX := second two bytes of string
- ;
- ; Output: AL := hash value (0-60)
- ;
- ; Registers destroyed: AX,BX
- ;---------------------------------------------
- ;
- TAB_sz equ 61 ;define table size
- hash proc near
- push dx ;save DX
- xor ax,bx ;combine into 16 bits
- xor dx,dx ;clear DX-dividend in DX AX
- mov bx,TAB_sz ;table size to BX
- div bx ;divide-remainder is in DX
- mov ax,dx ;remainder to AX
- pop dx ;restore DX
- ret
- hash endp
-