On Mar 19, 2012, at 2:56 PM, Eric Smith wrote:
David Riley wrote:
Unfortunately, that method of trapping A-line
instructions makes it
impossible to try to port MacOS to Coldfire (something which I had
the harebrained idea to do once), because Coldfire uses the 0xA
prefix for its enhanced MAC (multiply-accumulate, not Mac, though
the irony is delicious) unit. You'd have to do other opcode
translations, too, but that pretty much blows the Toolbox calls out
of the water, since there's no equivalent illegal prefix.
So what? Since
you're going to have to reassemble/recompile code anyhow, just do the system calls
with two words instead of one. If you felt strongly about it, the second word could even
be the exact Axxx word used on the Mac.
Well, that's a good point. I was mostly being lazy. :-) Certainly
a subroutine jump would provide the address of the A-line on the
stack.
There are, of course, other things that make it a bit harder, like
the fact that the Coldfire architecture got rid of some of the more
CISC-y instructions (or modes of instructions) and rearranged a few
others for opcode efficiency; I know there's an automatic converter
out there somewhere, but I'm sure some of the clever tricks employed
by the ROM writers would make it a little hard. I'd hope for
something that could be patched in without moving much around, but
that's almost always too much to ask for.
- Dave