Skip to content
/ mipsi Public

A MIPS-32 interpreter(simulator) written in Rust.

License

Notifications You must be signed in to change notification settings

kumavale/mipsi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIPS Interpreter

Actions Status license
A MIPS-32 interpreter(simulator) written in Rust.

How to run

If no argument, run with REPL

cargo run --release [file...]

Debug run

[ENVIRONMENT VARIABLES] cargo run --release [file...]

( e.g. TOKEN_TRACE=1 REGISTER_TRACE=1 cargo run --release file.asm )

ENVIRONMENT VARIABLES
  • TOKEN_TRACE
  • DATA_TRACE
  • STACK_TRACE
  • REGISTER_TRACE
  • FP_REGISTER_TRACE

REPL command

  • exit ... to exit
  • help ... display this message
  • dispt ... display tokens
  • dispd ... display data
  • disps ... display stack
  • dispr ... display register
  • dispf ... display floating point register

Supported

  • Arithmetic, Logic
    • ADD[U]
    • ADDI[U]
    • AND
    • ANDI
    • CLO
    • CLZ
    • DIV[U]
    • MULT[U]
    • MUL
    • MULO[U]
    • MADD[U]
    • MSUB[U]
    • NEG[U]
    • NOR
    • NOT
    • OR
    • ORI
    • REM[U]
    • SLL
    • SLLV
    • SRA
    • SRAV
    • SRL
    • SRLV
    • ROL
    • ROR
    • SUB[U]
    • XOR
    • XORI
  • Constant
    • LUI
    • LI
  • Comparison
    • SLT[U]
    • SLTI[U]
    • SEQ
    • SGE[U]
    • SGT[U]
    • SLE[U]
    • SNE
  • Branch
    • B
    • BEQ
    • BGE[U]
    • BGT[U]
    • BLE[U]
    • BLT[U]
    • BNE
    • BEQZ
    • BGEZ
    • BGTZ
    • BLEZ
    • BLTZ
    • BNEZ
    • BGEZAL
    • BLTZAL
  • Jump
    • J
    • JAL
    • JR
    • JALR
  • Load
    • LA
    • LB[U]
    • LH[U]
    • LW
  • Store
    • SB
    • SH
    • SW
  • Transfer
    • MOVE
    • MFHI
    • MFLO
    • MTHI
    • MTLO
    • MOVN
    • MOVZ
  • Exception, Interrupt
    • SYSCALL
      • 1: print_int
      • 2: print_float
      • 3: print_double
      • 4: print_string
      • 5: read_int
      • 6: read_float
      • 7: read_double
      • 8: read_string
      • 9: sbrk(allocate heap memory)
      • 10: exit
      • 11: print_character
      • 12: read_character
      • 17: exit2
      • 41: random int
      • 42: random int range
    • BREAK
    • NOP
  • Indicate
    • .text
    • .data
    • .globl
    • .align
    • .word
    • .half
    • .byte
    • .float
    • .double
    • .space
    • .ascii[z]
  • My own
    • PRTN
    • PRTI
    • PRTH
    • PRTX
    • PRTC
    • PRTS
    • RST
  • Floating point
    • LI.S
    • LWC1
    • SWC1
    • MTC1
    • ADD.S
    • DIV.S
    • MUL.S
    • SUB.S
    • CVT.S.W

Note

  1. Unsigned integers are not supported, but instead behave as signed integers.
  2. If "Debug build", panics when overflow occurs.

About

A MIPS-32 interpreter(simulator) written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published