Module Mips


module Mips: sig .. end
MIPS instructions


type mips =
| I of string * Register.reg * int (*instruction with one immediate value as input (example: li)*)
| R of string * Register.reg * Register.reg (*instruction with one register as input (example: neg)*)
| RI of string * Register.reg * Register.reg * int (*instruction with one register and one immediate value as input (example: addi)*)
| RR of string * Register.reg * Register.reg * Register.reg (*instruction with two registers as input (example: add)*)
| LW of Register.reg * Register.reg * int (*LW(r,s,i) corresponds to lw r, i(s)*)
| SW of Register.reg * Register.reg * int (*SW(r,s,i) corresponds to sw r, i(s)*)
| Syscall (*syscall instruction*)
Type for a MIPS instruction
val print_mips : Pervasives.out_channel -> mips -> unit
printing function for a MIPS instruction