From f4c55ae3cc9b62e34f19a3108d5854917d2bcf05 Mon Sep 17 00:00:00 2001 From: able Date: Tue, 25 Jul 2023 12:20:35 -0500 Subject: [PATCH] changes I GUESS --- hbasm/assets/memory.hbasm | 3 +++ hbvm/assets/memory.hb | Bin 0 -> 46 bytes hbvm/src/main.rs | 7 ++++++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 hbasm/assets/memory.hbasm create mode 100644 hbvm/assets/memory.hb 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 0000000000000000000000000000000000000000..9fe357520153a5f5ccf15f5a6793ae05728d0d3f GIT binary patch literal 46 ecmb0U`NYfs267@25C#JSBZGhh0~d^kL<0apSOKE| literal 0 HcmV?d00001 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(); } }