Mail Archives: djgpp/1997/03/27/02:21:07
Hi,
I am coding FPU context switch with Pentium processor using fnsave and
frstor FPU instructions. And I found these FPU instructions behaves
differently between real mode and protected mode.
See the following code:
int i;
char fpusave[124];
fpusave[0] = 0x7f; fpusave[1] = 0x03;
fpusave[2] = 0x00; fpusave[3] = 0x00;
fpusave[4] = 0xff; fpusave[5] = 0xff;
asm {
frstor fpusave
fwait
fnsave fpusave
fwait
}
for( i = 0; i < 124; i++ )
printf("%x ", fpusave[i]);
When compiled with bcc -B, it output 7f 03 00 00 ff ....
but when compiled with bcc32 and PMC protectd library, it output 7f 03
ff ff 7f 7f .....
Also when compiled with djgpp in DOS and gcc in linux after inline
assembly code is modified, it output the same as bcc32 and PMC lib: 7f
03 ff ff 7f 7f ....
What happened to FPU in protected mode?
Thanks in advance.
Heo Sung-Gwan
---
E-mail: heo AT turbotek DOT co DOT kr
- Raw text -