Skip to content

rdtsc register order incorrect #1304

@samek-h

Description

@samek-h

In this example, the order of registers is in the rdtsc instruction is written as follows:

   Asm ("rdtsc",
        Outputs =>
          (Unsigned_32'Asm_Output ("=a", High),
           Unsigned_32'Asm_Output ("=d", Low)),
        Volatile => True);

But the rdtsc stores the 32-bit parts of the value the other way around - low into EAX, high into EDX.

From the intel Manual: "The EDX register is loaded with the high-order 32 bits of the MSR and the EAX register is loaded with the low-order 32 bits. "

For more details, refer to Intel® 64 and IA-32 Architectures Software Developer’s Manual, vol. 2B, chapter 4.3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeedbackFeedback from users about their experiencebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions