diff --git a/sim/h8300/Makefile.in b/sim/h8300/Makefile.in
index da68255..713de00 100644
--- a/sim/h8300/Makefile.in
+++ b/sim/h8300/Makefile.in
@@ -18,6 +18,7 @@
## COMMON_PRE_CONFIG_FRAG
SIM_OBJS = compile.o \
+ io.o \
$(SIM_NEW_COMMON_OBJS) \
sim-load.o
@@ -28,3 +29,5 @@ compile.o: compile.c inst.h config.h \
$(srcdir)/../../include/opcode/h8300.h \
$(srcdir)/../../include/gdb/remote-sim.h \
$(srcdir)/../../include/gdb/callback.h
+
+io.o: io.c sim-main.h
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index d084b5d..b2fe38a 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -41,11 +41,14 @@
#endif
int debug;
+int h8300_interrupt_mode;
host_callback *sim_callback;
static SIM_OPEN_KIND sim_kind;
static char *myname;
+static int verbose_interrupt = 0;
+static int logging = 0;
/* FIXME: Needs to live in header file.
This header should also include the things in remote-sim.h.
@@ -578,10 +581,8 @@ lvalue (SIM_DESC sd, int x, int rn, unsigned int *val)
static int
cmdline_location()
{
- if (h8300smode && !h8300_normal_mode)
- return 0xffff00L;
- else if (h8300hmode && !h8300_normal_mode)
- return 0x2ff00L;
+ if ((h8300hmode || h8300smode) && !h8300_normal_mode)
+ return 0xff0000L;
else
return 0xff00L;
}
@@ -1037,12 +1038,15 @@ decode (SIM_DESC sd, int addr, unsigned char *data, decoded_inst *dst)
/* 8-bit ABS is displacement from SBR.
16 and 32-bit ABS are displacement from ZERO.
- (SBR will always be zero except for h8/sx)
+ (SBR will always be 0xffff00 except for h8/sx)
*/
if ((x & SIZE) == L_8)
p->reg = SBR_REGNUM;
else
- p->reg = ZERO_REGNUM;;
+ p->reg = ZERO_REGNUM;
+ /* address extend for @x:16 */
+ if ((x & SIZE) == L_16U)
+ p->literal += (p->literal >= 0x8000)?0xff0000:0x000000;
}
else if ((x & MODE) == ME
|