Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!necntc!drilex!maynard!campbell From: campbell@maynard.BSW.COM (Larry Campbell) Newsgroups: comp.sys.ibm.pc Subject: Re: How do you detect a V20? Message-ID: <904@maynard.BSW.COM> Date: Mon, 27-Apr-87 00:42:08 EDT Article-I.D.: maynard.904 Posted: Mon Apr 27 00:42:08 1987 Date-Received: Mon, 27-Apr-87 05:40:02 EDT References: <785@killer.UUCP> <1710@ihlpe.ATT.COM> Reply-To: campbell@maynard.UUCP (Larry Campbell) Organization: The Boston Software Works, Inc. Lines: 34 Keywords: NEC V20/V30, software detection? Summary: it's easy In article <1710@ihlpe.ATT.COM> psfales@ihlpe.ATT.COM (Peter Fales) writes: >In article <785@killer.UUCP>, toma@killer.UUCP (Tom Armistead) writes: >> Is there a way to detect a NEC V20 or V30 CPU in an IBM or compatible PC >> through software??? > >I have an assembly language program (that came originally from netnews) >that does exactly that. The V20/V30 are so compatible that software >differentiation is difficult. The trick is to use a bug in the Intel >chips that was fixed in the NEC chips. ... There's a much easier method that I got from my local NEC sales engineer. (Why is it that computer people would rather go pawing around the networks than just telephoning the manufacturer?) Anyway, here's the code: | Use undocumented Intel instruction, opcode D6, to determine if this | is an Intel chip (D6 copies carry flag throughout AL) or an NEC V20 | (something else happens) xor ax,ax | ax <= 0 stc | set carry flag .byte 0xD6 | magic instruction cmpb al,*0xFF | which chip? je cpu8088 | if FF, this is 8088 ... | not FF, this is V20 cpu8088: ... I don't know if this also works for the V30, but I would guess that it does. The NEC rep told me that on Intel chips, the test works on the 8088, 8086, 80188, and 80186. -- Larry Campbell The Boston Software Works, Inc. Internet: campbell@maynard.BSW.COM 120 Fulton Street, Boston MA 02109 uucp: {alliant,think,wjh12}!maynard!campbell +1 617 367 6846