Subversion Repositories Kolibri OS

Rev

Rev 451 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 451 Rev 485
Line 26... Line 26...
26
  dd U_END+4096
26
  dd U_END+4096
27
  dd U_END+4096
27
  dd U_END+4096
28
  dd	 0x0
28
  dd	 0x0
29
  dd	 0x0
29
  dd	 0x0
Line 30... Line 30...
30
 
30
 
31
macro udata
-
 
32
{
-
 
33
}
-
 
34
 
31
include '..\..\..\macros.inc' ; useful macroses
35
include 'mos_uzel.inc'
32
include 'draw.inc'
36
; useful macroses and Brand ID decoding
-
 
37
include 'caches.inc'
33
include 'brand.inc'           ;Brand ID decoding
38
;(L1 and L2 cashes decoding for Intel)
-
 
39
include 'multipli.inc'
34
include 'caches.inc'          ;(L1 and L2 cashes decoding for Intel)
40
;(multiplier decoding)
35
include 'multipli.inc'        ;(multiplier decoding)
41
include 'features.inc'
-
 
Line 42... Line -...
42
;(features decoding)
-
 
43
 
36
include 'features.inc'        ;(features decoding)
Line 44... Line 37...
44
include 'gif2img.inc'
37
 
45
; include macros to convert gif to img
38
include 'gif2img.inc'         ;macros to convert gif to img
Line 53... Line 46...
53
;------------
46
;------------
54
CYCLES:
47
CYCLES:
55
;    CPU speed
48
;    CPU speed
56
    mov eax, 18
49
    mov eax, 18
57
    mov ebx,5
50
    mov ebx,5
58
    int 0x40
51
    mcall
59
    mov [total1],eax  ;in Hz,  example 1600490000
52
    mov [total1],eax  ;in Hz,  example 1600490000
60
    xor  edx,edx
53
    xor  edx,edx
61
    mov  ebx,1000000
54
    mov  ebx,1000000
62
    div  ebx
55
    div  ebx
63
    mov [total], eax  ; in Mhz,  example 1600
56
    mov [total], eax  ; in Mhz,  example 1600
Line 462... Line 455...
462
 
455
 
Line 463... Line 456...
463
Text 75,70,0x00000000,AMDn, AMDnlen-AMDn
456
Text 75,70,0x00000000,AMDn, AMDnlen-AMDn
464
 
457
 
465
	mov	esi, amd
458
	mov	esi, amd
466
	call	load_gif
459
	call	load_gif
Line 467... Line 460...
467
PutImage 125,107,201,49,img_area+8
460
PutImage 135,97,201,49,img_area+8
468
;         place   size
461
;         place   size
469
 
462
 
Line 1063... Line 1056...
1063
  ;  mov   eax,dword 0x00000004
1056
  ;  mov   eax,dword 0x00000004
1064
  ;  mov   ebx,115*65536+80
1057
  ;  mov   ebx,115*65536+80
1065
  ;  mov   ecx,dword 0x00000000
1058
  ;  mov   ecx,dword 0x00000000
1066
  ;  mov   edx,PF0c
1059
  ;  mov   edx,PF0c
1067
  ;  mov   esi,PF0clen-PF0c
1060
  ;  mov   esi,PF0clen-PF0c
1068
  ;  int   0x40
1061
  ;  mcall
1069
  ;jmp MMXtest
1062
  ;jmp MMXtest
1070
;.ppF1:
1063
;.ppF1:
1071
Text 110,70,0x00000000,PF0, PF0len-PF0
1064
Text 110,70,0x00000000,PF0, PF0len-PF0
1072
 jmp MMXtest
1065
 jmp MMXtest
1073
.IF2:
1066
.IF2:
Line 1578... Line 1571...
1578
    ;================_RAM_==============
1571
    ;================_RAM_==============
1579
  Number 200,340,0,4,dword [ram_size_a],0xFFFFFF
1572
  Number 200,340,0,4,dword [ram_size_a],0xFFFFFF
Line 1580... Line 1573...
1580
 
1573
 
1581
  mov eax, 18
1574
  mov eax, 18
1582
  mov ebx, 16
1575
  mov ebx, 16
Line 1583... Line 1576...
1583
  int 0x40
1576
  mcall
Line 1584... Line 1577...
1584
 
1577
 
Line 1585... Line 1578...
1585
  shr eax, 10
1578
  shr eax, 10
1586
 
1579
 
1587
  mov [ram_size_a], eax
1580
  mov [ram_size_a], eax
Line 1588... Line 1581...
1588
 
1581
 
