John Levine writes:
It used to be harder because programs would store into
the instruction
stream but these days code is all read-only it's quite standard. I'm
typing this on my M1 Macbook using an editor that thinks it's running
on an x86.
Note that Apple silicon has special hardware - not in standard ARM
devices - to accomodate the x86 memory model. I don't know the detals
of Rosetta 2, but I believe this hardware is an important component to
make it work.