home *** CD-ROM | disk | FTP | other *** search
- 30 Oct 88
-
- Assembly language routine to detect and return processor type
- From Micro Cornucopia magazine #37, Sep-Oct 87
- Technical Tips column letter's text follows:
-
- Identifying Intel Microprocessors
- Rather than writing software using only 8086/8088 instructions,
- it is very useful to allow execution of 80186, 80286, or 80386 code
- on systems with these processors. A general method for doing this
- tests for the type of processor and branches to processor-specific
- routines. This allows a program to take full advantage of each
- processor's capabilities while retaining the ability to run on
- 8086/88 systems.
- One method for deciding which processor is running is to examine
- the flag register. While undefined on all processors, bit 15 of the
- flag register does take on different values. A "one" identifies the
- 8086/88 or 80186/188 processor. A zero means we're looking at either
- an 80286 or 80386.
- Bits 12 - 14 are used only in Protected Mode. An 80286 in Real Mode
- can't set any of these bits. An 80386 can set all three although they
- have no effect.
- The 8086/88 and 80186/188 flags behave identically. We'll have to
- look at how the shift instruction works to differentiate these two
- processors. The 8086/88 uses all eight bits of the CL register to
- hold the shift count. The 80186/188 uses only the lower five bits.
- So the 80186/188 uses CL MOD 32 for the shift count. This means a
- shift of 33 is the same as a shift of one for the 80186/188, while
- all those shifts on the 8086/88 guarantee a result of zero.
- See Figure 1 [PROCTYPE.ASM] for code which returns the processor
- type in the AX register.
- The preceding was a condensed version of an Intel "TechBits"
- paper sent in by:
- Pat O'Leary
- Ardrew, Athy
- County Kildare, Ireland
-
- Additional files:
- PROCTYPE.ASM Assembly language procedure from Micro Cornucopia
- CHEKPROC.ASM Demo program to test PROCTYPE.ASM (Toad Hall)
- BATCHEK.BAT Demo batch file to test CHEKPROC.COM (Toad Hall)
-
- Everything works on my 80286 XT clone, have no 8086/88/186/386
- to test other possible replies on. Donno WHAT a V10/V20/V30 would do!
- How about someone playing with one and adjusting documentation and/or
- source accordingly?
-
- David Kirschbaum
- Toad Hall
- kirsch@braggvax.ARPA