From: Heo Sung-Gwan Newsgroups: comp.os.msdos.programmer,comp.lang.asm.x86,comp.os.msdos.djgpp,comp.unix.pc-clone.32bit Subject: FPU and protected mode Date: Thu, 27 Mar 1997 11:47:23 +0900 Organization: S/W Team, Turbo Tek Lines: 39 Message-ID: <3339DFBB.3A4B@turbotek.co.kr> Reply-To: heo AT turbotek DOT co DOT kr NNTP-Posting-Host: 203.239.124.66 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit CC: heo AT turbotek DOT co DOT kr To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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