CPUID and trap problem
Posted: Mon Nov 25, 2002 2:37 pm
I'm having some problems with the EFLAGS ID-bit method of detecting if a cpu has the cpuid instruction.
I pushfd, store the flags, switch bit 21, push it on the stack, and popfd, and this works ok.
But when I pushfd again to compare the bit 21 with the stored value, It Reboots (Real hardware) or 3rd Exception CPU (Bochs) (interrupts are disabled, I think it's a trap)
But If i pushfd and popfd the second time with no code inbetween, there is no problem.
What am I doing wrong?
I pushfd, store the flags, switch bit 21, push it on the stack, and popfd, and this works ok.
But when I pushfd again to compare the bit 21 with the stored value, It Reboots (Real hardware) or 3rd Exception CPU (Bochs) (interrupts are disabled, I think it's a trap)
But If i pushfd and popfd the second time with no code inbetween, there is no problem.
What am I doing wrong?