Subversion Repositories Kolibri OS

Rev

Rev 485 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
223 Ghost 1
;******************************************************************************
2
; project name:    CPUID                                                      *
3
; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures                *
450 Ghost 4
; compiler:        flat assembler 1.67.21                                     *
515 heavyiron 5
; version:         2.21                                                        *
6
; last update:     18th May 2007         1st 2nd 3rd 4th 5th 6th 7th 8th 9th  *
223 Ghost 7
; maintained by:   Sergey Kuzmin aka Wildwest                                 *
8
; e-mail:          kuzmin_serg@list.ru                                        *
9
; site:            http://coolthemes.narod.ru/files.html                      *
318 heavyiron 10
; license:         Copyright 2004-2007 Sergey Kuzmin and co-authors           *
223 Ghost 11
;                  Rules:                                                     *
12
;                  1)you can use pieces of code in your project, but should   *
318 heavyiron 13
;                    mention the original author (include copyright notice);  *
223 Ghost 14
;                  2)if you modify CPUID (improve, port, translate, etc) send *
318 heavyiron 15
;                    your changes to the maintainer or make about post changes*
16
;                    at forum  http://meos.sysbin.com                         *
223 Ghost 17
;-----------------------------------------------------------------------------*
18
; English comments                                                            *
19
;------------------------------------------------------------------------------
20
use32
21
  org	 0x0
22
  db	 'MENUET01'
23
  dd	 0x01
24
  dd	 START
25
  dd	 I_END
451 heavyiron 26
  dd U_END+4096
27
  dd U_END+4096
223 Ghost 28
  dd	 0x0
29
  dd	 0x0
30
 
485 heavyiron 31
include '..\..\..\macros.inc' ; useful macroses
32
include 'draw.inc'
33
include 'brand.inc'           ;Brand ID decoding
34
include 'caches.inc'          ;(L1 and L2 cashes decoding for Intel)
35
include 'multipli.inc'        ;(multiplier decoding)
36
include 'features.inc'        ;(features decoding)
223 Ghost 37
 
485 heavyiron 38
include 'gif2img.inc'         ;macros to convert gif to img
223 Ghost 39
 
40
include 'rsatest.inc'
41
include 'variable.inc'
42
 
318 heavyiron 43
 
44
 
223 Ghost 45
START:			;   LET'S GO!!!
46
;------------
47
CYCLES:
48
;    CPU speed
49
    mov eax, 18
50
    mov ebx,5
485 heavyiron 51
    mcall
318 heavyiron 52
    mov [total1],eax  ;in Hz,  example 1600490000
223 Ghost 53
    xor  edx,edx
54
    mov  ebx,1000000
55
    div  ebx
318 heavyiron 56
    mov [total], eax  ; in Mhz,  example 1600
223 Ghost 57
    xor edx, edx
58
    mov eax, [total1]
59
    mov ebx, 10000
60
    div ebx
61
    mov [ost], eax    ; example 160049
62
    mov eax, [total]
63
    imul eax, 100
64
    mov [sot], eax    ;  example 160000
65
    mov eax, [ost]
66
    sub eax, [sot]
67
    mov [sot], eax    ; example 49
68
;------------
69
cpu:		      ;is CPUID supported?
70
  pushfd	      ;push original EFLAGS
71
  pop eax	      ;get original EFLAGS
72
  mov ebx, eax	      ;save original EFLAGS
73
  xor eax, 00200000h  ;flip 21th bit in EFLAGS
74
  push eax	      ;save new EFLAGS value on stack
75
  popfd 	      ;replace current EFLAGS value
76
  pushfd	      ;get new EFLAGS
77
  pop eax	      ;store new EFLAGS in EAX
78
  cmp eax, ebx	      ;compare values of 21th bit
79
  jz NO_CPUID	      ;CPUID isn't supported
80
;------------
81
CPUNAME:	      ; VENDOR
82
    mov   eax,0       ; eax=0
83
    cpuid
84
 
85
    mov [stdc], eax   ; number of calls
86
    mov   [cpuname+ 12],ebx
87
    mov   [cpuname+ 16],edx
88
    mov   [cpuname+ 20],ecx
89
    mov   [smallvendor],ecx
90
 
91
; for various vendors we should later use different methods
92
 
93
;Decoding cache L1 and L2 for Intel
94
 
95
  cmp [smallvendor], 'ntel'
96
  jne cpu1     ;is not Intel
97
  je .detec
98
.detec:
99
 
100
;Starting L1, L2, L3 caches detection (Intel made it VERY HARD)
101
 
102
mov eax, 2
103
cpuid
104
 
105
mov [che], al	     ; number of calls
106
multik:
107
dec [che]
108
 
109
.eaxl:
110
test  eax, $80000000 ;    Test bit 31
318 heavyiron 111
jnz   .ebxl	     ;    <> 0 =>invalid values
223 Ghost 112
shr eax, 8
113
call decodecache
114
shr eax, 8
115
call decodecache
116
shr eax, 8
117
call decodecache
118
.ebxl:
119
test  ebx, $80000000
120
jnz   .ecxl
121
mov eax, ebx
122
call decodecache
123
shr eax, 8
124
call decodecache
125
shr eax, 8
126
call decodecache
127
shr eax, 8
128
call decodecache
129
.ecxl:
130
test  ecx, $80000000
131
jnz   .edxl
132
mov eax, ecx
133
call decodecache
134
shr eax, 8
135
call decodecache
136
shr eax, 8
137
call decodecache
138
shr eax, 8
139
call decodecache
140
.edxl:
141
test  edx, $80000000
142
jnz   cpu1
143
mov eax, edx
144
call decodecache
145
shr eax, 8
146
call decodecache
147
shr eax, 8
148
call decodecache
149
shr eax, 8
150
call decodecache
151
 
152
cmp [che], 0 ; we made all calls
153
je cpu1
154
 
155
multi: ; not yet
156
 
157
mov eax, 2  ; so we made call again
158
cpuid
159
 
160
jmp multik
161
 
162
;  FAMILY MODEL STEPPING
163
cpu1:
164
    xor eax, eax
165
    inc eax	  ; eax=1
166
    cpuid
167
 
168
mov ecx, eax
169
and ecx,00000F00h ;   get CPU family
170
shr ecx,8	  ;   shift it to the correct position
171
mov dword[f],ecx
172
 
173
mov ecx, eax
174
and ecx,000000F0h ;    get CPU model
175
shr ecx,4
176
mov dword[m],ecx
177
 
178
mov ecx, eax
179
and ecx,0000000Fh ;   get CPU stepping
180
mov dword[s],ecx
181
 
182
;-
183
mov ecx, eax	  ; get Type
184
shl ecx, 18
185
shr ecx,30
186
;and ecx, 0000000Fh ; only two lower bits can be nonzero
187
mov dword[t], ecx
188
;=======================================================
189
 
190
cmp dword[smallvendor], 'cAMD'
191
jz maybe_athlon
192
cmp dword[smallvendor], 'ntel'
193
jz detect_it
194
jmp no_full   ; if not AMD or Intel
195
 
196
detect_it:
197
cmp [f], 0Fh
198
jne no_full
199
 
200
full:
201
 
202
mov ecx, eax	      ; get Extended model
203
shr ecx,16	      ;shift it to the correct position
204
and ecx, 0000000Fh
205
shl ecx, 4
206
add ecx, [m]
207
mov dword[em],ecx     ;  effective    model
208
 
209
mov ecx, eax	      ; get Extended family
210
shr ecx, 20	      ;shift it to the correct position
211
and ecx, 000000FFh
212
add ecx, [f]
318 heavyiron 213
mov dword[ef],ecx     ; effective family
223 Ghost 214
 
215
 
216
jmp fut
217
 
218
no_full:
219
 
220
mov ecx, [m]
221
mov [em], ecx
222
 
223
mov ecx, [f]
224
mov [ef], ecx
225
 
226
jmp fut
227
 
228
maybe_athlon:
318 heavyiron 229
mov eax, 0x80000001		  ; CPUID ext. function 0x80000001
223 Ghost 230
cpuid
231
mov ecx, eax
232
and ecx,00000F00h ;   get CPU family
233
shr ecx,8	  ;   shift it to the correct position
234
mov dword[ef],ecx
235
 
236
mov ecx, eax
237
and ecx,000000F0h ;    get CPU model
238
shr ecx,4
239
mov dword[em],ecx
240
 
241
fut:
242
 
243
call decode_sse3
244
;-
245
    call decode_extended
246
 
247
    mov   eax,$80000000
248
    cpuid
249
 
250
    mov   [extc], eax  ; max number of calls
251
 
252
  test	eax, $80000000 ;// Test bit 31
253
  jz .noname
254
 
255
  cmp  eax,$80000003
256
  ja .mynameis
257
  jmp .noname
258
 
259
.mynameis:
260
    mov       eax,$80000002
261
    cpuid
262
    mov   [myname],eax
263
    mov   [myname+4],ebx
264
    mov   [myname+8],ecx
265
    mov   [myname+12],edx
266
    mov   eax,$80000003
267
    cpuid
268
    mov   [myname+16],eax
269
    mov   [myname+20],ebx
270
    mov   [myname+24],ecx
271
    mov   [myname+28],edx
272
    mov   eax,$80000004
273
    cpuid
274
    mov   [myname+32],eax
275
    mov   [myname+36],ebx
276
    mov   [myname+40],ecx
277
    mov   [myname+44],edx
278
    jmp   red
279
 
280
.noname:
281
mov  dword [myname], $612F6E
282
 
283
red:
284
 
285
xor ecx, ecx
286
xor eax, eax
287
xor edx, edx
288
xor ebx, ebx
289
 
290
;mov byte [multiplier], 115;     ; for testing
291
 
292
call multipl			      ; get multiplier
293
mov byte [multiplier], cl
294
 
295
xor eax, eax
296
xor ebx, ebx
297
xor ecx, ecx
298
xor edx, edx
299
 
300
cmp dword[multiplier], 0
301
jz contin
302
 
303
calc:
304
 
305
mov eax,dword [ost]   ; example 166474
306
imul eax, 10	      ; example 1664740
307
mov  ebx, dword [multiplier]   ; get system clock (if multiplier detected)
308
div ebx
309
mov dword [freqbb], eax  ;  16647
310
 
311
xor eax, eax
312
xor ebx, ebx
313
xor ecx, ecx
314
xor edx, edx
315
 
318 heavyiron 316
mov eax,dword [ost]  ;example  166474
223 Ghost 317
mov  ebx,10
318 heavyiron 318
div  ebx	     ;example  16647
223 Ghost 319
 
320
mov dword [temp], eax
321
 
322
xor eax, eax
323
xor ebx, ebx
324
xor ecx, ecx
325
xor edx, edx
326
 
327
mov eax, dword [temp]
328
 
329
mov  ebx, dword [multiplier]
330
div ebx 		       ; example 166
331
 
332
imul eax, 100
333
mov  dword[freqll], eax  ; example 16600
334
 
335
xor eax, eax
336
xor ebx, ebx
337
xor ecx, ecx
338
xor edx, edx
339
 
340
mov eax, dword[freqbb]; example  16647
341
sub eax, dword[freqll];  example   16600
342
mov dword[freqll], eax	  ;example  47
343
 
344
 
