.486 ;# Create 32 bit code
.model flat, stdcall ;# 32 bit memory model
option casemap :none ;# Case sensitive
include Macros.inc ;# Macros 'n stuff
.code
start:
MyProc proc
LOCAL nTemp :DWORD
push ebx
;Debug
; int 3
;Check that the CPUID instruction is supported
pushfd
pop eax
btc eax, 15h
push eax
popfd
pushfd
pop edx
xor eax, edx
jz _cpuid_supported
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor edx, edx
jmp _set_results
_cpuid_supported:
mov eax,[ebp+0Ch]
db 0Fh, 0A2h ;# CPUID
_set_results:
mov nTemp, edx
mov edx,[ebp+10h]
mov [edx], eax
mov edx,[ebp+14h]
mov [edx], ebx
mov edx,[ebp+18h]
mov [edx], ecx
mov edx,[ebp+1Ch]
mov eax, nTemp
mov [edx], eax
pop ebx
xor eax, eax
ret 18h
MyProc endp
end start
CPU
Monitoring Code
.586 ;# Create 32 bit code, pentium instructions allowed
.model flat, stdcall ;# 32 bit memory model
option casemap :none ;# Case sensitive
include Macros.inc
.code
start:
CpuClk proc
rdtsc ;# Read the cpu clock cycle count into eax/edx
mov ecx, dword ptr [esp+08h] ;# Address of Currency parameter into ecx
mov [ecx], eax ;# Put eax to the low part of the currency variable
mov [ecx+4], edx ;# Put edx to the high part of the currency variable
xor eax, eax ;# Clear eax
ret 8 ;# Return
CpuClk endp
end start
; David Fritts corrected by Robert Rayment
.486 ;# Create 32 bit code
.model flat, stdcall ;# 32 bit memory model
option casemap :none ;# Case sensitive
include Macros.inc ;# Macros 'n stuff
.code
start:
shiftright proc
mov eax, dword ptr [esp+08h] ; value
mov ecx, dword ptr [esp+0Ch] ; shift
mov edx, dword ptr [esp+10h] ; hresult
shr eax, cl
mov dword ptr [edx], eax
xor eax, eax
ret 16
shiftright endp
end start
Monitoring Software Free Download
CPU Monitoring software is a freeware. please enjoy it.
support@cpu-monitoring.com