.586p .model flat, stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\kernel32.inc include \masm32\include\user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib .data szCaption db "CPU speed (MHz)", 0 szFormat db "%u", 0 .data? timerHi dd ? timerLo dd ? szBuffer db 42 dup (?) .const delay dd 500 constant dd 1000 .code determineSpeed proc LOCAL prClass:DWORD, priority:DWORD pushad invoke Sleep, 0 rdtsc mov [timerLo], eax mov [timerHi], edx invoke Sleep, delay xor eax, eax rdtsc rdtsc sub eax, [timerLo] sbb edx, [timerHi] mov [timerLo], eax mov [timerHi], edx finit fild dword ptr [constant] fild dword ptr [delay] fmulp st(1), st fild dword ptr [timerLo] fxch fdivp st(1), st frndint fistp dword ptr [esp + 28] wait popad ret determineSpeed endp start: invoke Sleep, 100 call determineSpeed invoke wsprintf, addr szBuffer, addr szFormat, eax invoke MessageBox, NULL, addr szBuffer, addr szCaption, MB_OK invoke ExitProcess, 0 end start Попытаюсь перевести это в VB...
Ответить
|