Are there any command line interpreters or any other set of programs around for x86 linux in order to run MIPS assembly programs?
I\'d like to be able to write simpl
You could use gxemul, which emulates a MIPS machine (among others, including Dreamcast), and is able to run many Operating systems (included linux, netbsd and some more).
gxemul-wikipedia
gxemul-home page
Maybe you can take a look at these emulators? I'm not an expert but the list seems good.
MARS made my assembly programming for MIPS architecture so much easier. If you would like a GUI/IDE, I would recommend MARS for sure.
You will need either a cross compilation toolchain, or to build your own cross binutils. For a prebuilt toolchain, you can visit code sourcery. If you just want to compile assembly, then all you need is binutils. There are some guidelines on the Linux Mips wiki
For the emulation part, QEmu would be my choice.
Incidentally, Spim does not require X Windows. It has a console interface as well. Run either spim
or xspim
.
Assuming you wish to use GCC.
Steps for compiling for MIPS on an x84-64 system, and then running the executable using an emulator:
Use a cross-compilation toolchain to produce an executable.
If you are on Debian/Ubuntu, install a cross-compilation toolchain for MIPS. For example, either of these APT packages: gcc-mips-linux-gnu
(MIPS big endian) or gcc-mipsel-linux-gnu
(MIPS little endian).
Compile using mips-linux-gnu-gcc
(mipsel-linux-gnu-gcc
for little endian MIPS); assemble using mips-linux-gnu-as
; link using mips-linux-gnu-gcc
.
Run the executable using an emulator.
sudo apt-get install qemu-user
.qemu-mips ./a.out
(or qemu-mipsel ./a.out
for little endian MIPS). Simply running ./a.out
also works; the emulator will be used.