|
@@ -175,8 +175,15 @@ fn um_step(um: &mut UMState, op: UMOp) {
|
|
|
panic!("Halt reached")
|
|
|
},
|
|
|
UMOp::Allocate(b, c) => {
|
|
|
+ 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.regs[b as usize] = new_arr_add;
|
|
|
},
|
|
|
UMOp::Abandon(c) => {
|
|
|
+ let i = um.arrmap[&um.regs[c as usize]];
|
|
|
+ um.arrmap.remove(&um.regs[c as usize]);
|
|
|
+ um.mem[i] = vec![0u32; 0];
|
|
|
},
|
|
|
UMOp::Output(c) => {
|
|
|
print!("{}", um.regs[c as usize] as u8 as char)
|