Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!usc!cs.utexas.edu!tut.cis.ohio-state.edu!rutgers!netnews.upenn.edu!rm105serve.sas.upenn.edu!theall From: theall@rm105serve.sas.upenn.edu (George A. Theall) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: 386 vs 386SX Message-ID: <34538@netnews.upenn.edu> Date: 11 Dec 90 14:23:33 GMT References: <6242@crash.cts.com> Sender: news@netnews.upenn.edu Organization: University of Pennsylvania Lines: 71 In article <6242@crash.cts.com> jca@pnet01.cts.com (John C. Archambeau) writes: >There is no way in software to tell the >difference between the 386SX and 386DX. Recently there was a short piece of code posted to comp.sys.intel by danw@jacobs.cs.orst.edu (Dan Whitaker) which claimed to tell the difference when run on some type of 386 (ie, it's not for XTs or ATs). Though I don't understand the test it employs, it has successfully reported the CPU type when run on several IBM PS/2 Model 80s and 55SXs and an NEC PowerMate SX with which I work. I make no claims that the algorithm used is valid for all machines or configurations. Nonetheless, a slightly reformatted version of Whitaker's code is attached below for those who might be interested yet missed the earlier article. It is coded for TASM and will *not* run under either DESQview or Turbo Debugger! I'd appreciate hearing of your experiences with it, especially if it does *not* work in a particular configuration. --- snip, snip, snip --- ;---------------------------------------------------------------------------; ; Article 1406 of comp.sys.intel: ; From: danw@jacobs.cs.orst.edu (Dan Whitaker) ; Subject: CODE that can tell a 386DX from a 386SX ; Date: 22 Oct 90 22:24:27 GMT ; Organization: Oregon State University - CS - Corvallis Oregon ; ; For all of you that have been looking for a fool proof way to ; tell a 386DX from a 386SX, there it is. (Source code included) ; ; Dan Whitaker wk (503) 757-0934 FAX (503) 757-7350 ;---------------------------------------------------------------------------; DOSSEG .MODEL MEDIUM .386P .STACK 100h .DATA have386dx DB 'You have a 386DX',13,10,'$' have386sx DB 'You have a 386sx',13,10,'$' .CODE mov eax,CR0 ;Read in the CR0 register and eax,0ffefh ;set the 5th bit to 0 mov CR0,eax ;write out modified register to reset CR0 mov eax,CR0 ;Read it back in to see if it changed and eax,00010h ;set register to 0 if 5th bit was zero jnz sxchip ;see if it is sx mov ax,@data ;lets display the dx message mov ds,ax ;set DS to point to the data segment mov ah,9 ;DOS print string function mov dx,OFFSET have386dx ;point to dx message int 21h ;display the message jmp exit sxchip: mov ax,@data mov ds,ax ;set DS to point to the data segment mov ah,9 ;DOS print string function mov dx,OFFSET have386sx ;point to sx message int 21h ;display message exit: mov ah,4ch ;DOS terminate program function int 21h ;terminate the program END --- snip, snip, snip --- George --- theall@rm105serve.sas.upenn.edu Dept. of Economics theall@ssctemp.sas.upenn.edu Univ. of Pennsylvania gtheall@penndrls.upenn.edu Philadelphia, PA 19104