345
xor eax, eax
346
xor ebx, ebx
347
xor ecx, ecx
348
xor edx, edx
349
 
350
 
351
mov eax,dword [freqbb]; example 16647
352
mov  ebx, 100
353
div ebx
354
mov dword [freqbb], eax  ; example 166
355
 
356
xor eax, eax
357
xor ebx, ebx
358
xor ecx, ecx
359
xor edx, edx
360
 
361
    mov eax,dword[multiplier]  ; example 115
362
    mov  ebx,10
363
    div  ebx
364
    mov dword[multb], eax  ;   example 11
365
 
366
    imul eax, 10
367
    mov dword[multa], eax    ;  example 110
368
 
369
xor eax, eax
370
xor ebx, ebx
371
xor ecx, ecx
372
xor edx, edx
373
 
374
    mov eax, dword[multiplier]
375
    sub eax, dword[multa]
376
    mov dword[multa], eax    ; example 5
377
 
378
xor eax, eax
379
xor ebx, ebx
380
xor ecx, ecx
381
xor edx, edx
382
 
383
jmp output
384
 
385
contin:
386
 
387
mov   dword [freqbb], 0
388
mov   dword [freqll], 0
389
 
390
output:
391
 
392
   call draw_window    ;     Draw window
393
 
394
typedetect:
395
 
396
cmp [t], 00b
397
jne t2d
451 heavyiron 398
Text 290,250,0x00000000,t1, t1len-t1
223 Ghost 399
jmp PROCCORE
400
t2d:
401
cmp [t], 01b
402
jne t3d
451 heavyiron 403
Text 290,250,0x00000000,t2, t2len-t2
223 Ghost 404
jmp PROCCORE
405
t3d:
406
cmp [t], 11b
407
jne notype
451 heavyiron 408
Text 290,250,0x00000000,t3, t3len-t3
223 Ghost 409
jmp PROCCORE
410
notype:
451 heavyiron 411
Text 290,250,0x00000000,t4, t4len-t4
223 Ghost 412
 
413
PROCCORE:    ;   Who are you?
414
; Intel - "GenuineIntel"           +
415
; AMD - "AuthenticAMD"             +
416
; Cyrix - "CyrixInstead"           +
417
; UMC - "UMC UMC UMC "
418
; NexGen - "NexGenDriven"
419
; Centaur - "CentaurHauls"         +
420
; Rise Technology - "RiseRiseRise"
421
; SiS - "SiS SiS SiS "
422
; Transmeta - "GenuineTMx86"       +
423
; National Semiconductor - "Geode by NSC"
424
 
425
  cmp dword[smallvendor], 'ntel'
426
  jz Intel
427
  cmp dword[smallvendor], 'cAMD'
428
  jz AMD
429
  cmp dword[smallvendor], 'tead'
430
  jz Cyrix
431
  cmp dword[smallvendor], 'auls'
432
  jz Centaur
433
  cmp dword[smallvendor], 'Mx86'
434
  jz Transmeta
435
 
436
; cmp ecx, 'UMC '
437
; jz .UMC
438
; cmp ecx, 'iven'
439
; jz .NexGen
440
; cmp ecx, 'Rise'
441
;  jz .Rise
442
; cmp ecx, 'SiS '
443
; jz .SiS
444
; cmp ecx, ' NSC'
445
; jz .NSC
446
  jmp Other   ;  I don't know what to do with you...
447
Other:
451 heavyiron 448
Text 75,70,0x00000000,other, otherlen-other
223 Ghost 449
    jmp MMXtest
450
;-------------------------
451
 
452
AMD:
453
 
451 heavyiron 454
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 455
 
451 heavyiron 456
Text 75,70,0x00000000,AMDn, AMDnlen-AMDn
223 Ghost 457
 
458
	mov	esi, amd
459
	call	load_gif
515 heavyiron 460
PutImage 135,107,201,49,img_area+8
318 heavyiron 461
;         place   size
223 Ghost 462
 
463
; Relax, man. AMD made PRETTY SIMPLE cache detection routine
464
;CACHE1:
465
mov eax, 80000005h
466
    cpuid
318 heavyiron 467
 
468
mov eax, ecx
469
;shl eax, 24
470
;shr eax, 24
471
 
472
and eax,000000FFh ;
473
mov [lineld], eax
474
 
475
mov eax, ecx
476
;shl eax, 8
477
;shr eax, 24
478
 
479
and eax,00FF0000h
480
shr eax, 16
481
mov [wayld], eax
482
 
223 Ghost 483
shr ecx, 24
484
mov [L1d], ecx
318 heavyiron 485
 
486
 
487
mov eax, edx
488
;shl eax, 24
489
;shr eax, 24
490
 
491
and eax,000000FFh ;
492
mov [lineli], eax
493
 
494
mov eax, edx
495
;shl eax, 8
496
;shr eax, 24
497
 
498
and eax,00FF0000h
499
shr eax, 16
500
mov [wayli], eax
501
 
502
 
223 Ghost 503
shr edx, 24
504
mov [L1i], edx
318 heavyiron 505
 
506
 
223 Ghost 507
;CACHE2:
508
mov eax, 80000006h
509
    cpuid
318 heavyiron 510
 
511
mov eax, ecx
512
;and eax,000000FFh ;
513
shl eax, 24
514
shr eax, 24
515
mov dword[linel2], eax
516
 
517
mov eax, ecx
518
shl eax, 16
519
shr eax, 28
520
 
521
cmp eax, 0010b
522
je way2
523
 
524
cmp eax, 0100b
525
je way4
526
 
527
cmp eax, 0110b
528
je way8
529
 
530
cmp eax, 1000b
531
je way16
532
 
533
jmp to_next
534
 
535
way2:
536
mov dword[wayl2], 2
537
jmp to_next
538
 
539
way4:
540
mov dword[wayl2], 4
541
jmp to_next
542
 
543
way8:
544
mov dword[wayl2], 8
545
jmp to_next
546
 
547
way16:
548
mov dword[wayl2], 16
549
jmp to_next
550
 
551
 
552
to_next:
553
 
223 Ghost 554
shr ecx, 16
555
mov [L2],ecx
318 heavyiron 556
 
223 Ghost 557
    cmp [f], $5
558
    jz .fiv
559
    cmp [f], $6
560
    jz .si
561
    cmp [f], $F
562
    jz fif
563
.fiv:	 ;     Family=5
564
    cmp [m],$0
565
    jz .A50
566
    cmp [m],$1
567
    jz .A51
568
    cmp [m],$2
569
    jz .A52
570
    cmp [m],$3
571
    jz .A53
572
    cmp [m],$6
573
    jz .A56
574
    cmp [m],$7
575
    jz .A57
576
    cmp [m],$8
577
    jz .A58
578
    cmp [m],$9
579
    jz .A59
580
    cmp [m],$D
581
    jz .A5D
582
.A50:
583
    mov [micron], 50   ; 0.35?
451 heavyiron 584
Text 100,70,0x00000000,A50, A50len-A50
223 Ghost 585
    jmp MMXtest
586
.A51:
587
    mov [micron], 35
451 heavyiron 588
Text 100,70,0x00000000,A51, A51len-A51
223 Ghost 589
    jmp MMXtest
590
.A52:
591
    mov [micron], 35
451 heavyiron 592
Text 100,70,0x00000000,A52, A52len-A52
223 Ghost 593
    jmp MMXtest
594
.A53:
595
    mov [micron], 35
451 heavyiron 596
Text 100,70,0x00000000,A53, A53len-A53
223 Ghost 597
    jmp MMXtest
598
.A56:
599
    mov [micron], 30
451 heavyiron 600
Text 100,70,0x00000000,A56, A56len-A56
223 Ghost 601
    jmp MMXtest
602
.A57:
603
    mov [micron], 25
451 heavyiron 604
Text 100,70,0x00000000,A57, A57len-A57
223 Ghost 605
    jmp MMXtest
606
.A58:
607
    mov [micron], 25
451 heavyiron 608
Text 100,70,0x00000000,A58, A58len-A58
223 Ghost 609
    jmp MMXtest
610
.A59:
611
    mov [micron], 25
451 heavyiron 612
Text 100,70,0x00000000,A59, A59len-A59
223 Ghost 613
    jmp MMXtest
614
.A5D:
615
    mov [micron], 18
451 heavyiron 616
Text 100,70,0x00000000,A5D, A5Dlen-A5D
223 Ghost 617
    jmp MMXtest
618
.si:   ;    Family=6
619
 
620
    cmp [m],$1
621
    jz A1
622
    cmp [m],$2
623
    jz A2
624
    cmp [m],$3
625
    jz A3
626
    cmp [m],$4
627
    jz A4
628
    cmp [m],$6
629
    jz A6
630
    cmp [m],$7
631
    jz A7
632
    cmp [m],$8
633
    jz A8
634
    cmp [m],$A
635
    jz AA
636
A1:
637
    mov [micron], 25
451 heavyiron 638
Text 100,70,0x00000000,At1, At1len-At1
223 Ghost 639
 jmp MMXtest
640
A2:
641
    mov [micron], 18
451 heavyiron 642
Text 100,70,0x00000000,At2, At2len-At2
223 Ghost 643
 jmp MMXtest
644
A3:
645
    mov [micron], 18
451 heavyiron 646
 Text 100,70,0x00000000,At3, At3len-At3
223 Ghost 647
 jmp MMXtest
648
A4:
649
    mov [micron], 18
451 heavyiron 650
Text 100,70,0x00000000,At4, At4len-At4
223 Ghost 651
 jmp MMXtest
652
A6:
653
 
654
 mov [micron], 18
451 heavyiron 655
 Text 100,70,0x00000000,At6, At6len-At6
223 Ghost 656
 
657
 mov [FRS], 266  ;!!!!!!
658
 
451 heavyiron 659
Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 660
 
661
 call newrating; !!!!
662
 
451 heavyiron 663
Text 245,70,0x00000000,pr, prlen-pr
223 Ghost 664
 
451 heavyiron 665
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 666
 jmp MMXtest
667
A7:
668
    mov [micron], 13
451 heavyiron 669
Text 100,70,0x00000000,At7, At7len-At7
223 Ghost 670
 jmp MMXtest
671
 
672
A8:
673
 
674
 mov [micron], 13
675
mov [FRS], 266	;!!!!!!
676
 
451 heavyiron 677
   Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 678
 
679
 
680
 cmp [L2], 256
681
 jl .App  ; Applebred
451 heavyiron 682
Text 100,70,0x00000000,At8, At8len-At8
223 Ghost 683
 
684
 
685
call newrating;!!!!
686
 
451 heavyiron 687
Text 245,70,0x00000000,pr, prlen-pr
688
Number 310,70,0,4,dword [rating],0x000000
223 Ghost 689
jmp MMXtest
690
 
691
 .App:
451 heavyiron 692
Text 100,70,0x00000000,At8a, At8alen-At8a
223 Ghost 693
jmp MMXtest
694
 
695
AA:
696
 
697
 mov [micron], 13
698
 
699
mov [FRS], 333; !!!!
451 heavyiron 700
Text 245,70,0x00000000,pr, prlen-pr
223 Ghost 701
 
451 heavyiron 702
   Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 703
 
704
 cmp [L2], 256
705
 jl .Tho ; Thorton
706
 
707
call newrating;!!!!!
451 heavyiron 708
Text 100,70,0x00000000,Ata, Atalen-Ata
223 Ghost 709
 
