Xref: utzoo comp.lang.pascal:5899 comp.sys.ibm.pc.hardware:6982 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!samsung!umich!sharkey!tygra!dave From: dave@tygra.UUCP (David Conrad) Newsgroups: comp.lang.pascal,comp.sys.ibm.pc.hardware Subject: Re: 8086 vs. 80286 : How to detect which one? Message-ID: <1991Mar28.094957.11834@tygra.UUCP> Date: 28 Mar 91 09:49:57 GMT References: <1991Mar26.223512.1@rulcri.leidenuniv.nl> Organization: CAT-TALK Conferencing System, Detroit, MI Lines: 50 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! :). mov ax, 1 mov cl, 33 ; or 21, if .RADIX 16 (hex) shl ax, cl ; don't use extended shl instruction, may be on 8086/88 jnz atleast386 atmost286: ... atleast386: ... 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- *); If some kind soul with a 386 would run the following test program, I'd be grateful: begin writeln (1 SHL 33); end. 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. Confusedly, 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