|
@@ -178,6 +178,7 @@ fn um_step(um: &mut UMState, op: UMOp) {
|
|
|
let new_arr = vec![032; um.regs[c as usize] as usize];
|
|
|
let new_arr_add = um.mem.len() as u32;
|
|
|
um.mem.push(new_arr);
|
|
|
+ um.arrmap.insert(new_arr_add, new_arr_add as usize);
|
|
|
um.regs[b as usize] = new_arr_add;
|
|
|
},
|
|
|
UMOp::Abandon(c) => {
|
|
@@ -196,6 +197,12 @@ fn um_step(um: &mut UMState, op: UMOp) {
|
|
|
}
|
|
|
},
|
|
|
UMOp::Load(b, c) => {
|
|
|
+ let new_arr = um.mem[um.arrmap[&um.regs[b as usize]]].clone();
|
|
|
+ let new_arr_add = um.mem.len() as u32;
|
|
|
+ um.mem.push(new_arr);
|
|
|
+ um.arrmap.remove(&0);
|
|
|
+ um.arrmap.insert(0,new_arr_add as usize);
|
|
|
+ um.pc = um.regs[c as usize] as usize;
|
|
|
},
|
|
|
UMOp::Value(a, val) => {
|
|
|
um.regs[a as usize] = val
|