How can I execute MIPS assembly programs on an x86 linux?

前端 未结 8 804
名媛妹妹
名媛妹妹 2020-12-13 15:35

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

相关标签:
8条回答
  • 2020-12-13 15:58

    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

    0 讨论(0)
  • 2020-12-13 15:59

    Maybe you can take a look at these emulators? I'm not an expert but the list seems good.

    0 讨论(0)
  • 2020-12-13 16:00

    MARS made my assembly programming for MIPS architecture so much easier. If you would like a GUI/IDE, I would recommend MARS for sure.

    0 讨论(0)
  • 2020-12-13 16:05

    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.

    0 讨论(0)
  • 2020-12-13 16:07

    Incidentally, Spim does not require X Windows. It has a console interface as well. Run either spim or xspim.

    0 讨论(0)
  • 2020-12-13 16:12

    Assuming you wish to use GCC.

    Steps for compiling for MIPS on an x84-64 system, and then running the executable using an emulator:

    1. 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.

    2. Run the executable using an emulator.

      • Install an emulator that can launch Linux processes compiled for one CPU (e.g. MIPS) on another CPU (e.g. x84-64): sudo apt-get install qemu-user.
      • Run your executable compiled for MIPS using the emulator: qemu-mips ./a.out (or qemu-mipsel ./a.out for little endian MIPS). Simply running ./a.out also works; the emulator will be used.
    0 讨论(0)
提交回复
热议问题