451 heavyiron 710
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 711
 
712
jmp MMXtest
713
 .Tho:
714
call newrating;!!!!!
451 heavyiron 715
Text 100,70,0x00000000,Atat, Atatlen-Atat
716
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 717
 jmp MMXtest
718
fif:  ;  AMD-64    Family=15
719
 
720
;here is a need to rewrite detection of AMD F-th family according to "Revision Guide for
721
;AMD AthlonTM 64 and  AMD OpteronTM  Processors" 25759.pdf
722
 
723
; checking sse3 for new AMD's is needed
724
    cmp [m],$1	; Dual-core Opteron
725
    jz .AF1
318 heavyiron 726
    cmp [m],$3	; Toledo 1024 0.09   // Manchester     ||Windsor Dual Core not supported
223 Ghost 727
    jz .AF3
728
    cmp [m],$4	;Athlon 64 Mobile Athlon 64 FX  ClawHammer (1024) 0.13
729
    jz .AF4
730
    cmp [m],$5	; Opteron     Athlon 64 FX 0.13 (1024)
731
    jz .AF5
318 heavyiron 732
    cmp [m],$7	;Athlon 64 Athlon 64 FX  Clawhammer(1024) 0.13   Sledgehammer(1024)  0.13  // SSE3+ SanDiego(1024)
223 Ghost 733
    jz .AF7
734
   cmp [m],$8 ; Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13
735
    jz .AF8
736
   cmp [m],$B ; Athlon 64
737
    jz .AFB
738
   cmp [m],$C ;Athlon 64 Newcastle(512) 0.13  Sempron> Paris (256)   0.13  |SSE3+ Sempron >  Palermo FC0 0.09  // (Venice)
739
    jz .AFC
740
   cmp [m],$E  ; Athlon 64    //
741
    jz .AFE
515 heavyiron 742
   cmp [m],$F ; Athlon 64 Winchester(512) |SSE3+ SanDiego(1024)  Venice (512)  Palermo (256) 0.09
223 Ghost 743
    jz .AFF
744
    jmp next_generation
745
.AF1:
746
    mov [micron], 09  ;?
515 heavyiron 747
    Text 100,70,0x00000000,AF1, AF1len-AF1
748
    jmp MMXtest
223 Ghost 749
.AF3:
750
    mov [micron], 09
515 heavyiron 751
    Text 100,70,0x00000000,AF3, AF3len-AF3
752
    jmp MMXtest
223 Ghost 753
.AF4:
754
    mov [micron], 13
515 heavyiron 755
    Text 100,70,0x00000000,AF4, AF4len-AF4
756
    jmp MMXtest
223 Ghost 757
.AF5:
758
    mov [micron], 13
515 heavyiron 759
    Text 100,70,0x00000000,AF5, AF5len-AF5
760
    jmp MMXtest
223 Ghost 761
.AF7:
762
    mov [micron], 13
515 heavyiron 763
    Text 100,70,0x00000000,AF5, AF5len-AF5
764
    jmp MMXtest
223 Ghost 765
.AF8:
515 heavyiron 766
   mov [micron], 13
767
   Text 100,70,0x00000000,AF4, AF4len-AF4  ; AF4, AF5len-AF4
768
   jmp MMXtest
223 Ghost 769
.AFB:
770
    mov [micron], 13
451 heavyiron 771
Text 100,70,0x00000000,AF4, AF4len-AF4
223 Ghost 772
 jmp MMXtest
773
 
774
.AFC:
775
cmp [L2], 512
776
je .AFCn
777
 
778
cmp [sse3sup], 1
779
je .AFCnpal
780
 
781
.AFCnpar:  ; paris
782
    mov [micron], 13
515 heavyiron 783
    Text 100,70,0x00000000,AFCs, AFCslen-AFCs
784
    jmp MMXtest
223 Ghost 785
 
786
.AFCnpal: ; palermo
787
    mov [micron], 9
515 heavyiron 788
    Text 100,70,0x00000000,AFCsp, AFCsplen-AFCsp
789
    jmp MMXtest
223 Ghost 790
 
791
.AFCn: ;newcastle
792
    mov [micron], 13
515 heavyiron 793
    Text 100,70,0x00000000,AFC, AFClen-AFC
794
    jmp MMXtest
223 Ghost 795
 
515 heavyiron 796
.AFE:	; error in cpu
223 Ghost 797
 jmp .AFC
798
 
799
.AFF:
800
 
801
cmp [sse3sup], 1
802
je .AFFsse
803
 
804
.win:
805
mov [micron], 9    ; winchester
806
jmp MMXtest
807
 
808
.AFFsse:
318 heavyiron 809
mov [micron], 9
223 Ghost 810
cmp [L2], 1024
811
jz .AFs
812
cmp [L2], 512
813
jz .AFd
814
cmp [L2], 256
815
jz .AFp
816
 
817
.AFs:
451 heavyiron 818
Text 100,70,0x00000000,AFS, AFSlen-AFS
223 Ghost 819
 jmp MMXtest
820
 
821
.AFd:
451 heavyiron 822
Text 100,70,0x00000000,AFV, AFVlen-AFV
223 Ghost 823
 jmp MMXtest
824
 
825
.AFp:
451 heavyiron 826
Text 100,70,0x00000000,AFCsp, AFCsplen-AFCsp
223 Ghost 827
 jmp MMXtest
828
;-----------------------------------------------
829
Intel:
451 heavyiron 830
Text 75,70,0x00000000,Inteln, Intelnlen-Inteln
223 Ghost 831
 
832
	mov	esi, intel
833
	call	load_gif
515 heavyiron 834
PutImage 135,107,201,49,img_area+8
835
;PutImage 125,107,201,49,img_area+8
318 heavyiron 836
;         place   size
223 Ghost 837
 
838
det:
839
    cmp [f], $5
840
    jz .five
841
    cmp [f], $6
842
    jz .six
843
    cmp [f], $7
844
    jz .sev
845
    cmp [f], $F
846
    jz .fift
847
.five:	      ;Family=5
848
 
451 heavyiron 849
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 850
 
851
    cmp [m],$0
852
    jz .I0
853
    cmp [m],$1
854
    jz .I1
855
    cmp [m],$2
856
    jz .I2
857
    cmp [m],$3
858
    jz .I3
859
    cmp [m],$4
860
    jz .I4
861
    cmp [m],$7
862
    jz .I7
863
    cmp [m],$8
864
    jz .I8
865
.I0:
451 heavyiron 866
Text 110,70,0x00000000,P50, P50len-P50
223 Ghost 867
   mov [L1d], 8
868
   mov [L1i], 8
869
   mov [L2], 256
870
   mov [micron], 80
871
 jmp MMXtest
872
.I1:
451 heavyiron 873
Text 110,70,0x00000000,P5, P5len-P5
223 Ghost 874
   mov [L1d], 8
875
   mov [L1i], 8
876
   mov [L2], 256
877
   mov [micron], 50
878
 jmp MMXtest
879
.I2:
451 heavyiron 880
Text 110,70,0x00000000,P54C, P54Clen-P54C
223 Ghost 881
   mov [L1d], 8
882
   mov [L1i], 8
883
   mov [L2], 256
884
   mov [micron], 50
885
 jmp MMXtest
886
.I3:
451 heavyiron 887
Text 110,70,0x00000000,P54T, P54Tlen-P54T
223 Ghost 888
   mov [L1d], 8
889
   mov [L1i], 8
890
   mov [L2], 256
891
   mov [micron], 50
892
 jmp MMXtest
893
.I4:
451 heavyiron 894
Text 110,70,0x00000000,P55C, P55Clen-P55C
223 Ghost 895
   mov [L1d], 8
896
   mov [L1i], 8
897
   mov [L2], 256
898
   mov [micron], 35
899
 jmp MMXtest
900
.I7:
451 heavyiron 901
Text 110,70,0x00000000,P54C, P54Clen-P54C
223 Ghost 902
   mov [L1d], 8
903
   mov [L1i], 8
904
   mov [L2], 256
905
   mov [micron], 35
906
 jmp MMXtest
907
.I8:
451 heavyiron 908
Text 110,70,0x00000000,P55C, P55Clen-P55C
223 Ghost 909
   mov [L1d], 16
910
   mov [L1i], 16
911
   mov [L2], 256
912
   mov [micron], 35
913
 jmp MMXtest
914
.six:		   ;Family=6
915
 
451 heavyiron 916
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 917
 
918
    cmp [m],$0
919
    jz .I60
920
    cmp [m],$1
921
    jz .I61
922
    cmp [m],$3
923
    jz .I63
924
    cmp [m],$5
925
    jz .I65
926
    cmp [m],$6
927
    jz .I66
928
    cmp [m],$7
929
    jz .I67
930
    cmp [m],$8
931
    jz .I68
932
    cmp [m],$9
933
    jz .I69
934
    cmp [m],$A
935
    jz .I6A
936
    cmp [m],$B
937
    jz .I6B
938
   cmp [m],$D
939
    jz .I6D
940
    cmp [m],$E
941
    jz .I6E
942
   cmp [m],$F
943
    jz .I6F
944
.I60:
945
    mov [micron], 50
451 heavyiron 946
Text 110,70,0x00000000,P60, P60len-P60
223 Ghost 947
 jmp MMXtest
948
.I61:
949
    mov [micron], 35
451 heavyiron 950
Text 110,70,0x00000000,P61, P61len-P61
223 Ghost 951
 jmp MMXtest
952
.I63:
953
    mov [micron], 28
451 heavyiron 954
Text 110,70,0x00000000,P63, P63len-P63
223 Ghost 955
 jmp MMXtest
956
.I65:
957
    mov [micron], 25
958
    cmp [L2], 0
959
    jne .pp65  ; Pentium
451 heavyiron 960
Text 110,70,0x00000000,P65c, P65clen-P65c
223 Ghost 961
    jmp MMXtest
962
.pp65:
451 heavyiron 963
Text 110,70,0x00000000,P65, P65len-P65
223 Ghost 964
    jmp MMXtest
965
.I66:
966
    mov [micron], 25
451 heavyiron 967
Text 110,70,0x00000000,P66, P66len-P66
223 Ghost 968
    jmp MMXtest
969
.I67:
970
    mov [micron], 25
451 heavyiron 971
Text 110,70,0x00000000,P67, P67len-P67
223 Ghost 972
    jmp MMXtest
973
.I68:
974
    mov [micron], 18
975
    cmp [L2], 128
976
    jne .pp68  ; Pentium
451 heavyiron 977
Text 110,70,0x00000000,P68c, P68clen-P68c
223 Ghost 978
    jmp MMXtest
979
 .pp68:
451 heavyiron 980
Text 110,70,0x00000000,P68, P68len-P68
223 Ghost 981
    jmp MMXtest
982
.I69:
983
    mov [micron], 13
451 heavyiron 984
Text 110,70,0x00000000,P69 , P69len-P69
223 Ghost 985
    jmp MMXtest
986
.I6A:
987
    mov [micron], 18
451 heavyiron 988
Text 110,70,0x00000000,P6A, P6Alen-P6A
223 Ghost 989
    jmp MMXtest
990
.I6B:
991
    mov [micron], 13
992
    cmp [L2], 256
993
    jne .pp6B  ; Pentium
