Page 1 of 1

Identification of 64 Bit AMD CPU

Posted: Wed Oct 10, 2007 9:19 am
by AJ
Hi All,

I am just investigating a 64 bit extensions to my OS at the moment and am trying to identify whether long mode is available. On Intel, this seems pretty easy (CPUID EAX=1, returns in bit 30 of EDX), but according to the AMD manuals, bits 29:31 of EDX with CPUID EAX=1 are reserved (even in the latest PDF from their site).

Scanning the document, I can't find how to check if long mode is available. Does anyone know how I should do this (I have googled but may not be using the correct search term)?

Cheers,
Adam

Posted: Wed Oct 10, 2007 9:28 am
by AJ
Bugg*r, just found it! It's in the AMD x86_64 overview document and is in bit 29 of EDX, for anyone else looking.

Cheers,
Adam

Posted: Wed Oct 10, 2007 9:34 am
by Brynet-Inc
Looks like you're a little confused ;)

First check if the maximum supported extended level is higher then 0..
EAX = 0x80000000
CPUID
EAX > 0

Then check for the long-mode feature bit is set:
EAX = 0x80000001
CPUID
bit 29 in EDX..

Have fun :)

Posted: Wed Oct 10, 2007 9:38 am
by AJ
Thanks. It's been one of those days, today. :roll: