|
|
|
@ -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; |
|
|
|
} |
|
|
|
|