aboutsummaryrefslogtreecommitdiff
path: root/src/memory.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.rs')
-rw-r--r--src/memory.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/memory.rs b/src/memory.rs
index c3cc60a..d321711 100644
--- a/src/memory.rs
+++ b/src/memory.rs
@@ -75,7 +75,13 @@ pub struct DirectMappedCache<T: MemoryInterface> {
}
impl Memory {
- pub fn new(size: isa::Address, binary: Binary) -> Memory {
+ pub fn new(size: isa::Address) -> Memory {
+ Memory {
+ memory: vec![0; size as usize],
+ }
+ }
+
+ pub fn new_from_binary(size: isa::Address, binary: Binary) -> Memory {
let mut memory = binary.words.clone();
let size = size as usize;
if size > memory.len() {