451 heavyiron 994
Text 110,70,0x00000000,P6Bc, P6Bclen-P6Bc
223 Ghost 995
    jmp MMXtest
996
.pp6B:
451 heavyiron 997
Text 110,70,0x00000000,P6B, P6Blen-P6B
223 Ghost 998
    jmp MMXtest
999
.I6D:
1000
    mov [micron], 9
451 heavyiron 1001
Text 110,70,0x00000000,P6D, P6Dlen-P6D
223 Ghost 1002
    jmp MMXtest
1003
.I6E:
1004
    mov [micron], 6
451 heavyiron 1005
Text 110,70,0x00000000,P6E, P6Elen-P6E
223 Ghost 1006
    jmp MMXtest
1007
.I6F:
1008
    mov [micron], 6
451 heavyiron 1009
Text 110,70,0x00000000,P6F, P6Flen-P6F
223 Ghost 1010
    jmp MMXtest
1011
 
1012
;06Ex - Pentium M Yonah 0.065
318 heavyiron 1013
;06Fx - Pentium D Conroe 0.065, Xeon Woodcrest, Celeron D AllenDale, Core 2 Kentsfield
223 Ghost 1014
 
1015
.sev:	 ;Family=7
1016
.IS0:
1017
 
451 heavyiron 1018
Text 15, 190,0x00000000,cache, cachelen-cache ;?
223 Ghost 1019
 
1020
    mov [micron], 18
451 heavyiron 1021
Text 110,70,0x00000000,PS0, PS0len-PS0
223 Ghost 1022
 jmp MMXtest
1023
 
1024
.fift:	  ;Family=15
1025
 
451 heavyiron 1026
Text 15, 190,0x00000000,cacheP4, cacheP4len-cacheP4
223 Ghost 1027
 
1028
    cmp [m],$0
1029
    jz .IF0
1030
    cmp [m],$1
1031
    jz .IF1
1032
    cmp [m],$2
1033
    jz .IF2
1034
    cmp [m],$3
1035
    jz .IF3
1036
    cmp [m],$4
1037
    jz .IF3 ;identical to F3xh
1038
    cmp [m],$5
1039
    jz .IF5
1040
    cmp [m],$6
1041
    jz .IF6
1042
    jmp next_generation
1043
.IF0:
1044
    mov [micron], 18
1045
    cmp [L2], 128
1046
    jne .ppF0  ; Pentium
451 heavyiron 1047
Text 110,70,0x00000000,PF0c, PF0clen-PF0c
223 Ghost 1048
    jmp MMXtest
1049
.ppF0:
451 heavyiron 1050
Text 110,70,0x00000000,PF0, PF0len-PF0
223 Ghost 1051
    jmp MMXtest
1052
.IF1:
1053
    mov [micron], 18
1054
    cmp [L2], 128
1055
    je .IF0;jne.ppF1  ; Pentium
1056
  ;  mov   eax,dword 0x00000004
1057
  ;  mov   ebx,115*65536+80
1058
  ;  mov   ecx,dword 0x00000000
1059
  ;  mov   edx,PF0c
1060
  ;  mov   esi,PF0clen-PF0c
485 heavyiron 1061
  ;  mcall
223 Ghost 1062
  ;jmp MMXtest
1063
;.ppF1:
451 heavyiron 1064
Text 110,70,0x00000000,PF0, PF0len-PF0
223 Ghost 1065
 jmp MMXtest
1066
.IF2:
1067
    mov [micron], 13
1068
    cmp [L2], 128
1069
    jne .ppF2  ; Pentium
451 heavyiron 1070
Text 110,70,0x00000000,PF2c, PF2clen-PF2c
223 Ghost 1071
 jmp MMXtest
1072
.ppF2:
451 heavyiron 1073
Text 110,70,0x00000000,PF2, PF2len-PF2
223 Ghost 1074
 jmp MMXtest
1075
.IF3:
1076
    mov [micron], 09
1077
    cmp [L2], 256
1078
    jne .ppF3  ; Pentium
451 heavyiron 1079
Text 110,70,0x00000000,PF3c, PF3clen-PF3c
223 Ghost 1080
 jmp MMXtest
1081
.ppF3:
451 heavyiron 1082
Text 110,70,0x00000000,PF3, PF3len-PF3
223 Ghost 1083
 jmp MMXtest
1084
 
1085
.IF5:
1086
    mov [micron], 09
1087
    cmp [L2], 512
1088
    jae .ppF5  ; Pentium
451 heavyiron 1089
Text 110,70,0x00000000,PF5c, PF5clen-PF5c
223 Ghost 1090
 jmp MMXtest
1091
.ppF5:
451 heavyiron 1092
Text 110,70,0x00000000,PF5, PF5len-PF5
223 Ghost 1093
 jmp MMXtest
1094
 
1095
 .IF6:
1096
    mov [micron], 06  ; 065
1097
    cmp [L2], 512
1098
    ja .ppF6  ; Pentium
451 heavyiron 1099
Text 110,70,0x00000000,PF6c, PF6clen-PF6c
223 Ghost 1100
 jmp MMXtest
1101
.ppF6:
451 heavyiron 1102
Text 110,70,0x00000000,PF6, PF6len-PF6
223 Ghost 1103
 jmp MMXtest
1104
 
1105
 
1106
 next_generation:
451 heavyiron 1107
Text 110,70,0x00000000,NG, NGlen-NG
223 Ghost 1108
  jmp MMXtest
1109
;----------------------------------
1110
Cyrix:
1111
 
451 heavyiron 1112
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 1113
 
1114
	mov	esi, cyrix
1115
	call	load_gif
515 heavyiron 1116
PutImage 135,107,201,49,img_area+8
1117
;PutImage 130,127,201,49,img_area+8
318 heavyiron 1118
;         place   size
223 Ghost 1119
 
1120
    cmp [f], $5
1121
    jz .fivv
1122
    cmp [f], $6
1123
    jz .sixx
1124
.fivv:	  ;Family=5
1125
    cmp [m],$2
1126
    jz .C52
1127
    cmp [m],$4
1128
    jz .C54
1129
.C52:
1130
    mov [micron], 50 ;35?
1131
    mov [L1i], 8
1132
    mov [L1d], 8
1133
    mov [L2], 512
451 heavyiron 1134
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn
1135
Text 110,70,0x00000000,C52, C52len-C52
223 Ghost 1136
    jmp MMXtest
1137
.C54:
1138
    mov [micron], 50
1139
    mov [L1i], 8
1140
    mov [L1d], 8
1141
    mov [L2], 512
451 heavyiron 1142
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn
1143
Text 110,70,0x00000000,C54, C54len-C54
223 Ghost 1144
    jmp MMXtest
1145
 
1146
.sixx:	   ;Family=6
1147
   cmp [m],$0
1148
   jz .C60
1149
   cmp [m],$5
1150
   jz .C65
1151
.C60:
1152
    mov [micron], 25
1153
    mov [L1i], 32
1154
    mov [L1d], 32
1155
    mov [L2], 512
451 heavyiron 1156
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn
1157
Text 110,70,0x00000000,C60, C60len-C60
223 Ghost 1158
    jmp MMXtest
1159
.C65:
1160
    mov [micron], 25 ;35?
1161
    mov [L1i], 32
1162
    mov [L1d], 32
1163
    mov [L2], 512
451 heavyiron 1164
Text 75,70,0x00000000,Centaurn, Centaurnlen-Centaurn
1165
Text 100,70,0x00000000,C65, C65len-C65
223 Ghost 1166
    jmp MMXtest
1167
;---------------------
1168
Centaur:
1169
 
451 heavyiron 1170
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 1171
 
1172
;CACHE1:
1173
mov eax, 80000005h
1174
    cpuid
1175
shr ecx, 24
1176
mov [L1d], ecx
1177
shr edx, 24
1178
mov [L1i], edx
318 heavyiron 1179
 
1180
 
1181
 
1182
; cache detection routine
1183
;CACHE1:
1184
mov eax, 80000005h
1185
    cpuid
1186
 
1187
mov eax, ecx
1188
 
1189
and eax,000000FFh ;
1190
mov [lineld], eax
1191
 
1192
mov eax, ecx
1193
 
1194
and eax,00FF0000h
1195
shr eax, 16
1196
mov [wayld], eax
1197
 
1198
shr ecx, 24
1199
mov [L1d], ecx
1200
 
1201
mov eax, edx
1202
 
1203
and eax,000000FFh ;
1204
mov [lineli], eax
1205
 
1206
mov eax, edx
1207
 
1208
and eax,00FF0000h
1209
shr eax, 16
1210
mov [wayli], eax
1211
 
1212
shr edx, 24
1213
mov [L1i], edx
1214
 
1215
 
223 Ghost 1216
;CACHE2:
1217
mov eax, 80000006h
1218
    cpuid
318 heavyiron 1219
 
1220
cmp [f], $6
1221
    jz vn
1222
    jmp vl2old	; if not then old identification
1223
vn:
1224
    cmp [m],$9
1225
    jl vl2old
1226
; else  new
1227
mov eax, ecx
1228
shl eax, 24
1229
shr eax, 24
1230
mov dword[linel2], eax
1231
 
1232
mov eax, ecx
1233
shl eax, 16
1234
shr eax, 28
1235
 
1236
mov dword[wayl2], eax
1237
 
1238
shr ecx, 16  ; it is 16 bits now
223 Ghost 1239
mov [L2],ecx
1240
 
318 heavyiron 1241
 
1242
 
1243
vl2old:
1244
mov eax, ecx
1245
shl eax, 24
1246
shr eax, 24
1247
mov dword[linel2], eax
1248
 
1249
mov eax, ecx
1250
shl eax, 8
1251
shr eax, 24
1252
 
1253
mov dword[wayl2], eax
1254
 
1255
shr ecx, 24  ; it was 8 bits earlier
1256
mov [L2],ecx
1257
 
1258
 
223 Ghost 1259
    cmp [f], $5
1260
    jz fivC
1261
    cmp [f], $6
1262
    jz sixC
1263
 
1264
fivC:		   ;Family=5
1265
 
1266
	mov	esi, idt
1267
	call	load_gif
515 heavyiron 1268
PutImage 135,107,201,49,img_area+8
1269
;PutImage 125,107,201,49,img_area+8
318 heavyiron 1270
;         place   size
223 Ghost 1271
 
451 heavyiron 1272
Text 75,70,0x00000000,IDTn, IDTnlen-IDTn
223 Ghost 1273
    cmp [m],$4
1274
    jz .V54
1275
    cmp [m],$8
1276
    jz .V58
1277
    cmp [m],$9
1278
    jz .V59
1279
.V54:
1280
   mov [micron], 35
451 heavyiron 1281
Text 100,70,0x00000000,V54, V54len-V54
223 Ghost 1282
    jmp MMXtest
1283
.V58:
1284
    mov [micron], 25
451 heavyiron 1285
Text 100,70,0x00000000,V58, V58len-V58
223 Ghost 1286
    jmp MMXtest
1287
.V59:
1288
    mov [micron], 25
451 heavyiron 1289
Text 100,70,0x00000000,V59, V59len-V59
223 Ghost 1290
    jmp MMXtest
1291
 
1292
sixC:	;Family=6
1293
 
1294
	mov	esi, via
1295
	call	load_gif
