RISC code output
TODO: fix wrong order for conversion in cfgrisc
This commit is contained in:
17
bin/main.ml
17
bin/main.ml
@ -1,11 +1,22 @@
|
||||
open MiniImp
|
||||
|
||||
let () =
|
||||
(* let program = "def main with input x output y as *)
|
||||
(* x := 2; *)
|
||||
(* if y < 0 then ( *)
|
||||
(* y := x + 3; *)
|
||||
(* x := y; *)
|
||||
(* ) else *)
|
||||
(* x := 1 - y;" in *)
|
||||
|
||||
let program = "def main with input x output y as
|
||||
x := 2;
|
||||
if y < 0 then (
|
||||
y := x + 3;
|
||||
x := y;
|
||||
if x > 0 then
|
||||
x := y;
|
||||
else
|
||||
x := y + 1;
|
||||
) else
|
||||
x := 1 - y;" in
|
||||
|
||||
@ -19,4 +30,6 @@ let () =
|
||||
|
||||
let convertedrisccfg = CfgRISC.convert convertedcfg in
|
||||
|
||||
Printf.printf "%a" CfgRISC.RISCCfg.pp convertedrisccfg
|
||||
let risc = RISC.convert convertedrisccfg in
|
||||
|
||||
Printf.printf "%a" RISC.RISCAssembly.pp risc
|
||||
|
||||
Reference in New Issue
Block a user