Subversion Repositories Kolibri OS

Rev

Rev 318 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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