summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index 553766a..226eadf 100644
--- a/memory.c
+++ b/memory.c
@@ -27,6 +27,16 @@ void memory_set_byte(struct memory *mem, int32_t addr, uint8_t data)
base[addr - mem->image_base] = data;
}
+uint16_t memory_get_halfword(struct memory *mem, int32_t addr)
+{
+ return mem->base[(addr - mem->image_base) / 2];
+}
+
+void memory_set_halfword(struct memory *mem, int32_t addr, uint16_t data)
+{
+ mem->base[(addr - mem->image_base) / 2] = data;
+}
+
uint32_t memory_get_word(struct memory *mem, int32_t addr)
{
return mem->base[(addr - mem->image_base) / 4];