515 heavyiron 1296
PutImage 135,107,201,49,img_area+8
1297
;PutImage 125,107,201,49,img_area+8
318 heavyiron 1298
;         place   size
223 Ghost 1299
 
451 heavyiron 1300
Text 75,70,0x00000000,Centaurn, Centaurnlen-Centaurn
223 Ghost 1301
    cmp [m],$6
1302
    jz .V66
1303
    cmp [m],$7
1304
    jz .V67
1305
    cmp [m],$8
1306
    jz .V68
1307
    cmp [m],$9
1308
    jz .V69
318 heavyiron 1309
    cmp [m],$A
223 Ghost 1310
    jz .V6A
1311
.V66:
1312
   mov [micron], 18 ; 25?
451 heavyiron 1313
Text 100,70,0x00000000,V66, V66len-V66
223 Ghost 1314
    jmp MMXtest
1315
.V67:
1316
    mov [micron], 15
451 heavyiron 1317
Text 100,70,0x00000000,V67, V67len-V67
223 Ghost 1318
    jmp MMXtest
1319
.V68:
1320
    mov [micron], 13
451 heavyiron 1321
Text 100,70,0x00000000,V68, V68len-V68
223 Ghost 1322
    jmp MMXtest
1323
.V69:
1324
   mov [micron], 13
451 heavyiron 1325
Text 100,70,0x00000000,V69, V69len-V69
223 Ghost 1326
    jmp MMXtest
1327
.V6A:
1328
   mov [micron], 9
451 heavyiron 1329
Text 100,70,0x00000000,VA, VAlen-VA
223 Ghost 1330
    jmp MMXtest
1331
;-----------
1332
Transmeta:
1333
 
451 heavyiron 1334
Text 15, 190,0x00000000,cache, cachelen-cache
223 Ghost 1335
 
451 heavyiron 1336
Text 75,70,0x00000000,Tranmsmetan, Tranmsmetanlen-Tranmsmetan
223 Ghost 1337
 
1338
	mov	esi, transmeta
1339
	call	load_gif
515 heavyiron 1340
PutImage 135,107,201,49,img_area+8
1341
;PutImage 125,107,201,49,img_area+8
318 heavyiron 1342
;         place   size
223 Ghost 1343
 
318 heavyiron 1344
; cache detection routine - it is the same as for AMD (almost)
223 Ghost 1345
;CACHE1:
1346
mov eax, 80000005h
1347
    cpuid
318 heavyiron 1348
 
1349
mov eax, ecx
1350
 
1351
and eax,000000FFh ;
1352
mov [lineld], eax
1353
 
1354
mov eax, ecx
1355
 
1356
and eax,00FF0000h
1357
shr eax, 16
1358
mov [wayld], eax
1359
 
223 Ghost 1360
shr ecx, 24
1361
mov [L1d], ecx
318 heavyiron 1362
 
1363
mov eax, edx
1364
 
1365
and eax,000000FFh ;
1366
mov [lineli], eax
1367
 
1368
mov eax, edx
1369
 
1370
and eax,00FF0000h
1371
shr eax, 16
1372
mov [wayli], eax
1373
 
223 Ghost 1374
shr edx, 24
1375
mov [L1i], edx
318 heavyiron 1376
 
1377
 
223 Ghost 1378
;CACHE2:
1379
mov eax, 80000006h
1380
    cpuid
318 heavyiron 1381
 
1382
mov eax, ecx
1383
shl eax, 24
1384
shr eax, 24
1385
mov dword[linel2], eax
1386
 
1387
mov eax, ecx
1388
shl eax, 16
1389
shr eax, 28
1390
 
1391
mov dword[wayl2], eax
1392
 
223 Ghost 1393
shr ecx, 16
318 heavyiron 1394
mov [L2],ecx
223 Ghost 1395
 
318 heavyiron 1396
 
223 Ghost 1397
    cmp [f], $5
1398
    jz .fivt
1399
    cmp [f], $F
1400
    jz .fift
1401
.fivt:	  ;     Family=5
1402
 
1403
    mov [micron], 13 ; ?
451 heavyiron 1404
Text 140,70,0x00000000,T5, T5len-T5
223 Ghost 1405
    jmp MMXtest
1406
 
1407
.fift:	  ;     Family=F
1408
    mov [micron], 13 ;
451 heavyiron 1409
Text 140,70,0x00000000,TF, TFlen-TF
223 Ghost 1410
    jmp MMXtest
1411
 
1412
;----
1413
MMXtest:	     ; MMX test and Brand ID decoding
1414
 
1415
call decodebrand  ; get Brand ID
1416
 
1417
call decode_standard_features
1418
 
1419
call decode_extended_features
1420
      xor eax,eax
1421
      inc eax
1422
      cpuid
1423
HTTtest:
1424
  test	edx, $10000000; ;Test bit 28
1425
  jnz	.EL   ;HTT technology is supported
1426
  jz .ELN
1427
 
1428
.EL:
1429
   and ebx,00FF0000h ; numbers of logical processors
1430
   shr ebx,16 ;        shift it to the correct position
1431
   cmp ebx, 1
318 heavyiron 1432
   ;   mov [number_of_log_cpus], ebx
223 Ghost 1433
   je .ELN  ; HHT not enabled (Celeron)
1434
 
1435
   mov	dword [HTTn+9], $736579
1436
   mov	dword [HTT+ 6], $736579
1437
   jmp TEXTOUT
1438
.ELN:
1439
 
1440
   mov	dword [HTTn+ 9],  $6F6E
1441
   mov	dword [HTT+ 6],  $6F6E
1442
   jmp	TEXTOUT
1443
 
1444
TEXTOUT:
1445
 
451 heavyiron 1446
Text 15,110,0x00000000,fam, famlen-fam
1447
Text 15,130,0x00000000,mode, modelen-mode
1448
Text 15,150,0x00000000,step, steplen-step
223 Ghost 1449
;--------L1  L2
451 heavyiron 1450
Number 75,170,0,3,dword [L1d],0x000000;
1451
Number 75,190,0,3,dword [L1i],0x000000;
1452
Number 41,210,0,4,dword[L2],0x000000;
1453
Number 35,230,0,5,dword[L3],0x000000;
223 Ghost 1454
;-----------Features
451 heavyiron 1455
Number 258,50,0,2,dword [micron],0x000000  ; micron
223 Ghost 1456
 
451 heavyiron 1457
Text 275,290,0x00000000,HTT, HTTlen-HTT
1458
Text 275,310,0x00000000,sse3, sse3len-sse3
223 Ghost 1459
 
451 heavyiron 1460
Text 15,70,0x00000000,name, namelen-name
223 Ghost 1461
 
451 heavyiron 1462
Text 15,290,0x00000000,MMXs, MMXslen-MMXs
1463
Text 15,310,0x00000000,SSE, SSElen-SSE
1464
Text 95,310,0x00000000,SSE2, SSE2len-SSE2
223 Ghost 1465
 
451 heavyiron 1466
    Number 140,170,0,2,dword [wayld],0x000000
1467
    Number 218,170,0,2,dword [lineld],0x000000
318 heavyiron 1468
 
451 heavyiron 1469
    Number 140,190,0,2,dword [wayli],0x000000
1470
    Number 218,190,0,2,dword [lineli],0x000000
318 heavyiron 1471
 
451 heavyiron 1472
    Number 140,210,0,2,dword [wayl2],0x000000
1473
    Number 218,210,0,2,dword [linel2],0x000000
318 heavyiron 1474
 
451 heavyiron 1475
    Number 140,230,0,2,dword [wayl3],0x000000
1476
    Number 218,230,0,2,dword [linel3],0x000000
318 heavyiron 1477
 
223 Ghost 1478
    jmp TEST3DNOW
1479
;-------------------
1480
TEST3DNOW:
1481
 
1482
  cmp [smallvendor], 'ntel'
1483
  je .NOEXTENDED
1484
  jne .t
1485
 
1486
.t:
1487
 
1488
  mov	eax, $80000001 ;// Setup extended function 8000_0001h
1489
  cpuid
1490
 
1491
  test	edx, $80000000 ;// Test bit 31
1492
  jnz	.XIT
1493
 
1494
.NOEXTENDED: ;// 3DNow! technology is supported
1495
   mov	dword [now+ 9], $6F6E
1496
   jmp TEST3DNOWP
1497
.XIT:
1498
   mov	dword [now+ 9],  $736579
1499
   jmp TEST3DNOWP
1500
 
1501
TEST3DNOWP:
1502
 
1503
  cmp [smallvendor], 'ntel'
1504
  je .NOEXTENDEDP
1505
 
1506
.tp:
1507
 
1508
  mov	eax, $80000001 ;// Setup extended function 8000_0001h
1509
  cpuid
1510
 
1511
  test	edx, $40000000 ;// Test bit 30
1512
  jnz	.XITP  ;// 3DNow! technology is supported
1513
 
1514
.NOEXTENDEDP:
1515
   mov	dword [nowp+ 9], $6F6E
1516
   jmp TESTMMXP
1517
.XITP:
1518
   mov	dword [nowp+ 9],  $736579
1519
   jmp TESTMMXP
1520
 
1521
TESTMMXP:
1522
 
1523
    mov   eax,$80000000
1524
    cpuid
1525
 
1526
    test eax, 80000000h
1527
jna NOEXTENDEDM
1528
 
1529
  ;cmp   eax, $80000000 ;// Is 800_0001h supported?
1530
  ;jz   .NOEXTENDEDM    ;// If not, 3DNow! technology is not supported
1531
  mov	eax, $80000001 ;// Setup extended function 8000_0001h
1532
  cpuid
1533
  cmp [smallvendor], 'tead'
1534
  jne noCyr
1535
Cyrmx:
1536
  test	edx, $01000000 ;// Test bit 24
1537
  jnz	XITM  ;// 3DNow! technology is supported
1538
  jz NOEXTENDEDM
1539
noCyr:
1540
  test	edx, $00400000 ;// Test bit 22
1541
  jnz	XITM  ;// 3DNow! technology is supported
1542
  ;jz   .NOEXTENDEDM
1543
 
1544
NOEXTENDEDM:
1545
   mov	dword [mmxp+ 7], $6F6E
1546
   mov	dword [MMXPi+ 8], $6F6E
1547
   jmp text3d
1548
XITM:
1549
   mov	dword [mmxp+ 7],  $736579
1550
   mov	dword [MMXPi+ 8],  $736579
1551
   jmp text3d
1552
 
1553
text3d:
1554
 
451 heavyiron 1555
Text 175,290,0x00000000,now, nowlen-now
1556
Text 175,310,0x00000000,nowp, nowplen-nowp
1557
Text 95,290,0x00000000,mmxp, mmxplen-mmxp
223 Ghost 1558
 
1559
jmp still
1560
 
1561
;--------------------------
1562
NO_CPUID:
451 heavyiron 1563
 Text 15,50,0x00000000,oblom, oblomlen-oblom
223 Ghost 1564
 jmp FREEZE
1565
 
1566
FREEZE:
1567
nop
318 heavyiron 1568
jmp FREEZE ; maybe we should close application or just made some Warning and jump to still:
223 Ghost 1569
;----------------
450 Ghost 1570
still:
1571
 
1572
; çàòåì ïåðåõîäèì â öèêë îæèäàíèÿ ñîáûòèé
1573
event_wait:
1574
 
