Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public calculate_xors
- public calculate_xchgs
- public get_cpuinfo
- .data
- real_num dd 0
- .code
- calculate_xors proc
- xor r8, r8
- xor r9, r9
- rdtsc
- or r8, rdx
- shl r8, 32
- or r8, rax
- mov rcx, 10000
- loopmark:
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- xor r9, r8
- xor r8, r9
- xor r9, r8
- loop loopmark
- rdtsc
- or r9, rdx
- shl r9, 32
- or r9, rax
- mov rax, r9
- sub rax, r8
- ret
- calculate_xors endp
- calculate_xchgs proc
- xor r8, r8
- xor r9, r9
- rdtsc
- or r8, rdx
- shl r8, 32
- or r8, rax
- mov rcx, 10000
- loopmark:
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- xchg r8, r9
- loop loopmark
- rdtsc
- or r9, rdx
- shl r9, 32
- or r9, rax
- mov rax, r9
- sub rax, r8
- ret
- calculate_xchgs endp
- get_cpuinfo proc
- push rax
- mov r8, rcx
- mov eax, 80000002h
- cpuid
- mov [r8+0], eax
- mov [r8+4], ebx
- mov [r8+8], ecx
- mov [r8+12], edx
- add r8, 16
- mov eax, 80000003h
- cpuid
- mov [r8+0], eax
- mov [r8+4], ebx
- mov [r8+8], ecx
- mov [r8+12], edx
- add r8, 16
- mov eax, 80000004h
- cpuid
- mov [r8+0], eax
- mov [r8+4], ebx
- mov [r8+8], ecx
- mov [r8+12], edx
- add r8, 16
- pop rax
- ret
- get_cpuinfo endp
- end
Advertisement
Add Comment
Please, Sign In to add comment