The MASM Forum

Projects => MASM32 => Topic started by: v0xX on February 23, 2024, 04:52:52 AM

Title: convert rdpru do cycle count
Post by: v0xX on February 23, 2024, 04:52:52 AM
i want convert rdpru on amd platform do cycle count like rdtsc  we do like this

.CODE
GetRdpruCycle PROC
lfence
mov rcx, 0E8h ; load aperf into rdpru for cycle count
db 0Fh, 01h, 0F9h
lfence
shl rdx, 32
or rax, rdx
ret
GetRdpruCycle ENDP
END
Title: Re: convert rdpru do cycle count
Post by: jj2007 on February 23, 2024, 05:59:42 AM
Come on, don't be lazy: tell us in detail what you want, and what is your problem. I refuse to invest time on such a cryptic-minimalistic request for help.