You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.5 KiB

; pentbug.asm
; tests for the existence of the well-documented Pentium NPU bug
; assemble and run this program using Borland's TASM and run under DOS:
; TASM pentbug ; one pass assemble
; TLINK /Tdc pentbug ; link as COM file
; PENTBUG ; run the program...
.MODEL tiny
ORG 100h
mov dx,OFFSET okmsg ; start out optimistically
fild [first] ; load the first number (x)
fild [second] ; and the second (y)
fdiv st(1),st ; perform y/x
fmulp st(1),st ; now st(0) = (y/x)*x
fild [first] ; reload y
fcompp ; compare the two
fnstsw ax ; put status word into ax
sahf ; load into CPU flags
jz short @@NoBug ; if they're equal, no bug
mov dx,OFFSET bugmsg ; load bad news message...
mov ah,9 ; print appropriate message
int 21h ;
mov ah,4ch ; and exit
int 21h ;
first DD 4195835 ; "magic numbers" culled from
second DD 3145727 ; the net. There are others...
okmsg DB "No "
bugmsg DB "Pentium bug found.",13,10,'$'
END Start