Skip to content

Compile big endian MIPS assembly using only the Rust toolchain.

Notifications You must be signed in to change notification settings

onsdagens/mips-asm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mips_asm

Compile raw MIPS assembly using only the Rust toolchain

Installation

  • Rust installed.

  • Rust LLVM tools distribution (you can also use any llvm or gnu counterpart)

  • Cargo binutils for easy integration.

rustup component add llvm-tools 
cargo install cargo-binutils

How it works

This crate provides a scaffolding for compiling assembly programs for the big endian MIPS.

Since Rust only supports mipsle-unknown-none (the little endian version) out of the box, we provide a target description for a big endian MIPS in the mips.json file. We also provide a simple linker script in memory.x.

This crate is set up to automatically use the provided target description and linker script. On cargo build, the assembly contained in asm.s is emitted as a global assembly block.

Example

To edit the assembly to be compiled, edit the asm.s file in the root of this repo.

To build a binary.

cargo build 

To disassemble the generated binary.

cargo objdump -- --disassemble --print-imm-hex

To get size information and layout for sections and symbols.

cargo nm

About

Compile big endian MIPS assembly using only the Rust toolchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published