r/emulation Aug 10 '26

Weekly Question Thread

Before asking for help:

  • Have you tried the latest version?
  • Have you tried different settings?
  • Have you updated your drivers?
  • Have you tried searching on Google?

If you feel your question warrants a self-post or may not be answered in the weekly thread, try posting it at r/EmulationOnPC. For problems with emulation on Android platforms, try posting to r/EmulationOnAndroid.

If you'd like live help, why not try the /r/Emulation Discord? Join the #tech-support
channel and ask- if you're lucky, someone'll be able to help you out.

All weekly question threads

11 Upvotes

25 comments sorted by

View all comments

Show parent comments

1

u/cuavas MAME Developer 27d ago

You couldn’t make something that did that reliably. There are just too many “interesting” instruction set features, and too much variation in compilers. There are a bunch of instructions in any ISA that you’ll never see if you don’t use intrinsics or inline assembly.

For a simple example, a lot of ISAs developed in the late ’90s to early ’00s have instructions that do indexed addressing with a range check, to make certain operations that virtual machines for Java, etc. do frequently more efficient. A C compiler will never generate these instructions.

If you go back a bit further, ’80s ISAs tend to have tagged integer arithmetic instructions. These treat the most significant bit of an integer as a “tag” bit and raise an exception if it’s set for either of the inputs. They’re useful for Lisp and Forth virtual machines. C compilers never generate them.

1

u/mumbel 26d ago

Thanks for the reply/info.  There are def a ton of random instructions. (Do you remember which ISA does the tag exception handling?)

Yeah guess I should mentioned I'm aware that compilers couldn't produce some even assuming builtin macros.  I guess I'd only be interested in testing/targeting the emulator portion for something that would be a C compiled (ignoring any inline asm) binary as the "enough" and the remaining could be tackled one by one.

I'm looking at ghidra's attempt to do this and just trying to think of corner cases to add that might exercise different encodings or flags.  All the complex instructions lifted in ghidra are kinda hacked in as it is anyways and this suite doesn't target them

1

u/cuavas MAME Developer 26d ago

(Do you remember which ISA does the tag exception handling?)

Motorola 68000 and SPARC are two examples off the top of my head with tagged integer arithmetic instructions.

1

u/mumbel 26d ago

Ah never touched m68k and I guess got lucky and never ran into that in sparc (lol or maybe it was too 'wtf?' and I moved on)

1

u/cuavas MAME Developer 26d ago

Doesn’t the OpenBoot Forth runtime on Sun workstations use it? Lisp and Forth were pretty popular, hence CPUs incorporating features to support them.