* interp.c (sim_fetch_register): Only store a single byte for
authorStephane Carrez <stcarrez@nerim.fr>
Sat, 1 Mar 2003 16:00:09 +0000 (16:00 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Sat, 1 Mar 2003 16:00:09 +0000 (16:00 +0000)
1 byte registers.

sim/m68hc11/ChangeLog
sim/m68hc11/interp.c

index 325b8874a7cb9977926f4eca237ff1a1c4085d4e..21957ef7791b9c407e16df31667989fb871ed587 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-01  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * interp.c (sim_fetch_register): Only store a single byte for
+       1 byte registers.
+
 2003-02-27  Andrew Cagney  <cagney@redhat.com>
 
        * interp.c (sim_prepare_for_program, sim_open)
index 8a60606223ab76d5bbca1d57afd96ba3b84ef6b7..3da382d88ad1b1cc47b199bdfa350f8397ce012c 100644 (file)
@@ -554,8 +554,15 @@ sim_fetch_register (SIM_DESC sd, int rn, unsigned char *memory, int length)
       val = 0;
       break;
     }
-  memory[0] = val >> 8;
-  memory[1] = val & 0x0FF;
+  if (size == 1)
+    {
+      memory[0] = val;
+    }
+  else
+    {
+      memory[0] = val >> 8;
+      memory[1] = val & 0x0FF;
+    }
   return size;
 }