Make RL78 disassembler and simulator respect ISA for mul/div
[deliverable/binutils-gdb.git] / sim / rl78 / mem.c
index 8d95199352cae54aa19daf39bbb93150fca5a764..f40d2c163939dcc46239578b0c3f95c59abe8072 100644 (file)
@@ -63,6 +63,18 @@ mem_rom_size (int rom_bytes)
   rom_limit = rom_bytes;
 }
 
+int mirror_rom_base = 0x01000;
+int mirror_ram_base = 0xf1000;
+int mirror_length = 0x7000;
+
+void
+mem_set_mirror (int rom_base, int ram_base, int length)
+{
+  mirror_rom_base = rom_base;
+  mirror_ram_base = ram_base;
+  mirror_length = length;
+}
+
 /* ---------------------------------------------------------------------- */
 /* Note: the RL78 memory map has a few surprises.  For starters, part
    of the first 64k is mapped to the last 64k, depending on an SFR bit
@@ -92,13 +104,11 @@ static int
 address_mapping (int address)
 {
   address &= MASK;
-  if (address >= 0xf1000 && address < ram_base)
+  if (address >= mirror_ram_base && address < mirror_ram_base + mirror_length)
     {
-      address &= 0xffff;
-      tprintf ("&");
+      address = address - mirror_ram_base + mirror_rom_base;
       if (memory[RL78_SFR_PMC] & 1)
        {
-         tprintf ("|");
          address |= 0x10000;
        }
       last_addr_was_mirror = 1;
This page took 0.025947 seconds and 4 git commands to generate.