/programs/testing/cpuid/trunk/CPUID.ASM |
---|
0,0 → 1,4329 |
;****************************************************************************** |
; project name: CPUID * |
; platform: KolibriOS, x86 (IA-32), x86-64 achitectures * |
; compiler: flat assembler 1.70.03 * |
; version: 2.31 * |
; last update: 9 October 2018 * |
; maintained by: Sergey Kuzmin aka Wildwest * |
; e-mail: kuzmin_serg@list.ru * |
; site: http://coolthemes.narod.ru/files.html * |
; license: Copyright 2004-2018 Sergey Kuzmin and co-authors * |
; Rules: * |
; 1)you can use pieces of code in your project, but should * |
; mention the original author (include copyright notice); * |
; 2)if you modify CPUID (improve, port, translate, etc) send * |
; your changes to the maintainer or make about post changes * |
; at forum http://board.kolibrios.org/viewtopic.php?f=42&t=594* |
;-----------------------------------------------------------------------------* |
; English comments * |
;------------------------------------------------------------------------------ |
use32 |
org 0x0 |
db 'MENUET01' |
dd 0x01 |
dd START |
dd I_END |
dd U_END+4096 |
dd U_END+4096 |
dd 0x0 |
dd path |
include '..\..\..\develop\libraries\box_lib\load_lib.mac' |
include '..\..\..\macros.inc' |
include '../../../gui_patterns.inc' |
include '../../../KOSfuncs.inc' |
include 'lang.inc' |
include 'draw.inc' |
include 'brand.inc' ; brand ID decoding |
include 'caches.inc' ; L1 and L2 cashes decoding for Intel |
include 'multipli.inc' ; multiplier decoding |
include 'features.inc' ; features decoding |
include 'logos.inc' ; include file where gif's are stored |
include 'rsatest.inc' |
include 'variable.inc' |
include 'gif_lite.inc' |
@use_library |
START: |
mcall 68,11 |
mcall 66,1,1 |
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors |
load_libraries l_libs_start,end_l_libs |
;----------------------------------------------------------------------------- |
;OpenDialog initialisation |
push dword OpenDialog_data |
call [OpenDialog_Init] |
mov edi,filename_area |
mov esi,start_temp_file_name |
call copy_file_name_path |
;----------------------------------------------------------------------------- |
mcall 68,12,4096*8 ; 16 Kb - I hope this will be enough for store of data |
mov [store_text_area_start],eax |
;------------ |
CYCLES: |
; CPU speed |
mov eax, 18 |
mov ebx,5 |
mcall |
mov [total1],eax ;in Hz, example 1600490000 |
xor edx,edx |
mov ebx,1000000 |
div ebx |
mov [total], eax ; in Mhz, example 1600 |
xor edx, edx |
mov eax, [total1] |
mov ebx, 10000 |
div ebx |
mov [ost], eax ; example 160049 |
mov ecx, [total] |
imul ecx, 100 |
neg ecx |
add ecx, eax |
mov [sot], ecx ; example 49 |
;------------ |
cpu: ;is CPUID supported? |
pushfd ;push original EFLAGS |
pop eax ;get original EFLAGS |
mov ebx, eax ;save original EFLAGS |
xor eax, 00200000h ;flip 21th bit in EFLAGS |
push eax ;save new EFLAGS value on stack |
popfd ;replace current EFLAGS value |
pushfd ;get new EFLAGS |
pop eax ;store new EFLAGS in EAX |
cmp eax, ebx ;compare values of 21th bit |
jz NO_CPUID ;CPUID isn't supported |
;------------ |
CPUNAME: ; VENDOR |
mov eax,0 ; eax=0 |
cpuid |
mov [stdc], eax ; number of calls |
mov [cpuname+ 12],ebx |
mov [cpuname+ 16],edx |
mov [cpuname+ 20],ecx |
mov [smallvendor],ecx |
; for various vendors we should later use different methods |
;Decoding cache L1 and L2 for Intel |
cmp ecx, 'ntel' |
jne cpu1 ;is not Intel |
;Starting L1, L2, L3 caches detection (Intel made it VERY HARD) |
mov eax, 2 |
cpuid |
mov [che], al ; number of calls |
multik: |
.eaxl: |
test eax, eax ; Test bit 31 |
js .ebxl ; <> 0 =>invalid values |
call decodecache24 |
.ebxl: |
test ebx, ebx |
js .ecxl |
mov eax, ebx |
call decodecache32 |
.ecxl: |
test ecx, ecx |
js .edxl |
mov eax, ecx |
call decodecache32 |
.edxl: |
test edx, edx |
js cpu1 |
mov eax, edx |
call decodecache32 |
dec [che] ; we made all calls |
je cpu1 |
multi: ; not yet |
mov eax, 2 ; so we made call again |
cpuid |
jmp multik |
; FAMILY MODEL STEPPING |
cpu1: |
xor eax, eax |
inc eax ; eax=1 |
cpuid |
mov ecx, eax |
shr ecx,8 ; shift it to the correct position |
and ecx,0000000Fh ; get CPU family |
mov dword[f],ecx |
mov ecx, eax |
shr ecx,4 |
and ecx,0000000Fh ; get CPU model |
mov dword[m],ecx |
mov ecx, eax |
and ecx,0000000Fh ; get CPU stepping |
mov dword[s],ecx |
;- |
mov ecx, eax ; get Type |
shl ecx, 18 |
shr ecx,30 |
;and ecx, 0000000Fh ; only two lower bits can be nonzero |
mov dword[t], ecx |
;======================================================= |
cmp dword[smallvendor], 'cAMD' |
jz maybe_athlon |
cmp dword[smallvendor], 'ntel' |
jnz no_full ; if not AMD or Intel |
;detect_it: |
;cmp [f], 0Fh |
;jne no_full fixed calculation of extended model for Intel |
full: |
mov ecx, eax ; get Extended model |
shr ecx,16 ;shift it to the correct position |
and ecx, 0000000Fh |
shl ecx, 4 |
mov dword[newpc],ecx ; this value for old pc=0 and for new pc>0 |
add ecx, [m] |
mov dword[em],ecx ; effective model |
mov ecx, eax ; get Extended family |
shr ecx, 20 ;shift it to the correct position |
and ecx, 000000FFh |
add ecx, [f] |
mov dword[ef],ecx ; effective family |
jmp fut |
no_full: |
mov ecx, [m] |
mov [em], ecx |
mov ecx, [f] |
mov [ef], ecx |
jmp fut |
maybe_athlon: |
mov eax, 0x80000001 ; CPUID ext. function 0x80000001 |
cpuid |
mov ecx, eax |
shr ecx,8 ; shift it to the correct position |
and ecx,0000000Fh ; get CPU family |
mov dword[ef],ecx |
mov ecx, eax |
shr ecx,4 |
and ecx,0000000Fh ; get CPU model |
mov dword[em],ecx |
fut: |
call decode_sse3_5 |
;call decode_sse3_5 |
;- |
call decode_extended |
mov eax,$80000000 |
cpuid |
mov [extc], eax ; max number of calls |
test eax, $80000000 ;// Test bit 31 |
jz .noname |
cmp eax,$80000003 |
ja .mynameis |
jmp .noname |
.mynameis: |
mov eax,$80000002 |
cpuid |
mov [myname],eax |
mov [myname+4],ebx |
mov [myname+8],ecx |
mov [myname+12],edx |
mov eax,$80000003 |
cpuid |
mov [myname+16],eax |
mov [myname+20],ebx |
mov [myname+24],ecx |
mov [myname+28],edx |
mov eax,$80000004 |
cpuid |
mov [myname+32],eax |
mov [myname+36],ebx |
mov [myname+40],ecx |
mov [myname+44],edx |
jmp red |
.noname: |
red: |
;mov byte [multiplier], 115; ; for testing |
call decode_sse3 |
call multipl ; get multiplier |
mov byte [multiplier], cl |
mov dword [freqbb], 0 |
mov dword [freqll], 0 |
mov ebx, dword [multiplier] |
test ebx, ebx |
jz output |
calc: |
mov eax,dword [ost] ; example 166474 |
imul eax, 10 ; example 1664740 |
xor edx,edx |
div ebx ; get system clock (if multiplier detected) |
xor edx, edx ; example eax=16647 |
mov ebx, 100 |
div ebx |
mov dword [freqbb], eax ; example 166 |
mov dword [freqll], edx ; example 47 |
xor edx, edx |
mov eax,dword[multiplier] ; example 115 |
mov ebx,10 |
div ebx |
mov dword[multb], eax ; example 11 |
mov dword[multa], edx ; example 5 |
output: |
call draw_window ; Draw window |
;HRERE |
PROCCORE: ; Who are you? |
; Intel - "GenuineIntel" + |
; AMD - "AuthenticAMD" + |
; Cyrix - "CyrixInstead" + |
; UMC - "UMC UMC UMC " |
; NexGen - "NexGenDriven" |
; Centaur - "CentaurHauls" + |
; Rise Technology - "RiseRiseRise" |
; SiS - "SiS SiS SiS " |
; Transmeta - "GenuineTMx86" + |
; National Semiconductor - "Geode by NSC" |
; Vortex - "Vortex86 SoC" + initial support |
cmp dword[smallvendor], 'ntel' ;1 |
jz Intel |
cmp dword[smallvendor], 'cAMD' ;2 |
jz AMD |
cmp dword[smallvendor], 'tead' ;3 |
jz Cyrix |
cmp dword[smallvendor], 'auls' ;4 |
jz Centaur |
cmp dword[smallvendor], 'Mx86' ;5 |
jz Transmeta |
cmp dword[smallvendor], ' SoC' ;6 |
jz Vortex |
; cmp ecx, 'UMC ' |
; jz .UMC |
; cmp ecx, 'iven' |
; jz .NexGen |
; cmp ecx, 'Rise' |
; jz .Rise |
; cmp ecx, 'SiS ' |
; jz .SiS |
; cmp ecx, ' NSC' |
; jz .NSC |
; jmp Other ; I don't know what to do with you... |
Other: |
Text 75,70,0x00000000,other, otherlen-other |
mov esi, other |
mov edi, [saveproc] |
call concatname |
jmp MMXtest |
;------------------------- |
AMD: |
;------------------------------------------------------------------------------- |
Text 15, 190,0x00000000,cache, cachelen-cache |
Text 75,70,,AMDn, AMDnlen-AMDn |
mov esi, AMDnNew |
mov edi, saveproc |
call concatname |
mov esi, amd |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
MOV [codeN], 2 |
; place size |
; Relax, man. AMD made PRETTY SIMPLE cache detection routine |
;CACHE1: |
mov eax, 80000005h |
cpuid |
movzx eax, cl |
mov [lineld], eax |
mov eax, ecx |
;shl eax, 8 |
;shr eax, 24 |
and eax,00FF0000h |
shr eax, 16 |
mov [wayld], eax |
shr ecx, 24 |
mov [L1d], ecx |
movzx eax, dl |
mov [lineli], eax |
mov eax, edx |
;shl eax, 8 |
;shr eax, 24 |
and eax,00FF0000h |
shr eax, 16 |
mov [wayli], eax |
shr edx, 24 |
mov [L1i], edx |
;CACHE2: |
mov eax, 80000006h |
cpuid |
movzx eax, cl |
mov dword[linel2], eax |
push ecx |
shr ecx, 12+1 |
and ecx, 0x7 |
mov eax, 1 |
shl eax, cl |
mov dword [wayl2], eax |
pop ecx |
shr ecx, 16 |
mov [L2],ecx |
;CACHE3: edx provides l3 |
mov eax, 80000006h |
cpuid |
movzx eax, cl ;mov cl to eax, zero extend; cl is counter reg for loop,shifts |
mov dword[linel3], eax |
push edx |
shr edx, 12+1 |
and edx, 0x7 |
mov eax, 1 |
shl eax, cl |
mov dword [wayl3], eax |
pop edx |
shr edx, 18 |
mov [L3],ecx |
cmp [f], $5 |
jz .fiv |
cmp [f], $6 |
jz .si |
cmp [f], $F |
jz fif |
cmp [f], $10 ;family 16, 010h, |
jz ten |
.fiv: ; Family=5 |
mov [micron], 50 |
mov edx, A50 |
cmp [m], $0 |
jz @f |
mov [micron], 35 |
mov edx, A51 |
cmp [m], $1 |
jz @f |
mov edx, A52 |
cmp [m], $2 |
jz @f |
mov edx, A53 |
cmp [m], $3 |
jz @f |
mov [micron], 30 |
mov edx, A56 |
cmp [m], $6 |
jz @f |
mov [micron], 25 |
mov edx, A57 |
cmp [m], $7 |
jz @f |
mov edx, A58 |
cmp [m], $8 |
jz @f |
mov edx, A59 |
cmp [m], $9 |
jz @f |
mov [micron], 18 |
mov edx, A5D |
@@: |
jmp @f |
.si: ; Family=6 |
mov [micron], 25 |
mov edx, At1 |
cmp [m], $1 |
jz @f |
mov [micron], 18 |
mov edx, At2 |
cmp [m], $2 |
jz @f |
mov edx, At3 |
cmp [m], $3 |
jz @f |
mov edx, At4 |
cmp [m], $4 |
jz @f |
cmp [m], $6 |
jz A6 |
mov [micron], 13 |
mov edx, At7 |
cmp [m], $7 |
jz @f |
cmp [m], $8 |
jz A8 |
jmp AA |
@@: |
mov [cname], edx |
jmp MMXtest |
A6: |
;mov [FRS], 266 ;!!!!!! |
;Number 315,90,0,3,dword [FRS],0x000000; MHz |
call newrating; !!!! |
Text 245,70,0x00000000,pr, prlen-pr |
Number 310,70,0,4,dword [rating],0x000000 |
mov edx, At6 |
jmp @b |
A8: |
;mov [FRS], 266 ;!!!!!! |
;Number 315,90,0,3,dword [FRS],0x000000; MHz |
cmp [L2], 256 |
jl .App ; Applebred |
call newrating;!!!! |
Text 245,70,0x00000000,pr, prlen-pr |
Number 310,70,0,4,dword [rating],0x000000 |
mov edx, At8 |
jmp @b |
.App: |
mov edx, At8a |
jmp @b |
AA: |
; mov [FRS], 333; !!!! |
Text 245,70,0x00000000,pr, prlen-pr |
; Number 315,90,0,3,dword [FRS],0x000000; MHz |
mov edx, Atat |
cmp [L2], 256 |
jl .Tho ; Thorton |
mov edx, Ata |
.Tho: |
push edx |
call newrating;!!!!! |
Number 310,70,0,4,dword [rating],0x000000 |
pop edx |
jmp @b |
fif: ; AMD-64 Family=15 |
;here is a need to rewrite detection of AMD F-th family according to "Revision Guide for |
;AMD AthlonTM 64 and AMD OpteronTM Processors" 25759.pdf |
cmp [m],$1 ;Dual-core Opteron |
jz AF1. |
cmp [m],$3 ;Toledo 1024 0.09 |
jz AF3. |
cmp [m],$4 ;Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 |
jz AF4. |
cmp [m],$5 ;Opteron Athlon 64 FX 0.13 (1024) |
jz AF5. |
cmp [m],$7 ;Athlon 64 Athlon 64 FX Clawhammer(1024) 0.13 Sledgehammer(1024) 0.13 // SSE3+ SanDiego(1024) |
jz AF7. |
cmp [m],$8 ;Athlon 64 Mobile Athlon 64 FX ClawHammer (1024) 0.13 |
jz AF8. |
cmp [m],$B ;Athlon 64 |
jz AFB. |
cmp [m],$C ;Athlon 64 Newcastle(512) 0.13 Sempron> Paris (256) 0.13 |SSE3+ Sempron > Palermo FC0 0.09 // (Venice) |
jz AFC. |
cmp [m],$E ;Athlon 64 |
jz AFE. |
cmp [m],$F ;Athlon 64 Winchester(512) |SSE3+ SanDiego(1024) Venice (512) Palermo (256) 0.09 |
jz AFF. |
jmp next_generation |
ten: ;family = 10h |
cmp [m],$2 |
jz AB23. |
cmp [m], $8 |
jz AB83. |
cmp [m], $9 |
jz AB9. |
cmp [m], $2 |
jz AB8check2. |
AB8check2.: |
cmp [s],03h |
jz AB8right2. |
cmp [m],$2 |
jz athlonCheck |
athlonCheck: |
cmp [s],03h |
jz athlonKuma |
cmp [m], $5 |
jz AB4. |
cmp [m],$1 |
jz AB1. |
cmp [m],$4 |
jz AB8check. |
AB8check.: |
cmp [s],02h |
jz ABC2. |
cmp [s],01h |
jz ABC3. |
cmp [m], $9 |
jz AB6. |
cmp [m], $2 |
jz AB8check. |
cmp [m], 06h |
jz ABM. |
athlonKuma: |
mov [micron], 65 |
Text 100,70,0x00000000,AthlonKuma, AthlonKumalen-AthlonKuma |
mov esi, AthlonKuma |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB23.: |
mov [micron], 65 |
Text 100,70,0x00000000,AB23, AB23len-AB23 |
mov esi, AB23 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB83.: |
mov [micron], 65 |
Text 100,70,0x00000000,AB83, AB83len-AB83 |
mov esi, AB83 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB9.: |
mov [micron], 65 |
Text 100,70,0x00000000,AB9, AB9len-AB9 |
mov esi, AB9 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB8right2.: |
mov [micron], 65 |
Text 100,70,0x00000000,AB8right2, AB8right2len-AB8right2 |
mov esi, AB8right2 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB4.: |
mov [micron], 45 |
Text 100,70,0x00000000,AB4, AB4len-AB4 |
mov esi, AB4 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB1.: |
mov [micron], 65 |
Text 100,70,0x00000000,AB1, AB1len-AB1 |
mov esi, AB1 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
ABC2.: |
mov [micron], 45 |
Text 100,70,0x00000000,ABC2, ABC2len-ABC2 |
mov esi, ABC2 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AB6.: |
mov [micron], 45 |
Text 100,70,0x00000000,AB6, AB6len-AB6 |
mov esi, AB6 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
ABC3.: |
mov [micron], 45 |
Text 100,70,0x00000000,ABC3, ABC3len-ABC3 |
mov esi, ABC3 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
ABM.: |
mov [micron], 45 |
Text 100,70,0x00000000,ABM2, ABM2len-ABM |
mov esi, ABM2 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AF1.: |
mov [micron], 09 ;? |
Text 100,70,0x00000000,AF1, AF1len-AF1 |
mov esi, AF1 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AF3.: |
mov [micron], 09 |
Text 100,70,0x00000000,AF3, AF3len-AF3 |
mov esi, AF3 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AF4.: |
mov [micron], 13 |
Text 100,70,0x00000000,AF4, AF4len-AF4 |
mov esi, AF4 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AF5.: |
mov [micron], 13 |
Text 100,70,0x00000000,AF5, AF5len-AF5 |
jmp MMXtest |
AF7.: |
mov [micron], 13 |
Text 100,70,0x00000000,AF5, AF5len-AF5 |
mov esi, AF5 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AF8.: |
mov [micron], 13 |
Text 100,70,0x00000000,AF4, AF4len-AF4 |
mov esi, AF4 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AFB.: |
mov [micron], 13 |
Text 100,70,0x00000000,AF4, AF4len-AF4 |
mov esi, AF4 |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AFC.: |
cmp [L2], 512 |
je AFC.n |
cmp [sse3sup], 1 |
je AFC.npal |
AFC.npar: ; paris |
mov [micron], 13 |
Text 100,70,0x00000000,AFCs, AFCslen-AFCs |
mov esi, AFCs |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AFC.npal: ; palermo |
mov [micron], 9 |
Text 100,70,0x00000000,AFCsp, AFCsplen-AFCsp |
mov esi, AFCsp |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AFC.n: ;newcastle |
mov [micron], 13 |
Text 100,70,0x00000000,AFC, AFClen-AFC |
mov esi, AFC |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
AFE.: ; error in cpu |
jmp AFC. |
AFF.: |
cmp [sse3sup], 1 |
je .AFFsse |
.win: |
mov [micron], 9 ; winchester |
jmp MMXtest |
.AFFsse: |
mov [micron], 9 |
cmp [L2], 1024 |
jz .AFs |
cmp [L2], 512 |
jz .AFd |
cmp [L2], 256 |
jz .AFp |
.AFs: |
Text 100,70,0x00000000,AFS, AFSlen-AFS |
mov esi, AFS |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
.AFd: |
Text 100,70,0x00000000,AFV, AFVlen-AFV |
mov esi, AFV |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
.AFp: |
Text 100,70,0x00000000,AFCsp, AFCsplen-AFCsp |
mov esi, AFCsp |
mov edi, saveproc + 0x4 |
call concatname |
jmp MMXtest |
;----------------------------------------------- |
Intel: |
mov [codeN], $1 |
Text 75,70,0x00000000,Inteln, Intelnlen-Inteln |
mov esi, IntelnNew |
mov edi, saveproc |
call concatname |
mov esi, intel |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
det: |
cmp [f], $5 |
jz five |
cmp [f], $6 |
jz six |
cmp [f], $7 |
jz sev |
cmp [f], $F |
jz fift |
five: ;Family=5 |
Text 15, 190,0x00000000,cache, cachelen-cache |
cmp [m],$0 |
jz .I0 |
cmp [m],$1 |
jz .I1 |
cmp [m],$2 |
jz .I2 |
cmp [m],$3 |
jz .I3 |
cmp [m],$4 |
jz .I4 |
cmp [m],$7 |
jz .I7 |
cmp [m],$8 |
jz .I8 |
.I0: |
mov [cname], P50 |
mov esi, P50 |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 80 |
jmp MMXtest |
.I1: |
mov [cname], P5 |
mov esi, P5 |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 50 |
jmp MMXtest |
.I2: |
mov [cname], P54C |
mov esi, P54C |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 50 |
jmp MMXtest |
.I3: |
mov [cname], P54T |
mov esi, P54T |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 50 |
jmp MMXtest |
.I4: |
mov [cname], P55C |
mov esi, P55C |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 35 |
jmp MMXtest |
.I7: |
mov [cname], P54C |
mov esi, P54C |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 8 |
mov [L1i], 8 |
mov [L2], 256 |
mov [micron], 35 |
jmp MMXtest |
.I8: |
mov [cname], P55C |
mov esi, P55C |
mov edi, saveproc + 0x6 |
call concatname |
mov [L1d], 16 |
mov [L1i], 16 |
mov [L2], 256 |
mov [micron], 35 |
jmp MMXtest |
six: ;Family=6 |
Text 15, 190,0x00000000,cache, cachelen-cache |
cmp [newpc],$0 |
jnz NEWintel |
cmp [m],$0 |
jz .I60 |
cmp [m],$1 |
jz .I61 |
cmp [m],$3 |
jz .I63 |
cmp [m],$5 |
jz .I65 |
cmp [m],$6 |
jz .I66 |
cmp [m],$7 |
jz .I67 |
cmp [m],$8 |
jz .I68 |
cmp [m],$9 |
jz .I69 |
cmp [m],$A |
jz .I6A |
cmp [m],$B |
jz .I6B |
cmp [m],$D |
jz .I6D |
cmp [m],$E |
jz .I6E |
cmp [m],$F |
jz .I6F |
.I60: |
mov [micron], 50 |
mov [cname], P60 |
mov esi, P60 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I61: |
mov [micron], 35 |
mov [cname], P61 |
mov esi, P61 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I63: |
mov [micron], 28 |
mov [cname], P63 |
mov esi, P63 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I65: |
mov [micron], 25 |
cmp [L2], 0 |
jne .pp65 ; Pentium |
mov [cname], P65c |
mov esi, P65c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.pp65: |
mov [cname], P65 |
mov esi, P65 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I66: |
mov [micron], 25 |
mov [cname], P66 |
mov esi, P66 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I67: |
mov [micron], 25 |
;but if SSE4.1 supported then it is Intel Core (Penryn) |
mov [cname], P67 |
mov esi, P67 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I68: |
mov [micron], 18 |
cmp [L2], 128 |
jne .pp68 ; Pentium |
mov [cname], P68c |
mov esi, P68c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.pp68: |
mov [cname], P68 |
mov esi, P68 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I69: |
mov [micron], 13 |
mov [cname], P69 |
mov esi, P69 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I6A: |
mov [micron], 18 |
;but if SSE4.2 supported then it is Intel Core (Nehalem) |
mov [cname], P6A |
mov esi, P6A |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I6B: |
mov [micron], 13 |
cmp [L2], 256 |
jne .pp6B ; Pentium |
mov [cname], P6Bc |
mov esi, P6Bc |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.pp6B: |
mov [cname], P6B |
mov esi, P6B |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I6D: |
mov [micron], 9 |
mov [cname], P6D |
mov esi, P6D |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I6E: |
mov [micron], 6 |
mov [cname], P6E |
mov esi, P6E |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.I6F: |
mov [micron], 6 |
mov [cname], P6F |
mov esi, P6F |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
;06Ex - Pentium M Yonah 0.065 |
;06Fx - Pentium D Conroe 0.065, Xeon Woodcrest, Celeron D AllenDale, Core 2 Kentsfield |
NEWintel: |
cmp [em],$3A ;IvyBridge |
jz I3A |
cmp [em],$2A ;SandyBridge |
jz I2A |
cmp [em],$2D ;SandyBridge-E/EN/EP |
jz I2D |
cmp [em],$25 ;Arrandale/Clarksdale |
jz I25 |
cmp [em],$2C ;Gulftown/Westmere-EP |
jz I2C ;westmere-EP stepping B1 -> micron 0.032 |
cmp [em],$2F ;Westmere-EX |
jz I2F |
cmp [em],$1E ;Clarksfield/Lynnfield/Jasper Forest |
jz I1E |
cmp [em],$1A ;Bloomfield/Nehalem-EP |
jz I1A |
cmp [em],$2E ;Nehalem-EX |
jz I2E |
cmp [em],$17 ;Yorkfield/Wolfdale/Penryn/Harpertown (DP) |
jz I17 |
cmp [em],$1D ;Dunnington (MP) |
jz I1D |
cmp [em],$0F ;Clovertown/Kentsfield/Conroe/Merom/Woodcrest |
jz I0F |
cmp [em],$16 ;Merom Conroe |
jz I16 |
cmp [em],$06 ;Cedar Mill/Presler |
jz I06 |
cmp [em],$03 ;Nocona Irwindale / Prescott |
jz I03 |
cmp [em],$04 ;NoconaIrwindale / Prescott |
jz I03 |
cmp [em],$0D ;Dothan |
jz I0D |
cmp [em],$36 ;Cedarview |
jz I36 |
cmp [em],$26 ;Lincroft |
jz I26 |
cmp [em],$1C ;Pineview/Silverthorne |
jz I1C |
mov [cname], no_known |
Inewunknown: |
jmp MMXtest |
I3A: |
mov [micron], 32 |
mov [cname], P3A |
mov esi, P3A |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I2A: |
mov [micron], 32 |
mov [cname], P2A |
mov esi, P2A |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I2D: |
mov [micron], 32 |
mov [cname], P2D |
mov esi, P2D |
mov edi,saveproc + 0x10 |
call concatname |
jmp MMXtest |
I25: |
mov [micron], 32 |
mov [cname], P25 ;P25 |
mov esi, P25 |
mov edi, saveproc + 0x10 ;12 |
call concatname |
jmp MMXtest |
I2C: |
mov [micron], 32 |
mov [cname], P2C |
mov esi, P2C |
mov edi,saveproc + 0x10 |
call concatname |
jmp MMXtest |
I2F: |
mov [micron], 32 |
mov [cname], P2F |
mov esi, P2F |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I1E: |
mov [micron], 32 |
mov [cname], P1E |
mov esi, P1E |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I1A: |
mov [micron], 45 |
mov [cname], P1A |
mov esi, P1A |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I2E: |
mov [micron], 45 |
mov [cname], P2E |
mov esi, P2E |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I17: |
mov [micron], 45 |
mov [cname], P17 |
mov esi, P17 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I1D: |
mov [micron], 45 |
mov [cname], P1D |
mov esi, P1D |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I0F: |
mov [micron], 65 |
mov [cname], P0F |
mov esi, P0F |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I16: |
mov [micron], 65 |
mov [cname], P16 |
mov esi, P16 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I06: |
mov [micron], 32 |
mov [cname], P06 |
mov esi, P06 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I03: |
mov [micron], 32 |
mov [cname], P03 |
mov esi, P03 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I0D: |
mov [micron], 32 |
mov [cname], P0D |
mov esi, P0D |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I36: |
mov [micron], 32 |
mov [cname], P36 |
mov esi, P36 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I26: |
mov [micron], 32 |
mov [cname], P26 |
mov esi, P26 |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
I1C: |
mov [micron], 32 |
mov [cname], P1C |
mov esi, P1C |
mov edi, saveproc + 0x10 |
call concatname |
jmp MMXtest |
;;;;;;;;;;;;;;;;;;; |
sev: ;Family=7 |
.IS0: |
Text 15, 190,0x00000000,cache, cachelen-cache |
mov [micron], 18 |
mov [cname], PS0 |
mov esi, PS0 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
fift: ;Family=15 |
Text 15, 190,0x00000000,cacheP4, cacheP4len-cacheP4 |
cmp [m],$0 |
jz .IF0 |
cmp [m],$1 |
jz .IF1 |
cmp [m],$2 |
jz .IF2 |
cmp [m],$3 |
jz .IF3 |
cmp [m],$4 |
jz .IF3 ;identical to F3xh |
cmp [m],$5 |
jz .IF5 |
cmp [m],$6 |
jz .IF6 |
jmp next_generation |
.IF0: |
mov [micron], 18 |
cmp [L2], 128 |
jne .ppF0 ; Pentium |
mov [cname], PF0c |
mov esi, PF0c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.ppF0: |
mov [cname], PF0 |
mov esi, PF0 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.IF1: |
mov [micron], 18 |
cmp [L2], 128 |
je .IF0;jne.ppF1 ; Pentium |
; mov eax,dword 0x00000004 |
; mov ebx,115*65536+80 |
; mov ecx,dword 0x00000000 |
; mov edx,PF0c |
; mov esi,PF0clen-PF0c |
; mcall |
;jmp MMXtest |
;.ppF1: |
mov [cname], PF0 |
mov esi, PF0 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.IF2: |
mov [micron], 13 |
cmp [L2], 128 |
jne .ppF2 ; Pentium |
mov [cname], PF2c |
mov esi, PF2c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.ppF2: |
mov [cname], PF2 |
mov esi, PF2 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.IF3: |
mov [micron], 09 |
cmp [L2], 256 |
jne .ppF3 ; Pentium |
mov [cname], PF3c |
mov esi, PF3c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.ppF3: |
mov [cname], PF3 |
mov esi, PF3 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.IF5: |
mov [micron], 09 |
cmp [L2], 512 |
jae .ppF5 ; Pentium |
mov [cname], PF5c |
mov esi, PF5c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.ppF5: |
mov [cname], PF5 |
mov esi, PF5 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.IF6: |
mov [micron], 06 ; 065 |
cmp [L2], 512 |
ja .ppF6 ; Pentium |
mov [cname], PF6c |
mov esi, PF6c |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.ppF6: |
mov [cname], PF6 |
mov esi, PF6 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
next_generation: |
mov [cname], NG |
mov esi, NG |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
;---------------------------------- |
Cyrix: |
mov [codeN], 3 |
Text 15, 190,0x00000000,cache, cachelen-cache |
mov esi, cyrix |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
cmp [f], $5 |
jz .fivv |
cmp [f], $6 |
jz .sixx |
.fivv: ;Family=5 |
cmp [m],$2 |
jz .C52 |
cmp [m],$4 |
jz .C54 |
.C52: |
mov [micron], 50 ;35? |
mov [L1i], 8 |
mov [L1d], 8 |
mov [L2], 512 |
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn |
mov esi, Cyrixn |
mov edi, saveproc |
call concatname |
mov [cname], C52 |
mov esi, C52 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.C54: |
mov [micron], 50 |
mov [L1i], 8 |
mov [L1d], 8 |
mov [L2], 512 |
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn |
mov esi, Cyrixn |
mov edi, saveproc |
call concatname |
mov [cname], C54 |
mov esi, C54 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.sixx: ;Family=6 |
cmp [m],$0 |
jz .C60 |
cmp [m],$5 |
jz .C65 |
.C60: |
mov [micron], 25 |
mov [L1i], 32 |
mov [L1d], 32 |
mov [L2], 512 |
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn |
mov esi, Cyrixn |
mov edi, saveproc |
call concatname |
mov [cname], C60 |
mov esi, C60 |
mov edi, saveproc + 0x6 |
call concatname |
jmp MMXtest |
.C65: |
mov [micron], 25 ;35? |
mov [L1i], 32 |
mov [L1d], 32 |
mov [L2], 512 |
Text 75,70,0x00000000,Centaurn, Centaurnlen-Centaurn |
mov esi, Centaurn |
mov edi, saveproc |
call concatname |
mov edx,C65 |
mov esi,C65len-C65 |
jmp OutProcName |
;--------------------- |
Centaur: |
Text 15, 190,0x00000000,cache, cachelen-cache |
;CACHE1: |
mov eax, 80000005h |
cpuid |
shr ecx, 24 |
mov [L1d], ecx |
shr edx, 24 |
mov [L1i], edx |
; cache detection routine |
;CACHE1: |
mov eax, 80000005h |
cpuid |
movzx eax, cl |
mov [lineld], eax |
mov eax, ecx |
shr eax, 16 |
and eax,000000FFh |
mov [wayld], eax |
shr ecx, 24 |
mov [L1d], ecx |
movzx eax, dl |
mov [lineli], eax |
mov eax, edx |
shr eax, 16 |
and eax,000000FFh |
mov [wayli], eax |
shr edx, 24 |
mov [L1i], edx |
;CACHE2: |
mov eax, 80000006h |
cpuid |
cmp [f], $6 |
jz vn |
jmp vl2old ; if not then old identification |
vn: |
cmp [m],$9 |
jl vl2old |
; else new |
movzx eax, cl |
mov dword[linel2], eax |
mov eax, ecx |
shl eax, 16 |
shr eax, 28 |
mov dword[wayl2], eax |
shr ecx, 16 ; it is 16 bits now |
mov [L2],ecx |
vl2old: |
movzx eax, cl |
mov dword[linel2], eax |
mov eax, ecx |
shl eax, 8 |
shr eax, 24 |
mov dword[wayl2], eax |
shr ecx, 24 ; it was 8 bits earlier |
mov [L2],ecx |
cmp [f], $5 |
jz fivC |
cmp [f], $6 |
jz sixC |
fivC: ;Family=5 |
mov esi, idt |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
;PutImage 125,107,201,49,img_area+8 |
; place size |
Text 75,70,0x00000000,IDTn, IDTnlen-IDTn |
mov esi, IDTn |
mov edi, saveproc + 0x4 |
call concatname |
cmp [m],$4 |
jz .V54 |
cmp [m],$8 |
jz .V58 |
cmp [m],$9 |
jz .V59 |
.V54: |
mov [micron], 35 |
mov edx,V54 |
mov esi,V54len-V54 |
jmp OutProcName |
.V58: |
mov [micron], 25 |
mov edx,V58 |
mov esi,V58len-V58 |
jmp OutProcName |
.V59: |
mov [micron], 25 |
mov edx,V59 |
mov esi,V59len-V59 |
jmp OutProcName |
sixC: ;Family=6 |
mov esi, via |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
Text 75,70,0x00000000,Centaurn, Centaurnlen-Centaurn |
mov esi, Centaurn |
mov edi, saveproc |
call concatname |
cmp [m],$6 |
jz .V66 |
cmp [m],$7 |
jz .V67 |
cmp [m],$8 |
jz .V68 |
cmp [m],$9 |
jz .V69 |
cmp [m],$A |
jz .V6A |
.V66: |
mov [micron], 18 ; 25? |
mov edx,V66 |
mov esi,V66len-V66 |
jmp OutProcName |
.V67: |
mov [micron], 15 |
mov edx,V67 |
mov esi,V67len-V67 |
jmp OutProcName |
.V68: |
mov [micron], 13 |
mov edx,V68 |
mov esi,V68len-V68 |
jmp OutProcName |
.V69: |
mov [micron], 13 |
mov edx,V69 |
mov esi,V69len-V69 |
jmp OutProcName |
.V6A: |
mov [micron], 9 |
mov edx,VA |
mov esi,VAlen-VA |
jmp OutProcName |
;----------- |
Transmeta: |
Text 15, 190,0x00000000,cache, cachelen-cache |
Text 75,70,,Tranmsmetan, Tranmsmetanlen-Tranmsmetan |
mov esi, Tranmsmetan |
mov edi, saveproc |
call concatname |
mov esi, transmeta |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
; cache detection routine - it is the same as for AMD (almost) |
;CACHE1: |
mov eax, 80000005h |
cpuid |
movzx eax, cl |
mov [lineld], eax |
mov eax, ecx |
shr eax,16 |
and eax,000000FFh |
mov [wayld], eax |
shr ecx, 24 |
mov [L1d], ecx |
movzx eax, dl |
mov [lineli], eax |
mov eax, edx |
shr eax, 16 |
and eax,000000FFh |
mov [wayli], eax |
shr edx, 24 |
mov [L1i], edx |
;CACHE2: |
mov eax, 80000006h |
cpuid |
movzx eax, cl |
mov dword[linel2], eax |
mov eax, ecx |
shl eax, 16 |
shr eax, 28 |
mov dword[wayl2], eax |
shr ecx, 16 |
mov [L2],ecx |
cmp [f], $5 |
jz .fivt |
cmp [f], $F |
jz .fift |
.fivt: ; Family=5 |
mov edx,T5 |
mov esi,T5len-T5 |
jmp @f |
.fift: ; Family=F |
mov edx,TF |
mov esi,TFlen-TF |
@@: |
mov [micron], 13 ; |
Text 140,70,0 |
jmp MMXtest |
OutProcName: |
Text 100,70,0 |
;---- |
;---------------------------------- new |
Vortex: |
Text 15, 190,0x00000000,cache, cachelen-cache |
mov esi, vortex |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
;PutImage 130,127,201,49,img_area+8 |
; place size |
cmp [f], $5 |
jz .V54 ;fivvtx |
;.fivvtx: ;Family=5 |
; cmp [m],$4 |
; jz .V54 |
.V54: |
mov [micron], 13 |
mov [L1i], 16 |
mov [L1d], 16 |
mov [L2], 256 |
mov [wayl2], 4 |
mov [wayli], 4 |
mov [wayld], 4 |
Text 75,70,0x00000000,Vortexn, Vortexnlen-Vortexn |
mov esi, Vortexn |
mov edi, saveproc |
call concatname |
jmp MMXtest |
;--------------------- |
MMXtest: ; MMX test and Brand ID decoding |
call decodebrand ; get Brand ID |
call decode_standard_features |
call decode_extended_features |
xor eax,eax |
inc eax |
cpuid |
HTTtest: |
test edx, $10000000; ;Test bit 28 |
jz .ELN |
.EL: ;HTT technology is supported |
and ebx,00FF0000h ; numbers of logical processors |
cmp ebx, 1 shl 16 |
; mov [number_of_log_cpus], ebx |
je .ELN ; HHT not enabled (Celeron) |
mov dword [HTTn+9], $736579 |
mov dword [HTT+ 6], $736579 |
jmp TEXTOUT |
.ELN: |
mov dword [HTTn+ 9], $6F6E |
mov dword [HTT+ 6], $6F6E |
TEXTOUT: |
Text 275,290,0x00000000,HTT, HTTlen-HTT |
Text 275,310,,sse3, sse3len-sse3 |
Text 15,290,,MMXs, MMXslen-MMXs |
Text 15,310,,SSE, SSElen-SSE |
Text 95,310,,SSE2, SSE2len-SSE2 |
;------------------- |
TEST3DNOW: |
xor edx, edx |
cmp [smallvendor], 'ntel' |
; je @f ;recent change |
jne .t |
.t: |
mov eax, $80000001 ;// Setup extended function 8000_0001h |
cpuid |
test edx, $80000000 ;// Test bit 31 |
jnz .XIT |
.NOEXTENDED: ;// 3DNow! technology is supported |
mov dword [now+ 9], $6F6E |
jmp TEST3DNOWP |
.XIT: |
mov dword [now+ 9], $736579 |
jmp TEST3DNOWP |
TEST3DNOWP: |
cmp [smallvendor], 'ntel' |
je .NOEXTENDEDP |
.tp: |
mov eax, $80000001 ;// Setup extended function 8000_0001h |
cpuid |
test edx, $40000000 ;// Test bit 30 |
jnz .XITP ;// 3DNow! technology is supported |
.NOEXTENDEDP: |
mov dword [nowp+ 9], $6F6E |
jmp TESTMMXP |
.XITP: |
mov dword [nowp+ 9], $736579 |
jmp TESTMMXP |
TESTMMXP: |
mov eax,$80000000 |
cpuid |
test eax, 80000000h |
jna NOEXTENDEDM |
;cmp eax, $80000000 ;// Is 800_0001h supported? |
;jz .NOEXTENDEDM ;// If not, 3DNow! technology is not supported |
mov eax, $80000001 ;// Setup extended function 8000_0001h |
cpuid |
cmp [smallvendor], 'tead' |
jne noCyr |
Cyrmx: |
test edx, $01000000 ;// Test bit 24 |
jnz XITM ;// 3DNow! technology is supported |
jz NOEXTENDEDM |
noCyr: |
test edx, $00400000 ;// Test bit 22 |
jnz XITM ;// 3DNow! technology is supported |
;jz .NOEXTENDEDM |
NOEXTENDEDM: |
mov dword [mmxp+ 7], $6F6E |
mov dword [MMXPi+ 8], $6F6E |
jmp text3d |
XITM: |
mov dword [mmxp+ 7], $736579 |
mov dword [MMXPi+ 8], $736579 |
text3d: |
Text 15,330,0x00000000,now, nowlen-now |
Text 95,330,,nowp, nowplen-nowp |
Text 95,290,,mmxp, mmxplen-mmxp |
Text 110,70,0x80000000,dword[cname] |
jmp still |
;-------------------------- |
NO_CPUID: |
mov [nocpuid], 1 |
Text 15,50,0x00000000,oblom, oblomlen-oblom |
FREEZE: |
nop |
jmp FREEZE ; maybe we should close application or just made some Warning and jump to still: |
;---------------- |
still: |
; waiting for events |
event_wait: |
mov eax,23 ; function 23 - event wait |
mov ebx,50 ; wait for 0.5 second |
mcall |
cmp eax,1 ; |
je red ; redraw |
cmp eax,2 ; |
je key ; key |
cmp eax,3 ; |
je button ; button |
jmp still ; |
key: ; |
mcall ; |
jmp still ; |
button: ; |
mov eax,17 ; |
mcall ; |
cmp ah,1 ; = 1 ? |
je close ; close |
cmp ah,2 ; = 2 ? |
je thread_start ; |
cmp ah, 3 |
je call_OpenDialog |
mov eax,11 ; function 23 - event wait |
mov ebx,1 |
mcall |
mov eax,15 ; function 23 - event wait |
mov ebx,3 |
mcall |
; cmp ah,3 ; = 3 ? |
jne still |
close: |
mov eax,-1 |
mcall |
;**************************** THREAD-SECOND WINDOW |
thread_start: |
cmp [num_win2],0 |
jne still |
;================================================RSA test |
;test rsa coding speed |
call init_test |
;length of module - 256 bit |
mov eax,26 |
mov ebx,9 |
mcall |
add eax,100 ;test lasts 1 second. |
push eax |
.loop: |
push 4 ;do 4 iterations - this reduces number of calls mcall. |
.loop1: |
call rsa_test ;this procedure change all registers |
dec dword [esp] |
jnz .loop1 |
pop ecx |
mov eax,26 |
mov ebx,9 |
mcall |
cmp eax,dword [esp] ;Is time changed? |
jl .loop |
pop eax |
shr dword [iter],4 ;[iter] - speed in Kb/sec. (every iteration codes 64 bytes) |
CreateTread window_2,thread2_esp |
jmp still |
window_2: |
mov [num_win2],1 |
call draw_window_2 |
still_2: |
mov eax,10 |
mcall |
cmp eax,1 |
je window_2 ; window_2 |
cmp eax,2 ; |
je key_2 ; key_2 |
cmp eax,3 ; |
je button_2 ; button_2 |
jmp still_2 ; |
key_2: ; |
mcall ; |
jmp still_2 ; |
button_2: ; |
mov eax,17 ; 17 |
mcall ; |
cmp ah,1 ; = 1 ? |
jne still_2 ; noclose |
mov [num_win2],0 ; |
or eax,-1 ; |
mcall |
draw_window_2: |
;call prepare_text_area |
mov eax,12 ; function 12:tell os about windowdraw |
mov ebx,1h ; 1, start of draw |
mcall |
Window 250,250,420,520, 0x33FFFFFF, 0x805080d0, standard ;460 |
; place size |
Text 15, 10,0x00000000, STDCA, STDCAlen-STDCA |
Text 215, 10,, EXTCA, EXTCAlen-EXTCA |
Text 15, 30,0x00000000, FPU, FPUlen-FPU |
Text 115, 30,, VME, VMElen-VME |
Text 215, 30,, DE, DElen-DE |
Text 315, 30,, PSE, PSElen-PSE |
Text 15, 50,,TSC, TSClen-TSC |
Text 115,50,,MSR, MSRlen-MSR |
Text 215,50,,PAE, PAElen-PAE |
Text 315,50,,MCE, MCElen-MCE |
Text 15,70,,CX8, CX8len-CX8 |
Text 115,70,,APIC, APIClen-APIC |
Text 215,70,,Res, Reslen-Res |
Text 315,70,,SEP, SEPlen-SEP |
Text 15,90,,MTRR, MTRRlen-MTRR |
Text 115,90,,PGE, PGElen-PGE |
Text 215,90,,MCA, MCAlen-MCA |
Text 315,90,,CMOV, CMOVlen-CMOV |
Text 15,110,,PAT, PATlen-PAT |
Text 115,110,,PSE36, PSE36len-PSE36 |
Text 215,110,,PSNUM, PSNUMlen-PSNUM |
Text 315,110,,CLFLUSHn, CLFLUSHnlen-CLFLUSHn |
Text 15,130,,Res, Reslen-Res |
Text 115,130,,DTS, DTSlen-DTS |
Text 215,130,,ACPI, ACPIlen-ACPI |
Text 315,130,,MMX, MMXlen-MMX |
Text 15,150,,FXSR, FXSRlen-FXSR |
Text 115,150,,SSE, SSElen-SSE |
Text 215,150,,SSE2, SSE2len-SSE2 |
Text 315,150,,SSn, SSnlen-SSn |
Text 15,170,,HTT, HTTnlen-HTTn |
Text 115,170,,TM, TMlen-TM |
Text 215,170,,IA64, IA64len-IA64 |
Text 315,170,,PBE, PBElen-PBE |
;--------------- |
DrawLine 0, 410, 185,185,0x8080FF ;10 |
mov eax,$80000000 |
cpuid |
;mov eax, $03020101 \A0for test of reaction |
test eax, eax |
js goooddd |
baaadd: |
Text 95,235,0x00000000,NEF, NEFlen-NEF |
jmp too |
goooddd: |
Text 15,195,0x00000000,SS3, SS3len-SS3 |
Text 15,215,,MON, MONlen-MON |
Text 15,235,,DS_CPL, DS_CPLlen-DS_CPL |
Text 15,255,,EST, ESTlen-EST |
Text 15,275,,TM2, TM2len-TM2 |
Text 15,295,,VMX, VMXlen-VMX |
Text 15,315,,SVM, SVMlen-SVM |
Text 15,355,0x00000000,SMX, SMXlen-SMX |
Text 15,335,0x00000000,PAGE, PAGElen-PAGE |
Text 15,375,0x00000000,MIS, MISlen-MIS |
Text 115,355,0x00000000,WDT, WDTlen-WDT |
Text 115,195,,CNXT_ID, CNXT_IDlen-CNXT_ID |
Text 115,215,,CX16, CX16len-CX16 |
Text 115,235,,ETPRD, ETPRDlen-ETPRD |
Text 115,255,,SYS, SYSlen-SYS |
Text 115,275,,LAF, LAFlen-LAF |
Text 115,295,,SSSE3, SSSE3len-SSSE3 |
Text 115,315,,MCR8, MCR8len-MCR8 |
Text 115,335,0x00000000,EAS, EASlen-EAS |
Text 115,375,0x00000000,DNP, DNPlen-DNP |
Text 315,375,0x00000000,SSE5, SSE5len-SSE5 |
Text 215,195,,MP, MPlen-MP |
Text 215,215,,NX, NXlen-NX |
Text 215,235,,MMXPi, MMXPilen-MMXPi |
Text 215,255,,MMXn, MMXnlen-MMXn |
Text 215,275,,FXSRn, FXSRnlen-FXSRn |
Text 215,295,,DCA,DCAlen-DCA |
Text 315,295,0x00000000,SSE41,SSE41len-SSE41 |
Text 215,335,0x00000000,x2APIC,x2APIClen-x2APIC |
Text 215,355,0x00000000,ABM,ABMlen-ABM |
Text 215,375,0x00000000,OSVW,OSVWlen-OSVW |
Text 315,195,,FFXSR, FFXSRlen-FFXSR |
Text 315,215,,TSCP, TSCPlen-TSCP |
Text 315,235,,LM, LMlen-LM |
Text 315,255,,DNo, DNolen-DNo |
Text 315,275,,DN, DNlen-DN |
Text 215,315,,CMPL, CMPLlen-CMPL |
Text 315,315,0x00000000,SS42,SS42len-SS42 |
Text 315,335,0x00000000,PPCNT,PPCNTlen-PPCNT |
Text 315,295,0x00000000,SSE4A,SSE4Alen-SSE4A |
Text 315,355,0x00000000,SKINIT_,SKINIT_len-SKINIT_ |
too: |
DrawLine 10, 400, 430,430,0x8080FF ;10 |
Text 15,415,0x00000000,speed, speedlen-speed |
Text 130,415,,kbpersec, kbperseclen-kbpersec |
DrawLine 10, 80, 400, 400, 0x8080FF |
Text 90,400,0x80000000,performancestr, 0 |
DrawLine 322, 400, 400, 400, 0x8080FF |
DrawLine 10, 10, 400, 490, 0x8080FF |
DrawLine 400, 400, 400, 490, 0x8080FF |
DrawLine 10, 400, 490, 490, 0x8080FF |
; your proc |
Text 20,415,0x808080FF,currentcpu, 0 |
Number 170,415,0,5,dword [iter],0x000000 ; + 15 |
;Text 115,370,,kbpersec, kbperseclen-kbpersec ;+ 355 |
mov eax, dword[iter] |
;mov ebx, 100 |
;mul ebx |
add eax, 215 |
mov word[linelen], ax ; need to store it as drawline corrupts eax |
DrawLine 215, [linelen], 416,416,0x8080FF ;10 + 355 , 357 |
DrawLine 215, [linelen], 417,417,0x8080FF ;10 |
DrawLine 215, [linelen], 418,418,0x8080FF ;10 |
;;; DrawLine 20, 390, 371,371,0x8080FF ;10 |
; sample proc 1 |
Text 20,435,0x80000000,samplename1,0 ; 10 + 40 + 40 +40 + 380 |
Number 170,435,0,5,dword [samplespeed1],0x000000; ; 25 + 40 + 40 +40 + 380 |
;Text 115,470,0,kbpersec, kbperseclen-kbpersec ; 25 + 40 + 40 +40 + 380 |
mov eax, dword[samplespeed1] |
add eax, 215 |
mov dword[linelen], eax ; need to store it as drawline corrupts eax |
DrawLine 215, [linelen], 436,436,0x8080FF ;27+40 + 40 +40 + 380 |
DrawLine 215, [linelen], 437,437,0x8080FF ;10 |
DrawLine 215, [linelen], 438,438,0x8080FF ;10 |
; sample proc 2 |
Text 20,455,0x80000000,samplename2,0 ; 10 + 40 + 350 |
Number 170,455,0,5,dword [samplespeed2],0x000000; ; 25 + 40 + 350 |
;Text 115,410,0,kbpersec, kbperseclen-kbpersec ; 25 + 40 + 350 |
mov eax, dword[samplespeed2] |
add eax, 215 |
mov dword[linelen], eax ; need to store it as drawline corrupts eax |
DrawLine 215, [linelen], 456,456,0x8080FF ;27+40 + 355 |
DrawLine 215, [linelen], 457,457,0x8080FF ;10 |
DrawLine 215, [linelen], 458,458,0x8080FF ;10 |
; sample proc 3 |
Text 20,475,0x80000000,samplename3,0 ; 10 + 40 + 40 + 38 |
Number 170,475,0,5,dword [samplespeed3],0x000000; ; 25 + 40 + 40 + 355 |
;Text 115,440,0,kbpersec, kbperseclen-kbpersec ; 25 + 40 + 40 + 380 |
mov eax, dword[samplespeed3] |
add eax, 215 |
mov dword[linelen], eax ; need to store it as drawline corrupts eax |
DrawLine 215, [linelen], 476,476,0x8080FF ;27+40 + 40 |
DrawLine 215, [linelen], 477,477,0x8080FF ;10 |
DrawLine 215, [linelen], 478,478,0x8080FF ;10 |
mov eax,12 |
mov ebx,2h |
mcall |
ret |
linelen dd 0 |
currentcpu db 'Current CPU',0 |
samplename1 db 'Intel Core i5 CPU', 0x000000 ; not real results! |
samplespeed1 dd 62 |
samplename2 db 'Intel Core i3 CPU', 0 |
samplespeed2 dd 48 |
samplename3 db 'Intel Pentium Dual CPU', 0 |
samplespeed3 dd 35 |
performancestr db 'PERFORMANCE (KB/S in RSA test 256 bit)',0 |
ptsstring db '' |
num_win2 db 0 |
draw_window: |
mcall SF_REDRAW, SSF_BEGIN_DRAW |
Window 150, 150, 350, 405, 0x34FFFFFF, 0x805080d0, title |
mov esi, [sc.work_button] |
DefineButton 138, 345, 92, 24, 2, |
DefineButton 238, 345, 92, 24, 3, |
mov ecx, [sc.work_button_text] |
or ecx, 0x90000000 |
mov edx, btn_more_cap |
mcall SF_DRAW_TEXT, (138 + (92 - 7 * 8) / 2) shl 16 + 350 |
mov edx, btn_save_cap |
mcall SF_DRAW_TEXT, (238 + (92 - 4 * 8) / 2) shl 16 + 350 |
Text 130,270,0x00000000,instruct, instructlen-instruct |
DrawLine 10, 330, 340,340,0x8080FF |
DrawLine 330, 330, 275,340;,0x8080FF |
DrawLine 10, 10, 275,340;,0x8080FF |
DrawLine 10, 125, 275,275;,0x8080FF |
DrawLine 230, 330, 275,275;,0x8080FF |
cmp dword[smallvendor], 'cAMD' |
jne cont |
cmp [f], $6 |
jne cont |
; Button 240,85,69,15,3,0x030000FF ; button for rating |
; Text 245,90,0x00FFFFFF,FR, FRlen-FR ; text at button |
call newrating; !!!! |
cont: |
;Number 82,50,0,4,dword [total],0x000000; MHz |
mov esi, total |
mov edi, tsum + 0xB ;0xA |
call savenumber |
;Number 110,50,0,2,dword [sot]; KHz |
mov esi, sot |
mov edi, tsum + 0x10 |
call savenumber |
;Number 75,110,1*256,1,dword [f],0x000000 ; |
mov esi, f |
mov edi, fam + 0x8 ;0x9 |
call savenumber |
;Number 75,130,,,dword [m] |
mov esi, m |
mov edi, mode + 0x7 |
call savenumber |
;Number 75,150,,,dword [s] |
mov esi, s |
mov edi, step + 0xa ;0x9 |
call savenumber |
;Number 110,110,1*256,2,dword [ef] |
mov esi, ef |
mov edi, fam + 0xE ;0x9 |
call savenumber |
;Number 110,130,,,dword [em] |
mov esi, em |
mov edi, mode + 0xE ;0xD |
call savenumber |
mov esi, multb |
mov edi, multil + 0xB |
call savenumber |
;Number 105,30,0,1,dword [multa] |
mov esi, multa |
mov edi, multil + 0xf |
call savenumber |
;Number 140,170,0,2,dword [wayld],0x000000 |
mov esi, wayld |
mov edi, cache2 + 0x14 ;0x14 |
call savenumber |
;Number 218,170,,,dword [lineld] |
mov esi, lineld |
mov edi, cache2 + 0x21 |
call savenumber |
;Number 140,190,,,dword [wayli] |
mov esi, wayli |
mov edi, cache + 0x14 |
call savenumber |
;Number 218,190,,,dword [lineli] |
mov esi, lineli |
mov edi, cache + 0x21 |
call savenumber |
;Number 140,210,,,dword [wayl2] |
mov esi, wayl2 |
mov edi, cache3 + 0x14 |
call savenumber |
;Number 218,210,,,dword [linel2] |
mov esi, linel2 |
mov edi, cache3 + 0x21 |
call savenumber |
;Number 140,230,,,dword [wayl3] |
mov esi, wayl3 |
mov edi, cache4 + 0x14 |
call savenumber |
;Number 218,230,,,dword [linel3] |
mov esi, linel3 |
mov edi, cache4 + 0x21 |
call savenumber |
mov esi, L1d |
mov edi, cache2 + 0xa |
call savenumber |
;Number 75,190,,,dword [ L1i] |
mov esi, L1i |
mov edi, cache + 0xa |
call savenumber |
;Number 41,210,0,4,dword[L2] |
mov esi, L2 |
mov edi, cache3 + 0x4 ;0x3 |
call savenumber |
;Number 35,230,0,5,dword[L3] |
mov esi, L3 |
mov edi, cache4 + 0x4 ;0x3 |
call savenumber |
;-----------Features |
;Number 258,50,0,2,dword [micron] ; micron |
mov esi, micron |
mov edi, tech + 0xE |
call savenumber |
mov esi, stdc |
mov edi, STDCA + 0x14 |
call savenumber |
;Number 335,10,,,dword [extc], |
mov esi, extc |
mov edi, EXTCA + 0x14 |
call savenumber |
Text 15,90,,cpuname, cpunamelen-cpuname; |
Text 255,250,,typen, typenlen-typen |
Text 175, 50,,tech, techlen-tech; |
red2: |
;;;;;;;;;;;;;;;;;;;;;;;; |
goon: |
call decodebrand |
typedetect: |
mov edx, t1 |
cmp [t], 00b |
jz @f |
mov edx, t2 |
cmp [t], 01b |
jz @f |
mov edx, t3 |
cmp [t], 11b |
jz @f |
mov edx, t4 |
@@: |
mov ebx, 290*65536 + 250 |
mov ecx, 0x80000000 |
mcall 4 |
Text 15,250,,brandid, brandidlen-brandid |
Text 15,50,0x00000000,tsum, tsumlen-tsum |
Text 15,110,0x00000000,fam, famlen-fam |
Text 15,130,0x00000000,mode, modelen-mode |
Text 15,150,0x00000000,step, steplen-step |
Text 275,290,0x00000000,HTT, HTTlen-HTT |
Text 275,310,,sse3, sse3len-sse3 |
Text 175,290,0x00000000,SSE41, SSE41len-SSE41 |
Text 175,310,0x00000000,SSE42, SSE42len-SSE42 |
Text 175,330,0x00000000,SSE5, SSE5len-SSE5 |
Text 15,70,,name, namelen-name |
Text 15,290,,MMXs, MMXslen-MMXs |
Text 15,310,,SSE, SSElen-SSE |
Text 95,310,,SSE2, SSE2len-SSE2 |
Text 95,290,,mmxp, mmxplen-mmxp |
Text 15,330,0x00000000,now, nowlen-now |
Text 95,330,,nowp, nowplen-nowp |
Text 15, 190,0x00000000,cache, cachelen-cache |
Text 15,170,0x00000000,cache2, cache2len-cache2 |
Text 15,210,,cache3, cache3len-cache3 |
Text 15,230,,cache4, cache4len-cache4 |
call load_gif |
cmp [nomultiplier], $1 |
je nomultip |
Text 15,30,0x00000000,multil2, multil2len-multil2 |
Text 175,30,0x00000000,freql2, freql2len-freql2 |
Number 85,30,0,2,dword [multb],0x000000; |
Number 105,30,0,1,dword [multa] |
Number 259,30,0,4,dword [freqbb] |
Number 289,30,0,2,dword [freqll] |
JumpForCodename: |
cmp [codeN], $1 |
je codeNIntel |
cmp [codeN], $2 |
je codeNAMD |
cmp [codeN], $3 |
je codeNCyrix |
cmp [codeN], $4 |
je codeNCentaur |
cmp [codeN],$5 |
je codeNTransmeta |
cmp [codeN], $6 |
je codeNVortex |
jmp nnn |
codeNIntel: |
Text 75,70,0x00000000,Inteln, Intelnlen-Inteln |
mov esi, intel |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
codeNAMD: |
Text 75,70,,AMDn, AMDnlen-AMDn |
mov esi, amd |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
codeNCyrix: |
Text 75,70,0x00000000,Cyrixn, Cyrixnlen-Cyrixn |
mov esi, cyrix |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
codeNCentaur: |
Text 75,70,0x00000000,IDTn, IDTnlen-IDTn |
mov esi, idt |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
codeNTransmeta: |
Text 75,70,,Tranmsmetan, Tranmsmetanlen-Tranmsmetan |
mov esi, transmeta |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
codeNVortex: |
Text 75,70,0x00000000,Vortexn, Vortexnlen-Vortexn |
mov esi, vortex |
call load_gif |
PutImage 135,107,201,49,img_area+8 |
jmp nnn |
nomultip: |
Text 15,30,0x00000000,multi3, multi3len-multi3 |
Text 175,30,0x00000000,freql3, freql3len-freql3 |
Text 259,30,0x00000000, clock0, clock0len-clock0 |
jmp JumpForCodename |
nnn: |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Text 15,10,0x00000000,stm, stmlen-stm |
; Fix for deleting leading whitespaces |
; in Intel P4's internal name |
; by Madis Calme |
; 23.12.2004 ver. 0.81 |
cld |
mov edi,myname |
mov al,20h |
or ecx,-1 |
repe scasb |
dec edi |
mov esi,mynamelen |
sub esi,edi |
Text 105, 10, 0x00000000, edi, esi |
;- |
Text 15,250,,brandid, brandidlen-brandid |
mcall SF_REDRAW, SSF_END_DRAW |
ret ; |
call_OpenDialog: |
mov [OpenDialog_data.type],1 ; Save |
push dword OpenDialog_data |
call [OpenDialog_Start] |
cmp [OpenDialog_data.status],2 ; OpenDialog does not start |
je .save_file_default_path |
cmp [OpenDialog_data.status],1 |
jne still |
call store_data |
jmp still |
.save_file_default_path: |
mov edi,file_name |
mov esi,file_default_path |
call copy_file_name_path |
call store_data |
jmp still |
copy_file_name_path: |
xor eax,eax |
cld |
@@: |
lodsb |
stosb |
test eax,eax |
jnz @r |
ret |
;----------------------------------------------------------------------------- |
prepare_text_area: |
mov edi,[store_text_area_start] |
push edi |
mov ecx,4096 |
mov eax,dword ' ' |
cld |
rep stosd |
pop edi |
mov [store_text_area_end], edi |
mov esi,title |
call addstring |
mov esi, stm |
call addstring |
mov esi, myname |
call addstring |
cmp [nomultiplier], $1 |
je noMult |
jne detMulti |
;jne detFreq |
detMulti: |
mov esi,multil |
call addstring |
jmp detFreq |
detFreq: |
mov esi, freql |
call addstring |
noMult: |
mov esi,multi3 |
call addstring |
mov esi,freql3 |
call addstring |
mov esi, tech |
call addstring |
mov esi, saveproc |
call addstring |
mov esi, cpuname |
call addstring |
mov esi, fam |
call addstring |
mov esi, mode |
call addstring |
mov esi, step |
call addstring |
mov esi, cache2 |
call addstring |
mov esi, cache |
call addstring |
mov esi, cache3 |
call addstring |
mov esi, cache4 |
call addstring |
mov esi, brandid |
call addstring |
mov esi, MMXs |
call addstring |
mov esi, mmxp |
call addstring |
mov esi, now |
call addstring |
mov esi, HTT |
call addstring |
mov esi, SSE |
call addstring |
mov esi, SSE41 |
call addstring |
mov esi, SSE42 |
call addstring |
mov esi, SSE5 |
call addstring |
mov esi, SSE2 |
call addstring |
mov esi, nowp |
call addstring |
mov esi, sse3 |
call addstring |
mov esi, standard |
call addstring |
mov esi, STDCA |
call addstring |
mov esi, EXTCA |
call addstring |
mov esi, FPU |
call addstring |
mov esi, VME |
call addstring |
mov esi, DE |
call addstring |
mov esi, PSE |
call addstring |
mov esi, TSC |
call addstring |
mov esi, MSR |
call addstring |
mov esi, PAE |
call addstring |
mov esi, MCE |
call addstring |
mov esi, CX8 |
call addstring |
mov esi, APIC |
call addstring |
mov esi, Res |
call addstring |
mov esi, SEP |
call addstring |
mov esi, MTRR |
call addstring |
mov esi, PGE |
call addstring |
mov esi, MCA |
call addstring |
mov esi, CMOV |
call addstring |
mov esi, PAT |
call addstring |
mov esi, PSE36 |
call addstring |
mov esi, PSNUM |
call addstring |
mov esi, CLFLUSHn |
call addstring |
mov esi, Res |
call addstring |
mov esi, DTS |
call addstring |
mov esi, ACPI |
call addstring |
mov esi, MMX |
call addstring |
mov esi, FXSR |
call addstring |
mov esi, SSE |
call addstring |
mov esi, SSn |
call addstring |
mov esi, HTT |
call addstring |
mov esi, TM |
call addstring |
mov esi, IA64 |
call addstring |
mov esi, PBE |
call addstring |
mov esi, SS3 |
call addstring |
mov esi, CNXT_ID |
call addstring |
mov esi, MP |
call addstring |
mov esi, FFXSR |
call addstring |
mov esi, MON |
call addstring |
mov esi, CX16 |
call addstring |
mov esi, NX |
call addstring |
mov esi, TSCP |
call addstring |
mov esi, DS_CPL |
call addstring |
mov esi, ETPRD |
call addstring |
mov esi, MMXPi |
call addstring |
mov esi, LM |
call addstring |
mov esi, EST |
call addstring |
mov esi, SYS |
call addstring |
mov esi, MMXn |
call addstring |
mov esi, DNo |
call addstring |
mov esi, TM2 |
call addstring |
mov esi, LAF |
call addstring |
mov esi, FFXSR |
call addstring |
mov esi, DN |
call addstring |
mov esi, VMX |
call addstring |
mov esi, SSSE3 |
call addstring |
mov esi, DCA |
call addstring |
mov esi, CMPL |
call addstring |
mov esi, SVM |
call addstring |
mov esi, MCR8 |
call addstring |
mov esi, SMX |
call addstring |
mov esi, x2APIC |
call addstring |
mov esi, PPCNT |
call addstring |
mov esi, PAGE |
call addstring |
mov esi, EAS |
call addstring |
mov esi, ABM |
call addstring |
mov esi, MIS |
call addstring |
mov esi,OSVW |
call addstring |
mov esi,SKINIT_ |
call addstring |
mov esi, WDT |
call addstring |
ret |
addstring: |
mov edi, [store_text_area_end] |
xor eax, eax |
xor ecx, ecx |
cld |
@@: |
lodsb |
stosb |
inc [store_text_area_end] |
cmp [esi], byte 0x0 |
jnz @r |
mov al,0Ah |
stosb |
mov [store_text_area_end],edi |
xor edi,edi |
xor esi, esi |
ret |
savenumber: |
xor eax, eax |
cld |
lodsw |
call numbertostring |
xor esi, esi |
xor edi, edi |
ret |
savestring: |
xor eax, eax |
cld |
lodsw |
;call numbertostring |
xor esi, esi |
xor edi, edi |
ret |
numbertostring: |
mov bx, 10 |
xor ecx, ecx |
@@m1: |
xor dx, dx |
div bx |
push dx |
inc cx |
test ax, ax |
jnz @@m1 |
@@m2: |
pop ax |
add al, '0' |
stosb |
loop @@m2 |
ret |
concatname: |
;mov edi, [saveproc] |
xor eax, eax |
xor ecx, ecx |
cld |
@@: |
lodsb |
stosb |
cmp [esi], byte 0x0 |
jnz @r |
xor edi,edi |
xor esi, esi |
ret |
store_data: |
call prepare_text_area |
mov eax,[store_text_area_start] |
mov [fileinfo.return],eax |
mov ebx,[store_text_area_end] |
sub ebx,eax |
inc ebx |
mov [fileinfo.size],ebx |
mcall 70,fileinfo |
ret |
load_gif: |
mov edi, img_area |
jmp ReadGIF |
; DATA AREA |
title db 'CPUID 2.31',0 |
stm: |
db 'Internal name:', 0 |
stmlen: |
SS42: |
db 'SSE4.2: ',0 |
SS42len: |
SMX: |
db 'SMX: ',0 |
SMXlen: |
x2APIC: |
db 'x2APIC: ' |
x2APIClen: |
PPCNT: |
db 'POPCNT: ' |
PPCNTlen: |
PAGE: |
db 'Page1Gb: ' |
PAGElen: |
EAS: |
db 'EAS: ',0 |
EASlen: |
newLabel: |
db '3DNP: ',0 |
newLabellen: |
ABM: |
db 'ABM: ' |
ABMlen: |
SSE4A: |
db 'SSE4A: ' |
SSE4Alen: |
MIS: |
db 'MIS: ',0 |
MISlen: |
DNP: |
db '3DNP: ' |
DNPlen: |
OSVW: |
db 'OSVW: ',0 |
OSVWlen: |
SKINIT_: |
db 'SKINIT: ',0 |
SKINIT_len: |
WDT: |
db 'WDT: ',0 |
WDTlen: |
saveproc: |
db ' ',0 |
multil: |
db 'Multiplier: . ', 0 |
multillen: |
multil2: |
db 'Multiplier: . ' |
multil2len: |
multi3: |
db 'Multiplier: n/a',0 |
multi3len: |
freql: |
db 'System clock: . MHz', 0 |
freqllen: |
freql2: |
db 'System clock: . MHz' |
freql2len: |
freql3: |
db 'System clock: n/a ' |
freql3len: |
tsum: |
db 'Frequency: . MHz ',0 |
tsumlen: |
tech: |
db 'Technology: 0. micron ', 0 |
techlen: |
name: |
if lang eq it |
db 'Codename:',0 |
else |
db 'CODENAME:',0 |
end if |
namelen: |
vendorname: |
if lang eq it |
db 'Vendor CPU ', 0 |
else |
db 'CPU VENDOR: ', 0 |
end if |
vendornamelen: |
cpuname: |
if lang eq it |
db 'Vendor CPU ', 0 |
else |
db 'CPU VENDOR: ', 0 |
end if |
cpunamelen: |
fam: |
if lang eq it |
db 'Famiglia: std ext', 0 |
else |
db 'FAMILY: std ext', 0 |
end if |
famlen: |
mode: |
if lang eq it |
db 'Modello: std ext', 0 |
else |
db 'MODEL: std ext', 0 |
end if |
modelen: |
step: |
if lang eq it |
db 'Stepping: ', 0 |
else |
db 'STEPPING: ', 0 |
end if |
steplen: |
cache: |
db 'L1(inst): KB -way set -byte line size',0 |
cachelen: |
cache2: |
db 'L1(data): KB -way set -byte line size',0 |
cache2len: |
cache3: |
db 'L2: KB -way set -byte line size',0 |
cache3len: |
cache4: |
db 'L3: KB -way set -byte line size',0 |
cache4len: |
brandid: |
db 'Brand:', 0 |
brandidlen: |
MMXs: |
db 'MMX: ',0 |
MMXslen: |
total dd 0x0 |
total1 dd 0x0 |
rating dd 0x0 |
rat dd 0x0 ; |
NEF: |
db 'EXTENDED FEATURES ARE NOT AVAILABLE',0 |
NEFlen: |
mb : |
db 'MB' |
mblen: |
logcpus : |
db 'Number of logical CPU:' |
logcpuslen: |
speed : |
if lang eq it |
; db 'Performance',0 |
else |
; db 'PERFORMANCE:',0 |
end if |
speedlen: |
kbpersec: |
db 'KB/SEC' |
kbperseclen: |
instruct: |
if lang eq it |
db 'Set istruzioni' |
else |
db 'Instruction sets' |
end if |
instructlen: |
standard db 'Standard and Extended features plus Performance test',0 |
STDCA: |
db 'Highest STD call is ',0 |
STDCAlen: |
EXTCA: |
db 'Highest EXT call is h',0 |
EXTCAlen: |
oblom: |
if lang eq it |
db 'CPUID non e disponibile' |
else |
db 'SORRY, CPUID IS NOT AVAILABLE' |
end if |
oblomlen: |
other: |
if lang eq it |
db 'Questo vendor non e supportato' |
else |
db 'SORRY, THIS VENDOR IS NOT SUPPORTED YET' |
end if |
otherlen: |
cacheP4: |
db 'L1(inst): Kuops -way set -byte line size' |
cacheP4len: |
typen: |
if lang eq it |
db 'Tipo:' |
else |
db 'Type:' |
end if |
typenlen: |
pr: |
db 'P-rating:' |
prlen: |
AMDn: |
db 'AMD',0 |
AMDnlen: |
AMDnNew: |
db 'CODENAME: AMD',0 |
AMDnNewlen: |
Inteln: |
db 'Intel',0 |
Intelnlen: |
IntelnNew: |
db 'CODENAME: Intel',0 |
IntelnNewlen: |
Cyrixn: |
db 'Cyrix',0 |
Cyrixnlen: |
IDTn: |
db 'IDT/Centaur',0 |
IDTnlen: |
Centaurn: |
db 'VIA',0 |
Centaurnlen: |
Tranmsmetan: |
db 'Transmeta',0 |
Tranmsmetanlen: |
Vortexn: |
db 'Vortex86',0 |
Vortexnlen: |
mmxp: |
db 'MMX+: ',0 |
mmxplen: |
HTT: |
db 'HTT: ',0 |
HTTlen: |
HTTn: |
db 'HTT: ',0 |
HTTnlen: |
sse3: |
db 'SSE3: ',0 |
sse3len: |
SSE41: |
db 'SSE4.1: ',0 |
SSE41len: |
SSE42: |
db 'SSE4.2: ',0 |
SSE42len: |
SSE5: |
db 'SSE5: ',0 |
SSE5len: |
now: |
db '3DNOW!: ',0 |
nowlen: |
nowp: |
db '3DNOW!+: ',0 |
nowplen: |
;-Type |
t1 db 'OEM',0 |
t2 db 'Overdrive',0 |
t3 db 'Dual',0 |
t4 db 'Unknown',0 |
;----------Intel |
P50: |
db 'P5 A-step',0 |
P50len: |
P5: |
db 'P5',0 |
P5len: |
P54T: |
db 'P24T Overdrive',0 |
P54Tlen: |
P54C: |
db 'P54C',0 |
P54Clen: |
P55C: |
db 'P55C (with MMX)',0 |
P55Clen: |
; --- |
P60: |
db 'Pentium Pro A-step',0 |
P60len: |
P61: |
db 'Pentium Pro',0 |
P61len: |
P63: |
db 'Pentium II (Klamath)',0 |
P63len: |
P65: |
db 'Pentium II (Deschutes)',0 |
P65len: |
P66: |
db 'Celeron (Medocino)',0 |
P66len: |
P67: |
db 'Pentium III (Katmai)',0 |
P67len: |
P68: |
db 'Pentium III (Coppermine)',0 |
P68len: |
P69: |
db 'Pentium M (Banias)',0 |
P69len: |
P6A: |
db 'Pentium III Xeon (Cascades)',0 |
P6Alen: |
P6B: |
db 'Pentium III (Tualatin)',0 |
P6Blen: |
P6D: |
db 'Pentium M (Dothan)',0 |
P6Dlen: |
P6E: |
db 'Pentium M (Yonah)/ Core',0 |
P6Elen: |
P6F: |
db 'Pentium D (Conroe)/ Core 2 (Kentsfield)',0 |
P6Flen: |
;--- |
PS0: |
db 'Itanium (IA-64)',0 |
PS0len: |
;------------ |
PF0: |
db 'Pentium 4 (Willamete)',0 |
PF0len: |
PF2: |
db 'Pentium 4 (Northwood)',0 |
PF2len: |
PF3: |
db 'Pentium 4 (Prescott)',0 |
PF3len: |
PF5: |
db 'Pentium 4 (Tejas)',0 |
PF5len: |
PF6: |
db 'Pentium 4 (Presler)',0 |
PF6len: |
;----------------Intel Celerons |
P65c: |
db 'Celeron (Covington)',0 |
P65clen: |
P68c: |
db 'Celeron (Coppermine)',0 |
P68clen: |
P6Bc: |
db 'Celeron (Tualatin)',0 |
P6Bclen: |
PF0c: |
db 'Celeron (Willamete)',0 |
PF0clen: |
PF2c: |
db 'Celeron (Northwood)',0 |
PF2clen: |
PF3c: |
db 'Celeron (Prescott)',0 |
PF3clen: |
PF5c: |
db 'Celeron D (Texas)',0 |
PF5clen: |
PF6c: |
db 'Celeron D (Presler)',0 |
PF6clen: |
;---------New Intel |
P3A: |
db 'IvyBridge',0 |
P3Alen: |
P2A: |
db 'Sandy Bridge',0 |
P2Alen: |
P2D: |
db 'Sandy bridge-E',0 |
P2Dlen: |
P25: |
db 'Arrandale',0 |
P25len: |
P2C: |
db 'Gulftown',0 |
P2Clen: |
P2F: |
db 'Westmere-EX',0 |
P2Flen: |
P1E: |
db 'Clarksfield',0 |
P1Elen: |
P1A: |
db 'Bloomfield',0 |
P1Alen: |
P2E: |
db 'Nehalem-EX',0 |
P2Elen: |
P17: |
db 'Yorkfield',0 |
P17len: |
P1D: |
db 'Dunnington',0 |
P1Dlen: |
P0F: |
db 'Clovertown',0 |
P0Flen: |
P16: |
db 'Merom Conroe',0 |
P16len: |
P06: |
db 'Cedar Mill',0 |
P06len: |
P03: |
db 'Nocona Irwindale',0 |
P03len: |
P04: |
db 'NoconaIrwindale',0 |
P04len: |
P0D: |
db 'Dothan',0 |
P0Dlen: |
P36: |
db 'Cedarview',0 |
P36len: |
P26: |
db 'Lincroft',0 |
P26len: |
P1C: |
db 'Pineview',0 |
P1Clen: |
no_known: |
db 'SORRY, CODENAME IS NOT SUPPORTED YET ', 0 |
;---------AMD |
A50 db 'K5 (PR75, PR90, PR100)',0 |
A51 db '5k86 (PR120, PR133)',0 |
A52 db '5k86 (PR166)',0 |
A53 db '5k86 (PR200)',0 |
A56 db 'K6',0 |
A57 db 'K6',0 |
A58 db 'K6-2',0 |
A59 db 'K6-III',0 |
A5D db 'K6-2+ or K6-III+',0 |
;------------------- |
At1 db 'Athlon',0 |
At2 db 'Athlon',0 |
At3 db 'Duron (Spitfire)',0 |
At4 db 'Athlon (Thunderbird)',0 |
At6 db 'AthlonXP (Palomino)',0 |
At7 db 'Duron (Morgan)',0 |
At8 db 'AthlonXP (Thoroughbred)',0 |
At8a db 'Duron (Applebred)',0 |
Ata db 'AthlonXP (Barton)',0 |
Atat db 'AthlonXP (Thorton)',0 |
;------------------- |
AthlonKuma: |
db 'AMD Athlon 7750 Black Edition',0 |
AthlonKumalen: |
AB23: |
db 'Opteron 2300-series',0 |
AB23len: |
AB83: |
db 'Opteron 8300-series',0 |
AB83len: |
AB9: |
db 'Phenom X4',0 |
AB9len: |
AB8right2: |
db 'Phenom X3',0 |
AB8right2len: |
AB4: |
db 'Athlon X2',0 |
AB4len: |
AB1: |
db 'Sempron',0 |
AB1len: |
ABC2: |
db 'Opteron (Shanghai) 2387',0 |
ABC2len: |
AB6: |
db 'Opteron (Magny-Cours)',0 |
AB6len: |
ABC3: |
db 'Opteron (Shanghai) 8300 series',0 |
ABC3len: |
ABM2: |
db 'Turion II ',0 |
ABM2len: |
;--- |
AF1: |
db 'Dual-core Opteron',0 |
AF1len: |
AF3: |
db 'Athlon 64 (Toledo)',0 |
AF3len: |
AF4: |
db 'Athlon 64 (ClawHammer)',0 |
AF4len: |
AF5: |
db 'Opteron/Athlon 64 FX (SledgeHammer)',0 |
AF5len: |
AFC: |
db 'Athlon 64 (Newcastle)',0 |
AFClen: |
AFF: |
db 'Athlon 64 (Winchester)',0 |
AFFlen: |
AFS: |
db 'Athlon 64 (San Diego)',0 |
AFSlen: |
AFV: |
db 'Athlon 64 (Venice)',0 |
AFVlen: |
AFCs: |
db 'Sempron (Paris)',0 |
AFCslen: |
AFCsp: |
db 'Sempron (Palermo)',0 |
AFCsplen: |
;---------Cyrix |
C52: |
db '6x86 M1',0 |
C52len: |
C54: |
db 'MediaGX',0 |
C54len: |
C60: |
db '6x86MX M2',0 |
C60len: |
C65: |
db 'C3 (Cyrix M2)',0 ;? |
C65len: |
;--------IDT |
V54: |
db 'WinChip C6',0 |
V54len: |
V58: |
db 'WinChip 2',0 |
V58len: |
V59: |
db 'WinChip 3',0 |
V59len: |
;-------VIA |
V66: |
db 'C3 (Samuel)',0 ; Joshua is unreleased 065 |
V66len: |
V67: |
db 'C3 (Samuel2/Ezra)',0 ; ? |
V67len: |
V68: |
db 'C3 (Ezra-T/Eden)',0 ;? |
V68len: |
V69: |
db 'C3 (Antaur/Nehemiah)',0 ;? |
V69len: |
VA: |
db 'C7 (Esther)',0 ;? |
VAlen: |
;---------Transmeta |
T5: |
db 'Crusoe',0 ; |
T5len: |
TF: |
db 'Efficeon',0 ; |
TFlen: |
;--------- |
NG: |
db 'Next generation CPU',0 |
NGlen: |
athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 120 |
db 190, 120, 200, 130, 135, 140, 210, 150, 220, 160, 165, 170, 180, 230, 240 |
athlonmcoef: db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 |
db 30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240 |
athloncoef3 db 45, 50, 40, 55, 25, 30, 60, 35 |
p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 (Willamete) |
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 |
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 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
I_END: |
img_area: ; image is going to be unpacked to here |
rb 201*49*3+8 ; image resolution (bits to reserve) |
img_area2: ; image is going to be unpacked to here |
rb 93*24*3+8 ; image resolution (bits to reserve) |
img_area3: ; image is going to be unpacked to here |
rb 93*24*3+8 ; image resolution (bits to reserve) |
gif_hash_area: |
rd 4096+1 ;hash area size for unpacking gif |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
system_dir_ProcLib db '/sys/lib/proc_lib.obj',0 |
err_message_found_lib2 db 'proc_lib.obj - Not found!',0 |
err_message_import2 db 'proc_lib.obj - Wrong import!',0 |
head_f_i: |
head_f_l db 'error',0 |
;--------------------------------------------------------------------- |
l_libs_start: |
library02 l_libs system_dir_ProcLib+9, path, library_path, system_dir_ProcLib, \ |
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i |
end_l_libs: |
;--------------------------------------------------------------------- |
align 4 |
ProcLib_import: |
OpenDialog_Init dd aOpenDialog_Init |
OpenDialog_Start dd aOpenDialog_Start |
;OpenDialog__Version dd aOpenDialog_Version |
dd 0 |
dd 0 |
aOpenDialog_Init db 'OpenDialog_init',0 |
aOpenDialog_Start db 'OpenDialog_start',0 |
;aOpenDialog_Version db 'Version_OpenDialog',0 |
;--------------------------------------------------------------------- |
align 4 |
OpenDialog_data: |
.type dd 0 |
.procinfo dd Proc_Info ;+4 |
.com_area_name dd communication_area_name ;+8 |
.com_area dd 0 ;+12 |
.opendir_pach dd temp_dir_pach ;+16 |
.dir_default_pach dd communication_area_default_pach ;+20 |
.start_path dd open_dialog_path ;+24 |
.draw_window dd draw_window ;+28 |
.status dd 0 ;+32 |
.openfile_pach dd file_name ;+36 |
.filename_area dd filename_area ;+40 |
.filter_area dd Filter |
.x: |
.x_size dw 420 ;+48 ; Window X size |
.x_start dw 10 ;+50 ; Window X position |
.y: |
.y_size dw 320 ;+52 ; Window y size |
.y_start dw 10 ;+54 ; Window Y position |
communication_area_name: |
db 'FFFFFFFF_open_dialog',0 |
open_dialog_path: |
db '/sys/File Managers/opendial',0 |
communication_area_default_pach: |
db '/sys',0 |
Filter: |
dd Filter.end - Filter.1 |
.1: |
db 'TXT',0 |
db 'LOG',0 |
.end: |
dd 0 |
file_default_path: |
db '/sys/' |
start_temp_file_name: |
db 'CPUID.txt',0 |
btn_more_cap: |
db 'Details', 0 |
btn_save_cap: |
db 'Save', 0 |
;--------------------------------------------------------------------- |
align 4 |
fileinfo: |
.subfunction dd 2 |
.Offset dd 0 |
.Offset_1 dd 0 |
.size dd 4096 |
.return dd 0 |
db 0 |
.name: dd file_name |
align 4 |
sc system_colors |
store_text_area_start dd ? |
store_text_area_end dd ? |
store_text_size dd ? |
;--------------------------------------------------------------------- |
library_path: |
rb 4096 |
;--------------------------------------------------------------------- |
path: |
rb 4096 |
;--------------------------------------------------------------------- |
temp_dir_pach: |
rb 4096 |
;--------------------------------------------------------------------- |
file_name: |
rb 4096 |
;--------------------------------------------------------------------- |
file_name_1: |
rb 4096 |
;--------------------------------------------------------------------- |
filename_area: |
rb 256 |
;--------------------------------------------------------------------- |
rb 4096 |
stacktop: |
;--------------------------------------------------------------------- |
Proc_Info process_information |
; RSA test data |
align 4 |
num1 rd 40 |
num2 rd 40 |
num3 rd 40 |
iter rd 1 |
openkey rd 1 |
IncludeUGlobals |
nocpuid db ? |
ost dd ? |
sot dd ? |
f dd ? |
m dd ? |
s dd ? |
t dd ? |
ef dd ? |
em dd ? |
multiplier dd ? |
multa dd ? |
multb dd ? |
smallvendor dd ? |
L1d dd ? |
L1i dd ? |
L2 dd ? |
L3 dd ? |
micron dd ? |
brand dd ? |
newpc dd ? |
nomultiplier dd ? |
ram_size_a dd ? |
ram_size_t dd ? |
stdc dd ? |
extc dd ? |
FRS dd ? |
freqsel db ? |
sse3sup db ? |
sse41sup dd ? |
sse42sup dd ? |
sse5sup dd ? |
freqbb dd ? |
freqll dd ? |
wayli dd ? |
lineli dd ? |
wayld dd ? |
lineld dd ? |
wayl2 dd ? |
linel2 dd ? |
wayl3 dd ? |
linel3 dd ? |
che db ? ; numbers of calls for Intel caches detection |
cname dd ? |
codeN dd ? |
myname: |
rb 48 |
mynamelen: |
db ? |
align 4 |
thread2_stack_area rb 64 |
thread2_esp = $ |
U_END: |
/programs/testing/cpuid/trunk/intel.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/Build.bat |
---|
0,0 → 1,4 |
@echo lang fix en >lang.inc |
@fasm cpuid.asm cpuid |
@pause |
@erase lang.inc |
/programs/testing/cpuid/trunk/amd.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/cyrix.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/idt.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/logos.inc |
---|
0,0 → 1,20 |
amd: |
file 'amd.gif' ;include gif file |
cyrix: |
file 'cyrix.gif' ;include gif file |
idt: |
file 'idt.gif' ;include gif file |
intel: |
file 'intel.gif' ;include gif file |
transmeta: |
file 'transmet.gif' ;include gif file |
via: |
file 'via.gif' ;include gif file |
vortex: |
file 'vortex.gif' ;include gif file |
/programs/testing/cpuid/trunk/transmet.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/via.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/vortex.gif |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Added: svn:mime-type |
+application/octet-stream |
\ No newline at end of property |
/programs/testing/cpuid/trunk/Tupfile.lua |
---|
0,0 → 1,3 |
if tup.getconfig("NO_FASM") ~= "" then return end |
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"}) |
tup.rule({"CPUID.ASM", extra_inputs = {"lang.inc"}}, "fasm %f %o -m70000" .. tup.getconfig("KPACK_CMD"), "CPUID") |
/programs/testing/cpuid/trunk/gif_lite.inc |
---|
0,0 → 1,210 |
uglobal |
align 4 |
ReadGIF.globalColor dd ? |
ReadGIF.cur_info dd ? ; image table pointer |
ReadGIF.codesize dd ? |
ReadGIF.compsize dd ? |
ReadGIF.bit_count dd ? |
ReadGIF.CC dd ? |
ReadGIF.EOI dd ? |
ReadGIF.Palette dd ? |
ReadGIF.block_ofs dd ? |
ReadGIF.gif_workarea rb 16*1024 |
endg |
; unpacks GIF image |
ReadGIF: |
; in: |
; esi - pointer to GIF file in memory |
; edi - pointer to output image list |
; out: |
; eax=0 -> ok, eax=1 -> invalid signature |
; eax>=8 -> unsupported image attributes |
push esi edi |
mov [.cur_info],edi |
xor eax,eax |
mov [.globalColor],eax |
inc eax |
cmp dword[esi],'GIF8' |
jne .ex ; signature |
mov ecx,[esi+0xa] |
add esi,0xd |
mov edi,esi |
test cl,cl |
jns .nextblock |
mov [.globalColor],esi |
call .Gif_skipmap |
.nextblock: |
cmp byte[edi],0x21 |
jne .noextblock |
inc edi |
inc edi |
.block_skip: |
movzx eax,byte[edi] |
lea edi,[edi+eax+1] |
test eax,eax |
jnz .block_skip |
jmp .nextblock |
.noextblock: |
mov al,8 |
cmp byte[edi],0x2c ; image beginning |
jne .ex |
inc edi |
mov esi,[.cur_info] |
xchg esi,edi |
movzx eax,word[esi+4] |
stosd |
movzx eax,word[esi+6] |
stosd |
add esi,8 |
push edi |
mov ecx,[esi] |
inc esi |
test cl,cl |
js .uselocal |
push [.globalColor] |
mov edi,esi |
jmp .setPal |
.uselocal: |
call .Gif_skipmap |
push esi |
.setPal: |
movzx ecx,byte[edi] |
inc ecx |
mov [.codesize],ecx |
dec ecx |
pop [.Palette] |
lea esi,[edi+1] |
mov edi,.gif_workarea |
xor eax,eax |
lodsb ; eax - block_count |
add eax,esi |
mov [.block_ofs],eax |
mov [.bit_count],8 |
mov eax,1 |
shl eax,cl |
mov [.CC],eax |
mov ecx,eax |
inc eax |
mov [.EOI],eax |
mov eax, 1000h shl 16 |
.filltable: |
stosd |
inc eax |
loop .filltable |
pop edi |
.reinit: |
mov edx,[.EOI] |
inc edx |
push [.codesize] |
pop [.compsize] |
call .Gif_get_sym |
cmp eax,[.CC] |
je .reinit |
call .Gif_output |
.cycle: |
movzx ebx,ax |
call .Gif_get_sym |
cmp eax,edx |
jae .notintable |
cmp eax,[.CC] |
je .reinit |
cmp eax,[.EOI] |
je .end |
call .Gif_output |
.add: |
mov dword [.gif_workarea+edx*4],ebx |
cmp edx,0xFFF |
jae .cycle |
inc edx |
bsr ebx,edx |
cmp ebx,[.compsize] |
jne .noinc |
inc [.compsize] |
.noinc: |
jmp .cycle |
.notintable: |
push eax |
mov eax,ebx |
call .Gif_output |
push ebx |
movzx eax,bx |
call .Gif_output |
pop ebx eax |
jmp .add |
.end: |
xor eax,eax |
.ex: |
pop edi esi |
ret |
.Gif_skipmap: |
; in: ecx - image descriptor, esi - pointer to colormap |
; out: edi - pointer to area after colormap |
and ecx,111b |
inc ecx ; color map size |
mov ebx,1 |
shl ebx,cl |
lea ebx,[ebx*2+ebx] |
lea edi,[esi+ebx] |
ret |
.Gif_get_sym: |
mov ecx,[.compsize] |
push ecx |
xor eax,eax |
.shift: |
ror byte[esi],1 |
rcr eax,1 |
dec [.bit_count] |
jnz .loop1 |
inc esi |
cmp esi,[.block_ofs] |
jb .noblock |
push eax |
xor eax,eax |
lodsb |
test eax,eax |
jnz .nextbl |
mov eax,[.EOI] |
sub esi,2 |
add esp,8 |
jmp .exx |
.nextbl: |
add eax,esi |
mov [.block_ofs],eax |
pop eax |
.noblock: |
mov [.bit_count],8 |
.loop1: |
loop .shift |
pop ecx |
rol eax,cl |
.exx: |
xor ecx,ecx |
ret |
.Gif_output: |
push esi eax edx |
mov edx,.gif_workarea |
.next: |
push word[edx+eax*4] |
mov ax,word[edx+eax*4+2] |
inc ecx |
cmp ax,1000h |
jnz .next |
shl ebx,16 |
mov bx,[esp] |
.loop2: |
pop ax |
lea esi,[eax+eax*2] |
add esi,[.Palette] |
mov esi,[esi] |
bswap esi |
shr esi,8 |
mov [edi],esi |
add edi,3 |
loop .loop2 |
pop edx eax esi |
ret |
/programs/testing/cpuid/trunk/HISTORY.TXT |
---|
0,0 → 1,203 |
;****************************************************************************** |
; project name: CPUID |
; target platform: KolibriOS, x86 (IA-32), x86-64 achitectures |
; compability: CPUID works in MS Windows by means of emulator KlbrInWin from Diamond http://board.kolibrios.org/viewtopic.php?f=23&t=1273 |
; compiler: flat assembler 1.70.03 |
; version: 2.29 |
; last update: 12 October 2014 |
; maintained by: Sergey Kuzmin aka Wildwest |
; e-mail: kuzmin_serg@list.ru |
; site: http://coolthemes.narod.ru/files.html |
;****************************************************************************** |
; Summary: |
; supported vendors - Intel, AMD, VIA, Cyrix, IDT (Centaur),Transmeta, Vortex86 |
; displayed features - CPU frequency; |
; Internal Name; |
; Multiplier and System Clock frequency; |
; Standard and Extended Features; |
; CPU signature (family, model,stepping); |
; Codename; |
; L1, L2 and L3 Caches; |
; Technology; |
; CPU Vendor; |
; Type and Brand ID; |
; Logo for Vendors; |
; calculation of PR-rating for AMD AthlonXP; |
; Amout of RAM (available and total) |
; Highest input values for standard and extended calls |
; performed tests - Performance test (RSA encoding) |
;****************************************************************************** |
;"To do" plans: |
; actual use of Brand ID for description of Intel's CPU, i.e. Celeron/Pentium separation; |
; remove support of Cyrix and early Centaur (IDT) - they are too old, rare and non-standard; |
; Sempron detection - probably they supports Brand-ID; |
; update caches descriptors for intel Core 1/2 |
; quantity of logical CPU/cores - requires APIC ID analysis |
; newest AMD/Intel codename detection |
; improve support of Vortex86 |
;****************************************************************************** |
;HISTORY: |
;2.5: CPUID 15/08/2016 (not finished) |
;Authors: |
; Manasi Thakkar aka mat1854 |
;Features: |
; (+) added saving of features from fork version 2.26pre in log |
; (+) fixed redraw bug, which appears if user execute save dialog |
; Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
; incorrect cache detection for several models of newest Intel CPU, because they designed for another cache detection approach |
;----------------------------------------------------------------------------- |
;2.4: CPUID 09/08/2016 |
;Authors: |
; Artem Azhbakov aka marting422 |
; Nikita Moiseev aka Powerdogesss |
; Manasi Thakkar aka mat1854 |
; Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
;Features: |
; (+) added detection of Intel Arrandale |
; (+) save log in text file; |
; (+) use Extended models to turn off multiplier detection for CPU's, which aren't supported; |
; (+) show multiplier numbers, if we detect something and show n/a, if we don't; |
; (+) merging of different versions from GSOC students; |
; (+) added detection of codenames for new Intel CPUs: IvyBridge, SandyBridge-E, Gulftown, Westmere-EX, Clarksfield, Bloomfield,Nehalem-EX, Yorkfield, Dunnington, Clovertown, Merom Conroe, Cedar Mill, Nocona Irwindale, NoconaIrwindale, Dothan, Cedarview, Lincroft and Pineview. |
; (+) added detection of AMD k-10 series: AMD Athlon 7750 Black Edition, Opteron 2300-series, Opteron 8300-series, Phenom X4, Phenom X3, Athlon X2, Sempron, Opteron (Shanghai) 2387, Opteron (Magny-Cours), Opteron (Shanghai) 8300 series, Turion II. |
; (+) fixed duplication in txt file |
; (+) save Codename in text file; |
; (+) fixed abstact examples in visualisation block for RSA encoding performance test |
;Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
; incorrect cache detection for several models of newest Intel CPU, because they designed for another cache detection approach |
;----------------------------------------------------------------------------- |
;2.3: CPUID 12/10/2014 (not finished) |
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
; Pavel Rymovskiy aka Heavyiron <Heavyiron@pisem.net> |
; fedesco |
;Features: |
; (+) 'choose FSB' button removed and related code changed in the way it would use FSB value detected by Ghost's code; |
; (+) fixed calculation of Extended model for newest Intel; |
; (+) initial support of new vendor Vortex86 - logo, caches, technology; |
; (+) Italian translation by fedesco; |
; (+) makefile for *nix by fedesco; |
; (+) new cache descriptors for Intel; |
; (+) fixed typo, which makes output of Brand ID for AMD CPU's at incorrect place by Heavyiron; |
; (+) fixed typo, which makes selection of incorrect codename for AMD F8x CPU's; |
; (+) added detection of Extended Model for Intel's CPU and example of it's use |
;Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
; incorrect multiplier detection for newest CPU |
; incorrect cache detection for several models of newest Intel CPU, because they designed for another cache detection approach |
;----------------------------------------------------------------------------- |
;2.2: CPUID 01/05/2007 |
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
; Iliya Mikhailov aka Ghost <Ghost.nsk@gmail.com> |
; /^S0rG^\ <s0rg@ngs.ru> |
; Pavel Rymovskiy aka Heavyiron <Heavyiron@pisem.net> |
; Leency <Leency@email.ua> |
;Features: |
; (+) creative work by Leency - logos now much better and they take less size; |
; (+) changes from Heavyiron: client-relative drawing, title with function 0. It means the end of compatibility with MenuetOS! |
; (+) real-time RAM monitoring (previous versions showed changed amount of available RAM only at redraw event or CPUID window activation); |
; (+) fixed address of LAHF feature, added detection of CMPL, SVM, MOVCR8 technologies for AMD; |
; (+) fixed L2 cache size detection for VIA (they changed format from 8 bits to 16 bits several years ago); |
; (+) more macroses for Interface and Threads (from Menuett.inc written by /^S0rG^\, 2002), sources separated into several include files; |
; (++) more info about caches for VIA and Transmeta; |
; (+) added detection of DCA, SSSE3, VMX technologies for Intel; |
; (+) updated multiplier detection for AMD and Intel (thanks a lot to Ghost); |
;Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
;----------------------------------------------------------------------------- |
;2.1: CPUID 10/01/2007 |
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
;Features: |
; (++) more info about caches for AMD and Intel |
; (+) redesign |
; (+) fixes for names of some extended features |
; (+) fixed missing technology for some AMD64 cpu's |
; (+) detection of dual-core AMD Opteron, but I came to conclusion that detection of AMD Fxxh CPU's should be changed (don't know how yet) |
; (+) new caches for Intel |
; (+) fixed Celeron detection based on L2 cache size for newest Intel CPU (there are Celeron models with 512 Kb); |
; (+) CPUID now display System Clock with accuracy 0.01 MHz; |
; (+) new logo for Intel (they changed it some time ago); |
;Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
;----------------------------------------------------------------------------- |
;2.0: CPUID 31/10/2006 |
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
; Eugeniy Grechnikov aka Diamond <diamondz@land.ru> |
; Iliya Mikhailov aka Ghost <Ghost.nsk@gmail.com> |
;Features: |
; (+) detection of Brand ID of AMD CPU's (Opteron etc - not finished) |
; (+) detection of Extended family and Model of AMD CPU's |
; (+) interface+(redesign) |
; (+) calculation of System Clock |
; (++) added multiplier detection for AMD and Intel (thanks a lot to Ghost) |
; (+) optimization of GIF decoder, code cleanup and bugfix by Diamond; |
; (+) fixed bug with MMX+ detection for Cyrix CPU (in second window; |
; it was properly recognized in main window); |
; (+) we show appropiate message in second window if Extended Features |
; ($8000_000x) aren't available; |
; (+) we mark unknown CPU models as "Next generation CPU"; |
;Known issues: Sempron marked as AthlonXP |
; second window doesn't closed when you close main window |
;----------------------------------------------------------------------------- |
;1.1: CPUID 17/03/2006 |
;Author: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
;Features: |
; (+) performance test now runs after click at "Press for more" button => we start app without test, i.e. |
; immediately, but application can be unstable during multiple switching between windows(need testing) |
; (++) added detection of total and available amount of RAM (would work only in KolibriOS) |
; (++) added detection of extended family and model (not shown, but if you want...); |
; (++) added detection of effective family and model; |
; (+) more codenames: Intel Tejas, Presler, Yonah, Conroe; |
; (+) more codenames: AMD Toledo; |
; (+) interface+(redesign). |
;Bugs: probably some non-critical graphical issues |
;Known issues: Sempron is not supported (marked as AthlonXP) |
;----------------------------------------------------------------------------- |
;1.0: CPUID 26/09/2005 |
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
; Marat Zakiyanov aka Mario79 <mario79@bk.ru> |
; Andrey Halyavin aka halyavin <halyavin@land.ru> |
;Features: |
; (+) fixed bug, when processor doesn't support extented features and program don't report 'no' in such case |
; (+) fixed bug in CPU Type detection |
; (+) fixed bug, when program crashes on AMD AthlonXP when after click on 'Press for more' button |
; you click on 'Choose FSB' button; |
; (+) added output of highest standard and extended calls |
; (+) Extended Features(phase 1 - big part of AMD/Intel specific EF) |
; (+) reworked P-rating calculation for AMD AthlonXP -> |
; now one program for 266, 333, 400 MHz FSB |
; (but unstable - see Bugs section) |
; (+) support for Intel F5x, renamed C3(Esther) to C7(Esther) |
; (+) more codenames |
; (Intel: new Prescott's model; Dothan; VIA: Esther; |
; AMD: Newcastle, Paris, Winchester, San Diego, Venice, Palermo) |
; (+) performance test (RSA encoding, fixed-point arithmetics) |
; by Andrey Halyavin |
; (+) interface+(thanks to Mario79 for additional window |
; and to me for nice button) |
;Bugs: probably some non-critical graphical issues |
;Known issues: Sempron is not supported (marked as AthlonXP) |
;----------------------------------------------------------------------------- |
;0.9: CPUID 24/01/2005 |
;Authors: Sergey Kuzmin aka Wildwest <kuzmin_serg@list.ru> |
; Madis Kalme aka Madis731 <madis.kalme@mail.ee> |
; Jeffrey Amelynck aka Profkid <the_adams_familie@hotmail.com> |
;Features: |
; (+) deleting leading whitespaces in Intel P4's internal name |
; by Madis Kalme |
; (+) all standard features |
; (+) more codenames (Transmeta series) |
; (+) caches for Cyrix |
; (+) Brand ID for Intel |
; (+) detect L3 cache for Intel |
; (+) detect Xeon (will be improved later, at this moment see Brand) |
; (+) interface+(redesign and grafical logos for vendors) |
; (+) MMX+ test for Cyrix |
; (+) Type for Intel |
;Bugs: no !!! |
;Known issues: Sempron is not supported (marked as AthlonXP) |
; caches for IDT is not detected |
;----------------------------------------------------------------------------- |
;early history was removed; download any old version of CPUID and read it, if you want |
;***************************************************************************** |
/programs/testing/cpuid/trunk/README.TXT |
---|
0,0 → 1,91 |
WINDOWS (1251) CODEPAGE |
ENGLISH |
Hi! My name is Sergey Kuzmin aka Wildwest. |
This is one of the mostly famous program for KolibriOS/MenuetOS. |
I called it CPUID. CPUID talks with you CPU and show log. |
Current version is 2.29 and you can use it on your own risk without any warranty. |
E-mail me (kuzmin_serg@list.ru) if you have some problems or suggestions. |
All righs on this program are mine, except parts of code written by other developers. |
Further versions will be soon on my site: http://coolthemes.narod.ru/files.html |
People from international KolibriOS/MenuetOS team help me and I wish to mention his effort here: |
Ville Turjanmaa (Finland), which wrote MenuetOS; |
Ivan Poddubny and /^S0rG^\ (Russia) for useful macroses; |
Madis Kalme (Estonia), which wrote fix for strange Intel's Internal names; |
Jeffrey Amelynck (Belgium), who send me logos and code for its displaying |
(code was based on macros, written by Evgeniy Pavlyushin (Russia), which was |
just a shell for GIF decoding routine made by Andrey Ivushkin (Ukraine)); |
Marat Zakiyanov (Russia) for its kind propose of help in creating additional window ; |
Andrey Halyavin (Russia) for his patience during debugging performance test ; |
Eugeniy Grechnikov (Russia) for great code clean-up and optimization; |
Iliya Mikhailov (Russia) for piece of code from his great GMON; |
Pavel Rymovskiy (Belarus) and Kirill Lipatov (Ukraine) for their work, which enhance look & feel of CPUID |
fedesco (Italy) for makefile for compilation on *nix systems and for translation to Italian language. |
Also I want to thank folks which help me by testing and suggestions - |
Sonny, Smiddy and all the RU-Team. |
Please, test it and e-mail me screenshot. |
The CPUID thread with announcements and discussion is at http://board.kolibrios.org/viewtopic.php?f=42&t=594 |
Bye... |
RUSSIAN |
Ïðèâåò! Ìåíÿ çîâóò Ñåðãåé Êóçüìèí aka Wildwest. |
Ýòî îäíà èç ñàìûõ èçâåñòíûõ ïðîãðàìì äëÿ KolibriOS/MenuetOS. |
Îíà íàçûâàåòñÿ CPUID è ïîêàçûâàåò ðåçóëüòàòû èäåíòèôèêàöèè ïðîöåññîðà. |
Ýòî âåðñèÿ 2.29 è ÂÛ ìîæåòå å¸ èñïîëüçîâàòü íà ñâîé ñîáñòâåííûé ðèñê áåçî âñÿêèõ ãàðàíòèé. |
Åñëè áóäóò êàêèå-òî ïðîáëåìû èëè ïðåäëîæåíèÿ, òî íàïèøèòå ìíå (kuzmin_serg@list.ru). |
Âñå ïðàâà íà ïðîãðàììó ïðèíàäëåæàò ìíå, êðîìå ïðàâ íà ÷àñòè, íàïèñàííûõ îñòàëüíûìè ðàçðàáîò÷èêàìè. |
Ñëåäóþùèå âåðñèè áóäóò âûêëàäûâàòüñÿ íà ñòðàíè÷êå: http://coolthemes.narod.ru/files.html |
Ëþäè èç ìåæäóíàðîäíîé êîìàíäû KolibriOS/MenuetOS ïîìîãàëè ìíå è ÿ õîòåë áû óïîìÿíóòü èõ çäåñü: |
Ville Turjanmaa (Ôèíëÿíäèÿ), íàïèñàâøåãî MenuetOS; |
Èâàí Ïîääóáíîãî and /^S0rG^\ (Ðîññèÿ), íàïèñàâøèõ ïîëåçíûå ìàêðîñû; |
Madis Kalme (Ýñòîíèÿ), íàïèñàâøåãî îáðàáîò÷èê äëÿ ñòðàííûõ âíóòðåííèõ èìåí ïðîöåññîðîâ Èíòåë; |
Jeffrey Amelynck (Áåëüãèÿ), ïðèñëàâøåãî ìíå ëîãîòèïû è êîä äëÿ èõ ïîêàçà |
(êîä îñíîâàí íà ìàêðîñå îò Åâãåíèÿ Ïàâëþøèíà (Ðîññèÿ), êîòîðûé áûë ïðîñòî îáåðòêîé |
äëÿ àëãîðèòìà äåêîäèðîâàíèÿ GIF, ðåàëèçîâàííîãî Àíäðååì Èâóøêèíûì (Óêðàèíà)); |
Ìàðàòà Çàêèÿíîâà (Ðîññèÿ) çà åãî ëþáåçíîå ïðåäëîæåíèå ïîìî÷ü ñ ñîçäàíèåì äîïîëíèòåëüíîãî îêíà; |
Àíäðåÿ Õàëÿâèíà (Ðîññèÿ) çà åãî òåðïåíèå â ïðîöåññå îòëàäêè òåñòà ïðîèçîâèòåëüíîñòè; |
Åâãåíèÿ Ãðå÷íèêîâà (Ðîññèÿ) çà ÷èñòêó êîäà è îïòèìèçàöèþ; |
Èëüþ Ìèõàéëîâà (Ðîññèÿ) çà êóñîê êîäà èç åãî çàìå÷àòåëüíîé ïðîãðàììû GMON; |
Ïàâëà Ðûìîâñêîãî (Áåëîðóññèÿ) è Êèðèëëà Ëèïàòîâà (Óêðàèíà) çà ðàáîòó, ñïîñîñîáñòâîâàâøóþ óëó÷øåíèþ âíåøíåãî âèäà CPUID; |
fedesco (Èòàëèÿ) çà makefile äëÿ êîìïèëÿöèè â *nix-ñèñòåìàõ è ïåðåâîä èíòåðôåéñà íà èòàëüÿíñêèé ÿçûê. |
Òàêæå ÿ õî÷ó ïîáëàãîäàðèòü ëþäåé, ïîìîãàâøèõ ìíå òåñòèðîâàíèåì è ïðåäëîæåíèÿìè - |
Sonny, Smiddy è âñþ "ñîâåòñêóþ êîìàíäó" KolibriOS/MenuetOS. |
Ïîæàëóéñòà, ïðîòåñòèðóéòå ïðîãðàììó è ïðèøëèòå ìíå ñêðèíøîò ïî e-mail. |
Äî âñòðå÷ íà ôîðóìå http://board.kolibrios.org/viewtopic.php?f=42&t=594 |
/programs/testing/cpuid/trunk/features.inc |
---|
0,0 → 1,963 |
;Addresses for bits |
; edx cpuid(1) |
FPU_FLAG equ 0001h ;Floating-point unit on-Chip |
VME_FLAG equ 0002h ;Virtual Mode Extension |
DE_FLAG equ 0004h ;Debugging Extension |
PSE_FLAG equ 0008h ;Page Size Extension |
TSC_FLAG equ 0010h ;Time-Stamp Counter |
MSR_FLAG equ 0020h ;Model Specific Registers |
PAE_FLAG equ 0040h ;Physical Address Extension |
MCE_FLAG equ 0080h ;Machine Check Exception |
CX8_FLAG equ 0100h ;CMPXCHG8 Instruction Supported |
APIC_FLAG equ 0200h ;On-chip APIC Hardware Supported |
;10_FLAG equ 0400h ;Reserved |
SEP_FLAG equ 0800h ;Fast System Call |
MTRR_FLAG equ 1000h ;Memory Type Range Registers |
PGE_FLAG equ 2000h ;Page Global Enable |
MCA_FLAG equ 4000h ;Machine Check Architecture |
CMOV_FLAG equ 8000h ;Conditional Move Instruction Supported |
PAT_FLAG equ 10000h ;Page Attribute Table |
PSE36_FLAG equ 20000h ;36-bit Page Size Extension |
PSNUM_FLAG equ 40000h ;Processor serial number present and enabled |
CLFLUSH_FLAG equ 80000h ;CLFLUSH Instruction supported |
;20_FLAG equ 100000h ;Reserved |
DTS_FLAG equ 200000h ;Debug Store |
ACPI_FLAG equ 400000h ;Thermal Monitor and Software Controlled Clock Facilities supported |
MMX_FLAG equ 800000h ;Intel Architecture MMX technology supported |
FXSR_FLAG equ 1000000h ;Fast floating point save and restore |
SSE_FLAG equ 2000000h ;Streaming SIMD Extensions supported |
SSE2_FLAG equ 4000000h ;Streaming SIMD Extensions 2 |
SS_FLAG equ 8000000h ;Self-Snoop |
;HTT_FLAG equ 10000000h ;Hyper-Threading Technology |
TM_FLAG equ 20000000h ;Thermal Monitor supported |
IA64_FLAG equ 40000000h ; IA-64 |
PBE_FLAG equ 80000000h ;Pending Break Enable |
; ecx cpuid(1) |
SSE3_FLAG equ 0001h ;SSE3 0 |
MON_FLAG equ 0008h ;MON -3 |
DS_CPL_FLAG equ 0010h ;DS-CPL -4 |
VMX_FLAG equ 0020h ;VMX -5 |
SMX_FLAG equ 0040h ;SMX -6 to add |
EST_FLAG equ 0080h ; EST-7 |
TM2_FLAG equ 0100h ; TM2-8 |
SSSE3_FLAG equ 0200h ;SSSE3 -9 |
CNXT_ID_FLAG equ 0400h ;CID -10 |
CX16_FLAG equ 2000h ;CX16 - 13 |
ETPRD_FLAG equ 4000h ;xTPR - 14 |
PDCM_FLAG equ 8000h ;PDCM - 15 to add |
DCA_FLAG equ 40000h ;DCA - 18 Direct Cache Access |
SSE41_FLAG equ 80000h ;SSE41 - 19 to add |
SSE42_FLAG equ 100000h ;SSE42 - 20 to add |
x2APIC_FLAG equ 200000h ;x2APIC - 21 to add |
PPCNT_FLAG equ 800000h ;PPCNT - 23 to add |
; edx cpuid(8000_0001h) |
SYS_FLAG equ 0800h ;11 - may be we already detect it as SEP_FLAG |
MP_FLAG equ 80000h ;19 ???? not found in recent guides from AMD and Intel |
NX_FLAG equ 100000h ;20 |
MMXPi_FLAG equ 400000h ;22 |
MMXn_FLAG equ 800000h ;23 |
FXSRn_FLAG equ 1000000h ;24 it is ÌÌÕ+ for Cyrix |
FFXSR_FLAG equ 2000000h ;25 |
PAGE_FLAG equ 4000000h ;26 Page1Gb to add |
TSCP_FLAG equ 8000000h ;27 |
LM_FLAG equ 20000000h ;29 EM64T |
DNo_FLAG equ 40000000h ;30 3dNow! Ext |
DN_FLAG equ 80000000h ;31 3dNow! |
; ecx cpuid(8000_0001h) |
LAHF_FLAG equ 0001h ; LAHF 0 |
CMPL_FLAG equ 0002h ; core multi-processing legacy mode 1 |
SVM_FLAG equ 0004h ; secure virtual machine 2 |
EAS_FLAG equ 0008h ; ExtApicSpace 3 to add |
MOVCR8_FLAG equ 0010h ; AltMovCr8 4 |
ABM_FLAG equ 0020h ; ABM -5 to add |
SSE4A_FLAG equ 0040h ; SSE4A -6 to add |
MIS_FLAG equ 0080h ; MissAlignSSE -7 to add |
3DNP_FLAG equ 0100h ; 3DNowPrefetch-8 to add |
OSVW_FLAG equ 0200h ; OS visible workaround -9 to add |
SSE5_FLAG equ 0800h ;SSE5 - 11 to add |
SKINIT_FLAG equ 1000h ;SKINIT- 12 to add |
WDT_FLAG equ 2000h ;Watchdog timer - 13 to add |
;decoding standard features |
decode_standard_features: |
xor eax,eax |
inc eax |
cpuid |
Test0: |
test edx, FPU_FLAG |
jnz Test0e |
mov dword [FPU+6], $6F6E |
jmp Test1 |
Test0e: |
mov dword [FPU+6], $736579 |
;;;;;; |
Test1: |
test edx, VME_FLAG |
jnz Test1e |
mov dword [VME+ 7], $6F6E |
jmp Test2 |
Test1e: |
mov dword [VME+ 7], $736579 |
;;;;;; |
Test2: |
test edx, DE_FLAG |
jnz Test2e |
mov dword [DE+ 7], $6F6E |
jmp Test3 |
Test2e: |
mov dword [DE+ 7], $736579 |
;;;;;; |
Test3: |
test edx, PSE_FLAG |
jnz Test3e |
mov dword [PSE+ 8], $6F6E |
jmp Test4 |
Test3e: |
mov dword [PSE+ 8], $736579 |
;;;; |
Test4: |
test edx, TSC_FLAG |
jnz Test4e |
mov dword [TSC+ 6], $6F6E |
jmp Test5 |
Test4e: |
mov dword [TSC+ 6], $736579 |
;;;; |
Test5: |
test edx, MSR_FLAG |
jnz Test5e |
mov dword [MSR+ 7], $6F6E |
jmp Test6 |
Test5e: |
mov dword [MSR+ 7], $736579 |
;;;; |
Test6: |
test edx, PAE_FLAG |
jnz Test6e |
mov dword [PAE+ 7], $6F6E |
jmp Test7 |
Test6e: |
mov dword [PAE+ 7], $736579 |
;;;; |
Test7: |
test edx, MCE_FLAG |
jnz Test7e |
mov dword [MCE+ 8], $6F6E |
jmp Test8 |
Test7e: |
mov dword [MCE+ 8], $736579 |
;;;; |
Test8: |
test edx, CX8_FLAG |
jnz Test8e |
mov dword [CX8+ 6], $6F6E |
jmp Test9 |
Test8e: |
mov dword [CX8+ 6], $736579 |
;;;; |
Test9: |
test edx, APIC_FLAG |
jnz Test9e |
mov dword [APIC+ 7], $6F6E |
jmp Test11 |
Test9e: |
mov dword [APIC+ 7], $736579 |
;;;;; |
Test11: |
test edx, SEP_FLAG |
jnz Test11e |
mov dword [SEP+ 8], $6F6E |
jmp Test12 |
Test11e: |
mov dword [SEP+ 8], $736579 |
;;;; |
Test12: |
test edx, MTRR_FLAG |
jnz Test12e |
mov dword [MTRR+ 6], $6F6E |
jmp Test13 |
Test12e: |
mov dword [MTRR+ 6], $736579 |
;;;; |
Test13: |
test edx, PGE_FLAG |
jnz Test13e |
mov dword [PGE+ 7], $6F6E |
jmp Test14 |
Test13e: |
mov dword [PGE+ 7], $736579 |
;;;;; |
Test14: |
test edx, MCA_FLAG |
jnz Test14e |
mov dword [MCA+ 7], $6F6E |
jmp Test15 |
Test14e: |
mov dword [MCA+ 7], $736579 |
;;;; |
Test15: |
test edx, CMOV_FLAG |
jnz Test15e |
mov dword [CMOV+ 8], $6F6E |
jmp Test16 |
Test15e: |
mov dword [CMOV+ 8], $736579 |
;;;; |
Test16: |
test edx, PAT_FLAG |
jnz Test16e |
mov dword [PAT+ 6], $6F6E |
jmp Test17 |
Test16e: |
mov dword [PAT+ 6], $736579 |
;;;; |
Test17: |
test edx, PSE36_FLAG |
jnz Test17e |
mov dword [PSE36+ 7], $6F6E |
jmp Test18 |
Test17e: |
mov dword [PSE36+ 7], $736579 |
;;;; |
Test18: |
test edx, PSNUM_FLAG |
jnz Test18e |
mov dword [PSNUM+ 7], $6F6E |
jmp Test19 |
Test18e: |
mov dword [PSNUM+ 7], $736579 |
;;;; |
Test19: |
test edx, CLFLUSH_FLAG |
jnz Test19e |
mov dword [CLFLUSHn + 8], $6F6E |
jmp Test21 |
Test19e: |
mov dword [CLFLUSHn + 8], $736579 |
;;;; |
Test21: |
test edx, DTS_FLAG |
jnz Test21e |
mov dword [DTS+ 7], $6F6E |
jmp Test22 |
Test21e: |
mov dword [DTS+ 7], $736579 |
;;;; |
Test22: |
test edx, ACPI_FLAG |
jnz Test22e |
mov dword [ACPI+ 7], $6F6E |
jmp Test23 |
Test22e: |
mov dword [ACPI+ 7], $736579 |
;;;;; |
Test23: |
test edx, MMX_FLAG |
jnz Test23e |
mov dword [MMX+ 8], $6F6E |
mov dword [MMXs+ 7], $6F6E |
jmp Test24 |
Test23e: |
mov dword [MMX+ 8], $736579 |
mov dword [MMXs+ 7], $736579 |
;;;;; |
Test24: |
test edx, FXSR_FLAG |
jnz Test24e |
mov dword [FXSR+ 6], $6F6E |
jmp Test25 |
Test24e: |
mov dword [FXSR+ 6], $736579 |
;;;;; |
Test25: |
test edx, SSE_FLAG |
jnz Test25e |
mov dword [SSE+ 7], $6F6E |
jmp Test26 |
Test25e: |
mov dword [SSE+ 7], $736579 |
;;;; |
Test26: |
test edx, SSE2_FLAG |
jnz Test26e |
mov dword [SSE2+ 7], $6F6E |
jmp Test27 |
Test26e: |
mov dword [SSE2+ 7], $736579 |
;;;; |
Test27: |
test edx, SS_FLAG |
jnz Test27e |
mov dword [SSn+ 8], $6F6E |
jmp Test29;28 |
Test27e: |
mov dword [SSn+ 8], $736579 |
;;;; |
;Test28: |
;test edx, HTT_FLAG |
;jnz Test28e |
; |
;mov dword [HTT+ 8], $6F6E |
;jmp Test29 |
; |
;Test28e: |
;mov dword [HTT+ 8], $736579 |
;;;; |
Test29: |
test edx, TM_FLAG |
jnz Test29e |
mov dword [TM+ 7], $6F6E |
jmp Test30 |
Test29e: |
mov dword [TM+ 7], $736579 |
;;;; |
Test30: |
test edx, IA64_FLAG |
jnz Test30e |
mov dword [IA64+ 7], $6F6E |
jmp Test31 |
Test30e: |
mov dword [IA64+ 7], $736579 |
;;;; |
Test31: |
test edx, PBE_FLAG |
jnz Test31e |
mov dword [PBE+ 8], $6F6E |
jmp Standart_out |
Test31e: |
mov dword [PBE+ 8], $736579 |
Standart_out: |
ret |
;////////////////////////////////////////////// |
decode_sse3_5: ; is SS3-5 supported |
xor eax,eax |
inc eax |
cpuid |
test ecx, $1 ; Test bit 1 |
jnz .EX; SSE3 technology is supported |
jz .EXN |
.EX: |
mov dword [sse3+ 6], $736579 |
mov [sse3sup], 1 |
jmp exitter |
.EXN: |
mov dword [sse3+ 6], $6F6E |
mov [sse3sup],0 |
exitter: |
test ecx, $80000 ; Test bit 19 |
jnz .EX1; SSE41 technology is supported |
jz .EXN1 |
.EX1: |
mov dword [SSE41+ 11], $736579 |
mov [sse41sup], 1 |
jmp exitter1 |
.EXN1: |
mov dword [SSE41+ 11], $6F6E |
mov [sse41sup],0 |
exitter1: |
test ecx, $100000 ; Test bit 20 |
jnz .EX2; SSE42 technology is supported |
jz .EXN2 |
.EX2: |
mov dword [SSE42+ 10], $736579 |
mov dword [SS42+ 11], $736579 |
mov [sse42sup], 1 |
jmp exitter2 |
.EXN2: |
mov dword [SSE42+ 10], $6F6E |
mov dword [SS42+ 11], $6F6E |
mov [sse42sup],0 |
exitter2: |
xor eax,eax |
mov eax, 80000001h |
cpuid |
test ecx, $800 ; Test bit 11 |
jnz .EX3; SS5 technology is supported |
jz .EXN3 |
.EX3: |
mov dword [SSE5+ 12], $736579 |
mov [sse5sup], 1 |
jmp exitter3 |
.EXN3: |
mov dword [SSE5+ 12], $6F6E |
mov [sse5sup],0 |
exitter3: |
ret |
decode_extended_features: |
xor eax,eax |
inc eax |
cpuid |
Tes1: |
test ecx, SSE3_FLAG |
jnz Tes1e |
mov dword [SS3+ 8], $6F6E |
jmp Tes2 |
Tes1e: |
mov dword [SS3+ 8], $736579 |
Tes2: |
test ecx, MON_FLAG |
jnz Tes2e |
mov dword [MON+ 8], $6F6E |
jmp Tes3 |
Tes2e: |
mov dword [MON+ 8], $736579 |
Tes3: |
test ecx, DS_CPL_FLAG |
jnz Tes3e |
mov dword [DS_CPL+ 8], $6F6E |
jmp Tes4 |
Tes3e: |
mov dword [DS_CPL+ 8], $736579 |
Tes4: |
test ecx, EST_FLAG |
jnz Tes4e |
mov dword [EST+ 8], $6F6E |
jmp Tes5 |
Tes4e: |
mov dword [EST+ 8], $736579 |
Tes5: |
test ecx, TM2_FLAG |
jnz Tes5e |
mov dword [TM2+ 8], $6F6E |
jmp Tes6 |
Tes5e: |
mov dword [TM2+ 8], $736579 |
Tes6: |
test ecx, CNXT_ID_FLAG |
jnz Tes6e |
mov dword [CNXT_ID+ 12], $6F6E |
jmp Tes7 |
Tes6e: |
mov dword [CNXT_ID+ 12], $736579 |
Tes7: |
test ecx, CX16_FLAG |
jnz Tes7e |
mov dword [CX16+ 12], $6F6E |
jmp Tes8 |
Tes7e: |
mov dword [CX16+ 12], $736579 |
Tes8: |
test ecx, ETPRD_FLAG |
jnz Tes8e |
mov dword [ETPRD+ 12], $6F6E |
jmp Tes9 |
Tes8e: |
mov dword [ETPRD+ 12], $736579 |
Tes9: |
test ecx, VMX_FLAG |
jnz Tes9e |
mov dword [VMX+ 8], $6F6E |
jmp Tes10 |
Tes9e: |
mov dword [VMX+ 8], $736579 |
Tes10: |
test ecx, SSSE3_FLAG |
jnz Tes10e |
mov dword [SSSE3+ 12], $6F6E |
jmp Tes11 |
Tes10e: |
mov dword [SSSE3+ 12], $736579 |
Tes11: |
test ecx, DCA_FLAG |
jnz Tes11e |
mov dword [DCA+ 8], $6F6E |
jmp Tes12 |
Tes11e: |
mov dword [DCA+ 8], $736579 |
Tes12: |
test ecx, SMX_FLAG |
jnz Tes12e |
mov dword [SMX+ 8], $6F6E |
jmp Tes13 |
Tes12e: |
mov dword [SMX+ 8], $736579 |
Tes13: |
test ecx, PDCM_FLAG |
jnz Tes13e |
mov dword [newLabel+ 8], $6F6E |
jmp Tes14 |
Tes13e: |
mov dword [newLabel+ 8], $736579 |
Tes14: |
test ecx, x2APIC_FLAG |
jnz Tes14e |
mov dword [x2APIC+ 8], $6F6E |
jmp Tes15 |
Tes14e: |
mov dword [x2APIC+ 8], $736579 |
Tes15: |
test ecx, PPCNT_FLAG |
jnz Tes15e |
mov dword [PPCNT+ 12], $6F6E |
jmp Tes16 |
Tes15e: |
mov dword [PPCNT+ 12], $736579 |
Tes16: |
ret |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
decode_extended: |
xor eax, eax |
mov eax,$80000000 |
cpuid |
test eax, 80000000h |
jnz gooodd |
jmp baaad |
baaad: |
jmp Tez13 |
gooodd: |
xor eax, eax |
mov eax, $80000001 ;// Setup extended function 8000_0001h |
cpuid |
Tez1: |
test edx, MP_FLAG |
jnz Tez1e |
mov dword [MP+8], $6F6E |
jmp Tez2 |
Tez1e: |
mov dword [MP+ 8], $736579 |
Tez2: |
test edx, NX_FLAG |
jnz Tez2e |
mov dword [NX+ 8], $6F6E |
jmp Tez4 |
;jmp Tez3 we do detection in another place, because of Cyrix specific MMX+ detection |
Tez2e: |
mov dword [NX+ 8], $736579 |
;Tez3: |
;test edx, MMXPi_FLAG |
;jnz Tez3e |
;mov dword [MMXPi+ 8], $6F6E |
;jmp Tez4 |
;Tez3e: |
;mov dword [MMXPi+ 8], $736579 |
Tez4: |
test edx, MMXn_FLAG |
jnz Tez4e |
mov dword [MMXn+ 8], $6F6E |
jmp Tez5 |
Tez4e: |
mov dword [MMXn+ 8], $736579 |
Tez5: |
test edx, FXSRn_FLAG |
jnz Tez5e |
mov dword [FXSRn+ 8], $6F6E |
jmp Tez6 |
Tez5e: |
mov dword [FXSRn+ 8], $736579 |
Tez6: |
test edx, FFXSR_FLAG |
jnz Tez6e |
mov dword [FFXSR+ 12], $6F6E |
jmp Tez7 |
Tez6e: |
mov dword [FFXSR+ 12], $736579 |
Tez7: |
test edx, TSCP_FLAG |
jnz Tez7e |
mov dword [TSCP+ 12], $6F6E |
jmp Tez8 |
Tez7e: |
mov dword [TSCP+ 12], $736579 |
Tez8: |
test edx, LM_FLAG |
jnz Tez8e |
mov dword [LM+ 12], $6F6E |
jmp Tez9 |
Tez8e: |
mov dword [LM+ 12], $736579 |
Tez9: |
test edx, DNo_FLAG |
jnz Tez9e |
mov dword [DNo+ 12], $6F6E |
jmp Tez10 |
Tez9e: |
mov dword [DNo+ 12], $736579 |
Tez10: |
test edx, DN_FLAG |
jnz Tez10e |
mov dword [DN+ 12], $6F6E |
jmp Tez11 |
Tez10e: |
mov dword [DN+ 12], $736579 |
;Intel |
Tez11: |
test edx, SYS_FLAG |
jnz Tez11e |
mov dword [SYS+ 12], $6F6E |
jmp Tez12 |
Tez11e: |
mov dword [SYS+ 12], $736579 |
Tez12: |
test ecx, LAHF_FLAG |
jnz Tez12e |
mov dword [LAF+ 12], $6F6E |
jmp Tez13 |
Tez12e: |
mov dword [LAF+ 12], $736579 |
Tez13: |
test ecx, CMPL_FLAG |
jnz Tez13e |
mov dword [CMPL+ 8], $6F6E |
jmp Tez14 |
Tez13e: |
mov dword [CMPL+ 8], $736579 |
Tez14: |
test ecx, SVM_FLAG |
jnz Tez14e |
mov dword [SVM+ 8], $6F6E |
jmp Tez15 |
Tez14e: |
mov dword [SVM+ 8], $736579 |
Tez15: |
test ecx, MOVCR8_FLAG |
jnz Tez15e |
mov dword [MCR8+ 12], $6F6E |
jmp Tez16 |
Tez15e: |
mov dword [MCR8+ 12], $736579 |
Tez16: |
test edx, PAGE_FLAG |
jnz Tez16e |
mov dword [PAGE+ 8], $6F6E |
jmp Tez17 |
Tez16e: |
mov dword [PAGE+ 8], $736579 |
Tez17: |
test ecx, EAS_FLAG |
jnz Tez17e |
mov dword [EAS+ 12], $6F6E |
jmp Tez18 |
Tez17e: |
mov dword [EAS+ 12], $736579 |
Tez18: |
test ecx, ABM_FLAG |
jnz Tez18e |
mov dword [ABM+ 8], $6F6E |
jmp Tez19 |
Tez18e: |
mov dword [ABM+ 8], $736579 |
Tez19: |
test ecx, SSE4A_FLAG |
jnz Tez19e |
mov dword [SSE4A+ 8], $6F6E |
jmp Tez20 |
Tez19e: |
mov dword [SSE4A+ 8], $736579 |
Tez20: |
test ecx, MIS_FLAG |
jnz Tez20e |
mov dword [MIS+ 8], $6F6E |
jmp Tez21 |
Tez20e: |
mov dword [MIS+ 8], $736579 |
Tez21: |
test ecx, 3DNP_FLAG |
jnz Tez21e |
;mov dword [DNP+ 8], $6F6E |
;jmp Tez22 |
Tez21e: |
;mov dword [DNP+ 8], $736579 |
Tez22: |
test ecx, OSVW_FLAG |
jnz Tez22e |
mov dword [OSVW+ 8], $6F6E |
jmp Tez23 |
Tez22e: |
mov dword [OSVW+ 8], $736579 |
Tez23: |
test ecx, SKINIT_FLAG |
jnz Tez23e |
mov dword [SKINIT_+ 12], $6F6E |
jmp Tez24 |
Tez23e: |
mov dword [SKINIT_+ 12], $736579 |
Tez24: |
test ecx, WDT_FLAG |
jnz Tez24e |
mov dword [WDT+ 12], $6F6E |
jmp Tez25 |
Tez24e: |
mov dword [WDT+ 12], $736579 |
Tez25: |
ret |
;////////////////////////////////////////////// |
decode_sse3: ; is SS3 supported |
xor eax, eax |
inc eax |
cpuid |
test ecx, 1 |
setnz [sse3sup] |
mov eax, sse3+6 |
write_yes_no: |
mov dword [eax], 'no' |
jz @f |
mov dword [eax], 'yes' |
@@: |
ret |
show_next_bit: |
shr edx, 1 |
write_yes_no_cf: |
mov dword [eax], 'no' |
jnc @f |
mov dword [eax], 'yes' |
@@: |
ret |
/programs/testing/cpuid/trunk/multipli.inc |
---|
0,0 → 1,304 |
newrating: |
cmp [freqbb], 151 |
jl f266 |
cmp [freqbb], 150 |
ja ft |
jmp vyxod |
ft: |
cmp [freqbb], 180 |
ja f400 |
cmp [freqbb], 181 |
jl f333 |
jmp vyxod |
f266: |
;ôîðìóëû âû÷èñëåíèÿ XP-ðåéòèíãà Athlon-îâ (Tbred, Barton): |
;FSB266/256kB: ñäåëàíî |
;XP+ (Freq<2000MHz) = 1000 + (Freq-1000)*1,5 = Freq*1.5-500 |
;XP+ (Freq>=2000MHz) = 900 + (Freq-1000)*1,5 = Freq*1.5-600 |
mov [FRS], 266 |
cmp [total], 2000 |
jl pal |
; Ðåéòèíã äëÿ Ïàëîìèíî 2000+ |
mov eax,[total] |
imul eax, 3 |
shr eax,1 |
sub eax, 600 |
mov [rating], eax |
jmp vyxod |
pal: |
; Ðåéòèíã äëÿ Ïàëîìèíî 2000- |
mov eax,[total] |
imul eax, 3 |
shr eax,1 |
sub eax, 500 |
mov [rating], eax |
jmp vyxod |
f333: |
mov [FRS], 333 |
cmp [L2], 256 |
jl .Th ; Thorton |
;FSB333/512kB: ñäåëàíî |
;XP+ (Freq<2100MHz) = Freq*1.2 + 300 |
;XP+ (Freq>=2100MHz) = Freq*1.2 + 400 |
cmp [total], 2100 |
jl .r2100 |
mov eax,[total] |
xor edx, edx |
imul eax, 600000 |
mov ebx, 500000 |
div ebx |
mov [rating], eax |
add [rating], 400 |
; Rating for Barton F<2000 MHz |
jmp vyxod |
.r2100: |
mov eax,[total] |
xor edx, edx |
imul eax, 600000 |
mov ebx, 500000 |
div ebx |
mov [rating], eax |
add [rating], 300 |
; Rating for Barton F>2000 MHz |
jmp vyxod |
;FSB333/256kB: ñäåëàíî |
;XP+ = Freq*1.2 + 100 |
.Th: |
mov eax,[total] |
xor edx, edx |
imul eax, 600000 |
mov ebx, 500000 |
div ebx |
mov [rating], eax |
add [rating], 100 |
;Rating for Thorton |
jmp vyxod |
f400: |
mov [FRS], 400 |
;FSB400/512kB: |
;XP+ = Freq*1.5 - 100 |
mov eax,[total] |
imul eax, 3 |
shr eax,1 |
sub eax, 100 |
mov [rating], eax |
vyxod: |
ret |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
multipl: |
;--- âû÷èñëåíèå êîýôôèöèåíòà óìíîæåíèÿ - |
; ïîðòèò ðåãèñòðû |
; out : CL = êîýôô.óìíîæåíèÿ * 10, èëè 0 |
xor ecx, ecx |
cmp dword[smallvendor], 'cAMD' ; Check for Advanced Micro Devices CPU |
jne noAMD |
cmp byte [f], 5 |
jne noAMDK6 |
mov eax, 68 ; AMD-K6 (p.30) |
mov ebx, 3 |
mov edx, 0x0C0000087 |
mcall ; eax - low dword |
and eax, 111b |
mov cl, [athloncoef3 + eax] |
cmp eax, 6 |
jne @f |
cmp byte[m], 8 |
jae @f |
mov cl, 20 |
@@: ret |
noAMDK6:cmp byte [f], 6 |
jne noAMDK7 |
cmp byte [m], 5 |
jna @f |
mov eax, 0x80000007 |
cpuid |
and edx, 6 ; voltage ID control & frequency ID control |
cmp edx, 6 |
je AMDK7M |
@@: mov eax, 68 ; Athlon/AthlonXP |
mov ebx, 3 |
mov edx, 0x0C0010015 |
mcall |
mov ebx, eax |
shr ebx, 24 |
and ebx, 0x0F |
shr eax, 20 |
jnc @f |
add bl, 16 |
@@: mov cl, [athloncoef + ebx] |
ret |
AMDK7M: mov eax, 68 ; AthonXP-M |
mov ebx, 3 |
mov edx, 0xC0010042 |
mcall |
and eax, 0x1F |
mov cl, [athlonmcoef + eax] |
ret |
noAMDK7:cmp byte [f], 0xF |
jne noAMDK8 |
mov eax, 0x80000007 |
cpuid |
and edx, 6 ; voltage ID control & frequency ID control |
cmp edx, 6 |
je AMDK8M |
mov eax, 68 ; Athon64 |
mov ebx, 3 |
mov edx, 0xC0010015 |
mcall |
shr eax, 24 |
and al, 0x3F |
shr al, 1 |
add al, 4 |
mov dl, 10 |
mul dl |
mov cl, al |
ret |
AMDK8M: mov eax, 68 ; Athon64-M |
mov ebx, 3 |
mov edx, 0xC0010042 |
mcall |
and al, 0x3F |
shr al, 1 |
add al, 4 |
mov dl, 10 |
mul dl |
mov cl, al |
ret |
;///////////////////////////////////////////////////////// |
noAMD: cmp dword [smallvendor], 'ntel' ; Check for International Electronics CPU |
jne noIntel |
cmp byte[f], 0x0F |
jne noIntelP4 |
cmp byte [t], 6 |
jne @f |
mov eax, 68 ; Pentium M |
mov ebx, 3 |
mov edx, 0x2A |
mcall |
shr eax, 22 |
and eax, 0x1F |
mov dl, 10 |
mul dl |
mov cl, al |
ret |
@@: cmp byte [m], 2 |
jae @f |
mov eax, 68 ; Pentium 4 / Xeon (model < 2) Willamete |
mov ebx, 3 |
mov edx, 0x2A |
mcall |
shr eax, 8 |
and eax, 0x0F |
mov cl, [p4coef + eax] |
ret |
@@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) NorthWood |
mov ebx, 3 |
mov edx, 0x2C |
mcall |
shr eax, 24 |
and eax, 0x1F |
mov dl, 10 |
mul dl |
mov cl, al |
ret |
noIntelP4: |
cmp byte[f], 6 |
jne noIntelP6 |
;edited code for test task-1 |
cmp byte[em],0x3A ;i3,i5,i7 |
je newCPU; |
cmp byte[em],0x2A ;celeron dekstop, mobile, Xeon E3 |
je newCPU; |
cmp byte[em],0x2D ;i7 |
je newCPU; |
cmp byte[em],0x25 ;celeron, pentium, core i3,i5,i7 |
je newCPU; |
cmp byte[em],0x2C ;Xeon 3000 |
je newCPU; |
cmp byte[em],0x1E ;Clarksfield core i7 |
je newCPU; |
cmp byte[em],0x1A ;Bloomfield-2008 |
je newCPU; |
cmp byte[em],0x2E ;NEhlem ~2008 |
je newCPU; |
mov eax, 68 ; Pentium Pro / Pentium II / Pentium III |
mov ebx, 3 |
mov edx, 0x2A |
mcall |
shr eax, 22 |
test al, 0x20 |
jz @f |
or al, 0x10 |
@@: and eax, 0x1f |
cmp byte[m], 0x06 ; ? 7 |
ja @f |
and al, 0x0f |
@@: |
mov cl, [coppercoeff + eax] |
cmp byte[m], 0x0B |
jb @f |
mov cl, [tualatcoeff + eax] |
cmp byte[m], 0x0B |
je @f |
mov dl, 10 ; model 0x0C - 0x0F - Dothan / Yonah / Conroe / Merom |
mul dl |
mov cl, al |
@@: ret |
noIntel: |
noIntelP6: |
noAMDK8: |
newCPU: |
mov [nomultiplier], 1 |
ret |
/programs/testing/cpuid/trunk/variable.inc |
---|
0,0 → 1,355 |
; Brand |
;====================== |
brand0: |
db 'n/a' |
brand0len: |
brand01: |
db '01 Celeron' |
brand01len: |
brand02: |
db '02 Pentium III' |
brand02len: |
brand03: |
db '03 Pentium III Xeon' |
brand03len: |
brand03d: |
db '03 Celeron' |
brand03dlen: |
brand04: |
db '04 Pentium III' |
brand04len: |
brand06: |
db '06 Pentium III M' |
brand06len: |
brand07: |
db '07 Celeron M' |
brand07len: |
brand08: |
db '08 Pentium 4' |
brand08len: |
brand09: |
db '09 Pentium 4' |
brand09len: |
brand0A: |
db '0A Celeron' |
brand0Alen: |
brand0B: |
db '0B Xeon' |
brand0Blen: |
brand0Bd: |
db '0B Xeon MP' |
brand0Bdlen: |
brand0C: |
db '0C Xeon MP' |
brand0Clen: |
brand0E: |
db '0E Pentium 4 M' |
brand0Elen: |
brand0Ed: |
db '0E Xeon' |
brand0Edlen: |
brand0F: |
db '10 Celeron M' |
brand0Flen: |
brand11: |
db '11 Mobile CPU' |
brand11len: |
brand12: |
db '12 Celeron M' |
brand12len: |
brand13: |
db '13 Celeron M' |
brand13len: |
brand14: |
db '14 Celeron' |
brand14len: |
brand15: |
db '15 Mobile CPU' |
brand15len: |
brand16: |
db '16 Pentium M' |
brand16len: |
brand17: |
db '17 Celeron M' |
brand17len: |
;====================== |
;features |
FPU: |
db 'FPU: ',0 |
FPUlen: |
VME: |
db 'VME: ',0 |
VMElen: |
DE: |
db 'DE: ',0 |
DElen: |
PSE: |
db 'PSE: ',0 |
PSElen: |
TSC: |
db 'TSC: ',0 |
TSClen: |
MSR: |
db 'MSR: ',0 |
MSRlen: |
PAE: |
db 'PAE: ',0 |
PAElen: |
MCE: |
db 'MCE: ',0 |
MCElen: |
CX8: |
db 'CX8: ',0 |
CX8len: |
APIC: |
db 'APIC: ',0 |
APIClen: |
SEP: |
db 'SEP: ',0 |
SEPlen: |
MTRR: |
db 'MTRR: ',0 |
MTRRlen: |
PGE: |
db 'PGE: ',0 |
PGElen: |
MCA: |
db 'MCA: ',0 |
MCAlen: |
CMOV: |
db 'CMOV: ',0 |
CMOVlen: |
PAT: |
db 'PAT: ',0 |
PATlen: |
PSE36: |
db 'PSE36: ',0 |
PSE36len: |
PSNUM: |
db 'PSNUM: ',0 |
PSNUMlen: |
CLFLUSHn: |
db 'CLFLSH: ',0 |
CLFLUSHnlen: |
DTS: |
db 'DTS: ',0 |
DTSlen: |
ACPI: |
db 'ACPI: ',0 |
ACPIlen: |
MMX: |
db 'MMX: ',0 |
MMXlen: |
FXSR: |
db 'FXSR: ',0 |
FXSRlen: |
SSE: |
db 'SSE: ',0 |
SSElen: |
SSE2: |
db 'SSE2: ',0 |
SSE2len: |
SSn: |
db 'SS: ',0 |
SSnlen: |
TM: |
db 'TM: ',0 |
TMlen: |
IA64: |
db 'IA64: ',0 |
IA64len: |
PBE: |
db 'PBE: ',0 |
PBElen: |
Res: |
db 'Reserved',0 |
Reslen: |
;Extended |
SS3: |
db 'SSE3: ',0 |
SS3len: |
MON: |
db 'MON: ',0 |
MONlen: |
DS_CPL: |
db 'DS-CPL: ',0 |
DS_CPLlen: |
EST: |
db 'EST: ',0 |
ESTlen: |
TM2: |
db 'TM2: ',0 |
TM2len: |
CNXT_ID: |
db 'CNXT-ID: ',0 |
CNXT_IDlen: |
CX16: |
db 'CX16: ',0 |
CX16len: |
ETPRD: |
db 'xTPR/ETPRD: ',0 ; xTPR |
ETPRDlen: |
;Extended2 |
SYS: |
db 'SYSCALL: ',0 |
SYSlen: |
MP: |
db 'MP: ',0 |
MPlen: |
NX: |
db 'NX/XD: ',0 |
NXlen: |
MMXPi: |
db 'MMX+: ',0 |
MMXPilen: |
MMXn: |
db 'MMX: ',0 |
MMXnlen: |
FXSRn: |
db 'FXSR: ',0 |
FXSRnlen: |
FFXSR: |
db 'FFXSR: ',0 |
FFXSRlen: |
TSCP: |
db 'TSCP: ',0 |
TSCPlen: |
LM: |
db 'EM64T/LM: ',0 ; AA64 |
LMlen: |
DNo: |
db '3DNow!+: ',0 |
DNolen: |
DN: |
db '3DNow!: ',0 |
DNlen: |
LAF: |
db 'LAHF: ',0 |
LAFlen: |
VMX: |
db 'VMX: ',0 |
VMXlen: |
SSSE3: |
db 'SSSE3: ',0 |
SSSE3len: |
DCA: |
db 'DCA: ',0 |
DCAlen: |
MCR8: |
db 'MCR8: ',0 |
MCR8len: |
SVM: |
db 'SVM: ',0 |
SVMlen: |
CMPL: |
db 'CMPL: ',0 |
CMPLlen: |
;================================ |
abrand00: |
db '8-bit Brand (no details)' |
abrand00len: |
abrand0: |
db 'AMD Opteron UP' |
abrand0len: |
abrand1: |
db 'AMD Opteron DP' |
abrand1len: |
abrand2: |
db 'AMD Opteron MP' |
abrand2len: |
;===================================== |
multi0: |
db 'n/a' |
multi0len: |
;===================================== |
clock0: |
db 'n/a' |
clock0len: |
/programs/testing/cpuid/trunk/caches.inc |
---|
0,0 → 1,972 |
; Decoding cache L1,L2,L3 for Intel |
decodecache32: |
call decodecache |
decodecache24: |
shr eax, 8 |
call decodecache |
shr eax, 8 |
call decodecache |
shr eax, 8 |
decodecache: |
comp0: |
cmp al, 00h |
je L000 |
comp6: |
cmp al, 06h |
je kk6 |
comp7: |
cmp al, 08h |
je kk7 |
comp61: ;+1 |
cmp al, 09h |
je kk61 |
comp11: |
cmp al, 0Ah |
je kk11 |
je Ld8 |
comp13: |
cmp al, 0Ch |
je kk13 |
je Ld16 |
comp62: ;+1 |
cmp al, 0Dh |
je kk15 |
comp63: ;+1 |
cmp al, 0Eh |
je kk63 |
comp14: |
cmp al, 10h |
je kk14 |
je Ld16 |
comp8: |
cmp al, 15h |
je kk8 |
comp48: |
cmp al, 1Ah |
je kk48 |
je L96 |
comp64: ;+1 |
cmp al, 21h |
je kk23 |
comp39: |
cmp al, 22h |
je kk39 |
je L305 |
comp40: |
cmp al, 23h |
je kk40 |
je L31 |
comp41: |
cmp al, 25h |
je kk41 |
je L32 |
comp42: |
cmp al, 29h |
je kk42 |
je L34 |
comp16: |
cmp al, 2Ch |
je kk16 |
je Ld32 |
comp10: |
cmp al, 30h |
je kk10 |
comp18: |
cmp al, 39h |
je kk18 |
je L128 |
comp49: |
cmp al, 3Ah |
je kk49 |
je L192 |
comp19: |
cmp al, 3Bh |
je kk19 |
je L128 |
comp22: |
cmp al, 3Ch |
je kk22 |
je L256 |
comp50: |
cmp al, 3Dh |
je kk50 |
je L384 |
comp51: |
cmp al, 3Eh |
je kk51 |
je L512 |
comp1: |
cmp al, 41h |
je kk1 |
comp2: |
cmp al, 42h |
je kk2 |
comp3: |
cmp al, 43h |
je kk3 |
comp4: |
cmp al, 44h |
je kk4 |
comp5: |
cmp al, 45h |
je kk5 |
comp53: |
cmp al, 46h |
je kk53 |
je L34 |
comp54: |
cmp al, 47h |
je kk54 |
je L38 |
comp65: ;+1 |
cmp al, 48h |
je kk26 |
comp55: |
cmp al, 49h |
je kk55 |
je L34 |
comp56: |
cmp al, 4Ah |
je kk56 |
je L36 |
comp57: |
cmp al, 4Bh |
je kk57 |
je L38 |
comp58: |
cmp al, 4Ch |
je kk58 |
je L312 |
comp59: |
cmp al, 4Dh |
je kk59 |
je L316 |
comp60: |
cmp al, 4Eh |
je kk60 |
je L6144 |
comp36: |
cmp al, 60h |
je kk36 |
je Ld16 |
comp12: |
cmp al, 66h |
je kk12 |
je Ld8 |
comp15: |
cmp al, 67h |
je kk15 |
je Ld16 |
comp17: |
cmp al, 68h |
je kk17 |
je Ld32 |
comp33: |
cmp al, 70h |
je kk33 |
je Li12 |
comp34: |
cmp al, 71h |
je kk34 |
je Li16 |
comp35: |
cmp al, 72h |
je kk35 |
je Li32 |
comp47: |
cmp al, 73h |
je kk47 |
je Li64 |
comp9: |
cmp al, 77h |
je kk9 |
comp37: |
cmp al, 78h |
je kk37 |
je L1024 |
comp20: |
cmp al, 79h |
je kk20 |
je L128 |
comp23: |
cmp al, 7Ah |
je kk23 |
je L256 |
comp26: |
cmp al, 7Bh |
je kk26 |
je L512 |
comp29: |
cmp al, 7Ch |
je kk29 |
je L1024 |
comp38: |
cmp al, 7Dh |
je kk38 |
je L2048 |
comp24: |
cmp al, 7Eh |
je kk24 |
je L256 |
comp52: |
cmp al, 7Fh |
je kk52 |
je L512 |
comp66: |
cmp al, 80h |
je kk21 |
comp21: |
cmp al, 81h |
je kk21 |
je L128 |
comp25: |
cmp al, 82h |
je kk25 |
je L256 |
comp27: |
cmp al, 83h |
je kk27 |
je L512 |
comp30: |
cmp al, 84h |
je kk30 |
je L1024 |
comp32: |
cmp al, 85h |
je kk32 |
je L2048 |
comp28: |
cmp al, 86h |
je kk28 |
je L512 |
comp31: |
cmp al, 87h |
je kk31 |
je L1024 |
comp43: |
cmp al, 88h |
je kk43 |
je L32 |
comp44: |
cmp al, 89h |
je kk44 |
je L34 |
comp45: |
cmp al, 8Ah |
je kk45 |
je L38 |
comp46: |
cmp al, 8Dh |
je kk46 |
je L34 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;comp67: ;+1 |
;cmp al, 208 ; D0h |
;je kk39 |
;comp68: ;+1 |
;cmp al, 209 ; D1h |
;je kk68 |
;comp69: ;+1 |
;cmp al, 210 ; D2h |
;je kk43 |
;comp70: ;+1 |
;cmp al, 214 ; D6h |
;je kk40 |
;comp71: ;+1 |
;cmp al, 215 ; D7h |
;je kk41 |
;comp72: ;+1 |
;cmp al, 216 ;D8h |
;je kk42 |
;comp73: ;+1 |
;cmp al, 220 ; DCh |
;je kk73 |
;comp74: ;+1 |
;cmp al, 221 ;DDh |
;je kk74 |
;comp75: ;+1 |
;cmp al, 222 ;DEh |
;je kk56 |
;comp76: ;+1 |
;cmp al, 226 ;E2h |
;je kk76 |
;comp77: ;+1 |
;cmp al, 227 ;E3h |
;je kk55 |
;comp78: ;+1 |
;cmp al, 228 ;E4h |
;je kk57 |
;comp79: ;+1 |
;cmp al, 234 ;EAh |
;je kk79 |
;comp80: ;+1 |
;cmp al, 235 ;EBh |
;je kk80 |
;comp81: ;+1 |
;cmp al, 236 ;ECh |
;je kk81 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
comp67: ;+1 |
cmp al, 0D0h |
je kk39 |
comp68: ;+1 |
cmp al, 0D1h |
je kk68 |
comp69: ;+1 |
cmp al, 0D2h |
je kk43 |
comp70: ;+1 |
cmp al, 0D6h |
je kk40 |
comp71: ;+1 |
cmp al, 0D7h |
je kk41 |
comp72: ;+1 |
cmp al, 0D8h |
je kk42 |
comp73: ;+1 |
cmp al, 0DCh |
je kk73 |
comp74: ;+1 |
cmp al, 0DDh |
je kk74 |
comp75: ;+1 |
cmp al, 0DEh |
je kk56 |
comp76: ;+1 |
cmp al, 0E2h |
je kk76 |
comp77: ;+1 |
cmp al, 0E3h |
je kk55 |
comp78: ;+1 |
cmp al, 0E4h |
je kk57 |
comp79: ;+1 |
cmp al, 0EAh |
je kk79 |
comp80: ;+1 |
cmp al, 0EBh |
je kk80 |
comp81: ;+1 |
cmp al, 0ECh |
je kk81 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
jne L000 |
;------------------ |
;;;;;;;;;;;;;;;;; L1 instr |
kk6: |
mov [wayli], 4 |
mov [lineli], 32 |
jmp Li8 |
kk7: |
mov [wayli], 4 |
mov [lineli], 32 |
jmp Li16 |
kk8: |
mov [wayli], 4 |
mov [lineli], 32 |
jmp Li16 |
kk9: |
mov [wayli], 4 |
mov [lineli], 64 |
jmp Li16 |
kk61: |
mov [wayli], 4 ;+1 |
mov [lineli], 64 |
jmp Li32 |
kk33: |
mov [wayli], 8 |
;mov [lineli], 32 |
jmp Li12 |
kk34: |
mov [wayli], 8 |
;mov [lineli], 32 |
jmp Li16 |
kk35: |
mov [wayli], 8 |
;mov [lineli], 32 |
jmp Li32 |
kk47: |
mov [wayli], 8 |
;mov [lineli], 32 |
jmp Li64 |
kk10: |
mov [wayli], 8 |
mov [lineli], 64 |
jmp Li32 |
;;;;;;;;;;;;;;;;;;; |
;---------------L1 data |
kk11: |
mov [wayld], 2 |
mov [lineld], 32 |
jmp Ld8 |
kk12: |
mov [wayld], 4 |
mov [lineld], 64 |
jmp Ld8 |
kk13: |
mov [wayld], 4 |
mov [lineld], 32 |
jmp Ld16 |
kk14: |
mov [wayld], 4 |
mov [lineld], 32 |
jmp Ld16 |
kk15: |
mov [wayld], 4 |
mov [lineld], 64 |
jmp Ld16 |
kk16: |
mov [wayld], 8 |
mov [lineld], 64 |
jmp Ld32 |
kk17: |
mov [wayld], 4 |
mov [lineld], 64 |
jmp Ld32 |
kk63: |
mov [wayld], 6 |
mov [lineld], 64 |
jmp Ld24 |
kk36: |
mov [wayld], 8 |
mov [lineld], 64 |
jmp Ld16 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;; L2 |
kk19: |
mov [wayl2], 2 |
mov [linel2], 64 |
jmp L128 |
kk52: |
mov [wayl2], 2 |
mov [linel2], 64 |
jmp L512 |
kk1: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L128 |
kk2: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L256 |
kk25: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L256 |
kk3: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L512 |
kk4: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L1024 |
kk5: |
mov [wayl2], 4 |
mov [linel2], 32 |
jmp L2048 |
kk18: |
mov [wayl2], 4 |
mov [linel2], 64 |
jmp L128 |
kk22: |
mov [wayl2], 4 |
mov [linel2], 64 |
jmp L256 |
kk28: |
mov [wayl2], 4 |
mov [linel2], 64 |
jmp L512 |
kk51: |
mov [wayl2], 4 |
mov [linel2], 64 |
jmp L512 |
kk37: |
mov [wayl2], 4 |
mov [linel2], 64 |
jmp L1024 |
kk48: |
mov [wayl2], 6 |
mov [linel2], 64 |
jmp L96 |
kk49: |
mov [wayl2], 6 |
mov [linel2], 64 |
jmp L192 |
kk50: |
mov [wayl2], 6 |
mov [linel2], 64 |
jmp L384 |
kk21: |
mov [wayl2], 8 |
mov [linel2], 32 |
jmp L128 |
kk27: |
mov [wayl2], 8 |
mov [linel2], 32 |
jmp L512 |
kk30: |
mov [wayl2], 8 |
mov [linel2], 32 |
jmp L1024 |
kk32: |
mov [wayl2], 8 |
mov [linel2], 32 |
jmp L2048 |
kk20: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L128 |
kk23: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L256 |
kk26: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L512 |
kk29: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L1024 |
kk31: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L1024 |
kk38: |
mov [wayl2], 8 |
mov [linel2], 64 |
jmp L2048 |
kk24: |
mov [wayl2], 8 |
mov [linel2], 128 |
jmp L256 |
kk65: |
mov [wayl2], 12 |
mov [linel2], 64 |
jmp L3072 |
kk60: |
mov [wayl2], 24 |
mov [linel2], 64 |
jmp L6144 |
;;;;;;;;;;;;;;;;;;;;;;;;; L3 |
kk39: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L305 |
kk40: |
mov [wayl3], 8 |
mov [linel3], 64 |
jmp L31 |
kk41: |
mov [wayl3], 8 |
mov [linel3], 64 |
jmp L32 |
kk42: |
mov [wayl3], 8 |
mov [linel3], 64 |
jmp L34 |
kk43: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L32 |
kk44: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L34 |
kk45: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L38 |
kk53: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L34 |
kk68: |
mov [wayl3], 4 |
mov [linel3], 64 |
jmp L31 |
kk54: |
mov [wayl3], 8 |
mov [linel3], 64 |
jmp L38 |
kk74: |
mov [wayl3], 12 |
mov [linel3], 64 |
jmp L33 |
kk73: |
mov [wayl3], 12 |
mov [linel3], 64 |
jmp L315 |
kk56: |
mov [wayl3], 12 |
mov [linel3], 64 |
jmp L36 |
kk58: |
mov [wayl3], 12 |
mov [linel3], 64 |
jmp L312 |
kk46: |
mov [wayl3], 12 |
mov [linel3], 128 |
jmp L33 |
kk76: |
mov [wayl3], 16 |
mov [linel3], 64 |
jmp L32 |
kk55: |
mov [wayl3], 16 |
mov [linel3], 64 |
jmp L34 |
kk57: |
mov [wayl3], 16 |
mov [linel3], 64 |
jmp L38 |
kk59: |
mov [wayl3], 16 |
mov [linel3], 64 |
jmp L316 |
kk79: |
mov [wayl3], 24 |
mov [linel3], 64 |
jmp L312 |
kk80: |
mov [wayl3], 24 |
mov [linel3], 64 |
jmp L318 |
kk81: |
mov [wayl3], 24 |
mov [linel3], 64 |
jmp L324 |
;------------------ |
Li8: |
mov [L1i], 8 |
jmp L000 |
Li12: |
mov [L1i], 12 |
jmp L000 |
Li16: |
mov [L1i], 16 |
jmp L000 |
Li32: |
mov [L1i], 32 |
jmp L000 |
Li64: |
mov [L1i], 64 |
jmp L000 |
Ld8: |
mov [L1d], 8 |
jmp L000 |
Ld16: |
mov [L1d], 16 |
jmp L000 |
Ld24: |
mov [L1d], 24 |
jmp L000 |
Ld32: |
mov [L1d], 32 |
jmp L000 |
L96: |
mov [L2], 96 |
jmp L000 |
L128: |
mov [L2], 128 |
jmp L000 |
L192: |
mov [L2], 192 |
jmp L000 |
L256: |
mov [L2], 256 |
jmp L000 |
L384: |
mov [L2], 384 |
jmp L000 |
L512: |
mov [L2], 512 |
jmp L000 |
L1024: |
mov [L2], 1024 |
jmp L000 |
L2048: |
mov [L2], 2048 |
jmp L000 |
L3072: |
mov [L2], 3072 |
jmp L000 |
L6144: |
mov [L2], 6144 |
jmp L000 |
L305: |
mov [L3], 512 |
jmp L000 |
L31: |
mov [L3], 1024 |
jmp L000 |
L315: |
mov [L3], 1536 |
jmp L000 |
L32: |
mov [L3], 2048 |
jmp L000 |
L33: |
mov [L3], 3072 |
jmp L000 |
L34: |
mov [L3], 4096 |
jmp L000 |
L36: |
mov [L3], 6144 |
jmp L000 |
L38: |
mov [L3], 8192 |
jmp L000 |
L312: |
mov [L3], 12288 |
jmp L000 |
L316: |
mov [L3], 16384 |
jmp L000 |
L318: |
mov [L3], 18432 |
jmp L000 |
L324: |
mov [L3], 24576 |
jmp L000 |
L000: |
ret |
/programs/testing/cpuid/trunk/makefile |
---|
0,0 → 1,23 |
#!gmake |
########################### |
### Esempio per Kolibri ### |
########################### |
# Macro |
FASM=/opt/bin/fasm |
KPACK=/opt/bin/kpack |
LANG=lang.inc |
FILE=CPUID |
SOURCE=${FILE}.ASM |
OUT=${FILE}.bin |
en: |
echo "lang fix en" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
it: |
echo "lang fix it" > ${LANG} |
${FASM} ${SOURCE} ${OUT} |
clean: |
rm -f ${LANG} ${OUT} |
/programs/testing/cpuid/trunk/brand.inc |
---|
0,0 → 1,254 |
;////////////////////////////////////////////// |
;Decoding Brand ID for Intel |
decodebrand: |
cmp dword[smallvendor], 'cAMD' |
jz amd_br |
cmp dword[smallvendor], 'ntel' |
jz intel_br |
jmp Bi00 ; if not AMD or Intel |
amd_br: ;;;;;;;;;;;;;;;;;;;;; amd brand |
xor eax,eax |
inc eax |
cpuid |
cnnn0: |
test bl, bl |
jz cnnn1 |
rr: |
mov byte [brand], bl ; |
Text 60,250,0x00000000,abrand00, abrand00len-abrand00 |
ret |
;jmp comppp |
cnnn1: |
mov eax, 0x80000001 ; CPUID ext. function 0x80000001 |
cpuid |
test ebx, ebx |
je Bi00 |
mov [brand], ebx ; |
comppp: |
cmp byte [brand+1], 4 |
jb res1 |
jz res2 |
ja res3 |
res1: |
Text 60,250,0x00000000,abrand0, abrand0len-abrand0 |
ret |
res2: |
Text 60,250,0x00000000,abrand1, abrand1len-abrand1 |
ret |
res3: |
Text 60,250,0x00000000,abrand2, abrand2len-abrand2 |
ret |
;;;;;;;;;;;;;;;;;;;;; intel brand |
intel_br: |
xor eax,eax |
inc eax |
cpuid |
movzx ebx, bl |
mov [brand], ebx |
cmp0: |
test ebx, ebx |
je Bi00 |
cmp1: |
dec ebx |
je Bi01 |
cmp2: |
dec ebx |
je Bi02 |
cmp3: |
dec ebx |
je Bi03 |
cmp4: |
dec ebx |
je Bi04 |
cmp6: |
dec ebx |
dec ebx |
je Bi06 |
cmp7: |
dec ebx |
je Bi07 |
cmp8: |
dec ebx |
je Bi08 |
cmp9: |
dec ebx |
je Bi09 |
cmpA: |
dec ebx |
je Bi0A |
cmpB: |
dec ebx |
je Bi0B |
cmpC: |
dec ebx |
je Bi0C |
cmpE: |
dec ebx |
dec ebx |
je Bi0E |
cmpF: |
dec ebx |
je Bi0F |
cmp11: |
dec ebx |
dec ebx |
je Bi11 |
cmp12: |
dec ebx |
je Bi12 |
cmp13: |
dec ebx |
je Bi13 |
cmp14: |
dec ebx |
je Bi14 |
cmp15: |
dec ebx |
je Bi15 |
cmp16: |
dec ebx |
je Bi16 |
cmp17: |
dec ebx |
je Bi17 |
;------------------ |
Bi00: |
Text 60,250,0x00000000,brand0, brand0len-brand0 |
;Number 270,180,1*256,2,dword [brand],0x000000 was in v. 1.11 |
ret |
Bi01: |
Text 60,250,0x00000000,brand01, brand01len-brand01 |
ret |
Bi02: |
Text 60,250,0x00000000,brand02, brand02len-brand02 |
ret |
Bi03: |
cmp [m], 8 |
je E3 |
Text 60,250,0x00000000,brand03, brand03len-brand03 |
ret |
E3: |
Text 60,250,0x00000000,brand03d, brand03dlen-brand03d |
ret |
Bi04: |
Text 60,250,0x00000000,brand04, brand04len-brand04 |
ret |
Bi06: |
Text 60,250,0x00000000,brand06, brand06len-brand06 |
ret |
Bi07: |
Text 60,250,0x00000000,brand07, brand07len-brand07 |
ret |
Bi08: |
Text 60,250,0x00000000,brand08, brand08len-brand08 |
ret |
Bi09: |
Text 60,250,0x00000000,brand09, brand09len-brand09 |
ret |
Bi0A: |
Text 60,250,0x00000000,brand0A, brand0Alen-brand0A |
ret |
Bi0B: |
cmp [m], 13 |
jl Eb |
Text 60,250,0x00000000,brand0B, brand0Blen-brand0B |
ret |
Eb: |
Text 60,250,0x00000000,brand0Bd, brand0Bdlen-brand0Bd |
ret |
Bi0C: |
Text 60,250,0x00000000,brand0C, brand0Clen-brand0C |
ret |
Bi0E: |
cmp [m], 13 |
jl Ed |
Text 60,250,0x00000000,brand0E, brand0Elen-brand0E |
ret |
Ed: |
Text 60,250,0x00000000,brand0Ed, brand0Edlen-brand0Ed |
ret |
Bi0F: |
Text 60,250,0x00000000,brand0F, brand0Flen-brand0F |
ret |
Bi11: |
Text 60,250,0x00000000,brand11, brand11len-brand11 |
ret |
Bi12: |
Text 60,250,0x00000000,brand12, brand12len-brand12 |
ret |
Bi13: |
Text 60,250,0x00000000,brand13, brand13len-brand13 |
ret |
Bi14: |
Text 60,250,0x00000000,brand14, brand14len-brand14 |
ret |
Bi15: |
Text 60,250,0x00000000,brand15, brand15len-brand15 |
ret |
Bi16: |
Text 60,250,0x00000000,brand16, brand16len-brand16 |
ret |
Bi17: |
Text 60,250,0x00000000,brand17, brand17len-brand17 |
ret |
/programs/testing/cpuid/trunk/draw.inc |
---|
0,0 → 1,73 |
; Interface |
macro Window xStart,yStart,xSize,ySize,bColor,gColor,fColor |
{ |
__mov ebx,xStart,xSize |
__mov ecx,yStart,ySize |
__mov edx,bColor |
__mov esi,gColor |
__mov edi,fColor |
xor eax,eax |
mcall |
} |
;WriteTextToWindow |
macro Text xStart,yStart,rgbColor,pText,nTextLen |
{ |
__mov ebx,xStart,yStart |
__mov ecx,rgbColor |
__mov edx,pText |
__mov esi,nTextLen |
mov eax,4 |
mcall |
} |
;DisplayNumber |
macro Number xStart,yStart,nPrintType,noOfDigits,Data,rgbColor |
{ |
__mov edx,xStart,yStart |
__mov ebx,noOfDigits,nPrintType |
__mov ecx,Data |
__mov esi,rgbColor |
mov eax,47 |
mcall |
} |
macro DrawLine xStart,xEnd,yStart,yEnd,rgbColor |
{ |
__mov ebx,xStart,xEnd |
__mov ecx,yStart,yEnd |
__mov edx,rgbColor |
mov eax,38 |
mcall |
} |
macro PutImage xPos,yPos,xImage,yImage,pImage |
{ |
__mov ecx,xImage,yImage |
__mov edx,xPos,yPos |
__mov ebx,pImage |
mov eax,7 |
mcall |
} |
macro Button xStart,yStart,xSize,ySize,nID,rgbColor |
{ |
__mov ebx,xStart,xSize |
__mov ecx,yStart,ySize |
__mov edx,nID |
__mov esi,rgbColor |
mov eax,8 |
mcall |
} |
macro CreateTread EntryPoint,StackPos |
{ |
xor ebx,ebx |
inc ebx |
mov ecx,EntryPoint |
mov edx,StackPos |
mov eax,51 |
mcall |
} |
/programs/testing/cpuid/trunk/rsatest.inc |
---|
0,0 → 1,598 |
;testing speed of RSA coding (256 bit) |
;for program CPUID (WildWest) |
;author: halyavin |
;structure of long number: |
;rd 1 : length of number |
;rd 39: digits of number |
;length of zero number is equal to 1. |
number_digits=39 |
number_size=4*(number_digits+1) |
;calling convention: |
;procedures can change eax,ecx,edx |
init_rsatest: |
;to do: add initialization which depends on processor. |
ret |
set_zero: |
;eax - address of number |
;[eax]:=0 |
;result: eax isn't changed |
xor ecx,ecx |
xor edx,edx |
inc edx |
mov dword [eax],edx |
mov edx,39 |
add eax,4 |
.loop: |
mov dword [eax],ecx |
add eax,4 |
dec edx |
jnz .loop |
sub eax,160 ;size of number |
ret |
ladd: |
;eax - first number |
;edx - second number |
;[eax]:=[eax]+[edx] |
pushad |
mov ecx,dword [eax] |
mov esi,dword [edx] |
mov ebp,eax |
cmp ecx,esi |
jg .l1 |
mov ecx,esi |
.l1: |
add eax,4 |
add edx,4 |
xor ebx,ebx |
xor esi,esi |
mov edi,ecx |
.l2: |
add ebx,dword [eax] |
adc ebx,dword [edx] |
adc esi,esi |
mov dword [eax],ebx |
mov ebx,esi |
add eax,4 |
xor esi,esi |
add edx,4 |
dec ecx |
jnz .l2 |
test ebx,ebx |
jz .lend |
inc dword [eax] |
inc edi |
.lend: |
mov eax,ebp |
mov dword [eax],edi |
popad |
ret |
lsub: |
;eax - first number |
;edx - second number |
;[eax]=[eax]-[edx] |
;[eax]>=[edx] |
pushad |
mov ecx,dword [eax] |
mov edi,ecx |
mov ebp,eax |
add eax,4 |
add edx,4 |
xor ebx,ebx |
xor esi,esi |
.l1: |
mov esi,dword [eax] |
sub esi,ebx |
sbb esi,dword [edx] |
mov dword [eax],esi |
sbb esi,esi |
mov ebx,esi |
neg ebx |
add eax,4 |
add edx,4 |
dec ecx |
jnz .l1 |
dec edi |
jz .lend |
sub eax,4 |
.l2: |
mov ebx,dword [eax] |
test ebx,ebx |
jnz .lend |
sub eax,4 |
dec edi |
jnz .l2 |
.lend: |
inc edi |
mov eax,ebp |
mov [eax],edi |
popad |
ret |
lcmp: |
;eax - address of number |
;edx - address of number |
;result: ecx=1 if eax>edx |
; ecx=0 if eax=edx |
; ecx=-1 if eax<edx |
push ebx |
mov ebx,dword [eax] |
cmp ebx,dword [edx] |
jg .l1 |
jl .l2 |
push esi |
push eax |
push edx |
lea eax,[eax+4*ebx] |
lea edx,[edx+4*ebx] |
.l3: |
mov esi,dword [eax] |
cmp esi,dword [edx] |
ja .l4 |
jb .l5 |
sub eax,4 |
sub edx,4 |
dec ebx |
jnz .l3 |
xor ecx,ecx |
.lend: |
pop edx |
pop eax |
pop esi |
pop ebx |
ret |
.l4: |
mov ecx,1 |
jmp .lend |
.l5: |
mov ecx,-1 |
jmp .lend |
.l1: |
mov ecx,1 |
pop ebx |
ret |
.l2: |
mov ecx,-1 |
pop ebx |
ret |
lshr: |
;eax - number |
;edx - shift |
;[eax]=[eax] shr edx |
cmp edx,32 |
jl .general |
mov ecx,edx |
shr ecx,5 |
and edx,31 |
push esi |
mov esi,ecx |
cmp ecx,dword [eax] |
jng .norm |
xor esi,esi |
mov ecx,dword [eax] |
.norm: |
push edi |
push ebp |
mov ebp,eax |
add eax,4 |
.loop1: |
test esi,esi |
jz .endloop1 |
mov edi,dword [eax+4*ecx] |
mov dword [eax],edi |
add eax,4 |
dec esi |
jmp .loop1 |
.endloop1: |
mov eax,ebp |
mov esi,dword [eax] |
lea eax,[eax+4*esi] |
xor edi,edi |
mov esi,ecx |
.loop2: |
mov dword [eax],edi |
sub eax,4 |
dec ecx |
jnz .loop2 |
mov eax,ebp |
sub dword [eax],esi |
jz .len0 |
.lend1: |
pop ebp |
pop edi |
pop esi |
jmp .general |
.len0: |
inc dword [eax] |
jmp .lend1 |
.general: |
test edx,edx |
jz .lend |
push ebx |
push esi |
push edi |
push ebp |
push eax |
mov ebx,dword [eax] |
lea eax,[eax+4*ebx] |
mov ecx,edx |
sub ecx,32 |
neg ecx |
mov esi,1 |
shl esi,cl |
dec esi |
mov ecx,edx |
xor ebp,ebp |
.loop3: |
mov edi,dword [eax] |
ror edi,cl |
mov edx,edi |
and edx,esi |
or edx,ebp |
mov dword [eax],edx |
mov edx,esi |
not edx |
and edi,edx |
mov ebp,edi |
sub eax,4 |
dec ebx |
jnz .loop3 |
pop eax |
mov ebx,dword [eax] |
mov ecx,dword [eax+4*ebx] |
dec ebx |
jz .norm1 |
test ecx,ecx |
jnz .norm1 |
dec dword [eax] |
.norm1: |
pop ebp |
pop edi |
pop esi |
pop ebx |
.lend: |
ret |
lshl: |
;eax - number |
;edx - shift |
;[eax]:=[eax] shl edx |
cmp edx,32 |
jl .general |
cmp dword [eax],1 |
jnz .l1 |
cmp dword [eax+4],0 |
jnz .l1 |
ret |
.l1: |
push esi |
push ebx |
mov ecx,edx |
shr ecx,5 |
and edx,31 |
mov ebx,dword [eax] |
add dword [eax],ecx |
lea eax,[eax+4*ebx] |
.loop1: |
mov esi,dword [eax] |
mov dword [eax+4*ecx],esi |
sub eax,4 |
dec ebx |
jnz .loop1 |
xor esi,esi |
lea eax,[eax+4*ecx] |
.loop2: |
mov dword [eax],esi |
sub eax,4 |
dec ecx |
jnz .loop2 |
pop ebx |
pop esi |
jmp .general |
.general: |
test edx,edx |
jz .lend |
pushad |
mov ecx,edx |
mov ebx,1 |
shl ebx,cl |
dec ebx |
mov edx,dword [eax] |
xor esi,esi |
lea eax,[eax+4*edx] |
.loop3: |
mov edi,dword [eax] |
rol edi,cl |
mov ebp,edi |
and ebp,ebx |
add esi,ebp |
mov dword [eax+4],esi |
mov ebp,ebx |
not ebp |
and edi,ebp |
mov esi,edi |
sub eax,4 |
dec edx |
jnz .loop3 |
mov dword [eax+4],esi |
mov edx,dword [eax] |
cmp dword [eax+4*edx+4],0 |
jz .l2 |
inc dword [eax] |
.l2: |
popad |
.lend: |
ret |
lwrite_bit: |
;eax - address of number |
;edx - number of bit |
;set bit to 1. First bit has number 0. |
mov ecx,edx |
shr edx,5 |
inc edx |
cmp dword [eax],edx |
jg .norm |
mov dword [eax],edx |
.norm: |
push ebx |
mov ebx,1 |
shl ebx,cl |
or dword [eax+4*edx],ebx |
pop ebx |
ret |
lcopy: |
;eax - address of first number |
;edx - address of second number |
;[eax]:=[edx] |
push ebx |
push esi |
push eax |
push edx |
push dword [eax] |
mov ebx,dword [edx] |
mov ecx,ebx |
add edx,4 |
add eax,4 |
.loop1: |
mov esi,dword [edx] |
mov dword [eax],esi |
add eax,4 |
add edx,4 |
dec ecx |
jnz .loop1 |
pop ecx |
sub ecx,ebx |
jng .l1 |
xor esi,esi |
.loop2: |
mov dword [eax],esi |
add eax,4 |
dec ecx |
jnz .loop2 |
.l1: |
pop edx |
pop eax |
mov dword [eax],ebx |
pop esi |
pop ebx |
ret |
lmul: |
;eax - first number |
;edx - second number |
;ecx - third number |
;[eax]:=[ecx]*[edx] |
push ecx |
push edx |
call set_zero |
pop edx |
pop ecx |
pushad |
sub esp,16 ; local variables |
mov ebp,edx |
mov ebx,dword [edx] |
mov dword [esp],ebx |
mov ebx,dword [ecx] |
mov dword [esp+4],ebx |
mov ebx,eax |
add ebp,4 |
add ecx,4 |
add ebx,4 |
xor esi,esi |
mov dword [esp+8],esi |
.loop1: |
xor esi,esi |
mov dword [esp+12],esi |
.loop2: |
mov eax,dword [esp+12] |
mov eax,dword [ecx+4*eax] |
mov edi,dword [esp+8] |
mov edi,dword [ebp+4*edi] |
mul edi |
add eax,esi |
adc edx,0 |
mov edi,dword [esp+12] |
add edi,dword [esp+8] |
add eax,dword [ebx+4*edi] |
adc edx,0 |
mov dword [ebx+4*edi],eax |
mov esi,edx |
inc dword [esp+12] |
mov eax,dword [esp+4] |
cmp dword [esp+12],eax |
jnz .loop2 |
test esi,esi |
jz .loop1end |
mov eax,dword [esp+12] |
add eax,dword [esp+8] |
mov [ebx+4*eax],esi |
.loop1end: |
inc dword [esp+8] |
mov eax,dword [esp] |
cmp dword [esp+8],eax |
jnz .loop1 |
add esp,16 |
sub ebx,4 |
mov ecx,39 |
xor edx,edx |
.loop3: |
cmp dword [ebx+4*ecx],edx |
jnz .loop3end |
dec ecx |
jnz .loop3 |
.loop3end: |
test ecx,ecx |
jnz .l1 |
inc ecx |
.l1: |
mov dword [ebx],ecx |
popad |
ret |
lmod: |
;eax - address of first number |
;edx - address of second number |
;[eax]:=[eax] mod [edx] |
mov ecx,dword [eax] |
sub ecx,dword [edx] |
jl .lend |
pushad |
inc ecx |
mov ebp,eax |
mov eax,edx |
mov edi,eax |
shl ecx,5 |
mov edx,ecx |
mov esi,ecx |
call lshl |
.loop: |
mov eax,ebp |
mov edx,edi |
call lcmp |
test ecx,ecx |
jl .l1 |
call lsub |
.l1: |
dec esi |
js .endloop |
mov eax,edx |
mov edx,1 |
call lshr |
jmp .loop |
.endloop: |
popad |
.lend: |
ret |
rsacode: |
;eax - address of message |
;edx - open key |
;ecx - address of module |
;esi - temparary number1 |
;edi - temparary number2 |
;esi - [eax]^edx mod (ecx) |
;[eax] is changed. |
push eax |
push edx |
push ecx |
xchg eax,esi |
call set_zero |
mov dword [eax+4],1 |
mov esi,eax |
mov eax,edi |
call set_zero |
.loop: |
mov ecx,dword [esp+4] |
test ecx,1 |
jz .l1 |
mov eax,edi |
mov edx,esi |
mov ecx,dword [esp+8] |
call lmul |
mov edx,dword [esp] |
call lmod |
mov eax,esi |
mov edx,edi |
call lcopy |
.l1: |
shr dword [esp+4],1 |
jz .endloop |
mov edx,dword [esp+8] |
mov ecx,edx |
mov eax,edi |
call lmul |
mov edx,dword [esp] |
call lmod |
mov eax,dword [esp+8] |
mov edx,edi |
call lcopy |
jmp .loop |
.endloop: |
pop ecx |
pop edx |
pop eax |
ret |
rsa_test: |
mov eax,num1 |
mov dword [eax],16 |
mov ecx,1 |
mov edx,16 |
.loop: |
add eax,4 |
mov dword [eax],ecx |
dec edx |
jnz .loop |
mov eax,num1 |
mov ebx,[iter] |
mov dword [eax+4],ebx |
inc dword [iter] |
mov edx,[openkey] |
mov ecx,module |
mov esi,num2 |
mov edi,num3 |
call rsacode |
ret |
init_test: |
xor eax,eax |
mov [iter],eax |
mov [openkey],10007 |
mov eax,num2 |
call set_zero |
mov eax,num3 |
call set_zero |
ret |
module: |
;module=p*q. |
;where |
;p= |
;dd 9 |
;dd 147,2,3,4,5,6,7,8,9 |
;times 30 dd 0 |
;q= |
;dd 9 |
;dd 163,4,5,6,7,8,9,10,11 |
;times 30 dd 0 |
dd 17 |
dd 23961,914,1232,1556,1887,2226,2574,2932,3301,288,308,314,305,280,238,178,99 |
times 22 dd 0 |
;in decimal |
;p=1042128803351525332193283695592003066548124262686459610611886292768993621049491 |
;q=1273712981880077616387281148672409277231717442781838063285512054053473668300963 |
;n=1327372985619988354987062708438042005329282516404896732667039640816200186465366322016844458439816997285872910403676793109807015096535910981266920474905959833 |