home *** CD-ROM | disk | FTP | other *** search
- ; Created 04/17/92
- ; updated 07/22/93
- ; updated 02/05/94 information about IBM 486SLC2 chips
- ; updated 02/28/94 information about Cyrix 486DLC
- ; updated 04/19/94 to better test for 586/Pentium chip
- ; updated 06/09/94 for data from Intel 486SX Data Book
-
- DOSSEG
- .MODEL MEDIUM
- .CODE
- .8086 ; necessary for use w/ 16 bit segments
- ;.486P ; can't use this if want to use w/ 16 bit compilers or 16 bit
- ; ; chips,
-
- PUBLIC CHIPTYPE
-
- ;=======================================================================
- ; Copyright (C) Copr. 1993, 1994 by Sidney J. Kelly
- ; All Rights Reserved.
- ; Sidney J. Kelly
- ; 150 Woodhaven Drive
- ; Pittsburgh, PA 15228
- ; home phone 412-561-0950 (7pm to 9:30pm EST)
- ;=======================================================================
- ;;«RM82»«TS8,16,24,32,40»
-
- ;=======================================================================
- ; DECLARE FUNCTION CHIPTYPE% ()
- ; Returns:
- ; 586 if Pentium(tm) in real mode (not tested)
- ; -586 if Pentium(tm) in protected mode (not tested)
- ; 486 if 80486 (DX or SX) in real mode (tested SX & DX)
- ; (can be a CX 486D or CX 486S, CX 486DX2, or CX 486DLC, or AMD)
- ; (Can't yet distinguish between Intel 486SX and a CX 486S)
- ; -486 if 80486 (DX or SX) in protected mode (tested SX & DX)
- ; (can be a CX 486D or CX 486S, CX 486DX2, or CX 486DLC, or AMD)
- ; 480 if IBM 486SLC in real mode (tested)
- ; -480 if IBM 486SLC in protected mode (tested)
- ; CYRIX 486/INTEL 486 clear the reserved bits in the machine status
- ; word (CR0), while IBM 486SCL2/50, 386DX and 386SX do not.
- ; Tested w/ an IBM 486SLC2/66 with a math coprocessor and
- ; an IBM 486SLC2/50 without a math coprocessor.
- ; The SLC2 uses a 16 bit external bus chip (386SX style), while
- ; the Intel 486DX/SX uses a 32 bit bus. Unlike the Intel chip,
- ; the SLC has an 16K internal cache versus an 8k internal cache
- ; for the Intel 486DX. A 33 MHz IIT 387SX NDP (with an IBM SLC2/66)
- ; is as fast as the 387 that is part of a 486DX 25mhz.
- ; 479 if Cyrix 486DLC in real mode
- ; 386 if 80386DX in real mode (tested)
- ; 376 if 80386SX in real mode (newer chips only) (tested)
- ; -386 if 80386DX or 80386SX in protected mode (because shouldn't check
- ; for 386SX in protected mode) (tested)
- ; 286 if 80286 (tested)
- ; 186 if 80186 (normally only seen on Tandy 2000)
- ; 188 if 80188 (very rare) (not tested)
- ; 32 if NEC 20 (equivalent to 8088)
- ; 30 if NEC 30 (equivalent to 8086)
- ; 88 if 8088 (tested) (standard PC/XT)
- ; 86 if 8086 (AT&T 6300, COMPAQ Systempro, WANG)
- ;
- ; CYRIX 486 chips
- ; 486DLC 1kb on chip cache, no integrated math, 386DX pin compatible
- ; 486DLU 1kb on chip cache, no integrated math, is a 286 upgrade chip
- ; 486DX pin compatible chips (same as Intel chips)
- ; 486D 2kb on chip cache, integrated coprocessor,
- ; 486S 2kb on chip cache, no coprocessor
- ; 486DX2 pin compatible now with an 8K cache (not tested)
- ;
- ; Registers:
- ; Destroys: EAX and ECX on 80386+
- ; AX,BX,CX and DX on all chips
- ;
- ; Tested with Windows 3.1, extended mode, NO UAE's!!
- ; Tested with EMM386.EXE and 386MAX version 7.0
- ;
- ; Not tested with QEMM or OS/2
- ;
- ; This code is based on code from Intel's "i486 Programmers Reference Manual"
- ; cpuid32.asm - Per file
- ; "This program has been developed by Intel Corporation. You have
- ; Intel's permission to incorporate this source code into your
- ; product royalty free."
- ; as modified by Wayne A. King, [CIS: 70022,2700] 5/24/93 for use w/
- ; MASM 5.1, to correct bugs w/ real mode processors and 32 bit instructions
- ;=======================================================================
-
- OPCODE_32 MACRO
- DB 66h ; opcode for 32 bit addressing
- ENDM ; used on 80386/80486/Pentium
- CPUID MACRO ; Hardcoded opcode for CPUID instruction
- DB 0Fh,0A2h ; only works on Pentium(tm)
- ENDM ; will not work on 80386/80486 (illegal op code)
-
- EVEN
- Old_Value DW 0 ; hold chiptype from last call
-
-
- ; Please do not remove
- Copyright DB 13,10,'Copyright Copr. (C) 1990, 1991, 1994 Sidney J. Kelly',13,10
- Copyright1 DB 'All Rights Reserved',13,10,26
-
- EVEN
- CHIPTYPE PROC FAR
- Push BP ; preserve BP
- Mov BP,SP ; save SP
- Push SI ; save SI
- Push DI ; save DI
- PushF ; save flags
- Mov AX,CS:[Old_Value] ; have we done this before?
- Or AX,AX ; is AX = 0
- JZ @f ; yes, so find chip type
- Jmp Finis_Fast ; else, got value, it can't change. so quit
- ;-----------------------------------------------------------------------
- ; To test for real mode chips, test the value of SP after it is placed on the
- ; stack. The real mode chips increment SP before pushing it on the stack,
- ; 80286+ CPU's increment SP _after_ pushing it on the stack.
- ;-----------------------------------------------------------------------
- @@:
- Push SP
- Pop AX
- CMP SP,AX ; if real mode, these values will differ
- JZ Test_Newer ; no, same value test newer chips
- ;-----------------------------------------------------------------------
- ; Test for 8086, 8088, 80188, 80186, NEC v20, NEC v30
- ;-----------------------------------------------------------------------
- Test_Real: ; Test real mode chips
- Mov DX,188 ; assume 80188 chip
- Mov AX,-1 ; put 0FFFFh in AX
- Mov CL,33 ; prepare to shift AX right 33 times
- SHR AX,CL ; 8018x+ chips wont allow this
- JNZ Test_Queue ; if AX <> 0 then have 80188/80186
- Mov DX,32 ; assume NEC chip
- STI ; test for NEC
- Mov CX,-1 ; loop 64kb times
- Xor SI,SI ; load a 0 into SI
- Rep Lods Byte Ptr ES:[SI] ; only NEC can REP w/ segment
- ; override. NEC also sets ZF if multiply using a 0 number
- ; Intel chips couldn't use Rep w/ segment override until
- ; 80386+ chip
- JCXZ Test_Queue ; if CX = 0 then a NEC
- Mov DX,88 ; else, report 8088, not a NEC
- ;----------------
- ; Queue length is 2 bytes on 8088, 4 bytes on 8086, 6 bytes on 80286
- ; 16 bytes on 386, 32 bytes on 486, and 128 bytes on the Pentium
- ; per Abrash, PC Techniques (March/April 1994), Intel 486SX Data Book, p 188
- ; Abrash, "Zen of Assembly Language" (Scott Foresman 1990),
- ; ISBN 0-673-38602-3, page 701
- ; However, Pentium invalidates its queue if it determines that
- ; a write as occurred to queue stream, so can't use this routine
- ; to determine the length of queue on a Pentium
- ;----------------
- Test_Queue:
- Push CS ; point ES to CS
- Pop ES
- STD ; move direction down
- Mov AL,0FBh ; load op code for STI in AL
- Mov CX,3 ; load 3 bytes
- Xor BX,BX ; start counter (BX) w/ a 0
- CALL Calc_Q_Offset ; flush queue, and calc offset
- Jmp_Back_Entry:
- CLI
- Rep STOSB ; determine length of queue
- CLD ; reset direction flag
- NOP
- NOP
- NOP
- Inc BX ; test if BX changed?
- NOP
- STI ; allow flags again
- Or BX,BX ; if BX still 0
- JZ @f ; then quit
- Sub DX,2 ; note have longer queue (8086/80186/V30)
- @@:
- Jmp Finis ; quit
- Calc_Q_Offset:
- Pop DI ; get offset address into DI
- Add DI,9 ; add 9
- Jmp Short Jmp_Back_Entry ; jump back
- ;-----------------------------------------------------------------------
- ; Test for 80386 and above, by checking to see if Bit 14
- ; On the 286 chip, none of the flags from 12 to 15 can be set in real
- ; mode. All bits fixed to 0
- ; On a 386+ bit 15 is permanently set to 0, bit 14 (NT - Nested Task)
- ; can be toggled no matter what the current protection mode.
- ; Bits 12-13 on 80386+ can be toggled if in real mode or if current protection
- ; mode is 0 (CPL=0 or ring0)
- ;-----------------------------------------------------------------------
- Test_Newer: ; test for 80386+
- Mov DX,286 ; assume have 286
- CLI ; prevent interruptions
- PushF ; save flags
- Pop AX ; copy to AX
- Or AX,4000h ; set bit 14
- Push AX ; save AX
- PopF ; pop into flag register
- PushF ; push new flags
- Pop AX ; get into AX
- STI ; allow interruptions again
- TEST AX,4000h ; is bit 14 clear?
- Jnz TEST_4_486 ; if set have 80386+ chip
- ;--------------------------------
- ; Windows enhanced mode has a bug in POPF instruction emulation
- ; We test machine to see if in protected mode.
- ; This routine will guess wrong if using 286 extended mode software
- ;--------------------------------
- ;SMSW AX ; test if protected mode set
- DB 0Fh,01h,0E0h ; get machine status into AX
- Test AX,0001b ; are we in protected mode?
- Jnz TEST_4_486 ; yes, more likely a 386+ than a 286
- Jmp Finis ; quit, report back as a 80286
- ;=====================================================================
- ; Cpu type is an 80386 or 80486
- ; This code should not bomb if the machine is in protected mode.
- ;
- ; The 486 has defined Bit 18 (AF) in EFLAGS which will enable alignment
- ; faults. The 386 does not have this. This test will set the bit
- ; to determine if the processor type is a 486. First the stack must
- ; be aligned so that the fault does not occur.
- ;
- ; Source: TYPE.ASM in PCEO converted by Francis Leung based on help from
- ; Al Kinney, the sysop of Intel's PCEO forum.
- ; and PCMAG, Feb 26, 1991 V10N4, p. 416 (Duncan states the information
- ; is derived from Intel code). Another similar version was modified by
- ; Ernest Vogelsinger, (CIS ID 100015,551.), again based on Intel code.
- ;
- ; The "Official Intel Method" was published in "Intel486 SX Microprocessor
- ; Intel487 SX Math CoProcessor Data Book" (Intel 1991)
- ; ISBN 1-55512-158-6, Appendix B, page B-1. The Intel code will work
- ; on a 16 bit compiler.
- ;
- ; NOTE:
- ; This section will falsely report cpu as a 486 if a 386 is single stepped in
- ; CODEVIEW and report cpu as a 386 if a 486 is single stepped in CODEVIEW
- ;=====================================================================
- TEST_4_486:
- Mov DX,386 ; assume have 386
- Mov BX,SP ; save original SP in BX
- CLI ; prevent interrupts
- And SP, NOT 3 ; align stack, clear AC flag on 486
- OPCODE_32
- PushF ; PushFD
- OPCODE_32 ; copy flags into EAX
- Pop AX ; Pop EAX
- OPCODE_32
- Mov CX,AX ; copy EAX (flags) to ECX
- ; ECX has a copy of original flags
- ; Xor EAX,040000h ; flip bit 18
- DB 66h,35h,00,00,04,00 ; Xor EAX,40000h ; toggle bit 18
- OPCODE_32
- Push AX ; Push EAX (flags)
- OPCODE_32 ; get it back
- PopF ; PopFD
- OPCODE_32 ; save it again
- PushF ; PushFD
- OPCODE_32 ; get it in EAX
- Pop AX ; Pop EAX
- STI ; allow interrupts again
- OPCODE_32 ; eliminate all but bit 18, changes flags too
- Xor AX,CX ; Xor EAX,ECX
- Mov SP,BX ; restore SP
- JNZ Test_486_Type ; have 486/586
- Jmp Short Test_386_Type ; have 80386 if no bit set
- Test_486_Type:
- CLI ; halt interrupts
- And SP, NOT 3 ; else, align stack again to avoid faults
- Mov DX,486 ; and report have 486
- OPCODE_32 ; restore original flags
- Push CX ; Push ECX
- OPCODE_32 ; get flags back
- PopF ; PopFD
- Mov SP,BX ; restore SP again
- STI ; allow interrupts again
- ;------------------------------------------------------------------
- ; SMSW reads lower 16 bits of CR0 on an 80386+. However, it
- ; does not trigger a fault in protected mode as would reading CR0.
- ;------------------------------------------------------------------
- ; SMSW AX ; test if protected mode set
- DB 0Fh,01h,0E0h ; get machine status into AX
- ;------------------------------------------------------------------
- ; Test for IBM 486SLC chips based on difference of treatment of
- ; reserved bits in CR0 / machine status register
- ;------------------------------------------------------------------
- Or AH,AH ; is AH = 0
- Jz Test_4_DLC ; YES, it is not an IBM SLC
- Mov DX,480 ; else report IBM SLC
- Jmp Short TY_486
- Test_4_DLC:
- TEST AX,0001b ; are we in protected mode
- Jnz TY_486 ; yes, can't test for DLC safely
- Call Test_DLC ; test for DLC
- Jmp Short @f ; continue on
- TY_486:
- TEST AX,0001b ; is bit 0 set?
- JZ @f ; no, not in protected mode
- Neg DX ; else, report 486 in protected mode
- @@:
- ;------------------------------------------------------------------
- ; Determine if CPU supports CPUID instruction by seeing if
- ; can set and clear ID flag (Bit 21) in EFLAGS.
- ; Pentium uses this flag to say that CPUID is supported
- ; Can't use this test on revision A of 386DX chips, so must make
- ; sure have a 486+ first before we test.
- ; On a 486 chip, this bit is undefined (0), per Intel 486SX Data Book
- ; ?The bit may be used by 487SX to tell 486SX to shut
- ; down because 487SX is active (undocumented)? However, bit is
- ; not used on a 486DX
- ;------------------------------------------------------------------
- CLI ; disable interrupts
- OPCODE_32
- Mov AX,CX ; get original EFLAGS
- ; Xor EAX,200000h ; flip bit 21
- DB 66h,35h,00,00,20h,00 ; Xor EAX,200000h ; toggle bit 21
- OPCODE_32
- Push AX ; save new EFLAGS value on stack
- OPCODE_32
- PopF ; replace current EFLAGS value
- OPCODE_32
- PushF ; get new EFLAGS
- OPCODE_32
- Pop AX ; store new EFLAGS in EAX
- OPCODE_32
- STI ; allow interrupts again
- Xor AX,CX ; can't toggle ID bit,
- Jne Get_Pentium_Info ; may have Pentium
- Jmp Short Finis ; have plain old 486
- Get_Pentium_Info:
- ; Mov EAX,1 ; get family info function
- ; returns in AL a value of 5 if a Pentium
- DB 66h,0B8h,01,00,00,00
- CPUID ; macro for CPUID instruction
- ; if EAX is set to 0 before calling CPUID then
- ; then a text string is returned in EBX,ECX and EDX
- ; And EAX,0F00h ; find family info
- DB 66h,25h,00,0Fh,00,00
- ; Shr EAX,8
- DB 66h,0C1h,0E8h,08
- Mov DX,586 ; assume Pentium
- Cmp AL,5
- Je F_Status ; have a Pentium
- Mov DX,486 ; else, do not have Pentium
- F_Status:
- ; SMSW AX ; test if protected mode set
- DB 0Fh,01h,0E0h ; get machine status
- TEST AX,0001b ; is bit 0 set?
- JZ @f ; no, not in protected mode
- Neg DX ; else, report chip in protected mode
- @@:
- Jmp Short Finis ; quit
- Test_386_Type:
- ;------------------------------------------------------------------
- ; SMSW reads lower 16 bits of CR0 on an 80386+. However, it
- ; does not trigger a fault in protected mode as would reading CR0.
- ;------------------------------------------------------------------
- ; SMSW AX ; test if protected mode set
- DB 0Fh,01h,0E0h ; get machine status
- TEST AX,0001b ; is bit 0 set?
- JNZ Prot_Mode ; yes in protected mode
- ;------------------------------------------------------------------
- ; Check for 386SX by trying to set the co-processor type bit in CR0,
- ; the Extension Type (ET) (bit 4) bit.
- ; On the 386DX this bit is defined, on the newer 386SX it is not.
- ; On a 486 chip, the bit is permanently set to 1, per
- ; Intel 486SX Data Book, page 28
- ;
- ; Get current CR0 and save in ECX.
- ;
- ; Don't run this section in protected mode!!
- ; NOTE this will trigger a protection interrupt and thus is
- ; not usable under Windows 3.0 or QEMM-386.
- ;
- ; 486SX chip uses similar bit in EFLAGS, ID flag (bit 21), for
- ; information whether a co-processor is installed
- ;------------------------------------------------------------------
- ; Mov EAX, CR0
- DB 0Fh,20h,0C0h ; Mov EAX, CR0
- ; Mov ECX, EAX
- OPCODE_32
- Mov CX,AX ; Mov ECX,EAX
- ;------------------------------------------------------------------
- COMMENT *|
- ┌──┬──┬──┬─┬─┬─┬─┬─┬─┐ CR0
- │31│30│ ▓│5│4│3│2│1│0│ Machine Status Word (80386/80486)
- └┬─┴┬─┴┬─┴┬┴┬┴┬┴┬┴┬┴┬┘ (undefined bits are usually 1)
- │ │ | │ │ │ │ │ └──── Protection Enable (PE) (bit 0)
- │ │ | │ │ │ │ └───── Monitor Coprocessor (MP)(bit 1)
- │ │ | │ │ │ └────── Emulation (EM) (bit 2)
- │ │ | │ │ └─────── Task Switched (TS) (bit 3)
- │ │ | │ └──────── Extension Type (ET) (bit 4)
- │ │ | │ (386 chip only, 486 chip sets bit to 1)
- │ │ | └─────── Numerics Exception (NE) (bit 5)
- │ │ | (Should be 0 for 486DX+)
- │ │ └----------─ Reserved (bits 6-29)
- │ │ (On an Cyrix 486D/486S and Intel 486SX, undefined bits
- │ │ are 0 ---
- │ │ But the undefined bits on IBM 486SLC2 and 386DX, 386SX
- │ │ are 1 when read using SMSW)
- │ └─────────── Internal Cache disable (CD) - 486 chip only
- └───────────── Paging (PG) (bit 31)
-
- On a 386 chip, the MSW is the lower 16 bits of CR0
-
- PE Protection Enable, CPU in protected mode or virtual 8086 mode
- if bit is set. (80286 uses same bit in MSW)
- MP Monitor Coprocessor, controls treatment of the FWAIT
- instruction. If TS = 1 then coprocessor not available
- trap will be executed. (80286 uses same bit in MSW)
- EM Emulation, indicates whether coprocessor functions
- are emulated . If EM = 0 then all 80x87 opcodes executed
- on a real 80x87. (80286 chip uses this bit in MSW)
- TS Task Switched, used by coprocessor
- (80286 chip uses this bit in MSW, balance of bits are not used)
- ET Extension Type, indicates whether 80837 or 80287 chip in use.
- Newer 80386SX chips do not allow this bit to be changed
- Bit is set to 1 on a 486 chip
- CD Cache disable bit (486 only)
- PG Paging, indicates whether the processor uses page
- tables to translate linear addresses to physical
- addresses. V8086 mode normally does not, WINDOWS 386 mode does.
-
- Typical status from MSW:
- EMM386.EXE 0001b or PE = 1 (Virtual 386 mode)
- Mathchip emulation, protection enable
- EM87.COM 0100b or EM = 1 (real mode on 386SX)
- Mathchip emulation.
-
- Virtual 8086 mode requires PE to be set as well as bit 17 of EFLAGS
- register.
-
- See, Murray, "80386/80286 Assembly Language Programming"
- (Osborne 1986) (ISBN 0-07-881217-8), p 55-65
- COMMEND |*
- ;---------------------
- ; Flip the ET bit and save it back in CR0.
- ;---------------------
- ; Xor EAX,10H ; flip bit 4
- DB 66h,35h,10h,00,00,00 ; Xor EAX,10H
- ; Mov CR0, EAX
- DB 0Fh,22h,0C0h ; Mov CR0,EAX
- ;---------------------
- ; Get CR0 to test the ET bit. Restore CR0 to original value.
- ;---------------------
- ; Mov EAX, CR0
- DB 0Fh,20h,0C0h ; Mov EAX, CR0
- ; Mov CR0, ECX
- DB 0Fh,22h,0C1h ; Mov CR0,ECX
- ;------------------------------------------------------------------
- ; If the ET bit is different from what it was to begin with, then we
- ; have a 386DX (NOTE: the first stepping of the 386SX supported the
- ; 287, and therefore used this bit. That means that this test will
- ; identify an early 386SX as 386DX). All AMD's are second stepping
- ;------------------------------------------------------------------
- OPCODE_32
- Xor AX,CX ; Xor EAX,ECX
- Jnz Finis
- Sub DX,10 ; report back have a 80386SX
- Jmp Short Finis
- Prot_Mode:
- NEG DX ; report in protected mode
- Finis:
- Mov AX,DX ; get return code in AX
- Mov CS:[Old_Value],AX ; save it
- Finis_Fast:
- Popf ; restore flags
- STI ; make sure interrupts allowed
- Pop DI ; restore DI
- Pop SI ; restore SI
- Mov SP,BP ; restore SP
- Pop BP ; restore BP
- Ret
- CHIPTYPE ENDP
-
- ;=======================================================================
- ; Test for Cyrix/TI/IBM DLC/SLC
- ; If cannot toggle bit 5 of CR0 then have
- ; a Cyrix 486 SLC/DLC and ZR set
- ;
- ; Bit 5 is the Numerics Exception Bit. It should be 1 on an
- ; 486SX and 0 on a 486DX,487SX
- ; Note:
- ; Test should only be performed in real mode because may trigger
- ; an error under a memory manager such as Windows 3.0
- ;=======================================================================
-
- EVEN
- Test_DLC PROC NEAR
- OPCODE_32
- Push BX ; Push EBX
- ; Mov EBX,CR0
- DB 0Fh,20h,0C3h
- OPCODE_32
- Mov AX,BX ; Mov EAX,EBX
- ; Xor EAX,+20h
- DB 66h,83h,0F0h,20h ; see if can toggle bit 5 of CR0
- ; Mov CR0,EAX
- DB 0Fh,22h,0C0h
- ; Mov EAX,CR0
- DB 0Fh,20h,0C0h
- ; Mov CR0,EBX
- DB 0Fh,22h,0C3h
- OPCODE_32
- Cmp AX,BX ; Cmp EAX,EBX
- OPCODE_32
- Pop BX ; Pop EBX
- Jnz @f ; not a DLU
- Mov DX,479
- @@:
- Ret
- Test_DLC ENDP
- END
-
-
- CPU Characteristics / Determination
-
- 1). Early vs. Later chips
- a). 80286, 80386. Earlier CPU's decremented SP before a PUSH SP
- but 286+ pushes the value first, then decrements SP or
- b). 8088,8086,80188,80186,NEC v20,NEC v30 Flag register bits 12
- through 15 cannot be cleared
-
- 2). 80286 vs. 80386 chip
- a). 80286 allows setting of bit 15 of the flags register
- b). 80386 allows setting of bits 12 through 14 of flags register
-
- 3). 8088 and 8086 vs. Modern chips
- a). 80188, 80186, NEC v20, NEC v30 will shift left or right
- using only lower 5 bits of CL. If CL = 32, the shift will not
- occur
-
- b). 8088, 8086 will shift left or right using all 8 bits of CL
- if CL = 33, register is guaranteed to be cleared
-
- 4). Intel 8088,8086 vs. NEC v20/v30
- a). 8088,8086 nonzero multiplication result clears zero flag
-
- b). V20,V30 nonzero multiplication result does not clear
- zero flag, set ZF before multiply, and test after, if it's
- still set, then it's a V20, V30
-
- 5). Determine bus width
- 8088 vs. 8086, 80188 vs. 80186, NEC v20 vs. v30
-
- a). 8088,80188,V20 two byte prefetch queue
-
- b). 8086,80186,V30 four byte prefetch queue
-
- Source: "Chips In Transition", PC Tech Journal (April 1986)
-
- 6). 80386 vs. 80486
- 80486 in Flags register has an alignment bit for stack faults
- 80386 does not
-
- 7). 80486SX vs. 80486DX
- 80486DX has a built-in 80387, 80486SX does not
-
- 8) 80386DX vs. 80386SX
- in MSW bit 4 (ET bit) toggles on old 386SX and all 80386DX
- does not toggle on newer 80386SX. Should only test in real mode.
-
- ;=======================================================================
- The following instructions are privileged 386 instructions. Execution
- of any of these instructions in protected mode will trigger a 386
- fault interrupt. Early versions of 386 memory managers (QEMM/Windows 3.0)
- did not properly handle the error and would crash (Windows would send a UAE).
- PC Mag (February 26, 1991) page 415, V10N4P415
-
- More modern memory managers permit a change to CR0 and have that change
- stick (e.g. 386MAX Version 7.0).
-
- However, Windows 3.1, Enhanced mode does permit access to CR0 without
- an error because it resets CR0 to its orgininal state after the
- DOS program changes it. Windows 3.0 did not permit such access without
- triggering an "UAE."
-
- CLTS Clear Task Switched Flag
- HLT Halt CPU until receives co-processor interrupt
- LGDT Load Global Descriptor Table Register
- LIDT Load Interrupt Descriptor Table Register
- LLDT Load Local Descriptor Table Register
- LMSW Load Machine status word
- LSL Load Segment limit
- LTR Load Task register
- Mov CRn,reg Move data to control register
- Mov reg,CRn Move date from control register
- Mov DRn,reg Move data to debug register
- Mov reg,DRn Move data from debug register
- Mov reg,TRn Move data from test register
- Mov TRn,reg Move data to test register
- See, also, Murray, "80386/80286 Assembly Language Programming"
- (Osborne 1986) (ISBN 0-07-881217-8), p 140
- ;=======================================================================
-
-