aboutsummaryrefslogtreecommitdiff
path: root/sim/h8300/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'sim/h8300/run.c')
-rw-r--r--sim/h8300/run.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sim/h8300/run.c b/sim/h8300/run.c
index 5b0f732..3010433 100644
--- a/sim/h8300/run.c
+++ b/sim/h8300/run.c
@@ -56,29 +56,29 @@ main (ac, av)
if (verbose)
printf ("run %s\n", name);
- abfd = bfd_openr (name, "coff-h8300");
- if (abfd)
+ abfd = bfd_openr (name, "coff-h8300");
+ if (abfd)
+ {
+ if (bfd_check_format(abfd, bfd_object))
{
- if (bfd_check_format(abfd, bfd_object))
- {
-
- for (s = abfd->sections; s; s=s->next)
- {
- char *buffer = malloc(bfd_section_size(abfd,s));
- bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
- sim_write(s->vma, buffer, bfd_section_size(abfd,s));
- }
+ if (abfd->arch_info->mach == bfd_mach_h8300h)
+ set_h8300h ();
- start_address = bfd_get_start_address(abfd);
- sim_store_register(
- 9,start_address);
- sim_resume(0,0);
- if (verbose)
- sim_info (verbose);
- return 0;
+ for (s = abfd->sections; s; s=s->next)
+ {
+ char *buffer = malloc(bfd_section_size(abfd,s));
+ bfd_get_section_contents(abfd, s, buffer, 0, bfd_section_size(abfd,s));
+ sim_write(s->vma, buffer, bfd_section_size(abfd,s));
}
+
+ start_address = bfd_get_start_address(abfd);
+ sim_store_register(9,start_address);
+ sim_resume(0,0);
+ if (verbose)
+ sim_info (verbose);
+ return 0;
}
-
+ }
return 1;
}