Line 1589... Line 1582...
1589
  mov eax, 18
1582
  mov eax, 18
Line 1601... Line 1594...
1601
  Number 270,340,0,4,dword [ram_size_t],0x000000
1594
  Number 270,340,0,4,dword [ram_size_t],0x000000
1602
  Text 300,340,0x00000000,mb, mblen-mb
1595
  Text 300,340,0x00000000,mb, mblen-mb
Line 1603... Line 1596...
1603
 
1596
 
Line 1604... Line -...
1604
;==============================
-
 
1605
 
1597
;==============================
-
 
1598
 
1606
	mov	ebx,50	     ; æäåìñ 1 ñåê
1599
	mov	eax,23	     ; ôóíêöèÿ 23: îæèäàíèå ñîáûòèÿ
Line 1607... Line -...
1607
	mov	eax,23	     ; ôóíêöèÿ 23: îæèäàíèå ñîáûòèÿ
-
 
1608
	int	0x40
-
 
1609
 
1600
	mov	ebx,50	     ; æäåìñ 0.5 ñåê
1610
;    mov  eax,10
1601
	mcall
1611
;    int  0x40           ;
1602
 
1612
    cmp  eax,1		; 
1603
    cmp  eax,1		; 
1613
    je	 red		;  redraw
1604
    je	 red		;  redraw
1614
    cmp  eax,2		; 
1605
    cmp  eax,2		; 
1615
    je	 key		;  key
1606
    je	 key		;  key
1616
    cmp  eax,3		; 
1607
    cmp  eax,3		; 
1617
    je	 button 	;  button
1608
    je	 button 	;  button
1618
    jmp  still		; 
1609
    jmp  still		; 
1619
  key:			; 
1610
  key:			; 
1620
    mov  eax,2		;  
1611
    mov  eax,2		;  
1621
    int  0x40		; 
1612
    mcall		; 
1622
    jmp  still		; 
1613
    jmp  still		; 
1623
  button:		; 
1614
  button:		; 
1624
    mov  eax,17 	; 
1615
    mov  eax,17 	; 
Line 1625... Line 1616...
1625
    int  0x40		; 
1616
    mcall		; 
1626
    cmp  ah,1		;  = 1 ?
1617
    cmp  ah,1		;  = 1 ?
Line 1679... Line 1670...
1679
noclose:
1670
noclose:
1680
    jmp  still		
1671
    jmp  still		
Line 1681... Line 1672...
1681
 
1672
 
1682
close:
1673
close:
1683
    mov   eax,-1	
1674
    mov   eax,-1	
Line 1684... Line 1675...
1684
    int  0x40	       
1675
    mcall	       
1685
 
1676
 
Line 1686... Line 1677...
1686
;**************************** THREAD-SECOND WINDOW
1677
;**************************** THREAD-SECOND WINDOW
Line 1698... Line 1689...
1698
 module_test:
1689
 module_test:
1699
;test rsa coding speed
1690
;test rsa coding speed
1700
;length of module - 256 bit
1691
;length of module - 256 bit
1701
  mov  eax,26
1692
  mov  eax,26
1702
  mov  ebx,9
1693
  mov  ebx,9
1703
  int  0x40
1694
  mcall
1704
  add  eax,100 ;test lasts 1 second.
1695
  add  eax,100 ;test lasts 1 second.
1705
  push eax
1696
  push eax
1706
.loop:
1697
.loop:
1707
  mov  ecx,4 ;do 4 iterations
1698
  mov  ecx,4 ;do 4 iterations
1708
  push ecx   ;this reduces number of calls int 0x40.
1699
  push ecx   ;this reduces number of calls mcall.
1709
.loop1:
1700
.loop1:
1710
  call rsa_test   ;this procedure change all registers
1701
  call rsa_test   ;this procedure change all registers
1711
  dec  dword [esp]
1702
  dec  dword [esp]
1712
  jnz  .loop1
1703
  jnz  .loop1
1713
  pop  ecx
1704
  pop  ecx
1714
  mov  eax,26
1705
  mov  eax,26
1715
  mov  ebx,9
1706
  mov  ebx,9
1716
  int  0x40
1707
  mcall
1717
  cmp  eax,dword [esp]	 ;Is time changed?
1708
  cmp  eax,dword [esp]	 ;Is time changed?
1718
  jl   .loop
1709
  jl   .loop
1719
  pop  eax
1710
  pop  eax
1720
  shr  dword [iter],4 ;[iter] - speed in Kb/sec. (every iteration codes 64 bytes)
1711
  shr  dword [iter],4 ;[iter] - speed in Kb/sec. (every iteration codes 64 bytes)
