Defined variables module, not fully working

This commit is contained in:
elvis
2024-12-16 05:15:33 +01:00
parent 590123d988
commit 25f9f12525
12 changed files with 435 additions and 50 deletions

View File

@ -142,10 +142,10 @@ let reduce_instructions (prg: RISCArchitecture.t) (lo: string list) : int =
in
helper {prg with registers = RegisterMap.add {index = r3.index} n prg.registers} tl current_label
)
| LoadI (r1, i) :: tl -> (
| LoadI (i, r3) :: tl -> (
let n = i
in
helper {prg with registers = RegisterMap.add {index = r1.index} n prg.registers} tl current_label
helper {prg with registers = RegisterMap.add {index = r3.index} n prg.registers} tl current_label
)
| Store (r1, r3) :: tl -> (
let n = RegisterMap.find {index = r1.index} prg.registers in