From 70542d46a2cfe3371164656fac3be74d44327263 Mon Sep 17 00:00:00 2001 From: chad Date: Fri, 30 May 2014 09:50:38 -0600 Subject: [PATCH] Memory size should be a multiple of word size. Otherwise it's hard to fetch/read the last instruction/byte. --- src/mem.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mem.cpp b/src/mem.cpp index bffff41e..f151aa98 100644 --- a/src/mem.cpp +++ b/src/mem.cpp @@ -29,6 +29,8 @@ RamMemDevice::RamMemDevice(const char *filename, Size wordSize) : } do { contents.push_back(input.get()); } while (input); + + while (contents.size() % wordSize) contents.push_back(0x00); } RamMemDevice::RamMemDevice(Size size, Size wordSize) :