Is there a way to get all instructions my CPU supports programmatically?
Or is there a tool for this kind of job?
I want also get the corresponding machine code for each ins开发者_如何转开发truction.
The CPUID instruction reports what functionality the CPU supports for x86 processors.
http://www.intel.com/assets/pdf/appnote/241618.pdf
You'll have to refer to the Instruction Reference Manuals for the opcodes, there's no way the CPU can tell you that 'opcode 0x?? is the XYZ instruction' programatically.
What you are looking for is information on the instruction set. For Intel processesors, you can look here: http://www.intel.com/products/processor/manuals/.
For x86-64 and Itanium, refer to chapter 3 in this PDF: http://www.intel.com/Assets/PDF/manual/325383.pdf
Every architecture I've cared enough to learn that deeply has a similar manual.
I would imagine not, as that is something that the CPU would have to support. Google your processor.
CPU-Z is a freeware program that will return the Instructions supported.
To get this information by code I would imagine you would need deep knowledge of ASM Assembly.
精彩评论