May 21 2004
16-bit emulated CPU?
Christian and I are working on an interpreter (written in C) for the Transputer instruction set. We are currently wrestling with porting the run-time to the LEGO Mindstorm. More precisely, we have cross-compiled our interpreter and run it successfully on the LEGO—no question about that—but what we have no way of doing is debugging on the Mindstorm.
When testing on Linux, we can use printf statements, or (more often) we use GDB (the GNU debugger) to explore how our application is running or how it has failed. On the LEGO, we have no output to speak of, and as we are currently debugging platform-specific communication, it is hard to… well, use the limited communication capabilities of the LEGO for expressing what is going on inside of it.
Is this where we’re supposed to buy a development board for the H8/300 series microprocessor and do things the “right” way? Or, is there a software-only solution that would allow us to develop C, cross-compile to an emulated CPU, and test/debug our 16-bit code on that? We’ve had no luck w/ Google finding something that answers this question adequately. It is possible we don’t know what we’re looking for.
Comments or emails on the subject (mcj4 at kent dot ac dot uk) are appreciated.
2 Responses to “16-bit emulated CPU?”
If you’re just looking to test the 16-bit-ness, then the easiest way to do that may be to use a 16-bit PC environment: use dosbox or DOSEmu to run the Open Watcom (http://www.openwatcom.org/) compiler suite, which’ll compile and debug 16-bit binaries.
Failing that, I guess you could learn Morse code and use the Mindstorms box’s beeper to “print” out debugging messages.
You laugh… if we weren’t debugging external channel communications, I would consider it…
Many thanks for the compiler pointer; that might do well for us.