Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!hplabs!hp-pcd!hpcvlx!kcl From: kcl@hpcvlx.HP.COM (Ken C. Lo) Newsgroups: comp.sys.ibm.pc Subject: Re: Testing for a numeric coprocessor Message-ID: <101000054@hpcvlx.HP.COM> Date: 29 Jun 89 16:35:52 GMT References: <2584@blake.acs.washington.edu> Organization: Hewlett-Packard Co., Corvallis, OR, USA Lines: 22 There is a FNINIT instruction the 80286 can execute to determine whether or not the 80287 is presented. FND_287: FNINIT ;initialize Numerical Processor FSTSW AX ;retrieve 80287 status word OR AL,AL ;test low byte of 80287's ;exception flags ;if all zero,then 80287 is present ;and properly initialized ;if not all zero, then 80287 absent JZ GOT_287 ;branch if 80287 present SMSW AX ;No Numerical Processor OR 04H ;set EM bit in machine status ;word LMSW AX ;enable software emulation of 80287 GOT_287 SMSW AX ;Numerical processor present OR 02H ;set MP bit in machine status word LMSW AX ;permit normal 80287 operation