1 /* front end to the simulator.
3 Written by Steve Chamberlain of Cygnus Support.
6 This file is part of H8/300 sim
9 THIS SOFTWARE IS NOT COPYRIGHTED
11 Cygnus offers the following for use in the public domain. Cygnus
12 makes no warranty with regard to the software or it's performance
13 and the user accepts the software "AS IS" with all faults.
15 CYGNUS DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO
16 THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 bfd_vma start_address
;
36 for (i
= 1; i
< ac
; i
++)
41 else if (strcmp(av
[i
],"-t") == 0)
45 else if (strcmp(av
[i
],"-c") == 0)
47 sim_csize(atoi(av
[i
+1]));
50 if (strcmp (av
[i
], "-v") == 0)
54 else if (strcmp (av
[i
], "-t") == 0)
74 printf ("run %s\n", name
);
81 printf("run %s\n", name
);
83 abfd
= bfd_openr(name
,"coff-h8300");
85 abfd
= bfd_openr (name
, "coff-h8300");
95 if (bfd_check_format(abfd
, bfd_object
))
98 for (s
= abfd
->sections
; s
; s
=s
->next
)
100 char *buffer
= malloc(bfd_section_size(abfd
,s
));
101 bfd_get_section_contents(abfd
, s
, buffer
, 0, bfd_section_size(abfd
,s
));
102 sim_write(s
->vma
, buffer
, bfd_section_size(abfd
,s
));
105 start_address
= bfd_get_start_address(abfd
);
112 if (bfd_check_format (abfd
, bfd_object
))
115 for (s
= abfd
->sections
; s
; s
= s
->next
)
117 char *buffer
= malloc (bfd_section_size (abfd
, s
));
118 bfd_get_section_contents (abfd
, s
, buffer
, 0, bfd_section_size (abfd
, s
));
119 sim_write (s
->vma
, buffer
, bfd_section_size (abfd
, s
));
122 start_address
= bfd_get_start_address (abfd
);
This page took 0.031473 seconds and 4 git commands to generate.