aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-04-30 20:57:47 +0200
committerpacien2018-04-30 20:57:47 +0200
commit651e72602de2bdaeda933934de7f2a9be01aff09 (patch)
tree02222e50416a2a9812edd5faf94d7bb91147a048
parenta27cc602422cc9076ddc1d0e7db3f3cbf2bf193f (diff)
downloadurm-651e72602de2bdaeda933934de7f2a9be01aff09.tar.gz
Add missing instruction translations
-rw-r--r--src/eurm.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/eurm.ml b/src/eurm.ml
index 2b8cc5b..1e6d7d2 100644
--- a/src/eurm.ml
+++ b/src/eurm.ml
@@ -130,10 +130,14 @@ let compile_stage4 eurmcmds state =
130 in let transform = function 130 in let transform = function
131 | Inc(r) -> [ URMSucc(r) ], state 131 | Inc(r) -> [ URMSucc(r) ], state
132 | Zero(r) -> [ URMZero(r) ], state 132 | Zero(r) -> [ URMZero(r) ], state
133 | Copy(r1, r2) -> [ URMCopy(r1, r2) ], state
133 | EqPredicate(r1, r2, lbl) -> [ URMJump(r1, r2, Hashtbl.find label_table lbl) ], state 134 | EqPredicate(r1, r2, lbl) -> [ URMJump(r1, r2, Hashtbl.find label_table lbl) ], state
134 | Label(_) -> 135 | Label(_) ->
135 let dummy_reg = state.max_reg + 1 136 let dummy_reg = state.max_reg + 1
136 in [ URMZero(dummy_reg) ], add_reg_label state 1 0 137 in [ URMZero(dummy_reg) ], add_reg_label state 1 0
138 | Quit ->
139 let dummy_reg = state.max_reg + 1
140 in [ URMZero(dummy_reg); URMJump(dummy_reg, dummy_reg, -1) ], add_reg_label state 1 0
137 | _ -> failwith "Invalid_argument" 141 | _ -> failwith "Invalid_argument"
138 in build_label_table eurmcmds; apply_transform (transform) state eurmcmds 142 in build_label_table eurmcmds; apply_transform (transform) state eurmcmds
139 143