Giter Club home page Giter Club logo

mipsi's Introduction

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.

mipsi's People

Contributors

kumavale avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.