Gmail Calendar Documents Reader Web more
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion CPU Identification 3 of 4
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael A. Shiels  
View profile  
 More options Aug 16 1989, 3:05 am
Newsgroups: comp.sys.ibm.pc
Followup-To: comp.sys.ibm.pc
From: mshi...@tmsoft.uucp (Michael A. Shiels)
Date: 16 Aug 89 11:05:46 GMT
Local: Wed, Aug 16 1989 3:05 am
Subject: CPU Identification 3 of 4
Article 17981 of comp.sys.ibm.pc:
Path: watmath!looking!brad
From: b...@looking.UUCP (Brad Templeton)
Newsgroups: comp.sys.ibm.pc
Subject: Re: How to tell the difference between 80386 virtual 8086 mode and 286 real mode?
Message-ID: <1884@looking.UUCP>
Date: 30 Jul 88 16:56:17 GMT
References: <1873@looking.UUCP> <1657@microsoft.UUCP>
Reply-To: b...@looking.UUCP (Brad Templeton)
Organization: Looking Glass Software Ltd.
Lines: 49

> use SMSW

This does sound like a good method.  Another method, which I developed
on my own while waiting for replies, was to examine the length of the
instruction prefetch queue.   This can even tell the difference between
an 8088 and and 8086 if you want it to.  (8088 = 4, 8086,286 = 6, 386 = 8)

But that does sound like a rather scary way to do things, since Intel is
certainly free to change the length of this in future chips, or to put
in impure code checking into the prefetch hardware.

For those who want it,...

prefcount       PROC    NEAR
                ; must preserve ax.  It does
                mov     bx,offset point
                mov     cx,0
                mov     dx,12           ; max iter
        kloop:
                nop
                nop
                ; store "inc cx" at one of the nops
                mov     byte ptr cs:[bx],41h            ; inc cx
        point:
                ; execute a chain of nops, one that might be the "inc cx"
                REPT    12
                nop
                ENDM
                ; restore the "inc cx" back to a nop
                mov     byte ptr cs:[bx],90h            ; nop
                ; go on to the next byte
                inc     bx
                ; check we haven't gone too far
                dec     dx
                jz      pcdone
                ; keep looping until the inc was interpreted
                jcxz    kloop
         pcdone:
                ; we already have the index of the first non-prefetched
                ; byte plus one (we incremented anyway).  Now we use
                ; point-1 to add another to it because of the three byte
                ; instruction at the front
                ; the result is 6 for 286 and 8 for 386. (4 for 8088)
                sub     bx,offset point-1
                ret
prefcount       ENDP

--
Brad Templeton, Looking Glass Software Ltd.  --  Waterloo, Ontario 519/884-7473


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google