Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
223 | Ghost | 1 | ;Addresses for bits |
2 | |||
3 | FPU_FLAG equ 0001h ;Floating-point unit on-Chip |
||
4 | VME_FLAG equ 0002h ;Virtual Mode Extension |
||
5 | DE_FLAG equ 0004h ;Debugging Extension |
||
6 | PSE_FLAG equ 0008h ;Page Size Extension |
||
7 | TSC_FLAG equ 0010h ;Time-Stamp Counter |
||
8 | MSR_FLAG equ 0020h ;Model Specific Registers |
||
9 | PAE_FLAG equ 0040h ;Physical Address Extension |
||
10 | MCE_FLAG equ 0080h ;Machine Check Exception |
||
11 | CX8_FLAG equ 0100h ;CMPXCHG8 Instruction Supported |
||
12 | APIC_FLAG equ 0200h ;On-chip APIC Hardware Supported |
||
13 | ;10_FLAG equ 0400h ;Reserved |
||
14 | SEP_FLAG equ 0800h ;Fast System Call |
||
15 | MTRR_FLAG equ 1000h ;Memory Type Range Registers |
||
16 | PGE_FLAG equ 2000h ;Page Global Enable |
||
17 | MCA_FLAG equ 4000h ;Machine Check Architecture |
||
18 | CMOV_FLAG equ 8000h ;Conditional Move Instruction Supported |
||
19 | PAT_FLAG equ 10000h ;Page Attribute Table |
||
20 | PSE36_FLAG equ 20000h ;36-bit Page Size Extension |
||
21 | PSNUM_FLAG equ 40000h ;Processor serial number present and enabled |
||
22 | CLFLUSH_FLAG equ 80000h ;CLFLUSH Instruction supported |
||
23 | ;20_FLAG equ 100000h ;Reserved |
||
24 | DTS_FLAG equ 200000h ;Debug Store |
||
25 | ACPI_FLAG equ 400000h ;Thermal Monitor and Software Controlled Clock Facilities supported |
||
26 | MMX_FLAG equ 800000h ;Intel Architecture MMX technology supported |
||
27 | FXSR_FLAG equ 1000000h ;Fast floating point save and restore |
||
28 | SSE_FLAG equ 2000000h ;Streaming SIMD Extensions supported |
||
29 | SSE2_FLAG equ 4000000h ;Streaming SIMD Extensions 2 |
||
30 | SS_FLAG equ 8000000h ;Self-Snoop |
||
31 | ;HTT_FLAG equ 10000000h ;Hyper-Threading Technology |
||
32 | TM_FLAG equ 20000000h ;Thermal Monitor supported |
||
33 | IA64_FLAG equ 40000000h ; IA-64 |
||
34 | PBE_FLAG equ 80000000h ;Pending Break Enable |
||
35 | |||
36 | ; ecx cpuid(1) |
||
37 | SSE3_FLAG equ 0001h ;SSE3 0 |
||
38 | MON_FLAG equ 0008h ;MON -3 |
||
39 | DS_CPL_FLAG equ 0010h ;DS-CPL -4 |
||
40 | EST_FLAG equ 0080h ; EST-7 |
||
41 | TM2_FLAG equ 0100h ; TM2-8 |
||
42 | CNXT_ID_FLAG equ 0400h ;CID -10 |
||
43 | CX16_FLAG equ 2000h ;CX16 - 13 |
||
44 | ETPRD_FLAG equ 4000h ;xTPR - 14 |
||
45 | |||
46 | ; edx cpuid(8000_0001h) |
||
47 | |||
48 | SYS_FLAG equ 0800h ;11 |
||
49 | |||
50 | MP_FLAG equ 80000h ;19 |
||
51 | NX_FLAG equ 100000h ;20 |
||
52 | MMXPi_FLAG equ 400000h ;22 |
||
53 | MMXn_FLAG equ 800000h ;23 |
||
54 | FXSRn_FLAG equ 1000000h ;24 для Сирикс это ММХ+ |
||
55 | FFXSR_FLAG equ 2000000h ;25 |
||
56 | TSCP_FLAG equ 8000000h ;27 |
||
57 | LM_FLAG equ 20000000h ;29 |
||
58 | DNo_FLAG equ 40000000h ;30 |
||
59 | DN_FLAG equ 80000000h ;31 |
||
60 | |||
61 | ; ecx cpuid(8000_0001h) |
||
62 | LAHF_FLAG equ 100000h ;Reserved |
||
63 | |||
64 | ; optimize the code for size |
||
65 | macro add arg1,arg2 |
||
66 | { |
||
67 | if arg1 in |
||
68 | if arg2 eqtype 0 |
||
69 | if arg2 = 1 |
||
70 | inc arg1 |
||
71 | else |
||
72 | add arg1,arg2 |
||
73 | end if |
||
74 | else |
||
75 | add arg1,arg2 |
||
76 | end if |
||
77 | else |
||
78 | add arg1,arg2 |
||
79 | end if |
||
80 | } |
||
81 | |||
82 | macro sub arg1,arg2 |
||
83 | { |
||
84 | if arg2 eqtype 0 |
||
85 | if arg2 = 1 |
||
86 | dec arg1 |
||
87 | else |
||
88 | sub arg1,arg2 |
||
89 | end if |
||
90 | else |
||
91 | sub arg1,arg2 |
||
92 | end if |
||
93 | } |
||
94 | |||
95 | macro mov arg1,arg2 |
||
96 | { |
||
97 | if arg1 in |
||
98 | if arg2 eqtype 0 |
||
99 | if arg2 = 0 |
||
100 | xor arg1,arg1 |
||
101 | else if arg2 = 1 |
||
102 | xor arg1,arg1 |
||
103 | inc arg1 |
||
104 | else if arg2 = -1 |
||
105 | or arg1,-1 |
||
106 | else if arg2 > -128 & arg2 < 128 |
||
107 | push arg2 |
||
108 | pop arg1 |
||
109 | else |
||
110 | mov arg1,arg2 |
||
111 | end if |
||
112 | else |
||
113 | mov arg1,arg2 |
||
114 | end if |
||
115 | else |
||
116 | mov arg1,arg2 |
||
117 | end if |
||
118 | } |
||
119 | |||
120 | |||
121 | ; Interface |
||
122 | |||
123 | ;WriteTextToWindow |
||
124 | macro Text xStart,yStart,rgbColor,pText,nTextLen |
||
125 | { |
||
126 | mov ebx,xStart |
||
127 | shl ebx,16 |
||
128 | add ebx,yStart |
||
129 | mov ecx,rgbColor |
||
130 | mov edx,pText |
||
131 | mov esi,nTextLen |
||
132 | mov eax,4 |
||
133 | int 0x40 |
||
134 | } |
||
135 | |||
136 | ;DisplayNumber |
||
137 | macro Number xStart,yStart,nPrintType,noOfDigits,Data,rgbColor |
||
138 | { |
||
139 | mov edx,xStart |
||
140 | shl edx,16 |
||
141 | add edx,yStart |
||
142 | mov ebx,noOfDigits |
||
143 | shl ebx,16 |
||
144 | or ebx,nPrintType |
||
145 | mov ecx,Data |
||
146 | mov esi,rgbColor |
||
147 | mov eax,47 |
||
148 | int 0x40 |
||
149 | } |
||
150 | |||
151 | macro DrawLine xStart,xEnd,yStart,yEnd,rgbColor |
||
152 | { |
||
153 | mov ebx,xStart |
||
154 | shl ebx,16 |
||
155 | add ebx,xEnd |
||
156 | mov ecx,yStart |
||
157 | shl ecx,16 |
||
158 | add ecx, yEnd |
||
159 | mov edx,rgbColor |
||
160 | mov eax,38 |
||
161 | int 0x40 |
||
162 | } |
||
163 | |||
164 | ;////////////////////////////////////////////// |
||
165 | ; Decoding cache L1,L2,L3 for Intel |
||
166 | |||
167 | |||
168 | decodecache: |
||
169 | |||
170 | comp0: |
||
171 | cmp al, 00h |
||
172 | je L000 |
||
173 | |||
174 | ;-------L2 inst |
||
175 | |||
176 | comp1: |
||
177 | cmp al, 41h |
||
178 | je L128 |
||
179 | |||
180 | |||
181 | comp2: |
||
182 | cmp al, 42h |
||
183 | je L256 |
||
184 | |||
185 | comp3: |
||
186 | cmp al, 43h |
||
187 | je L512 |
||
188 | |||
189 | comp4: |
||
190 | cmp al, 44h |
||
191 | je L1024 |
||
192 | |||
193 | |||
194 | comp5: |
||
195 | cmp al, 45h |
||
196 | je L2048 |
||
197 | |||
198 | ;------------L1 inst |
||
199 | comp6: |
||
200 | cmp al, 06h |
||
201 | je Li8 |
||
202 | |||
203 | |||
204 | comp7: |
||
205 | cmp al, 08h |
||
206 | je Li16 |
||
207 | |||
208 | comp8: |
||
209 | cmp al, 15h |
||
210 | je Li16 |
||
211 | |||
212 | comp9: |
||
213 | cmp al, 77h |
||
214 | je Li16 |
||
215 | |||
216 | comp10: |
||
217 | cmp al, 30h |
||
218 | je Li32 |
||
219 | ;---------------L1 data |
||
220 | comp11: |
||
221 | cmp al, 0Ah |
||
222 | je Ld8 |
||
223 | |||
224 | comp12: |
||
225 | cmp al, 66h |
||
226 | je Ld8 |
||
227 | |||
228 | comp13: |
||
229 | cmp al, 0Ch |
||
230 | je Ld16 |
||
231 | |||
232 | comp14: |
||
233 | cmp al, 10h |
||
234 | je Ld16 |
||
235 | |||
236 | comp15: |
||
237 | cmp al, 67h |
||
238 | je Ld16 |
||
239 | |||
240 | comp16: |
||
241 | cmp al, 2Ch |
||
242 | je Ld32 |
||
243 | |||
244 | comp17: |
||
245 | cmp al, 68h |
||
246 | je Ld32 |
||
247 | |||
248 | ;-------L2 |
||
249 | comp18: |
||
250 | cmp al, 39h |
||
251 | je L128 |
||
252 | |||
253 | comp19: |
||
254 | cmp al, 3Bh |
||
255 | je L128 |
||
256 | |||
257 | comp20: |
||
258 | cmp al, 79h |
||
259 | je L128 |
||
260 | |||
261 | comp21: |
||
262 | cmp al, 81h |
||
263 | je L128 |
||
264 | |||
265 | comp22: |
||
266 | cmp al, 3Ch |
||
267 | je L256 |
||
268 | |||
269 | comp23: |
||
270 | cmp al, 7Ah |
||
271 | je L256 |
||
272 | |||
273 | comp24: |
||
274 | cmp al, 7Eh |
||
275 | je L256 |
||
276 | |||
277 | comp25: |
||
278 | cmp al, 82h |
||
279 | je L256 |
||
280 | |||
281 | comp26: |
||
282 | cmp al, 7Bh |
||
283 | je L512 |
||
284 | |||
285 | comp27: |
||
286 | cmp al, 83h |
||
287 | je L512 |
||
288 | |||
289 | comp28: |
||
290 | cmp al, 86h |
||
291 | je L512 |
||
292 | |||
293 | comp29: |
||
294 | cmp al, 7Ch |
||
295 | je L1024 |
||
296 | |||
297 | comp30: |
||
298 | cmp al, 84h |
||
299 | je L1024 |
||
300 | |||
301 | comp31: |
||
302 | cmp al, 87h |
||
303 | je L1024 |
||
304 | |||
305 | comp32: |
||
306 | cmp al, 85h |
||
307 | je L2048 |
||
308 | |||
309 | ;-----L1 Trace instr |
||
310 | |||
311 | comp33: |
||
312 | cmp al, 70h |
||
313 | je Li12 |
||
314 | |||
315 | comp34: |
||
316 | cmp al, 71h |
||
317 | je Li16 |
||
318 | |||
319 | comp35: |
||
320 | cmp al, 72h |
||
321 | je Li32 |
||
322 | |||
323 | ;----New codes |
||
324 | |||
325 | comp36: |
||
326 | cmp al, 60h |
||
327 | je Ld16 |
||
328 | |||
329 | comp37: |
||
330 | cmp al, 78h |
||
331 | je L1024 |
||
332 | |||
333 | comp38: |
||
334 | cmp al, 7Dh |
||
335 | je L2048 |
||
336 | |||
337 | ;---- L3 |
||
338 | comp39: |
||
339 | cmp al, 22h |
||
340 | je L305 |
||
341 | |||
342 | comp40: |
||
343 | cmp al, 23h |
||
344 | je L31 |
||
345 | |||
346 | comp41: |
||
347 | cmp al, 25h |
||
348 | je L32 |
||
349 | |||
350 | comp42: |
||
351 | cmp al, 29h |
||
352 | je L34 |
||
353 | |||
354 | comp43: |
||
355 | cmp al, 88h |
||
356 | je L32 |
||
357 | |||
358 | comp44: |
||
359 | cmp al, 89h |
||
360 | je L34 |
||
361 | |||
362 | comp45: |
||
363 | cmp al, 8Ah |
||
364 | je L38 |
||
365 | |||
366 | comp46: |
||
367 | cmp al, 8Dh |
||
368 | je L34 |
||
369 | |||
370 | ;============= v. 2.04 |
||
371 | comp47: |
||
372 | cmp al, 73h |
||
373 | je Li64 |
||
374 | |||
375 | comp48: |
||
376 | cmp al, 1Ah |
||
377 | je L96 |
||
378 | |||
379 | comp49: |
||
380 | cmp al, 3Ah |
||
381 | je L192 |
||
382 | |||
383 | comp50: |
||
384 | cmp al, 3Dh |
||
385 | je L384 |
||
386 | |||
387 | comp51: |
||
388 | cmp al, 3Eh |
||
389 | je L512 |
||
390 | |||
391 | comp52: |
||
392 | cmp al, 7Fh |
||
393 | je L512 |
||
394 | |||
395 | comp53: |
||
396 | cmp al, 46h |
||
397 | je L34 |
||
398 | |||
399 | comp54: |
||
400 | cmp al, 47h |
||
401 | je L38 |
||
402 | |||
403 | comp55: |
||
404 | cmp al, 49h |
||
405 | je L34 |
||
406 | |||
407 | comp56: |
||
408 | cmp al, 4Ah |
||
409 | je L36 |
||
410 | |||
411 | comp57: |
||
412 | cmp al, 4Bh |
||
413 | je L38 |
||
414 | |||
415 | comp58: |
||
416 | cmp al, 4Ch |
||
417 | je L312 |
||
418 | |||
419 | comp59: |
||
420 | cmp al, 4Dh |
||
421 | je L316 |
||
422 | |||
423 | jne L000 |
||
424 | |||
425 | ;------------------ |
||
426 | Li8: |
||
427 | mov [L1i], 8 |
||
428 | jmp L000 |
||
429 | |||
430 | Li12: |
||
431 | mov [L1i], 12 |
||
432 | jmp L000 |
||
433 | |||
434 | Li16: |
||
435 | mov [L1i], 16 |
||
436 | jmp L000 |
||
437 | |||
438 | Li32: |
||
439 | mov [L1i], 32 |
||
440 | jmp L000 |
||
441 | |||
442 | Li64: |
||
443 | mov [L1i], 64 |
||
444 | jmp L000 |
||
445 | |||
446 | Ld8: |
||
447 | mov [L1d], 8 |
||
448 | jmp L000 |
||
449 | |||
450 | Ld16: |
||
451 | mov [L1d], 16 |
||
452 | jmp L000 |
||
453 | |||
454 | Ld32: |
||
455 | mov [L1d], 32 |
||
456 | jmp L000 |
||
457 | |||
458 | L96: |
||
459 | mov [L2], 96 |
||
460 | jmp L000 |
||
461 | |||
462 | L128: |
||
463 | mov [L2], 128 |
||
464 | jmp L000 |
||
465 | |||
466 | L192: |
||
467 | mov [L2], 192 |
||
468 | jmp L000 |
||
469 | |||
470 | L256: |
||
471 | mov [L2], 256 |
||
472 | jmp L000 |
||
473 | |||
474 | L384: |
||
475 | mov [L2], 384 |
||
476 | jmp L000 |
||
477 | |||
478 | L512: |
||
479 | mov [L2], 512 |
||
480 | jmp L000 |
||
481 | |||
482 | L1024: |
||
483 | mov [L2], 1024 |
||
484 | jmp L000 |
||
485 | |||
486 | L2048: |
||
487 | mov [L2], 2048 |
||
488 | jmp L000 |
||
489 | |||
490 | L305: |
||
491 | mov [L3], 512 |
||
492 | jmp L000 |
||
493 | |||
494 | L31: |
||
495 | mov [L3], 1024 |
||
496 | jmp L000 |
||
497 | |||
498 | L32: |
||
499 | mov [L3], 2048 |
||
500 | jmp L000 |
||
501 | |||
502 | L34: |
||
503 | mov [L3], 4096 |
||
504 | jmp L000 |
||
505 | |||
506 | L36: |
||
507 | mov [L3], 6144 |
||
508 | jmp L000 |
||
509 | |||
510 | L38: |
||
511 | mov [L3], 8192 |
||
512 | jmp L000 |
||
513 | |||
514 | L312: |
||
515 | mov [L3], 12288 |
||
516 | jmp L000 |
||
517 | |||
518 | L316: |
||
519 | mov [L3], 16384 |
||
520 | jmp L000 |
||
521 | |||
522 | L000: |
||
523 | ret |
||
524 | ;////////////////////////////////////////////// |
||
525 | ;Decoding Brand ID for Intel |
||
526 | |||
527 | |||
528 | |||
529 | decodebrand: |
||
530 | |||
531 | |||
532 | cmp dword[smallvendor], 'cAMD' |
||
533 | jz amd_br |
||
534 | cmp dword[smallvendor], 'ntel' |
||
535 | jz intel_br |
||
536 | jmp Bi00 ; if not AMD or Intel |
||
537 | |||
538 | amd_br: ;;;;;;;;;;;;;;;;;;;;; amd brand |
||
539 | |||
540 | xor eax,eax |
||
541 | inc eax |
||
542 | cpuid |
||
543 | |||
544 | cnnn0: |
||
545 | cmp bl, 00h |
||
546 | ja rr |
||
547 | je cnnn1 |
||
548 | |||
549 | rr: |
||
550 | mov byte [brand], bl ; |
||
551 | Text 275,210,0x00000000,abrand00, abrand00len-abrand00 |
||
552 | jmp B000 |
||
553 | ;jmp comppp |
||
554 | |||
555 | cnnn1: |
||
556 | |||
557 | mov eax, 0x80000001 ; CPUID ext. function 0x80000001 |
||
558 | cpuid |
||
559 | |||
560 | cmp ebx, 0 |
||
561 | je Bi00 |
||
562 | mov word [brand], bx ; |
||
563 | |||
564 | comppp: |
||
565 | cmp [brand], 400h |
||
566 | jl res1 |
||
567 | cmp [brand], 500h |
||
568 | jl res2 |
||
569 | jae res3 |
||
570 | |||
571 | |||
572 | res1: |
||
573 | Text 275,210,0x00000000,abrand0, abrand0len-abrand0 |
||
574 | jmp B000 |
||
575 | |||
576 | res2: |
||
577 | Text 275,210,0x00000000,abrand1, abrand1len-abrand1 |
||
578 | jmp B000 |
||
579 | |||
580 | res3: |
||
581 | Text 275,210,0x00000000,abrand2, abrand2len-abrand2 |
||
582 | jmp B000 |
||
583 | ;;;;;;;;;;;;;;;;;;;;; intel brand |
||
584 | intel_br: |
||
585 | xor eax,eax |
||
586 | inc eax |
||
587 | cpuid |
||
588 | cmp0: |
||
589 | cmp bl, 00h |
||
590 | je Bi00 |
||
591 | |||
592 | cmp1: |
||
593 | cmp bl, 01h |
||
594 | je Bi01 |
||
595 | |||
596 | cmp2: |
||
597 | cmp bl, 02h |
||
598 | je Bi02 |
||
599 | |||
600 | cmp3: |
||
601 | cmp bl, 03h |
||
602 | je Bi03 |
||
603 | |||
604 | cmp4: |
||
605 | cmp bl, 04h |
||
606 | je Bi04 |
||
607 | |||
608 | cmp6: |
||
609 | cmp bl, 06h |
||
610 | je Bi06 |
||
611 | |||
612 | cmp7: |
||
613 | cmp bl, 07h |
||
614 | je Bi07 |
||
615 | |||
616 | cmp8: |
||
617 | cmp bl, 08h |
||
618 | je Bi08 |
||
619 | |||
620 | cmp9: |
||
621 | cmp bl, 09h |
||
622 | je Bi09 |
||
623 | |||
624 | cmpA: |
||
625 | cmp bl, 0Ah |
||
626 | je Bi0A |
||
627 | |||
628 | cmpB: |
||
629 | cmp bl, 0Bh |
||
630 | je Bi0B |
||
631 | |||
632 | cmpC: |
||
633 | cmp bl, 0Ch |
||
634 | je Bi0C |
||
635 | |||
636 | cmpE: |
||
637 | cmp bl, 0Eh |
||
638 | je Bi0E |
||
639 | |||
640 | cmpF: |
||
641 | cmp bl, 0Fh |
||
642 | je Bi0F |
||
643 | |||
644 | cmp11: |
||
645 | cmp bl, 11h |
||
646 | je Bi11 |
||
647 | |||
648 | cmp12: |
||
649 | cmp bl, 12h |
||
650 | je Bi12 |
||
651 | |||
652 | cmp13: |
||
653 | cmp bl, 13h |
||
654 | je Bi13 |
||
655 | |||
656 | cmp14: |
||
657 | cmp bl, 14h |
||
658 | je Bi14 |
||
659 | |||
660 | cmp15: |
||
661 | cmp bl, 15h |
||
662 | je Bi15 |
||
663 | |||
664 | cmp16: |
||
665 | cmp bl, 16h |
||
666 | je Bi16 |
||
667 | |||
668 | cmp17: |
||
669 | cmp bl, 17h |
||
670 | je Bi17 |
||
671 | |||
672 | jne Bi00 |
||
673 | |||
674 | ;------------------ |
||
675 | Bi00: |
||
676 | mov byte [brand], bl ;00h |
||
677 | Text 275,210,0x00000000,brand0, brand0len-brand0 |
||
678 | ;Number 275,200,1*256,2,dword [brand],0x000000 was in v. 1.11 |
||
679 | jmp B000 |
||
680 | |||
681 | Bi01: |
||
682 | mov [brand], 01h |
||
683 | Text 275,210,0x00000000,brand01, brand01len-brand01 |
||
684 | jmp B000 |
||
685 | |||
686 | Bi02: |
||
687 | mov [brand], 02h |
||
688 | Text 275,210,0x00000000,brand02, brand02len-brand02 |
||
689 | jmp B000 |
||
690 | |||
691 | Bi03: |
||
692 | mov [brand], 03h |
||
693 | |||
694 | cmp [m], 8 |
||
695 | je E3 |
||
696 | Text 275,210,0x00000000,brand03, brand03len-brand03 |
||
697 | jmp B000 |
||
698 | E3: |
||
699 | Text 275,210,0x00000000,brand03d, brand03dlen-brand03d |
||
700 | jmp B000 |
||
701 | |||
702 | Bi04: |
||
703 | mov [brand], 04h |
||
704 | Text 275,210,0x00000000,brand04, brand04len-brand04 |
||
705 | jmp B000 |
||
706 | |||
707 | Bi06: |
||
708 | mov [brand], 06h |
||
709 | Text 275,210,0x00000000,brand06, brand06len-brand06 |
||
710 | jmp B000 |
||
711 | |||
712 | Bi07: |
||
713 | mov [brand], 07h |
||
714 | Text 275,210,0x00000000,brand07, brand07len-brand07 |
||
715 | jmp B000 |
||
716 | |||
717 | Bi08: |
||
718 | mov [brand], 08h |
||
719 | Text 275,210,0x00000000,brand08, brand08len-brand08 |
||
720 | jmp B000 |
||
721 | |||
722 | Bi09: |
||
723 | mov [brand], 09h |
||
724 | Text 275,210,0x00000000,brand09, brand09len-brand09 |
||
725 | jmp B000 |
||
726 | |||
727 | Bi0A: |
||
728 | mov [brand], 0Ah |
||
729 | Text 275,210,0x00000000,brand0A, brand0Alen-brand0A |
||
730 | jmp B000 |
||
731 | |||
732 | Bi0B: |
||
733 | mov [brand], 0Bh |
||
734 | |||
735 | cmp [m], 13 |
||
736 | jl Eb |
||
737 | Text 275,210,0x00000000,brand0B, brand0Blen-brand0B |
||
738 | jmp B000 |
||
739 | Eb: |
||
740 | Text 275,210,0x00000000,brand0Bd, brand0Bdlen-brand0Bd |
||
741 | jmp B000 |
||
742 | |||
743 | Bi0C: |
||
744 | mov [brand], 0Ch |
||
745 | Text 275,210,0x00000000,brand0C, brand0Clen-brand0C |
||
746 | jmp B000 |
||
747 | |||
748 | Bi0E: |
||
749 | mov [brand], 0Eh |
||
750 | |||
751 | cmp [m], 13 |
||
752 | jl Ed |
||
753 | Text 275,210,0x00000000,brand0E, brand0Elen-brand0E |
||
754 | jmp B000 |
||
755 | Ed: |
||
756 | Text 275,210,0x00000000,brand0Ed, brand0Edlen-brand0Ed |
||
757 | jmp B000 |
||
758 | |||
759 | Bi0F: |
||
760 | mov [brand], 0Fh |
||
761 | Text 275,210,0x00000000,brand0F, brand0Flen-brand0F |
||
762 | jmp B000 |
||
763 | |||
764 | Bi11: |
||
765 | mov [brand], 11h |
||
766 | Text 275,210,0x00000000,brand11, brand11len-brand11 |
||
767 | jmp B000 |
||
768 | |||
769 | Bi12: |
||
770 | mov [brand], 12h |
||
771 | Text 275,210,0x00000000,brand12, brand12len-brand12 |
||
772 | jmp B000 |
||
773 | |||
774 | Bi13: |
||
775 | mov [brand], 13h |
||
776 | Text 275,210,0x00000000,brand13, brand13len-brand13 |
||
777 | jmp B000 |
||
778 | |||
779 | Bi14: |
||
780 | mov [brand], 14h |
||
781 | Text 275,210,0x00000000,brand14, brand14len-brand14 |
||
782 | jmp B000 |
||
783 | |||
784 | Bi15: |
||
785 | mov [brand], 15h |
||
786 | Text 275,210,0x00000000,brand15, brand15len-brand15 |
||
787 | jmp B000 |
||
788 | |||
789 | Bi16: |
||
790 | mov [brand], 16h |
||
791 | Text 275,210,0x00000000,brand16, brand16len-brand16 |
||
792 | jmp B000 |
||
793 | |||
794 | Bi17: |
||
795 | mov [brand], 17h |
||
796 | Text 275,210,0x00000000,brand17, brand17len-brand17 |
||
797 | jmp B000 |
||
798 | |||
799 | B000: |
||
800 | |||
801 | ret |
||
802 | ;////////////////////////////////////////////// |
||
803 | |||
804 | ;decoding standard features |
||
805 | |||
806 | decode_standard_features: |
||
807 | |||
808 | xor eax,eax |
||
809 | inc eax |
||
810 | cpuid |
||
811 | |||
812 | Test0: |
||
813 | test edx, FPU_FLAG |
||
814 | jnz Test0e |
||
815 | |||
816 | mov dword [FPU+6], $6F6E |
||
817 | jmp Test1 |
||
818 | |||
819 | Test0e: |
||
820 | mov dword [FPU+6], $736579 |
||
821 | |||
822 | ;;;;;; |
||
823 | Test1: |
||
824 | test edx, VME_FLAG |
||
825 | jnz Test1e |
||
826 | |||
827 | mov dword [VME+ 7], $6F6E |
||
828 | jmp Test2 |
||
829 | |||
830 | Test1e: |
||
831 | mov dword [VME+ 7], $736579 |
||
832 | |||
833 | ;;;;;; |
||
834 | Test2: |
||
835 | test edx, DE_FLAG |
||
836 | jnz Test2e |
||
837 | |||
838 | mov dword [DE+ 7], $6F6E |
||
839 | jmp Test3 |
||
840 | |||
841 | Test2e: |
||
842 | mov dword [DE+ 7], $736579 |
||
843 | ;;;;;; |
||
844 | |||
845 | Test3: |
||
846 | test edx, PSE_FLAG |
||
847 | jnz Test3e |
||
848 | |||
849 | mov dword [PSE+ 8], $6F6E |
||
850 | jmp Test4 |
||
851 | |||
852 | Test3e: |
||
853 | mov dword [PSE+ 8], $736579 |
||
854 | |||
855 | ;;;; |
||
856 | Test4: |
||
857 | test edx, TSC_FLAG |
||
858 | jnz Test4e |
||
859 | |||
860 | mov dword [TSC+ 6], $6F6E |
||
861 | jmp Test5 |
||
862 | |||
863 | Test4e: |
||
864 | mov dword [TSC+ 6], $736579 |
||
865 | |||
866 | ;;;; |
||
867 | Test5: |
||
868 | test edx, MSR_FLAG |
||
869 | jnz Test5e |
||
870 | |||
871 | mov dword [MSR+ 7], $6F6E |
||
872 | jmp Test6 |
||
873 | |||
874 | Test5e: |
||
875 | mov dword [MSR+ 7], $736579 |
||
876 | |||
877 | ;;;; |
||
878 | Test6: |
||
879 | test edx, PAE_FLAG |
||
880 | jnz Test6e |
||
881 | |||
882 | mov dword [PAE+ 7], $6F6E |
||
883 | jmp Test7 |
||
884 | |||
885 | Test6e: |
||
886 | mov dword [PAE+ 7], $736579 |
||
887 | |||
888 | ;;;; |
||
889 | Test7: |
||
890 | test edx, MCE_FLAG |
||
891 | jnz Test7e |
||
892 | |||
893 | mov dword [MCE+ 8], $6F6E |
||
894 | jmp Test8 |
||
895 | |||
896 | Test7e: |
||
897 | mov dword [MCE+ 8], $736579 |
||
898 | |||
899 | ;;;; |
||
900 | Test8: |
||
901 | test edx, CX8_FLAG |
||
902 | jnz Test8e |
||
903 | |||
904 | mov dword [CX8+ 6], $6F6E |
||
905 | jmp Test9 |
||
906 | |||
907 | Test8e: |
||
908 | mov dword [CX8+ 6], $736579 |
||
909 | ;;;; |
||
910 | |||
911 | Test9: |
||
912 | test edx, APIC_FLAG |
||
913 | jnz Test9e |
||
914 | |||
915 | mov dword [APIC+ 7], $6F6E |
||
916 | jmp Test11 |
||
917 | |||
918 | Test9e: |
||
919 | mov dword [APIC+ 7], $736579 |
||
920 | ;;;;; |
||
921 | |||
922 | Test11: |
||
923 | test edx, SEP_FLAG |
||
924 | jnz Test11e |
||
925 | |||
926 | mov dword [SEP+ 8], $6F6E |
||
927 | jmp Test12 |
||
928 | |||
929 | Test11e: |
||
930 | mov dword [SEP+ 8], $736579 |
||
931 | ;;;; |
||
932 | |||
933 | Test12: |
||
934 | test edx, MTRR_FLAG |
||
935 | jnz Test12e |
||
936 | |||
937 | mov dword [MTRR+ 6], $6F6E |
||
938 | jmp Test13 |
||
939 | |||
940 | Test12e: |
||
941 | mov dword [MTRR+ 6], $736579 |
||
942 | ;;;; |
||
943 | |||
944 | Test13: |
||
945 | test edx, PGE_FLAG |
||
946 | jnz Test13e |
||
947 | |||
948 | mov dword [PGE+ 7], $6F6E |
||
949 | jmp Test14 |
||
950 | |||
951 | Test13e: |
||
952 | mov dword [PGE+ 7], $736579 |
||
953 | ;;;;; |
||
954 | |||
955 | Test14: |
||
956 | test edx, MCA_FLAG |
||
957 | jnz Test14e |
||
958 | |||
959 | mov dword [MCA+ 7], $6F6E |
||
960 | jmp Test15 |
||
961 | |||
962 | Test14e: |
||
963 | mov dword [MCA+ 7], $736579 |
||
964 | ;;;; |
||
965 | |||
966 | Test15: |
||
967 | test edx, CMOV_FLAG |
||
968 | jnz Test15e |
||
969 | |||
970 | mov dword [CMOV+ 8], $6F6E |
||
971 | jmp Test16 |
||
972 | |||
973 | Test15e: |
||
974 | mov dword [CMOV+ 8], $736579 |
||
975 | ;;;; |
||
976 | |||
977 | Test16: |
||
978 | test edx, PAT_FLAG |
||
979 | jnz Test16e |
||
980 | |||
981 | mov dword [PAT+ 6], $6F6E |
||
982 | jmp Test17 |
||
983 | |||
984 | Test16e: |
||
985 | mov dword [PAT+ 6], $736579 |
||
986 | ;;;; |
||
987 | |||
988 | Test17: |
||
989 | test edx, PSE36_FLAG |
||
990 | jnz Test17e |
||
991 | |||
992 | mov dword [PSE36+ 7], $6F6E |
||
993 | jmp Test18 |
||
994 | |||
995 | Test17e: |
||
996 | mov dword [PSE36+ 7], $736579 |
||
997 | ;;;; |
||
998 | |||
999 | Test18: |
||
1000 | test edx, PSNUM_FLAG |
||
1001 | jnz Test18e |
||
1002 | |||
1003 | mov dword [PSNUM+ 7], $6F6E |
||
1004 | jmp Test19 |
||
1005 | |||
1006 | Test18e: |
||
1007 | mov dword [PSNUM+ 7], $736579 |
||
1008 | ;;;; |
||
1009 | |||
1010 | Test19: |
||
1011 | test edx, CLFLUSH_FLAG |
||
1012 | jnz Test19e |
||
1013 | |||
1014 | mov dword [CLFLUSHn + 8], $6F6E |
||
1015 | jmp Test21 |
||
1016 | |||
1017 | Test19e: |
||
1018 | mov dword [CLFLUSHn + 8], $736579 |
||
1019 | ;;;; |
||
1020 | |||
1021 | Test21: |
||
1022 | test edx, DTS_FLAG |
||
1023 | jnz Test21e |
||
1024 | |||
1025 | mov dword [DTS+ 7], $6F6E |
||
1026 | jmp Test22 |
||
1027 | |||
1028 | Test21e: |
||
1029 | mov dword [DTS+ 7], $736579 |
||
1030 | ;;;; |
||
1031 | |||
1032 | Test22: |
||
1033 | test edx, ACPI_FLAG |
||
1034 | jnz Test22e |
||
1035 | |||
1036 | mov dword [ACPI+ 7], $6F6E |
||
1037 | jmp Test23 |
||
1038 | |||
1039 | Test22e: |
||
1040 | mov dword [ACPI+ 7], $736579 |
||
1041 | ;;;;; |
||
1042 | |||
1043 | Test23: |
||
1044 | test edx, MMX_FLAG |
||
1045 | jnz Test23e |
||
1046 | |||
1047 | mov dword [MMX+ 8], $6F6E |
||
1048 | mov dword [MMXs+ 7], $6F6E |
||
1049 | jmp Test24 |
||
1050 | |||
1051 | Test23e: |
||
1052 | mov dword [MMX+ 8], $736579 |
||
1053 | mov dword [MMXs+ 7], $736579 |
||
1054 | ;;;;; |
||
1055 | |||
1056 | Test24: |
||
1057 | test edx, FXSR_FLAG |
||
1058 | jnz Test24e |
||
1059 | |||
1060 | mov dword [FXSR+ 6], $6F6E |
||
1061 | jmp Test25 |
||
1062 | |||
1063 | Test24e: |
||
1064 | mov dword [FXSR+ 6], $736579 |
||
1065 | ;;;;; |
||
1066 | |||
1067 | Test25: |
||
1068 | test edx, SSE_FLAG |
||
1069 | jnz Test25e |
||
1070 | |||
1071 | mov dword [SSE+ 7], $6F6E |
||
1072 | jmp Test26 |
||
1073 | |||
1074 | Test25e: |
||
1075 | mov dword [SSE+ 7], $736579 |
||
1076 | |||
1077 | ;;;; |
||
1078 | Test26: |
||
1079 | test edx, SSE2_FLAG |
||
1080 | jnz Test26e |
||
1081 | |||
1082 | mov dword [SSE2+ 7], $6F6E |
||
1083 | jmp Test27 |
||
1084 | |||
1085 | Test26e: |
||
1086 | mov dword [SSE2+ 7], $736579 |
||
1087 | |||
1088 | ;;;; |
||
1089 | |||
1090 | Test27: |
||
1091 | test edx, SS_FLAG |
||
1092 | jnz Test27e |
||
1093 | |||
1094 | mov dword [SSn+ 8], $6F6E |
||
1095 | jmp Test29;28 |
||
1096 | |||
1097 | Test27e: |
||
1098 | mov dword [SSn+ 8], $736579 |
||
1099 | |||
1100 | ;;;; |
||
1101 | |||
1102 | ;Test28: |
||
1103 | ;test edx, HTT_FLAG |
||
1104 | ;jnz Test28e |
||
1105 | ; |
||
1106 | ;mov dword [HTT+ 8], $6F6E |
||
1107 | ;jmp Test29 |
||
1108 | ; |
||
1109 | ;Test28e: |
||
1110 | ;mov dword [HTT+ 8], $736579 |
||
1111 | |||
1112 | ;;;; |
||
1113 | |||
1114 | Test29: |
||
1115 | test edx, TM_FLAG |
||
1116 | jnz Test29e |
||
1117 | |||
1118 | mov dword [TM+ 7], $6F6E |
||
1119 | jmp Test30 |
||
1120 | |||
1121 | Test29e: |
||
1122 | mov dword [TM+ 7], $736579 |
||
1123 | |||
1124 | ;;;; |
||
1125 | |||
1126 | Test30: |
||
1127 | test edx, IA64_FLAG |
||
1128 | jnz Test30e |
||
1129 | |||
1130 | mov dword [IA64+ 7], $6F6E |
||
1131 | jmp Test31 |
||
1132 | |||
1133 | Test30e: |
||
1134 | mov dword [IA64+ 7], $736579 |
||
1135 | |||
1136 | ;;;; |
||
1137 | Test31: |
||
1138 | test edx, PBE_FLAG |
||
1139 | jnz Test31e |
||
1140 | |||
1141 | mov dword [PBE+ 8], $6F6E |
||
1142 | jmp Standart_out |
||
1143 | |||
1144 | Test31e: |
||
1145 | mov dword [PBE+ 8], $736579 |
||
1146 | |||
1147 | Standart_out: |
||
1148 | |||
1149 | ret |
||
1150 | ;////////////////////////////////////////////// |
||
1151 | decode_sse3: ; is SS3 supported |
||
1152 | xor eax,eax |
||
1153 | inc eax |
||
1154 | cpuid |
||
1155 | test ecx, $1 ; Test bit 1 |
||
1156 | jnz .EX; SSE3 technology is supported |
||
1157 | jz .EXN |
||
1158 | |||
1159 | .EX: |
||
1160 | mov dword [sse3+ 6], $736579 |
||
1161 | mov [sse3sup], 1 |
||
1162 | jmp exitter |
||
1163 | .EXN: |
||
1164 | mov dword [sse3+ 6], $6F6E |
||
1165 | mov [sse3sup],0 |
||
1166 | |||
1167 | exitter: |
||
1168 | |||
1169 | ret |
||
1170 | ;////////////////////////////////////////////// |
||
1171 | decode_extended_features: |
||
1172 | xor eax,eax |
||
1173 | inc eax |
||
1174 | cpuid |
||
1175 | Tes1: |
||
1176 | test ecx, SSE3_FLAG |
||
1177 | jnz Tes1e |
||
1178 | |||
1179 | mov dword [SS3+ 8], $6F6E |
||
1180 | jmp Tes2 |
||
1181 | |||
1182 | Tes1e: |
||
1183 | mov dword [SS3+ 8], $736579 |
||
1184 | |||
1185 | |||
1186 | Tes2: |
||
1187 | test ecx, MON_FLAG |
||
1188 | jnz Tes2e |
||
1189 | |||
1190 | mov dword [MON+ 8], $6F6E |
||
1191 | jmp Tes3 |
||
1192 | |||
1193 | Tes2e: |
||
1194 | mov dword [MON+ 8], $736579 |
||
1195 | |||
1196 | |||
1197 | Tes3: |
||
1198 | test ecx, DS_CPL_FLAG |
||
1199 | jnz Tes3e |
||
1200 | |||
1201 | mov dword [DS_CPL+ 8], $6F6E |
||
1202 | jmp Tes4 |
||
1203 | |||
1204 | Tes3e: |
||
1205 | mov dword [DS_CPL+ 8], $736579 |
||
1206 | |||
1207 | Tes4: |
||
1208 | test ecx, EST_FLAG |
||
1209 | jnz Tes4e |
||
1210 | |||
1211 | mov dword [EST+ 8], $6F6E |
||
1212 | jmp Tes5 |
||
1213 | |||
1214 | Tes4e: |
||
1215 | mov dword [EST+ 8], $736579 |
||
1216 | |||
1217 | |||
1218 | Tes5: |
||
1219 | test ecx, TM2_FLAG |
||
1220 | jnz Tes5e |
||
1221 | |||
1222 | mov dword [TM2+ 8], $6F6E |
||
1223 | jmp Tes6 |
||
1224 | |||
1225 | Tes5e: |
||
1226 | mov dword [TM2+ 8], $736579 |
||
1227 | |||
1228 | |||
1229 | Tes6: |
||
1230 | test ecx, CNXT_ID_FLAG |
||
1231 | jnz Tes6e |
||
1232 | |||
1233 | mov dword [CNXT_ID+ 9], $6F6E |
||
1234 | jmp Tes7 |
||
1235 | |||
1236 | Tes6e: |
||
1237 | mov dword [CNXT_ID+ 9], $736579 |
||
1238 | |||
1239 | |||
1240 | Tes7: |
||
1241 | test ecx, CX16_FLAG |
||
1242 | jnz Tes7e |
||
1243 | |||
1244 | mov dword [CX16+ 9], $6F6E |
||
1245 | jmp Tes8 |
||
1246 | |||
1247 | Tes7e: |
||
1248 | mov dword [CX16+ 9], $736579 |
||
1249 | |||
1250 | |||
1251 | Tes8: |
||
1252 | test ecx, ETPRD_FLAG |
||
1253 | jnz Tes8e |
||
1254 | |||
1255 | mov dword [ETPRD+ 9], $6F6E |
||
1256 | jmp Tes9 |
||
1257 | |||
1258 | Tes8e: |
||
1259 | mov dword [ETPRD+ 9], $736579 |
||
1260 | |||
1261 | Tes9: |
||
1262 | |||
1263 | ret |
||
1264 | |||
1265 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
1266 | decode_extended: |
||
1267 | xor eax, eax |
||
1268 | mov eax,$80000000 |
||
1269 | cpuid |
||
1270 | ;cmp eax,$80000000 |
||
1271 | test eax, 80000000h |
||
1272 | jnz gooodd |
||
1273 | ; |
||
1274 | jmp baaad |
||
1275 | |||
1276 | baaad: |
||
1277 | ;mov dword [MP+8], $6F6E |
||
1278 | ;mov dword [NX+ 8], $6F6E |
||
1279 | ;mov dword [MMXPi+ 8], $6F6E |
||
1280 | ;mov dword [MMXn+ 8], $6F6E |
||
1281 | ;mov dword [FXSRn+ 8], $6F6E |
||
1282 | ;mov dword [FFXSR+ 10], $6F6E |
||
1283 | ;mov dword [TSCP+ 10], $6F6E |
||
1284 | ;mov dword [LM+ 10], $6F6E |
||
1285 | ;mov dword [DNo+ 10], $6F6E |
||
1286 | ;mov dword [DN+ 10], $6F6E |
||
1287 | ;mov dword [SYS+ 9], $6F6E |
||
1288 | ;mov dword [LAF+ 9], $6F6E |
||
1289 | |||
1290 | |||
1291 | |||
1292 | jmp Tez13 |
||
1293 | |||
1294 | gooodd: |
||
1295 | xor eax, eax |
||
1296 | mov eax, $80000001 ;// Setup extended function 8000_0001h |
||
1297 | cpuid |
||
1298 | |||
1299 | Tez1: |
||
1300 | test edx, MP_FLAG |
||
1301 | jnz Tez1e |
||
1302 | |||
1303 | mov dword [MP+8], $6F6E |
||
1304 | jmp Tez2 |
||
1305 | |||
1306 | Tez1e: |
||
1307 | mov dword [MP+ 8], $736579 |
||
1308 | |||
1309 | Tez2: |
||
1310 | test edx, NX_FLAG |
||
1311 | jnz Tez2e |
||
1312 | |||
1313 | mov dword [NX+ 8], $6F6E |
||
1314 | jmp Tez4 |
||
1315 | ;jmp Tez3 было, но из-за Сирикс приходится делать детект в лругом месте |
||
1316 | |||
1317 | Tez2e: |
||
1318 | mov dword [NX+ 8], $736579 |
||
1319 | |||
1320 | ;Tez3: |
||
1321 | ;test edx, MMXPi_FLAG |
||
1322 | ;jnz Tez3e |
||
1323 | |||
1324 | ;mov dword [MMXPi+ 8], $6F6E |
||
1325 | ;jmp Tez4 |
||
1326 | |||
1327 | |||
1328 | ;Tez3e: |
||
1329 | ;mov dword [MMXPi+ 8], $736579 |
||
1330 | |||
1331 | Tez4: |
||
1332 | test edx, MMXn_FLAG |
||
1333 | jnz Tez4e |
||
1334 | |||
1335 | mov dword [MMXn+ 8], $6F6E |
||
1336 | jmp Tez5 |
||
1337 | |||
1338 | Tez4e: |
||
1339 | mov dword [MMXn+ 8], $736579 |
||
1340 | |||
1341 | Tez5: |
||
1342 | test edx, FXSRn_FLAG |
||
1343 | jnz Tez5e |
||
1344 | |||
1345 | mov dword [FXSRn+ 8], $6F6E |
||
1346 | jmp Tez6 |
||
1347 | |||
1348 | Tez5e: |
||
1349 | mov dword [FXSRn+ 8], $736579 |
||
1350 | |||
1351 | Tez6: |
||
1352 | test edx, FFXSR_FLAG |
||
1353 | jnz Tez6e |
||
1354 | |||
1355 | mov dword [FFXSR+ 10], $6F6E |
||
1356 | jmp Tez7 |
||
1357 | |||
1358 | Tez6e: |
||
1359 | mov dword [FFXSR+ 10], $736579 |
||
1360 | |||
1361 | Tez7: |
||
1362 | test edx, TSCP_FLAG |
||
1363 | jnz Tez7e |
||
1364 | |||
1365 | mov dword [TSCP+ 10], $6F6E |
||
1366 | jmp Tez8 |
||
1367 | |||
1368 | Tez7e: |
||
1369 | mov dword [TSCP+ 10], $736579 |
||
1370 | |||
1371 | |||
1372 | Tez8: |
||
1373 | test edx, LM_FLAG |
||
1374 | jnz Tez8e |
||
1375 | |||
1376 | mov dword [LM+ 10], $6F6E |
||
1377 | jmp Tez9 |
||
1378 | |||
1379 | Tez8e: |
||
1380 | mov dword [LM+ 10], $736579 |
||
1381 | |||
1382 | Tez9: |
||
1383 | test edx, DNo_FLAG |
||
1384 | jnz Tez9e |
||
1385 | |||
1386 | mov dword [DNo+ 10], $6F6E |
||
1387 | jmp Tez10 |
||
1388 | |||
1389 | Tez9e: |
||
1390 | mov dword [DNo+ 10], $736579 |
||
1391 | |||
1392 | |||
1393 | Tez10: |
||
1394 | test edx, DN_FLAG |
||
1395 | jnz Tez10e |
||
1396 | |||
1397 | mov dword [DN+ 10], $6F6E |
||
1398 | jmp Tez11 |
||
1399 | |||
1400 | Tez10e: |
||
1401 | mov dword [DN+ 10], $736579 |
||
1402 | |||
1403 | ;Intel |
||
1404 | |||
1405 | Tez11: |
||
1406 | test edx, SYS_FLAG |
||
1407 | jnz Tez11e |
||
1408 | |||
1409 | mov dword [SYS+ 9], $6F6E |
||
1410 | jmp Tez12 |
||
1411 | |||
1412 | Tez11e: |
||
1413 | mov dword [SYS+ 9], $736579 |
||
1414 | |||
1415 | |||
1416 | Tez12: |
||
1417 | test ecx, LAHF_FLAG |
||
1418 | jnz Tez12e |
||
1419 | |||
1420 | mov dword [LAF+ 9], $6F6E |
||
1421 | jmp Tez13 |
||
1422 | |||
1423 | Tez12e: |
||
1424 | mov dword [LAF+ 9], $736579 |
||
1425 | |||
1426 | Tez13: |
||
1427 | |||
1428 | ret |
||
1429 | ;////////////////////////////////////////////// |
||
1430 | newrating: |
||
1431 | |||
1432 | cmp [FRS], 266 |
||
1433 | jz f266 |
||
1434 | cmp [FRS], 333 |
||
1435 | jz f333 |
||
1436 | cmp [FRS], 400 |
||
1437 | jz f400 |
||
1438 | |||
1439 | f266: |
||
1440 | |||
1441 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
1442 | ; |
||
1443 | ; Print the unpacked img to screen |
||
1444 | ; gif2img i333,img_area3 |
||
1445 | ; mov eax,7 ; sysfunc7: putimage |
||
1446 | ; mov ebx,img_area3+8 ; pointer to image |
||
1447 | ; mov ecx,33*65536+30 ; resolution (all gif's included are 64*81) |
||
1448 | ; mov edx,240*65536+90 ; plce to print image on screen (first number is |
||
1449 | ;pixels from left, second pixels from top) |
||
1450 | ; int 0x40 ; execute function |
||
1451 | |||
1452 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
1453 | |||
1454 | ;формулы вычисления XP-рейтинга Athlon-ов (Tbred, Barton): |
||
1455 | ;FSB266/256kB: сделано |
||
1456 | ;XP+ (Freq<2000MHz) = 1000 + (Freq-1000)*1,5 = Freq*1.5-500 |
||
1457 | ;XP+ (Freq>=2000MHz) = 900 + (Freq-1000)*1,5 = Freq*1.5-600 |
||
1458 | |||
1459 | |||
1460 | cmp [total], 2000 |
||
1461 | jl pal |
||
1462 | |||
1463 | ; Рейтинг для Паломино 2000+ |
||
1464 | mov eax,[total] |
||
1465 | imul eax, 3 |
||
1466 | shr eax,1 |
||
1467 | sub eax, 600 |
||
1468 | mov [rating], eax |
||
1469 | |||
1470 | jmp vyxod |
||
1471 | |||
1472 | pal: |
||
1473 | |||
1474 | ; Рейтинг для Паломино 2000- |
||
1475 | mov eax,[total] |
||
1476 | imul eax, 3 |
||
1477 | shr eax,1 |
||
1478 | sub eax, 500 |
||
1479 | mov [rating], eax |
||
1480 | |||
1481 | jmp vyxod |
||
1482 | |||
1483 | |||
1484 | f333: |
||
1485 | |||
1486 | |||
1487 | |||
1488 | |||
1489 | cmp [L2], 256 |
||
1490 | jl .Th ; Thorton |
||
1491 | |||
1492 | ;FSB333/512kB: сделано |
||
1493 | ;XP+ (Freq<2100MHz) = Freq*1.2 + 300 |
||
1494 | ;XP+ (Freq>=2100MHz) = Freq*1.2 + 400 |
||
1495 | |||
1496 | cmp [total], 2100 |
||
1497 | jl .r2100 |
||
1498 | mov eax,[total] |
||
1499 | xor edx, edx |
||
1500 | imul eax, 600000 |
||
1501 | mov ebx, 500000 |
||
1502 | div ebx |
||
1503 | mov [rating], eax |
||
1504 | add [rating], 400 |
||
1505 | |||
1506 | ; Rating for Barton F<2000 MHz |
||
1507 | jmp vyxod |
||
1508 | |||
1509 | .r2100: |
||
1510 | mov eax,[total] |
||
1511 | xor edx, edx |
||
1512 | imul eax, 600000 |
||
1513 | mov ebx, 500000 |
||
1514 | div ebx |
||
1515 | mov [rating], eax |
||
1516 | add [rating], 300 |
||
1517 | |||
1518 | |||
1519 | ; Rating for Barton F>2000 MHz |
||
1520 | jmp vyxod |
||
1521 | |||
1522 | ;FSB333/256kB: сделано |
||
1523 | ;XP+ = Freq*1.2 + 100 |
||
1524 | |||
1525 | .Th: |
||
1526 | |||
1527 | mov eax,[total] |
||
1528 | xor edx, edx |
||
1529 | imul eax, 600000 |
||
1530 | mov ebx, 500000 |
||
1531 | div ebx |
||
1532 | mov [rating], eax |
||
1533 | add [rating], 100 |
||
1534 | |||
1535 | |||
1536 | ;Rating for Thorton |
||
1537 | |||
1538 | |||
1539 | jmp vyxod |
||
1540 | |||
1541 | f400: |
||
1542 | |||
1543 | |||
1544 | ;FSB400/512kB: |
||
1545 | ;XP+ = Freq*1.5 - 100 |
||
1546 | |||
1547 | mov eax,[total] |
||
1548 | imul eax, 3 |
||
1549 | shr eax,1 |
||
1550 | sub eax, 100 |
||
1551 | mov [rating], eax |
||
1552 | |||
1553 | vyxod: |
||
1554 | |||
1555 | |||
1556 | ret |
||
1557 | |||
1558 | |||
1559 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
||
1560 | |||
1561 | multipl: |
||
1562 | ;--- вычисление коэффициента умножения - |
||
1563 | ; портит регистры |
||
1564 | ; out : CL = коэфф.умножения * 10, или 0 |
||
1565 | xor ecx, ecx |
||
1566 | |||
1567 | cmp dword[smallvendor], 'cAMD' ; Check for Advanced Micro Devices CPU |
||
1568 | jne noAMD |
||
1569 | cmp byte [f], 5 |
||
1570 | jne noAMDK6 |
||
1571 | mov eax, 68 ; AMD-K6 (p.30) |
||
1572 | mov ebx, 3 |
||
1573 | mov edx, 0x0C0000087 |
||
1574 | int 0x40 ; eax - low dword |
||
1575 | and eax, 111b |
||
1576 | mov cl, [athloncoef3 + eax] |
||
1577 | cmp eax, 6 |
||
1578 | jne @f |
||
1579 | cmp byte[m], 8 |
||
1580 | jae @f |
||
1581 | mov cl, 20 |
||
1582 | @@: ret |
||
1583 | |||
1584 | noAMDK6: |
||
1585 | cmp byte [f], 6 |
||
1586 | jne noAMDK7 |
||
1587 | mov eax, 68 ; Athlon/AthlonXP |
||
1588 | mov ebx, 3 |
||
1589 | mov edx, 0x0C0010015 |
||
1590 | int 0x40 |
||
1591 | mov ebx, eax |
||
1592 | shr ebx, 24 |
||
1593 | and ebx, 0x0F |
||
1594 | shr eax, 20 |
||
1595 | jc @f |
||
1596 | mov cl, [athloncoef + ebx] |
||
1597 | ret |
||
1598 | @@: mov cl, [athloncoef2 + ebx] |
||
1599 | ret |
||
1600 | |||
1601 | noAMD: |
||
1602 | cmp dword[smallvendor], 'ntel' ; Check for International Electronics CPU |
||
1603 | jne noIntel |
||
1604 | cmp byte[f], 0x0F |
||
1605 | jne noIntelP4 |
||
1606 | cmp byte [t], 6 |
||
1607 | jne @f |
||
1608 | mov eax, 68 ; Pentium M |
||
1609 | mov ebx, 3 |
||
1610 | mov edx, 0x2A |
||
1611 | int 0x40 |
||
1612 | shr eax, 22 |
||
1613 | and eax, 0x1F |
||
1614 | mov dl, 10 |
||
1615 | mul dl |
||
1616 | mov cl, al |
||
1617 | ret |
||
1618 | @@: cmp byte [m], 2 |
||
1619 | jae @f |
||
1620 | mov eax, 68 ; Pentium 4 / Xeon (model < 2) |
||
1621 | mov ebx, 3 |
||
1622 | mov edx, 0x2A |
||
1623 | int 0x40 |
||
1624 | shr eax, 8 |
||
1625 | and eax, 0x0F |
||
1626 | mov cl, [p4coef + eax] |
||
1627 | ret |
||
1628 | @@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) |
||
1629 | mov ebx, 3 |
||
1630 | mov edx, 0x2C |
||
1631 | int 0x40 |
||
1632 | |||
1633 | ; shr eax, 24 |
||
1634 | ; and eax, 0x1F |
||
1635 | shr eax, 27 |
||
1636 | and al, 0Fh |
||
1637 | add al, 8 |
||
1638 | |||
1639 | mov dl, 10 |
||
1640 | mul dl |
||
1641 | mov cl, al |
||
1642 | ret |
||
1643 | noIntelP4: |
||
1644 | cmp byte[f], 6 |
||
1645 | jne noIntelP6 |
||
1646 | mov eax, 68 ; Pentium Pro / Pentium II / Pentium III |
||
1647 | mov ebx, 3 |
||
1648 | mov edx, 0x2A |
||
1649 | int 0x40 |
||
1650 | shr eax, 22 |
||
1651 | test al, 0x20 |
||
1652 | jz @f |
||
1653 | or al, 0x10 |
||
1654 | @@: and eax, 0x1f |
||
1655 | mov cl, [coppercoeff + eax] |
||
1656 | cmp byte[m], 0x0B |
||
1657 | jb @f |
||
1658 | mov cl, [tualatcoeff + eax] |
||
1659 | @@: ret |
||
1660 | |||
1661 | noIntel: |
||
1662 | noIntelP6: |
||
1663 | noAMDK7: |
||
1664 | ret>2000>2100MHz)>2000MHz)>> |
||
1665 |