From 00416c6ed6b354207787df2ac7a6b1e8ad11fece Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Sat, 1 Mar 2003 16:00:09 +0000 Subject: [PATCH] * interp.c (sim_fetch_register): Only store a single byte for 1 byte registers. --- sim/m68hc11/ChangeLog | 5 +++++ sim/m68hc11/interp.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog index 325b8874a7c..21957ef7791 100644 --- a/sim/m68hc11/ChangeLog +++ b/sim/m68hc11/ChangeLog @@ -1,3 +1,8 @@ +2003-03-01 Stephane Carrez + + * interp.c (sim_fetch_register): Only store a single byte for + 1 byte registers. + 2003-02-27 Andrew Cagney * interp.c (sim_prepare_for_program, sim_open) diff --git a/sim/m68hc11/interp.c b/sim/m68hc11/interp.c index 8a60606223a..3da382d88ad 100644 --- a/sim/m68hc11/interp.c +++ b/sim/m68hc11/interp.c @@ -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; } -- 2.30.2