1575
    ;================_RAM_==============
451 heavyiron 1576
  Number 200,340,0,4,dword [ram_size_a],0xFFFFFF
450 Ghost 1577
 
1578
  mov eax, 18
1579
  mov ebx, 16
485 heavyiron 1580
  mcall
450 Ghost 1581
 
1582
  shr eax, 10
1583
 
1584
  mov [ram_size_a], eax
1585
 
1586
  mov eax, 18
1587
  mov ebx, 17
485 heavyiron 1588
  mcall
450 Ghost 1589
 
1590
  shr eax, 10
1591
 
1592
  mov [ram_size_t], eax
1593
 
451 heavyiron 1594
  Text 115,340,0x00000000,ram, ramlen-ram
450 Ghost 1595
 
451 heavyiron 1596
  Number 200,340,0,4,dword [ram_size_a],0x000000
450 Ghost 1597
 
451 heavyiron 1598
  Number 270,340,0,4,dword [ram_size_t],0x000000
1599
  Text 300,340,0x00000000,mb, mblen-mb
450 Ghost 1600
 
1601
;==============================
1602
 
1603
	mov	eax,23	     ; ôóíêöèÿ 23: îæèäàíèå ñîáûòèÿ
485 heavyiron 1604
	mov	ebx,50	     ; æäåìñ 0.5 ñåê
1605
	mcall
450 Ghost 1606
 
223 Ghost 1607
    cmp  eax,1		;
450 Ghost 1608
    je	 red		;  redraw
223 Ghost 1609
    cmp  eax,2		;
1610
    je	 key		;  key
1611
    cmp  eax,3		;
1612
    je	 button 	;  button
1613
    jmp  still		;
1614
  key:			;
1615
    mov  eax,2		;  
485 heavyiron 1616
    mcall		;
223 Ghost 1617
    jmp  still		;
1618
  button:		;
1619
    mov  eax,17 	;
485 heavyiron 1620
    mcall		;
223 Ghost 1621
    cmp  ah,1		;  = 1 ?
1622
    je	close		; close
1623
 
1624
    cmp  ah,2		;  = 2 ?
1625
    je	thread_start	;
1626
			;
1627
    cmp  ah,3		;  = 3 ?
1628
    je	vybor		; vybor
1629
 
1630
    jne  noclose
1631
 
450 Ghost 1632
    jmp     event_wait
223 Ghost 1633
vybor:
1634
 
451 heavyiron 1635
 Number 310,70,0,4,dword [rating],0xFFFFFF ;
223 Ghost 1636
 
451 heavyiron 1637
 Number 315,90,0,3,dword [FRS],0xFFFFFF; MHz
223 Ghost 1638
 
1639
cmp [FRS], 266
1640
jz .s1
1641
cmp [FRS], 333
1642
jz .s2
1643
cmp [FRS], 400
1644
jz .s3
1645
 
1646
.s1:
1647
mov [FRS], 333
1648
call newrating
451 heavyiron 1649
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 1650
 
451 heavyiron 1651
 Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 1652
jmp  still
1653
 
1654
.s2:
1655
mov [FRS], 400
1656
 
1657
call newrating
1658
 
451 heavyiron 1659
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 1660
 
451 heavyiron 1661
   Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 1662
jmp  still
1663
 
1664
.s3:
1665
mov [FRS], 266
1666
call newrating
1667
 
451 heavyiron 1668
 Number 310,70,0,4,dword [rating],0x000000
223 Ghost 1669
 
451 heavyiron 1670
  Number 315,90,0,3,dword [FRS],0x000000; MHz
223 Ghost 1671
 
1672
jmp  still
1673
 
1674
noclose:
1675
    jmp  still
1676
 
1677
close:
1678
    mov   eax,-1
485 heavyiron 1679
    mcall
223 Ghost 1680
 
1681
;**************************** THREAD-SECOND WINDOW
1682
thread_start:
1683
 
1684
    cmp  [num_win2],0
1685
 
1686
    jne  still
1687
 
1688
;================================================RSA test
1689
  call init_test   ; start RSA code
1690
  call module_test
1691
  jmp somewhere
1692
 
1693
 module_test:
1694
;test rsa coding speed
1695
;length of module - 256 bit
1696
  mov  eax,26
1697
  mov  ebx,9
485 heavyiron 1698
  mcall
223 Ghost 1699
  add  eax,100 ;test lasts 1 second.
1700
  push eax
1701
.loop:
1702
  mov  ecx,4 ;do 4 iterations
485 heavyiron 1703
  push ecx   ;this reduces number of calls mcall.
223 Ghost 1704
.loop1:
1705
  call rsa_test   ;this procedure change all registers
1706
  dec  dword [esp]
1707
  jnz  .loop1
1708
  pop  ecx
1709
  mov  eax,26
1710
  mov  ebx,9
485 heavyiron 1711
  mcall
223 Ghost 1712
  cmp  eax,dword [esp]	 ;Is time changed?
1713
  jl   .loop
1714
  pop  eax
1715
  shr  dword [iter],4 ;[iter] - speed in Kb/sec. (every iteration codes 64 bytes)
1716
  ret
1717
 
1718
   somewhere:
1719
;======================================================================
318 heavyiron 1720
CreateTread window_2,thread2_esp
223 Ghost 1721
 
1722
    jmp  still
1723
 
1724
window_2:
1725
    mov  [num_win2],1
1726
    call draw_window_2
1727
 
1728
still_2:
1729
 
1730
    mov  eax,10
485 heavyiron 1731
    mcall
223 Ghost 1732
 
1733
    cmp  eax,1
1734
    je	 window_2	;  window_2
1735
    cmp  eax,2		;
1736
    je	 key_2		;  key_2
1737
    cmp  eax,3		;
1738
    je	 button_2	;  button_2
1739
 
1740
    jmp  still_2	;
1741
 
1742
  key_2:		;
1743
    mov  eax,2		;   2
485 heavyiron 1744
    mcall		;
223 Ghost 1745
    jmp  still_2	;
1746
 
1747
  button_2:		;
1748
    mov  eax,17 	; 17
485 heavyiron 1749
    mcall		;
223 Ghost 1750
 
1751
    cmp  ah,1		; = 1 ?
1752
    jne  noclose_2	; noclose
1753
 
1754
    mov  [num_win2],0	;
1755
 
1756
    or	 eax,-1 	;
485 heavyiron 1757
    mcall
223 Ghost 1758
 
1759
  noclose_2:
1760
 
1761
    jmp  still_2	;
1762
 
1763
draw_window_2:
1764
    mov  eax,12 		   ; function 12:tell os about windowdraw
1765
    mov  ebx,1h 		    ; 1, start of draw
485 heavyiron 1766
    mcall
223 Ghost 1767
 
1768
 
451 heavyiron 1769
  Window 250,250,420,390, 0x33FFFFFF, 0x805080d0, standard
318 heavyiron 1770
	  ; place size
1771
 
451 heavyiron 1772
Text 15, 10,0x00000000, STDCA, STDCAlen-STDCA
1773
Text 215, 10,0x00000000, EXTCA, EXTCAlen-EXTCA
318 heavyiron 1774
 
451 heavyiron 1775
Number 135,10,1*256,8,dword [stdc],0x000000
1776
Number 335,10,1*256,8,dword [extc],0x000000
223 Ghost 1777
 
451 heavyiron 1778
Text 15, 30,0x00000000, FPU, FPUlen-FPU
1779
Text 115, 30,0x00000000, VME, VMElen-VME
1780
Text 215, 30,0x00000000, DE,  DElen-DE
1781
Text 315, 30,0x00000000, PSE, PSElen-PSE
223 Ghost 1782
 
451 heavyiron 1783
Text 15, 50,0x00000000,TSC, TSClen-TSC
1784
Text 115, 50,0x00000000,MSR, MSRlen-MSR
1785
Text 215,50,0x00000000,PAE, PAElen-PAE
1786
Text 315,50,0x00000000,MCE, MCElen-MCE
223 Ghost 1787
 
451 heavyiron 1788
Text 15,70,0x00000000,CX8, CX8len-CX8
1789
Text 115,70,0x00000000,APIC, APIClen-APIC
1790
Text 215,70,0x00000000,Res, Reslen-Res
1791
Text 315,70,0x00000000,SEP, SEPlen-SEP
223 Ghost 1792
 
451 heavyiron 1793
Text 15,90,0x00000000,MTRR, MTRRlen-MTRR
1794
Text 115,90,0x00000000,PGE, PGElen-PGE
1795
Text 215,90,0x00000000,MCA, MCAlen-MCA
1796
Text 315,90,0x00000000,CMOV, CMOVlen-CMOV
223 Ghost 1797
 
451 heavyiron 1798
Text 15,110,0x00000000,PAT, PATlen-PAT
1799
Text 115,110,0x00000000,PSE36, PSE36len-PSE36
1800
Text 215,110,0x00000000,PSNUM, PSNUMlen-PSNUM
1801
Text 315,110,0x00000000,CLFLUSHn, CLFLUSHnlen-CLFLUSHn
223 Ghost 1802
 
451 heavyiron 1803
Text 15,130,0x00000000,Res, Reslen-Res
1804
Text 115,130,0x00000000,DTS, DTSlen-DTS
1805
Text 215,130,0x00000000,ACPI, ACPIlen-ACPI
1806
Text 315,130,0x00000000,MMX, MMXlen-MMX
223 Ghost 1807
 
451 heavyiron 1808
Text 15,150,0x00000000,FXSR, FXSRlen-FXSR
1809
Text 115,150,0x00000000,SSE, SSElen-SSE
1810
Text  215,150,0x00000000,SSE2, SSE2len-SSE2
1811
Text 315,150,0x00000000,SSn, SSnlen-SSn
223 Ghost 1812
 
451 heavyiron 1813
Text 15,170,0x00000000,HTT, HTTnlen-HTTn
1814
Text 115,170,0x00000000,TM, TMlen-TM
1815
Text 215,170,0x00000000,IA64, IA64len-IA64
1816
Text 315,170,0x00000000,PBE, PBElen-PBE
223 Ghost 1817
;---------------
451 heavyiron 1818
DrawLine 0,  410, 185,185,0x8080FF  ;10
223 Ghost 1819
 
1820
mov   eax,$80000000
1821
cpuid
1822
;mov eax, $03020101   for test of reaction
1823
test eax, 80000000h
1824
jnz goooddd
1825
 
1826
baaadd:
451 heavyiron 1827
Text 95,235,0x00000000,NEF, NEFlen-NEF
223 Ghost 1828
jmp too
1829
 
1830
goooddd:
451 heavyiron 1831
Text 15,195,0x00000000,SS3, SS3len-SS3
1832
Text 15,215,0x00000000,MON, MONlen-MON
1833
Text 15,235,0x00000000,DS_CPL, DS_CPLlen-DS_CPL
1834
Text 15,255,0x00000000,EST, ESTlen-EST
1835
Text 15,275,0x00000000,TM2, TM2len-TM2
1836
Text 15,295,0x00000000,VMX, VMXlen-VMX
1837
Text 15,315,0x00000000,SVM, SVMlen-SVM
223 Ghost 1838
 