1721
  ret
1712
  ret
Line 1731... Line 1722...
1731
    call draw_window_2	
1722
    call draw_window_2	
Line 1732... Line 1723...
1732
 
1723
 
Line 1733... Line 1724...
1733
still_2:		
1724
still_2:		
1734
 
1725
 
Line 1735... Line 1726...
1735
    mov  eax,10 	
1726
    mov  eax,10 	
1736
    int  0x40		
1727
    mcall		
1737
 
1728
 
1738
    cmp  eax,1		
1729
    cmp  eax,1		
Line 1744... Line 1735...
1744
 
1735
 
Line 1745... Line 1736...
1745
    jmp  still_2	; 
1736
    jmp  still_2	; 
1746
 
1737
 
1747
  key_2:		; 
1738
  key_2:		; 
1748
    mov  eax,2		;   2 
1739
    mov  eax,2		;   2 
Line 1749... Line 1740...
1749
    int  0x40		; 
1740
    mcall		; 
1750
    jmp  still_2	; 
1741
    jmp  still_2	; 
1751
 
1742
 
Line 1752... Line 1743...
1752
  button_2:		; 
1743
  button_2:		; 
1753
    mov  eax,17 	; 17 
1744
    mov  eax,17 	; 17 
Line 1754... Line 1745...
1754
    int  0x40		; 
1745
    mcall		; 
Line 1755... Line 1746...
1755
 
1746
 
1756
    cmp  ah,1		; = 1 ?
1747
    cmp  ah,1		; = 1 ?
Line 1757... Line 1748...
1757
    jne  noclose_2	; noclose
1748
    jne  noclose_2	; noclose
Line 1758... Line 1749...
1758
 
1749
 
Line 1759... Line 1750...
1759
    mov  [num_win2],0	; 
1750
    mov  [num_win2],0	; 
1760
 
1751
 
1761
    or	 eax,-1 	; 
1752
    or	 eax,-1 	; 
1762
    int  0x40
1753
    mcall
Line 1763... Line 1754...
1763
 
1754
 
1764
  noclose_2:
1755
  noclose_2:
Line 1872... Line 1863...
1872
 
1863
 
Line 1873... Line 1864...
1873
Number 95,350,0,5,dword [iter],0x000000; RSA test results
1864
Number 95,350,0,5,dword [iter],0x000000; RSA test results
1874
 
1865
 
1875
    mov  eax,12
1866
    mov  eax,12
Line 1876... Line 1867...
1876
    mov  ebx,2h
1867
    mov  ebx,2h
Line 1877... Line 1868...
1877
    int  0x40
1868
    mcall
Line 1878... Line 1869...
1878
 
1869
 
Line 1879... Line 1870...
1879
    ret
1870
    ret
1880
 
1871
 
1881
num_win2 db 0
1872
num_win2 db 0
1882
 
1873
 
Line 1883... Line 1874...
1883
;   *******  main window *******
1874
;   *******  main window *******
1884
 
1875
 
Line 1885... Line 1876...
1885
draw_window:
1876
draw_window:
Line 1886... Line 1877...
1886
   mov eax,12
1877
   mov eax,12
Line 1899... Line 1890...
1899
;         place   size
1890
;         place   size
Line 1900... Line 1891...
1900
 
1891
 
1901
 
1892
 
1902
    mov  eax,12
1893
    mov  eax,12
Line 1903... Line 1894...
1903
    mov  ebx,2h
1894
    mov  ebx,2h
Line 1904... Line 1895...
1904
    int  0x40
1895
    mcall
1905
 
1896
 
Line 1985... Line 1976...
1985
	gif2img esi,edi
1976
	gif2img esi,edi
1986
	ret
1977
	ret
Line 1987... Line 1978...
1987
 
1978
 
Line 1988... Line 1979...
1988
; DATA AREA
1979
; DATA AREA
Line 1989... Line 1980...
1989
 
1980
 
1990
header    db   'CPUID 2.19 by S.Kuzmin & the KolibriOS team',0
1981
title    db   'CPUID 2.2 by S.Kuzmin & the KolibriOS team',0
1991
 
1982
 
Line 2510... Line 2501...
2510
myname:
2501
myname:
2511
   rb 48
2502
   rb 48
2512
mynamelen:
2503
mynamelen:
Line 2513... Line 2504...
2513
 
2504
 
2514
align 4
2505
align 4
2515
  udata
2506
 
2516
  thread2_stack_area rb 64
2507
  thread2_stack_area rb 64
2517
  thread2_esp = $
2508
  thread2_esp = $