Browse Source

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

* compile.c (sim_resume): Fix O_NEG insn.
gdb-4_18-branch
David Edelsohn 34 years ago
parent
commit
cf5b4aa63a
  1. 5
      sim/h8300/ChangeLog
  2. 8
      sim/h8300/compile.c
  3. 38
      sim/h8300/run.c

5
sim/h8300/ChangeLog

@ -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.

8
sim/h8300/compile.c

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

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

Loading…
Cancel
Save