Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
318 | heavyiron | 1 | newrating: |
2 | |||
3 | cmp [FRS], 266 |
||
4 | jz f266 |
||
5 | cmp [FRS], 333 |
||
6 | jz f333 |
||
7 | cmp [FRS], 400 |
||
8 | jz f400 |
||
9 | |||
10 | f266: |
||
11 | |||
12 | ;формулы вычисления XP-рейтинга Athlon-ов (Tbred, Barton): |
||
13 | ;FSB266/256kB: сделано |
||
14 | ;XP+ (Freq<2000MHz) = 1000 + (Freq-1000)*1,5 = Freq*1.5-500 |
||
15 | ;XP+ (Freq>=2000MHz) = 900 + (Freq-1000)*1,5 = Freq*1.5-600 |
||
16 | |||
17 | |||
18 | cmp [total], 2000 |
||
19 | jl pal |
||
20 | |||
21 | ; Рейтинг для Паломино 2000+ |
||
22 | mov eax,[total] |
||
23 | imul eax, 3 |
||
24 | shr eax,1 |
||
25 | sub eax, 600 |
||
26 | mov [rating], eax |
||
27 | |||
28 | jmp vyxod |
||
29 | |||
30 | pal: |
||
31 | |||
32 | ; Рейтинг для Паломино 2000- |
||
33 | mov eax,[total] |
||
34 | imul eax, 3 |
||
35 | shr eax,1 |
||
36 | sub eax, 500 |
||
37 | mov [rating], eax |
||
38 | |||
39 | jmp vyxod |
||
40 | |||
41 | |||
42 | f333: |
||
43 | |||
44 | |||
45 | |||
46 | |||
47 | cmp [L2], 256 |
||
48 | jl .Th ; Thorton |
||
49 | |||
50 | ;FSB333/512kB: сделано |
||
51 | ;XP+ (Freq<2100MHz) = Freq*1.2 + 300 |
||
52 | ;XP+ (Freq>=2100MHz) = Freq*1.2 + 400 |
||
53 | |||
54 | cmp [total], 2100 |
||
55 | jl .r2100 |
||
56 | mov eax,[total] |
||
57 | xor edx, edx |
||
58 | imul eax, 600000 |
||
59 | mov ebx, 500000 |
||
60 | div ebx |
||
61 | mov [rating], eax |
||
62 | add [rating], 400 |
||
63 | |||
64 | ; Rating for Barton F<2000 MHz |
||
65 | jmp vyxod |
||
66 | |||
67 | .r2100: |
||
68 | mov eax,[total] |
||
69 | xor edx, edx |
||
70 | imul eax, 600000 |
||
71 | mov ebx, 500000 |
||
72 | div ebx |
||
73 | mov [rating], eax |
||
74 | add [rating], 300 |
||
75 | |||
76 | |||
77 | ; Rating for Barton F>2000 MHz |
||
78 | jmp vyxod |
||
79 | |||
80 | ;FSB333/256kB: сделано |
||
81 | ;XP+ = Freq*1.2 + 100 |
||
82 | |||
83 | .Th: |
||
84 | |||
85 | mov eax,[total] |
||
86 | xor edx, edx |
||
87 | imul eax, 600000 |
||
88 | mov ebx, 500000 |
||
89 | div ebx |
||
90 | mov [rating], eax |
||
91 | add [rating], 100 |
||
92 | |||
93 | |||
94 | ;Rating for Thorton |
||
95 | |||
96 | |||
97 | jmp vyxod |
||
98 | |||
99 | f400: |
||
100 | |||
101 | |||
102 | ;FSB400/512kB: |
||
103 | ;XP+ = Freq*1.5 - 100 |
||
104 | |||
105 | mov eax,[total] |
||
106 | imul eax, 3 |
||
107 | shr eax,1 |
||
108 | sub eax, 100 |
||
109 | mov [rating], eax |
||
110 | |||
111 | vyxod: |
||
112 | |||
113 | |||
114 | ret |
||
115 | |||
116 | |||
117 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
118 | |||
119 | multipl: |
||
120 | ;--- вычисление коэффициента умножения - |
||
121 | ; портит регистры |
||
122 | ; out : CL = коэфф.умножения * 10, или 0 |
||
123 | |||
124 | xor ecx, ecx |
||
125 | |||
126 | cmp dword[smallvendor], 'cAMD' ; Check for Advanced Micro Devices CPU |
||
127 | jne noAMD |
||
128 | cmp byte [f], 5 |
||
129 | jne noAMDK6 |
||
130 | mov eax, 68 ; AMD-K6 (p.30) |
||
131 | mov ebx, 3 |
||
132 | mov edx, 0x0C0000087 |
||
133 | int 0x40 ; eax - low dword |
||
134 | and eax, 111b |
||
135 | mov cl, [athloncoef3 + eax] |
||
136 | cmp eax, 6 |
||
137 | jne @f |
||
138 | cmp byte[m], 8 |
||
139 | jae @f |
||
140 | mov cl, 20 |
||
141 | @@: ret |
||
142 | |||
143 | noAMDK6:cmp byte [f], 6 |
||
144 | jne noAMDK7 |
||
145 | cmp byte [m], 5 |
||
146 | jna @f |
||
147 | mov eax, 0x80000007 |
||
148 | cpuid |
||
149 | and edx, 6 ; voltage ID control & frequency ID control |
||
150 | cmp edx, 6 |
||
151 | je AMDK7M |
||
152 | @@: mov eax, 68 ; Athlon/AthlonXP |
||
153 | mov ebx, 3 |
||
154 | mov edx, 0x0C0010015 |
||
155 | int 0x40 |
||
156 | mov ebx, eax |
||
157 | shr ebx, 24 |
||
158 | and ebx, 0x0F |
||
159 | shr eax, 20 |
||
160 | jnc @f |
||
161 | add bl, 16 |
||
162 | @@: mov cl, [athloncoef + ebx] |
||
163 | ret |
||
164 | |||
165 | AMDK7M: mov eax, 68 ; AthonXP-M |
||
166 | mov ebx, 3 |
||
167 | mov edx, 0xC0010042 |
||
168 | int 0x40 |
||
169 | and eax, 0x1F |
||
170 | mov cl, [athlonmcoef + eax] |
||
171 | ret |
||
172 | |||
173 | noAMDK7:cmp byte [f], 0xF |
||
174 | jne noAMDK8 |
||
175 | mov eax, 0x80000007 |
||
176 | cpuid |
||
177 | and edx, 6 ; voltage ID control & frequency ID control |
||
178 | cmp edx, 6 |
||
179 | je AMDK8M |
||
180 | mov eax, 68 ; Athon64 |
||
181 | mov ebx, 3 |
||
182 | mov edx, 0xC0010015 |
||
183 | int 0x40 |
||
184 | shr eax, 24 |
||
185 | and al, 0x3F |
||
186 | shr al, 1 |
||
187 | add al, 4 |
||
188 | mov dl, 10 |
||
189 | mul dl |
||
190 | mov cl, al |
||
191 | ret |
||
192 | |||
193 | AMDK8M: mov eax, 68 ; Athon64-M |
||
194 | mov ebx, 3 |
||
195 | mov edx, 0xC0010042 |
||
196 | int 0x40 |
||
197 | and al, 0x3F |
||
198 | shr al, 1 |
||
199 | add al, 4 |
||
200 | mov dl, 10 |
||
201 | mul dl |
||
202 | mov cl, al |
||
203 | ret |
||
204 | ;///////////////////////////////////////////////////////// |
||
205 | noAMD: cmp dword [smallvendor], 'ntel' ; Check for International Electronics CPU |
||
206 | jne noIntel |
||
207 | cmp byte[f], 0x0F |
||
208 | jne noIntelP4 |
||
209 | cmp byte [t], 6 |
||
210 | jne @f |
||
211 | mov eax, 68 ; Pentium M |
||
212 | mov ebx, 3 |
||
213 | mov edx, 0x2A |
||
214 | int 0x40 |
||
215 | shr eax, 22 |
||
216 | and eax, 0x1F |
||
217 | mov dl, 10 |
||
218 | mul dl |
||
219 | mov cl, al |
||
220 | ret |
||
221 | @@: cmp byte [m], 2 |
||
222 | jae @f |
||
223 | mov eax, 68 ; Pentium 4 / Xeon (model < 2) Willamete |
||
224 | mov ebx, 3 |
||
225 | mov edx, 0x2A |
||
226 | int 0x40 |
||
227 | shr eax, 8 |
||
228 | and eax, 0x0F |
||
229 | mov cl, [p4coef + eax] |
||
230 | ret |
||
231 | @@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) NorthWood |
||
232 | mov ebx, 3 |
||
233 | mov edx, 0x2C |
||
234 | int 0x40 |
||
235 | shr eax, 24 |
||
236 | and eax, 0x1F |
||
237 | mov dl, 10 |
||
238 | mul dl |
||
239 | mov cl, al |
||
240 | ret |
||
241 | noIntelP4: |
||
242 | cmp byte[f], 6 |
||
243 | jne noIntelP6 |
||
244 | mov eax, 68 ; Pentium Pro / Pentium II / Pentium III |
||
245 | mov ebx, 3 |
||
246 | mov edx, 0x2A |
||
247 | int 0x40 |
||
248 | shr eax, 22 |
||
249 | test al, 0x20 |
||
250 | jz @f |
||
251 | or al, 0x10 |
||
252 | @@: and eax, 0x1f |
||
253 | |||
254 | cmp byte[m], 0x06 ; ? 7 |
||
255 | ja @f |
||
256 | and al, 0x0f |
||
257 | @@: |
||
258 | mov cl, [coppercoeff + eax] |
||
259 | cmp byte[m], 0x0B |
||
260 | jb @f |
||
261 | mov cl, [tualatcoeff + eax] |
||
262 | |||
263 | cmp byte[m], 0x0B |
||
264 | je @f |
||
265 | mov dl, 10 ; model 0x0C - 0x0F - Dothan / Yonah / Conroe / Merom |
||
266 | mul dl |
||
267 | mov cl, al |
||
268 | |||
269 | @@: ret |
||
270 | |||
271 | noIntel: |
||
272 | noIntelP6: |
||
273 | noAMDK8: |
||
274 | ret>2000>2100MHz)>2000MHz)> |