451 heavyiron 1839
Text 115,195,0x00000000,CNXT_ID, CNXT_IDlen-CNXT_ID
1840
Text 115,215,0x00000000,CX16, CX16len-CX16
1841
Text 115,235,0x00000000,ETPRD, ETPRDlen-ETPRD
1842
Text 115,255,0x00000000,SYS, SYSlen-SYS
1843
Text 115,275,0x00000000,LAF, LAFlen-LAF
1844
Text 115,295,0x00000000,SSSE3, SSSE3len-SSSE3
1845
Text 115,315,0x00000000,MCR8, MCR8len-MCR8
223 Ghost 1846
 
451 heavyiron 1847
Text 215,195,0x00000000,MP, MPlen-MP
1848
Text 215,215,0x00000000,NX, NXlen-NX
1849
Text 215,235,0x00000000,MMXPi, MMXPilen-MMXPi
1850
Text 215,255,0x00000000,MMXn, MMXnlen-MMXn
1851
Text 215,275,0x00000000,FXSRn, FXSRnlen-FXSRn
1852
Text 215,295,0x00000000,DCA,DCAlen-DCA
223 Ghost 1853
 
451 heavyiron 1854
Text 315,195,0x00000000,FFXSR, FFXSRlen-FFXSR
1855
Text 315,215,0x00000000,TSCP, TSCPlen-TSCP
1856
Text 315,235,0x00000000,LM, LMlen-LM
1857
Text 315,255,0x00000000,DNo, DNolen-DNo
1858
Text 315,275,0x00000000,DN, DNlen-DN
1859
Text 315,295,0x00000000,CMPL, CMPLlen-CMPL
318 heavyiron 1860
 
1861
 
223 Ghost 1862
too:
451 heavyiron 1863
DrawLine 0,  410, 335,335,0x8080FF  ;10
223 Ghost 1864
 
451 heavyiron 1865
Text 15,350,0x00000000,speed, speedlen-speed
1866
Text 130,350,0x00000000,kbpersec, kbperseclen-kbpersec
223 Ghost 1867
 
451 heavyiron 1868
Number 95,350,0,5,dword [iter],0x000000; RSA test results
223 Ghost 1869
 
1870
    mov  eax,12
1871
    mov  ebx,2h
485 heavyiron 1872
    mcall
223 Ghost 1873
 
1874
    ret
1875
 
1876
num_win2 db 0
1877
 
1878
;   *******  main window *******
1879
 
1880
draw_window:
1881
   mov eax,12
1882
   mov	ebx,1h
485 heavyiron 1883
   mcall
223 Ghost 1884
 
485 heavyiron 1885
  Window 150,150,350,385, 0x33FFFFFF, 0x805080d0, title
318 heavyiron 1886
	  ; place size
223 Ghost 1887
 
451 heavyiron 1888
  Button 15,330,92,23,2,0x03FFFFFF   ;  button "press for more"
223 Ghost 1889
 
1890
	mov	esi, knopka
1891
	mov	edi, img_area2
1892
	call	load_gif2
451 heavyiron 1893
PutImage 15,330,93,24,img_area2+8   ; image "press for more"
318 heavyiron 1894
;         place   size
223 Ghost 1895
 
1896
 
1897
    mov  eax,12
1898
    mov  ebx,2h
485 heavyiron 1899
    mcall
223 Ghost 1900
 
451 heavyiron 1901
    Text 130,270,0x00000000,instruct, instructlen-instruct
223 Ghost 1902
 
451 heavyiron 1903
    DrawLine  10,  330, 325,325,0x8080FF
1904
    DrawLine 330,  330, 275,325,0x8080FF
1905
    DrawLine  10,   10, 275,325,0x8080FF
1906
    DrawLine  10,  125, 275,275,0x8080FF
1907
    DrawLine 230,  330, 275,275,0x8080FF
223 Ghost 1908
 
1909
  cmp dword[smallvendor], 'cAMD'
1910
  jne cont
1911
  cmp [f], $6
1912
  jne cont
1913
  cmp [f], $6
1914
  jl cont
1915
 
451 heavyiron 1916
   Button 240,85,69,15,3,0x030000FF  ;  button for rating
223 Ghost 1917
 
451 heavyiron 1918
    Text 245,90,0x00FFFFFF,FR, FRlen-FR
223 Ghost 1919
 
1920
   call newrating; !!!!
1921
 
1922
     cont:
1923
 
1924
 
451 heavyiron 1925
    Text 15,50,0x00000000,tsum, tsumlen-tsum   ;
1926
    Text 15,90,0x00000000,cpuname, cpunamelen-cpuname;
1927
    Text 255,250,0x00000000,typen, typenlen-typen;
1928
    Text 175, 50,0x00000000,tech, techlen-tech;
223 Ghost 1929
 
451 heavyiron 1930
    Number 82,50,0,4,dword [total],0x000000; MHz
1931
    Number 110,50,0,2,dword [sot],0x000000; KHz
318 heavyiron 1932
 
451 heavyiron 1933
    Text 15,170,0x00000000,cache2, cache2len-cache2
1934
    Text 15,210,0x00000000,cache3, cache3len-cache3
1935
    Text 15,230,0x00000000,cache4, cache4len-cache4
318 heavyiron 1936
 
1937
 
451 heavyiron 1938
    Number 75,110,1*256,1,dword [f],0x000000 ;
1939
    Number 75,130,1*256,1,dword [m],0x000000;
1940
    Number 75,150,1*256,1,dword [s],0x000000;
223 Ghost 1941
 
451 heavyiron 1942
    Number 110,110,1*256,2,dword [ef],0x000000 ;
1943
    Number 110,130,1*256,2,dword [em],0x000000;
223 Ghost 1944
 
451 heavyiron 1945
Text   15,30,0x00000000,multil, multillen-multil
1946
Number 85,30,0,2,dword [multb],0x000000;
1947
Number 105,30,0,1,dword [multa],0x000000;
223 Ghost 1948
 
451 heavyiron 1949
Text   175,30,0x00000000,freql, freqllen-freql
1950
Number 259,30,0,4,dword [freqbb],0x000000;
1951
Number 289,30,0,2,dword [freqll],0x000000;
318 heavyiron 1952
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
451 heavyiron 1953
;Text 115,280,0x00000000,logcpus, logcpuslen-logcpus
1954
;Number 250,280,0,2,dword [number_of_log_cpus],0x000000
223 Ghost 1955
 
318 heavyiron 1956
 
451 heavyiron 1957
    Text 15,10,0x00000000,stm, stmlen-stm
223 Ghost 1958
;  Fix for deleting leading whitespaces
1959
;  in Intel P4's internal name
1960
;  by Madis Calme
1961
;  23.12.2004 ver. 0.81
1962
    cld
1963
    mov  edi,myname
1964
    mov  al,20h
1965
    or	 ecx,-1
1966
    repe scasb
1967
    dec  edi
1968
    mov  esi,mynamelen
1969
    sub  esi,edi
451 heavyiron 1970
    Text 105, 10, 0x00000000, edi, esi
1971
;    Text 105,20,0x00000000,myname, mynamelen-myname
223 Ghost 1972
;-
451 heavyiron 1973
Text 15,250,0x00000000,brandid, brandidlen-brandid
223 Ghost 1974
 
1975
    ret 		;
1976
 
1977
load_gif:
1978
	mov	edi, img_area
1979
load_gif2:
1980
	gif2img esi,edi
1981
	ret
1982
 
1983
; DATA AREA
1984
 
515 heavyiron 1985
title	 db   'CPUID 2.21 by S.Kuzmin & the KolibriOS team',0
451 heavyiron 1986
 
223 Ghost 1987
tsum:
1988
    db 'Frequency:     .   MHz'
1989
tsumlen:
1990
 
1991
total dd 0x0
1992
total1 dd 0x0
1993
rating dd 0x0
1994
rat dd 0x0  ;
1995
 
1996
ram:
1997
db 'Available RAM:     out of'
1998
ramlen:
1999
 
2000
NEF:
2001
db 'EXTENDED FEATURES ARE NOT AVAILABLE'
2002
NEFlen:
2003
 
2004
mb :
2005
db 'MB'
2006
mblen:
2007
 
318 heavyiron 2008
;logcpus :
2009
;db 'Number of logical CPU:'
2010
;logcpuslen:
2011
 
223 Ghost 2012
speed :
2013
db 'PERFORMANCE:'
2014
speedlen:
2015
 
2016
kbpersec:
2017
db 'KB/SEC'
2018
kbperseclen:
2019
 
2020
instruct:
2021
    db 'Instruction sets'
2022
instructlen:
2023
 
451 heavyiron 2024
standard    db 'Standard and Extended features plus Performance test',0
223 Ghost 2025
 
2026
FR:
2027
    db 'Choose FSB:'
2028
FRlen:
2029
 
2030
STDCA:
2031
    db 'Highest STD call is         '
2032
STDCAlen:
2033
 
2034
EXTCA:
2035
    db 'Highest EXT call is         h'
2036
EXTCAlen:
2037
 
2038
brandid:
2039
    db 'Brand:'
2040
brandidlen:
2041
 
2042
oblom:
2043
    db 'SORRY, CPUID IS NOT AVAILABLE'
2044
oblomlen:
2045
other:
2046
    db 'SORRY, THIS VENDOR IS NOT SUPPORTED YET'
2047
otherlen:
318 heavyiron 2048
 
223 Ghost 2049
cpuname:
2050
    db 'CPU VENDOR:             '
2051
cpunamelen:
2052
fam:
2053
    db 'FAMILY:     std    ext'
2054
famlen:
2055
mode:
2056
    db 'MODEL:      std    ext'
2057
modelen:
2058
step:
2059
    db 'STEPPING:'
2060
steplen:
318 heavyiron 2061
 
223 Ghost 2062
cache2:
2063
 
318 heavyiron 2064
    db 'L1(data):     KB       -way set     -byte line size'
223 Ghost 2065
cache2len:
2066
 
2067
cache:
318 heavyiron 2068
    db 'L1(inst):     KB       -way set     -byte line size'
223 Ghost 2069
cachelen:
2070
 
318 heavyiron 2071
cache3:
2072
 
2073
    db 'L2:      KB            -way set     -byte line size'
2074
cache3len:
2075
 
2076
cache4:
2077
    db 'L3:      KB            -way set     -byte line size'
2078
cache4len:
2079
 
223 Ghost 2080
cacheP4:
2081
 
318 heavyiron 2082
    db 'L1(inst):     Kuops    -way set     -byte line size'
223 Ghost 2083
cacheP4len:
2084
 
2085
tech:
2086
  db 'Technology: 0.   micron '
2087
techlen:
2088
 
2089
typen:
2090
  db 'Type:'
2091
typenlen:
2092
 
2093
pr:
2094
  db 'P-rating:'
2095
prlen:
2096
 
2097
multil:
2098
  db 'Multiplier:   .'
2099
multillen:
2100
 
2101
freql:
2102
  db 'System clock:     .   MHz'
2103
freqllen:
2104
 
2105
name:
2106
    db 'CODENAME:'
2107
namelen:
318 heavyiron 2108
 
223 Ghost 2109
AMDn:
2110
    db 'AMD'
2111
AMDnlen:
2112
Inteln:
2113
    db 'Intel'
2114
Intelnlen:
2115
Cyrixn:
2116
    db 'Cyrix'
2117
Cyrixnlen:
2118
IDTn:
2119
     db 'IDT/Centaur'
