From: raymoon@dgsys.com (Raymond Moon) Newsgroups: alt.lang.asm,comp.lang.asm.x86,news.answers,alt.answers,comp.answers Subject: x86 Assembly Language FAQ - General Part 2/3 Supersedes: <4e40km$2bi@news.dgsys.com> Followup-To: alt.lang.asm,comp.lang.asm.x86 Date: 21 Feb 1996 01:31:07 GMT Organization: MoonWare Lines: 657 Approved: news-answers-request@MIT.EDU Distribution: world Expires: Wed, 20 Mar 1996 23:59:59 GMT Message-ID: <4gdskr$o9c@news.dgsys.com> Reply-To: raymoon@moonware.dgsys.com Summary: This is the FAQ for the x86 Assembly Language programmers for the alt.lang.asm and comp.lang.asm.x86 newsgroups. This particular section of the FAQ is part two of three parts that contain x86 assembly language information common to all assemblers. Keywords: x86 Assemby Language ASM FAQ General Archive-name: assembly-language/x86/general/part2 Posting-Frequency: monthly (21st of every month) Last-modified: 1996/02/17 ------------------------------ Subject: 15. How To Determine If A Pentium With The FDIV Problem Is Present The following is a short assembly language program that can detect the FDIV error: (It has been pointed out to me that the test against zero may lead to a false positive. On my 387, the result is exactly zero so that is why I coded it that way. PENERR has been tested on and identifies a Pentium with the FDIV error.) ================================================================= ; PENERR.ASM - Determines if Pentium FDIV error is present ; Version 1.00 ; Copyright 1994 - Raymond Moon ; This program is free for all to use. .286 .287 DGROUP GROUP _TEXT, _DATA _DATA SEGMENT PARA PUBLIC 'DATA' ; Data segment x dd 4195835 y dd 3145727 OK byte 'No Error$' ERR byte 'Pentium Error Present', 7, '$' _DATA ENDS _TEXT SEGMENT WORD PUBLIC 'CODE' ; Code segment assume cs:DGROUP, ds:DGROUP org 100h START: finit fld x fld st fld y ; 0 = y; 1 & 2 = x fdiv st(2), st ; 0 = y; 1 = x; 2 = x/y fmulp st(2), st ; 0 = x, 1 = (x/y)*y fsubp st(1), st ; 0 = (x/y)*y-x => should be zero fldz ; 0 = 0; 1 = (x/y)*y-x fcomp st(1) ; Is it zero fstsw ax ; get control word ffree st(1) ffree st sahf ; load flag register jz EQUAL ; If C3 not set, result = 0 lea dx, ERR ; DS:DX => ERR jmp OUTPUT EQUAL: lea dx, OK ; DS:DX => OK OUTPUT: mov ah, 9h ; Display string int 21h int 20h ; Terminate program _TEXT ends end START ================================================================= penerr.com in uuencode for those who do not want to assemble the above source code. ================================================================= begin 644 penerr.com MF]OCV09``=G`V09$`=SZWLK>Z=GNV-F;W^#=P=W`GG0&C191`>L$C19(`;0) MS2'-(````````````````````/L%0`#__R\`3F\@17)R;W(D4&5N=&EU;2!% .