3

I start to explore in the area of computer architecture. There are 2 questions about ISA that confuse me.

  1. As far as I know, there are different kinds of ISA such as ARM, MIPS, 80x86, etc. I wonder whether a CPU can only specifically read one kind of ISA. For example, can a processor read both 80x86 and MIPS.

  2. If a CPU is unique to an ISA, how can I check which ISA my PC processor is using? Can I find it out manually?

Thank you

jackycflau
  • 1,101
  • 1
  • 13
  • 33

3 Answers3

3
  1. All the CPU/MCU's I know of support just single instruction set.

    There is capability of loading microcode to some of the newer architectures that may allow to change the instruction set behavior to some point bot strongly doubt it you can change the instruction set with it. Instruction set and internal CPU/MCU circuitry are strongly dependent. Making universal CPU with changeable instruction set is possible (for example with FPGA) but would be very slow in comparison to direct DIE encoded CPU. With similar technology of Die the clock speed would be may be just few MHz.

    Some architectures like i80x86 supports modes that can switch to different kind of operation (16/32/64 bit,real,protected) but its hard to say it is different instruction set or just subset of the same thing ...(matter of perspective)

  2. detection of instruction set.

    This is madness. Yes it is possible to detect which type of instruction set you have via program but all the CPU/MCU's have different pinout, interfaces, architectures and are not interchangeable (even in the same architecture class) so you detecting instruction set is meaningless as you alredy know the architecture you are doing the wiring for ...

    Anyway the detection would work like this:

    • have set of test programs of each supported instruction set/architecture that will set specific memory or IO to predefined state if working properly
    • have watch dog cycling between all the detections and stop on first valid result.
Spektre
  • 49,595
  • 11
  • 110
  • 380
  • Point 2 is not necessarily madness if you are for instance supporting a certain base architecture (say x86) but you may wish to use a superset IF available, for instance one of the Intel extensions to the instruction set added in later revisions. Then it is good to check for those, and if present utilize them, otherwise disregard their use. – Richard Tyregrim Feb 01 '16 at 08:01
  • @RichardEriksson yep from that perspective I agree but in general the point still holds. – Spektre Feb 01 '16 at 08:08
1
  1. Yes, each type of CPU is unique to an instruction set. The instruction set for ARM will not work with x86, SPARC, etc. There may be some overlap by coincidence, but programs are not compatible between architectures.

  2. Depending on your operating system, there are commands you can run to see this information. For unix/Linux, uname -a will show you what architecture you're running, as well as dmidecode. For Windows OS's, right-clicking on My Computer and selecting Properties should show you your architecture.

For example (Windows 7):

Windows 7 System Info

For Linux (I know, it's a super-old distro!):

$ uname -a
Linux hostname 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:32:27 UTC 2010 x86_64 GNU/Linux

(In this example, the architecture is x86_64), which is 64-bit Intel or AMD. To tell for sure, you can run dmidecode as I mentioned earlier:

~# dmidecode |grep -i proc
Processor Information
        Type: Central Processor
        Version: AMD Opteron(tm) Processor 154
Processor Information
        Type: Central Processor
        Version: AMD Opteron(tm) Processor 154
Tim S.
  • 2,187
  • 1
  • 25
  • 40
0

It can actually read any instruction set if the support is implemented. Most of the CPUs nowadays support two/three instructions set that only slightly differ because of 32-bit/64-bit addressing.

x86 supports 16-bit, 32-bit and 64-bit instructions set, ARM support 32-bit, 64-bit, for both Thumb and Thumb-2, etc. Similarly for MIPS for example.

Original Transmeta I believe was flexible about it and supposed to transcompile any instruction set into internal set and run it natively. However it failed and nowadays there is nothing similar to it.

Anyway, once you run application, it's bound to specific instruction set in its header so it can't change it during the runtime. Well, ARM is exception to that - it's able to switch between full and Thumb versions but they are just different encoding for the same...

For the second part - either in your OS GUI or you can usually read it - in Linux by reading /proc/cpuinfo, on Windows in the environment variable PROCESSOR_ARCHITECTURE.

Zbynek Vyskovsky - kvr000
  • 18,186
  • 3
  • 35
  • 43