* run.c (main): If h8/300h binary detected, call set_h8300h.

* compile.c (sim_resume): Fix O_NEG insn.
This commit is contained in:
David Edelsohn 1993-07-15 17:01:40 +00:00
parent b3a2b4975f
commit cf5b4aa63a
3 changed files with 28 additions and 23 deletions

View File

@ -1,3 +1,8 @@
Thu Jul 15 09:59:01 1993 Doug Evans (dje@canuck.cygnus.com)
* run.c (main): If h8/300h binary detected, call set_h8300h.
* compile.c (sim_resume): Fix O_NEG insn.
Fri Jul 9 14:36:48 1993 Doug Evans (dje@canuck.cygnus.com)
* run.c (main): Add -h flag to enable h8/300h emulation.

View File

@ -823,11 +823,11 @@ sim_resume (step)
res = rd + ea;
goto alu8;
#define RD rd = fetch(&code->src);
#define RD_EA rd = fetch(&code->dst); ea = fetch(&code->src);
#define EA ea = fetch(&code->src);
#define RD_EA ea = fetch(&code->src); rd = fetch(&code->dst);
ALUOP (1, O_SUB, RD_EA; ea = -ea ; res = rd + ea);
ALUOP (1, O_NEG, RD; ea = -ea ;rd = 0; res = rd + ea);
ALUOP (1, O_SUB, RD_EA; ea = -ea ; res = rd + ea);
ALUOP (1, O_NEG, EA; ea = -ea ; rd = 0; res = rd + ea);
case O(O_ADD,SB):
rd = GET_B_REG(code->dst.reg);

View File

@ -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))
if (abfd->arch_info->mach == bfd_mach_h8300h)
set_h8300h ();
for (s = abfd->sections; s; s=s->next)
{
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;
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;
}