Commit | Line | Data |
---|---|---|
3c9b82ba | 1 | /* BFD library support routines for the Z80 architecture. |
b3adc24a | 2 | Copyright (C) 2005-2020 Free Software Foundation, Inc. |
3c9b82ba NC |
3 | Contributed by Arnold Metselaar <arnold_m@operamail.com> |
4 | ||
5 | This file is part of BFD, the Binary File Descriptor library. | |
6 | ||
7 | This program is free software; you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
cd123cb7 | 9 | the Free Software Foundation; either version 3 of the License, or |
3c9b82ba NC |
10 | (at your option) any later version. |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program; if not, write to the Free Software | |
19 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, | |
20 | MA 02110-1301, USA. */ | |
21 | ||
3c9b82ba | 22 | #include "sysdep.h" |
3db64b00 | 23 | #include "bfd.h" |
3c9b82ba NC |
24 | #include "libbfd.h" |
25 | ||
26 | const bfd_arch_info_type bfd_z80_arch; | |
27 | ||
28 | /* This routine is provided two arch_infos and | |
29 | returns whether they'd be compatible. */ | |
30 | ||
31 | static const bfd_arch_info_type * | |
32 | compatible (const bfd_arch_info_type *a, const bfd_arch_info_type *b) | |
33 | { | |
34 | if (a->arch != b->arch) | |
35 | return NULL; | |
36 | ||
37 | if (a->mach == b->mach) | |
38 | return a; | |
39 | ||
40 | return (a->arch == bfd_arch_z80) ? & bfd_z80_arch : NULL; | |
41 | } | |
42 | ||
6655dba2 SB |
43 | #define N(name,print,bits,default,next) \ |
44 | { 16, bits, 8, bfd_arch_z80, name, "z80", print, 0, default, \ | |
aebcfb76 | 45 | compatible, bfd_default_scan, bfd_arch_default_fill, next, 0 } |
3c9b82ba NC |
46 | |
47 | #define M(n) &arch_info_struct[n] | |
48 | ||
49 | static const bfd_arch_info_type arch_info_struct[] = | |
50 | { | |
6655dba2 SB |
51 | N (bfd_mach_z80full, "z80-full", 16, FALSE, M(1)), |
52 | N (bfd_mach_z80strict, "z80-strict", 16, FALSE, M(2)), | |
53 | N (bfd_mach_z80, "z80", 16, FALSE, M(3)), | |
54 | N (bfd_mach_r800, "r800", 16, FALSE, M(4)), | |
55 | N (bfd_mach_gbz80, "gbz80", 16, FALSE, M(5)), | |
56 | N (bfd_mach_z180, "z180", 16, FALSE, M(6)), | |
9fc0b501 SB |
57 | N (bfd_mach_z80n, "z80n", 16, FALSE, M(7)), |
58 | N (bfd_mach_ez80_z80, "ez80-z80", 16, FALSE, M(8)), | |
6655dba2 | 59 | N (bfd_mach_ez80_adl, "ez80-adl", 24, FALSE, NULL) |
3c9b82ba NC |
60 | }; |
61 | ||
6655dba2 SB |
62 | const bfd_arch_info_type bfd_z80_arch = |
63 | N (bfd_mach_z80full, "z80-full", 16, TRUE, M(1)); |