aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpacien2018-04-30 22:27:42 +0200
committerpacien2018-04-30 22:27:42 +0200
commit50d9fa50080ebb2ca0e38664f158694cc73c8398 (patch)
tree604b1e14a7d81fd63dd203edb787d57e45117f62
parentd34d9ca20f37a841ea688cb3308d766a9b231dc3 (diff)
downloadurm-50d9fa50080ebb2ca0e38664f158694cc73c8398.tar.gz
Fix Mult offset
-rw-r--r--src/eurm.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/eurm.ml b/src/eurm.ml
index cb5a9cd..8198a5b 100644
--- a/src/eurm.ml
+++ b/src/eurm.ml
@@ -67,10 +67,10 @@ let compile_stage1 eurmcmds state =
67 add_reg_label state 1 0 67 add_reg_label state 1 0
68 68
69 | Mult(r1, r2) -> 69 | Mult(r1, r2) ->
70 let ctr_reg = state.max_reg + 1 and aux_reg = state.max_reg + 2 70 let ctr_reg = state.max_reg + 1 and res_reg = state.max_reg + 2
71 and start_label = string_of_int (state.label_count + 1) and end_label = string_of_int (state.label_count + 2) 71 and start_label = string_of_int (state.label_count + 1) and end_label = string_of_int (state.label_count + 2)
72 in [ Zero(ctr_reg); Copy(aux_reg, r1); Label(start_label); EqPredicate(ctr_reg, r2, end_label); 72 in [ Zero(ctr_reg); Zero(res_reg); Label(start_label); EqPredicate(ctr_reg, r2, end_label);
73 Add(r1, aux_reg); Inc(ctr_reg); Goto(start_label); Label(end_label) ], 73 Add(res_reg, r1); Inc(ctr_reg); Goto(start_label); Label(end_label); Copy(r1, res_reg) ],
74 add_reg_label state 2 2 74 add_reg_label state 2 2
75 75
76 | ZeroPredicate(r, l) -> 76 | ZeroPredicate(r, l) ->