1 /* BFD support for the NEC V850 processor
2 Copyright 1994, 1995 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 const struct bfd_arch_info
* info
;
32 enum bfd_architecture arch
;
34 /* First test for an exact match */
35 if (strcmp (string
, info
->printable_name
) == 0)
38 /* See how much of the supplied string matches with the
39 architecture, eg the string m68k:68020 would match the m68k entry
40 up to the :, then we get left with the machine number */
42 for (ptr_src
= string
, ptr_tst
= info
->arch_name
;
46 if (*ptr_src
!= *ptr_tst
) break;
49 /* Chewed up as much of the architecture as will match, skip any
56 /* nothing more, then only keep this one if it is the default
57 machine for this architecture */
58 return info
->the_default
;
62 while (isdigit (*ptr_src
))
64 number
= number
* 10 + * ptr_src
- '0';
70 case bfd_mach_v850e
: arch
= bfd_arch_v850
; break;
71 case bfd_mach_v850eq
: arch
= bfd_arch_v850
; break;
77 if (arch
!= info
->arch
)
80 if (number
!= info
->mach
)
87 static const bfd_arch_info_type arch_info_struct
[2] =
89 /* start-sanitize-v850e */
91 32, /* 32 bits in a word */
92 32, /* 32 bits in an address */
93 8, /* 8 bits in a byte */
100 bfd_default_compatible
,
102 & arch_info_struct
[ 1 ],
104 /* end-sanitize-v850e */
105 /* start-sanitize-v850eq */
107 32, /* 32 bits in a word */
108 32, /* 32 bits in an address */
109 8, /* 8 bits in a byte */
116 bfd_default_compatible
,
120 /* end-sanitize-v850eq */
123 const bfd_arch_info_type bfd_v850_arch
=
125 32, /* 32 bits in a word */
126 32, /* 32 bits in an address */
127 8, /* 8 bits in a byte */
129 0, /* only 1 machine */
133 true, /* the default */
134 bfd_default_compatible
,
136 & arch_info_struct
[ 0 ],