Files
lci/lib/miniImp/RISC.mli
2024-12-16 05:15:33 +01:00

61 lines
1005 B
OCaml

module RISCAssembly : sig
type register = {
index : string
}
type label = string
type risci =
| Nop
| BRegOp of brop * register * register * register
| BImmOp of biop * register * int * register
| URegOp of urop * register * register
| Load of register * register
| LoadI of int * register
| Store of register * register
| Jump of label
| CJump of register * label * label
| Label of label
and brop =
| Add
| Sub
| Mult
| Div
| Mod
| Pow
| And
| Or
| Eq
| Less
| LessEq
| More
| MoreEq
and biop =
| AddI
| SubI
| MultI
| DivI
| ModI
| PowI
| AndI
| OrI
| EqI
| LessI
| LessEqI
| MoreI
| MoreEqI
and urop =
| Not
| Copy
| Rand
type t = {
code : risci list;
inputval: int option
}
val pp_risci : out_channel -> risci -> unit
val pp : out_channel -> t -> unit
end
val convert : CfgRISC.RISCCfg.t -> RISCAssembly.t