1 ;; Native x86 GNU/Linux Forth System, Direct Threaded Code
3 ;; Copyright (C) 2020 Ketmar Dark // Invisible Vector
5 ;; This program is free software: you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, version 3 of the License ONLY.
9 ;; This program is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ;; GNU General Public License for more details.
14 ;; You should have received a copy of the GNU General Public License
15 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
19 urword_code
"(STR-NAME-HASH-CODEBLOCK)",str_name_hash_codeblock
27 ;; EDI,ECX,flags: destroyed
28 str_name_hash_edi_ecx:
36 ;; upcase it (this also distorts other chars, but who cares)
39 ;; high = hash&0xF0000000
60 str_name_hash_fold_mask_eax:
69 if WLIST_HASH_MASK
<> 255
70 and al,WLIST_HASH_MASK
79 ;; this is used to calculate word name hashes
80 urword_code
"STR-NAME-HASH",str_name_hash
81 urword_uses str_name_hash_codeblock
82 ;; ( addr count -- u32hash )
84 call str_name_hash_edi_ecx
90 ;; this is used to calculate word name hashes
91 urword_code
"STR-NAME-HASH-FOLDED-MASKED",str_name_hash_folded_masked
92 urword_uses str_name_hash_codeblock
93 ;; ( addr count -- maskedhash )
95 call str_name_hash_edi_ecx
96 call str_name_hash_fold_mask_eax
101 ;; this is used to calculate word name hashes
102 urword_code
"NAME-HASH-FOLD-MASK",name_hash_fold_mask
103 urword_uses str_name_hash_codeblock
104 ;; ( u32hash -- maskedhash )
106 call str_name_hash_fold_mask_eax
113 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
114 ;; fold 32-bit hash to 16-bit hash
115 urword_code
"UHASH32->16",fold_hash_u32_to_u16
116 ;; ( u32hash -- u16hash )
124 urword_code
"UHASH16->8",fold_hash_u16_to_u8
125 ;; ( u16hash -- u8hash )
131 urword_code
"UHASH32->8",fold_hash_u32_to_u8
132 ;; ( u16hash -- u8hash )