1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

How many x86 instructions?

Discussion in 'Intel' started by Yousuf Khan, Feb 20, 2014.

  1. I doubt the minimalism; a print rtn is 6 bytes, and the text "This
    processor is a:" is 20 on it's own!
    (this wasn't my code, I probably had it from clax some years back)
    Here's the routine I boiled it down to:
    test_cpu:
    ; mikes shorter test for processor
    mov ax,07000h
    push ax
    popf
    sti
    pushf
    pop ax
    and ah,0C0h ; isolate top 2 bits
    shr ah,1 ; avoid negative
    cmp ah,020h
    ; anything greater means 8086 - but 80 =-1!
    ; anything less means bit 4 off, i.e 286
    ; equal implies 386
    ret

    of course when the CPUID instruction was introduced it made the later
    chips much easier to identify!
     
    Stanley Daniel de Liver, Apr 26, 2014
    #41
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.