Xref: utzoo comp.lang.pascal:5942 comp.sys.ibm.pc.hardware:7097 Newsgroups: comp.lang.pascal,comp.sys.ibm.pc.hardware Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!umich!sharkey!tygra!dave From: dave@tygra.UUCP (David Conrad) Subject: Re: 8086 vs. 80286 : How to detect which one? Organization: CAT-TALK Conferencing System, Detroit, MI Date: Mon, 1 Apr 91 08:06:59 GMT Message-ID: <1991Apr1.080659.9077@tygra.UUCP> References: <1991Mar26.223512.1@rulcri.leidenuniv.nl> <1991Mar28.094957.11834@tygra.UUCP> In article <1991Mar28.094957.11834@tygra.UUCP> dave@tygra.UUCP (David Conrad) writes: >In article <1991Mar26.223512.1@rulcri.leidenuniv.nl> vereijken@rulcri.leidenuniv.nl (Jan Joris Vereijken) writes: >>Hi, >> >> >>Actually, I want more, I want a way where I can decide wheter I'm dealing with: >> >>8088 / 8086 / 80188 / 80186 / V20 / V30 / 80286 / 80386 / 80486 > >The only one I know how to do is 86,186,286 vs. 386,486 (the i586 is due out >this year!). The 386 only looks at the low 5 bits of CL when shifting (hey, >the registers are only 32 bits wide, why would you need to shift farther >than that!) The earlier processors are not so smart. They do what you tell >them, even if it makes no sense (the way computers *should* work! :). > >On 286's and previous all the bits would be shifted right out of AX, but on >the 386, 486, and (presumably) 586 shl ax, 33 is equivalent to shl ax, 1, so >AX ends up with 2 in it. I don't know if the equivalent TPas would work: > > If (1 SHL 33) = 2 then > (* 386+ *) > else > (* 286- *); > >Damn! It produces 2 on my 286!?! Either TP is too smart, or my information >is wrong. I got the info from a magazine, Dr. Dobbs I think. > Well, the problem was my memory was bad (in head, not computer). As the Turbo Assembler Quick Reference Guide tells me, the 80286/386 only allows shifts of up to 31 bits for max. speed, but the 8086 allows 8 bits of shift in CL. So this is the right test, but it differentiates between 8086/8088 and later. (Not sure about 186.) Sorry to have posted incorrect information. Dave Conrad dave%tygra@sharkey.cc.umich.edu -- = CAT-TALK Conferencing Network, Computer Conferencing and File Archive = - 1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new' - = as a login id. AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET") = E-MAIL Address: dave%tygra@sharkey.cc.umich.edu