A MIPS-32 interpreter(simulator) written in Rust.
If no argument, run with REPL
cargo run --release [file...]
[ENVIRONMENT VARIABLES] cargo run --release [file...]
( e.g. TOKEN_TRACE=1 REGISTER_TRACE=1 cargo run --release file.asm
)
- TOKEN_TRACE
- DATA_TRACE
- STACK_TRACE
- REGISTER_TRACE
- FP_REGISTER_TRACE
- exit ... to exit
- help ... display this message
- dispt ... display tokens
- dispd ... display data
- disps ... display stack
- dispr ... display register
- dispf ... display floating point register
- 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
- SYSCALL
- 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
Unsigned integers are not supported, but instead behave as signed integers.- If "Debug build", panics when overflow occurs.