2120
IDTnlen:
2121
Centaurn:
2122
     db 'VIA'
2123
Centaurnlen:
2124
 
2125
Tranmsmetan:
2126
     db 'Transmeta'
2127
Tranmsmetanlen:
2128
 
2129
MMXs:
2130
    db 'MMX:         '
2131
MMXslen:
2132
 
2133
mmxp:
2134
    db 'MMX+:         '
2135
mmxplen:
2136
 
2137
HTT:
2138
    db 'HTT:          '
2139
HTTlen:
2140
 
2141
HTTn:
2142
    db 'HTT:         '
2143
HTTnlen:
2144
 
2145
sse3:
2146
    db 'SSE3:         '
2147
sse3len:
2148
now:
2149
    db '3DNOW!:         '
2150
nowlen:
2151
nowp:
2152
    db '3DNOW!+:         '
2153
nowplen:
2154
 
2155
;-Type
2156
 
2157
t1:
2158
    db 'OEM'
2159
t1len:
2160
 
2161
t2:
2162
    db 'Overdrive'
2163
t2len:
2164
 
2165
t3:
2166
    db 'Dual'
2167
t3len:
2168
 
2169
t4:
2170
    db 'Unknown'
2171
t4len:
2172
 
2173
;----------Intel
2174
P50:
2175
db 'P5 A-step'
2176
P50len:
2177
P5:
2178
db 'P5'
2179
P5len:
2180
P54T:
2181
db 'P24T Overdrive'
2182
P54Tlen:
2183
P54C:
2184
db 'P54C'
2185
P54Clen:
2186
P55C:
2187
db 'P55C (with MMX)'
2188
P55Clen:
2189
; ---
2190
P60:
2191
db 'Pentium Pro A-step'
2192
P60len:
2193
P61:
2194
db 'Pentium Pro'
2195
P61len:
2196
P63:
2197
db 'Pentium II (Klamath)'
2198
P63len:
2199
P65:
2200
db 'Pentium II (Deschutes)'
2201
P65len:
2202
P66:
2203
db 'Celeron (Medocino)'
2204
P66len:
2205
P67:
2206
db 'Pentium III (Katmai)'
2207
P67len:
2208
P68:
2209
db 'Pentium III (Coppermine)'
2210
P68len:
2211
P69:
2212
db 'Pentium M (Banias)'
2213
P69len:
2214
P6A:
2215
db 'Pentium III Xeon (Cascades)'
2216
P6Alen:
2217
P6B:
2218
db 'Pentium III (Tualatin)'
2219
P6Blen:
2220
P6D:
2221
db 'Pentium M (Dothan)'
2222
P6Dlen:
2223
P6E:
318 heavyiron 2224
db 'Pentium M (Yonah)/ Core'
223 Ghost 2225
P6Elen:
2226
P6F:
318 heavyiron 2227
db 'Pentium D (Conroe)/ Core 2 (Kentsfield)'
223 Ghost 2228
P6Flen:
2229
;---
2230
PS0:
2231
db 'Itanium (IA-64)'
2232
PS0len:
2233
;------------
2234
PF0:
2235
db 'Pentium 4 (Willamete)'
2236
PF0len:
2237
PF2:
2238
db 'Pentium 4 (Northwood)'
2239
PF2len:
2240
PF3:
2241
db 'Pentium 4 (Prescott)'
2242
PF3len:
2243
PF5:
2244
db 'Pentium 4 (Tejas)'
2245
PF5len:
2246
PF6:
2247
db 'Pentium 4 (Presler)'
2248
PF6len:
2249
;----------------Intel Celerons
2250
P65c:
2251
db 'Celeron (Covington)'
2252
P65clen:
2253
P68c:
2254
db 'Celeron (Coppermine)'
2255
P68clen:
2256
P6Bc:
2257
db 'Celeron (Tualatin)'
2258
P6Bclen:
2259
PF0c:
2260
db 'Celeron (Willamete)'
2261
PF0clen:
2262
PF2c:
2263
db 'Celeron (Northwood)'
2264
PF2clen:
2265
PF3c:
2266
db 'Celeron (Prescott)'
2267
PF3clen:
2268
PF5c:
2269
db 'Celeron D (Texas)'
2270
PF5clen:
2271
PF6c:
2272
db 'Celeron D (Presler)'
2273
PF6clen:
2274
;---------AMD
2275
A50:
2276
db 'K5 (PR75, PR90, PR100)'
2277
A50len:
2278
A51:
2279
db '5k86 (PR120, PR133)'
2280
A51len:
2281
A52:
2282
db '5k86 (PR166)'
2283
A52len:
2284
A53:
2285
db '5k86 (PR200)'
2286
A53len:
2287
A56:
2288
db 'K6'
2289
A56len:
2290
A57:
2291
db 'K6'
2292
A57len:
2293
A58:
2294
db 'K6-2'
2295
A58len:
2296
A59:
2297
db 'K6-III'
2298
A59len:
2299
A5D:
2300
db 'K6-2+ or K6-III+'
2301
A5Dlen:
2302
;-------------------
2303
At1:
2304
db 'Athlon'
2305
At1len:
2306
At2:
2307
db 'Athlon'
2308
At2len:
2309
At3:
2310
db 'Duron (Spitfire)'
2311
At3len:
2312
At4:
2313
db 'Athlon (Thunderbird)'
2314
At4len:
2315
At6:
2316
db 'AthlonXP (Palomino)'
2317
At6len:
2318
At7:
2319
db 'Duron (Morgan)'
2320
At7len:
2321
At8:
2322
db 'AthlonXP (Thoroughbred)'
2323
At8len:
2324
At8a:
2325
db 'Duron (Applebred)'
2326
At8alen:
2327
Ata:
2328
db 'AthlonXP (Barton)'
2329
Atalen:
2330
Atat:
2331
db 'AthlonXP (Thorton)'
2332
Atatlen:
2333
;-------------------
2334
AF1:
2335
db 'Dual-core Opteron'
2336
AF1len:
2337
AF3:
2338
db 'Athlon 64 (Toledo)'
2339
AF3len:
2340
AF4:
2341
db 'Athlon 64 (ClawHammer)'
2342
AF4len:
2343
AF5:
2344
db 'Opteron/Athlon 64 FX (SledgeHammer)'
2345
AF5len:
2346
 
2347
AFC:
2348
db 'Athlon 64 (Newcastle)'
2349
AFClen:
2350
 
2351
AFF:
2352
db 'Athlon 64 (Winchester)'
2353
AFFlen:
2354
 
2355
AFS:
2356
db 'Athlon 64 (San Diego)'
2357
AFSlen:
2358
 
2359
AFV:
2360
db 'Athlon 64 (Venice)'
2361
AFVlen:
2362
 
2363
AFCs:
2364
db 'Sempron (Paris)'
2365
AFCslen:
2366
 
2367
AFCsp:
2368
db 'Sempron (Palermo)'
2369
AFCsplen:
2370
 
2371
;---------Cyrix
2372
C52:
2373
db '6x86 M1'
2374
C52len:
2375
C54:
2376
db 'MediaGX'
2377
C54len:
2378
C60:
2379
db '6x86MX M2'
2380
C60len:
2381
C65:
2382
db 'C3 (Cyrix M2)' ;?
2383
C65len:
2384
;--------IDT
2385
V54:
2386
db 'WinChip C6'
2387
V54len:
2388
V58:
2389
db 'WinChip 2'
2390
V58len:
2391
V59:
2392
db 'WinChip 3'
2393
V59len:
2394
;-------VIA
2395
V66:
2396
db 'C3 (Samuel)'  ; Joshua is unreleased 065
2397
V66len:
2398
V67:
2399
db 'C3 (Samuel2/Ezra)' ; ?
2400
V67len:
2401
V68:
2402
db 'C3 (Ezra-T/Eden)' ;?
2403
V68len:
2404
V69:
2405
db 'C3 (Antaur/Nehemiah)' ;?
2406
V69len:
2407
VA:
2408
db 'C7 (Esther)' ;?
2409
VAlen:
2410
;---------Transmeta
2411
T5:
2412
db 'Crusoe' ;
2413
T5len:
2414
TF:
2415
db 'Efficeon' ;
2416
TFlen:
2417
;---------
2418
NG:
2419
    db 'Next generation CPU'
2420
NGlen:
2421
 
2422
stm:
2423
    db 'Internal name:'
2424
stmlen:
2425
 
318 heavyiron 2426
athloncoef	db	110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120
2427
		db	190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240
2428
athlonmcoef:	db	110, 115, 120, 125, 50, 55, 60, 65,  70, 75, 80, 85, 90, 95, 100, 105
2429
		db	30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240
2430
athloncoef3	db	45, 50, 40, 55, 25, 30, 60, 35
2431
p4coef		db	160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150	; Pentium 4 (Willamete)
2432
coppercoeff	db	 50, 30, 40, 20, 55, 35,  45, 25,  35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70,  80, 100,  20, 75,  15, 105
223 Ghost 2433
tualatcoeff	db	120, 35, 35, 40, 55, 35, 115, 35, 160, 70, 80, 60, 40, 75, 35, 65, 90, 110,  35, 35, 95,  35, 85, 35, 35, 35, 130, 100, 140, 35, 150, 105
2434
 
2435
 
2436
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2437
;
2438
;  include images and unpacking- and hasharea
2439
;
2440
include 'logos.inc' ; include file where gif's are stored
2441
img_area:	   ; image is going to be unpacked to here
2442
rb 201*49*3+8	   ; image resolution (bits to reserve)
2443
 
2444
img_area2:	   ; image is going to be unpacked to here
2445
rb 93*24*3+8	   ; image resolution (bits to reserve)
2446
 
2447
gif_hash_area:
2448
rd 4096+1	   ;hash area size for unpacking gif
2449
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2450
 
2451
I_END:
451 heavyiron 2452
 
2453
ost dd ?
2454
sot dd ?
2455
f dd ?
2456
m dd ?
2457
s dd ?
2458
t dd ?
2459
 
2460
ef dd ?
2461
em dd ?
2462
 
2463
multiplier dd ?
2464
multa dd ?
2465
multb dd ?
2466
 
2467
smallvendor dd ?
2468
L1d  dd ?
2469
L1i  dd ?
2470
L2   dd ?
2471
L3   dd ?
2472
micron dd ?
2473
sse3sup dd ?
2474
brand dd ?
2475
 
2476
ram_size_a dd ?
2477
ram_size_t dd ?
2478
 
2479
stdc dd ?
2480
extc dd ?
2481
 
2482
FRS dd ?
2483
freqsel db ?
2484
 
2485
temp dd ?
2486
freqbb dd ?
2487
freqll dd ?
2488
 
2489
wayli dd ?
2490
lineli dd ?
2491
 
2492
wayld dd ?
2493
lineld dd ?
2494
 
2495
wayl2 dd ?
2496
linel2 dd ?
2497
 
2498
wayl3 dd ?
2499
linel3 dd ?
2500
 
2501
;number_of_log_cpus dd ?
2502
 
2503
che db ? ; numbers of calls for Intel caches detection
2504
 
2505
myname:
2506
   rb 48
2507
mynamelen:
2508
 
223 Ghost 2509
align 4
485 heavyiron 2510
 
223 Ghost 2511
  thread2_stack_area rb 64
2512
  thread2_esp = $
2513
U_END: