9 ;============================================================================
\r
13 ;============================================================================
\r
17 ; Hacked up Juan Jimenez's code a bit to just return 386/not 386
\r
21 ;hack to never look for a 386, for benchmark comparisons of same code on all CPUs
\r
22 ; pushf ; Save flag registers, we use them here
\r
23 ; xor ax,ax ; Clear AX and...
\r
24 ; push ax ; ...push it onto the stack
\r
25 ; popf ; Pop 0 into flag registers (all bits to 0),
\r
26 ; pushf ; attempting to set bits 12-15 of flags to 0's
\r
27 ; pop ax ; Recover the save flags
\r
28 ; and ax,08000h ; If bits 12-15 of flags are set to
\r
29 ; cmp ax,08000h ; zero then it's 8088/86 or 80188/186
\r
32 ; mov ax,07000h ; Try to set flag bits 12-14 to 1's
\r
33 ; push ax ; Push the test value onto the stack
\r
34 ; popf ; Pop it into the flag register
\r
35 ; pushf ; Push it back onto the stack
\r
36 ; pop ax ; Pop it into AX for check
\r
37 ; and ax,07000h ; if bits 12-14 are cleared then
\r
38 ; jz not386 ; the chip is an 80286
\r
40 ; mov ax,1 ; We now assume it's a 80386 or better
\r
60 mov ax,9090h ;Two NOP's
\r
61 mov [WORD FAR es:LDIV@],ax ;Patch over XOR AX,AX
\r
62 mov [WORD FAR es:LDIV@+2],ax ;and over JMP SHORT COMMON
\r