0

Is there any header present reliably across all "standard" (assuming its designed to be executed normally through some common computing platform) executable binaries that I can use to identify whether I'm looking at a CISC or RISC instruction set?

Or do I have to use contextual knowledge of the system the executable exists on to assume the instruction architecture?

Jonas
  • 121,568
  • 97
  • 310
  • 388
J.Todd
  • 707
  • 1
  • 12
  • 34
  • Why would it even be useful to know if the ISA was CISC or RISC, without identifying which ISA it is? Is that what you really meant to ask? Did you want to start reverse-engineering the ISA from scratch, and want to know if instructions are fixed-length (2 or 4 byte) or not? – Peter Cordes Jan 04 '21 at 13:06

1 Answers1

3

No. One counterexample is DOS .com executables: there is no metadata, just the bare machine code. ROM images of firmware might similarly have no metadata.

If you're talking about ELF executables, they indicate what ISA they're for, but don't classify that ISA as RISC vs. CISC. So you'd need a table of all RISC ISAs and all CISC ISAs.

There are some ISAs that even blur that line, like ARM which has some CISCy features like load-multiple, or (on paper only) ForwardCom which its architect describes as neither RISC nor CISC, but combining ideas from each.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
  • that ForwardCom project looks great in principle, but does it have any chance in a billion years of being adopted by any major hardware platform, ever? – J.Todd Oct 14 '20 at 14:24
  • @J.Todd: RISC-V evolved from paper to silicon, but then again RISC-V can be stripped down pretty far for embedded stuff. ForwardCom shines for superscalar OoO high-performance computing which is currently dominated by x86, and AArch64 has pretty good SIMD so could take over easily enough. If more things follow Apple's lead and move to non-x86 for higher-performance things (making binary compat less important), it's possible someone will come looking. But I mentioned it for this question because ForwardCom ELF binaries can run in a simulator, regardless of real hardware ever being built. – Peter Cordes Oct 14 '20 at 14:29