diff --git a/hbasm/assets/memory.hbasm b/hbasm/assets/memory.hbasm new file mode 100644 index 0000000..133def5 --- /dev/null +++ b/hbasm/assets/memory.hbasm @@ -0,0 +1,3 @@ +li r20, 1010 +st r20, r24, 0, 1 +addi r24, r0, 10 \ No newline at end of file diff --git a/hbvm/assets/memory.hb b/hbvm/assets/memory.hb new file mode 100644 index 0000000..9fe3575 Binary files /dev/null and b/hbvm/assets/memory.hb differ diff --git a/hbvm/src/main.rs b/hbvm/src/main.rs index a680dd8..28ec8ce 100644 --- a/hbvm/src/main.rs +++ b/hbvm/src/main.rs @@ -36,7 +36,12 @@ fn main() -> Result<(), Box> { println!("Program interrupt: {:?}", vm.run()); println!("{:?}", vm.registers); - std::alloc::dealloc(data, std::alloc::Layout::from_size_align_unchecked(4096, 4096)); + + println!("{:?}", core::slice::from_raw_parts(data, 4096)); + std::alloc::dealloc( + data, + std::alloc::Layout::from_size_align_unchecked(4096, 4096), + ); vm.memory.unmap(0).unwrap(); } }