Browse Source

Import dasm-tigcc, a GPL'ed improved replacement of ttdasm, which uses the GDB disassembler and modified chunks of code from libti* & TIEmu.
Original author: Kevin Kofler.

git-svn-id: file:///var/svn/tigccpp/trunk@1352 9552661e-59e3-4036-b4f2-dbe53926924f

debrouxl 15 years ago
parent
commit
a45cfbf1fa
58 changed files with 18245 additions and 0 deletions
  1. 339 0
      external/dasm-tigcc/COPYING
  2. 86 0
      external/dasm-tigcc/ChangeLog
  3. 37 0
      external/dasm-tigcc/Makefile
  4. 5273 0
      external/dasm-tigcc/bfd.h
  5. 350 0
      external/dasm-tigcc/dis-asm.h
  6. 102 0
      external/dasm-tigcc/dis-buf.c
  7. 43 0
      external/dasm-tigcc/dis-init.c
  8. 102 0
      external/dasm-tigcc/disasm.c
  9. 27 0
      external/dasm-tigcc/disasm.h
  10. 501 0
      external/dasm-tigcc/disassemble.c
  11. 186 0
      external/dasm-tigcc/er_codes.c
  12. 43 0
      external/dasm-tigcc/error.h
  13. 206 0
      external/dasm-tigcc/files9x.c
  14. 37 0
      external/dasm-tigcc/files9x.h
  15. 132 0
      external/dasm-tigcc/filesxx.c
  16. 347 0
      external/dasm-tigcc/filetypes.c
  17. 209 0
      external/dasm-tigcc/fpudasm.c
  18. 103 0
      external/dasm-tigcc/generic.h
  19. 139 0
      external/dasm-tigcc/hwpm.c
  20. 65 0
      external/dasm-tigcc/hwpm.h
  21. 607 0
      external/dasm-tigcc/images.c
  22. 77 0
      external/dasm-tigcc/images.h
  23. 3 0
      external/dasm-tigcc/int_def.inc
  24. 41 0
      external/dasm-tigcc/integers.c
  25. 161 0
      external/dasm-tigcc/integers.h
  26. 1627 0
      external/dasm-tigcc/m68k-dis.c
  27. 2429 0
      external/dasm-tigcc/m68k-opc.c
  28. 368 0
      external/dasm-tigcc/m68k.h
  29. 42 0
      external/dasm-tigcc/macros.h
  30. 719 0
      external/dasm-tigcc/main.c
  31. 35 0
      external/dasm-tigcc/main.h
  32. 122 0
      external/dasm-tigcc/mem.c
  33. 70 0
      external/dasm-tigcc/mem.h
  34. 137 0
      external/dasm-tigcc/mem89.c
  35. 43 0
      external/dasm-tigcc/mem89.h
  36. 146 0
      external/dasm-tigcc/mem89tm.c
  37. 43 0
      external/dasm-tigcc/mem89tm.h
  38. 127 0
      external/dasm-tigcc/mem92.c
  39. 43 0
      external/dasm-tigcc/mem92.h
  40. 138 0
      external/dasm-tigcc/mem92p.c
  41. 43 0
      external/dasm-tigcc/mem92p.h
  42. 77 0
      external/dasm-tigcc/mem_size.h
  43. 138 0
      external/dasm-tigcc/memv2.c
  44. 43 0
      external/dasm-tigcc/memv2.h
  45. 42 0
      external/dasm-tigcc/opintl.h
  46. 167 0
      external/dasm-tigcc/romcalls.c
  47. 67 0
      external/dasm-tigcc/romcalls.h
  48. 1558 0
      external/dasm-tigcc/romcalls.inc
  49. 240 0
      external/dasm-tigcc/rwfile.c
  50. 48 0
      external/dasm-tigcc/rwfile.h
  51. 40 0
      external/dasm-tigcc/sysdep.h
  52. 66 0
      external/dasm-tigcc/ti68k_def.h
  53. 50 0
      external/dasm-tigcc/ti68k_err.h
  54. 156 0
      external/dasm-tigcc/tifiles.h
  55. 57 0
      external/dasm-tigcc/timem.c
  56. 43 0
      external/dasm-tigcc/timem.h
  57. 73 0
      external/dasm-tigcc/tt.h
  58. 32 0
      external/dasm-tigcc/xmalloc.c

+ 339 - 0
external/dasm-tigcc/COPYING

@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+                          59 Temple Place - Suite 330, Boston, MA 02111 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	Appendix: How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) 19yy  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19yy name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.

+ 86 - 0
external/dasm-tigcc/ChangeLog

@@ -0,0 +1,86 @@
+2007-06-18  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * generic.h (ATTRIBUTE_PACKED, ATTRIBUTE_MAY_ALIAS): fix inverted #ifdef __GNUC__ logic
+        * integers.h (TI1, TI2, TI4, HI1, HI2, HI4): Work around GCC bug with __attribute__((may_alias)).
+
+2007-04-06  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * main.c (main): check the return values of fread
+        * filetypes.c: include sysdep.h
+          (is_regfile): mark filename with ATTRIBUTE_UNUSED
+
+2007-04-04  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+
+        * main.c: import ttdasm.c from ttdasm, rename to main.c, remove VTI
+                  code, port to TiEmu code
+        * tt.h: import from ttdasm, add USAGE_OUT from tt_version.h
+        * bfd.h, disasm.c, dis-asm.h, disasm.h, disassemble.c, dis-buf.c,
+          dis-init.c, m68k-dis.c, m68k.h, m68k-opc.c, opintl.h, sysdep.h: import
+            from TiEmu-patched GDB. Changes from TiEmu:
+            2007-04-04  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * m68k-dis.c (print_insn_arg): Don't accept floating-point immediates.
+                      (NEXTSINGLE, NEXTDOUBLE, NEXTEXTEND, NEXTPACKED): Remove.
+                      (print_insn_arg): Only accept %usp and %ssp as special registers on the 68000.
+                                        Handle failure return from print_indexed.
+                      (print_indexed): Only allow valid indexed addressing on the 68000.
+            2006-05-14  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * m68k-dis.c (m68k_scan_mask): Remove excess spaces. Fix a use of $ instead of 0x.
+            2005-05-22  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * m68k-dis.c (m68k_scan_mask): Handle A-Line (ER_throw) instructions.
+            2005-05-11  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * m68k-dis.c: Use asm_setjmp and asm_longjmp on Win32.
+            2005-04-29  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * m68k-dis.c (print_insn_arg): Use Motorola syntax. Use %ssp, not %isp.
+                      (print_indexed): Use Motorola syntax.
+                    * m68k-opc.c (m68k_opcode_aliases): Disable.
+                      (m68k_opcodes): Add the optional dots to increase readability.
+            2005-04-29  Kevin Kofler  <Kevin@tigcc.ticalc.org>
+                    * Merge from TIGCC:
+                      2002-01-10  Stephan Effelsberg  <b012414@dvz.fh-koeln.de>
+                      * m68k-opc.c (m68k_opcodes): Fix cmpi operand constraints when aliased as cmp. 
+                                                   (Don't allow PC-relative or indexed PC-relative
+                                                    second operand.)
+                    * m68k-dis.c: Include handles.h and romcalls.h.
+                      (NEXTUWORD): New macro.
+                      (print_insn_m68k): Handle F-Line instructions (ported from Romain Liévin's code in m68kdasm.c).
+                      (print_insn_arg): Print both displacement and target for branches.
+        * bfd.h: remove autogeneration notice, don't include ansidecl.h or symcat.h
+        * m68k-dis.c: header file changes
+                      some char * -> const char * changes for string literals
+                      use entry_point from main instead of handle code
+                      add m68k_arch_features and bfd_m68k_mach_to_features from BFD cpu-m68k.c
+                      removed float instructions from m68000 features
+                      print addresses in assemblable format
+                      only print ROM_CALLs if the table is loaded
+                      print unknown instructions as hex instead of octal
+                      call Offset2Name hook for ROM_CALL addressing
+                      revert asm_setjmp/asm_longjmp TiEmu change
+        * disasm.c: header file changes
+                    remove GDB-specific code
+                    change to disassemble from buffer
+        * er_codes.c, fpudasm.c, hwpm.c, hwpm.h, images.c, images.h, macros.h,
+          mem89.c, mem89.h, mem89tm.c, mem89tm.h, mem92.c, mem92.h, mem92p.c,
+          mem92p.h, mem.c, mem.h, mem_size.h, memv2.c, memv2.h, romcalls.c,
+          romcalls.h, ti68k_def.h, ti68k_err.h, timem.c, timem.h, xmalloc.c:
+            import from TiEmu, remove unused functions, change some included
+            headers, don't require glib
+       * images.c, images.h: change to support direct loading of images without
+                             the conversion to .img
+       * mem*.[ch]: remove handling of I/O ports, hw protection, FlashROM
+                    special-casing and writes
+       * romcalls.c, romcalls.h: use pregenerated ROM_CALL table instead of
+                                 loading it from file, allow accessing the table
+                                 for names even if we don't have addresses,
+                                 remove GList support
+       * romcalls.inc: new file, converted from TiEmu's romcalls.txt
+       * timem.c: rewrite in terms of ld-tigcc integer handling code
+       * error.h, files9x.c, files9x.h, filesxx.c, filetypes.c, rwfile.c,
+         rwfile.h, tifiles.h: import from libtifiles2, remove unused functions,
+            change some included headers, don't require glib
+       * rwfile.c: use ld-tigcc's integer handling code instead of glib's
+       * generic.h: import from ld-tigcc, remove some unused definitions, add
+                    ATTRIBUTE_MAY_ALIAS
+       * int_def.inc, integers.c, integers.h: import from ld-tigcc
+       * integers.c (HI1, HI2, HI4, TI1, TI2, TI4): set ATTRIBUTE_MAY_ALIAS
+       * main.h: new file, declaring some global variables in main.c
+       * Makefile: new file based on ld-tigcc makefile

+ 37 - 0
external/dasm-tigcc/Makefile

@@ -0,0 +1,37 @@
+ifeq ($(OSTYPE), msys)
+EXEEXT = .exe
+else
+EXEEXT =
+endif
+
+DASM_TIGCC = dasm-tigcc$(EXEEXT)
+
+CC = gcc
+CFLAGS = -s -Os -fno-exceptions
+LDFLAGS = -s -fno-exceptions
+WARN_CFLAGS = -W -Wall -Wwrite-strings
+DEFINES = 
+
+RM = rm
+RMFLAGS = -f
+
+COMPILE_C = $(CC) -c $(CFLAGS) $(ARCHFLAGS) $(WARN_CFLAGS) $(DEFINES)
+
+HEADERS = *.h int_def.inc
+OBJECTS = xmalloc.o integers.o rwfile.o filetypes.o files9x.o filesxx.o timem.o hwpm.o images.o romcalls.o er_codes.o mem89.o mem89tm.o mem92.o mem92p.o memv2.o mem.o fpudasm.o m68k-opc.o m68k-dis.o dis-buf.o dis-init.o disassemble.o disasm.o main.o
+
+.PHONY: all clean
+
+all: $(DASM_TIGCC)
+
+romcalls.o: romcalls.c romcalls.inc $(HEADERS)
+	$(COMPILE_C) romcalls.c -o romcalls.o
+
+%.o: %.c $(HEADERS)
+	$(COMPILE_C) $< -o $@
+
+$(DASM_TIGCC): $(OBJECTS)
+	$(CC) $(LDFLAGS) $(ARCHFLAGS) $(OBJECTS) -o $@
+
+clean:
+	-$(RM) $(RMFLAGS) $(OBJECTS) $(DASM_TIGCC)

+ 5273 - 0
external/dasm-tigcc/bfd.h

@@ -0,0 +1,5273 @@
+/* Main header file for the bfd library -- portable access to object files.
+
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   Contributed by Cygnus Support.
+
+   Copyright 2007 Kevin Kofler
+
+   This file is part of BFD, the Binary File Descriptor library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef __BFD_H_SEEN__
+#define __BFD_H_SEEN__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
+#ifndef SABER
+/* This hack is to avoid a problem with some strict ANSI C preprocessors.
+   The problem is, "32_" is not a valid preprocessing token, and we don't
+   want extra underscores (e.g., "nlm_32_").  The XCONCAT2 macro will
+   cause the inner CONCAT2 macros to be evaluated first, producing
+   still-valid pp-tokens.  Then the final concatenation can be done.  */
+#undef CONCAT4
+#define CONCAT4(a,b,c,d) XCONCAT2(CONCAT2(a,b),CONCAT2(c,d))
+#endif
+#endif
+
+/* This is a utility macro to handle the situation where the code
+   wants to place a constant string into the code, followed by a
+   comma and then the length of the string.  Doing this by hand
+   is error prone, so using this macro is safer.  The macro will
+   also safely handle the case where a NULL is passed as the arg.  */
+#define STRING_COMMA_LEN(STR) (STR), ((STR) ? sizeof (STR) - 1 : 0)
+/* Unfortunately it is not possible to use the STRING_COMMA_LEN macro
+   to create the arguments to another macro, since the preprocessor
+   will mis-count the number of arguments to the outer macro (by not
+   evaluating STRING_COMMA_LEN and so missing the comma).  This is a
+   problem for example when trying to use STRING_COMMA_LEN to build
+   the arguments to the strncmp() macro.  Hence this alternative
+   definition of strncmp is provided here.
+   
+   Note - these macros do NOT work if STR2 is not a constant string.  */
+#define CONST_STRNEQ(STR1,STR2) (strncmp ((STR1), (STR2), sizeof (STR2) - 1) == 0)
+  /* strcpy() can have a similar problem, but since we know we are
+     copying a constant string, we can use memcpy which will be faster
+     since there is no need to check for a NUL byte inside STR.  We
+     can also save time if we do not need to copy the terminating NUL.  */
+#define LITMEMCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2) - 1)
+#define LITSTRCPY(DEST,STR2) memcpy ((DEST), (STR2), sizeof (STR2))
+
+
+/* The word size used by BFD on the host.  This may be 64 with a 32
+   bit target if the host is 64 bit, or if other 64 bit targets have
+   been selected with --enable-targets, or if --enable-64-bit-bfd.  */
+#define BFD_ARCH_SIZE 32
+
+/* The word size of the default bfd target.  */
+#define BFD_DEFAULT_TARGET_SIZE 32
+
+#define BFD_HOST_64BIT_LONG 0
+#define BFD_HOST_LONG_LONG 1
+#if 1
+#define BFD_HOST_64_BIT long long
+#define BFD_HOST_U_64_BIT unsigned long long
+typedef BFD_HOST_64_BIT bfd_int64_t;
+typedef BFD_HOST_U_64_BIT bfd_uint64_t;
+#endif
+
+#if BFD_ARCH_SIZE >= 64
+#define BFD64
+#endif
+
+#ifndef INLINE
+#if __GNUC__ >= 2
+#define INLINE __inline__
+#else
+#define INLINE
+#endif
+#endif
+
+/* Forward declaration.  */
+typedef struct bfd bfd;
+
+/* Boolean type used in bfd.  Too many systems define their own
+   versions of "boolean" for us to safely typedef a "boolean" of
+   our own.  Using an enum for "bfd_boolean" has its own set of
+   problems, with strange looking casts required to avoid warnings
+   on some older compilers.  Thus we just use an int.
+
+   General rule: Functions which are bfd_boolean return TRUE on
+   success and FALSE on failure (unless they're a predicate).  */
+
+typedef int bfd_boolean;
+#undef FALSE
+#undef TRUE
+#define FALSE 0
+#define TRUE 1
+
+#ifdef BFD64
+
+#ifndef BFD_HOST_64_BIT
+ #error No 64 bit integer type available
+#endif /* ! defined (BFD_HOST_64_BIT) */
+
+typedef BFD_HOST_U_64_BIT bfd_vma;
+typedef BFD_HOST_64_BIT bfd_signed_vma;
+typedef BFD_HOST_U_64_BIT bfd_size_type;
+typedef BFD_HOST_U_64_BIT symvalue;
+
+#ifndef fprintf_vma
+#if BFD_HOST_64BIT_LONG
+#define sprintf_vma(s,x) sprintf (s, "%016lx", x)
+#define fprintf_vma(f,x) fprintf (f, "%016lx", x)
+#else
+#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
+#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
+#define fprintf_vma(s,x) \
+  fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
+#define sprintf_vma(s,x) \
+  sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
+#endif
+#endif
+
+#else /* not BFD64  */
+
+/* Represent a target address.  Also used as a generic unsigned type
+   which is guaranteed to be big enough to hold any arithmetic types
+   we need to deal with.  */
+typedef unsigned long bfd_vma;
+
+/* A generic signed type which is guaranteed to be big enough to hold any
+   arithmetic types we need to deal with.  Can be assumed to be compatible
+   with bfd_vma in the same way that signed and unsigned ints are compatible
+   (as parameters, in assignment, etc).  */
+typedef long bfd_signed_vma;
+
+typedef unsigned long symvalue;
+typedef unsigned long bfd_size_type;
+
+/* Print a bfd_vma x on stream s.  */
+#define fprintf_vma(s,x) fprintf (s, "%08lx", x)
+#define sprintf_vma(s,x) sprintf (s, "%08lx", x)
+
+#endif /* not BFD64  */
+
+#define HALF_BFD_SIZE_TYPE \
+  (((bfd_size_type) 1) << (8 * sizeof (bfd_size_type) / 2))
+
+#ifndef BFD_HOST_64_BIT
+/* Fall back on a 32 bit type.  The idea is to make these types always
+   available for function return types, but in the case that
+   BFD_HOST_64_BIT is undefined such a function should abort or
+   otherwise signal an error.  */
+typedef bfd_signed_vma bfd_int64_t;
+typedef bfd_vma bfd_uint64_t;
+#endif
+
+/* An offset into a file.  BFD always uses the largest possible offset
+   based on the build time availability of fseek, fseeko, or fseeko64.  */
+typedef BFD_HOST_64_BIT file_ptr;
+typedef unsigned BFD_HOST_64_BIT ufile_ptr;
+
+extern void bfd_sprintf_vma (bfd *, char *, bfd_vma);
+extern void bfd_fprintf_vma (bfd *, void *, bfd_vma);
+
+#define printf_vma(x) fprintf_vma(stdout,x)
+#define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x)
+
+typedef unsigned int flagword;	/* 32 bits of flags */
+typedef unsigned char bfd_byte;
+
+/* File formats.  */
+
+typedef enum bfd_format
+{
+  bfd_unknown = 0,	/* File format is unknown.  */
+  bfd_object,		/* Linker/assembler/compiler output.  */
+  bfd_archive,		/* Object archive file.  */
+  bfd_core,		/* Core dump.  */
+  bfd_type_end		/* Marks the end; don't use it!  */
+}
+bfd_format;
+
+/* Values that may appear in the flags field of a BFD.  These also
+   appear in the object_flags field of the bfd_target structure, where
+   they indicate the set of flags used by that backend (not all flags
+   are meaningful for all object file formats) (FIXME: at the moment,
+   the object_flags values have mostly just been copied from backend
+   to another, and are not necessarily correct).  */
+
+/* No flags.  */
+#define BFD_NO_FLAGS   	0x00
+
+/* BFD contains relocation entries.  */
+#define HAS_RELOC   	0x01
+
+/* BFD is directly executable.  */
+#define EXEC_P      	0x02
+
+/* BFD has line number information (basically used for F_LNNO in a
+   COFF header).  */
+#define HAS_LINENO  	0x04
+
+/* BFD has debugging information.  */
+#define HAS_DEBUG   	0x08
+
+/* BFD has symbols.  */
+#define HAS_SYMS    	0x10
+
+/* BFD has local symbols (basically used for F_LSYMS in a COFF
+   header).  */
+#define HAS_LOCALS  	0x20
+
+/* BFD is a dynamic object.  */
+#define DYNAMIC     	0x40
+
+/* Text section is write protected (if D_PAGED is not set, this is
+   like an a.out NMAGIC file) (the linker sets this by default, but
+   clears it for -r or -N).  */
+#define WP_TEXT     	0x80
+
+/* BFD is dynamically paged (this is like an a.out ZMAGIC file) (the
+   linker sets this by default, but clears it for -r or -n or -N).  */
+#define D_PAGED     	0x100
+
+/* BFD is relaxable (this means that bfd_relax_section may be able to
+   do something) (sometimes bfd_relax_section can do something even if
+   this is not set).  */
+#define BFD_IS_RELAXABLE 0x200
+
+/* This may be set before writing out a BFD to request using a
+   traditional format.  For example, this is used to request that when
+   writing out an a.out object the symbols not be hashed to eliminate
+   duplicates.  */
+#define BFD_TRADITIONAL_FORMAT 0x400
+
+/* This flag indicates that the BFD contents are actually cached in
+   memory.  If this is set, iostream points to a bfd_in_memory struct.  */
+#define BFD_IN_MEMORY 0x800
+
+/* The sections in this BFD specify a memory page.  */
+#define HAS_LOAD_PAGE 0x1000
+
+/* This BFD has been created by the linker and doesn't correspond
+   to any input file.  */
+#define BFD_LINKER_CREATED 0x2000
+
+/* Symbols and relocation.  */
+
+/* A count of carsyms (canonical archive symbols).  */
+typedef unsigned long symindex;
+
+/* How to perform a relocation.  */
+typedef const struct reloc_howto_struct reloc_howto_type;
+
+#define BFD_NO_MORE_SYMBOLS ((symindex) ~0)
+
+/* General purpose part of a symbol X;
+   target specific parts are in libcoff.h, libaout.h, etc.  */
+
+#define bfd_get_section(x) ((x)->section)
+#define bfd_get_output_section(x) ((x)->section->output_section)
+#define bfd_set_section(x,y) ((x)->section) = (y)
+#define bfd_asymbol_base(x) ((x)->section->vma)
+#define bfd_asymbol_value(x) (bfd_asymbol_base(x) + (x)->value)
+#define bfd_asymbol_name(x) ((x)->name)
+/*Perhaps future: #define bfd_asymbol_bfd(x) ((x)->section->owner)*/
+#define bfd_asymbol_bfd(x) ((x)->the_bfd)
+#define bfd_asymbol_flavour(x) (bfd_asymbol_bfd(x)->xvec->flavour)
+
+/* A canonical archive symbol.  */
+/* This is a type pun with struct ranlib on purpose!  */
+typedef struct carsym
+{
+  char *name;
+  file_ptr file_offset;	/* Look here to find the file.  */
+}
+carsym;			/* To make these you call a carsymogen.  */
+
+/* Used in generating armaps (archive tables of contents).
+   Perhaps just a forward definition would do?  */
+struct orl 			/* Output ranlib.  */
+{
+  char **name;		/* Symbol name.  */
+  union
+  {
+    file_ptr pos;
+    bfd *abfd;
+  } u;			/* bfd* or file position.  */
+  int namidx;		/* Index into string table.  */
+};
+
+/* Linenumber stuff.  */
+typedef struct lineno_cache_entry
+{
+  unsigned int line_number;	/* Linenumber from start of function.  */
+  union
+  {
+    struct bfd_symbol *sym;	/* Function name.  */
+    bfd_vma offset;	    		/* Offset into section.  */
+  } u;
+}
+alent;
+
+/* Object and core file sections.  */
+
+#define	align_power(addr, align)	\
+  (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align)))
+
+typedef struct bfd_section *sec_ptr;
+
+#define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0)
+#define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0)
+#define bfd_get_section_lma(bfd, ptr) ((ptr)->lma + 0)
+#define bfd_get_section_alignment(bfd, ptr) ((ptr)->alignment_power + 0)
+#define bfd_section_name(bfd, ptr) ((ptr)->name)
+#define bfd_section_size(bfd, ptr) ((ptr)->size)
+#define bfd_get_section_size(ptr) ((ptr)->size)
+#define bfd_section_vma(bfd, ptr) ((ptr)->vma)
+#define bfd_section_lma(bfd, ptr) ((ptr)->lma)
+#define bfd_section_alignment(bfd, ptr) ((ptr)->alignment_power)
+#define bfd_get_section_flags(bfd, ptr) ((ptr)->flags + 0)
+#define bfd_get_section_userdata(bfd, ptr) ((ptr)->userdata)
+
+#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
+
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
+#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
+#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
+/* Find the address one past the end of SEC.  */
+#define bfd_get_section_limit(bfd, sec) \
+  (((sec)->rawsize ? (sec)->rawsize : (sec)->size) \
+   / bfd_octets_per_byte (bfd))
+
+typedef struct stat stat_type;
+
+typedef enum bfd_print_symbol
+{
+  bfd_print_symbol_name,
+  bfd_print_symbol_more,
+  bfd_print_symbol_all
+} bfd_print_symbol_type;
+
+/* Information about a symbol that nm needs.  */
+
+typedef struct _symbol_info
+{
+  symvalue value;
+  char type;
+  const char *name;            /* Symbol name.  */
+  unsigned char stab_type;     /* Stab type.  */
+  char stab_other;             /* Stab other.  */
+  short stab_desc;             /* Stab desc.  */
+  const char *stab_name;       /* String for stab type.  */
+} symbol_info;
+
+/* Get the name of a stabs type code.  */
+
+extern const char *bfd_get_stab_name (int);
+
+/* Hash table routines.  There is no way to free up a hash table.  */
+
+/* An element in the hash table.  Most uses will actually use a larger
+   structure, and an instance of this will be the first field.  */
+
+struct bfd_hash_entry
+{
+  /* Next entry for this hash code.  */
+  struct bfd_hash_entry *next;
+  /* String being hashed.  */
+  const char *string;
+  /* Hash code.  This is the full hash code, not the index into the
+     table.  */
+  unsigned long hash;
+};
+
+/* A hash table.  */
+
+struct bfd_hash_table
+{
+  /* The hash array.  */
+  struct bfd_hash_entry **table;
+  /* The number of slots in the hash table.  */
+  unsigned int size;
+  /* The number of entries in the hash table.  */
+  unsigned int count;
+  /* The size of elements.  */
+  unsigned int entsize;
+  /* A function used to create new elements in the hash table.  The
+     first entry is itself a pointer to an element.  When this
+     function is first invoked, this pointer will be NULL.  However,
+     having the pointer permits a hierarchy of method functions to be
+     built each of which calls the function in the superclass.  Thus
+     each function should be written to allocate a new block of memory
+     only if the argument is NULL.  */
+  struct bfd_hash_entry *(*newfunc)
+    (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
+   /* An objalloc for this hash table.  This is a struct objalloc *,
+     but we use void * to avoid requiring the inclusion of objalloc.h.  */
+  void *memory;
+};
+
+/* Initialize a hash table.  */
+extern bfd_boolean bfd_hash_table_init
+  (struct bfd_hash_table *,
+   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
+			       struct bfd_hash_table *,
+			       const char *),
+   unsigned int);
+
+/* Initialize a hash table specifying a size.  */
+extern bfd_boolean bfd_hash_table_init_n
+  (struct bfd_hash_table *,
+   struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
+			       struct bfd_hash_table *,
+			       const char *),
+   unsigned int, unsigned int);
+
+/* Free up a hash table.  */
+extern void bfd_hash_table_free
+  (struct bfd_hash_table *);
+
+/* Look up a string in a hash table.  If CREATE is TRUE, a new entry
+   will be created for this string if one does not already exist.  The
+   COPY argument must be TRUE if this routine should copy the string
+   into newly allocated memory when adding an entry.  */
+extern struct bfd_hash_entry *bfd_hash_lookup
+  (struct bfd_hash_table *, const char *, bfd_boolean create,
+   bfd_boolean copy);
+
+/* Replace an entry in a hash table.  */
+extern void bfd_hash_replace
+  (struct bfd_hash_table *, struct bfd_hash_entry *old,
+   struct bfd_hash_entry *nw);
+
+/* Base method for creating a hash table entry.  */
+extern struct bfd_hash_entry *bfd_hash_newfunc
+  (struct bfd_hash_entry *, struct bfd_hash_table *, const char *);
+
+/* Grab some space for a hash table entry.  */
+extern void *bfd_hash_allocate
+  (struct bfd_hash_table *, unsigned int);
+
+/* Traverse a hash table in a random order, calling a function on each
+   element.  If the function returns FALSE, the traversal stops.  The
+   INFO argument is passed to the function.  */
+extern void bfd_hash_traverse
+  (struct bfd_hash_table *,
+   bfd_boolean (*) (struct bfd_hash_entry *, void *),
+   void *info);
+
+/* Allows the default size of a hash table to be configured. New hash
+   tables allocated using bfd_hash_table_init will be created with
+   this size.  */
+extern void bfd_hash_set_default_size (bfd_size_type);
+
+/* This structure is used to keep track of stabs in sections
+   information while linking.  */
+
+struct stab_info
+{
+  /* A hash table used to hold stabs strings.  */
+  struct bfd_strtab_hash *strings;
+  /* The header file hash table.  */
+  struct bfd_hash_table includes;
+  /* The first .stabstr section.  */
+  struct bfd_section *stabstr;
+};
+
+#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table
+
+/* User program access to BFD facilities.  */
+
+/* Direct I/O routines, for programs which know more about the object
+   file than BFD does.  Use higher level routines if possible.  */
+
+extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *);
+extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *);
+extern int bfd_seek (bfd *, file_ptr, int);
+extern file_ptr bfd_tell (bfd *);
+extern int bfd_flush (bfd *);
+extern int bfd_stat (bfd *, struct stat *);
+
+/* Deprecated old routines.  */
+#if __GNUC__
+#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
+  (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__),	\
+   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
+#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
+  (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__),	\
+   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
+#else
+#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD)				\
+  (warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0), \
+   bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
+#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD)				\
+  (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\
+   bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
+#endif
+extern void warn_deprecated (const char *, const char *, int, const char *);
+
+/* Cast from const char * to char * so that caller can assign to
+   a char * without a warning.  */
+#define bfd_get_filename(abfd) ((char *) (abfd)->filename)
+#define bfd_get_cacheable(abfd) ((abfd)->cacheable)
+#define bfd_get_format(abfd) ((abfd)->format)
+#define bfd_get_target(abfd) ((abfd)->xvec->name)
+#define bfd_get_flavour(abfd) ((abfd)->xvec->flavour)
+#define bfd_family_coff(abfd) \
+  (bfd_get_flavour (abfd) == bfd_target_coff_flavour || \
+   bfd_get_flavour (abfd) == bfd_target_xcoff_flavour)
+#define bfd_big_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_BIG)
+#define bfd_little_endian(abfd) ((abfd)->xvec->byteorder == BFD_ENDIAN_LITTLE)
+#define bfd_header_big_endian(abfd) \
+  ((abfd)->xvec->header_byteorder == BFD_ENDIAN_BIG)
+#define bfd_header_little_endian(abfd) \
+  ((abfd)->xvec->header_byteorder == BFD_ENDIAN_LITTLE)
+#define bfd_get_file_flags(abfd) ((abfd)->flags)
+#define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
+#define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
+#define bfd_my_archive(abfd) ((abfd)->my_archive)
+#define bfd_has_map(abfd) ((abfd)->has_armap)
+
+#define bfd_valid_reloc_types(abfd) ((abfd)->xvec->valid_reloc_types)
+#define bfd_usrdata(abfd) ((abfd)->usrdata)
+
+#define bfd_get_start_address(abfd) ((abfd)->start_address)
+#define bfd_get_symcount(abfd) ((abfd)->symcount)
+#define bfd_get_outsymbols(abfd) ((abfd)->outsymbols)
+#define bfd_count_sections(abfd) ((abfd)->section_count)
+
+#define bfd_get_dynamic_symcount(abfd) ((abfd)->dynsymcount)
+
+#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
+
+#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
+
+extern bfd_boolean bfd_cache_close
+  (bfd *abfd);
+/* NB: This declaration should match the autogenerated one in libbfd.h.  */
+
+extern bfd_boolean bfd_cache_close_all (void);
+
+extern bfd_boolean bfd_record_phdr
+  (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma,
+   bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **);
+
+/* Byte swapping routines.  */
+
+bfd_uint64_t bfd_getb64 (const void *);
+bfd_uint64_t bfd_getl64 (const void *);
+bfd_int64_t bfd_getb_signed_64 (const void *);
+bfd_int64_t bfd_getl_signed_64 (const void *);
+bfd_vma bfd_getb32 (const void *);
+bfd_vma bfd_getl32 (const void *);
+bfd_signed_vma bfd_getb_signed_32 (const void *);
+bfd_signed_vma bfd_getl_signed_32 (const void *);
+bfd_vma bfd_getb16 (const void *);
+bfd_vma bfd_getl16 (const void *);
+bfd_signed_vma bfd_getb_signed_16 (const void *);
+bfd_signed_vma bfd_getl_signed_16 (const void *);
+void bfd_putb64 (bfd_uint64_t, void *);
+void bfd_putl64 (bfd_uint64_t, void *);
+void bfd_putb32 (bfd_vma, void *);
+void bfd_putl32 (bfd_vma, void *);
+void bfd_putb16 (bfd_vma, void *);
+void bfd_putl16 (bfd_vma, void *);
+
+/* Byte swapping routines which take size and endiannes as arguments.  */
+
+bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean);
+void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean);
+
+extern bfd_boolean bfd_section_already_linked_table_init (void);
+extern void bfd_section_already_linked_table_free (void);
+
+/* Externally visible ECOFF routines.  */
+
+#if defined(__STDC__) || defined(ALMOST_STDC)
+struct ecoff_debug_info;
+struct ecoff_debug_swap;
+struct ecoff_extr;
+struct bfd_symbol;
+struct bfd_link_info;
+struct bfd_link_hash_entry;
+struct bfd_elf_version_tree;
+#endif
+extern bfd_vma bfd_ecoff_get_gp_value
+  (bfd * abfd);
+extern bfd_boolean bfd_ecoff_set_gp_value
+  (bfd *abfd, bfd_vma gp_value);
+extern bfd_boolean bfd_ecoff_set_regmasks
+  (bfd *abfd, unsigned long gprmask, unsigned long fprmask,
+   unsigned long *cprmask);
+extern void *bfd_ecoff_debug_init
+  (bfd *output_bfd, struct ecoff_debug_info *output_debug,
+   const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
+extern void bfd_ecoff_debug_free
+  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
+   const struct ecoff_debug_swap *output_swap, struct bfd_link_info *);
+extern bfd_boolean bfd_ecoff_debug_accumulate
+  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
+   const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
+   struct ecoff_debug_info *input_debug,
+   const struct ecoff_debug_swap *input_swap, struct bfd_link_info *);
+extern bfd_boolean bfd_ecoff_debug_accumulate_other
+  (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug,
+   const struct ecoff_debug_swap *output_swap, bfd *input_bfd,
+   struct bfd_link_info *);
+extern bfd_boolean bfd_ecoff_debug_externals
+  (bfd *abfd, struct ecoff_debug_info *debug,
+   const struct ecoff_debug_swap *swap, bfd_boolean relocatable,
+   bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *),
+   void (*set_index) (struct bfd_symbol *, bfd_size_type));
+extern bfd_boolean bfd_ecoff_debug_one_external
+  (bfd *abfd, struct ecoff_debug_info *debug,
+   const struct ecoff_debug_swap *swap, const char *name,
+   struct ecoff_extr *esym);
+extern bfd_size_type bfd_ecoff_debug_size
+  (bfd *abfd, struct ecoff_debug_info *debug,
+   const struct ecoff_debug_swap *swap);
+extern bfd_boolean bfd_ecoff_write_debug
+  (bfd *abfd, struct ecoff_debug_info *debug,
+   const struct ecoff_debug_swap *swap, file_ptr where);
+extern bfd_boolean bfd_ecoff_write_accumulated_debug
+  (void *handle, bfd *abfd, struct ecoff_debug_info *debug,
+   const struct ecoff_debug_swap *swap,
+   struct bfd_link_info *info, file_ptr where);
+
+/* Externally visible ELF routines.  */
+
+struct bfd_link_needed_list
+{
+  struct bfd_link_needed_list *next;
+  bfd *by;
+  const char *name;
+};
+
+enum dynamic_lib_link_class {
+  DYN_NORMAL = 0,
+  DYN_AS_NEEDED = 1,
+  DYN_DT_NEEDED = 2,
+  DYN_NO_ADD_NEEDED = 4,
+  DYN_NO_NEEDED = 8
+};
+
+enum notice_asneeded_action {
+  notice_as_needed,
+  notice_not_needed,
+  notice_needed
+};
+
+extern bfd_boolean bfd_elf_record_link_assignment
+  (bfd *, struct bfd_link_info *, const char *, bfd_boolean,
+   bfd_boolean);
+extern struct bfd_link_needed_list *bfd_elf_get_needed_list
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_elf_get_bfd_needed_list
+  (bfd *, struct bfd_link_needed_list **);
+extern bfd_boolean bfd_elf_size_dynamic_sections
+  (bfd *, const char *, const char *, const char *, const char * const *,
+   struct bfd_link_info *, struct bfd_section **,
+   struct bfd_elf_version_tree *);
+extern bfd_boolean bfd_elf_size_dynsym_hash_dynstr
+  (bfd *, struct bfd_link_info *);
+extern void bfd_elf_set_dt_needed_name
+  (bfd *, const char *);
+extern const char *bfd_elf_get_dt_soname
+  (bfd *);
+extern void bfd_elf_set_dyn_lib_class
+  (bfd *, enum dynamic_lib_link_class);
+extern int bfd_elf_get_dyn_lib_class
+  (bfd *);
+extern struct bfd_link_needed_list *bfd_elf_get_runpath_list
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_elf_discard_info
+  (bfd *, struct bfd_link_info *);
+extern unsigned int _bfd_elf_default_action_discarded
+  (struct bfd_section *);
+
+/* Return an upper bound on the number of bytes required to store a
+   copy of ABFD's program header table entries.  Return -1 if an error
+   occurs; bfd_get_error will return an appropriate code.  */
+extern long bfd_get_elf_phdr_upper_bound
+  (bfd *abfd);
+
+/* Copy ABFD's program header table entries to *PHDRS.  The entries
+   will be stored as an array of Elf_Internal_Phdr structures, as
+   defined in include/elf/internal.h.  To find out how large the
+   buffer needs to be, call bfd_get_elf_phdr_upper_bound.
+
+   Return the number of program header table entries read, or -1 if an
+   error occurs; bfd_get_error will return an appropriate code.  */
+extern int bfd_get_elf_phdrs
+  (bfd *abfd, void *phdrs);
+
+/* Create a new BFD as if by bfd_openr.  Rather than opening a file,
+   reconstruct an ELF file by reading the segments out of remote memory
+   based on the ELF file header at EHDR_VMA and the ELF program headers it
+   points to.  If not null, *LOADBASEP is filled in with the difference
+   between the VMAs from which the segments were read, and the VMAs the
+   file headers (and hence BFD's idea of each section's VMA) put them at.
+
+   The function TARGET_READ_MEMORY is called to copy LEN bytes from the
+   remote memory at target address VMA into the local buffer at MYADDR; it
+   should return zero on success or an `errno' code on failure.  TEMPL must
+   be a BFD for an ELF target with the word size and byte order found in
+   the remote memory.  */
+extern bfd *bfd_elf_bfd_from_remote_memory
+  (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep,
+   int (*target_read_memory) (bfd_vma vma, bfd_byte *myaddr, int len));
+
+/* Return the arch_size field of an elf bfd, or -1 if not elf.  */
+extern int bfd_get_arch_size
+  (bfd *);
+
+/* Return TRUE if address "naturally" sign extends, or -1 if not elf.  */
+extern int bfd_get_sign_extend_vma
+  (bfd *);
+
+extern struct bfd_section *_bfd_elf_tls_setup
+  (bfd *, struct bfd_link_info *);
+
+extern void _bfd_fix_excluded_sec_syms
+  (bfd *, struct bfd_link_info *);
+
+extern unsigned bfd_m68k_mach_to_features (int);
+
+extern int bfd_m68k_features_to_mach (unsigned);
+
+extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs
+  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
+   char **);
+
+extern bfd_boolean bfd_bfin_elf32_create_embedded_relocs
+  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *,
+   char **);
+
+/* SunOS shared library support routines for the linker.  */
+
+extern struct bfd_link_needed_list *bfd_sunos_get_needed_list
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_sunos_record_link_assignment
+  (bfd *, struct bfd_link_info *, const char *);
+extern bfd_boolean bfd_sunos_size_dynamic_sections
+  (bfd *, struct bfd_link_info *, struct bfd_section **,
+   struct bfd_section **, struct bfd_section **);
+
+/* Linux shared library support routines for the linker.  */
+
+extern bfd_boolean bfd_i386linux_size_dynamic_sections
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_m68klinux_size_dynamic_sections
+  (bfd *, struct bfd_link_info *);
+extern bfd_boolean bfd_sparclinux_size_dynamic_sections
+  (bfd *, struct bfd_link_info *);
+
+/* mmap hacks */
+
+struct _bfd_window_internal;
+typedef struct _bfd_window_internal bfd_window_internal;
+
+typedef struct _bfd_window
+{
+  /* What the user asked for.  */
+  void *data;
+  bfd_size_type size;
+  /* The actual window used by BFD.  Small user-requested read-only
+     regions sharing a page may share a single window into the object
+     file.  Read-write versions shouldn't until I've fixed things to
+     keep track of which portions have been claimed by the
+     application; don't want to give the same region back when the
+     application wants two writable copies!  */
+  struct _bfd_window_internal *i;
+}
+bfd_window;
+
+extern void bfd_init_window
+  (bfd_window *);
+extern void bfd_free_window
+  (bfd_window *);
+extern bfd_boolean bfd_get_file_window
+  (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean);
+
+/* XCOFF support routines for the linker.  */
+
+extern bfd_boolean bfd_xcoff_link_record_set
+  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type);
+extern bfd_boolean bfd_xcoff_import_symbol
+  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma,
+   const char *, const char *, const char *, unsigned int);
+extern bfd_boolean bfd_xcoff_export_symbol
+  (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *);
+extern bfd_boolean bfd_xcoff_link_count_reloc
+  (bfd *, struct bfd_link_info *, const char *);
+extern bfd_boolean bfd_xcoff_record_link_assignment
+  (bfd *, struct bfd_link_info *, const char *);
+extern bfd_boolean bfd_xcoff_size_dynamic_sections
+  (bfd *, struct bfd_link_info *, const char *, const char *,
+   unsigned long, unsigned long, unsigned long, bfd_boolean,
+   int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean);
+extern bfd_boolean bfd_xcoff_link_generate_rtinit
+  (bfd *, const char *, const char *, bfd_boolean);
+
+/* XCOFF support routines for ar.  */
+extern bfd_boolean bfd_xcoff_ar_archive_set_magic
+  (bfd *, char *);
+
+/* Externally visible COFF routines.  */
+
+#if defined(__STDC__) || defined(ALMOST_STDC)
+struct internal_syment;
+union internal_auxent;
+#endif
+
+extern bfd_boolean bfd_coff_get_syment
+  (bfd *, struct bfd_symbol *, struct internal_syment *);
+
+extern bfd_boolean bfd_coff_get_auxent
+  (bfd *, struct bfd_symbol *, int, union internal_auxent *);
+
+extern bfd_boolean bfd_coff_set_symbol_class
+  (bfd *, struct bfd_symbol *, unsigned int);
+
+extern bfd_boolean bfd_m68k_coff_create_embedded_relocs
+  (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **);
+
+/* ARM Interworking support.  Called from linker.  */
+extern bfd_boolean bfd_arm_allocate_interworking_sections
+  (struct bfd_link_info *);
+
+extern bfd_boolean bfd_arm_process_before_allocation
+  (bfd *, struct bfd_link_info *, int);
+
+extern bfd_boolean bfd_arm_get_bfd_for_interworking
+  (bfd *, struct bfd_link_info *);
+
+/* PE ARM Interworking support.  Called from linker.  */
+extern bfd_boolean bfd_arm_pe_allocate_interworking_sections
+  (struct bfd_link_info *);
+
+extern bfd_boolean bfd_arm_pe_process_before_allocation
+  (bfd *, struct bfd_link_info *, int);
+
+extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking
+  (bfd *, struct bfd_link_info *);
+
+/* ELF ARM Interworking support.  Called from linker.  */
+extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections
+  (struct bfd_link_info *);
+
+extern bfd_boolean bfd_elf32_arm_process_before_allocation
+  (bfd *, struct bfd_link_info *);
+
+void bfd_elf32_arm_set_target_relocs
+  (struct bfd_link_info *, int, char *, int, int);
+
+extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
+  (bfd *, struct bfd_link_info *);
+
+extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd
+  (bfd *, struct bfd_link_info *);
+
+/* ELF ARM mapping symbol support */
+#define BFD_ARM_SPECIAL_SYM_TYPE_MAP	(1 << 0)
+#define BFD_ARM_SPECIAL_SYM_TYPE_TAG	(1 << 1)
+#define BFD_ARM_SPECIAL_SYM_TYPE_OTHER  (1 << 2)
+#define BFD_ARM_SPECIAL_SYM_TYPE_ANY	(~0)
+extern bfd_boolean bfd_is_arm_special_symbol_name
+  (const char * name, int type);
+
+extern void bfd_elf32_arm_set_byteswap_code (struct bfd_link_info *, int);
+
+/* ARM Note section processing.  */
+extern bfd_boolean bfd_arm_merge_machines
+  (bfd *, bfd *);
+
+extern bfd_boolean bfd_arm_update_notes
+  (bfd *, const char *);
+
+extern unsigned int bfd_arm_get_mach_from_notes
+  (bfd *, const char *);
+
+/* TI COFF load page support.  */
+extern void bfd_ticoff_set_section_load_page
+  (struct bfd_section *, int);
+
+extern int bfd_ticoff_get_section_load_page
+  (struct bfd_section *);
+
+/* H8/300 functions.  */
+extern bfd_vma bfd_h8300_pad_address
+  (bfd *, bfd_vma);
+
+/* IA64 Itanium code generation.  Called from linker.  */
+extern void bfd_elf32_ia64_after_parse
+  (int);
+
+extern void bfd_elf64_ia64_after_parse
+  (int);
+
+/* This structure is used for a comdat section, as in PE.  A comdat
+   section is associated with a particular symbol.  When the linker
+   sees a comdat section, it keeps only one of the sections with a
+   given name and associated with a given symbol.  */
+
+struct coff_comdat_info
+{
+  /* The name of the symbol associated with a comdat section.  */
+  const char *name;
+
+  /* The local symbol table index of the symbol associated with a
+     comdat section.  This is only meaningful to the object file format
+     specific code; it is not an index into the list returned by
+     bfd_canonicalize_symtab.  */
+  long symbol;
+};
+
+extern struct coff_comdat_info *bfd_coff_get_comdat_section
+  (bfd *, struct bfd_section *);
+
+/* Extracted from init.c.  */
+void bfd_init (void);
+
+/* Extracted from opncls.c.  */
+bfd *bfd_fopen (const char *filename, const char *target,
+    const char *mode, int fd);
+
+bfd *bfd_openr (const char *filename, const char *target);
+
+bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
+
+bfd *bfd_openstreamr (const char *, const char *, void *);
+
+bfd *bfd_openr_iovec (const char *filename, const char *target,
+    void *(*open) (struct bfd *nbfd,
+    void *open_closure),
+    void *open_closure,
+    file_ptr (*pread) (struct bfd *nbfd,
+    void *stream,
+    void *buf,
+    file_ptr nbytes,
+    file_ptr offset),
+    int (*close) (struct bfd *nbfd,
+    void *stream));
+
+bfd *bfd_openw (const char *filename, const char *target);
+
+bfd_boolean bfd_close (bfd *abfd);
+
+bfd_boolean bfd_close_all_done (bfd *);
+
+bfd *bfd_create (const char *filename, bfd *templ);
+
+bfd_boolean bfd_make_writable (bfd *abfd);
+
+bfd_boolean bfd_make_readable (bfd *abfd);
+
+unsigned long bfd_calc_gnu_debuglink_crc32
+   (unsigned long crc, const unsigned char *buf, bfd_size_type len);
+
+char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir);
+
+struct bfd_section *bfd_create_gnu_debuglink_section
+   (bfd *abfd, const char *filename);
+
+bfd_boolean bfd_fill_in_gnu_debuglink_section
+   (bfd *abfd, struct bfd_section *sect, const char *filename);
+
+/* Extracted from libbfd.c.  */
+
+/* Byte swapping macros for user section data.  */
+
+#define bfd_put_8(abfd, val, ptr) \
+  ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
+#define bfd_put_signed_8 \
+  bfd_put_8
+#define bfd_get_8(abfd, ptr) \
+  (*(unsigned char *) (ptr) & 0xff)
+#define bfd_get_signed_8(abfd, ptr) \
+  (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80)
+
+#define bfd_put_16(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_putx16, ((val),(ptr)))
+#define bfd_put_signed_16 \
+  bfd_put_16
+#define bfd_get_16(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx16, (ptr))
+#define bfd_get_signed_16(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx_signed_16, (ptr))
+
+#define bfd_put_32(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_putx32, ((val),(ptr)))
+#define bfd_put_signed_32 \
+  bfd_put_32
+#define bfd_get_32(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx32, (ptr))
+#define bfd_get_signed_32(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx_signed_32, (ptr))
+
+#define bfd_put_64(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_putx64, ((val), (ptr)))
+#define bfd_put_signed_64 \
+  bfd_put_64
+#define bfd_get_64(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx64, (ptr))
+#define bfd_get_signed_64(abfd, ptr) \
+  BFD_SEND (abfd, bfd_getx_signed_64, (ptr))
+
+#define bfd_get(bits, abfd, ptr)                       \
+  ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr)       \
+   : (bits) == 16 ? bfd_get_16 (abfd, ptr)             \
+   : (bits) == 32 ? bfd_get_32 (abfd, ptr)             \
+   : (bits) == 64 ? bfd_get_64 (abfd, ptr)             \
+   : (abort (), (bfd_vma) - 1))
+
+#define bfd_put(bits, abfd, val, ptr)                  \
+  ((bits) == 8 ? bfd_put_8  (abfd, val, ptr)           \
+   : (bits) == 16 ? bfd_put_16 (abfd, val, ptr)                \
+   : (bits) == 32 ? bfd_put_32 (abfd, val, ptr)                \
+   : (bits) == 64 ? bfd_put_64 (abfd, val, ptr)                \
+   : (abort (), (void) 0))
+
+
+/* Byte swapping macros for file header data.  */
+
+#define bfd_h_put_8(abfd, val, ptr) \
+  bfd_put_8 (abfd, val, ptr)
+#define bfd_h_put_signed_8(abfd, val, ptr) \
+  bfd_put_8 (abfd, val, ptr)
+#define bfd_h_get_8(abfd, ptr) \
+  bfd_get_8 (abfd, ptr)
+#define bfd_h_get_signed_8(abfd, ptr) \
+  bfd_get_signed_8 (abfd, ptr)
+
+#define bfd_h_put_16(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_h_putx16, (val, ptr))
+#define bfd_h_put_signed_16 \
+  bfd_h_put_16
+#define bfd_h_get_16(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx16, (ptr))
+#define bfd_h_get_signed_16(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx_signed_16, (ptr))
+
+#define bfd_h_put_32(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_h_putx32, (val, ptr))
+#define bfd_h_put_signed_32 \
+  bfd_h_put_32
+#define bfd_h_get_32(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx32, (ptr))
+#define bfd_h_get_signed_32(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx_signed_32, (ptr))
+
+#define bfd_h_put_64(abfd, val, ptr) \
+  BFD_SEND (abfd, bfd_h_putx64, (val, ptr))
+#define bfd_h_put_signed_64 \
+  bfd_h_put_64
+#define bfd_h_get_64(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx64, (ptr))
+#define bfd_h_get_signed_64(abfd, ptr) \
+  BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr))
+
+/* Aliases for the above, which should eventually go away.  */
+
+#define H_PUT_64  bfd_h_put_64
+#define H_PUT_32  bfd_h_put_32
+#define H_PUT_16  bfd_h_put_16
+#define H_PUT_8   bfd_h_put_8
+#define H_PUT_S64 bfd_h_put_signed_64
+#define H_PUT_S32 bfd_h_put_signed_32
+#define H_PUT_S16 bfd_h_put_signed_16
+#define H_PUT_S8  bfd_h_put_signed_8
+#define H_GET_64  bfd_h_get_64
+#define H_GET_32  bfd_h_get_32
+#define H_GET_16  bfd_h_get_16
+#define H_GET_8   bfd_h_get_8
+#define H_GET_S64 bfd_h_get_signed_64
+#define H_GET_S32 bfd_h_get_signed_32
+#define H_GET_S16 bfd_h_get_signed_16
+#define H_GET_S8  bfd_h_get_signed_8
+
+
+/* Extracted from bfdio.c.  */
+long bfd_get_mtime (bfd *abfd);
+
+long bfd_get_size (bfd *abfd);
+
+/* Extracted from bfdwin.c.  */
+/* Extracted from section.c.  */
+typedef struct bfd_section
+{
+  /* The name of the section; the name isn't a copy, the pointer is
+     the same as that passed to bfd_make_section.  */
+  const char *name;
+
+  /* A unique sequence number.  */
+  int id;
+
+  /* Which section in the bfd; 0..n-1 as sections are created in a bfd.  */
+  int index;
+
+  /* The next section in the list belonging to the BFD, or NULL.  */
+  struct bfd_section *next;
+
+  /* The previous section in the list belonging to the BFD, or NULL.  */
+  struct bfd_section *prev;
+
+  /* The field flags contains attributes of the section. Some
+     flags are read in from the object file, and some are
+     synthesized from other information.  */
+  flagword flags;
+
+#define SEC_NO_FLAGS   0x000
+
+  /* Tells the OS to allocate space for this section when loading.
+     This is clear for a section containing debug information only.  */
+#define SEC_ALLOC      0x001
+
+  /* Tells the OS to load the section from the file when loading.
+     This is clear for a .bss section.  */
+#define SEC_LOAD       0x002
+
+  /* The section contains data still to be relocated, so there is
+     some relocation information too.  */
+#define SEC_RELOC      0x004
+
+  /* A signal to the OS that the section contains read only data.  */
+#define SEC_READONLY   0x008
+
+  /* The section contains code only.  */
+#define SEC_CODE       0x010
+
+  /* The section contains data only.  */
+#define SEC_DATA       0x020
+
+  /* The section will reside in ROM.  */
+#define SEC_ROM        0x040
+
+  /* The section contains constructor information. This section
+     type is used by the linker to create lists of constructors and
+     destructors used by <<g++>>. When a back end sees a symbol
+     which should be used in a constructor list, it creates a new
+     section for the type of name (e.g., <<__CTOR_LIST__>>), attaches
+     the symbol to it, and builds a relocation. To build the lists
+     of constructors, all the linker has to do is catenate all the
+     sections called <<__CTOR_LIST__>> and relocate the data
+     contained within - exactly the operations it would peform on
+     standard data.  */
+#define SEC_CONSTRUCTOR 0x080
+
+  /* The section has contents - a data section could be
+     <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
+     <<SEC_HAS_CONTENTS>>  */
+#define SEC_HAS_CONTENTS 0x100
+
+  /* An instruction to the linker to not output the section
+     even if it has information which would normally be written.  */
+#define SEC_NEVER_LOAD 0x200
+
+  /* The section contains thread local data.  */
+#define SEC_THREAD_LOCAL 0x400
+
+  /* The section has GOT references.  This flag is only for the
+     linker, and is currently only used by the elf32-hppa back end.
+     It will be set if global offset table references were detected
+     in this section, which indicate to the linker that the section
+     contains PIC code, and must be handled specially when doing a
+     static link.  */
+#define SEC_HAS_GOT_REF 0x800
+
+  /* The section contains common symbols (symbols may be defined
+     multiple times, the value of a symbol is the amount of
+     space it requires, and the largest symbol value is the one
+     used).  Most targets have exactly one of these (which we
+     translate to bfd_com_section_ptr), but ECOFF has two.  */
+#define SEC_IS_COMMON 0x1000
+
+  /* The section contains only debugging information.  For
+     example, this is set for ELF .debug and .stab sections.
+     strip tests this flag to see if a section can be
+     discarded.  */
+#define SEC_DEBUGGING 0x2000
+
+  /* The contents of this section are held in memory pointed to
+     by the contents field.  This is checked by bfd_get_section_contents,
+     and the data is retrieved from memory if appropriate.  */
+#define SEC_IN_MEMORY 0x4000
+
+  /* The contents of this section are to be excluded by the
+     linker for executable and shared objects unless those
+     objects are to be further relocated.  */
+#define SEC_EXCLUDE 0x8000
+
+  /* The contents of this section are to be sorted based on the sum of
+     the symbol and addend values specified by the associated relocation
+     entries.  Entries without associated relocation entries will be
+     appended to the end of the section in an unspecified order.  */
+#define SEC_SORT_ENTRIES 0x10000
+
+  /* When linking, duplicate sections of the same name should be
+     discarded, rather than being combined into a single section as
+     is usually done.  This is similar to how common symbols are
+     handled.  See SEC_LINK_DUPLICATES below.  */
+#define SEC_LINK_ONCE 0x20000
+
+  /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
+     should handle duplicate sections.  */
+#define SEC_LINK_DUPLICATES 0x40000
+
+  /* This value for SEC_LINK_DUPLICATES means that duplicate
+     sections with the same name should simply be discarded.  */
+#define SEC_LINK_DUPLICATES_DISCARD 0x0
+
+  /* This value for SEC_LINK_DUPLICATES means that the linker
+     should warn if there are any duplicate sections, although
+     it should still only link one copy.  */
+#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
+
+  /* This value for SEC_LINK_DUPLICATES means that the linker
+     should warn if any duplicate sections are a different size.  */
+#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
+
+  /* This value for SEC_LINK_DUPLICATES means that the linker
+     should warn if any duplicate sections contain different
+     contents.  */
+#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
+  (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
+
+  /* This section was created by the linker as part of dynamic
+     relocation or other arcane processing.  It is skipped when
+     going through the first-pass output, trusting that someone
+     else up the line will take care of it later.  */
+#define SEC_LINKER_CREATED 0x200000
+
+  /* This section should not be subject to garbage collection.
+     Also set to inform the linker that this section should not be
+     listed in the link map as discarded.  */
+#define SEC_KEEP 0x400000
+
+  /* This section contains "short" data, and should be placed
+     "near" the GP.  */
+#define SEC_SMALL_DATA 0x800000
+
+  /* Attempt to merge identical entities in the section.
+     Entity size is given in the entsize field.  */
+#define SEC_MERGE 0x1000000
+
+  /* If given with SEC_MERGE, entities to merge are zero terminated
+     strings where entsize specifies character size instead of fixed
+     size entries.  */
+#define SEC_STRINGS 0x2000000
+
+  /* This section contains data about section groups.  */
+#define SEC_GROUP 0x4000000
+
+  /* The section is a COFF shared library section.  This flag is
+     only for the linker.  If this type of section appears in
+     the input file, the linker must copy it to the output file
+     without changing the vma or size.  FIXME: Although this
+     was originally intended to be general, it really is COFF
+     specific (and the flag was renamed to indicate this).  It
+     might be cleaner to have some more general mechanism to
+     allow the back end to control what the linker does with
+     sections.  */
+#define SEC_COFF_SHARED_LIBRARY 0x10000000
+
+  /* This section contains data which may be shared with other
+     executables or shared objects. This is for COFF only.  */
+#define SEC_COFF_SHARED 0x20000000
+
+  /* When a section with this flag is being linked, then if the size of
+     the input section is less than a page, it should not cross a page
+     boundary.  If the size of the input section is one page or more,
+     it should be aligned on a page boundary.  This is for TI
+     TMS320C54X only.  */
+#define SEC_TIC54X_BLOCK 0x40000000
+
+  /* Conditionally link this section; do not link if there are no
+     references found to any symbol in the section.  This is for TI
+     TMS320C54X only.  */
+#define SEC_TIC54X_CLINK 0x80000000
+
+  /*  End of section flags.  */
+
+  /* Some internal packed boolean fields.  */
+
+  /* See the vma field.  */
+  unsigned int user_set_vma : 1;
+
+  /* A mark flag used by some of the linker backends.  */
+  unsigned int linker_mark : 1;
+
+  /* Another mark flag used by some of the linker backends.  Set for
+     output sections that have an input section.  */
+  unsigned int linker_has_input : 1;
+
+  /* Mark flags used by some linker backends for garbage collection.  */
+  unsigned int gc_mark : 1;
+  unsigned int gc_mark_from_eh : 1;
+
+  /* The following flags are used by the ELF linker. */
+
+  /* Mark sections which have been allocated to segments.  */
+  unsigned int segment_mark : 1;
+
+  /* Type of sec_info information.  */
+  unsigned int sec_info_type:3;
+#define ELF_INFO_TYPE_NONE      0
+#define ELF_INFO_TYPE_STABS     1
+#define ELF_INFO_TYPE_MERGE     2
+#define ELF_INFO_TYPE_EH_FRAME  3
+#define ELF_INFO_TYPE_JUST_SYMS 4
+
+  /* Nonzero if this section uses RELA relocations, rather than REL.  */
+  unsigned int use_rela_p:1;
+
+  /* Bits used by various backends.  The generic code doesn't touch
+     these fields.  */
+
+  /* Nonzero if this section has TLS related relocations.  */
+  unsigned int has_tls_reloc:1;
+
+  /* Nonzero if this section has a gp reloc.  */
+  unsigned int has_gp_reloc:1;
+
+  /* Nonzero if this section needs the relax finalize pass.  */
+  unsigned int need_finalize_relax:1;
+
+  /* Whether relocations have been processed.  */
+  unsigned int reloc_done : 1;
+
+  /* End of internal packed boolean fields.  */
+
+  /*  The virtual memory address of the section - where it will be
+      at run time.  The symbols are relocated against this.  The
+      user_set_vma flag is maintained by bfd; if it's not set, the
+      backend can assign addresses (for example, in <<a.out>>, where
+      the default address for <<.data>> is dependent on the specific
+      target and various flags).  */
+  bfd_vma vma;
+
+  /*  The load address of the section - where it would be in a
+      rom image; really only used for writing section header
+      information.  */
+  bfd_vma lma;
+
+  /* The size of the section in octets, as it will be output.
+     Contains a value even if the section has no contents (e.g., the
+     size of <<.bss>>).  */
+  bfd_size_type size;
+
+  /* For input sections, the original size on disk of the section, in
+     octets.  This field is used by the linker relaxation code.  It is
+     currently only set for sections where the linker relaxation scheme
+     doesn't cache altered section and reloc contents (stabs, eh_frame,
+     SEC_MERGE, some coff relaxing targets), and thus the original size
+     needs to be kept to read the section multiple times.
+     For output sections, rawsize holds the section size calculated on
+     a previous linker relaxation pass.  */
+  bfd_size_type rawsize;
+
+  /* If this section is going to be output, then this value is the
+     offset in *bytes* into the output section of the first byte in the
+     input section (byte ==> smallest addressable unit on the
+     target).  In most cases, if this was going to start at the
+     100th octet (8-bit quantity) in the output section, this value
+     would be 100.  However, if the target byte size is 16 bits
+     (bfd_octets_per_byte is "2"), this value would be 50.  */
+  bfd_vma output_offset;
+
+  /* The output section through which to map on output.  */
+  struct bfd_section *output_section;
+
+  /* The alignment requirement of the section, as an exponent of 2 -
+     e.g., 3 aligns to 2^3 (or 8).  */
+  unsigned int alignment_power;
+
+  /* If an input section, a pointer to a vector of relocation
+     records for the data in this section.  */
+  struct reloc_cache_entry *relocation;
+
+  /* If an output section, a pointer to a vector of pointers to
+     relocation records for the data in this section.  */
+  struct reloc_cache_entry **orelocation;
+
+  /* The number of relocation records in one of the above.  */
+  unsigned reloc_count;
+
+  /* Information below is back end specific - and not always used
+     or updated.  */
+
+  /* File position of section data.  */
+  file_ptr filepos;
+
+  /* File position of relocation info.  */
+  file_ptr rel_filepos;
+
+  /* File position of line data.  */
+  file_ptr line_filepos;
+
+  /* Pointer to data for applications.  */
+  void *userdata;
+
+  /* If the SEC_IN_MEMORY flag is set, this points to the actual
+     contents.  */
+  unsigned char *contents;
+
+  /* Attached line number information.  */
+  alent *lineno;
+
+  /* Number of line number records.  */
+  unsigned int lineno_count;
+
+  /* Entity size for merging purposes.  */
+  unsigned int entsize;
+
+  /* Points to the kept section if this section is a link-once section,
+     and is discarded.  */
+  struct bfd_section *kept_section;
+
+  /* When a section is being output, this value changes as more
+     linenumbers are written out.  */
+  file_ptr moving_line_filepos;
+
+  /* What the section number is in the target world.  */
+  int target_index;
+
+  void *used_by_bfd;
+
+  /* If this is a constructor section then here is a list of the
+     relocations created to relocate items within it.  */
+  struct relent_chain *constructor_chain;
+
+  /* The BFD which owns the section.  */
+  bfd *owner;
+
+  /* A symbol which points at this section only.  */
+  struct bfd_symbol *symbol;
+  struct bfd_symbol **symbol_ptr_ptr;
+
+  /* Early in the link process, map_head and map_tail are used to build
+     a list of input sections attached to an output section.  Later,
+     output sections use these fields for a list of bfd_link_order
+     structs.  */
+  union {
+    struct bfd_link_order *link_order;
+    struct bfd_section *s;
+  } map_head, map_tail;
+} asection;
+
+/* These sections are global, and are managed by BFD.  The application
+   and target back end are not permitted to change the values in
+   these sections.  New code should use the section_ptr macros rather
+   than referring directly to the const sections.  The const sections
+   may eventually vanish.  */
+#define BFD_ABS_SECTION_NAME "*ABS*"
+#define BFD_UND_SECTION_NAME "*UND*"
+#define BFD_COM_SECTION_NAME "*COM*"
+#define BFD_IND_SECTION_NAME "*IND*"
+
+/* The absolute section.  */
+extern asection bfd_abs_section;
+#define bfd_abs_section_ptr ((asection *) &bfd_abs_section)
+#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
+/* Pointer to the undefined section.  */
+extern asection bfd_und_section;
+#define bfd_und_section_ptr ((asection *) &bfd_und_section)
+#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
+/* Pointer to the common section.  */
+extern asection bfd_com_section;
+#define bfd_com_section_ptr ((asection *) &bfd_com_section)
+/* Pointer to the indirect section.  */
+extern asection bfd_ind_section;
+#define bfd_ind_section_ptr ((asection *) &bfd_ind_section)
+#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
+
+#define bfd_is_const_section(SEC)              \
+ (   ((SEC) == bfd_abs_section_ptr)            \
+  || ((SEC) == bfd_und_section_ptr)            \
+  || ((SEC) == bfd_com_section_ptr)            \
+  || ((SEC) == bfd_ind_section_ptr))
+
+/* Macros to handle insertion and deletion of a bfd's sections.  These
+   only handle the list pointers, ie. do not adjust section_count,
+   target_index etc.  */
+#define bfd_section_list_remove(ABFD, S) \
+  do                                                   \
+    {                                                  \
+      asection *_s = S;                                \
+      asection *_next = _s->next;                      \
+      asection *_prev = _s->prev;                      \
+      if (_prev)                                       \
+        _prev->next = _next;                           \
+      else                                             \
+        (ABFD)->sections = _next;                      \
+      if (_next)                                       \
+        _next->prev = _prev;                           \
+      else                                             \
+        (ABFD)->section_last = _prev;                  \
+    }                                                  \
+  while (0)
+#define bfd_section_list_append(ABFD, S) \
+  do                                                   \
+    {                                                  \
+      asection *_s = S;                                \
+      bfd *_abfd = ABFD;                               \
+      _s->next = NULL;                                 \
+      if (_abfd->section_last)                         \
+        {                                              \
+          _s->prev = _abfd->section_last;              \
+          _abfd->section_last->next = _s;              \
+        }                                              \
+      else                                             \
+        {                                              \
+          _s->prev = NULL;                             \
+          _abfd->sections = _s;                        \
+        }                                              \
+      _abfd->section_last = _s;                        \
+    }                                                  \
+  while (0)
+#define bfd_section_list_prepend(ABFD, S) \
+  do                                                   \
+    {                                                  \
+      asection *_s = S;                                \
+      bfd *_abfd = ABFD;                               \
+      _s->prev = NULL;                                 \
+      if (_abfd->sections)                             \
+        {                                              \
+          _s->next = _abfd->sections;                  \
+          _abfd->sections->prev = _s;                  \
+        }                                              \
+      else                                             \
+        {                                              \
+          _s->next = NULL;                             \
+          _abfd->section_last = _s;                    \
+        }                                              \
+      _abfd->sections = _s;                            \
+    }                                                  \
+  while (0)
+#define bfd_section_list_insert_after(ABFD, A, S) \
+  do                                                   \
+    {                                                  \
+      asection *_a = A;                                \
+      asection *_s = S;                                \
+      asection *_next = _a->next;                      \
+      _s->next = _next;                                \
+      _s->prev = _a;                                   \
+      _a->next = _s;                                   \
+      if (_next)                                       \
+        _next->prev = _s;                              \
+      else                                             \
+        (ABFD)->section_last = _s;                     \
+    }                                                  \
+  while (0)
+#define bfd_section_list_insert_before(ABFD, B, S) \
+  do                                                   \
+    {                                                  \
+      asection *_b = B;                                \
+      asection *_s = S;                                \
+      asection *_prev = _b->prev;                      \
+      _s->prev = _prev;                                \
+      _s->next = _b;                                   \
+      _b->prev = _s;                                   \
+      if (_prev)                                       \
+        _prev->next = _s;                              \
+      else                                             \
+        (ABFD)->sections = _s;                         \
+    }                                                  \
+  while (0)
+#define bfd_section_removed_from_list(ABFD, S) \
+  ((S)->next == NULL ? (ABFD)->section_last != (S) : (S)->next->prev != (S))
+
+#define BFD_FAKE_SECTION(SEC, FLAGS, SYM, NAME, IDX)                   \
+  /* name, id,  index, next, prev, flags, user_set_vma,            */  \
+  { NAME,  IDX, 0,     NULL, NULL, FLAGS, 0,                           \
+                                                                       \
+  /* linker_mark, linker_has_input, gc_mark, gc_mark_from_eh,      */  \
+     0,           0,                1,       0,                        \
+                                                                       \
+  /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc,       */  \
+     0,            0,             0,          0,                       \
+                                                                       \
+  /* has_gp_reloc, need_finalize_relax, reloc_done,                */  \
+     0,            0,                   0,                             \
+                                                                       \
+  /* vma, lma, size, rawsize                                       */  \
+     0,   0,   0,    0,                                                \
+                                                                       \
+  /* output_offset, output_section,              alignment_power,  */  \
+     0,             (struct bfd_section *) &SEC, 0,                    \
+                                                                       \
+  /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */  \
+     NULL,       NULL,        0,           0,       0,                 \
+                                                                       \
+  /* line_filepos, userdata, contents, lineno, lineno_count,       */  \
+     0,            NULL,     NULL,     NULL,   0,                      \
+                                                                       \
+  /* entsize, kept_section, moving_line_filepos,                    */ \
+     0,       NULL,          0,                                        \
+                                                                       \
+  /* target_index, used_by_bfd, constructor_chain, owner,          */  \
+     0,            NULL,        NULL,              NULL,               \
+                                                                       \
+  /* symbol,                    symbol_ptr_ptr,                    */  \
+     (struct bfd_symbol *) SYM, &SEC.symbol,                           \
+                                                                       \
+  /* map_head, map_tail                                            */  \
+     { NULL }, { NULL }                                                \
+    }
+
+void bfd_section_list_clear (bfd *);
+
+asection *bfd_get_section_by_name (bfd *abfd, const char *name);
+
+asection *bfd_get_section_by_name_if
+   (bfd *abfd,
+    const char *name,
+    bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj),
+    void *obj);
+
+char *bfd_get_unique_section_name
+   (bfd *abfd, const char *templat, int *count);
+
+asection *bfd_make_section_old_way (bfd *abfd, const char *name);
+
+asection *bfd_make_section_anyway_with_flags
+   (bfd *abfd, const char *name, flagword flags);
+
+asection *bfd_make_section_anyway (bfd *abfd, const char *name);
+
+asection *bfd_make_section_with_flags
+   (bfd *, const char *name, flagword flags);
+
+asection *bfd_make_section (bfd *, const char *name);
+
+bfd_boolean bfd_set_section_flags
+   (bfd *abfd, asection *sec, flagword flags);
+
+void bfd_map_over_sections
+   (bfd *abfd,
+    void (*func) (bfd *abfd, asection *sect, void *obj),
+    void *obj);
+
+asection *bfd_sections_find_if
+   (bfd *abfd,
+    bfd_boolean (*operation) (bfd *abfd, asection *sect, void *obj),
+    void *obj);
+
+bfd_boolean bfd_set_section_size
+   (bfd *abfd, asection *sec, bfd_size_type val);
+
+bfd_boolean bfd_set_section_contents
+   (bfd *abfd, asection *section, const void *data,
+    file_ptr offset, bfd_size_type count);
+
+bfd_boolean bfd_get_section_contents
+   (bfd *abfd, asection *section, void *location, file_ptr offset,
+    bfd_size_type count);
+
+bfd_boolean bfd_malloc_and_get_section
+   (bfd *abfd, asection *section, bfd_byte **buf);
+
+bfd_boolean bfd_copy_private_section_data
+   (bfd *ibfd, asection *isec, bfd *obfd, asection *osec);
+
+#define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \
+     BFD_SEND (obfd, _bfd_copy_private_section_data, \
+               (ibfd, isection, obfd, osection))
+bfd_boolean bfd_generic_is_group_section (bfd *, const asection *sec);
+
+bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group);
+
+/* Extracted from archures.c.  */
+enum bfd_architecture
+{
+  bfd_arch_unknown,   /* File arch not known.  */
+  bfd_arch_obscure,   /* Arch known, not one of these.  */
+  bfd_arch_m68k,      /* Motorola 68xxx */
+#define bfd_mach_m68000 1
+#define bfd_mach_m68008 2
+#define bfd_mach_m68010 3
+#define bfd_mach_m68020 4
+#define bfd_mach_m68030 5
+#define bfd_mach_m68040 6
+#define bfd_mach_m68060 7
+#define bfd_mach_cpu32  8
+#define bfd_mach_mcf_isa_a_nodiv 9
+#define bfd_mach_mcf_isa_a 10
+#define bfd_mach_mcf_isa_a_mac 11
+#define bfd_mach_mcf_isa_a_emac 12
+#define bfd_mach_mcf_isa_aplus 13
+#define bfd_mach_mcf_isa_aplus_mac 14
+#define bfd_mach_mcf_isa_aplus_emac 15
+#define bfd_mach_mcf_isa_b_nousp 16
+#define bfd_mach_mcf_isa_b_nousp_mac 17
+#define bfd_mach_mcf_isa_b_nousp_emac 18
+#define bfd_mach_mcf_isa_b 19
+#define bfd_mach_mcf_isa_b_mac 20
+#define bfd_mach_mcf_isa_b_emac 21
+#define bfd_mach_mcf_isa_b_float 22
+#define bfd_mach_mcf_isa_b_float_mac 23
+#define bfd_mach_mcf_isa_b_float_emac 24
+  bfd_arch_vax,       /* DEC Vax */
+  bfd_arch_i960,      /* Intel 960 */
+    /* The order of the following is important.
+       lower number indicates a machine type that
+       only accepts a subset of the instructions
+       available to machines with higher numbers.
+       The exception is the "ca", which is
+       incompatible with all other machines except
+       "core".  */
+
+#define bfd_mach_i960_core      1
+#define bfd_mach_i960_ka_sa     2
+#define bfd_mach_i960_kb_sb     3
+#define bfd_mach_i960_mc        4
+#define bfd_mach_i960_xa        5
+#define bfd_mach_i960_ca        6
+#define bfd_mach_i960_jx        7
+#define bfd_mach_i960_hx        8
+
+  bfd_arch_or32,      /* OpenRISC 32 */
+
+  bfd_arch_sparc,     /* SPARC */
+#define bfd_mach_sparc                 1
+/* The difference between v8plus and v9 is that v9 is a true 64 bit env.  */
+#define bfd_mach_sparc_sparclet        2
+#define bfd_mach_sparc_sparclite       3
+#define bfd_mach_sparc_v8plus          4
+#define bfd_mach_sparc_v8plusa         5 /* with ultrasparc add'ns.  */
+#define bfd_mach_sparc_sparclite_le    6
+#define bfd_mach_sparc_v9              7
+#define bfd_mach_sparc_v9a             8 /* with ultrasparc add'ns.  */
+#define bfd_mach_sparc_v8plusb         9 /* with cheetah add'ns.  */
+#define bfd_mach_sparc_v9b             10 /* with cheetah add'ns.  */
+/* Nonzero if MACH has the v9 instruction set.  */
+#define bfd_mach_sparc_v9_p(mach) \
+  ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \
+   && (mach) != bfd_mach_sparc_sparclite_le)
+/* Nonzero if MACH is a 64 bit sparc architecture.  */
+#define bfd_mach_sparc_64bit_p(mach) \
+  ((mach) >= bfd_mach_sparc_v9 && (mach) != bfd_mach_sparc_v8plusb)
+  bfd_arch_spu,       /* PowerPC SPU */
+#define bfd_mach_spu           256 
+  bfd_arch_mips,      /* MIPS Rxxxx */
+#define bfd_mach_mips3000              3000
+#define bfd_mach_mips3900              3900
+#define bfd_mach_mips4000              4000
+#define bfd_mach_mips4010              4010
+#define bfd_mach_mips4100              4100
+#define bfd_mach_mips4111              4111
+#define bfd_mach_mips4120              4120
+#define bfd_mach_mips4300              4300
+#define bfd_mach_mips4400              4400
+#define bfd_mach_mips4600              4600
+#define bfd_mach_mips4650              4650
+#define bfd_mach_mips5000              5000
+#define bfd_mach_mips5400              5400
+#define bfd_mach_mips5500              5500
+#define bfd_mach_mips6000              6000
+#define bfd_mach_mips7000              7000
+#define bfd_mach_mips8000              8000
+#define bfd_mach_mips9000              9000
+#define bfd_mach_mips10000             10000
+#define bfd_mach_mips12000             12000
+#define bfd_mach_mips16                16
+#define bfd_mach_mips5                 5
+#define bfd_mach_mips_sb1              12310201 /* octal 'SB', 01 */
+#define bfd_mach_mipsisa32             32
+#define bfd_mach_mipsisa32r2           33
+#define bfd_mach_mipsisa64             64
+#define bfd_mach_mipsisa64r2           65
+  bfd_arch_i386,      /* Intel 386 */
+#define bfd_mach_i386_i386 1
+#define bfd_mach_i386_i8086 2
+#define bfd_mach_i386_i386_intel_syntax 3
+#define bfd_mach_x86_64 64
+#define bfd_mach_x86_64_intel_syntax 65
+  bfd_arch_we32k,     /* AT&T WE32xxx */
+  bfd_arch_tahoe,     /* CCI/Harris Tahoe */
+  bfd_arch_i860,      /* Intel 860 */
+  bfd_arch_i370,      /* IBM 360/370 Mainframes */
+  bfd_arch_romp,      /* IBM ROMP PC/RT */
+  bfd_arch_convex,    /* Convex */
+  bfd_arch_m88k,      /* Motorola 88xxx */
+  bfd_arch_m98k,      /* Motorola 98xxx */
+  bfd_arch_pyramid,   /* Pyramid Technology */
+  bfd_arch_h8300,     /* Renesas H8/300 (formerly Hitachi H8/300) */
+#define bfd_mach_h8300    1
+#define bfd_mach_h8300h   2
+#define bfd_mach_h8300s   3
+#define bfd_mach_h8300hn  4
+#define bfd_mach_h8300sn  5
+#define bfd_mach_h8300sx  6
+#define bfd_mach_h8300sxn 7
+  bfd_arch_pdp11,     /* DEC PDP-11 */
+  bfd_arch_powerpc,   /* PowerPC */
+#define bfd_mach_ppc           32
+#define bfd_mach_ppc64         64
+#define bfd_mach_ppc_403       403
+#define bfd_mach_ppc_403gc     4030
+#define bfd_mach_ppc_505       505
+#define bfd_mach_ppc_601       601
+#define bfd_mach_ppc_602       602
+#define bfd_mach_ppc_603       603
+#define bfd_mach_ppc_ec603e    6031
+#define bfd_mach_ppc_604       604
+#define bfd_mach_ppc_620       620
+#define bfd_mach_ppc_630       630
+#define bfd_mach_ppc_750       750
+#define bfd_mach_ppc_860       860
+#define bfd_mach_ppc_a35       35
+#define bfd_mach_ppc_rs64ii    642
+#define bfd_mach_ppc_rs64iii   643
+#define bfd_mach_ppc_7400      7400
+#define bfd_mach_ppc_e500      500
+  bfd_arch_rs6000,    /* IBM RS/6000 */
+#define bfd_mach_rs6k          6000
+#define bfd_mach_rs6k_rs1      6001
+#define bfd_mach_rs6k_rsc      6003
+#define bfd_mach_rs6k_rs2      6002
+  bfd_arch_hppa,      /* HP PA RISC */
+#define bfd_mach_hppa10        10
+#define bfd_mach_hppa11        11
+#define bfd_mach_hppa20        20
+#define bfd_mach_hppa20w       25
+  bfd_arch_d10v,      /* Mitsubishi D10V */
+#define bfd_mach_d10v          1
+#define bfd_mach_d10v_ts2      2
+#define bfd_mach_d10v_ts3      3
+  bfd_arch_d30v,      /* Mitsubishi D30V */
+  bfd_arch_dlx,       /* DLX */
+  bfd_arch_m68hc11,   /* Motorola 68HC11 */
+  bfd_arch_m68hc12,   /* Motorola 68HC12 */
+#define bfd_mach_m6812_default 0
+#define bfd_mach_m6812         1
+#define bfd_mach_m6812s        2
+  bfd_arch_z8k,       /* Zilog Z8000 */
+#define bfd_mach_z8001         1
+#define bfd_mach_z8002         2
+  bfd_arch_h8500,     /* Renesas H8/500 (formerly Hitachi H8/500) */
+  bfd_arch_sh,        /* Renesas / SuperH SH (formerly Hitachi SH) */
+#define bfd_mach_sh            1
+#define bfd_mach_sh2        0x20
+#define bfd_mach_sh_dsp     0x2d
+#define bfd_mach_sh2a       0x2a
+#define bfd_mach_sh2a_nofpu 0x2b
+#define bfd_mach_sh2a_nofpu_or_sh4_nommu_nofpu 0x2a1
+#define bfd_mach_sh2a_nofpu_or_sh3_nommu 0x2a2
+#define bfd_mach_sh2a_or_sh4  0x2a3
+#define bfd_mach_sh2a_or_sh3e 0x2a4
+#define bfd_mach_sh2e       0x2e
+#define bfd_mach_sh3        0x30
+#define bfd_mach_sh3_nommu  0x31
+#define bfd_mach_sh3_dsp    0x3d
+#define bfd_mach_sh3e       0x3e
+#define bfd_mach_sh4        0x40
+#define bfd_mach_sh4_nofpu  0x41
+#define bfd_mach_sh4_nommu_nofpu  0x42
+#define bfd_mach_sh4a       0x4a
+#define bfd_mach_sh4a_nofpu 0x4b
+#define bfd_mach_sh4al_dsp  0x4d
+#define bfd_mach_sh5        0x50
+  bfd_arch_alpha,     /* Dec Alpha */
+#define bfd_mach_alpha_ev4  0x10
+#define bfd_mach_alpha_ev5  0x20
+#define bfd_mach_alpha_ev6  0x30
+  bfd_arch_arm,       /* Advanced Risc Machines ARM.  */
+#define bfd_mach_arm_unknown   0
+#define bfd_mach_arm_2         1
+#define bfd_mach_arm_2a        2
+#define bfd_mach_arm_3         3
+#define bfd_mach_arm_3M        4
+#define bfd_mach_arm_4         5
+#define bfd_mach_arm_4T        6
+#define bfd_mach_arm_5         7
+#define bfd_mach_arm_5T        8
+#define bfd_mach_arm_5TE       9
+#define bfd_mach_arm_XScale    10
+#define bfd_mach_arm_ep9312    11
+#define bfd_mach_arm_iWMMXt    12
+#define bfd_mach_arm_iWMMXt2   13
+  bfd_arch_ns32k,     /* National Semiconductors ns32000 */
+  bfd_arch_w65,       /* WDC 65816 */
+  bfd_arch_tic30,     /* Texas Instruments TMS320C30 */
+  bfd_arch_tic4x,     /* Texas Instruments TMS320C3X/4X */
+#define bfd_mach_tic3x         30
+#define bfd_mach_tic4x         40
+  bfd_arch_tic54x,    /* Texas Instruments TMS320C54X */
+  bfd_arch_tic80,     /* TI TMS320c80 (MVP) */
+  bfd_arch_v850,      /* NEC V850 */
+#define bfd_mach_v850          1
+#define bfd_mach_v850e         'E'
+#define bfd_mach_v850e1        '1'
+  bfd_arch_arc,       /* ARC Cores */
+#define bfd_mach_arc_5         5
+#define bfd_mach_arc_6         6
+#define bfd_mach_arc_7         7
+#define bfd_mach_arc_8         8
+ bfd_arch_m32c,     /* Renesas M16C/M32C.  */
+#define bfd_mach_m16c        0x75
+#define bfd_mach_m32c        0x78
+  bfd_arch_m32r,      /* Renesas M32R (formerly Mitsubishi M32R/D) */
+#define bfd_mach_m32r          1 /* For backwards compatibility.  */
+#define bfd_mach_m32rx         'x'
+#define bfd_mach_m32r2         '2'
+  bfd_arch_mn10200,   /* Matsushita MN10200 */
+  bfd_arch_mn10300,   /* Matsushita MN10300 */
+#define bfd_mach_mn10300               300
+#define bfd_mach_am33          330
+#define bfd_mach_am33_2        332
+  bfd_arch_fr30,
+#define bfd_mach_fr30          0x46523330
+  bfd_arch_frv,
+#define bfd_mach_frv           1
+#define bfd_mach_frvsimple     2
+#define bfd_mach_fr300         300
+#define bfd_mach_fr400         400
+#define bfd_mach_fr450         450
+#define bfd_mach_frvtomcat     499     /* fr500 prototype */
+#define bfd_mach_fr500         500
+#define bfd_mach_fr550         550
+  bfd_arch_mcore,
+  bfd_arch_ia64,      /* HP/Intel ia64 */
+#define bfd_mach_ia64_elf64    64
+#define bfd_mach_ia64_elf32    32
+  bfd_arch_ip2k,      /* Ubicom IP2K microcontrollers. */
+#define bfd_mach_ip2022        1
+#define bfd_mach_ip2022ext     2
+ bfd_arch_iq2000,     /* Vitesse IQ2000.  */
+#define bfd_mach_iq2000        1
+#define bfd_mach_iq10          2
+  bfd_arch_mt,
+#define bfd_mach_ms1           1
+#define bfd_mach_mrisc2        2
+#define bfd_mach_ms2           3
+  bfd_arch_pj,
+  bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
+#define bfd_mach_avr1          1
+#define bfd_mach_avr2          2
+#define bfd_mach_avr3          3
+#define bfd_mach_avr4          4
+#define bfd_mach_avr5          5
+#define bfd_mach_avr6          6
+  bfd_arch_bfin,        /* ADI Blackfin */
+#define bfd_mach_bfin          1
+  bfd_arch_cr16c,       /* National Semiconductor CompactRISC. */
+#define bfd_mach_cr16c         1
+  bfd_arch_crx,       /*  National Semiconductor CRX.  */
+#define bfd_mach_crx           1
+  bfd_arch_cris,      /* Axis CRIS */
+#define bfd_mach_cris_v0_v10   255
+#define bfd_mach_cris_v32      32
+#define bfd_mach_cris_v10_v32  1032
+  bfd_arch_s390,      /* IBM s390 */
+#define bfd_mach_s390_31       31
+#define bfd_mach_s390_64       64
+  bfd_arch_score,     /* Sunplus score */ 
+  bfd_arch_openrisc,  /* OpenRISC */
+  bfd_arch_mmix,      /* Donald Knuth's educational processor.  */
+  bfd_arch_xstormy16,
+#define bfd_mach_xstormy16     1
+  bfd_arch_msp430,    /* Texas Instruments MSP430 architecture.  */
+#define bfd_mach_msp11          11
+#define bfd_mach_msp110         110
+#define bfd_mach_msp12          12
+#define bfd_mach_msp13          13
+#define bfd_mach_msp14          14
+#define bfd_mach_msp15          15
+#define bfd_mach_msp16          16
+#define bfd_mach_msp21          21
+#define bfd_mach_msp31          31
+#define bfd_mach_msp32          32
+#define bfd_mach_msp33          33
+#define bfd_mach_msp41          41
+#define bfd_mach_msp42          42
+#define bfd_mach_msp43          43
+#define bfd_mach_msp44          44
+  bfd_arch_xc16x,     /* Infineon's XC16X Series.               */
+#define bfd_mach_xc16x         1
+#define bfd_mach_xc16xl        2
+#define bfd_mach_xc16xs         3
+  bfd_arch_xtensa,    /* Tensilica's Xtensa cores.  */
+#define bfd_mach_xtensa        1
+   bfd_arch_maxq,     /* Dallas MAXQ 10/20 */
+#define bfd_mach_maxq10    10
+#define bfd_mach_maxq20    20
+  bfd_arch_z80,
+#define bfd_mach_z80strict      1 /* No undocumented opcodes.  */
+#define bfd_mach_z80            3 /* With ixl, ixh, iyl, and iyh.  */
+#define bfd_mach_z80full        7 /* All undocumented instructions.  */
+#define bfd_mach_r800           11 /* R800: successor with multiplication.  */
+  bfd_arch_last
+  };
+
+typedef struct bfd_arch_info
+{
+  int bits_per_word;
+  int bits_per_address;
+  int bits_per_byte;
+  enum bfd_architecture arch;
+  unsigned long mach;
+  const char *arch_name;
+  const char *printable_name;
+  unsigned int section_align_power;
+  /* TRUE if this is the default machine for the architecture.
+     The default arch should be the first entry for an arch so that
+     all the entries for that arch can be accessed via <<next>>.  */
+  bfd_boolean the_default;
+  const struct bfd_arch_info * (*compatible)
+    (const struct bfd_arch_info *a, const struct bfd_arch_info *b);
+
+  bfd_boolean (*scan) (const struct bfd_arch_info *, const char *);
+
+  const struct bfd_arch_info *next;
+}
+bfd_arch_info_type;
+
+const char *bfd_printable_name (bfd *abfd);
+
+const bfd_arch_info_type *bfd_scan_arch (const char *string);
+
+const char **bfd_arch_list (void);
+
+const bfd_arch_info_type *bfd_arch_get_compatible
+   (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns);
+
+void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
+
+enum bfd_architecture bfd_get_arch (bfd *abfd);
+
+unsigned long bfd_get_mach (bfd *abfd);
+
+unsigned int bfd_arch_bits_per_byte (bfd *abfd);
+
+unsigned int bfd_arch_bits_per_address (bfd *abfd);
+
+const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
+
+const bfd_arch_info_type *bfd_lookup_arch
+   (enum bfd_architecture arch, unsigned long machine);
+
+const char *bfd_printable_arch_mach
+   (enum bfd_architecture arch, unsigned long machine);
+
+unsigned int bfd_octets_per_byte (bfd *abfd);
+
+unsigned int bfd_arch_mach_octets_per_byte
+   (enum bfd_architecture arch, unsigned long machine);
+
+/* Extracted from reloc.c.  */
+typedef enum bfd_reloc_status
+{
+  /* No errors detected.  */
+  bfd_reloc_ok,
+
+  /* The relocation was performed, but there was an overflow.  */
+  bfd_reloc_overflow,
+
+  /* The address to relocate was not within the section supplied.  */
+  bfd_reloc_outofrange,
+
+  /* Used by special functions.  */
+  bfd_reloc_continue,
+
+  /* Unsupported relocation size requested.  */
+  bfd_reloc_notsupported,
+
+  /* Unused.  */
+  bfd_reloc_other,
+
+  /* The symbol to relocate against was undefined.  */
+  bfd_reloc_undefined,
+
+  /* The relocation was performed, but may not be ok - presently
+     generated only when linking i960 coff files with i960 b.out
+     symbols.  If this type is returned, the error_message argument
+     to bfd_perform_relocation will be set.  */
+  bfd_reloc_dangerous
+ }
+ bfd_reloc_status_type;
+
+
+typedef struct reloc_cache_entry
+{
+  /* A pointer into the canonical table of pointers.  */
+  struct bfd_symbol **sym_ptr_ptr;
+
+  /* offset in section.  */
+  bfd_size_type address;
+
+  /* addend for relocation value.  */
+  bfd_vma addend;
+
+  /* Pointer to how to perform the required relocation.  */
+  reloc_howto_type *howto;
+
+}
+arelent;
+
+enum complain_overflow
+{
+  /* Do not complain on overflow.  */
+  complain_overflow_dont,
+
+  /* Complain if the value overflows when considered as a signed
+     number one bit larger than the field.  ie. A bitfield of N bits
+     is allowed to represent -2**n to 2**n-1.  */
+  complain_overflow_bitfield,
+
+  /* Complain if the value overflows when considered as a signed
+     number.  */
+  complain_overflow_signed,
+
+  /* Complain if the value overflows when considered as an
+     unsigned number.  */
+  complain_overflow_unsigned
+};
+
+struct reloc_howto_struct
+{
+  /*  The type field has mainly a documentary use - the back end can
+      do what it wants with it, though normally the back end's
+      external idea of what a reloc number is stored
+      in this field.  For example, a PC relative word relocation
+      in a coff environment has the type 023 - because that's
+      what the outside world calls a R_PCRWORD reloc.  */
+  unsigned int type;
+
+  /*  The value the final relocation is shifted right by.  This drops
+      unwanted data from the relocation.  */
+  unsigned int rightshift;
+
+  /*  The size of the item to be relocated.  This is *not* a
+      power-of-two measure.  To get the number of bytes operated
+      on by a type of relocation, use bfd_get_reloc_size.  */
+  int size;
+
+  /*  The number of bits in the item to be relocated.  This is used
+      when doing overflow checking.  */
+  unsigned int bitsize;
+
+  /*  Notes that the relocation is relative to the location in the
+      data section of the addend.  The relocation function will
+      subtract from the relocation value the address of the location
+      being relocated.  */
+  bfd_boolean pc_relative;
+
+  /*  The bit position of the reloc value in the destination.
+      The relocated value is left shifted by this amount.  */
+  unsigned int bitpos;
+
+  /* What type of overflow error should be checked for when
+     relocating.  */
+  enum complain_overflow complain_on_overflow;
+
+  /* If this field is non null, then the supplied function is
+     called rather than the normal function.  This allows really
+     strange relocation methods to be accommodated (e.g., i960 callj
+     instructions).  */
+  bfd_reloc_status_type (*special_function)
+    (bfd *, arelent *, struct bfd_symbol *, void *, asection *,
+     bfd *, char **);
+
+  /* The textual name of the relocation type.  */
+  char *name;
+
+  /* Some formats record a relocation addend in the section contents
+     rather than with the relocation.  For ELF formats this is the
+     distinction between USE_REL and USE_RELA (though the code checks
+     for USE_REL == 1/0).  The value of this field is TRUE if the
+     addend is recorded with the section contents; when performing a
+     partial link (ld -r) the section contents (the data) will be
+     modified.  The value of this field is FALSE if addends are
+     recorded with the relocation (in arelent.addend); when performing
+     a partial link the relocation will be modified.
+     All relocations for all ELF USE_RELA targets should set this field
+     to FALSE (values of TRUE should be looked on with suspicion).
+     However, the converse is not true: not all relocations of all ELF
+     USE_REL targets set this field to TRUE.  Why this is so is peculiar
+     to each particular target.  For relocs that aren't used in partial
+     links (e.g. GOT stuff) it doesn't matter what this is set to.  */
+  bfd_boolean partial_inplace;
+
+  /* src_mask selects the part of the instruction (or data) to be used
+     in the relocation sum.  If the target relocations don't have an
+     addend in the reloc, eg. ELF USE_REL, src_mask will normally equal
+     dst_mask to extract the addend from the section contents.  If
+     relocations do have an addend in the reloc, eg. ELF USE_RELA, this
+     field should be zero.  Non-zero values for ELF USE_RELA targets are
+     bogus as in those cases the value in the dst_mask part of the
+     section contents should be treated as garbage.  */
+  bfd_vma src_mask;
+
+  /* dst_mask selects which parts of the instruction (or data) are
+     replaced with a relocated value.  */
+  bfd_vma dst_mask;
+
+  /* When some formats create PC relative instructions, they leave
+     the value of the pc of the place being relocated in the offset
+     slot of the instruction, so that a PC relative relocation can
+     be made just by adding in an ordinary offset (e.g., sun3 a.out).
+     Some formats leave the displacement part of an instruction
+     empty (e.g., m88k bcs); this flag signals the fact.  */
+  bfd_boolean pcrel_offset;
+};
+
+#define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \
+  { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC }
+#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \
+  HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \
+         NAME, FALSE, 0, 0, IN)
+
+#define EMPTY_HOWTO(C) \
+  HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \
+         NULL, FALSE, 0, 0, FALSE)
+
+#define HOWTO_PREPARE(relocation, symbol)               \
+  {                                                     \
+    if (symbol != NULL)                                 \
+      {                                                 \
+        if (bfd_is_com_section (symbol->section))       \
+          {                                             \
+            relocation = 0;                             \
+          }                                             \
+        else                                            \
+          {                                             \
+            relocation = symbol->value;                 \
+          }                                             \
+      }                                                 \
+  }
+
+unsigned int bfd_get_reloc_size (reloc_howto_type *);
+
+typedef struct relent_chain
+{
+  arelent relent;
+  struct relent_chain *next;
+}
+arelent_chain;
+
+bfd_reloc_status_type bfd_check_overflow
+   (enum complain_overflow how,
+    unsigned int bitsize,
+    unsigned int rightshift,
+    unsigned int addrsize,
+    bfd_vma relocation);
+
+bfd_reloc_status_type bfd_perform_relocation
+   (bfd *abfd,
+    arelent *reloc_entry,
+    void *data,
+    asection *input_section,
+    bfd *output_bfd,
+    char **error_message);
+
+bfd_reloc_status_type bfd_install_relocation
+   (bfd *abfd,
+    arelent *reloc_entry,
+    void *data, bfd_vma data_start,
+    asection *input_section,
+    char **error_message);
+
+enum bfd_reloc_code_real {
+  _dummy_first_bfd_reloc_code_real,
+
+
+/* Basic absolute relocations of N bits.  */
+  BFD_RELOC_64,
+  BFD_RELOC_32,
+  BFD_RELOC_26,
+  BFD_RELOC_24,
+  BFD_RELOC_16,
+  BFD_RELOC_14,
+  BFD_RELOC_8,
+
+/* PC-relative relocations.  Sometimes these are relative to the address
+of the relocation itself; sometimes they are relative to the start of
+the section containing the relocation.  It depends on the specific target.
+
+The 24-bit relocation is used in some Intel 960 configurations.  */
+  BFD_RELOC_64_PCREL,
+  BFD_RELOC_32_PCREL,
+  BFD_RELOC_24_PCREL,
+  BFD_RELOC_16_PCREL,
+  BFD_RELOC_12_PCREL,
+  BFD_RELOC_8_PCREL,
+
+/* Section relative relocations.  Some targets need this for DWARF2.  */
+  BFD_RELOC_32_SECREL,
+
+/* For ELF.  */
+  BFD_RELOC_32_GOT_PCREL,
+  BFD_RELOC_16_GOT_PCREL,
+  BFD_RELOC_8_GOT_PCREL,
+  BFD_RELOC_32_GOTOFF,
+  BFD_RELOC_16_GOTOFF,
+  BFD_RELOC_LO16_GOTOFF,
+  BFD_RELOC_HI16_GOTOFF,
+  BFD_RELOC_HI16_S_GOTOFF,
+  BFD_RELOC_8_GOTOFF,
+  BFD_RELOC_64_PLT_PCREL,
+  BFD_RELOC_32_PLT_PCREL,
+  BFD_RELOC_24_PLT_PCREL,
+  BFD_RELOC_16_PLT_PCREL,
+  BFD_RELOC_8_PLT_PCREL,
+  BFD_RELOC_64_PLTOFF,
+  BFD_RELOC_32_PLTOFF,
+  BFD_RELOC_16_PLTOFF,
+  BFD_RELOC_LO16_PLTOFF,
+  BFD_RELOC_HI16_PLTOFF,
+  BFD_RELOC_HI16_S_PLTOFF,
+  BFD_RELOC_8_PLTOFF,
+
+/* Relocations used by 68K ELF.  */
+  BFD_RELOC_68K_GLOB_DAT,
+  BFD_RELOC_68K_JMP_SLOT,
+  BFD_RELOC_68K_RELATIVE,
+
+/* Linkage-table relative.  */
+  BFD_RELOC_32_BASEREL,
+  BFD_RELOC_16_BASEREL,
+  BFD_RELOC_LO16_BASEREL,
+  BFD_RELOC_HI16_BASEREL,
+  BFD_RELOC_HI16_S_BASEREL,
+  BFD_RELOC_8_BASEREL,
+  BFD_RELOC_RVA,
+
+/* Absolute 8-bit relocation, but used to form an address like 0xFFnn.  */
+  BFD_RELOC_8_FFnn,
+
+/* These PC-relative relocations are stored as word displacements --
+i.e., byte displacements shifted right two bits.  The 30-bit word
+displacement (<<32_PCREL_S2>> -- 32 bits, shifted 2) is used on the
+SPARC.  (SPARC tools generally refer to this as <<WDISP30>>.)  The
+signed 16-bit displacement is used on the MIPS, and the 23-bit
+displacement is used on the Alpha.  */
+  BFD_RELOC_32_PCREL_S2,
+  BFD_RELOC_16_PCREL_S2,
+  BFD_RELOC_23_PCREL_S2,
+
+/* High 22 bits and low 10 bits of 32-bit value, placed into lower bits of
+the target word.  These are used on the SPARC.  */
+  BFD_RELOC_HI22,
+  BFD_RELOC_LO10,
+
+/* For systems that allocate a Global Pointer register, these are
+displacements off that register.  These relocation types are
+handled specially, because the value the register will have is
+decided relatively late.  */
+  BFD_RELOC_GPREL16,
+  BFD_RELOC_GPREL32,
+
+/* Reloc types used for i960/b.out.  */
+  BFD_RELOC_I960_CALLJ,
+
+/* SPARC ELF relocations.  There is probably some overlap with other
+relocation types already defined.  */
+  BFD_RELOC_NONE,
+  BFD_RELOC_SPARC_WDISP22,
+  BFD_RELOC_SPARC22,
+  BFD_RELOC_SPARC13,
+  BFD_RELOC_SPARC_GOT10,
+  BFD_RELOC_SPARC_GOT13,
+  BFD_RELOC_SPARC_GOT22,
+  BFD_RELOC_SPARC_PC10,
+  BFD_RELOC_SPARC_PC22,
+  BFD_RELOC_SPARC_WPLT30,
+  BFD_RELOC_SPARC_COPY,
+  BFD_RELOC_SPARC_GLOB_DAT,
+  BFD_RELOC_SPARC_JMP_SLOT,
+  BFD_RELOC_SPARC_RELATIVE,
+  BFD_RELOC_SPARC_UA16,
+  BFD_RELOC_SPARC_UA32,
+  BFD_RELOC_SPARC_UA64,
+
+/* I think these are specific to SPARC a.out (e.g., Sun 4).  */
+  BFD_RELOC_SPARC_BASE13,
+  BFD_RELOC_SPARC_BASE22,
+
+/* SPARC64 relocations  */
+#define BFD_RELOC_SPARC_64 BFD_RELOC_64
+  BFD_RELOC_SPARC_10,
+  BFD_RELOC_SPARC_11,
+  BFD_RELOC_SPARC_OLO10,
+  BFD_RELOC_SPARC_HH22,
+  BFD_RELOC_SPARC_HM10,
+  BFD_RELOC_SPARC_LM22,
+  BFD_RELOC_SPARC_PC_HH22,
+  BFD_RELOC_SPARC_PC_HM10,
+  BFD_RELOC_SPARC_PC_LM22,
+  BFD_RELOC_SPARC_WDISP16,
+  BFD_RELOC_SPARC_WDISP19,
+  BFD_RELOC_SPARC_7,
+  BFD_RELOC_SPARC_6,
+  BFD_RELOC_SPARC_5,
+#define BFD_RELOC_SPARC_DISP64 BFD_RELOC_64_PCREL
+  BFD_RELOC_SPARC_PLT32,
+  BFD_RELOC_SPARC_PLT64,
+  BFD_RELOC_SPARC_HIX22,
+  BFD_RELOC_SPARC_LOX10,
+  BFD_RELOC_SPARC_H44,
+  BFD_RELOC_SPARC_M44,
+  BFD_RELOC_SPARC_L44,
+  BFD_RELOC_SPARC_REGISTER,
+
+/* SPARC little endian relocation  */
+  BFD_RELOC_SPARC_REV32,
+
+/* SPARC TLS relocations  */
+  BFD_RELOC_SPARC_TLS_GD_HI22,
+  BFD_RELOC_SPARC_TLS_GD_LO10,
+  BFD_RELOC_SPARC_TLS_GD_ADD,
+  BFD_RELOC_SPARC_TLS_GD_CALL,
+  BFD_RELOC_SPARC_TLS_LDM_HI22,
+  BFD_RELOC_SPARC_TLS_LDM_LO10,
+  BFD_RELOC_SPARC_TLS_LDM_ADD,
+  BFD_RELOC_SPARC_TLS_LDM_CALL,
+  BFD_RELOC_SPARC_TLS_LDO_HIX22,
+  BFD_RELOC_SPARC_TLS_LDO_LOX10,
+  BFD_RELOC_SPARC_TLS_LDO_ADD,
+  BFD_RELOC_SPARC_TLS_IE_HI22,
+  BFD_RELOC_SPARC_TLS_IE_LO10,
+  BFD_RELOC_SPARC_TLS_IE_LD,
+  BFD_RELOC_SPARC_TLS_IE_LDX,
+  BFD_RELOC_SPARC_TLS_IE_ADD,
+  BFD_RELOC_SPARC_TLS_LE_HIX22,
+  BFD_RELOC_SPARC_TLS_LE_LOX10,
+  BFD_RELOC_SPARC_TLS_DTPMOD32,
+  BFD_RELOC_SPARC_TLS_DTPMOD64,
+  BFD_RELOC_SPARC_TLS_DTPOFF32,
+  BFD_RELOC_SPARC_TLS_DTPOFF64,
+  BFD_RELOC_SPARC_TLS_TPOFF32,
+  BFD_RELOC_SPARC_TLS_TPOFF64,
+
+/* SPU Relocations.  */
+  BFD_RELOC_SPU_IMM7,
+  BFD_RELOC_SPU_IMM8,
+  BFD_RELOC_SPU_IMM10,
+  BFD_RELOC_SPU_IMM10W,
+  BFD_RELOC_SPU_IMM16,
+  BFD_RELOC_SPU_IMM16W,
+  BFD_RELOC_SPU_IMM18,
+  BFD_RELOC_SPU_PCREL9a,
+  BFD_RELOC_SPU_PCREL9b,
+  BFD_RELOC_SPU_PCREL16,
+  BFD_RELOC_SPU_LO16,
+  BFD_RELOC_SPU_HI16,
+
+/* Alpha ECOFF and ELF relocations.  Some of these treat the symbol or
+"addend" in some special way.
+For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when
+writing; when reading, it will be the absolute section symbol.  The
+addend is the displacement in bytes of the "lda" instruction from
+the "ldah" instruction (which is at the address of this reloc).  */
+  BFD_RELOC_ALPHA_GPDISP_HI16,
+
+/* For GPDISP_LO16 ("ignore") relocations, the symbol is handled as
+with GPDISP_HI16 relocs.  The addend is ignored when writing the
+relocations out, and is filled in with the file's GP value on
+reading, for convenience.  */
+  BFD_RELOC_ALPHA_GPDISP_LO16,
+
+/* The ELF GPDISP relocation is exactly the same as the GPDISP_HI16
+relocation except that there is no accompanying GPDISP_LO16
+relocation.  */
+  BFD_RELOC_ALPHA_GPDISP,
+
+/* The Alpha LITERAL/LITUSE relocs are produced by a symbol reference;
+the assembler turns it into a LDQ instruction to load the address of
+the symbol, and then fills in a register in the real instruction.
+
+The LITERAL reloc, at the LDQ instruction, refers to the .lita
+section symbol.  The addend is ignored when writing, but is filled
+in with the file's GP value on reading, for convenience, as with the
+GPDISP_LO16 reloc.
+
+The ELF_LITERAL reloc is somewhere between 16_GOTOFF and GPDISP_LO16.
+It should refer to the symbol to be referenced, as with 16_GOTOFF,
+but it generates output not based on the position within the .got
+section, but relative to the GP value chosen for the file during the
+final link stage.
+
+The LITUSE reloc, on the instruction using the loaded address, gives
+information to the linker that it might be able to use to optimize
+away some literal section references.  The symbol is ignored (read
+as the absolute section symbol), and the "addend" indicates the type
+of instruction using the register:
+1 - "memory" fmt insn
+2 - byte-manipulation (byte offset reg)
+3 - jsr (target of branch)  */
+  BFD_RELOC_ALPHA_LITERAL,
+  BFD_RELOC_ALPHA_ELF_LITERAL,
+  BFD_RELOC_ALPHA_LITUSE,
+
+/* The HINT relocation indicates a value that should be filled into the
+"hint" field of a jmp/jsr/ret instruction, for possible branch-
+prediction logic which may be provided on some processors.  */
+  BFD_RELOC_ALPHA_HINT,
+
+/* The LINKAGE relocation outputs a linkage pair in the object file,
+which is filled by the linker.  */
+  BFD_RELOC_ALPHA_LINKAGE,
+
+/* The CODEADDR relocation outputs a STO_CA in the object file,
+which is filled by the linker.  */
+  BFD_RELOC_ALPHA_CODEADDR,
+
+/* The GPREL_HI/LO relocations together form a 32-bit offset from the
+GP register.  */
+  BFD_RELOC_ALPHA_GPREL_HI16,
+  BFD_RELOC_ALPHA_GPREL_LO16,
+
+/* Like BFD_RELOC_23_PCREL_S2, except that the source and target must
+share a common GP, and the target address is adjusted for
+STO_ALPHA_STD_GPLOAD.  */
+  BFD_RELOC_ALPHA_BRSGP,
+
+/* Alpha thread-local storage relocations.  */
+  BFD_RELOC_ALPHA_TLSGD,
+  BFD_RELOC_ALPHA_TLSLDM,
+  BFD_RELOC_ALPHA_DTPMOD64,
+  BFD_RELOC_ALPHA_GOTDTPREL16,
+  BFD_RELOC_ALPHA_DTPREL64,
+  BFD_RELOC_ALPHA_DTPREL_HI16,
+  BFD_RELOC_ALPHA_DTPREL_LO16,
+  BFD_RELOC_ALPHA_DTPREL16,
+  BFD_RELOC_ALPHA_GOTTPREL16,
+  BFD_RELOC_ALPHA_TPREL64,
+  BFD_RELOC_ALPHA_TPREL_HI16,
+  BFD_RELOC_ALPHA_TPREL_LO16,
+  BFD_RELOC_ALPHA_TPREL16,
+
+/* Bits 27..2 of the relocation address shifted right 2 bits;
+simple reloc otherwise.  */
+  BFD_RELOC_MIPS_JMP,
+
+/* The MIPS16 jump instruction.  */
+  BFD_RELOC_MIPS16_JMP,
+
+/* MIPS16 GP relative reloc.  */
+  BFD_RELOC_MIPS16_GPREL,
+
+/* High 16 bits of 32-bit value; simple reloc.  */
+  BFD_RELOC_HI16,
+
+/* High 16 bits of 32-bit value but the low 16 bits will be sign
+extended and added to form the final result.  If the low 16
+bits form a negative number, we need to add one to the high value
+to compensate for the borrow when the low bits are added.  */
+  BFD_RELOC_HI16_S,
+
+/* Low 16 bits.  */
+  BFD_RELOC_LO16,
+
+/* High 16 bits of 32-bit pc-relative value  */
+  BFD_RELOC_HI16_PCREL,
+
+/* High 16 bits of 32-bit pc-relative value, adjusted  */
+  BFD_RELOC_HI16_S_PCREL,
+
+/* Low 16 bits of pc-relative value  */
+  BFD_RELOC_LO16_PCREL,
+
+/* MIPS16 high 16 bits of 32-bit value.  */
+  BFD_RELOC_MIPS16_HI16,
+
+/* MIPS16 high 16 bits of 32-bit value but the low 16 bits will be sign
+extended and added to form the final result.  If the low 16
+bits form a negative number, we need to add one to the high value
+to compensate for the borrow when the low bits are added.  */
+  BFD_RELOC_MIPS16_HI16_S,
+
+/* MIPS16 low 16 bits.  */
+  BFD_RELOC_MIPS16_LO16,
+
+/* Relocation against a MIPS literal section.  */
+  BFD_RELOC_MIPS_LITERAL,
+
+/* MIPS ELF relocations.  */
+  BFD_RELOC_MIPS_GOT16,
+  BFD_RELOC_MIPS_CALL16,
+  BFD_RELOC_MIPS_GOT_HI16,
+  BFD_RELOC_MIPS_GOT_LO16,
+  BFD_RELOC_MIPS_CALL_HI16,
+  BFD_RELOC_MIPS_CALL_LO16,
+  BFD_RELOC_MIPS_SUB,
+  BFD_RELOC_MIPS_GOT_PAGE,
+  BFD_RELOC_MIPS_GOT_OFST,
+  BFD_RELOC_MIPS_GOT_DISP,
+  BFD_RELOC_MIPS_SHIFT5,
+  BFD_RELOC_MIPS_SHIFT6,
+  BFD_RELOC_MIPS_INSERT_A,
+  BFD_RELOC_MIPS_INSERT_B,
+  BFD_RELOC_MIPS_DELETE,
+  BFD_RELOC_MIPS_HIGHEST,
+  BFD_RELOC_MIPS_HIGHER,
+  BFD_RELOC_MIPS_SCN_DISP,
+  BFD_RELOC_MIPS_REL16,
+  BFD_RELOC_MIPS_RELGOT,
+  BFD_RELOC_MIPS_JALR,
+  BFD_RELOC_MIPS_TLS_DTPMOD32,
+  BFD_RELOC_MIPS_TLS_DTPREL32,
+  BFD_RELOC_MIPS_TLS_DTPMOD64,
+  BFD_RELOC_MIPS_TLS_DTPREL64,
+  BFD_RELOC_MIPS_TLS_GD,
+  BFD_RELOC_MIPS_TLS_LDM,
+  BFD_RELOC_MIPS_TLS_DTPREL_HI16,
+  BFD_RELOC_MIPS_TLS_DTPREL_LO16,
+  BFD_RELOC_MIPS_TLS_GOTTPREL,
+  BFD_RELOC_MIPS_TLS_TPREL32,
+  BFD_RELOC_MIPS_TLS_TPREL64,
+  BFD_RELOC_MIPS_TLS_TPREL_HI16,
+  BFD_RELOC_MIPS_TLS_TPREL_LO16,
+
+
+/* MIPS ELF relocations (VxWorks extensions).  */
+  BFD_RELOC_MIPS_COPY,
+  BFD_RELOC_MIPS_JUMP_SLOT,
+
+
+/* Fujitsu Frv Relocations.  */
+  BFD_RELOC_FRV_LABEL16,
+  BFD_RELOC_FRV_LABEL24,
+  BFD_RELOC_FRV_LO16,
+  BFD_RELOC_FRV_HI16,
+  BFD_RELOC_FRV_GPREL12,
+  BFD_RELOC_FRV_GPRELU12,
+  BFD_RELOC_FRV_GPREL32,
+  BFD_RELOC_FRV_GPRELHI,
+  BFD_RELOC_FRV_GPRELLO,
+  BFD_RELOC_FRV_GOT12,
+  BFD_RELOC_FRV_GOTHI,
+  BFD_RELOC_FRV_GOTLO,
+  BFD_RELOC_FRV_FUNCDESC,
+  BFD_RELOC_FRV_FUNCDESC_GOT12,
+  BFD_RELOC_FRV_FUNCDESC_GOTHI,
+  BFD_RELOC_FRV_FUNCDESC_GOTLO,
+  BFD_RELOC_FRV_FUNCDESC_VALUE,
+  BFD_RELOC_FRV_FUNCDESC_GOTOFF12,
+  BFD_RELOC_FRV_FUNCDESC_GOTOFFHI,
+  BFD_RELOC_FRV_FUNCDESC_GOTOFFLO,
+  BFD_RELOC_FRV_GOTOFF12,
+  BFD_RELOC_FRV_GOTOFFHI,
+  BFD_RELOC_FRV_GOTOFFLO,
+  BFD_RELOC_FRV_GETTLSOFF,
+  BFD_RELOC_FRV_TLSDESC_VALUE,
+  BFD_RELOC_FRV_GOTTLSDESC12,
+  BFD_RELOC_FRV_GOTTLSDESCHI,
+  BFD_RELOC_FRV_GOTTLSDESCLO,
+  BFD_RELOC_FRV_TLSMOFF12,
+  BFD_RELOC_FRV_TLSMOFFHI,
+  BFD_RELOC_FRV_TLSMOFFLO,
+  BFD_RELOC_FRV_GOTTLSOFF12,
+  BFD_RELOC_FRV_GOTTLSOFFHI,
+  BFD_RELOC_FRV_GOTTLSOFFLO,
+  BFD_RELOC_FRV_TLSOFF,
+  BFD_RELOC_FRV_TLSDESC_RELAX,
+  BFD_RELOC_FRV_GETTLSOFF_RELAX,
+  BFD_RELOC_FRV_TLSOFF_RELAX,
+  BFD_RELOC_FRV_TLSMOFF,
+
+
+/* This is a 24bit GOT-relative reloc for the mn10300.  */
+  BFD_RELOC_MN10300_GOTOFF24,
+
+/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes
+in the instruction.  */
+  BFD_RELOC_MN10300_GOT32,
+
+/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes
+in the instruction.  */
+  BFD_RELOC_MN10300_GOT24,
+
+/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes
+in the instruction.  */
+  BFD_RELOC_MN10300_GOT16,
+
+/* Copy symbol at runtime.  */
+  BFD_RELOC_MN10300_COPY,
+
+/* Create GOT entry.  */
+  BFD_RELOC_MN10300_GLOB_DAT,
+
+/* Create PLT entry.  */
+  BFD_RELOC_MN10300_JMP_SLOT,
+
+/* Adjust by program base.  */
+  BFD_RELOC_MN10300_RELATIVE,
+
+
+/* i386/elf relocations  */
+  BFD_RELOC_386_GOT32,
+  BFD_RELOC_386_PLT32,
+  BFD_RELOC_386_COPY,
+  BFD_RELOC_386_GLOB_DAT,
+  BFD_RELOC_386_JUMP_SLOT,
+  BFD_RELOC_386_RELATIVE,
+  BFD_RELOC_386_GOTOFF,
+  BFD_RELOC_386_GOTPC,
+  BFD_RELOC_386_TLS_TPOFF,
+  BFD_RELOC_386_TLS_IE,
+  BFD_RELOC_386_TLS_GOTIE,
+  BFD_RELOC_386_TLS_LE,
+  BFD_RELOC_386_TLS_GD,
+  BFD_RELOC_386_TLS_LDM,
+  BFD_RELOC_386_TLS_LDO_32,
+  BFD_RELOC_386_TLS_IE_32,
+  BFD_RELOC_386_TLS_LE_32,
+  BFD_RELOC_386_TLS_DTPMOD32,
+  BFD_RELOC_386_TLS_DTPOFF32,
+  BFD_RELOC_386_TLS_TPOFF32,
+  BFD_RELOC_386_TLS_GOTDESC,
+  BFD_RELOC_386_TLS_DESC_CALL,
+  BFD_RELOC_386_TLS_DESC,
+
+/* x86-64/elf relocations  */
+  BFD_RELOC_X86_64_GOT32,
+  BFD_RELOC_X86_64_PLT32,
+  BFD_RELOC_X86_64_COPY,
+  BFD_RELOC_X86_64_GLOB_DAT,
+  BFD_RELOC_X86_64_JUMP_SLOT,
+  BFD_RELOC_X86_64_RELATIVE,
+  BFD_RELOC_X86_64_GOTPCREL,
+  BFD_RELOC_X86_64_32S,
+  BFD_RELOC_X86_64_DTPMOD64,
+  BFD_RELOC_X86_64_DTPOFF64,
+  BFD_RELOC_X86_64_TPOFF64,
+  BFD_RELOC_X86_64_TLSGD,
+  BFD_RELOC_X86_64_TLSLD,
+  BFD_RELOC_X86_64_DTPOFF32,
+  BFD_RELOC_X86_64_GOTTPOFF,
+  BFD_RELOC_X86_64_TPOFF32,
+  BFD_RELOC_X86_64_GOTOFF64,
+  BFD_RELOC_X86_64_GOTPC32,
+  BFD_RELOC_X86_64_GOT64,
+  BFD_RELOC_X86_64_GOTPCREL64,
+  BFD_RELOC_X86_64_GOTPC64,
+  BFD_RELOC_X86_64_GOTPLT64,
+  BFD_RELOC_X86_64_PLTOFF64,
+  BFD_RELOC_X86_64_GOTPC32_TLSDESC,
+  BFD_RELOC_X86_64_TLSDESC_CALL,
+  BFD_RELOC_X86_64_TLSDESC,
+
+/* ns32k relocations  */
+  BFD_RELOC_NS32K_IMM_8,
+  BFD_RELOC_NS32K_IMM_16,
+  BFD_RELOC_NS32K_IMM_32,
+  BFD_RELOC_NS32K_IMM_8_PCREL,
+  BFD_RELOC_NS32K_IMM_16_PCREL,
+  BFD_RELOC_NS32K_IMM_32_PCREL,
+  BFD_RELOC_NS32K_DISP_8,
+  BFD_RELOC_NS32K_DISP_16,
+  BFD_RELOC_NS32K_DISP_32,
+  BFD_RELOC_NS32K_DISP_8_PCREL,
+  BFD_RELOC_NS32K_DISP_16_PCREL,
+  BFD_RELOC_NS32K_DISP_32_PCREL,
+
+/* PDP11 relocations  */
+  BFD_RELOC_PDP11_DISP_8_PCREL,
+  BFD_RELOC_PDP11_DISP_6_PCREL,
+
+/* Picojava relocs.  Not all of these appear in object files.  */
+  BFD_RELOC_PJ_CODE_HI16,
+  BFD_RELOC_PJ_CODE_LO16,
+  BFD_RELOC_PJ_CODE_DIR16,
+  BFD_RELOC_PJ_CODE_DIR32,
+  BFD_RELOC_PJ_CODE_REL16,
+  BFD_RELOC_PJ_CODE_REL32,
+
+/* Power(rs6000) and PowerPC relocations.  */
+  BFD_RELOC_PPC_B26,
+  BFD_RELOC_PPC_BA26,
+  BFD_RELOC_PPC_TOC16,
+  BFD_RELOC_PPC_B16,
+  BFD_RELOC_PPC_B16_BRTAKEN,
+  BFD_RELOC_PPC_B16_BRNTAKEN,
+  BFD_RELOC_PPC_BA16,
+  BFD_RELOC_PPC_BA16_BRTAKEN,
+  BFD_RELOC_PPC_BA16_BRNTAKEN,
+  BFD_RELOC_PPC_COPY,
+  BFD_RELOC_PPC_GLOB_DAT,
+  BFD_RELOC_PPC_JMP_SLOT,
+  BFD_RELOC_PPC_RELATIVE,
+  BFD_RELOC_PPC_LOCAL24PC,
+  BFD_RELOC_PPC_EMB_NADDR32,
+  BFD_RELOC_PPC_EMB_NADDR16,
+  BFD_RELOC_PPC_EMB_NADDR16_LO,
+  BFD_RELOC_PPC_EMB_NADDR16_HI,
+  BFD_RELOC_PPC_EMB_NADDR16_HA,
+  BFD_RELOC_PPC_EMB_SDAI16,
+  BFD_RELOC_PPC_EMB_SDA2I16,
+  BFD_RELOC_PPC_EMB_SDA2REL,
+  BFD_RELOC_PPC_EMB_SDA21,
+  BFD_RELOC_PPC_EMB_MRKREF,
+  BFD_RELOC_PPC_EMB_RELSEC16,
+  BFD_RELOC_PPC_EMB_RELST_LO,
+  BFD_RELOC_PPC_EMB_RELST_HI,
+  BFD_RELOC_PPC_EMB_RELST_HA,
+  BFD_RELOC_PPC_EMB_BIT_FLD,
+  BFD_RELOC_PPC_EMB_RELSDA,
+  BFD_RELOC_PPC64_HIGHER,
+  BFD_RELOC_PPC64_HIGHER_S,
+  BFD_RELOC_PPC64_HIGHEST,
+  BFD_RELOC_PPC64_HIGHEST_S,
+  BFD_RELOC_PPC64_TOC16_LO,
+  BFD_RELOC_PPC64_TOC16_HI,
+  BFD_RELOC_PPC64_TOC16_HA,
+  BFD_RELOC_PPC64_TOC,
+  BFD_RELOC_PPC64_PLTGOT16,
+  BFD_RELOC_PPC64_PLTGOT16_LO,
+  BFD_RELOC_PPC64_PLTGOT16_HI,
+  BFD_RELOC_PPC64_PLTGOT16_HA,
+  BFD_RELOC_PPC64_ADDR16_DS,
+  BFD_RELOC_PPC64_ADDR16_LO_DS,
+  BFD_RELOC_PPC64_GOT16_DS,
+  BFD_RELOC_PPC64_GOT16_LO_DS,
+  BFD_RELOC_PPC64_PLT16_LO_DS,
+  BFD_RELOC_PPC64_SECTOFF_DS,
+  BFD_RELOC_PPC64_SECTOFF_LO_DS,
+  BFD_RELOC_PPC64_TOC16_DS,
+  BFD_RELOC_PPC64_TOC16_LO_DS,
+  BFD_RELOC_PPC64_PLTGOT16_DS,
+  BFD_RELOC_PPC64_PLTGOT16_LO_DS,
+
+/* PowerPC and PowerPC64 thread-local storage relocations.  */
+  BFD_RELOC_PPC_TLS,
+  BFD_RELOC_PPC_DTPMOD,
+  BFD_RELOC_PPC_TPREL16,
+  BFD_RELOC_PPC_TPREL16_LO,
+  BFD_RELOC_PPC_TPREL16_HI,
+  BFD_RELOC_PPC_TPREL16_HA,
+  BFD_RELOC_PPC_TPREL,
+  BFD_RELOC_PPC_DTPREL16,
+  BFD_RELOC_PPC_DTPREL16_LO,
+  BFD_RELOC_PPC_DTPREL16_HI,
+  BFD_RELOC_PPC_DTPREL16_HA,
+  BFD_RELOC_PPC_DTPREL,
+  BFD_RELOC_PPC_GOT_TLSGD16,
+  BFD_RELOC_PPC_GOT_TLSGD16_LO,
+  BFD_RELOC_PPC_GOT_TLSGD16_HI,
+  BFD_RELOC_PPC_GOT_TLSGD16_HA,
+  BFD_RELOC_PPC_GOT_TLSLD16,
+  BFD_RELOC_PPC_GOT_TLSLD16_LO,
+  BFD_RELOC_PPC_GOT_TLSLD16_HI,
+  BFD_RELOC_PPC_GOT_TLSLD16_HA,
+  BFD_RELOC_PPC_GOT_TPREL16,
+  BFD_RELOC_PPC_GOT_TPREL16_LO,
+  BFD_RELOC_PPC_GOT_TPREL16_HI,
+  BFD_RELOC_PPC_GOT_TPREL16_HA,
+  BFD_RELOC_PPC_GOT_DTPREL16,
+  BFD_RELOC_PPC_GOT_DTPREL16_LO,
+  BFD_RELOC_PPC_GOT_DTPREL16_HI,
+  BFD_RELOC_PPC_GOT_DTPREL16_HA,
+  BFD_RELOC_PPC64_TPREL16_DS,
+  BFD_RELOC_PPC64_TPREL16_LO_DS,
+  BFD_RELOC_PPC64_TPREL16_HIGHER,
+  BFD_RELOC_PPC64_TPREL16_HIGHERA,
+  BFD_RELOC_PPC64_TPREL16_HIGHEST,
+  BFD_RELOC_PPC64_TPREL16_HIGHESTA,
+  BFD_RELOC_PPC64_DTPREL16_DS,
+  BFD_RELOC_PPC64_DTPREL16_LO_DS,
+  BFD_RELOC_PPC64_DTPREL16_HIGHER,
+  BFD_RELOC_PPC64_DTPREL16_HIGHERA,
+  BFD_RELOC_PPC64_DTPREL16_HIGHEST,
+  BFD_RELOC_PPC64_DTPREL16_HIGHESTA,
+
+/* IBM 370/390 relocations  */
+  BFD_RELOC_I370_D12,
+
+/* The type of reloc used to build a constructor table - at the moment
+probably a 32 bit wide absolute relocation, but the target can choose.
+It generally does map to one of the other relocation types.  */
+  BFD_RELOC_CTOR,
+
+/* ARM 26 bit pc-relative branch.  The lowest two bits must be zero and are
+not stored in the instruction.  */
+  BFD_RELOC_ARM_PCREL_BRANCH,
+
+/* ARM 26 bit pc-relative branch.  The lowest bit must be zero and is
+not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
+field in the instruction.  */
+  BFD_RELOC_ARM_PCREL_BLX,
+
+/* Thumb 22 bit pc-relative branch.  The lowest bit must be zero and is
+not stored in the instruction.  The 2nd lowest bit comes from a 1 bit
+field in the instruction.  */
+  BFD_RELOC_THUMB_PCREL_BLX,
+
+/* ARM 26-bit pc-relative branch for an unconditional BL or BLX instruction.  */
+  BFD_RELOC_ARM_PCREL_CALL,
+
+/* ARM 26-bit pc-relative branch for B or conditional BL instruction.  */
+  BFD_RELOC_ARM_PCREL_JUMP,
+
+/* Thumb 7-, 9-, 12-, 20-, 23-, and 25-bit pc-relative branches.
+The lowest bit must be zero and is not stored in the instruction.
+Note that the corresponding ELF R_ARM_THM_JUMPnn constant has an
+"nn" one smaller in all cases.  Note further that BRANCH23
+corresponds to R_ARM_THM_CALL.  */
+  BFD_RELOC_THUMB_PCREL_BRANCH7,
+  BFD_RELOC_THUMB_PCREL_BRANCH9,
+  BFD_RELOC_THUMB_PCREL_BRANCH12,
+  BFD_RELOC_THUMB_PCREL_BRANCH20,
+  BFD_RELOC_THUMB_PCREL_BRANCH23,
+  BFD_RELOC_THUMB_PCREL_BRANCH25,
+
+/* 12-bit immediate offset, used in ARM-format ldr and str instructions.  */
+  BFD_RELOC_ARM_OFFSET_IMM,
+
+/* 5-bit immediate offset, used in Thumb-format ldr and str instructions.  */
+  BFD_RELOC_ARM_THUMB_OFFSET,
+
+/* Pc-relative or absolute relocation depending on target.  Used for
+entries in .init_array sections.  */
+  BFD_RELOC_ARM_TARGET1,
+
+/* Read-only segment base relative address.  */
+  BFD_RELOC_ARM_ROSEGREL32,
+
+/* Data segment base relative address.  */
+  BFD_RELOC_ARM_SBREL32,
+
+/* This reloc is used for references to RTTI data from exception handling
+tables.  The actual definition depends on the target.  It may be a
+pc-relative or some form of GOT-indirect relocation.  */
+  BFD_RELOC_ARM_TARGET2,
+
+/* 31-bit PC relative address.  */
+  BFD_RELOC_ARM_PREL31,
+
+/* Low and High halfword relocations for MOVW and MOVT instructions.  */
+  BFD_RELOC_ARM_MOVW,
+  BFD_RELOC_ARM_MOVT,
+  BFD_RELOC_ARM_MOVW_PCREL,
+  BFD_RELOC_ARM_MOVT_PCREL,
+  BFD_RELOC_ARM_THUMB_MOVW,
+  BFD_RELOC_ARM_THUMB_MOVT,
+  BFD_RELOC_ARM_THUMB_MOVW_PCREL,
+  BFD_RELOC_ARM_THUMB_MOVT_PCREL,
+
+/* Relocations for setting up GOTs and PLTs for shared libraries.  */
+  BFD_RELOC_ARM_JUMP_SLOT,
+  BFD_RELOC_ARM_GLOB_DAT,
+  BFD_RELOC_ARM_GOT32,
+  BFD_RELOC_ARM_PLT32,
+  BFD_RELOC_ARM_RELATIVE,
+  BFD_RELOC_ARM_GOTOFF,
+  BFD_RELOC_ARM_GOTPC,
+
+/* ARM thread-local storage relocations.  */
+  BFD_RELOC_ARM_TLS_GD32,
+  BFD_RELOC_ARM_TLS_LDO32,
+  BFD_RELOC_ARM_TLS_LDM32,
+  BFD_RELOC_ARM_TLS_DTPOFF32,
+  BFD_RELOC_ARM_TLS_DTPMOD32,
+  BFD_RELOC_ARM_TLS_TPOFF32,
+  BFD_RELOC_ARM_TLS_IE32,
+  BFD_RELOC_ARM_TLS_LE32,
+
+/* ARM group relocations.  */
+  BFD_RELOC_ARM_ALU_PC_G0_NC,
+  BFD_RELOC_ARM_ALU_PC_G0,
+  BFD_RELOC_ARM_ALU_PC_G1_NC,
+  BFD_RELOC_ARM_ALU_PC_G1,
+  BFD_RELOC_ARM_ALU_PC_G2,
+  BFD_RELOC_ARM_LDR_PC_G0,
+  BFD_RELOC_ARM_LDR_PC_G1,
+  BFD_RELOC_ARM_LDR_PC_G2,
+  BFD_RELOC_ARM_LDRS_PC_G0,
+  BFD_RELOC_ARM_LDRS_PC_G1,
+  BFD_RELOC_ARM_LDRS_PC_G2,
+  BFD_RELOC_ARM_LDC_PC_G0,
+  BFD_RELOC_ARM_LDC_PC_G1,
+  BFD_RELOC_ARM_LDC_PC_G2,
+  BFD_RELOC_ARM_ALU_SB_G0_NC,
+  BFD_RELOC_ARM_ALU_SB_G0,
+  BFD_RELOC_ARM_ALU_SB_G1_NC,
+  BFD_RELOC_ARM_ALU_SB_G1,
+  BFD_RELOC_ARM_ALU_SB_G2,
+  BFD_RELOC_ARM_LDR_SB_G0,
+  BFD_RELOC_ARM_LDR_SB_G1,
+  BFD_RELOC_ARM_LDR_SB_G2,
+  BFD_RELOC_ARM_LDRS_SB_G0,
+  BFD_RELOC_ARM_LDRS_SB_G1,
+  BFD_RELOC_ARM_LDRS_SB_G2,
+  BFD_RELOC_ARM_LDC_SB_G0,
+  BFD_RELOC_ARM_LDC_SB_G1,
+  BFD_RELOC_ARM_LDC_SB_G2,
+
+/* These relocs are only used within the ARM assembler.  They are not
+(at present) written to any object files.  */
+  BFD_RELOC_ARM_IMMEDIATE,
+  BFD_RELOC_ARM_ADRL_IMMEDIATE,
+  BFD_RELOC_ARM_T32_IMMEDIATE,
+  BFD_RELOC_ARM_T32_ADD_IMM,
+  BFD_RELOC_ARM_T32_IMM12,
+  BFD_RELOC_ARM_T32_ADD_PC12,
+  BFD_RELOC_ARM_SHIFT_IMM,
+  BFD_RELOC_ARM_SMC,
+  BFD_RELOC_ARM_SWI,
+  BFD_RELOC_ARM_MULTI,
+  BFD_RELOC_ARM_CP_OFF_IMM,
+  BFD_RELOC_ARM_CP_OFF_IMM_S2,
+  BFD_RELOC_ARM_T32_CP_OFF_IMM,
+  BFD_RELOC_ARM_T32_CP_OFF_IMM_S2,
+  BFD_RELOC_ARM_ADR_IMM,
+  BFD_RELOC_ARM_LDR_IMM,
+  BFD_RELOC_ARM_LITERAL,
+  BFD_RELOC_ARM_IN_POOL,
+  BFD_RELOC_ARM_OFFSET_IMM8,
+  BFD_RELOC_ARM_T32_OFFSET_U8,
+  BFD_RELOC_ARM_T32_OFFSET_IMM,
+  BFD_RELOC_ARM_HWLITERAL,
+  BFD_RELOC_ARM_THUMB_ADD,
+  BFD_RELOC_ARM_THUMB_IMM,
+  BFD_RELOC_ARM_THUMB_SHIFT,
+
+/* Renesas / SuperH SH relocs.  Not all of these appear in object files.  */
+  BFD_RELOC_SH_PCDISP8BY2,
+  BFD_RELOC_SH_PCDISP12BY2,
+  BFD_RELOC_SH_IMM3,
+  BFD_RELOC_SH_IMM3U,
+  BFD_RELOC_SH_DISP12,
+  BFD_RELOC_SH_DISP12BY2,
+  BFD_RELOC_SH_DISP12BY4,
+  BFD_RELOC_SH_DISP12BY8,
+  BFD_RELOC_SH_DISP20,
+  BFD_RELOC_SH_DISP20BY8,
+  BFD_RELOC_SH_IMM4,
+  BFD_RELOC_SH_IMM4BY2,
+  BFD_RELOC_SH_IMM4BY4,
+  BFD_RELOC_SH_IMM8,
+  BFD_RELOC_SH_IMM8BY2,
+  BFD_RELOC_SH_IMM8BY4,
+  BFD_RELOC_SH_PCRELIMM8BY2,
+  BFD_RELOC_SH_PCRELIMM8BY4,
+  BFD_RELOC_SH_SWITCH16,
+  BFD_RELOC_SH_SWITCH32,
+  BFD_RELOC_SH_USES,
+  BFD_RELOC_SH_COUNT,
+  BFD_RELOC_SH_ALIGN,
+  BFD_RELOC_SH_CODE,
+  BFD_RELOC_SH_DATA,
+  BFD_RELOC_SH_LABEL,
+  BFD_RELOC_SH_LOOP_START,
+  BFD_RELOC_SH_LOOP_END,
+  BFD_RELOC_SH_COPY,
+  BFD_RELOC_SH_GLOB_DAT,
+  BFD_RELOC_SH_JMP_SLOT,
+  BFD_RELOC_SH_RELATIVE,
+  BFD_RELOC_SH_GOTPC,
+  BFD_RELOC_SH_GOT_LOW16,
+  BFD_RELOC_SH_GOT_MEDLOW16,
+  BFD_RELOC_SH_GOT_MEDHI16,
+  BFD_RELOC_SH_GOT_HI16,
+  BFD_RELOC_SH_GOTPLT_LOW16,
+  BFD_RELOC_SH_GOTPLT_MEDLOW16,
+  BFD_RELOC_SH_GOTPLT_MEDHI16,
+  BFD_RELOC_SH_GOTPLT_HI16,
+  BFD_RELOC_SH_PLT_LOW16,
+  BFD_RELOC_SH_PLT_MEDLOW16,
+  BFD_RELOC_SH_PLT_MEDHI16,
+  BFD_RELOC_SH_PLT_HI16,
+  BFD_RELOC_SH_GOTOFF_LOW16,
+  BFD_RELOC_SH_GOTOFF_MEDLOW16,
+  BFD_RELOC_SH_GOTOFF_MEDHI16,
+  BFD_RELOC_SH_GOTOFF_HI16,
+  BFD_RELOC_SH_GOTPC_LOW16,
+  BFD_RELOC_SH_GOTPC_MEDLOW16,
+  BFD_RELOC_SH_GOTPC_MEDHI16,
+  BFD_RELOC_SH_GOTPC_HI16,
+  BFD_RELOC_SH_COPY64,
+  BFD_RELOC_SH_GLOB_DAT64,
+  BFD_RELOC_SH_JMP_SLOT64,
+  BFD_RELOC_SH_RELATIVE64,
+  BFD_RELOC_SH_GOT10BY4,
+  BFD_RELOC_SH_GOT10BY8,
+  BFD_RELOC_SH_GOTPLT10BY4,
+  BFD_RELOC_SH_GOTPLT10BY8,
+  BFD_RELOC_SH_GOTPLT32,
+  BFD_RELOC_SH_SHMEDIA_CODE,
+  BFD_RELOC_SH_IMMU5,
+  BFD_RELOC_SH_IMMS6,
+  BFD_RELOC_SH_IMMS6BY32,
+  BFD_RELOC_SH_IMMU6,
+  BFD_RELOC_SH_IMMS10,
+  BFD_RELOC_SH_IMMS10BY2,
+  BFD_RELOC_SH_IMMS10BY4,
+  BFD_RELOC_SH_IMMS10BY8,
+  BFD_RELOC_SH_IMMS16,
+  BFD_RELOC_SH_IMMU16,
+  BFD_RELOC_SH_IMM_LOW16,
+  BFD_RELOC_SH_IMM_LOW16_PCREL,
+  BFD_RELOC_SH_IMM_MEDLOW16,
+  BFD_RELOC_SH_IMM_MEDLOW16_PCREL,
+  BFD_RELOC_SH_IMM_MEDHI16,
+  BFD_RELOC_SH_IMM_MEDHI16_PCREL,
+  BFD_RELOC_SH_IMM_HI16,
+  BFD_RELOC_SH_IMM_HI16_PCREL,
+  BFD_RELOC_SH_PT_16,
+  BFD_RELOC_SH_TLS_GD_32,
+  BFD_RELOC_SH_TLS_LD_32,
+  BFD_RELOC_SH_TLS_LDO_32,
+  BFD_RELOC_SH_TLS_IE_32,
+  BFD_RELOC_SH_TLS_LE_32,
+  BFD_RELOC_SH_TLS_DTPMOD32,
+  BFD_RELOC_SH_TLS_DTPOFF32,
+  BFD_RELOC_SH_TLS_TPOFF32,
+
+/* ARC Cores relocs.
+ARC 22 bit pc-relative branch.  The lowest two bits must be zero and are
+not stored in the instruction.  The high 20 bits are installed in bits 26
+through 7 of the instruction.  */
+  BFD_RELOC_ARC_B22_PCREL,
+
+/* ARC 26 bit absolute branch.  The lowest two bits must be zero and are not
+stored in the instruction.  The high 24 bits are installed in bits 23
+through 0.  */
+  BFD_RELOC_ARC_B26,
+
+/* ADI Blackfin 16 bit immediate absolute reloc.  */
+  BFD_RELOC_BFIN_16_IMM,
+
+/* ADI Blackfin 16 bit immediate absolute reloc higher 16 bits.  */
+  BFD_RELOC_BFIN_16_HIGH,
+
+/* ADI Blackfin 'a' part of LSETUP.  */
+  BFD_RELOC_BFIN_4_PCREL,
+
+/* ADI Blackfin.  */
+  BFD_RELOC_BFIN_5_PCREL,
+
+/* ADI Blackfin 16 bit immediate absolute reloc lower 16 bits.  */
+  BFD_RELOC_BFIN_16_LOW,
+
+/* ADI Blackfin.  */
+  BFD_RELOC_BFIN_10_PCREL,
+
+/* ADI Blackfin 'b' part of LSETUP.  */
+  BFD_RELOC_BFIN_11_PCREL,
+
+/* ADI Blackfin.  */
+  BFD_RELOC_BFIN_12_PCREL_JUMP,
+
+/* ADI Blackfin Short jump, pcrel.  */
+  BFD_RELOC_BFIN_12_PCREL_JUMP_S,
+
+/* ADI Blackfin Call.x not implemented.  */
+  BFD_RELOC_BFIN_24_PCREL_CALL_X,
+
+/* ADI Blackfin Long Jump pcrel.  */
+  BFD_RELOC_BFIN_24_PCREL_JUMP_L,
+
+/* ADI Blackfin FD-PIC relocations.  */
+  BFD_RELOC_BFIN_GOT17M4,
+  BFD_RELOC_BFIN_GOTHI,
+  BFD_RELOC_BFIN_GOTLO,
+  BFD_RELOC_BFIN_FUNCDESC,
+  BFD_RELOC_BFIN_FUNCDESC_GOT17M4,
+  BFD_RELOC_BFIN_FUNCDESC_GOTHI,
+  BFD_RELOC_BFIN_FUNCDESC_GOTLO,
+  BFD_RELOC_BFIN_FUNCDESC_VALUE,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
+  BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO,
+  BFD_RELOC_BFIN_GOTOFF17M4,
+  BFD_RELOC_BFIN_GOTOFFHI,
+  BFD_RELOC_BFIN_GOTOFFLO,
+
+/* ADI Blackfin GOT relocation.  */
+  BFD_RELOC_BFIN_GOT,
+
+/* ADI Blackfin PLTPC relocation.  */
+  BFD_RELOC_BFIN_PLTPC,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_PUSH,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_CONST,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_ADD,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_SUB,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_MULT,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_DIV,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_MOD,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_LSHIFT,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_RSHIFT,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_AND,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_OR,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_XOR,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_LAND,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_LOR,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_LEN,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_NEG,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_COMP,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_PAGE,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_HWPAGE,
+
+/* ADI Blackfin arithmetic relocation.  */
+  BFD_ARELOC_BFIN_ADDR,
+
+/* Mitsubishi D10V relocs.
+This is a 10-bit reloc with the right 2 bits
+assumed to be 0.  */
+  BFD_RELOC_D10V_10_PCREL_R,
+
+/* Mitsubishi D10V relocs.
+This is a 10-bit reloc with the right 2 bits
+assumed to be 0.  This is the same as the previous reloc
+except it is in the left container, i.e.,
+shifted left 15 bits.  */
+  BFD_RELOC_D10V_10_PCREL_L,
+
+/* This is an 18-bit reloc with the right 2 bits
+assumed to be 0.  */
+  BFD_RELOC_D10V_18,
+
+/* This is an 18-bit reloc with the right 2 bits
+assumed to be 0.  */
+  BFD_RELOC_D10V_18_PCREL,
+
+/* Mitsubishi D30V relocs.
+This is a 6-bit absolute reloc.  */
+  BFD_RELOC_D30V_6,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0.  */
+  BFD_RELOC_D30V_9_PCREL,
+
+/* This is a 6-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container.  */
+  BFD_RELOC_D30V_9_PCREL_R,
+
+/* This is a 12-bit absolute reloc with the
+right 3 bitsassumed to be 0.  */
+  BFD_RELOC_D30V_15,
+
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0.  */
+  BFD_RELOC_D30V_15_PCREL,
+
+/* This is a 12-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container.  */
+  BFD_RELOC_D30V_15_PCREL_R,
+
+/* This is an 18-bit absolute reloc with
+the right 3 bits assumed to be 0.  */
+  BFD_RELOC_D30V_21,
+
+/* This is an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0.  */
+  BFD_RELOC_D30V_21_PCREL,
+
+/* This is an 18-bit pc-relative reloc with
+the right 3 bits assumed to be 0. Same
+as the previous reloc but on the right side
+of the container.  */
+  BFD_RELOC_D30V_21_PCREL_R,
+
+/* This is a 32-bit absolute reloc.  */
+  BFD_RELOC_D30V_32,
+
+/* This is a 32-bit pc-relative reloc.  */
+  BFD_RELOC_D30V_32_PCREL,
+
+/* DLX relocs  */
+  BFD_RELOC_DLX_HI16_S,
+
+/* DLX relocs  */
+  BFD_RELOC_DLX_LO16,
+
+/* DLX relocs  */
+  BFD_RELOC_DLX_JMP26,
+
+/* Renesas M16C/M32C Relocations.  */
+  BFD_RELOC_M32C_HI8,
+  BFD_RELOC_M32C_RL_JUMP,
+  BFD_RELOC_M32C_RL_1ADDR,
+  BFD_RELOC_M32C_RL_2ADDR,
+
+/* Renesas M32R (formerly Mitsubishi M32R) relocs.
+This is a 24 bit absolute address.  */
+  BFD_RELOC_M32R_24,
+
+/* This is a 10-bit pc-relative reloc with the right 2 bits assumed to be 0.  */
+  BFD_RELOC_M32R_10_PCREL,
+
+/* This is an 18-bit reloc with the right 2 bits assumed to be 0.  */
+  BFD_RELOC_M32R_18_PCREL,
+
+/* This is a 26-bit reloc with the right 2 bits assumed to be 0.  */
+  BFD_RELOC_M32R_26_PCREL,
+
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as unsigned.  */
+  BFD_RELOC_M32R_HI16_ULO,
+
+/* This is a 16-bit reloc containing the high 16 bits of an address
+used when the lower 16 bits are treated as signed.  */
+  BFD_RELOC_M32R_HI16_SLO,
+
+/* This is a 16-bit reloc containing the lower 16 bits of an address.  */
+  BFD_RELOC_M32R_LO16,
+
+/* This is a 16-bit reloc containing the small data area offset for use in
+add3, load, and store instructions.  */
+  BFD_RELOC_M32R_SDA16,
+
+/* For PIC.  */
+  BFD_RELOC_M32R_GOT24,
+  BFD_RELOC_M32R_26_PLTREL,
+  BFD_RELOC_M32R_COPY,
+  BFD_RELOC_M32R_GLOB_DAT,
+  BFD_RELOC_M32R_JMP_SLOT,
+  BFD_RELOC_M32R_RELATIVE,
+  BFD_RELOC_M32R_GOTOFF,
+  BFD_RELOC_M32R_GOTOFF_HI_ULO,
+  BFD_RELOC_M32R_GOTOFF_HI_SLO,
+  BFD_RELOC_M32R_GOTOFF_LO,
+  BFD_RELOC_M32R_GOTPC24,
+  BFD_RELOC_M32R_GOT16_HI_ULO,
+  BFD_RELOC_M32R_GOT16_HI_SLO,
+  BFD_RELOC_M32R_GOT16_LO,
+  BFD_RELOC_M32R_GOTPC_HI_ULO,
+  BFD_RELOC_M32R_GOTPC_HI_SLO,
+  BFD_RELOC_M32R_GOTPC_LO,
+
+/* This is a 9-bit reloc  */
+  BFD_RELOC_V850_9_PCREL,
+
+/* This is a 22-bit reloc  */
+  BFD_RELOC_V850_22_PCREL,
+
+/* This is a 16 bit offset from the short data area pointer.  */
+  BFD_RELOC_V850_SDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+short data area pointer.  */
+  BFD_RELOC_V850_SDA_15_16_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer.  */
+  BFD_RELOC_V850_ZDA_16_16_OFFSET,
+
+/* This is a 16 bit offset (of which only 15 bits are used) from the
+zero data area pointer.  */
+  BFD_RELOC_V850_ZDA_15_16_OFFSET,
+
+/* This is an 8 bit offset (of which only 6 bits are used) from the
+tiny data area pointer.  */
+  BFD_RELOC_V850_TDA_6_8_OFFSET,
+
+/* This is an 8bit offset (of which only 7 bits are used) from the tiny
+data area pointer.  */
+  BFD_RELOC_V850_TDA_7_8_OFFSET,
+
+/* This is a 7 bit offset from the tiny data area pointer.  */
+  BFD_RELOC_V850_TDA_7_7_OFFSET,
+
+/* This is a 16 bit offset from the tiny data area pointer.  */
+  BFD_RELOC_V850_TDA_16_16_OFFSET,
+
+/* This is a 5 bit offset (of which only 4 bits are used) from the tiny
+data area pointer.  */
+  BFD_RELOC_V850_TDA_4_5_OFFSET,
+
+/* This is a 4 bit offset from the tiny data area pointer.  */
+  BFD_RELOC_V850_TDA_4_4_OFFSET,
+
+/* This is a 16 bit offset from the short data area pointer, with the
+bits placed non-contiguously in the instruction.  */
+  BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET,
+
+/* This is a 16 bit offset from the zero data area pointer, with the
+bits placed non-contiguously in the instruction.  */
+  BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET,
+
+/* This is a 6 bit offset from the call table base pointer.  */
+  BFD_RELOC_V850_CALLT_6_7_OFFSET,
+
+/* This is a 16 bit offset from the call table base pointer.  */
+  BFD_RELOC_V850_CALLT_16_16_OFFSET,
+
+/* Used for relaxing indirect function calls.  */
+  BFD_RELOC_V850_LONGCALL,
+
+/* Used for relaxing indirect jumps.  */
+  BFD_RELOC_V850_LONGJUMP,
+
+/* Used to maintain alignment whilst relaxing.  */
+  BFD_RELOC_V850_ALIGN,
+
+/* This is a variation of BFD_RELOC_LO16 that can be used in v850e ld.bu
+instructions.  */
+  BFD_RELOC_V850_LO16_SPLIT_OFFSET,
+
+/* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the
+instruction.  */
+  BFD_RELOC_MN10300_32_PCREL,
+
+/* This is a 16bit pcrel reloc for the mn10300, offset by two bytes in the
+instruction.  */
+  BFD_RELOC_MN10300_16_PCREL,
+
+/* This is a 8bit DP reloc for the tms320c30, where the most
+significant 8 bits of a 24 bit word are placed into the least
+significant 8 bits of the opcode.  */
+  BFD_RELOC_TIC30_LDP,
+
+/* This is a 7bit reloc for the tms320c54x, where the least
+significant 7 bits of a 16 bit word are placed into the least
+significant 7 bits of the opcode.  */
+  BFD_RELOC_TIC54X_PARTLS7,
+
+/* This is a 9bit DP reloc for the tms320c54x, where the most
+significant 9 bits of a 16 bit word are placed into the least
+significant 9 bits of the opcode.  */
+  BFD_RELOC_TIC54X_PARTMS9,
+
+/* This is an extended address 23-bit reloc for the tms320c54x.  */
+  BFD_RELOC_TIC54X_23,
+
+/* This is a 16-bit reloc for the tms320c54x, where the least
+significant 16 bits of a 23-bit extended address are placed into
+the opcode.  */
+  BFD_RELOC_TIC54X_16_OF_23,
+
+/* This is a reloc for the tms320c54x, where the most
+significant 7 bits of a 23-bit extended address are placed into
+the opcode.  */
+  BFD_RELOC_TIC54X_MS7_OF_23,
+
+/* This is a 48 bit reloc for the FR30 that stores 32 bits.  */
+  BFD_RELOC_FR30_48,
+
+/* This is a 32 bit reloc for the FR30 that stores 20 bits split up into
+two sections.  */
+  BFD_RELOC_FR30_20,
+
+/* This is a 16 bit reloc for the FR30 that stores a 6 bit word offset in
+4 bits.  */
+  BFD_RELOC_FR30_6_IN_4,
+
+/* This is a 16 bit reloc for the FR30 that stores an 8 bit byte offset
+into 8 bits.  */
+  BFD_RELOC_FR30_8_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 9 bit short offset
+into 8 bits.  */
+  BFD_RELOC_FR30_9_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 10 bit word offset
+into 8 bits.  */
+  BFD_RELOC_FR30_10_IN_8,
+
+/* This is a 16 bit reloc for the FR30 that stores a 9 bit pc relative
+short offset into 8 bits.  */
+  BFD_RELOC_FR30_9_PCREL,
+
+/* This is a 16 bit reloc for the FR30 that stores a 12 bit pc relative
+short offset into 11 bits.  */
+  BFD_RELOC_FR30_12_PCREL,
+
+/* Motorola Mcore relocations.  */
+  BFD_RELOC_MCORE_PCREL_IMM8BY4,
+  BFD_RELOC_MCORE_PCREL_IMM11BY2,
+  BFD_RELOC_MCORE_PCREL_IMM4BY2,
+  BFD_RELOC_MCORE_PCREL_32,
+  BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2,
+  BFD_RELOC_MCORE_RVA,
+
+/* These are relocations for the GETA instruction.  */
+  BFD_RELOC_MMIX_GETA,
+  BFD_RELOC_MMIX_GETA_1,
+  BFD_RELOC_MMIX_GETA_2,
+  BFD_RELOC_MMIX_GETA_3,
+
+/* These are relocations for a conditional branch instruction.  */
+  BFD_RELOC_MMIX_CBRANCH,
+  BFD_RELOC_MMIX_CBRANCH_J,
+  BFD_RELOC_MMIX_CBRANCH_1,
+  BFD_RELOC_MMIX_CBRANCH_2,
+  BFD_RELOC_MMIX_CBRANCH_3,
+
+/* These are relocations for the PUSHJ instruction.  */
+  BFD_RELOC_MMIX_PUSHJ,
+  BFD_RELOC_MMIX_PUSHJ_1,
+  BFD_RELOC_MMIX_PUSHJ_2,
+  BFD_RELOC_MMIX_PUSHJ_3,
+  BFD_RELOC_MMIX_PUSHJ_STUBBABLE,
+
+/* These are relocations for the JMP instruction.  */
+  BFD_RELOC_MMIX_JMP,
+  BFD_RELOC_MMIX_JMP_1,
+  BFD_RELOC_MMIX_JMP_2,
+  BFD_RELOC_MMIX_JMP_3,
+
+/* This is a relocation for a relative address as in a GETA instruction or
+a branch.  */
+  BFD_RELOC_MMIX_ADDR19,
+
+/* This is a relocation for a relative address as in a JMP instruction.  */
+  BFD_RELOC_MMIX_ADDR27,
+
+/* This is a relocation for an instruction field that may be a general
+register or a value 0..255.  */
+  BFD_RELOC_MMIX_REG_OR_BYTE,
+
+/* This is a relocation for an instruction field that may be a general
+register.  */
+  BFD_RELOC_MMIX_REG,
+
+/* This is a relocation for two instruction fields holding a register and
+an offset, the equivalent of the relocation.  */
+  BFD_RELOC_MMIX_BASE_PLUS_OFFSET,
+
+/* This relocation is an assertion that the expression is not allocated as
+a global register.  It does not modify contents.  */
+  BFD_RELOC_MMIX_LOCAL,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit pc relative
+short offset into 7 bits.  */
+  BFD_RELOC_AVR_7_PCREL,
+
+/* This is a 16 bit reloc for the AVR that stores 13 bit pc relative
+short offset into 12 bits.  */
+  BFD_RELOC_AVR_13_PCREL,
+
+/* This is a 16 bit reloc for the AVR that stores 17 bit value (usually
+program memory address) into 16 bits.  */
+  BFD_RELOC_AVR_16_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+data memory address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_LO8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+of data memory address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_HI8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+of program memory address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_HH8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+of 32 bit value) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_MS8_LDI,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(usually data memory address) into 8 bit immediate value of SUBI insn.  */
+  BFD_RELOC_AVR_LO8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 8 bit of data memory address) into 8 bit immediate value of
+SUBI insn.  */
+  BFD_RELOC_AVR_HI8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(most high 8 bit of program memory address) into 8 bit immediate value
+of LDI or SUBI insn.  */
+  BFD_RELOC_AVR_HH8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value (msb
+of 32 bit value) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_MS8_LDI_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (usually
+command address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_LO8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value 
+(command address) into 8 bit immediate value of LDI insn. If the address
+is beyond the 128k boundary, the linker inserts a jump stub for this reloc
+in the lower 128k.  */
+  BFD_RELOC_AVR_LO8_LDI_GS,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+of command address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_HI8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (high 8 bit
+of command address) into 8 bit immediate value of LDI insn.  If the address
+is beyond the 128k boundary, the linker inserts a jump stub for this reloc
+below 128k.  */
+  BFD_RELOC_AVR_HI8_LDI_GS,
+
+/* This is a 16 bit reloc for the AVR that stores 8 bit value (most high 8 bit
+of command address) into 8 bit immediate value of LDI insn.  */
+  BFD_RELOC_AVR_HH8_LDI_PM,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(usually command address) into 8 bit immediate value of SUBI insn.  */
+  BFD_RELOC_AVR_LO8_LDI_PM_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 8 bit of 16 bit command address) into 8 bit immediate value
+of SUBI insn.  */
+  BFD_RELOC_AVR_HI8_LDI_PM_NEG,
+
+/* This is a 16 bit reloc for the AVR that stores negated 8 bit value
+(high 6 bit of 22 bit command address) into 8 bit immediate
+value of SUBI insn.  */
+  BFD_RELOC_AVR_HH8_LDI_PM_NEG,
+
+/* This is a 32 bit reloc for the AVR that stores 23 bit value
+into 22 bits.  */
+  BFD_RELOC_AVR_CALL,
+
+/* This is a 16 bit reloc for the AVR that stores all needed bits
+for absolute addressing with ldi with overflow check to linktime  */
+  BFD_RELOC_AVR_LDI,
+
+/* This is a 6 bit reloc for the AVR that stores offset for ldd/std
+instructions  */
+  BFD_RELOC_AVR_6,
+
+/* This is a 6 bit reloc for the AVR that stores offset for adiw/sbiw
+instructions  */
+  BFD_RELOC_AVR_6_ADIW,
+
+/* Direct 12 bit.  */
+  BFD_RELOC_390_12,
+
+/* 12 bit GOT offset.  */
+  BFD_RELOC_390_GOT12,
+
+/* 32 bit PC relative PLT address.  */
+  BFD_RELOC_390_PLT32,
+
+/* Copy symbol at runtime.  */
+  BFD_RELOC_390_COPY,
+
+/* Create GOT entry.  */
+  BFD_RELOC_390_GLOB_DAT,
+
+/* Create PLT entry.  */
+  BFD_RELOC_390_JMP_SLOT,
+
+/* Adjust by program base.  */
+  BFD_RELOC_390_RELATIVE,
+
+/* 32 bit PC relative offset to GOT.  */
+  BFD_RELOC_390_GOTPC,
+
+/* 16 bit GOT offset.  */
+  BFD_RELOC_390_GOT16,
+
+/* PC relative 16 bit shifted by 1.  */
+  BFD_RELOC_390_PC16DBL,
+
+/* 16 bit PC rel. PLT shifted by 1.  */
+  BFD_RELOC_390_PLT16DBL,
+
+/* PC relative 32 bit shifted by 1.  */
+  BFD_RELOC_390_PC32DBL,
+
+/* 32 bit PC rel. PLT shifted by 1.  */
+  BFD_RELOC_390_PLT32DBL,
+
+/* 32 bit PC rel. GOT shifted by 1.  */
+  BFD_RELOC_390_GOTPCDBL,
+
+/* 64 bit GOT offset.  */
+  BFD_RELOC_390_GOT64,
+
+/* 64 bit PC relative PLT address.  */
+  BFD_RELOC_390_PLT64,
+
+/* 32 bit rel. offset to GOT entry.  */
+  BFD_RELOC_390_GOTENT,
+
+/* 64 bit offset to GOT.  */
+  BFD_RELOC_390_GOTOFF64,
+
+/* 12-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_390_GOTPLT12,
+
+/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_390_GOTPLT16,
+
+/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_390_GOTPLT32,
+
+/* 64-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_390_GOTPLT64,
+
+/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_390_GOTPLTENT,
+
+/* 16-bit rel. offset from the GOT to a PLT entry.  */
+  BFD_RELOC_390_PLTOFF16,
+
+/* 32-bit rel. offset from the GOT to a PLT entry.  */
+  BFD_RELOC_390_PLTOFF32,
+
+/* 64-bit rel. offset from the GOT to a PLT entry.  */
+  BFD_RELOC_390_PLTOFF64,
+
+/* s390 tls relocations.  */
+  BFD_RELOC_390_TLS_LOAD,
+  BFD_RELOC_390_TLS_GDCALL,
+  BFD_RELOC_390_TLS_LDCALL,
+  BFD_RELOC_390_TLS_GD32,
+  BFD_RELOC_390_TLS_GD64,
+  BFD_RELOC_390_TLS_GOTIE12,
+  BFD_RELOC_390_TLS_GOTIE32,
+  BFD_RELOC_390_TLS_GOTIE64,
+  BFD_RELOC_390_TLS_LDM32,
+  BFD_RELOC_390_TLS_LDM64,
+  BFD_RELOC_390_TLS_IE32,
+  BFD_RELOC_390_TLS_IE64,
+  BFD_RELOC_390_TLS_IEENT,
+  BFD_RELOC_390_TLS_LE32,
+  BFD_RELOC_390_TLS_LE64,
+  BFD_RELOC_390_TLS_LDO32,
+  BFD_RELOC_390_TLS_LDO64,
+  BFD_RELOC_390_TLS_DTPMOD,
+  BFD_RELOC_390_TLS_DTPOFF,
+  BFD_RELOC_390_TLS_TPOFF,
+
+/* Long displacement extension.  */
+  BFD_RELOC_390_20,
+  BFD_RELOC_390_GOT20,
+  BFD_RELOC_390_GOTPLT20,
+  BFD_RELOC_390_TLS_GOTIE20,
+
+/* Score relocations  */
+  BFD_RELOC_SCORE_DUMMY1,
+
+/* Low 16 bit for load/store  */
+  BFD_RELOC_SCORE_GPREL15,
+
+/* This is a 24-bit reloc with the right 1 bit assumed to be 0  */
+  BFD_RELOC_SCORE_DUMMY2,
+  BFD_RELOC_SCORE_JMP,
+
+/* This is a 19-bit reloc with the right 1 bit assumed to be 0  */
+  BFD_RELOC_SCORE_BRANCH,
+
+/* This is a 11-bit reloc with the right 1 bit assumed to be 0  */
+  BFD_RELOC_SCORE16_JMP,
+
+/* This is a 8-bit reloc with the right 1 bit assumed to be 0  */
+  BFD_RELOC_SCORE16_BRANCH,
+
+/* Undocumented Score relocs  */
+  BFD_RELOC_SCORE_GOT15,
+  BFD_RELOC_SCORE_GOT_LO16,
+  BFD_RELOC_SCORE_CALL15,
+  BFD_RELOC_SCORE_DUMMY_HI16,
+
+/* Scenix IP2K - 9-bit register number / data address  */
+  BFD_RELOC_IP2K_FR9,
+
+/* Scenix IP2K - 4-bit register/data bank number  */
+  BFD_RELOC_IP2K_BANK,
+
+/* Scenix IP2K - low 13 bits of instruction word address  */
+  BFD_RELOC_IP2K_ADDR16CJP,
+
+/* Scenix IP2K - high 3 bits of instruction word address  */
+  BFD_RELOC_IP2K_PAGE3,
+
+/* Scenix IP2K - ext/low/high 8 bits of data address  */
+  BFD_RELOC_IP2K_LO8DATA,
+  BFD_RELOC_IP2K_HI8DATA,
+  BFD_RELOC_IP2K_EX8DATA,
+
+/* Scenix IP2K - low/high 8 bits of instruction word address  */
+  BFD_RELOC_IP2K_LO8INSN,
+  BFD_RELOC_IP2K_HI8INSN,
+
+/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0  */
+  BFD_RELOC_IP2K_PC_SKIP,
+
+/* Scenix IP2K - 16 bit word address in text section.  */
+  BFD_RELOC_IP2K_TEXT,
+
+/* Scenix IP2K - 7-bit sp or dp offset  */
+  BFD_RELOC_IP2K_FR_OFFSET,
+
+/* Scenix VPE4K coprocessor - data/insn-space addressing  */
+  BFD_RELOC_VPE4KMATH_DATA,
+  BFD_RELOC_VPE4KMATH_INSN,
+
+/* These two relocations are used by the linker to determine which of
+the entries in a C++ virtual function table are actually used.  When
+the --gc-sections option is given, the linker will zero out the entries
+that are not used, so that the code for those functions need not be
+included in the output.
+
+VTABLE_INHERIT is a zero-space relocation used to describe to the
+linker the inheritance tree of a C++ virtual function table.  The
+relocation's symbol should be the parent class' vtable, and the
+relocation should be located at the child vtable.
+
+VTABLE_ENTRY is a zero-space relocation that describes the use of a
+virtual function table entry.  The reloc's symbol should refer to the
+table of the class mentioned in the code.  Off of that base, an offset
+describes the entry that is being used.  For Rela hosts, this offset
+is stored in the reloc's addend.  For Rel hosts, we are forced to put
+this offset in the reloc's section offset.  */
+  BFD_RELOC_VTABLE_INHERIT,
+  BFD_RELOC_VTABLE_ENTRY,
+
+/* Intel IA64 Relocations.  */
+  BFD_RELOC_IA64_IMM14,
+  BFD_RELOC_IA64_IMM22,
+  BFD_RELOC_IA64_IMM64,
+  BFD_RELOC_IA64_DIR32MSB,
+  BFD_RELOC_IA64_DIR32LSB,
+  BFD_RELOC_IA64_DIR64MSB,
+  BFD_RELOC_IA64_DIR64LSB,
+  BFD_RELOC_IA64_GPREL22,
+  BFD_RELOC_IA64_GPREL64I,
+  BFD_RELOC_IA64_GPREL32MSB,
+  BFD_RELOC_IA64_GPREL32LSB,
+  BFD_RELOC_IA64_GPREL64MSB,
+  BFD_RELOC_IA64_GPREL64LSB,
+  BFD_RELOC_IA64_LTOFF22,
+  BFD_RELOC_IA64_LTOFF64I,
+  BFD_RELOC_IA64_PLTOFF22,
+  BFD_RELOC_IA64_PLTOFF64I,
+  BFD_RELOC_IA64_PLTOFF64MSB,
+  BFD_RELOC_IA64_PLTOFF64LSB,
+  BFD_RELOC_IA64_FPTR64I,
+  BFD_RELOC_IA64_FPTR32MSB,
+  BFD_RELOC_IA64_FPTR32LSB,
+  BFD_RELOC_IA64_FPTR64MSB,
+  BFD_RELOC_IA64_FPTR64LSB,
+  BFD_RELOC_IA64_PCREL21B,
+  BFD_RELOC_IA64_PCREL21BI,
+  BFD_RELOC_IA64_PCREL21M,
+  BFD_RELOC_IA64_PCREL21F,
+  BFD_RELOC_IA64_PCREL22,
+  BFD_RELOC_IA64_PCREL60B,
+  BFD_RELOC_IA64_PCREL64I,
+  BFD_RELOC_IA64_PCREL32MSB,
+  BFD_RELOC_IA64_PCREL32LSB,
+  BFD_RELOC_IA64_PCREL64MSB,
+  BFD_RELOC_IA64_PCREL64LSB,
+  BFD_RELOC_IA64_LTOFF_FPTR22,
+  BFD_RELOC_IA64_LTOFF_FPTR64I,
+  BFD_RELOC_IA64_LTOFF_FPTR32MSB,
+  BFD_RELOC_IA64_LTOFF_FPTR32LSB,
+  BFD_RELOC_IA64_LTOFF_FPTR64MSB,
+  BFD_RELOC_IA64_LTOFF_FPTR64LSB,
+  BFD_RELOC_IA64_SEGREL32MSB,
+  BFD_RELOC_IA64_SEGREL32LSB,
+  BFD_RELOC_IA64_SEGREL64MSB,
+  BFD_RELOC_IA64_SEGREL64LSB,
+  BFD_RELOC_IA64_SECREL32MSB,
+  BFD_RELOC_IA64_SECREL32LSB,
+  BFD_RELOC_IA64_SECREL64MSB,
+  BFD_RELOC_IA64_SECREL64LSB,
+  BFD_RELOC_IA64_REL32MSB,
+  BFD_RELOC_IA64_REL32LSB,
+  BFD_RELOC_IA64_REL64MSB,
+  BFD_RELOC_IA64_REL64LSB,
+  BFD_RELOC_IA64_LTV32MSB,
+  BFD_RELOC_IA64_LTV32LSB,
+  BFD_RELOC_IA64_LTV64MSB,
+  BFD_RELOC_IA64_LTV64LSB,
+  BFD_RELOC_IA64_IPLTMSB,
+  BFD_RELOC_IA64_IPLTLSB,
+  BFD_RELOC_IA64_COPY,
+  BFD_RELOC_IA64_LTOFF22X,
+  BFD_RELOC_IA64_LDXMOV,
+  BFD_RELOC_IA64_TPREL14,
+  BFD_RELOC_IA64_TPREL22,
+  BFD_RELOC_IA64_TPREL64I,
+  BFD_RELOC_IA64_TPREL64MSB,
+  BFD_RELOC_IA64_TPREL64LSB,
+  BFD_RELOC_IA64_LTOFF_TPREL22,
+  BFD_RELOC_IA64_DTPMOD64MSB,
+  BFD_RELOC_IA64_DTPMOD64LSB,
+  BFD_RELOC_IA64_LTOFF_DTPMOD22,
+  BFD_RELOC_IA64_DTPREL14,
+  BFD_RELOC_IA64_DTPREL22,
+  BFD_RELOC_IA64_DTPREL64I,
+  BFD_RELOC_IA64_DTPREL32MSB,
+  BFD_RELOC_IA64_DTPREL32LSB,
+  BFD_RELOC_IA64_DTPREL64MSB,
+  BFD_RELOC_IA64_DTPREL64LSB,
+  BFD_RELOC_IA64_LTOFF_DTPREL22,
+
+/* Motorola 68HC11 reloc.
+This is the 8 bit high part of an absolute address.  */
+  BFD_RELOC_M68HC11_HI8,
+
+/* Motorola 68HC11 reloc.
+This is the 8 bit low part of an absolute address.  */
+  BFD_RELOC_M68HC11_LO8,
+
+/* Motorola 68HC11 reloc.
+This is the 3 bit of a value.  */
+  BFD_RELOC_M68HC11_3B,
+
+/* Motorola 68HC11 reloc.
+This reloc marks the beginning of a jump/call instruction.
+It is used for linker relaxation to correctly identify beginning
+of instruction and change some branches to use PC-relative
+addressing mode.  */
+  BFD_RELOC_M68HC11_RL_JUMP,
+
+/* Motorola 68HC11 reloc.
+This reloc marks a group of several instructions that gcc generates
+and for which the linker relaxation pass can modify and/or remove
+some of them.  */
+  BFD_RELOC_M68HC11_RL_GROUP,
+
+/* Motorola 68HC11 reloc.
+This is the 16-bit lower part of an address.  It is used for 'call'
+instruction to specify the symbol address without any special
+transformation (due to memory bank window).  */
+  BFD_RELOC_M68HC11_LO16,
+
+/* Motorola 68HC11 reloc.
+This is a 8-bit reloc that specifies the page number of an address.
+It is used by 'call' instruction to specify the page number of
+the symbol.  */
+  BFD_RELOC_M68HC11_PAGE,
+
+/* Motorola 68HC11 reloc.
+This is a 24-bit reloc that represents the address with a 16-bit
+value and a 8-bit page number.  The symbol address is transformed
+to follow the 16K memory bank of 68HC12 (seen as mapped in the window).  */
+  BFD_RELOC_M68HC11_24,
+
+/* Motorola 68HC12 reloc.
+This is the 5 bits of a value.  */
+  BFD_RELOC_M68HC12_5B,
+
+/* NS CR16C Relocations.  */
+  BFD_RELOC_16C_NUM08,
+  BFD_RELOC_16C_NUM08_C,
+  BFD_RELOC_16C_NUM16,
+  BFD_RELOC_16C_NUM16_C,
+  BFD_RELOC_16C_NUM32,
+  BFD_RELOC_16C_NUM32_C,
+  BFD_RELOC_16C_DISP04,
+  BFD_RELOC_16C_DISP04_C,
+  BFD_RELOC_16C_DISP08,
+  BFD_RELOC_16C_DISP08_C,
+  BFD_RELOC_16C_DISP16,
+  BFD_RELOC_16C_DISP16_C,
+  BFD_RELOC_16C_DISP24,
+  BFD_RELOC_16C_DISP24_C,
+  BFD_RELOC_16C_DISP24a,
+  BFD_RELOC_16C_DISP24a_C,
+  BFD_RELOC_16C_REG04,
+  BFD_RELOC_16C_REG04_C,
+  BFD_RELOC_16C_REG04a,
+  BFD_RELOC_16C_REG04a_C,
+  BFD_RELOC_16C_REG14,
+  BFD_RELOC_16C_REG14_C,
+  BFD_RELOC_16C_REG16,
+  BFD_RELOC_16C_REG16_C,
+  BFD_RELOC_16C_REG20,
+  BFD_RELOC_16C_REG20_C,
+  BFD_RELOC_16C_ABS20,
+  BFD_RELOC_16C_ABS20_C,
+  BFD_RELOC_16C_ABS24,
+  BFD_RELOC_16C_ABS24_C,
+  BFD_RELOC_16C_IMM04,
+  BFD_RELOC_16C_IMM04_C,
+  BFD_RELOC_16C_IMM16,
+  BFD_RELOC_16C_IMM16_C,
+  BFD_RELOC_16C_IMM20,
+  BFD_RELOC_16C_IMM20_C,
+  BFD_RELOC_16C_IMM24,
+  BFD_RELOC_16C_IMM24_C,
+  BFD_RELOC_16C_IMM32,
+  BFD_RELOC_16C_IMM32_C,
+
+/* NS CRX Relocations.  */
+  BFD_RELOC_CRX_REL4,
+  BFD_RELOC_CRX_REL8,
+  BFD_RELOC_CRX_REL8_CMP,
+  BFD_RELOC_CRX_REL16,
+  BFD_RELOC_CRX_REL24,
+  BFD_RELOC_CRX_REL32,
+  BFD_RELOC_CRX_REGREL12,
+  BFD_RELOC_CRX_REGREL22,
+  BFD_RELOC_CRX_REGREL28,
+  BFD_RELOC_CRX_REGREL32,
+  BFD_RELOC_CRX_ABS16,
+  BFD_RELOC_CRX_ABS32,
+  BFD_RELOC_CRX_NUM8,
+  BFD_RELOC_CRX_NUM16,
+  BFD_RELOC_CRX_NUM32,
+  BFD_RELOC_CRX_IMM16,
+  BFD_RELOC_CRX_IMM32,
+  BFD_RELOC_CRX_SWITCH8,
+  BFD_RELOC_CRX_SWITCH16,
+  BFD_RELOC_CRX_SWITCH32,
+
+/* These relocs are only used within the CRIS assembler.  They are not
+(at present) written to any object files.  */
+  BFD_RELOC_CRIS_BDISP8,
+  BFD_RELOC_CRIS_UNSIGNED_5,
+  BFD_RELOC_CRIS_SIGNED_6,
+  BFD_RELOC_CRIS_UNSIGNED_6,
+  BFD_RELOC_CRIS_SIGNED_8,
+  BFD_RELOC_CRIS_UNSIGNED_8,
+  BFD_RELOC_CRIS_SIGNED_16,
+  BFD_RELOC_CRIS_UNSIGNED_16,
+  BFD_RELOC_CRIS_LAPCQ_OFFSET,
+  BFD_RELOC_CRIS_UNSIGNED_4,
+
+/* Relocs used in ELF shared libraries for CRIS.  */
+  BFD_RELOC_CRIS_COPY,
+  BFD_RELOC_CRIS_GLOB_DAT,
+  BFD_RELOC_CRIS_JUMP_SLOT,
+  BFD_RELOC_CRIS_RELATIVE,
+
+/* 32-bit offset to symbol-entry within GOT.  */
+  BFD_RELOC_CRIS_32_GOT,
+
+/* 16-bit offset to symbol-entry within GOT.  */
+  BFD_RELOC_CRIS_16_GOT,
+
+/* 32-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_CRIS_32_GOTPLT,
+
+/* 16-bit offset to symbol-entry within GOT, with PLT handling.  */
+  BFD_RELOC_CRIS_16_GOTPLT,
+
+/* 32-bit offset to symbol, relative to GOT.  */
+  BFD_RELOC_CRIS_32_GOTREL,
+
+/* 32-bit offset to symbol with PLT entry, relative to GOT.  */
+  BFD_RELOC_CRIS_32_PLT_GOTREL,
+
+/* 32-bit offset to symbol with PLT entry, relative to this relocation.  */
+  BFD_RELOC_CRIS_32_PLT_PCREL,
+
+/* Intel i860 Relocations.  */
+  BFD_RELOC_860_COPY,
+  BFD_RELOC_860_GLOB_DAT,
+  BFD_RELOC_860_JUMP_SLOT,
+  BFD_RELOC_860_RELATIVE,
+  BFD_RELOC_860_PC26,
+  BFD_RELOC_860_PLT26,
+  BFD_RELOC_860_PC16,
+  BFD_RELOC_860_LOW0,
+  BFD_RELOC_860_SPLIT0,
+  BFD_RELOC_860_LOW1,
+  BFD_RELOC_860_SPLIT1,
+  BFD_RELOC_860_LOW2,
+  BFD_RELOC_860_SPLIT2,
+  BFD_RELOC_860_LOW3,
+  BFD_RELOC_860_LOGOT0,
+  BFD_RELOC_860_SPGOT0,
+  BFD_RELOC_860_LOGOT1,
+  BFD_RELOC_860_SPGOT1,
+  BFD_RELOC_860_LOGOTOFF0,
+  BFD_RELOC_860_SPGOTOFF0,
+  BFD_RELOC_860_LOGOTOFF1,
+  BFD_RELOC_860_SPGOTOFF1,
+  BFD_RELOC_860_LOGOTOFF2,
+  BFD_RELOC_860_LOGOTOFF3,
+  BFD_RELOC_860_LOPC,
+  BFD_RELOC_860_HIGHADJ,
+  BFD_RELOC_860_HAGOT,
+  BFD_RELOC_860_HAGOTOFF,
+  BFD_RELOC_860_HAPC,
+  BFD_RELOC_860_HIGH,
+  BFD_RELOC_860_HIGOT,
+  BFD_RELOC_860_HIGOTOFF,
+
+/* OpenRISC Relocations.  */
+  BFD_RELOC_OPENRISC_ABS_26,
+  BFD_RELOC_OPENRISC_REL_26,
+
+/* H8 elf Relocations.  */
+  BFD_RELOC_H8_DIR16A8,
+  BFD_RELOC_H8_DIR16R8,
+  BFD_RELOC_H8_DIR24A8,
+  BFD_RELOC_H8_DIR24R8,
+  BFD_RELOC_H8_DIR32A16,
+
+/* Sony Xstormy16 Relocations.  */
+  BFD_RELOC_XSTORMY16_REL_12,
+  BFD_RELOC_XSTORMY16_12,
+  BFD_RELOC_XSTORMY16_24,
+  BFD_RELOC_XSTORMY16_FPTR16,
+
+/* Infineon Relocations.  */
+  BFD_RELOC_XC16X_PAG,
+  BFD_RELOC_XC16X_POF,
+  BFD_RELOC_XC16X_SEG,
+  BFD_RELOC_XC16X_SOF,
+
+/* Relocations used by VAX ELF.  */
+  BFD_RELOC_VAX_GLOB_DAT,
+  BFD_RELOC_VAX_JMP_SLOT,
+  BFD_RELOC_VAX_RELATIVE,
+
+/* Morpho MT - 16 bit immediate relocation.  */
+  BFD_RELOC_MT_PC16,
+
+/* Morpho MT - Hi 16 bits of an address.  */
+  BFD_RELOC_MT_HI16,
+
+/* Morpho MT - Low 16 bits of an address.  */
+  BFD_RELOC_MT_LO16,
+
+/* Morpho MT - Used to tell the linker which vtable entries are used.  */
+  BFD_RELOC_MT_GNU_VTINHERIT,
+
+/* Morpho MT - Used to tell the linker which vtable entries are used.  */
+  BFD_RELOC_MT_GNU_VTENTRY,
+
+/* Morpho MT - 8 bit immediate relocation.  */
+  BFD_RELOC_MT_PCINSN8,
+
+/* msp430 specific relocation codes  */
+  BFD_RELOC_MSP430_10_PCREL,
+  BFD_RELOC_MSP430_16_PCREL,
+  BFD_RELOC_MSP430_16,
+  BFD_RELOC_MSP430_16_PCREL_BYTE,
+  BFD_RELOC_MSP430_16_BYTE,
+  BFD_RELOC_MSP430_2X_PCREL,
+  BFD_RELOC_MSP430_RL_PCREL,
+
+/* IQ2000 Relocations.  */
+  BFD_RELOC_IQ2000_OFFSET_16,
+  BFD_RELOC_IQ2000_OFFSET_21,
+  BFD_RELOC_IQ2000_UHI16,
+
+/* Special Xtensa relocation used only by PLT entries in ELF shared
+objects to indicate that the runtime linker should set the value
+to one of its own internal functions or data structures.  */
+  BFD_RELOC_XTENSA_RTLD,
+
+/* Xtensa relocations for ELF shared objects.  */
+  BFD_RELOC_XTENSA_GLOB_DAT,
+  BFD_RELOC_XTENSA_JMP_SLOT,
+  BFD_RELOC_XTENSA_RELATIVE,
+
+/* Xtensa relocation used in ELF object files for symbols that may require
+PLT entries.  Otherwise, this is just a generic 32-bit relocation.  */
+  BFD_RELOC_XTENSA_PLT,
+
+/* Xtensa relocations to mark the difference of two local symbols.
+These are only needed to support linker relaxation and can be ignored
+when not relaxing.  The field is set to the value of the difference
+assuming no relaxation.  The relocation encodes the position of the
+first symbol so the linker can determine whether to adjust the field
+value.  */
+  BFD_RELOC_XTENSA_DIFF8,
+  BFD_RELOC_XTENSA_DIFF16,
+  BFD_RELOC_XTENSA_DIFF32,
+
+/* Generic Xtensa relocations for instruction operands.  Only the slot
+number is encoded in the relocation.  The relocation applies to the
+last PC-relative immediate operand, or if there are no PC-relative
+immediates, to the last immediate operand.  */
+  BFD_RELOC_XTENSA_SLOT0_OP,
+  BFD_RELOC_XTENSA_SLOT1_OP,
+  BFD_RELOC_XTENSA_SLOT2_OP,
+  BFD_RELOC_XTENSA_SLOT3_OP,
+  BFD_RELOC_XTENSA_SLOT4_OP,
+  BFD_RELOC_XTENSA_SLOT5_OP,
+  BFD_RELOC_XTENSA_SLOT6_OP,
+  BFD_RELOC_XTENSA_SLOT7_OP,
+  BFD_RELOC_XTENSA_SLOT8_OP,
+  BFD_RELOC_XTENSA_SLOT9_OP,
+  BFD_RELOC_XTENSA_SLOT10_OP,
+  BFD_RELOC_XTENSA_SLOT11_OP,
+  BFD_RELOC_XTENSA_SLOT12_OP,
+  BFD_RELOC_XTENSA_SLOT13_OP,
+  BFD_RELOC_XTENSA_SLOT14_OP,
+
+/* Alternate Xtensa relocations.  Only the slot is encoded in the
+relocation.  The meaning of these relocations is opcode-specific.  */
+  BFD_RELOC_XTENSA_SLOT0_ALT,
+  BFD_RELOC_XTENSA_SLOT1_ALT,
+  BFD_RELOC_XTENSA_SLOT2_ALT,
+  BFD_RELOC_XTENSA_SLOT3_ALT,
+  BFD_RELOC_XTENSA_SLOT4_ALT,
+  BFD_RELOC_XTENSA_SLOT5_ALT,
+  BFD_RELOC_XTENSA_SLOT6_ALT,
+  BFD_RELOC_XTENSA_SLOT7_ALT,
+  BFD_RELOC_XTENSA_SLOT8_ALT,
+  BFD_RELOC_XTENSA_SLOT9_ALT,
+  BFD_RELOC_XTENSA_SLOT10_ALT,
+  BFD_RELOC_XTENSA_SLOT11_ALT,
+  BFD_RELOC_XTENSA_SLOT12_ALT,
+  BFD_RELOC_XTENSA_SLOT13_ALT,
+  BFD_RELOC_XTENSA_SLOT14_ALT,
+
+/* Xtensa relocations for backward compatibility.  These have all been
+replaced by BFD_RELOC_XTENSA_SLOT0_OP.  */
+  BFD_RELOC_XTENSA_OP0,
+  BFD_RELOC_XTENSA_OP1,
+  BFD_RELOC_XTENSA_OP2,
+
+/* Xtensa relocation to mark that the assembler expanded the
+instructions from an original target.  The expansion size is
+encoded in the reloc size.  */
+  BFD_RELOC_XTENSA_ASM_EXPAND,
+
+/* Xtensa relocation to mark that the linker should simplify
+assembler-expanded instructions.  This is commonly used
+internally by the linker after analysis of a
+BFD_RELOC_XTENSA_ASM_EXPAND.  */
+  BFD_RELOC_XTENSA_ASM_SIMPLIFY,
+
+/* 8 bit signed offset in (ix+d) or (iy+d).  */
+  BFD_RELOC_Z80_DISP8,
+
+/* DJNZ offset.  */
+  BFD_RELOC_Z8K_DISP7,
+
+/* CALR offset.  */
+  BFD_RELOC_Z8K_CALLR,
+
+/* 4 bit value.  */
+  BFD_RELOC_Z8K_IMM4L,
+  BFD_RELOC_UNUSED };
+typedef enum bfd_reloc_code_real bfd_reloc_code_real_type;
+reloc_howto_type *bfd_reloc_type_lookup
+   (bfd *abfd, bfd_reloc_code_real_type code);
+
+const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code);
+
+/* Extracted from syms.c.  */
+
+typedef struct bfd_symbol
+{
+  /* A pointer to the BFD which owns the symbol. This information
+     is necessary so that a back end can work out what additional
+     information (invisible to the application writer) is carried
+     with the symbol.
+
+     This field is *almost* redundant, since you can use section->owner
+     instead, except that some symbols point to the global sections
+     bfd_{abs,com,und}_section.  This could be fixed by making
+     these globals be per-bfd (or per-target-flavor).  FIXME.  */
+  struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field.  */
+
+  /* The text of the symbol. The name is left alone, and not copied; the
+     application may not alter it.  */
+  const char *name;
+
+  /* The value of the symbol.  This really should be a union of a
+     numeric value with a pointer, since some flags indicate that
+     a pointer to another symbol is stored here.  */
+  symvalue value;
+
+  /* Attributes of a symbol.  */
+#define BSF_NO_FLAGS    0x00
+
+  /* The symbol has local scope; <<static>> in <<C>>. The value
+     is the offset into the section of the data.  */
+#define BSF_LOCAL      0x01
+
+  /* The symbol has global scope; initialized data in <<C>>. The
+     value is the offset into the section of the data.  */
+#define BSF_GLOBAL     0x02
+
+  /* The symbol has global scope and is exported. The value is
+     the offset into the section of the data.  */
+#define BSF_EXPORT     BSF_GLOBAL /* No real difference.  */
+
+  /* A normal C symbol would be one of:
+     <<BSF_LOCAL>>, <<BSF_FORT_COMM>>,  <<BSF_UNDEFINED>> or
+     <<BSF_GLOBAL>>.  */
+
+  /* The symbol is a debugging record. The value has an arbitrary
+     meaning, unless BSF_DEBUGGING_RELOC is also set.  */
+#define BSF_DEBUGGING  0x08
+
+  /* The symbol denotes a function entry point.  Used in ELF,
+     perhaps others someday.  */
+#define BSF_FUNCTION    0x10
+
+  /* Used by the linker.  */
+#define BSF_KEEP        0x20
+#define BSF_KEEP_G      0x40
+
+  /* A weak global symbol, overridable without warnings by
+     a regular global symbol of the same name.  */
+#define BSF_WEAK        0x80
+
+  /* This symbol was created to point to a section, e.g. ELF's
+     STT_SECTION symbols.  */
+#define BSF_SECTION_SYM 0x100
+
+  /* The symbol used to be a common symbol, but now it is
+     allocated.  */
+#define BSF_OLD_COMMON  0x200
+
+  /* The default value for common data.  */
+#define BFD_FORT_COMM_DEFAULT_VALUE 0
+
+  /* In some files the type of a symbol sometimes alters its
+     location in an output file - ie in coff a <<ISFCN>> symbol
+     which is also <<C_EXT>> symbol appears where it was
+     declared and not at the end of a section.  This bit is set
+     by the target BFD part to convey this information.  */
+#define BSF_NOT_AT_END    0x400
+
+  /* Signal that the symbol is the label of constructor section.  */
+#define BSF_CONSTRUCTOR   0x800
+
+  /* Signal that the symbol is a warning symbol.  The name is a
+     warning.  The name of the next symbol is the one to warn about;
+     if a reference is made to a symbol with the same name as the next
+     symbol, a warning is issued by the linker.  */
+#define BSF_WARNING       0x1000
+
+  /* Signal that the symbol is indirect.  This symbol is an indirect
+     pointer to the symbol with the same name as the next symbol.  */
+#define BSF_INDIRECT      0x2000
+
+  /* BSF_FILE marks symbols that contain a file name.  This is used
+     for ELF STT_FILE symbols.  */
+#define BSF_FILE          0x4000
+
+  /* Symbol is from dynamic linking information.  */
+#define BSF_DYNAMIC       0x8000
+
+  /* The symbol denotes a data object.  Used in ELF, and perhaps
+     others someday.  */
+#define BSF_OBJECT        0x10000
+
+  /* This symbol is a debugging symbol.  The value is the offset
+     into the section of the data.  BSF_DEBUGGING should be set
+     as well.  */
+#define BSF_DEBUGGING_RELOC 0x20000
+
+  /* This symbol is thread local.  Used in ELF.  */
+#define BSF_THREAD_LOCAL  0x40000
+
+  flagword flags;
+
+  /* A pointer to the section to which this symbol is
+     relative.  This will always be non NULL, there are special
+     sections for undefined and absolute symbols.  */
+  struct bfd_section *section;
+
+  /* Back end special data.  */
+  union
+    {
+      void *p;
+      bfd_vma i;
+    }
+  udata;
+}
+asymbol;
+
+#define bfd_get_symtab_upper_bound(abfd) \
+     BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd))
+
+bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym);
+
+bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name);
+
+#define bfd_is_local_label_name(abfd, name) \
+  BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name))
+
+bfd_boolean bfd_is_target_special_symbol (bfd *abfd, asymbol *sym);
+
+#define bfd_is_target_special_symbol(abfd, sym) \
+  BFD_SEND (abfd, _bfd_is_target_special_symbol, (abfd, sym))
+
+#define bfd_canonicalize_symtab(abfd, location) \
+  BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location))
+
+bfd_boolean bfd_set_symtab
+   (bfd *abfd, asymbol **location, unsigned int count);
+
+void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol);
+
+#define bfd_make_empty_symbol(abfd) \
+  BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd))
+
+asymbol *_bfd_generic_make_empty_symbol (bfd *);
+
+#define bfd_make_debug_symbol(abfd,ptr,size) \
+  BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size))
+
+int bfd_decode_symclass (asymbol *symbol);
+
+bfd_boolean bfd_is_undefined_symclass (int symclass);
+
+void bfd_symbol_info (asymbol *symbol, symbol_info *ret);
+
+bfd_boolean bfd_copy_private_symbol_data
+   (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym);
+
+#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \
+  BFD_SEND (obfd, _bfd_copy_private_symbol_data, \
+            (ibfd, isymbol, obfd, osymbol))
+
+/* Extracted from bfd.c.  */
+struct bfd
+{
+  /* A unique identifier of the BFD  */
+  unsigned int id;
+
+  /* The filename the application opened the BFD with.  */
+  const char *filename;
+
+  /* A pointer to the target jump table.  */
+  const struct bfd_target *xvec;
+
+  /* The IOSTREAM, and corresponding IO vector that provide access
+     to the file backing the BFD.  */
+  void *iostream;
+  const struct bfd_iovec *iovec;
+
+  /* Is the file descriptor being cached?  That is, can it be closed as
+     needed, and re-opened when accessed later?  */
+  bfd_boolean cacheable;
+
+  /* Marks whether there was a default target specified when the
+     BFD was opened. This is used to select which matching algorithm
+     to use to choose the back end.  */
+  bfd_boolean target_defaulted;
+
+  /* The caching routines use these to maintain a
+     least-recently-used list of BFDs.  */
+  struct bfd *lru_prev, *lru_next;
+
+  /* When a file is closed by the caching routines, BFD retains
+     state information on the file here...  */
+  ufile_ptr where;
+
+  /* ... and here: (``once'' means at least once).  */
+  bfd_boolean opened_once;
+
+  /* Set if we have a locally maintained mtime value, rather than
+     getting it from the file each time.  */
+  bfd_boolean mtime_set;
+
+  /* File modified time, if mtime_set is TRUE.  */
+  long mtime;
+
+  /* Reserved for an unimplemented file locking extension.  */
+  int ifd;
+
+  /* The format which belongs to the BFD. (object, core, etc.)  */
+  bfd_format format;
+
+  /* The direction with which the BFD was opened.  */
+  enum bfd_direction
+    {
+      no_direction = 0,
+      read_direction = 1,
+      write_direction = 2,
+      both_direction = 3
+    }
+  direction;
+
+  /* Format_specific flags.  */
+  flagword flags;
+
+  /* Currently my_archive is tested before adding origin to
+     anything. I believe that this can become always an add of
+     origin, with origin set to 0 for non archive files.  */
+  ufile_ptr origin;
+
+  /* Remember when output has begun, to stop strange things
+     from happening.  */
+  bfd_boolean output_has_begun;
+
+  /* A hash table for section names.  */
+  struct bfd_hash_table section_htab;
+
+  /* Pointer to linked list of sections.  */
+  struct bfd_section *sections;
+
+  /* The last section on the section list.  */
+  struct bfd_section *section_last;
+
+  /* The number of sections.  */
+  unsigned int section_count;
+
+  /* Stuff only useful for object files:
+     The start address.  */
+  bfd_vma start_address;
+
+  /* Used for input and output.  */
+  unsigned int symcount;
+
+  /* Symbol table for output BFD (with symcount entries).  */
+  struct bfd_symbol  **outsymbols;
+
+  /* Used for slurped dynamic symbol tables.  */
+  unsigned int dynsymcount;
+
+  /* Pointer to structure which contains architecture information.  */
+  const struct bfd_arch_info *arch_info;
+
+  /* Flag set if symbols from this BFD should not be exported.  */
+  bfd_boolean no_export;
+
+  /* Stuff only useful for archives.  */
+  void *arelt_data;
+  struct bfd *my_archive;      /* The containing archive BFD.  */
+  struct bfd *next;            /* The next BFD in the archive.  */
+  struct bfd *archive_head;    /* The first BFD in the archive.  */
+  bfd_boolean has_armap;
+
+  /* A chain of BFD structures involved in a link.  */
+  struct bfd *link_next;
+
+  /* A field used by _bfd_generic_link_add_archive_symbols.  This will
+     be used only for archive elements.  */
+  int archive_pass;
+
+  /* Used by the back end to hold private data.  */
+  union
+    {
+      struct aout_data_struct *aout_data;
+      struct artdata *aout_ar_data;
+      struct _oasys_data *oasys_obj_data;
+      struct _oasys_ar_data *oasys_ar_data;
+      struct coff_tdata *coff_obj_data;
+      struct pe_tdata *pe_obj_data;
+      struct xcoff_tdata *xcoff_obj_data;
+      struct ecoff_tdata *ecoff_obj_data;
+      struct ieee_data_struct *ieee_data;
+      struct ieee_ar_data_struct *ieee_ar_data;
+      struct srec_data_struct *srec_data;
+      struct ihex_data_struct *ihex_data;
+      struct tekhex_data_struct *tekhex_data;
+      struct elf_obj_tdata *elf_obj_data;
+      struct nlm_obj_tdata *nlm_obj_data;
+      struct bout_data_struct *bout_data;
+      struct mmo_data_struct *mmo_data;
+      struct sun_core_struct *sun_core_data;
+      struct sco5_core_struct *sco5_core_data;
+      struct trad_core_struct *trad_core_data;
+      struct som_data_struct *som_data;
+      struct hpux_core_struct *hpux_core_data;
+      struct hppabsd_core_struct *hppabsd_core_data;
+      struct sgi_core_struct *sgi_core_data;
+      struct lynx_core_struct *lynx_core_data;
+      struct osf_core_struct *osf_core_data;
+      struct cisco_core_struct *cisco_core_data;
+      struct versados_data_struct *versados_data;
+      struct netbsd_core_struct *netbsd_core_data;
+      struct mach_o_data_struct *mach_o_data;
+      struct mach_o_fat_data_struct *mach_o_fat_data;
+      struct bfd_pef_data_struct *pef_data;
+      struct bfd_pef_xlib_data_struct *pef_xlib_data;
+      struct bfd_sym_data_struct *sym_data;
+      void *any;
+    }
+  tdata;
+
+  /* Used by the application to hold private data.  */
+  void *usrdata;
+
+  /* Where all the allocated stuff under this BFD goes.  This is a
+     struct objalloc *, but we use void * to avoid requiring the inclusion
+     of objalloc.h.  */
+  void *memory;
+};
+
+typedef enum bfd_error
+{
+  bfd_error_no_error = 0,
+  bfd_error_system_call,
+  bfd_error_invalid_target,
+  bfd_error_wrong_format,
+  bfd_error_wrong_object_format,
+  bfd_error_invalid_operation,
+  bfd_error_no_memory,
+  bfd_error_no_symbols,
+  bfd_error_no_armap,
+  bfd_error_no_more_archived_files,
+  bfd_error_malformed_archive,
+  bfd_error_file_not_recognized,
+  bfd_error_file_ambiguously_recognized,
+  bfd_error_no_contents,
+  bfd_error_nonrepresentable_section,
+  bfd_error_no_debug_section,
+  bfd_error_bad_value,
+  bfd_error_file_truncated,
+  bfd_error_file_too_big,
+  bfd_error_on_input,
+  bfd_error_invalid_error_code
+}
+bfd_error_type;
+
+bfd_error_type bfd_get_error (void);
+
+void bfd_set_error (bfd_error_type error_tag, ...);
+
+const char *bfd_errmsg (bfd_error_type error_tag);
+
+void bfd_perror (const char *message);
+
+typedef void (*bfd_error_handler_type) (const char *, ...);
+
+bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type);
+
+void bfd_set_error_program_name (const char *);
+
+bfd_error_handler_type bfd_get_error_handler (void);
+
+long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect);
+
+long bfd_canonicalize_reloc
+   (bfd *abfd, asection *sec, arelent **loc, asymbol **syms);
+
+void bfd_set_reloc
+   (bfd *abfd, asection *sec, arelent **rel, unsigned int count);
+
+bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags);
+
+int bfd_get_arch_size (bfd *abfd);
+
+int bfd_get_sign_extend_vma (bfd *abfd);
+
+bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma);
+
+unsigned int bfd_get_gp_size (bfd *abfd);
+
+void bfd_set_gp_size (bfd *abfd, unsigned int i);
+
+bfd_vma bfd_scan_vma (const char *string, const char **end, int base);
+
+bfd_boolean bfd_copy_private_header_data (bfd *ibfd, bfd *obfd);
+
+#define bfd_copy_private_header_data(ibfd, obfd) \
+     BFD_SEND (obfd, _bfd_copy_private_header_data, \
+               (ibfd, obfd))
+bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd);
+
+#define bfd_copy_private_bfd_data(ibfd, obfd) \
+     BFD_SEND (obfd, _bfd_copy_private_bfd_data, \
+               (ibfd, obfd))
+bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd);
+
+#define bfd_merge_private_bfd_data(ibfd, obfd) \
+     BFD_SEND (obfd, _bfd_merge_private_bfd_data, \
+               (ibfd, obfd))
+bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags);
+
+#define bfd_set_private_flags(abfd, flags) \
+     BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags))
+#define bfd_sizeof_headers(abfd, info) \
+       BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, info))
+
+#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \
+       BFD_SEND (abfd, _bfd_find_nearest_line, \
+                 (abfd, sec, syms, off, file, func, line))
+
+#define bfd_find_line(abfd, syms, sym, file, line) \
+       BFD_SEND (abfd, _bfd_find_line, \
+                 (abfd, syms, sym, file, line))
+
+#define bfd_find_inliner_info(abfd, file, func, line) \
+       BFD_SEND (abfd, _bfd_find_inliner_info, \
+                 (abfd, file, func, line))
+
+#define bfd_debug_info_start(abfd) \
+       BFD_SEND (abfd, _bfd_debug_info_start, (abfd))
+
+#define bfd_debug_info_end(abfd) \
+       BFD_SEND (abfd, _bfd_debug_info_end, (abfd))
+
+#define bfd_debug_info_accumulate(abfd, section) \
+       BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section))
+
+#define bfd_stat_arch_elt(abfd, stat) \
+       BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat))
+
+#define bfd_update_armap_timestamp(abfd) \
+       BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd))
+
+#define bfd_set_arch_mach(abfd, arch, mach)\
+       BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach))
+
+#define bfd_relax_section(abfd, section, link_info, again) \
+       BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again))
+
+#define bfd_gc_sections(abfd, link_info) \
+       BFD_SEND (abfd, _bfd_gc_sections, (abfd, link_info))
+
+#define bfd_merge_sections(abfd, link_info) \
+       BFD_SEND (abfd, _bfd_merge_sections, (abfd, link_info))
+
+#define bfd_is_group_section(abfd, sec) \
+       BFD_SEND (abfd, _bfd_is_group_section, (abfd, sec))
+
+#define bfd_discard_group(abfd, sec) \
+       BFD_SEND (abfd, _bfd_discard_group, (abfd, sec))
+
+#define bfd_link_hash_table_create(abfd) \
+       BFD_SEND (abfd, _bfd_link_hash_table_create, (abfd))
+
+#define bfd_link_hash_table_free(abfd, hash) \
+       BFD_SEND (abfd, _bfd_link_hash_table_free, (hash))
+
+#define bfd_link_add_symbols(abfd, info) \
+       BFD_SEND (abfd, _bfd_link_add_symbols, (abfd, info))
+
+#define bfd_link_just_syms(abfd, sec, info) \
+       BFD_SEND (abfd, _bfd_link_just_syms, (sec, info))
+
+#define bfd_final_link(abfd, info) \
+       BFD_SEND (abfd, _bfd_final_link, (abfd, info))
+
+#define bfd_free_cached_info(abfd) \
+       BFD_SEND (abfd, _bfd_free_cached_info, (abfd))
+
+#define bfd_get_dynamic_symtab_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_symtab_upper_bound, (abfd))
+
+#define bfd_print_private_bfd_data(abfd, file)\
+       BFD_SEND (abfd, _bfd_print_private_bfd_data, (abfd, file))
+
+#define bfd_canonicalize_dynamic_symtab(abfd, asymbols) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_symtab, (abfd, asymbols))
+
+#define bfd_get_synthetic_symtab(abfd, count, syms, dyncount, dynsyms, ret) \
+       BFD_SEND (abfd, _bfd_get_synthetic_symtab, (abfd, count, syms, \
+                                                   dyncount, dynsyms, ret))
+
+#define bfd_get_dynamic_reloc_upper_bound(abfd) \
+       BFD_SEND (abfd, _bfd_get_dynamic_reloc_upper_bound, (abfd))
+
+#define bfd_canonicalize_dynamic_reloc(abfd, arels, asyms) \
+       BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms))
+
+extern bfd_byte *bfd_get_relocated_section_contents
+  (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *,
+   bfd_boolean, asymbol **);
+
+bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative);
+
+struct bfd_preserve
+{
+  void *marker;
+  void *tdata;
+  flagword flags;
+  const struct bfd_arch_info *arch_info;
+  struct bfd_section *sections;
+  struct bfd_section *section_last;
+  unsigned int section_count;
+  struct bfd_hash_table section_htab;
+};
+
+bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *);
+
+void bfd_preserve_restore (bfd *, struct bfd_preserve *);
+
+void bfd_preserve_finish (bfd *, struct bfd_preserve *);
+
+bfd_vma bfd_emul_get_maxpagesize (const char *);
+
+void bfd_emul_set_maxpagesize (const char *, bfd_vma);
+
+bfd_vma bfd_emul_get_commonpagesize (const char *);
+
+void bfd_emul_set_commonpagesize (const char *, bfd_vma);
+
+/* Extracted from archive.c.  */
+symindex bfd_get_next_mapent
+   (bfd *abfd, symindex previous, carsym **sym);
+
+bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head);
+
+bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous);
+
+/* Extracted from corefile.c.  */
+const char *bfd_core_file_failing_command (bfd *abfd);
+
+int bfd_core_file_failing_signal (bfd *abfd);
+
+bfd_boolean core_file_matches_executable_p
+   (bfd *core_bfd, bfd *exec_bfd);
+
+bfd_boolean generic_core_file_matches_executable_p
+   (bfd *core_bfd, bfd *exec_bfd);
+
+/* Extracted from targets.c.  */
+#define BFD_SEND(bfd, message, arglist) \
+  ((*((bfd)->xvec->message)) arglist)
+
+#ifdef DEBUG_BFD_SEND
+#undef BFD_SEND
+#define BFD_SEND(bfd, message, arglist) \
+  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+    ((*((bfd)->xvec->message)) arglist) : \
+    (bfd_assert (__FILE__,__LINE__), NULL))
+#endif
+#define BFD_SEND_FMT(bfd, message, arglist) \
+  (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
+
+#ifdef DEBUG_BFD_SEND
+#undef BFD_SEND_FMT
+#define BFD_SEND_FMT(bfd, message, arglist) \
+  (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \
+   (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \
+   (bfd_assert (__FILE__,__LINE__), NULL))
+#endif
+
+enum bfd_flavour
+{
+  bfd_target_unknown_flavour,
+  bfd_target_aout_flavour,
+  bfd_target_coff_flavour,
+  bfd_target_ecoff_flavour,
+  bfd_target_xcoff_flavour,
+  bfd_target_elf_flavour,
+  bfd_target_ieee_flavour,
+  bfd_target_nlm_flavour,
+  bfd_target_oasys_flavour,
+  bfd_target_tekhex_flavour,
+  bfd_target_srec_flavour,
+  bfd_target_ihex_flavour,
+  bfd_target_som_flavour,
+  bfd_target_os9k_flavour,
+  bfd_target_versados_flavour,
+  bfd_target_msdos_flavour,
+  bfd_target_ovax_flavour,
+  bfd_target_evax_flavour,
+  bfd_target_mmo_flavour,
+  bfd_target_mach_o_flavour,
+  bfd_target_pef_flavour,
+  bfd_target_pef_xlib_flavour,
+  bfd_target_sym_flavour
+};
+
+enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN };
+
+/* Forward declaration.  */
+typedef struct bfd_link_info _bfd_link_info;
+
+typedef struct bfd_target
+{
+  /* Identifies the kind of target, e.g., SunOS4, Ultrix, etc.  */
+  char *name;
+
+ /* The "flavour" of a back end is a general indication about
+    the contents of a file.  */
+  enum bfd_flavour flavour;
+
+  /* The order of bytes within the data area of a file.  */
+  enum bfd_endian byteorder;
+
+ /* The order of bytes within the header parts of a file.  */
+  enum bfd_endian header_byteorder;
+
+  /* A mask of all the flags which an executable may have set -
+     from the set <<BFD_NO_FLAGS>>, <<HAS_RELOC>>, ...<<D_PAGED>>.  */
+  flagword object_flags;
+
+ /* A mask of all the flags which a section may have set - from
+    the set <<SEC_NO_FLAGS>>, <<SEC_ALLOC>>, ...<<SET_NEVER_LOAD>>.  */
+  flagword section_flags;
+
+ /* The character normally found at the front of a symbol.
+    (if any), perhaps `_'.  */
+  char symbol_leading_char;
+
+ /* The pad character for file names within an archive header.  */
+  char ar_pad_char;
+
+  /* The maximum number of characters in an archive header.  */
+  unsigned short ar_max_namelen;
+
+  /* Entries for byte swapping for data. These are different from the
+     other entry points, since they don't take a BFD as the first argument.
+     Certain other handlers could do the same.  */
+  bfd_uint64_t   (*bfd_getx64) (const void *);
+  bfd_int64_t    (*bfd_getx_signed_64) (const void *);
+  void           (*bfd_putx64) (bfd_uint64_t, void *);
+  bfd_vma        (*bfd_getx32) (const void *);
+  bfd_signed_vma (*bfd_getx_signed_32) (const void *);
+  void           (*bfd_putx32) (bfd_vma, void *);
+  bfd_vma        (*bfd_getx16) (const void *);
+  bfd_signed_vma (*bfd_getx_signed_16) (const void *);
+  void           (*bfd_putx16) (bfd_vma, void *);
+
+  /* Byte swapping for the headers.  */
+  bfd_uint64_t   (*bfd_h_getx64) (const void *);
+  bfd_int64_t    (*bfd_h_getx_signed_64) (const void *);
+  void           (*bfd_h_putx64) (bfd_uint64_t, void *);
+  bfd_vma        (*bfd_h_getx32) (const void *);
+  bfd_signed_vma (*bfd_h_getx_signed_32) (const void *);
+  void           (*bfd_h_putx32) (bfd_vma, void *);
+  bfd_vma        (*bfd_h_getx16) (const void *);
+  bfd_signed_vma (*bfd_h_getx_signed_16) (const void *);
+  void           (*bfd_h_putx16) (bfd_vma, void *);
+
+  /* Format dependent routines: these are vectors of entry points
+     within the target vector structure, one for each format to check.  */
+
+  /* Check the format of a file being read.  Return a <<bfd_target *>> or zero.  */
+  const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *);
+
+  /* Set the format of a file being written.  */
+  bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *);
+
+  /* Write cached information into a file being written, at <<bfd_close>>.  */
+  bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *);
+
+
+  /* Generic entry points.  */
+#define BFD_JUMP_TABLE_GENERIC(NAME) \
+  NAME##_close_and_cleanup, \
+  NAME##_bfd_free_cached_info, \
+  NAME##_new_section_hook, \
+  NAME##_get_section_contents, \
+  NAME##_get_section_contents_in_window
+
+  /* Called when the BFD is being closed to do any necessary cleanup.  */
+  bfd_boolean (*_close_and_cleanup) (bfd *);
+  /* Ask the BFD to free all cached information.  */
+  bfd_boolean (*_bfd_free_cached_info) (bfd *);
+  /* Called when a new section is created.  */
+  bfd_boolean (*_new_section_hook) (bfd *, sec_ptr);
+  /* Read the contents of a section.  */
+  bfd_boolean (*_bfd_get_section_contents)
+    (bfd *, sec_ptr, void *, file_ptr, bfd_size_type);
+  bfd_boolean (*_bfd_get_section_contents_in_window)
+    (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type);
+
+  /* Entry points to copy private data.  */
+#define BFD_JUMP_TABLE_COPY(NAME) \
+  NAME##_bfd_copy_private_bfd_data, \
+  NAME##_bfd_merge_private_bfd_data, \
+  _bfd_generic_init_private_section_data, \
+  NAME##_bfd_copy_private_section_data, \
+  NAME##_bfd_copy_private_symbol_data, \
+  NAME##_bfd_copy_private_header_data, \
+  NAME##_bfd_set_private_flags, \
+  NAME##_bfd_print_private_bfd_data
+
+  /* Called to copy BFD general private data from one object file
+     to another.  */
+  bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *);
+  /* Called to merge BFD general private data from one object file
+     to a common output file when linking.  */
+  bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *);
+  /* Called to initialize BFD private section data from one object file
+     to another.  */
+#define bfd_init_private_section_data(ibfd, isec, obfd, osec, link_info) \
+  BFD_SEND (obfd, _bfd_init_private_section_data, (ibfd, isec, obfd, osec, link_info))
+  bfd_boolean (*_bfd_init_private_section_data)
+    (bfd *, sec_ptr, bfd *, sec_ptr, struct bfd_link_info *);
+  /* Called to copy BFD private section data from one object file
+     to another.  */
+  bfd_boolean (*_bfd_copy_private_section_data)
+    (bfd *, sec_ptr, bfd *, sec_ptr);
+  /* Called to copy BFD private symbol data from one symbol
+     to another.  */
+  bfd_boolean (*_bfd_copy_private_symbol_data)
+    (bfd *, asymbol *, bfd *, asymbol *);
+  /* Called to copy BFD private header data from one object file
+     to another.  */
+  bfd_boolean (*_bfd_copy_private_header_data)
+    (bfd *, bfd *);
+  /* Called to set private backend flags.  */
+  bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword);
+
+  /* Called to print private BFD data.  */
+  bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *);
+
+  /* Core file entry points.  */
+#define BFD_JUMP_TABLE_CORE(NAME) \
+  NAME##_core_file_failing_command, \
+  NAME##_core_file_failing_signal, \
+  NAME##_core_file_matches_executable_p
+
+  char *      (*_core_file_failing_command) (bfd *);
+  int         (*_core_file_failing_signal) (bfd *);
+  bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *);
+
+  /* Archive entry points.  */
+#define BFD_JUMP_TABLE_ARCHIVE(NAME) \
+  NAME##_slurp_armap, \
+  NAME##_slurp_extended_name_table, \
+  NAME##_construct_extended_name_table, \
+  NAME##_truncate_arname, \
+  NAME##_write_armap, \
+  NAME##_read_ar_hdr, \
+  NAME##_openr_next_archived_file, \
+  NAME##_get_elt_at_index, \
+  NAME##_generic_stat_arch_elt, \
+  NAME##_update_armap_timestamp
+
+  bfd_boolean (*_bfd_slurp_armap) (bfd *);
+  bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *);
+  bfd_boolean (*_bfd_construct_extended_name_table)
+    (bfd *, char **, bfd_size_type *, const char **);
+  void        (*_bfd_truncate_arname) (bfd *, const char *, char *);
+  bfd_boolean (*write_armap)
+    (bfd *, unsigned int, struct orl *, unsigned int, int);
+  void *      (*_bfd_read_ar_hdr_fn) (bfd *);
+  bfd *       (*openr_next_archived_file) (bfd *, bfd *);
+#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i))
+  bfd *       (*_bfd_get_elt_at_index) (bfd *, symindex);
+  int         (*_bfd_stat_arch_elt) (bfd *, struct stat *);
+  bfd_boolean (*_bfd_update_armap_timestamp) (bfd *);
+
+  /* Entry points used for symbols.  */
+#define BFD_JUMP_TABLE_SYMBOLS(NAME) \
+  NAME##_get_symtab_upper_bound, \
+  NAME##_canonicalize_symtab, \
+  NAME##_make_empty_symbol, \
+  NAME##_print_symbol, \
+  NAME##_get_symbol_info, \
+  NAME##_bfd_is_local_label_name, \
+  NAME##_bfd_is_target_special_symbol, \
+  NAME##_get_lineno, \
+  NAME##_find_nearest_line, \
+  _bfd_generic_find_line, \
+  NAME##_find_inliner_info, \
+  NAME##_bfd_make_debug_symbol, \
+  NAME##_read_minisymbols, \
+  NAME##_minisymbol_to_symbol
+
+  long        (*_bfd_get_symtab_upper_bound) (bfd *);
+  long        (*_bfd_canonicalize_symtab)
+    (bfd *, struct bfd_symbol **);
+  struct bfd_symbol *
+              (*_bfd_make_empty_symbol) (bfd *);
+  void        (*_bfd_print_symbol)
+    (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type);
+#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e))
+  void        (*_bfd_get_symbol_info)
+    (bfd *, struct bfd_symbol *, symbol_info *);
+#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e))
+  bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *);
+  bfd_boolean (*_bfd_is_target_special_symbol) (bfd *, asymbol *);
+  alent *     (*_get_lineno) (bfd *, struct bfd_symbol *);
+  bfd_boolean (*_bfd_find_nearest_line)
+    (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma,
+     const char **, const char **, unsigned int *);
+  bfd_boolean (*_bfd_find_line)
+    (bfd *, struct bfd_symbol **, struct bfd_symbol *,
+     const char **, unsigned int *);
+  bfd_boolean (*_bfd_find_inliner_info)
+    (bfd *, const char **, const char **, unsigned int *);
+ /* Back-door to allow format-aware applications to create debug symbols
+    while using BFD for everything else.  Currently used by the assembler
+    when creating COFF files.  */
+  asymbol *   (*_bfd_make_debug_symbol)
+    (bfd *, void *, unsigned long size);
+#define bfd_read_minisymbols(b, d, m, s) \
+  BFD_SEND (b, _read_minisymbols, (b, d, m, s))
+  long        (*_read_minisymbols)
+    (bfd *, bfd_boolean, void **, unsigned int *);
+#define bfd_minisymbol_to_symbol(b, d, m, f) \
+  BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f))
+  asymbol *   (*_minisymbol_to_symbol)
+    (bfd *, bfd_boolean, const void *, asymbol *);
+
+  /* Routines for relocs.  */
+#define BFD_JUMP_TABLE_RELOCS(NAME) \
+  NAME##_get_reloc_upper_bound, \
+  NAME##_canonicalize_reloc, \
+  NAME##_bfd_reloc_type_lookup
+
+  long        (*_get_reloc_upper_bound) (bfd *, sec_ptr);
+  long        (*_bfd_canonicalize_reloc)
+    (bfd *, sec_ptr, arelent **, struct bfd_symbol **);
+  /* See documentation on reloc types.  */
+  reloc_howto_type *
+              (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type);
+
+  /* Routines used when writing an object file.  */
+#define BFD_JUMP_TABLE_WRITE(NAME) \
+  NAME##_set_arch_mach, \
+  NAME##_set_section_contents
+
+  bfd_boolean (*_bfd_set_arch_mach)
+    (bfd *, enum bfd_architecture, unsigned long);
+  bfd_boolean (*_bfd_set_section_contents)
+    (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type);
+
+  /* Routines used by the linker.  */
+#define BFD_JUMP_TABLE_LINK(NAME) \
+  NAME##_sizeof_headers, \
+  NAME##_bfd_get_relocated_section_contents, \
+  NAME##_bfd_relax_section, \
+  NAME##_bfd_link_hash_table_create, \
+  NAME##_bfd_link_hash_table_free, \
+  NAME##_bfd_link_add_symbols, \
+  NAME##_bfd_link_just_syms, \
+  NAME##_bfd_final_link, \
+  NAME##_bfd_link_split_section, \
+  NAME##_bfd_gc_sections, \
+  NAME##_bfd_merge_sections, \
+  NAME##_bfd_is_group_section, \
+  NAME##_bfd_discard_group, \
+  NAME##_section_already_linked \
+
+  int         (*_bfd_sizeof_headers) (bfd *, struct bfd_link_info *);
+  bfd_byte *  (*_bfd_get_relocated_section_contents)
+    (bfd *, struct bfd_link_info *, struct bfd_link_order *,
+     bfd_byte *, bfd_boolean, struct bfd_symbol **);
+
+  bfd_boolean (*_bfd_relax_section)
+    (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *);
+
+  /* Create a hash table for the linker.  Different backends store
+     different information in this table.  */
+  struct bfd_link_hash_table *
+              (*_bfd_link_hash_table_create) (bfd *);
+
+  /* Release the memory associated with the linker hash table.  */
+  void        (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *);
+
+  /* Add symbols from this object file into the hash table.  */
+  bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *);
+
+  /* Indicate that we are only retrieving symbol values from this section.  */
+  void        (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
+
+  /* Do a link based on the link_order structures attached to each
+     section of the BFD.  */
+  bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
+
+  /* Should this section be split up into smaller pieces during linking.  */
+  bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *);
+
+  /* Remove sections that are not referenced from the output.  */
+  bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *);
+
+  /* Attempt to merge SEC_MERGE sections.  */
+  bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *);
+
+  /* Is this section a member of a group?  */
+  bfd_boolean (*_bfd_is_group_section) (bfd *, const struct bfd_section *);
+
+  /* Discard members of a group.  */
+  bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *);
+
+  /* Check if SEC has been already linked during a reloceatable or
+     final link.  */
+  void (*_section_already_linked) (bfd *, struct bfd_section *,
+                                   struct bfd_link_info *);
+
+  /* Routines to handle dynamic symbols and relocs.  */
+#define BFD_JUMP_TABLE_DYNAMIC(NAME) \
+  NAME##_get_dynamic_symtab_upper_bound, \
+  NAME##_canonicalize_dynamic_symtab, \
+  NAME##_get_synthetic_symtab, \
+  NAME##_get_dynamic_reloc_upper_bound, \
+  NAME##_canonicalize_dynamic_reloc
+
+  /* Get the amount of memory required to hold the dynamic symbols.  */
+  long        (*_bfd_get_dynamic_symtab_upper_bound) (bfd *);
+  /* Read in the dynamic symbols.  */
+  long        (*_bfd_canonicalize_dynamic_symtab)
+    (bfd *, struct bfd_symbol **);
+  /* Create synthetized symbols.  */
+  long        (*_bfd_get_synthetic_symtab)
+    (bfd *, long, struct bfd_symbol **, long, struct bfd_symbol **,
+     struct bfd_symbol **);
+  /* Get the amount of memory required to hold the dynamic relocs.  */
+  long        (*_bfd_get_dynamic_reloc_upper_bound) (bfd *);
+  /* Read in the dynamic relocs.  */
+  long        (*_bfd_canonicalize_dynamic_reloc)
+    (bfd *, arelent **, struct bfd_symbol **);
+
+  /* Opposite endian version of this target.  */
+  const struct bfd_target * alternative_target;
+
+  /* Data for use by back-end routines, which isn't
+     generic enough to belong in this structure.  */
+  const void *backend_data;
+
+} bfd_target;
+
+bfd_boolean bfd_set_default_target (const char *name);
+
+const bfd_target *bfd_find_target (const char *target_name, bfd *abfd);
+
+const char ** bfd_target_list (void);
+
+const bfd_target *bfd_search_for_target
+   (int (*search_func) (const bfd_target *, void *),
+    void *);
+
+/* Extracted from format.c.  */
+bfd_boolean bfd_check_format (bfd *abfd, bfd_format format);
+
+bfd_boolean bfd_check_format_matches
+   (bfd *abfd, bfd_format format, char ***matching);
+
+bfd_boolean bfd_set_format (bfd *abfd, bfd_format format);
+
+const char *bfd_format_string (bfd_format format);
+
+/* Extracted from linker.c.  */
+bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec);
+
+#define bfd_link_split_section(abfd, sec) \
+       BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec))
+
+void bfd_section_already_linked (bfd *abfd, asection *sec,
+    struct bfd_link_info *info);
+
+#define bfd_section_already_linked(abfd, sec, info) \
+       BFD_SEND (abfd, _section_already_linked, (abfd, sec, info))
+
+/* Extracted from simple.c.  */
+bfd_byte *bfd_simple_get_relocated_section_contents
+   (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table);
+
+#ifdef __cplusplus
+}
+#endif
+#endif

+ 350 - 0
external/dasm-tigcc/dis-asm.h

@@ -0,0 +1,350 @@
+/* Interface between the opcode library and its callers.
+
+   Copyright 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor,
+   Boston, MA 02110-1301, USA.
+
+   Written by Cygnus Support, 1993.
+
+   The opcode library (libopcodes.a) provides instruction decoders for
+   a large variety of instruction sets, callable with an identical
+   interface, for making instruction-processing programs more independent
+   of the instruction set being processed.  */
+
+#ifndef DIS_ASM_H
+#define DIS_ASM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include "bfd.h"
+
+typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;
+
+enum dis_insn_type
+{
+  dis_noninsn,			/* Not a valid instruction */
+  dis_nonbranch,		/* Not a branch instruction */
+  dis_branch,			/* Unconditional branch */
+  dis_condbranch,		/* Conditional branch */
+  dis_jsr,			/* Jump to subroutine */
+  dis_condjsr,			/* Conditional jump to subroutine */
+  dis_dref,			/* Data reference instruction */
+  dis_dref2			/* Two data references in instruction */
+};
+
+/* This struct is passed into the instruction decoding routine,
+   and is passed back out into each callback.  The various fields are used
+   for conveying information from your main routine into your callbacks,
+   for passing information into the instruction decoders (such as the
+   addresses of the callback functions), or for passing information
+   back from the instruction decoders to their callers.
+
+   It must be initialized before it is first passed; this can be done
+   by hand, or using one of the initialization macros below.  */
+
+typedef struct disassemble_info
+{
+  fprintf_ftype fprintf_func;
+  void *stream;
+  void *application_data;
+
+  /* Target description.  We could replace this with a pointer to the bfd,
+     but that would require one.  There currently isn't any such requirement
+     so to avoid introducing one we record these explicitly.  */
+  /* The bfd_flavour.  This can be bfd_target_unknown_flavour.  */
+  enum bfd_flavour flavour;
+  /* The bfd_arch value.  */
+  enum bfd_architecture arch;
+  /* The bfd_mach value.  */
+  unsigned long mach;
+  /* Endianness (for bi-endian cpus).  Mono-endian cpus can ignore this.  */
+  enum bfd_endian endian;
+  /* An arch/mach-specific bitmask of selected instruction subsets, mainly
+     for processors with run-time-switchable instruction sets.  The default,
+     zero, means that there is no constraint.  CGEN-based opcodes ports
+     may use ISA_foo masks.  */
+  void *insn_sets;
+
+  /* Some targets need information about the current section to accurately
+     display insns.  If this is NULL, the target disassembler function
+     will have to make its best guess.  */
+  asection *section;
+
+  /* An array of pointers to symbols either at the location being disassembled
+     or at the start of the function being disassembled.  The array is sorted
+     so that the first symbol is intended to be the one used.  The others are
+     present for any misc. purposes.  This is not set reliably, but if it is
+     not NULL, it is correct.  */
+  asymbol **symbols;
+  /* Number of symbols in array.  */
+  int num_symbols;
+
+  /* Symbol table provided for targets that want to look at it.  This is
+     used on Arm to find mapping symbols and determine Arm/Thumb code.  */
+  asymbol **symtab;
+  int symtab_pos;
+  int symtab_size;
+
+  /* For use by the disassembler.
+     The top 16 bits are reserved for public use (and are documented here).
+     The bottom 16 bits are for the internal use of the disassembler.  */
+  unsigned long flags;
+#define INSN_HAS_RELOC	0x80000000
+  void *private_data;
+
+  /* Function used to get bytes to disassemble.  MEMADDR is the
+     address of the stuff to be disassembled, MYADDR is the address to
+     put the bytes in, and LENGTH is the number of bytes to read.
+     INFO is a pointer to this struct.
+     Returns an errno value or 0 for success.  */
+  int (*read_memory_func)
+    (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length,
+     struct disassemble_info *info);
+
+  /* Function which should be called if we get an error that we can't
+     recover from.  STATUS is the errno value from read_memory_func and
+     MEMADDR is the address that we were trying to read.  INFO is a
+     pointer to this struct.  */
+  void (*memory_error_func)
+    (int status, bfd_vma memaddr, struct disassemble_info *info);
+
+  /* Function called to print ADDR.  */
+  void (*print_address_func)
+    (bfd_vma addr, struct disassemble_info *info);
+
+  /* Function called to determine if there is a symbol at the given ADDR.
+     If there is, the function returns 1, otherwise it returns 0.
+     This is used by ports which support an overlay manager where
+     the overlay number is held in the top part of an address.  In
+     some circumstances we want to include the overlay number in the
+     address, (normally because there is a symbol associated with
+     that address), but sometimes we want to mask out the overlay bits.  */
+  int (* symbol_at_address_func)
+    (bfd_vma addr, struct disassemble_info * info);
+
+  /* Function called to check if a SYMBOL is can be displayed to the user.
+     This is used by some ports that want to hide special symbols when
+     displaying debugging outout.  */
+  bfd_boolean (* symbol_is_valid)
+    (asymbol *, struct disassemble_info * info);
+
+  /* These are for buffer_read_memory.  */
+  bfd_byte *buffer;
+  bfd_vma buffer_vma;
+  unsigned int buffer_length;
+
+  /* This variable may be set by the instruction decoder.  It suggests
+      the number of bytes objdump should display on a single line.  If
+      the instruction decoder sets this, it should always set it to
+      the same value in order to get reasonable looking output.  */
+  int bytes_per_line;
+
+  /* The next two variables control the way objdump displays the raw data.  */
+  /* For example, if bytes_per_line is 8 and bytes_per_chunk is 4, the */
+  /* output will look like this:
+     00:   00000000 00000000
+     with the chunks displayed according to "display_endian". */
+  int bytes_per_chunk;
+  enum bfd_endian display_endian;
+
+  /* Number of octets per incremented target address
+     Normally one, but some DSPs have byte sizes of 16 or 32 bits.  */
+  unsigned int octets_per_byte;
+
+  /* The number of zeroes we want to see at the end of a section before we
+     start skipping them.  */
+  unsigned int skip_zeroes;
+
+  /* The number of zeroes to skip at the end of a section.  If the number
+     of zeroes at the end is between SKIP_ZEROES_AT_END and SKIP_ZEROES,
+     they will be disassembled.  If there are fewer than
+     SKIP_ZEROES_AT_END, they will be skipped.  This is a heuristic
+     attempt to avoid disassembling zeroes inserted by section
+     alignment.  */
+  unsigned int skip_zeroes_at_end;
+
+  /* Whether the disassembler always needs the relocations.  */
+  bfd_boolean disassembler_needs_relocs;
+
+  /* Results from instruction decoders.  Not all decoders yet support
+     this information.  This info is set each time an instruction is
+     decoded, and is only valid for the last such instruction.
+
+     To determine whether this decoder supports this information, set
+     insn_info_valid to 0, decode an instruction, then check it.  */
+
+  char insn_info_valid;		/* Branch info has been set. */
+  char branch_delay_insns;	/* How many sequential insn's will run before
+				   a branch takes effect.  (0 = normal) */
+  char data_size;		/* Size of data reference in insn, in bytes */
+  enum dis_insn_type insn_type;	/* Type of instruction */
+  bfd_vma target;		/* Target address of branch or dref, if known;
+				   zero if unknown.  */
+  bfd_vma target2;		/* Second target address for dref2 */
+
+  /* Command line options specific to the target disassembler.  */
+  char * disassembler_options;
+
+} disassemble_info;
+
+
+/* Standard disassemblers.  Disassemble one instruction at the given
+   target address.  Return number of octets processed.  */
+typedef int (*disassembler_ftype) (bfd_vma, disassemble_info *);
+
+extern int print_insn_alpha		(bfd_vma, disassemble_info *);
+extern int print_insn_avr		(bfd_vma, disassemble_info *);
+extern int print_insn_bfin		(bfd_vma, disassemble_info *);
+extern int print_insn_big_arm		(bfd_vma, disassemble_info *);
+extern int print_insn_big_mips		(bfd_vma, disassemble_info *);
+extern int print_insn_big_or32		(bfd_vma, disassemble_info *);
+extern int print_insn_big_powerpc	(bfd_vma, disassemble_info *);
+extern int print_insn_big_score         (bfd_vma, disassemble_info *);
+extern int print_insn_crx               (bfd_vma, disassemble_info *);
+extern int print_insn_d10v		(bfd_vma, disassemble_info *);
+extern int print_insn_d30v		(bfd_vma, disassemble_info *);
+extern int print_insn_dlx 		(bfd_vma, disassemble_info *);
+extern int print_insn_fr30		(bfd_vma, disassemble_info *);
+extern int print_insn_frv		(bfd_vma, disassemble_info *);
+extern int print_insn_h8300		(bfd_vma, disassemble_info *);
+extern int print_insn_h8300h		(bfd_vma, disassemble_info *);
+extern int print_insn_h8300s		(bfd_vma, disassemble_info *);
+extern int print_insn_h8500		(bfd_vma, disassemble_info *);
+extern int print_insn_hppa		(bfd_vma, disassemble_info *);
+extern int print_insn_i370		(bfd_vma, disassemble_info *);
+extern int print_insn_i386		(bfd_vma, disassemble_info *);
+extern int print_insn_i386_att		(bfd_vma, disassemble_info *);
+extern int print_insn_i386_intel	(bfd_vma, disassemble_info *);
+extern int print_insn_i860		(bfd_vma, disassemble_info *);
+extern int print_insn_i960		(bfd_vma, disassemble_info *);
+extern int print_insn_ia64		(bfd_vma, disassemble_info *);
+extern int print_insn_ip2k		(bfd_vma, disassemble_info *);
+extern int print_insn_iq2000		(bfd_vma, disassemble_info *);
+extern int print_insn_little_arm	(bfd_vma, disassemble_info *);
+extern int print_insn_little_mips	(bfd_vma, disassemble_info *);
+extern int print_insn_little_or32	(bfd_vma, disassemble_info *);
+extern int print_insn_little_powerpc	(bfd_vma, disassemble_info *);
+extern int print_insn_little_score      (bfd_vma, disassemble_info *); 
+extern int print_insn_m32c	        (bfd_vma, disassemble_info *);
+extern int print_insn_m32r		(bfd_vma, disassemble_info *);
+extern int print_insn_m68hc11		(bfd_vma, disassemble_info *);
+extern int print_insn_m68hc12		(bfd_vma, disassemble_info *);
+extern int print_insn_m68k		(bfd_vma, disassemble_info *);
+extern int print_insn_m88k		(bfd_vma, disassemble_info *);
+extern int print_insn_maxq_big		(bfd_vma, disassemble_info *);
+extern int print_insn_maxq_little	(bfd_vma, disassemble_info *);
+extern int print_insn_mcore		(bfd_vma, disassemble_info *);
+extern int print_insn_mmix		(bfd_vma, disassemble_info *);
+extern int print_insn_mn10200		(bfd_vma, disassemble_info *);
+extern int print_insn_mn10300		(bfd_vma, disassemble_info *);
+extern int print_insn_msp430		(bfd_vma, disassemble_info *);
+extern int print_insn_mt                (bfd_vma, disassemble_info *);
+extern int print_insn_ns32k		(bfd_vma, disassemble_info *);
+extern int print_insn_openrisc		(bfd_vma, disassemble_info *);
+extern int print_insn_pdp11		(bfd_vma, disassemble_info *);
+extern int print_insn_pj		(bfd_vma, disassemble_info *);
+extern int print_insn_rs6000		(bfd_vma, disassemble_info *);
+extern int print_insn_s390		(bfd_vma, disassemble_info *);
+extern int print_insn_sh		(bfd_vma, disassemble_info *);
+extern int print_insn_sh64		(bfd_vma, disassemble_info *);
+extern int print_insn_sh64x_media	(bfd_vma, disassemble_info *);
+extern int print_insn_sparc		(bfd_vma, disassemble_info *);
+extern int print_insn_spu		(bfd_vma, disassemble_info *);
+extern int print_insn_tic30		(bfd_vma, disassemble_info *);
+extern int print_insn_tic4x		(bfd_vma, disassemble_info *);
+extern int print_insn_tic54x		(bfd_vma, disassemble_info *);
+extern int print_insn_tic80		(bfd_vma, disassemble_info *);
+extern int print_insn_v850		(bfd_vma, disassemble_info *);
+extern int print_insn_vax		(bfd_vma, disassemble_info *);
+extern int print_insn_w65		(bfd_vma, disassemble_info *);
+extern int print_insn_xc16x		(bfd_vma, disassemble_info *);
+extern int print_insn_xstormy16		(bfd_vma, disassemble_info *);
+extern int print_insn_xtensa		(bfd_vma, disassemble_info *);
+extern int print_insn_z80		(bfd_vma, disassemble_info *);
+extern int print_insn_z8001		(bfd_vma, disassemble_info *);
+extern int print_insn_z8002		(bfd_vma, disassemble_info *);
+
+extern disassembler_ftype arc_get_disassembler (void *);
+extern disassembler_ftype cris_get_disassembler (bfd *);
+
+extern void print_mips_disassembler_options (FILE *);
+extern void print_ppc_disassembler_options (FILE *);
+extern void print_arm_disassembler_options (FILE *);
+extern void parse_arm_disassembler_option (char *);
+extern int  get_arm_regname_num_options (void);
+extern int  set_arm_regname_option (int);
+extern int  get_arm_regnames (int, const char **, const char **, const char *const **);
+extern bfd_boolean arm_symbol_is_valid (asymbol *, struct disassemble_info *);
+
+/* Fetch the disassembler for a given BFD, if that support is available.  */
+extern disassembler_ftype disassembler (bfd *);
+
+/* Amend the disassemble_info structure as necessary for the target architecture.
+   Should only be called after initialising the info->arch field.  */
+extern void disassemble_init_for_target (struct disassemble_info * info);
+
+/* Document any target specific options available from the disassembler.  */
+extern void disassembler_usage (FILE *);
+
+
+/* This block of definitions is for particular callers who read instructions
+   into a buffer before calling the instruction decoder.  */
+
+/* Here is a function which callers may wish to use for read_memory_func.
+   It gets bytes from a buffer.  */
+extern int buffer_read_memory
+  (bfd_vma, bfd_byte *, unsigned int, struct disassemble_info *);
+
+/* This function goes with buffer_read_memory.
+   It prints a message using info->fprintf_func and info->stream.  */
+extern void perror_memory (int, bfd_vma, struct disassemble_info *);
+
+
+/* Just print the address in hex.  This is included for completeness even
+   though both GDB and objdump provide their own (to print symbolic
+   addresses).  */
+extern void generic_print_address
+  (bfd_vma, struct disassemble_info *);
+
+/* Always true.  */
+extern int generic_symbol_at_address
+  (bfd_vma, struct disassemble_info *);
+
+/* Also always true.  */
+extern bfd_boolean generic_symbol_is_valid
+  (asymbol *, struct disassemble_info *);
+
+/* Method to initialize a disassemble_info struct.  This should be
+   called by all applications creating such a struct.  */
+extern void init_disassemble_info (struct disassemble_info *info, void *stream,
+				   fprintf_ftype fprintf_func);
+
+/* For compatibility with existing code.  */
+#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
+  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
+#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
+  init_disassemble_info (&(INFO), (STREAM), (fprintf_ftype) (FPRINTF_FUNC))
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* ! defined (DIS_ASM_H) */

+ 102 - 0
external/dasm-tigcc/dis-buf.c

@@ -0,0 +1,102 @@
+/* Disassemble from a buffer, for GNU.
+   Copyright 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2005
+   Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+#include <errno.h>
+#include "opintl.h"
+
+/* Get LENGTH bytes from info's buffer, at target address memaddr.
+   Transfer them to myaddr.  */
+int
+buffer_read_memory (bfd_vma memaddr,
+		    bfd_byte *myaddr,
+		    unsigned int length,
+		    struct disassemble_info *info)
+{
+  unsigned int opb = info->octets_per_byte;
+  unsigned int end_addr_offset = length / opb;
+  unsigned int max_addr_offset = info->buffer_length / opb; 
+  unsigned int octets = (memaddr - info->buffer_vma) * opb;
+
+  if (memaddr < info->buffer_vma
+      || memaddr - info->buffer_vma + end_addr_offset > max_addr_offset)
+    /* Out of bounds.  Use EIO because GDB uses it.  */
+    return EIO;
+  memcpy (myaddr, info->buffer + octets, length);
+
+  return 0;
+}
+
+/* Print an error message.  We can assume that this is in response to
+   an error return from buffer_read_memory.  */
+
+void
+perror_memory (int status,
+	       bfd_vma memaddr,
+	       struct disassemble_info *info)
+{
+  if (status != EIO)
+    /* Can't happen.  */
+    info->fprintf_func (info->stream, _("Unknown error %d\n"), status);
+  else
+    {
+      char buf[30];
+
+      /* Actually, address between memaddr and memaddr + len was
+	 out of bounds.  */
+      sprintf_vma (buf, memaddr);
+      info->fprintf_func (info->stream,
+			  _("Address 0x%s is out of bounds.\n"), buf);
+    }
+}
+
+/* This could be in a separate file, to save miniscule amounts of space
+   in statically linked executables.  */
+
+/* Just print the address is hex.  This is included for completeness even
+   though both GDB and objdump provide their own (to print symbolic
+   addresses).  */
+
+void
+generic_print_address (bfd_vma addr, struct disassemble_info *info)
+{
+  char buf[30];
+
+  sprintf_vma (buf, addr);
+  (*info->fprintf_func) (info->stream, "0x%s", buf);
+}
+
+/* Just return true.  */
+
+int
+generic_symbol_at_address (bfd_vma addr ATTRIBUTE_UNUSED,
+			   struct disassemble_info *info ATTRIBUTE_UNUSED)
+{
+  return 1;
+}
+
+/* Just return TRUE.  */
+
+bfd_boolean
+generic_symbol_is_valid (asymbol * sym ATTRIBUTE_UNUSED,
+			 struct disassemble_info *info ATTRIBUTE_UNUSED)
+{
+  return TRUE;
+}

+ 43 - 0
external/dasm-tigcc/dis-init.c

@@ -0,0 +1,43 @@
+/* Initialize "struct disassemble_info".
+
+   Copyright 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+#include "bfd.h"
+
+void
+init_disassemble_info (struct disassemble_info *info, void *stream,
+		       fprintf_ftype fprintf_func)
+{
+  memset (info, 0, sizeof (*info));
+
+  info->flavour = bfd_target_unknown_flavour;
+  info->arch = bfd_arch_unknown;
+  info->endian = BFD_ENDIAN_UNKNOWN;
+  info->octets_per_byte = 1;
+  info->fprintf_func = fprintf_func;
+  info->stream = stream;
+  info->read_memory_func = buffer_read_memory;
+  info->memory_error_func = perror_memory;
+  info->print_address_func = generic_print_address;
+  info->symbol_at_address_func = generic_symbol_at_address;
+  info->symbol_is_valid = generic_symbol_is_valid;
+  info->display_endian = BFD_ENDIAN_UNKNOWN;
+}
+

+ 102 - 0
external/dasm-tigcc/disasm.c

@@ -0,0 +1,102 @@
+/* Disassemble support for GDB.
+
+   Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
+   Free Software Foundation, Inc.
+
+   Copyright 2007 Kevin Kofler
+
+   This file is part of GDB.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+#include <stdint.h>
+#include <limits.h>
+#include <stdarg.h>
+
+#include "sysdep.h"
+#include "disasm.h"
+#include "dis-asm.h"
+#include "romcalls.h"
+#include "main.h"
+
+/* Disassemble functions.
+   FIXME: We should get rid of all the duplicate code in gdb that does
+   the same thing: disassemble_command() and the gdbtk variation. */
+
+/* (TiEmu 20050429 Kevin Kofler) */
+static int
+sprintf_disasm (void *stream, const char *format, ...)
+{
+  int result;
+  va_list args;
+  va_start (args, format);
+  result = vsprintf ((char *)stream + strlen((char *)stream), format, args);
+  va_end (args);
+  return result;
+}
+
+static void
+strcat_disasm (const char *format, void *stream)
+{
+  strcat ((char *)stream, format);
+}
+
+static void
+print_address_1 (int32_t reladdr, uint32_t absaddr, int flags, void *stream,
+                 void (*fprintf_f) (void *, const char *, ...),
+                 void (*fputs_f) (const char *, void *))
+{
+  int rcid;
+  const char *rcname;
+  PrintAddress (reladdr, absaddr, flags, stream, fprintf_f, fputs_f);
+  if (((rcid = romcalls_is_addr (absaddr)) != -1)
+      && ((rcname = romcalls_get_name (rcid)) != NULL))
+    fprintf_f (stream, " /* tios::%s */", rcname);
+}
+
+static void
+dis_asm_sprint_address (bfd_vma addr, struct disassemble_info *info)
+{
+  print_address_1 (addr, info->target, info->flags, info->stream,
+                   (void (*) (void *, const char *, ...)) sprintf_disasm, strcat_disasm);
+}
+
+struct disassemble_info
+gdb_disassemble_info (unsigned char *mem_buf, char *output_buf)
+{
+  struct disassemble_info di;
+  init_disassemble_info (&di, output_buf, sprintf_disasm);
+  di.buffer = mem_buf;
+  di.buffer_length = UINT_MAX;
+  di.print_address_func = dis_asm_sprint_address;
+  di.flavour = bfd_target_unknown_flavour;
+  di.arch = bfd_arch_m68k;
+  di.mach = bfd_mach_m68000;
+  di.endian = BFD_ENDIAN_BIG;
+  disassemble_init_for_target (&di);
+  return di;
+}
+
+uint32_t Dasm68000(unsigned char *mem_buf, char *output_buf, uint32_t addr)
+{
+  struct disassemble_info di = gdb_disassemble_info(mem_buf, output_buf);
+  uint32_t offset;
+
+  *output_buf = 0;
+  di.buffer_vma = addr;
+  offset = print_insn_m68k(addr, &di);
+  return offset;
+}

+ 27 - 0
external/dasm-tigcc/disasm.h

@@ -0,0 +1,27 @@
+/*
+   dasm-tigcc - Disassembler for TI calculators
+
+   Copyright (C) 2007 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+*/
+
+#ifndef DISASM_H
+#define DISASM_H
+
+#include <stdint.h>
+uint32_t Dasm68000(unsigned char *mem_buf, char *output_buf, uint32_t addr);
+
+#endif

+ 501 - 0
external/dasm-tigcc/disassemble.c

@@ -0,0 +1,501 @@
+/* Select disassembly routine for specified architecture.
+   Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
+   2004, 2005, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+
+/* Kevin Kofler 20070404 dummy function */
+enum bfd_architecture bfd_get_arch (bfd *abfd ATTRIBUTE_UNUSED)
+{
+  return bfd_arch_m68k;
+}
+
+#ifdef ARCH_all
+#define ARCH_alpha
+#define ARCH_arc
+#define ARCH_arm
+#define ARCH_avr
+#define ARCH_bfin
+#define ARCH_cris
+#define ARCH_crx
+#define ARCH_d10v
+#define ARCH_d30v
+#define ARCH_dlx
+#define ARCH_fr30
+#define ARCH_frv
+#define ARCH_h8300
+#define ARCH_h8500
+#define ARCH_hppa
+#define ARCH_i370
+#define ARCH_i386
+#define ARCH_i860
+#define ARCH_i960
+#define ARCH_ia64
+#define ARCH_ip2k
+#define ARCH_iq2000
+#define ARCH_m32c
+#define ARCH_m32r
+#define ARCH_m68hc11
+#define ARCH_m68hc12
+#define ARCH_m68k
+#define ARCH_m88k
+#define ARCH_maxq
+#define ARCH_mcore
+#define ARCH_mips
+#define ARCH_mmix
+#define ARCH_mn10200
+#define ARCH_mn10300
+#define ARCH_mt
+#define ARCH_msp430
+#define ARCH_ns32k
+#define ARCH_openrisc
+#define ARCH_or32
+#define ARCH_pdp11
+#define ARCH_pj
+#define ARCH_powerpc
+#define ARCH_rs6000
+#define ARCH_s390
+#define ARCH_score
+#define ARCH_sh
+#define ARCH_sparc
+#define ARCH_spu
+#define ARCH_tic30
+#define ARCH_tic4x
+#define ARCH_tic54x
+#define ARCH_tic80
+#define ARCH_v850
+#define ARCH_vax
+#define ARCH_w65
+#define ARCH_xstormy16
+#define ARCH_xc16x
+#define ARCH_xtensa
+#define ARCH_z80
+#define ARCH_z8k
+#define INCLUDE_SHMEDIA
+#endif
+
+#ifdef ARCH_m32c
+#include "m32c-desc.h"
+#endif
+
+disassembler_ftype
+disassembler (abfd)
+     bfd *abfd;
+{
+  enum bfd_architecture a = bfd_get_arch (abfd);
+  disassembler_ftype disassemble;
+
+  switch (a)
+    {
+      /* If you add a case to this table, also add it to the
+	 ARCH_all definition right above this function.  */
+#ifdef ARCH_alpha
+    case bfd_arch_alpha:
+      disassemble = print_insn_alpha;
+      break;
+#endif
+#ifdef ARCH_arc
+    case bfd_arch_arc:
+      {
+	disassemble = arc_get_disassembler (abfd);
+	break;
+      }
+#endif
+#ifdef ARCH_arm
+    case bfd_arch_arm:
+      if (bfd_big_endian (abfd))
+	disassemble = print_insn_big_arm;
+      else
+	disassemble = print_insn_little_arm;
+      break;
+#endif
+#ifdef ARCH_avr
+    case bfd_arch_avr:
+      disassemble = print_insn_avr;
+      break;
+#endif
+#ifdef ARCH_bfin
+    case bfd_arch_bfin:
+      disassemble = print_insn_bfin;
+      break;
+#endif
+#ifdef ARCH_cris
+    case bfd_arch_cris:
+      disassemble = cris_get_disassembler (abfd);
+      break;
+#endif
+#ifdef ARCH_crx
+    case bfd_arch_crx:
+      disassemble = print_insn_crx;
+      break;
+#endif
+#ifdef ARCH_d10v
+    case bfd_arch_d10v:
+      disassemble = print_insn_d10v;
+      break;
+#endif
+#ifdef ARCH_d30v
+    case bfd_arch_d30v:
+      disassemble = print_insn_d30v;
+      break;
+#endif
+#ifdef ARCH_dlx
+    case bfd_arch_dlx:
+      /* As far as I know we only handle big-endian DLX objects.  */
+      disassemble = print_insn_dlx;
+      break;
+#endif
+#ifdef ARCH_h8300
+    case bfd_arch_h8300:
+      if (bfd_get_mach (abfd) == bfd_mach_h8300h
+	  || bfd_get_mach (abfd) == bfd_mach_h8300hn)
+	disassemble = print_insn_h8300h;
+      else if (bfd_get_mach (abfd) == bfd_mach_h8300s
+	       || bfd_get_mach (abfd) == bfd_mach_h8300sn
+	       || bfd_get_mach (abfd) == bfd_mach_h8300sx
+	       || bfd_get_mach (abfd) == bfd_mach_h8300sxn)
+	disassemble = print_insn_h8300s;
+      else
+	disassemble = print_insn_h8300;
+      break;
+#endif
+#ifdef ARCH_h8500
+    case bfd_arch_h8500:
+      disassemble = print_insn_h8500;
+      break;
+#endif
+#ifdef ARCH_hppa
+    case bfd_arch_hppa:
+      disassemble = print_insn_hppa;
+      break;
+#endif
+#ifdef ARCH_i370
+    case bfd_arch_i370:
+      disassemble = print_insn_i370;
+      break;
+#endif
+#ifdef ARCH_i386
+    case bfd_arch_i386:
+      disassemble = print_insn_i386;
+      break;
+#endif
+#ifdef ARCH_i860
+    case bfd_arch_i860:
+      disassemble = print_insn_i860;
+      break;
+#endif
+#ifdef ARCH_i960
+    case bfd_arch_i960:
+      disassemble = print_insn_i960;
+      break;
+#endif
+#ifdef ARCH_ia64
+    case bfd_arch_ia64:
+      disassemble = print_insn_ia64;
+      break;
+#endif
+#ifdef ARCH_ip2k
+    case bfd_arch_ip2k:
+      disassemble = print_insn_ip2k;
+      break;
+#endif
+#ifdef ARCH_fr30
+    case bfd_arch_fr30:
+      disassemble = print_insn_fr30;
+      break;
+#endif
+#ifdef ARCH_m32r
+    case bfd_arch_m32r:
+      disassemble = print_insn_m32r;
+      break;
+#endif
+#if defined(ARCH_m68hc11) || defined(ARCH_m68hc12)
+    case bfd_arch_m68hc11:
+      disassemble = print_insn_m68hc11;
+      break;
+    case bfd_arch_m68hc12:
+      disassemble = print_insn_m68hc12;
+      break;
+#endif
+#ifdef ARCH_m68k
+    case bfd_arch_m68k:
+      disassemble = print_insn_m68k;
+      break;
+#endif
+#ifdef ARCH_m88k
+    case bfd_arch_m88k:
+      disassemble = print_insn_m88k;
+      break;
+#endif
+#ifdef ARCH_maxq
+    case bfd_arch_maxq:
+      disassemble = print_insn_maxq_little;
+      break;
+#endif
+#ifdef ARCH_mt
+    case bfd_arch_mt:
+      disassemble = print_insn_mt;
+      break;
+#endif
+#ifdef ARCH_msp430
+    case bfd_arch_msp430:
+      disassemble = print_insn_msp430;
+      break;
+#endif
+#ifdef ARCH_ns32k
+    case bfd_arch_ns32k:
+      disassemble = print_insn_ns32k;
+      break;
+#endif
+#ifdef ARCH_mcore
+    case bfd_arch_mcore:
+      disassemble = print_insn_mcore;
+      break;
+#endif
+#ifdef ARCH_mips
+    case bfd_arch_mips:
+      if (bfd_big_endian (abfd))
+	disassemble = print_insn_big_mips;
+      else
+	disassemble = print_insn_little_mips;
+      break;
+#endif
+#ifdef ARCH_mmix
+    case bfd_arch_mmix:
+      disassemble = print_insn_mmix;
+      break;
+#endif
+#ifdef ARCH_mn10200
+    case bfd_arch_mn10200:
+      disassemble = print_insn_mn10200;
+      break;
+#endif
+#ifdef ARCH_mn10300
+    case bfd_arch_mn10300:
+      disassemble = print_insn_mn10300;
+      break;
+#endif
+#ifdef ARCH_openrisc
+    case bfd_arch_openrisc:
+      disassemble = print_insn_openrisc;
+      break;
+#endif
+#ifdef ARCH_or32
+    case bfd_arch_or32:
+      if (bfd_big_endian (abfd))
+        disassemble = print_insn_big_or32;
+      else
+        disassemble = print_insn_little_or32;
+      break;
+#endif
+#ifdef ARCH_pdp11
+    case bfd_arch_pdp11:
+      disassemble = print_insn_pdp11;
+      break;
+#endif
+#ifdef ARCH_pj
+    case bfd_arch_pj:
+      disassemble = print_insn_pj;
+      break;
+#endif
+#ifdef ARCH_powerpc
+    case bfd_arch_powerpc:
+      if (bfd_big_endian (abfd))
+	disassemble = print_insn_big_powerpc;
+      else
+	disassemble = print_insn_little_powerpc;
+      break;
+#endif
+#ifdef ARCH_rs6000
+    case bfd_arch_rs6000:
+      if (bfd_get_mach (abfd) == bfd_mach_ppc_620)
+	disassemble = print_insn_big_powerpc;
+      else
+	disassemble = print_insn_rs6000;
+      break;
+#endif
+#ifdef ARCH_s390
+    case bfd_arch_s390:
+      disassemble = print_insn_s390;
+      break;
+#endif
+#ifdef ARCH_score
+    case bfd_arch_score:
+      if (bfd_big_endian (abfd))
+        disassemble = print_insn_big_score;      
+      else
+        disassemble = print_insn_little_score; 
+     break;
+#endif
+#ifdef ARCH_sh
+    case bfd_arch_sh:
+      disassemble = print_insn_sh;
+      break;
+#endif
+#ifdef ARCH_sparc
+    case bfd_arch_sparc:
+      disassemble = print_insn_sparc;
+      break;
+#endif
+#ifdef ARCH_spu
+    case bfd_arch_spu:
+      disassemble = print_insn_spu;
+      break;
+#endif
+#ifdef ARCH_tic30
+    case bfd_arch_tic30:
+      disassemble = print_insn_tic30;
+      break;
+#endif
+#ifdef ARCH_tic4x
+    case bfd_arch_tic4x:
+      disassemble = print_insn_tic4x;
+      break;
+#endif
+#ifdef ARCH_tic54x
+    case bfd_arch_tic54x:
+      disassemble = print_insn_tic54x;
+      break;
+#endif
+#ifdef ARCH_tic80
+    case bfd_arch_tic80:
+      disassemble = print_insn_tic80;
+      break;
+#endif
+#ifdef ARCH_v850
+    case bfd_arch_v850:
+      disassemble = print_insn_v850;
+      break;
+#endif
+#ifdef ARCH_w65
+    case bfd_arch_w65:
+      disassemble = print_insn_w65;
+      break;
+#endif
+#ifdef ARCH_xstormy16
+    case bfd_arch_xstormy16:
+      disassemble = print_insn_xstormy16;
+      break;
+#endif
+#ifdef ARCH_xc16x
+    case bfd_arch_xc16x:
+      disassemble = print_insn_xc16x;
+      break;
+#endif
+#ifdef ARCH_xtensa
+    case bfd_arch_xtensa:
+      disassemble = print_insn_xtensa;
+      break;
+#endif
+#ifdef ARCH_z80
+    case bfd_arch_z80:
+      disassemble = print_insn_z80;
+      break;
+#endif
+#ifdef ARCH_z8k
+    case bfd_arch_z8k:
+      if (bfd_get_mach(abfd) == bfd_mach_z8001)
+	disassemble = print_insn_z8001;
+      else
+	disassemble = print_insn_z8002;
+      break;
+#endif
+#ifdef ARCH_vax
+    case bfd_arch_vax:
+      disassemble = print_insn_vax;
+      break;
+#endif
+#ifdef ARCH_frv
+    case bfd_arch_frv:
+      disassemble = print_insn_frv;
+      break;
+#endif
+#ifdef ARCH_iq2000
+    case bfd_arch_iq2000:
+      disassemble = print_insn_iq2000;
+      break;
+#endif
+#ifdef ARCH_m32c
+    case bfd_arch_m32c:
+      disassemble = print_insn_m32c;
+      break;
+#endif
+    default:
+      return 0;
+    }
+  return disassemble;
+}
+
+void
+disassembler_usage (stream)
+     FILE * stream ATTRIBUTE_UNUSED;
+{
+#ifdef ARCH_arm
+  print_arm_disassembler_options (stream);
+#endif
+#ifdef ARCH_mips
+  print_mips_disassembler_options (stream);
+#endif
+#ifdef ARCH_powerpc
+  print_ppc_disassembler_options (stream);
+#endif
+
+  return;
+}
+
+void
+disassemble_init_for_target (struct disassemble_info * info)
+{
+  if (info == NULL)
+    return;
+
+  switch (info->arch)
+    {
+#ifdef ARCH_arm
+    case bfd_arch_arm:
+      info->symbol_is_valid = arm_symbol_is_valid;
+      info->disassembler_needs_relocs = TRUE;
+      break;
+#endif
+#ifdef ARCH_ia64
+    case bfd_arch_ia64:
+      info->skip_zeroes = 16;
+      break;
+#endif
+#ifdef ARCH_tic4x
+    case bfd_arch_tic4x:
+      info->skip_zeroes = 32;
+      break;
+#endif
+#ifdef ARCH_m32c
+    case bfd_arch_m32c:
+      info->endian = BFD_ENDIAN_BIG;
+      if (! info->insn_sets)
+	{
+	  info->insn_sets = cgen_bitset_create (ISA_MAX);
+	  if (info->mach == bfd_mach_m16c)
+	    cgen_bitset_set (info->insn_sets, ISA_M16C);
+	  else
+	    cgen_bitset_set (info->insn_sets, ISA_M32C);
+	}
+      break;
+#endif
+    default:
+      break;
+    }
+}

+ 186 - 0
external/dasm-tigcc/er_codes.c

@@ -0,0 +1,186 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: er_codes.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2005, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    ER_throw support
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* This table is converted and hand-edited from the TIGCC error.h. */
+static struct {unsigned int id; const char *name;} erthrow_table[] = {
+  {0, "ER_OK"},
+  {1, "ER_EXIT"},
+  {2, "ER_STOP"},
+  {3, "ER_OFF"},
+  {4, "ER_PRGM_STOP"},
+  {9, "ER_NO_MSG"},
+  {10, "ER_FUNC_DID_NOT_RETURN_VALUE"},
+  {20, "ER_TEST_NOT_TRUE_OR_FALSE"},
+  {30, "ER_ARG_CANNOT_BE_FOLDER"},
+  {40, "ER_ARGUMENT"},
+  {50, "ER_ARG_MISMATCH"},
+  {60, "ER_EXPECTED_BOOL_OR_AGG"},
+  {70, "ER_ARG_MUST_BE_DECIMAL"},
+  {80, "ER_ARG_MUST_BE_LABEL"},
+  {90, "ER_ARGUMENT_MUST_BE_LIST"},
+  {100, "ER_ARG_MUST_BE_MATRIX"},
+  {110, "ER_ARG_MUST_BE_PIC"},
+  {120, "ER_ARG_MUST_BE_PIC_OR_STR"},
+  {130, "ER_ARG_MUST_BE_STRING"},
+  {140, "ER_EXPECTED_VAR"},
+  {150, "ER_ARG_MUST_BE_EMPTY_FOLDER"},
+  {160, "ER_EXPECTED_ALGEBRAIC"},
+  {161, "ER_ASAP_TOO_LONG"},
+  {163, "ER_ATTRIBUTE_NOT_FOUND"},
+  {165, "ER_BATT_LOW"},
+  {170, "ER_BOUND"},
+  {180, "ER_BREAK"},
+  {185, "ER_CHECKSUM"},
+  {190, "ER_CIRCULAR_DEFINITION"},
+  {200, "ER_INVALID_SUCH_THAT"},
+  {210, "ER_DATATYPE"},
+  {220, "ER_DEPENDENT_LIMIT"},
+  {225, "ER_DIFF_EQ_SETUP"},
+  {230, "ER_DIMENSION"},
+  {240, "ER_NON_CONFORMING_LISTS"},
+  {250, "ER_DIVBY0"},
+  {260, "ER_DOMAIN"},
+  {270, "ER_DUPLICATE_VAR_NAME"},
+  {280, "ER_ELSE_WITHOUT_IF"},
+  {290, "ER_ENDTRY_WITHOUT_ELSE"},
+  {295, "ER_EXCESSIVE_ITERATION"},
+  {300, "ER_EXPECTED_2OR3_ELEMENTS"},
+  {305, "ER_EXPIRED"},
+  {307, "ER_APP_EXT_NOT_FOUND"},
+  {308, "ER_APP_NOT_FOUND"},
+  {310, "ER_INVALID_NSOLVE_ARG1"},
+  {320, "ER_INVALID_SOLVE_ARG1"},
+  {330, "ER_FOLDER"},
+  {335, "ER_FUNCS_IN_DIFF_EQ"},
+  {345, "ER_INCONSISTENT_UNITS"},
+  {350, "ER_INVALID_SUBSCRIPT"},
+  {360, "ER_INVALID_INDIR_STRING"},
+  {380, "ER_INVALID_ANS"},
+  {390, "ER_ILLEGAL_ASSIGNMENT"},
+  {400, "ER_ILLEGAL_ASSIGNMENT_VALUE"},
+  {405, "ER_INVALID_AXES"},
+  {410, "ER_ILLEGAL_COMMAND"},
+  {420, "ER_INVALID_FOLDER_NAME"},
+  {430, "ER_GRAPH_MODE"},
+  {435, "ER_INVALID_GUESS"},
+  {440, "ER_INVALID_IMPLIED_MULT"},
+  {450, "ER_ILLEGAL_IN_FUNC"},
+  {460, "ER_ILLEGAL_IN_CUSTOM"},
+  {470, "ER_ILLEGAL_IN_DIALOG"},
+  {480, "ER_ILLEGAL_IN_TOOLBAR"},
+  {490, "ER_CANNOT_EXIT_FROM_TRY"},
+  {500, "ER_INVALID_LABEL"},
+  {510, "ER_INVALID_LIST_OR_MATRIX"},
+  {520, "ER_INVAL_OUTSIDE_TB_CM"},
+  {530, "ER_INVAL_OUTSIDE_DG_TB_CM"},
+  {540, "ER_INVALID_OUTSIDE_DIALOG"},
+  {550, "ER_MUST_BE_IN_PRGM_OR_FUNC"},
+  {560, "ER_EXIT_NOT_IN_LOOP"},
+  {570, "ER_INVALID_PATHNAME"},
+  {575, "ER_INVALID_POLAR_COMPLEX"},
+  {580, "ER_ILLEGAL_PRGM_REF"},
+  {590, "ER_INVALID_SYNTAX_BLOCK"},
+  {600, "ER_INVALID_TABLE"},
+  {605, "ER_INVALID_USE_OF_UNITS"},
+  {610, "ER_INVALID_LOCAL_DECLARATION"},
+  {620, "ER_EXPECTED_VAR_OR_FUNC"},
+  {630, "ER_INVALID_VAR_REF"},
+  {640, "ER_INVALID_VECTOR_SYNTAX"},
+  {650, "ER_LINK_IO"},
+  {665, "ER_MAT_NOT_DIAGONALIZABLE"},
+  {670, "ER_MEMORY"},
+  {673, "ER_STACK_VIO"},
+  {680, "ER_EXPECTED_LPAR"},
+  {690, "ER_EXPECTED_RPAR"},
+  {700, "ER_EXPECTED_DOUBLE_QUOTE"},
+  {710, "ER_EXPECTED_RIGHT_BRACKET"},
+  {720, "ER_EXPECTED_RIGHT_BRACE"},
+  {730, "ER_INVALID_BLOCK_STRUCTURE"},
+  {740, "ER_MISSING_THEN"},
+  {750, "ER_NOT_FUNC_OR_PRGM"},
+  {765, "ER_NO_FUNCS_SEL"},
+  {780, "ER_NO_SOLUTION"},
+  {790, "ER_NON_ALGEBRAIC_VARIABLE"},
+  {800, "ER_UNREAL_RESULT"},
+  {810, "ER_MEMORY_DML"},
+  {830, "ER_OVERFLOW"},
+  {840, "ER_STAT_PLOT"},
+  {850, "ER_PRGM_NOT_FOUND"},
+  {860, "ER_RECURSION_TOO_DEEP"},
+  {870, "ER_RESERVED"},
+  {875, "ER_ROM_ROUTINE_NOT_AVAILABLE"},
+  {880, "ER_SEQUENCE_SETUP"},
+  {885, "ER_SIGNATURE_ERR"},
+  {890, "ER_SINGULARMAT"},
+  {895, "ER_SLOPE_FIELD_FUNCS"},
+  {900, "ER_EMPTY_GROUP_NOT_VALID"},
+  {910, "ER_SYNTAX"},
+  {930, "ER_TOO_FEW_ARGS"},
+  {940, "ER_TOO_MANY_ARGS"},
+  {950, "ER_TOO_MANY_SUBSCRIPTS"},
+  {955, "ER_TOO_MANY_UNDEFINED"},
+  {960, "ER_UNDEFINED_VAR"},
+  {965, "ER_UNLICENSED"},
+  {970, "ER_VAR_IN_USE"},
+  {980, "ER_PROTECTED"},
+  {990, "ER_NAME_TOO_LONG"},
+  {1000, "ER_RANGE"},
+  {1010, "ER_ZOOM"},
+  {1020, "ER_ILLEGAL_TAG"},
+  {1030, "ER_MEM_VIO"},
+  {2048, NULL}
+};
+
+const char* ercodes_get_name(unsigned id)
+{
+	if(id >= 2048)
+		return "Unknown ERROR code";
+	else
+	{
+		unsigned n = sizeof(erthrow_table)/sizeof(*erthrow_table), lb = 0, ub = n-1;
+		while (lb < ub - 1)	
+		{
+			unsigned mid = (lb + ub) >> 1;
+			if (erthrow_table[mid].id <= id)
+				lb = mid;
+			else
+				ub = mid;
+		}
+		if (id != erthrow_table[lb].id)
+		{
+			static char buffer[100];
+			sprintf(buffer, "%s + %u", erthrow_table[lb].name,
+			        id - erthrow_table[lb].id);
+			return buffer;
+		}
+		else
+			return erthrow_table[lb].name;
+	}
+}
+

+ 43 - 0
external/dasm-tigcc/error.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: error.h 3056 2006-11-06 17:12:50Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Lievin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIFILES_ERRCODES__
+#define __TIFILES_ERRCODES__
+
+/* Error codes must begin at 512 up to 767 */
+
+typedef enum {
+	ERR_NO_ERROR = 0,		// No error (returns 0)
+
+	ERR_MALLOC=512,			// Error with malloc
+	ERR_FILE_OPEN,			// Unable to open file
+	ERR_FILE_CLOSE,			// Unable to close file
+	ERR_GROUP_SIZE,			// Group size exceeded (>64KB)
+	ERR_BAD_CALC,			// The function does not exist for this calc
+	ERR_INVALID_FILE,		// Is not a TI file
+	ERR_BAD_FILE,			// Same as above
+	ERR_FILE_CHECKSUM,		// Checksum file error
+	ERR_FILE_ZIP,			// (Un)Zip internal error
+	ERR_UNSUPPORTED,		// Function not supported
+	ERR_FILE_IO				// Stream error
+} FileError;
+
+#endif

+ 206 - 0
external/dasm-tigcc/files9x.c

@@ -0,0 +1,206 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: files9x.c 3227 2007-02-26 19:40:27Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+	TI File Format handling routines
+	Calcs: 89/89tm/92/92+/V200
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <assert.h>
+
+#include "tifiles.h"
+#include "error.h"
+#include "macros.h"
+#include "files9x.h"
+#include "rwfile.h"
+
+#define tifiles_info(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+#define TI89_AMS     0x23
+#define TI89_APPL    0x24
+#define TI89_CERTIF  0x25
+#define TI89_LICENSE 0x3E
+
+#ifndef DISABLE_TI9X
+
+/********/
+/* Misc */
+/********/
+
+/***********/
+/* Reading */
+/***********/
+
+static int check_device_type(uint8_t id)
+{
+	const uint8_t types[] = { 0, DEVICE_TYPE_89, DEVICE_TYPE_92P };
+	int i;
+
+	for(i = 1; i <= (int)(sizeof(types)/sizeof(uint8_t)); i++)
+		if(types[i] == id)
+			return i;
+
+	return 0;
+}
+
+static int check_data_type(uint8_t id)
+{
+	const uint8_t types[] = { 0, TI89_AMS, TI89_APPL, TI89_CERTIF, TI89_LICENSE  };
+	int i;
+
+	for(i = 1; i <= (int)(sizeof(types)/sizeof(uint8_t)); i++)
+		if(types[i] == id)
+			return i;
+
+	return 0;
+}
+
+/**
+ * ti9x_file_read_flash:
+ * @filename: name of flash file to open.
+ * @content: where to store the file content.
+ *
+ * Load the flash file into a #FlashContent structure.
+ *
+ * Structure content must be freed with #tifiles_content_delete_flash when
+ * no longer used. If error occurs, the structure content is released for you.
+ *
+ * Return value: an error code, 0 otherwise.
+ **/
+int ti9x_file_read_flash(const char *filename, Ti9xFlash *head)
+{
+	FILE *f;
+	Ti9xFlash *content = head;
+	int tib = 0;
+	char signature[9];
+
+	if (!tifiles_file_is_flash(filename) && !tifiles_file_is_tib(filename))
+		return ERR_INVALID_FILE;
+
+	// detect file type (old or new format)
+	tib = tifiles_file_is_tib(filename);
+
+	f = gfopen(filename, "rb");
+	if (f == NULL) 
+	{
+	    tifiles_info("Unable to open this file: %s\n", filename);
+		return ERR_FILE_OPEN;
+	}  
+
+	if (tib) 
+	{	// tib is an old format but mainly used by developers
+		memset(content, 0, sizeof(Ti9xFlash));
+		if(fseek(f, 0, SEEK_END)) goto tfrf;
+		content->data_length = (uint32_t) ftell(f);
+		if(fseek(f, 0, SEEK_SET)) goto tfrf;
+
+		strcpy(content->name, "basecode");
+		content->data_type = 0x23;	// FLASH os
+
+		content->data_part = (uint8_t *) calloc(content->data_length, 1);
+		if (content->data_part == NULL) 
+		{
+			fclose(f);
+			return ERR_MALLOC;
+		}
+
+		if(fread(content->data_part, 1, content->data_length, f) < content->data_length) goto tfrf;
+		switch(content->data_part[8])
+		{
+		case 1: content->device_type = DEVICE_TYPE_92P; break;	// TI92+
+		case 3: content->device_type = DEVICE_TYPE_89; break;	// TI89
+		// value added by the TI community according to HWID parameter
+		// doesn't have any 'legal' existence.
+		case 8: content->device_type = DEVICE_TYPE_92P; break;	// V200PLT
+		case 9: content->device_type = DEVICE_TYPE_89; break;	// Titanium
+		}
+
+		content->next = NULL;
+	} 
+	else 
+	{
+		for (content = head;; content = content->next) 
+		{
+		    if(fread_8_chars(f, signature) < 0) goto tfrf;
+		    content->model = tifiles_file_get_model(filename);
+		    if(fread_byte(f, &(content->revision_major)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->revision_minor)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->flags)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->object_type)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->revision_day)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->revision_month)) < 0) goto tfrf;
+		    if(fread_word(f, &(content->revision_year)) < 0) goto tfrf;
+		    if(fskip(f, 1) < 0) goto tfrf;
+		    if(fread_8_chars(f, content->name) < 0) goto tfrf;
+		    if(fskip(f, 23) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->device_type)) < 0) goto tfrf;
+		    if(fread_byte(f, &(content->data_type)) < 0) goto tfrf;
+		    if(fskip(f, 23) < 0) goto tfrf;
+			if(fread_byte(f, &(content->hw_id)) < 0) goto tfrf;
+		    if(fread_long(f, &(content->data_length)) < 0) goto tfrf;
+
+			if(content->data_type != TI89_LICENSE && !check_device_type(content->device_type))
+				return ERR_INVALID_FILE;
+			if(!check_data_type(content->data_type))
+				return ERR_INVALID_FILE;
+
+			content->data_part = (uint8_t *) calloc(content->data_length, 1);
+			if (content->data_part == NULL) 
+			{
+				fclose(f);
+				tifiles_content_delete_flash(content);
+				return ERR_MALLOC;
+			}
+
+			if(fread(content->data_part, 1, content->data_length, f) < content->data_length) goto tfrf;
+			content->next = NULL;
+
+			// check for end of file
+			if(fread_8_chars(f, signature) < 0)
+				break;
+			if(strcmp(signature, "**TIFL**") || feof(f))
+				break;
+			if(fseek(f, -8, SEEK_CUR)) goto tfrf;
+
+			content->next = (Ti9xFlash *) calloc(1, sizeof(Ti9xFlash));
+			if (content->next == NULL) 
+			{
+				fclose(f);
+				tifiles_content_delete_flash(content);
+				return ERR_MALLOC;
+			}
+		}
+	}
+
+	fclose(f);
+	return 0;
+
+tfrf:	// release on exit
+    fclose(f);
+	tifiles_content_delete_flash(content);
+	return ERR_FILE_IO;
+}
+
+#endif

+ 37 - 0
external/dasm-tigcc/files9x.h

@@ -0,0 +1,37 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: files9x.h 3056 2006-11-06 17:12:50Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIFILES_FILES9X_H__
+#define __TIFILES_FILES9X_H__
+
+#include "tifiles.h"
+
+/* Structures */
+
+typedef FlashContent	Ti9xFlash;
+
+/* Functions */
+
+// reading
+int ti9x_file_read_flash(const char *filename, Ti9xFlash *content);
+
+#endif

+ 132 - 0
external/dasm-tigcc/filesxx.c

@@ -0,0 +1,132 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: filesxx.c 3227 2007-02-26 19:40:27Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2006  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+  This unit contains a TI file independant API
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "tifiles.h"
+#include "error.h"
+#include "files9x.h"
+
+#define tifiles_calc_is_ti9x(model) 1
+
+/**
+ * tifiles_content_create_flash:
+ * @model: a calculator model (compulsory).
+ *
+ * Allocates a #FlashContent structure.
+ *
+ * Return value: the allocated block.
+ **/
+TIEXPORT2 FlashContent* TICALL tifiles_content_create_flash(CalcModel model)
+{
+	FlashContent* content = calloc(1, sizeof(FlashContent));
+
+	content->model = model;
+	if(tifiles_calc_is_ti9x(content->model))
+	{
+	  time_t tt;
+	  struct tm *lt;
+
+	  time(&tt);
+	  lt = localtime(&tt);
+	  content->revision_major = 1;
+	  content->revision_minor = 0;
+	  content->flags = 0;
+	  content->object_type = 0;
+	  content->revision_day = lt->tm_mday;
+	  content->revision_month = lt->tm_mon;
+	  content->revision_year = lt->tm_year + 1900;
+	}
+
+	return content;
+}
+
+/**
+ * tifiles_content_delete_flash:
+ *
+ * Free the whole content of a #FlashContent structure.
+ *
+ * Return value: none.
+ **/
+TIEXPORT2 int TICALL tifiles_content_delete_flash(FlashContent *content)
+{
+	int i;
+	assert(content != NULL);
+
+	{
+		FlashContent *ptr;
+
+		free(content->data_part);
+
+		ptr = content->next;
+		while (ptr != NULL) 
+		{
+			FlashContent *next = ptr->next;
+
+			free(ptr->data_part);
+			free(ptr);
+
+			for(i = 0; i < content->num_pages; i++)
+			{
+				free(content->pages[i]->data);
+				free(content->pages[i]);
+			}
+			free(content->pages);
+
+			ptr = next;
+		}
+
+		free(content);
+	}
+
+  return 0;
+}
+
+/**
+ * tifiles_file_read_flash:
+ * @filename: name of FLASH file to open.
+ * @content: where to store the file content.
+ *
+ * Load the FLASH file into a FlashContent structure.
+ *
+ * Structure content must be freed with #tifiles_content_delete_flash when
+ * no longer used.
+ *
+ * Return value: an error code, 0 otherwise.
+ **/
+TIEXPORT2 int tifiles_file_read_flash(const char *filename, FlashContent *content)
+{
+	if (tifiles_calc_is_ti9x(tifiles_file_get_model(filename)) || tifiles_file_is_tib(filename))
+		return ti9x_file_read_flash(filename, content);
+	else
+    return ERR_BAD_CALC;
+
+	return 0;
+}

+ 347 - 0
external/dasm-tigcc/filetypes.c

@@ -0,0 +1,347 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: typesxx.c 912 2005-03-30 20:49:06Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define g_ascii_strcasecmp strcasecmp
+
+#include "tifiles.h"
+#include "error.h"
+#include "rwfile.h"
+#include "sysdep.h"
+
+/****************/
+/* Global types */
+/****************/
+
+#define NCALCS FILES_NCALCS
+
+static const char GROUP_FILE_EXT[NCALCS + 1][4] = 
+{
+	"XxX", 
+	"73g", "82g", "83g", "8Xg", "8Xg", "85g", "86g", 
+	"89g", "89g", "92g", "9Xg", "V2g", "8Xg", "89g",
+};
+
+static const char BACKUP_FILE_EXT[NCALCS + 1][4] = 
+{
+	"XxX", 
+	"73b", "82b", "83b", "8Xb", "8Xb", "85b", "86b", 
+	"89g", "89g", "92b", "9Xg", "V2g", "8Xg", "89g",
+};
+
+static const char FLASH_APP_FILE_EXT[NCALCS + 1][4] = 
+{
+	"XxX", 
+	"73k", "???", "???", "8Xk", "8Xk", "???", "???",
+	"89k", "89k", "???", "9Xk", "V2k", "8Xk", "89k",
+};
+
+static const char FLASH_OS_FILE_EXT[NCALCS + 1][4] = 
+{
+	"XxX", 
+	"73u", "???", "???", "8Xu", "8Xu", "???", "???",
+	"89u", "89u", "???", "9Xu", "V2u", "8Xu", "89u",
+};
+
+static const char CERTIF_FILE_EXT[NCALCS + 1][4] = 
+{
+	"XxX", 
+	"73q", "???", "???", "8Xq", "8Xq", "???", "???",
+	"89q", "89q", "???", "9Xq", "V2q", "8Xq", "89q",
+};
+
+/*******************/
+/* File extensions */
+/*******************/
+
+/**
+ * tifiles_fext_get:
+ * @filename: a filename as string.
+ *
+ * Returns file extension part.
+ *
+ * Return value: a file extension without dot as string (like "89g").
+ **/
+TIEXPORT2 const char *TICALL tifiles_fext_get(const char *filename)
+{
+  char *d = NULL;
+
+  d = strrchr(filename, '.');
+  if (d == NULL)
+    return "";
+
+  return (++d);
+}
+
+/**********************/
+/* Signature checking */
+/**********************/
+
+static int tifiles_file_has_ti_header(const char *filename)
+{
+	FILE *f;
+	char buf[9];
+	char *p;
+
+	f = gfopen(filename, "rb");
+	if (f == NULL)
+		return 0;
+	
+	fread_8_chars(f, buf);
+	for(p = buf; *p != '\0'; p++)
+		*p = toupper(*p);
+
+	if (!strcmp(buf, "**TI73**") || !strcmp(buf, "**TI82**") ||
+      !strcmp(buf, "**TI83**") || !strcmp(buf, "**TI83F*") ||
+      !strcmp(buf, "**TI85**") || !strcmp(buf, "**TI86**") ||
+      !strcmp(buf, "**TI89**") || !strcmp(buf, "**TI92**") ||
+      !strcmp(buf, "**TI92P*") || !strcmp(buf, "**V200**") ||
+      !strcmp(buf, "**TIFL**")) {
+		fclose(f);
+		return !0;
+	}
+
+	fclose(f);
+	return 0;
+}
+
+#define TIB_SIGNATURE	"Advanced Mathematics Software"
+
+static int tifiles_file_has_tib_header(const char *filename)
+{
+	FILE *f;
+	char str[128];
+	const char *e = tifiles_fext_get(filename);
+
+	if (!strcmp(e, ""))
+	  return 0;
+
+	if(g_ascii_strcasecmp(e, "tib"))
+		return 0;
+
+	f = gfopen(filename, "rb");
+	if(f == NULL)
+		return 0;
+
+	fread_n_chars(f, 22, str);
+	fread_n_chars(f, strlen(TIB_SIGNATURE), str);
+	str[strlen(TIB_SIGNATURE)] = '\0';
+	if(!strcmp(str, TIB_SIGNATURE)) 
+	{
+		fclose(f);
+		return !0;
+	}
+
+	return 0;
+}
+
+/**************/
+/* File types */
+/**************/
+
+#ifndef __WIN32__
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#endif
+
+static int is_regfile(const char *filename ATTRIBUTE_UNUSED)
+{
+#ifndef __WIN32__
+	struct stat buf;
+
+	if (stat(filename, &buf) < 0)
+		return 0;
+
+	if (S_ISREG(buf.st_mode))
+		return !0;
+	else
+		return 0;
+#else
+	return !0;
+#endif
+}
+
+/**
+ * tifiles_file_is_ti:
+ * @filename: a filename as string.
+ *
+ * Check whether file is a TI file by checking the signature.
+ *
+ * Return value: a boolean value.
+ **/
+TIEXPORT2 int TICALL tifiles_file_is_ti(const char *filename)
+{
+	// bug: check that file is not a FIFO
+	if (!is_regfile(filename))
+		return 0;
+
+	if(tifiles_file_has_ti_header(filename))
+		return !0;
+
+	if(tifiles_file_has_tib_header(filename))
+		return !0;
+
+	return 0;
+}
+
+
+/**
+ * tifiles_file_is_os:
+ * @filename: a filename as string.
+ *
+ * Check whether file is a FLASH OS file (tib or XXu)
+ *
+ * Return value: a boolean value.
+ **/
+TIEXPORT2 int TICALL tifiles_file_is_os(const char *filename)
+{
+  int i;
+  const char *e = tifiles_fext_get(filename);
+
+  if (!strcmp(e, ""))
+    return 0;
+
+  if (!tifiles_file_is_ti(filename))
+    return 0;
+
+  if(tifiles_file_is_tib(filename))
+	  return !0;
+
+  for (i = 1; i < NCALCS + 1; i++) 
+  {
+    if (!g_ascii_strcasecmp(e, FLASH_OS_FILE_EXT[i]))
+      return !0;
+  }
+
+  return 0;
+}
+
+/**
+ * tifiles_file_is_app:
+ * @filename: a filename as string.
+ *
+ * Check whether file is a FLASH app file
+ *
+ * Return value: a boolean value.
+ **/
+TIEXPORT2 int TICALL tifiles_file_is_app(const char *filename)
+{
+  int i;
+  const char *e = tifiles_fext_get(filename);
+
+  if (!strcmp(e, ""))
+    return 0;
+
+  if (!tifiles_file_is_ti(filename))
+    return 0;
+
+  for (i = 1; i < NCALCS + 1; i++) 
+  {
+    if (!g_ascii_strcasecmp(e, FLASH_APP_FILE_EXT[i]))
+      return !0;
+  }
+
+  return 0;
+}
+
+/**
+ * tifiles_file_is_flash:
+ * @filename: a filename as string.
+ *
+ * Check whether file is a FLASH file (os or app).
+ *
+ * Return value: a boolean value.
+ **/
+TIEXPORT2 int TICALL tifiles_file_is_flash(const char *filename)
+{
+  return tifiles_file_is_os(filename) || tifiles_file_is_app(filename);
+}
+
+/**
+ * tifiles_file_is_tib:
+ * @filename: a filename as string.
+ *
+ * Check whether file is a TIB formatted file.
+ *
+ * Return value: a boolean value.
+ **/
+TIEXPORT2 int TICALL tifiles_file_is_tib(const char *filename)
+{
+	return tifiles_file_has_tib_header(filename);
+}
+
+/********/
+/* Misc */
+/********/
+
+/* Note: a better way should be to open the file and read the signature */
+/**
+ * tifiles_file_get_model:
+ * @filename: a filename as string.
+ *
+ * Returns the calculator model targetted for this file.
+ *
+ * Return value: a model taken in #CalcModel.
+ **/
+TIEXPORT2 CalcModel TICALL tifiles_file_get_model(const char *filename)
+{
+  const char *ext = tifiles_fext_get(filename);
+  int type = CALC_NONE;
+  char str[3];
+
+  if (!strcmp(ext, ""))
+    return CALC_NONE;
+
+  strncpy(str, ext, 2);
+  str[2] = '\0';
+
+  if (!g_ascii_strcasecmp(str, "73"))
+    type = CALC_TI73;
+  else if (!g_ascii_strcasecmp(str, "82"))
+    type = CALC_TI82;
+  else if (!g_ascii_strcasecmp(str, "83"))
+    type = CALC_TI83;
+  else if (!g_ascii_strcasecmp(str, "8x"))
+    type = CALC_TI83P;
+  else if (!g_ascii_strcasecmp(str, "85"))
+    type = CALC_TI85;
+  else if (!g_ascii_strcasecmp(str, "86"))
+    type = CALC_TI86;
+  else if (!g_ascii_strcasecmp(str, "89"))
+    type = CALC_TI89;
+  else if (!g_ascii_strcasecmp(str, "92"))
+    type = CALC_TI92;
+  else if (!g_ascii_strcasecmp(str, "9X"))
+    type = CALC_TI92P;
+  else if (!g_ascii_strcasecmp(str, "V2"))
+    type = CALC_V200;
+  //else if (!g_ascii_strcasecmp(str, "tib"))
+    //type = CALC_TI89;	// consider .tib as TI89
+  else
+    type = CALC_NONE;
+
+  return type;
+}

+ 209 - 0
external/dasm-tigcc/fpudasm.c

@@ -0,0 +1,209 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: fpudasm.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    A pseudo-FPU disassembler.
+	Many informations comes from the TI's BCD artihmetic package:
+	<ftp://ftp.ti.com/pub/graph-ti/calc-apps/89/asm/exec.inc>
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdint.h>
+
+typedef struct
+{
+	uint16_t	code;
+	const char*	name;
+} TUPLE;
+
+// 6 chars max
+TUPLE operators[9] = {
+	{ 0x0000, "FCMP" }, { 0x1000, "FADD" }, { 0x2000, "FDIV" }, { 0x3000, "FMUL" }, 
+	{ 0x4000, "FSUB" }, { 0x5000, "FINTRZ" }, { 0x6000, "FMOVE" }, { 0x7000, "FNEG" },
+	{ 0x8000, "FTST" },
+};
+
+// 7 chars max
+TUPLE sizes[6] = {
+	{ 0x0000, "BYTE"}, { 0x0200, "WORD"}, { 0x0400, "LONG"},
+	{ 0x0600, "SINGLE"}, { 0x0800, "DOUBLE"}, { 0x0a00, "UNSGNED"}, 
+};
+
+// 11 chars max
+TUPLE srcs[21] = {
+	{ 0x0000, "FP0"}, { 0x0010, "FP1"}, { 0x0020, "FP2"}, { 0x0030, "FP3"}, 
+	{ 0x0040, "FP4"}, { 0x0050, "FP5"}, { 0x0060, "FP6"}, { 0x0070, "FP7"}, 
+	{ 0x0080, "D0"}, { 0x0090, "D1"}, { 0x00a0, "D2"}, { 0x00b0, "D3"}, 
+	{ 0x00c0, "D4"}, { 0x00d0, "D5"}, { 0x00e0, "D6"}, { 0x00f0, "D7"}, 
+	{ 0x0100, "IMMED_LONG"}, { 0x0110, "IMMED_SHORT"}, { 0x0120, "FRAME_OFF"},
+	{ 0x0130, "EFFECT_ADDR"}, { 0x0140, "IMMED_ZERO"},
+};
+
+// 11 chars max
+TUPLE dsts[11] = {
+	{ 0x0000, "R0"}, { 0x0001, "R1"}, { 0x0002, "R2"}, { 0x0003, "R3"}, 
+	{ 0x0004, "R4"}, { 0x0005, "R5"}, { 0x0006, "R6"}, { 0x0007, "R7"}, 
+	{ 0x0008, "FRAME_OFF"}, { 0x0009, "EFFECT_ADDR"}, { 0x000a, "RETURN_REG"}, 
+};
+
+#define GET_OPERATOR(x)		((x) & 0xf000)
+#define GET_SIZE(x)			((x) & 0x0e00)
+#define GET_SRC(x)			((x) & 0x01f0)
+#define GET_DST(x)			((x) & 0x000f)
+
+/*
+; BCD arithmetic package
+
+***************************************************************************
+*                        OPERATOR / OPERAND WORD                          *
+*                                                                         *
+*    | 15| 14| 13| 12| 11| 10| 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |    *
+*    +---------------+-----------+-------------------+---------------+    *
+*    |   OPERATOR    |   SIZE    |    SRC OPERAND    |  DEST OPERAND |    *
+*    +---------------+-----------+-------------------+---------------+    *
+*        FCMP   0      BYTE    0     FP0          0    R0 (FP or D) 0     *
+*        FADD   1      WORD    1      |                 |                 *
+*        FDIV   2      LONG    2     FP7          7    R7 (FP or D) 7     *
+*        FMUL   3      SINGLE  3     D0           8    FRAME_OFF    8     *
+*        FSUB   4      DOUBLE  4      |                EFFECT_ADDR  9     *
+*        FINTRZ 5      UNSGNED 5     D7          15    RETURN_REG  10     *
+*        FMOVE  6                    IMMED_LONG  16                       *
+*        FNEG   7                    IMMED_SHORT 17                       *
+*        FTST   8                    FRAME_OFF   18                       *
+*                                    EFFECT_ADDR 19                       *
+*                                    IMMED_ZERO  20                       *
+***************************************************************************
+bcdCmp          = 0x0000
+bcdAdd          = 0x1000
+bcdDiv          = 0x2000
+bcdMul          = 0x3000
+bcdSub          = 0x4000
+bcdIntz         = 0x5000
+bcdMove         = 0x6000
+bcdNeg          = 0x7000
+bcdTst          = 0x8000
+
+bcdByte         = 0x0000
+bcdWord         = 0x0200
+bcdLong         = 0x0400
+bcdSingle       = 0x0600
+bcdDouble       = 0x0800
+bcdUnsigned     = 0x0A00
+
+; Source operand
+bcdFP0          = 0x0000
+bcdFP1          = 0x0010
+bcdFP2          = 0x0020
+bcdFP3          = 0x0030
+bcdFP4          = 0x0040
+bcdFP5          = 0x0050
+bcdFP6          = 0x0060
+bcdFP7          = 0x0070
+bcdD0           = 0x0080
+bcdD1           = 0x0090
+bcdD2           = 0x00A0
+bcdD3           = 0x00B0
+bcdD4           = 0x00C0
+bcdD5           = 0x00D0
+bcdD6           = 0x00E0
+bcdD7           = 0x00F0
+bcdLongImm      = 0x0100
+bcdShortImm     = 0x0110
+bcdFrameSrc     = 0x0120
+bcdAbsSrc       = 0x0130
+bcdZeroImm      = 0x0140
+
+; Destination operand
+bcdR0           = 0x0000
+bcdR1           = 0x0001
+bcdR2           = 0x0002
+bcdR3           = 0x0003
+bcdR4           = 0x0004
+bcdR5           = 0x0005
+bcdR6           = 0x0006
+bcdR7           = 0x0007
+bcdFrameDest    = 0x0008
+bcdAbsDest      = 0x0009
+bcdRetReg       = 0x000A
+*/
+
+/*
+	Input: FPU opcode in 'code'
+	Output: FPU disassembled in 'buf'. sizeof(buf) >= 6+1+7+1+11+1+11 = 38
+*/
+int DasmFPU(uint16_t code, char *buf)
+{
+	int	operator = GET_OPERATOR(code);
+	int size = GET_SIZE(code);
+	int src = GET_SRC(code);
+	int dst = GET_DST(code);
+	int idx[4] = { 0 };
+	int i;
+	int j = 0;
+
+	for(i = 0; i < (int)(sizeof(operators) / sizeof(TUPLE)); i++)
+	{
+		if(operators[i].code == operator)
+		{
+			idx[j++] = i;
+			break;
+		}
+	}
+
+	for(i = 0; i < (int)(sizeof(sizes) / sizeof(TUPLE)); i++)
+	{
+		if(sizes[i].code == size)
+		{
+			idx[j++] = i;
+			break;
+		}
+	}
+	
+	for(i = 0; i < (int)(sizeof(srcs) / sizeof(TUPLE)); i++)
+	{
+		if(srcs[i].code == src)
+		{
+			idx[j++] = i;
+			break;
+		}
+	}
+
+	for(i = 0; i < (int)(sizeof(dsts) / sizeof(TUPLE)); i++)
+	{
+		if(dsts[i].code == dst)
+		{
+			idx[j++] = i;
+			break;
+		}
+	}
+
+	sprintf(buf, "%s.%s %s,%s", 
+		operators[idx[0]].name, sizes[idx[1]].name,
+		srcs[idx[2]].name, dsts[idx[3]].name);
+
+	return 0;
+}

+ 103 - 0
external/dasm-tigcc/generic.h

@@ -0,0 +1,103 @@
+/* generic.h: Header file to be included by all other files
+
+   Copyright (C) 2002-2004 Sebastian Reichelt
+   Copyright (C) 2007 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef GENERIC_H
+#define GENERIC_H
+
+#ifdef __GNUC__
+#define ATTRIBUTE_PACKED __attribute__((__packed__))
+#define ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
+#else
+#define ATTRIBUTE_PACKED /**/
+#define ATTRIBUTE_MAY_ALIAS /**/
+#endif
+
+// Attempt to auto-detect I1, I2, I4, SI1, SI2 and SI4 based on <limits.h>.
+// It is a good idea to double-check these definitions on every new system
+// you compile on.
+// Such a check is also performed at run time (or optimized away as dead
+// code).
+
+#include <limits.h>
+
+// Make sure that the character types take exactly 1 byte.
+#if UCHAR_MAX != 0xFF
+#error Need 1-byte unsigned char type.
+#endif /* UCHAR_MAX != 0xFF */
+#if SCHAR_MIN != (-0x80) || SCHAR_MAX != 0x7F
+#error Need 1-byte signed char type.
+#endif /* UCHAR_MAX != 0xFF */
+
+// Unsigned types.
+typedef unsigned char I1;
+
+#if USHRT_MAX == 0xFFFF
+typedef unsigned short I2;
+#elif UINT_MAX == 0xFFFF
+typedef unsigned int I2;
+#elif ULONG_MAX == 0xFFFF
+typedef unsigned long I2;
+#else /* no 2-byte unsigned int */
+#error No 2-byte unsigned integer type found.
+#endif /* 2-byte unsigned int */
+
+#if ULONG_MAX == 0xFFFFFFFF
+typedef unsigned long I4;
+#elif UINT_MAX == 0xFFFFFFFF
+typedef unsigned int I4;
+#elif ULONG_LONG_MAX == 0xFFFFFFFF || ULLONG_MAX == 0xFFFFFFFF
+typedef unsigned long long I4;
+#else /* no 4-byte unsigned int */
+#error No 4-byte unsigned integer type found.
+#endif /* 4-byte unsigned int */
+
+// Signed types.
+typedef signed char SI1;
+
+#if SHRT_MIN == (-0x8000) && SHRT_MAX == 0x7FFF
+typedef short SI2;
+#elif INT_MIN == (-0x8000) && INT_MAX == 0x7FFF
+typedef int SI2;
+#elif LONG_MIN == (-0x8000) && LONG_MAX == 0x7FFF
+typedef long SI2;
+#else /* no 2-byte signed int */
+#error No 2-byte signed integer type found.
+#endif /* 2-byte signed int */
+
+#if LONG_MIN == (-0x80000000) && LONG_MAX == 0x7FFFFFFF
+typedef long SI4;
+#elif INT_MIN == (-0x80000000) && INT_MAX == 0x7FFFFFFF
+typedef int SI4;
+#elif (LONG_LONG_MIN == (-0x80000000) && LONG_LONG_MAX == 0x7FFFFFFF) \
+      || (LLONG_MIN == (-0x80000000) && LLONG_MAX == 0x7FFFFFFF)
+typedef long long SI4;
+#else /* no 4-byte signed int */
+#error No 4-byte signed integer type found.
+#endif /* 4-byte signed int */
+
+// Maximum used specific-size integers.
+#define IMAX  I4
+#define SIMAX SI4
+
+// These should be all right in most cases.
+typedef int BOOLEAN;
+typedef SI4 COUNT;
+typedef COUNT SIZE;
+
+#endif

+ 139 - 0
external/dasm-tigcc/hwpm.c

@@ -0,0 +1,139 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: hwpm.c 2385 2007-03-12 21:04:20Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2003, Romain Lievin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+	This module manages Hardware Parameter Block. This is a 'C' structure like this:
+
+	typedef struct {
+	unsigned short len;					// length of parameter block
+	unsigned long hardwareID;			// 1 = TI-92 Plus, 3 = TI-89
+	unsigned long hardwareRevision;		// hardware revision number
+	unsigned long bootMajor;			// boot code version number
+	unsigned long bootRevision;			// boot code revision number
+	unsigned long bootBuild;			// boot code build number
+	unsigned long gateArray;			// gate array version number
+	unsigned long physDisplayBitsWide;	// display width
+	unsigned long physDisplayBitsTall;	// display height
+	unsigned long LCDBitsWide;			// visible display width
+	unsigned long LCDBitsTall;			// visible display height
+	} HARDWARE_PARM_BLOCK;
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h> //memset
+
+#include "hwpm.h"
+#include "timem.h"
+
+#define _(x) (x)
+#define tiemu_info(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+
+/* -- */
+
+/*
+    Read hardware parameter block from image.
+*/
+int ti68k_get_hw_param_block(uint8_t *rom_data, uint8_t rom_base, HW_PARM_BLOCK *s)
+{
+	int i = 0;
+    uint32_t addr;
+
+    addr = rd_long(&rom_data[0x104]);
+    addr &= 0x000fffff;
+
+    memset(s, 0, sizeof(HW_PARM_BLOCK));
+    s->len = rd_word(&(rom_data[addr+0]));
+	if(s->len > 2+(4*i++))
+		s->hardwareID = rd_long(&(rom_data[addr+2]));
+	if(s->len > 2+(4*i++))
+		s->hardwareRevision = rd_long(&(rom_data[addr+6]));
+	if(s->len > 2+(4*i++))
+		s->bootMajor = rd_long(&(rom_data[addr+10]));
+	if(s->len > 2+(4*i++))
+		s->bootRevision = rd_long(&(rom_data[addr+14]));
+	if(s->len > 2+(4*i++))
+		s->bootBuild = rd_long(&(rom_data[addr+18]));
+	if(s->len > 2+(4*i++))
+		s->gateArray = rd_long(&(rom_data[addr+22]));
+	if(s->len > 2+(4*i++))
+		s->physDisplayBitsWide = rd_long(&(rom_data[addr+26]));
+	if(s->len > 2+(4*i++))
+		s->physDisplayBitsTall = rd_long(&(rom_data[addr+30]));
+	if(s->len > 2+(4*i++))
+		s->LCDBitsWide = rd_long(&(rom_data[addr+34]));
+	if(s->len > 2+(4*i++))
+		s->LCDBitsTall = rd_long(&(rom_data[addr+38]));
+
+    if((s->hardwareID == HWID_V200) && (rom_base == 0x40))
+    {
+        tiemu_info(_("/* Detected V200 patched ROM (ExtendeD): emulated as TI92+ by changing the hwID from 8 to 1. */"));
+        s->hardwareID = HWID_TI92P;
+    }
+
+	if((s->hardwareID == HWID_TI89T) && (rom_base == 0x20))
+    {
+        tiemu_info(_("/* Detected TI89 Titanium patched ROM (ExtendeD): emulated as TI89 by changing the hwID from 9 to 3. */"));
+        s->hardwareID = HWID_TI89;
+    }
+
+    return 0;
+}
+
+/*
+    Write hardware parameter block into image.
+*/
+int ti68k_put_hw_param_block(uint8_t *rom_data, uint8_t rom_base, const HW_PARM_BLOCK *s)
+{
+	int i = 0;
+    uint32_t addr = 0x108;
+
+	wr_long(&rom_data[0x104], (rom_base << 16) || addr);
+	wr_word(&(rom_data[addr+0]), s->len);
+
+	if(s->len > 2+(4*i++))
+	    wr_long(&(rom_data[addr+2]), s->hardwareID);
+	if(s->len > 2+(4*i++))
+		wr_long(&(rom_data[addr+6]), s->hardwareRevision);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+10]), s->bootMajor);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+14]), s->bootRevision);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+18]), s->bootBuild);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+22]), s->gateArray);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+26]), s->physDisplayBitsWide);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+30]), s->physDisplayBitsTall);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+34]), s->LCDBitsWide);
+	if(s->len > 2+(4*i++))
+		 wr_long(&(rom_data[addr+38]), s->LCDBitsTall);
+
+    return 0;
+}

+ 65 - 0
external/dasm-tigcc/hwpm.h

@@ -0,0 +1,65 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: hwpm.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2003, Romain Lievin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_HWPM__
+#define __TI68K_HWPM__
+
+#include <stdint.h>
+
+/*
+  Definitions
+*/
+
+// Hardware parameter block from TIGCC documentation
+// Exists only on FLASH calculators
+typedef struct {
+	uint16_t  len;                 /* length of parameter block    */
+    uint32_t  hardwareID;          /* 1 = TI-92 Plus, 3 = TI-89    */
+    uint32_t  hardwareRevision;    /* hardware revision number     */
+    uint32_t  bootMajor;           /* boot code version number     */
+    uint32_t  bootRevision;        /* boot code revision number    */
+    uint32_t  bootBuild;           /* boot code build number       */
+    uint32_t  gateArray;           /* gate array version number    */
+    uint32_t  physDisplayBitsWide; /* display width                */
+    uint32_t  physDisplayBitsTall; /* display height               */
+    uint32_t  LCDBitsWide;         /* visible display width        */
+    uint32_t  LCDBitsTall;         /* visible display height       */
+} HW_PARM_BLOCK;
+
+// Possible values if hardwareID field
+#define HWID_TI92P  1
+#define HWID_TI89   3
+#define HWID_V200   8
+#define HWID_TI89T  9
+
+/*
+	Functions
+*/
+
+int ti68k_get_hw_param_block(uint8_t *rom_data, uint8_t rom_base, HW_PARM_BLOCK *block);
+int ti68k_put_hw_param_block(uint8_t *rom_data, uint8_t rom_base, const HW_PARM_BLOCK *s);
+
+#endif

+ 607 - 0
external/dasm-tigcc/images.c

@@ -0,0 +1,607 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: images.c 2417 2007-03-29 01:42:01Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2003, Romain Lievin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005-2007, Romain Liévin, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+	This module handles loading of images or upgrades.
+	Images can be:
+	- ROM dump
+	- FLASH upgrade as a ROM dump
+	
+  	Note:0x12000 is the beginning of the system privileged part.
+*/
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "tifiles.h"
+#include "images.h"
+#include "macros.h"
+#include "hwpm.h"
+#include "ti68k_def.h"
+#include "ti68k_err.h"
+#include "mem_size.h"
+
+#define _(x) (x)
+#define tiemu_info(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+#define tiemu_warning(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+#define tiemu_error(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+
+#define is_num(c)   isdigit(c)
+#define is_alnum(c) isalnum(c)
+
+#define SPP	0x12000		// system privileged part
+#define BO  0x88        // offset from SPP to boot
+
+static int get_rom_version(char *ptr, int size, char *version);
+
+/*
+	Utility functions
+*/
+int ti68k_is_a_rom_file(const char *filename)
+{
+	char *ext;
+
+	ext = strrchr(filename, '.');
+	if(ext == NULL)
+		return 0;
+	else if(!strcasecmp(ext, ".rom"))
+		return !0;
+
+	return 0;
+}
+
+int ti68k_is_a_tib_file(const char *filename)
+{
+	return tifiles_file_is_os(filename);
+}
+
+int ti68k_is_a_img_file(const char *filename)
+{
+	char *ext;
+
+	ext = strrchr(filename, '.');
+	if(ext == NULL)
+		return 0;
+	else if(!strcasecmp(ext, ".img"))
+		return !0;
+
+	return 0;
+}
+
+int ti68k_is_a_sav_file(const char *filename)
+{
+	char *ext;
+
+	ext = strrchr(filename, '.');
+	if(ext == NULL)
+		return 0;
+	else if(!strcasecmp(ext, ".sav"))
+		return !0;
+
+	return 0;
+}
+
+/*
+	Get some information on the ROM dump:
+	- size
+	- ROM base address
+	- FLASH/EPROM
+	- os version
+	- calc type
+	Note: if the data field is NULL, memory is allocated. 
+	Otherwise, data is overwritten.
+	Thanks to Kevin for HW2 detection code.
+*/
+int ti68k_get_rom_infos(const char *filename, IMG_INFO *rom, int preload)
+{
+  	FILE *file;
+    HW_PARM_BLOCK hwblock;
+
+	// Open file
+  	file = fopen(filename, "rb");
+  	if(file == NULL)
+    {
+      tiemu_info(_("Unable to open this file: <%s>"), filename);
+      return ERR_CANT_OPEN;
+    }
+
+	// Clear infos
+	memset(rom, 0, sizeof(IMG_INFO));
+
+  	// Retrieve ROM size
+  	fseek(file, 0, SEEK_END);
+  	rom->size = ftell(file);
+  	fseek(file, 0, SEEK_SET);
+
+  	if(rom->size < 256) 
+    	return ERR_INVALID_ROM_SIZE;
+	if (rom->size == 8*MB)
+	{
+	  // TiLP used to dump 8 MB images for HW4, try to load them anyway.
+	  tiemu_info(_("/* Warning: truncating 8 MB image to 4 MB: <%s> */"), filename);
+	  rom->size = 4*MB;
+	}
+  	if (rom->size > 4*MB)
+    	return ERR_INVALID_ROM_SIZE;
+  
+	if(rom->data == NULL)
+  		rom->data = malloc(rom->size + 4);
+	if(rom->data == NULL)
+		return ERR_MALLOC;
+	memset(rom->data, 0xff, rom->size);
+	if (fread(rom->data, 1, rom->size, file) < (size_t)rom->size)
+	{
+	  tiemu_info(_("Failed to read from file: <%s>"), filename);
+	  fclose(file);
+	  return ERR_CANT_OPEN;
+	}
+	if (fclose(file))
+	{
+	  tiemu_info(_("Failed to close file: <%s>"), filename);
+	  return ERR_CANT_OPEN;
+	}
+
+    rom->has_boot = 1;
+    rom->rom_base = rom->data[0x05] & 0xf0;
+  	rom->flash = (rom->data[0x65] & 0x0f) ? 0 : FLASH_ROM;
+
+    get_rom_version(rom->data, rom->size, rom->version);
+
+    if(!rom->flash)
+    {
+        rom->calc_type = TI92;
+        rom->hw_type = HW1;
+    }
+    else
+    {
+        // Get hw param block to determine calc type & hw type
+        if(ti68k_get_hw_param_block((uint8_t*)rom->data, rom->rom_base, 
+				    &hwblock) == -1)
+	    return ERR_INVALID_ROM;
+
+        switch(hwblock.hardwareID)
+        {
+        case HWID_TI92P: rom->calc_type = TI92p; break;
+        case HWID_TI89: rom->calc_type = TI89;  break;
+        case HWID_V200: rom->calc_type = V200;  break;
+        case HWID_TI89T: rom->calc_type = TI89t; break;
+        default: break;
+        }
+
+        if(rom->flash)
+        {
+            if(hwblock.len < 24)
+                rom->hw_type = HW1;
+            else
+                rom->hw_type = (char)hwblock.gateArray;
+        }
+    }
+
+	if(!preload)
+		free(rom->data);
+
+	return 0;
+}
+
+
+/*
+  Get some information on the FLASH upgrade:
+  - size
+  - ROM base address
+  - os version
+  - calc type
+*/
+int ti68k_get_tib_infos(const char *filename, IMG_INFO *tib, int preload)
+{
+	FlashContent *content;
+	FlashContent *ptr;
+	int nheaders = 0;
+	int i;
+
+	// Check valid file
+	if(!tifiles_file_is_ti(filename))
+		return ERR_NOT_TI_FILE;
+		
+	if(!tifiles_file_is_os(filename))
+		return ERR_INVALID_UPGRADE;
+
+	// Clear infos
+	memset(tib, 0, sizeof(IMG_INFO));
+
+	// Load file
+	content = tifiles_content_create_flash(CALC_TI89);
+	if(tifiles_file_read_flash(filename, content) != 0)
+        return ERR_INVALID_UPGRADE;
+	
+	// count headers
+  	for (ptr = content; ptr != NULL; ptr = ptr->next)
+    	nheaders++;
+  	
+  	// keep the last one (data)
+  	for (i = 0, ptr = content; i < nheaders - 1; i++)
+    	ptr = ptr->next;
+    	
+  	// Load TIB into memory and relocate at SPP
+	if(tib->data == NULL)
+  		tib->data = malloc(SPP + ptr->data_length + 4);
+	if(tib->data == NULL)
+		return ERR_MALLOC;
+
+    memset(tib->data + SPP, 0xff, ptr->data_length);
+  	memcpy(tib->data + SPP, ptr->data_part, ptr->data_length);
+  	
+  	// Update current rom infos
+    tib->rom_base = tib->data[BO+5 + SPP] & 0xf0;
+
+	// libtifiles can't distinguish TI89/TI89t and 92+/V200. We need to look.
+	switch(ptr->device_type & 0xff)
+	{
+		case DEVICE_TYPE_89:    // can be a Titanium, too
+            switch(tib->rom_base & 0xff)
+            {
+            case 0x20: tib->calc_type = TI89;  break;
+            case 0x80: tib->calc_type = TI89t; break;
+            default: return ERR_INVALID_UPGRADE;
+            }
+		break;
+		case DEVICE_TYPE_92P:
+            switch(tib->rom_base & 0xff)
+            {
+            case 0x20: tib->calc_type = V200;  break;
+            case 0x40: tib->calc_type = TI92p; break;
+            default: return ERR_INVALID_UPGRADE;
+            }
+		break;
+		default:
+			tiemu_info("TIB problem: %02x!\n", 0xff & ptr->device_type);
+			return ERR_INVALID_UPGRADE;
+		break;
+	}
+    
+  	tib->flash = FLASH_ROM;
+  	tib->has_boot = 0;
+  	tib->size = ptr->data_length + SPP;
+
+  	get_rom_version(tib->data, tib->size, tib->version);
+  	
+  	tifiles_content_delete_flash(content);
+	if(!preload)
+		free(tib->data);
+
+  	return 0;
+}
+
+/*
+	Try to get some information on the ROM dump:
+	- size
+	- ROM base address
+	- FLASH/EPROM
+	- soft version
+	- calc type
+*/
+int ti68k_get_img_infos(const char *filename, IMG_INFO *ri)
+{
+	FILE *f;
+
+	// Check file
+	if(!ti68k_is_a_img_file(filename))
+	{
+		tiemu_warning("Images must have '.img' extension (%s).\n",
+			filename);
+		return ERR_CANT_OPEN;
+	}
+	
+	// Open dest file
+  	f = fopen(filename, "rb");
+  	if(f == NULL)
+    {
+      	tiemu_warning("Unable to open this file: <%s>\n", filename);
+      	return ERR_CANT_OPEN;
+    }
+    
+    // Read header
+    if (fread(ri, sizeof(IMG_INFO), 1, f) < 1)
+    {
+      tiemu_warning("Failed to read from file: <%s>\n", filename);
+      fclose(f);
+      return ERR_CANT_OPEN;
+    }
+
+    if(strcmp(ri->signature, IMG_SIGN) || ri->size > 4*MB)
+    {
+      tiemu_warning("Bad image: <%s>\n", filename);
+      return ERR_INVALID_UPGRADE;
+    }
+
+    // Close file
+    if (fclose(f))
+    {
+      tiemu_warning("Failed to close file: <%s>\n", filename);
+      return ERR_CANT_OPEN;
+    }
+    
+    return 0;
+}
+
+const int ti_rom_sizes[] = { ROM_SIZE_TI92_I, ROM_SIZE_TI89, ROM_SIZE_TI92P, ROM_SIZE_V200, ROM_SIZE_TI89T };
+
+static int log_b2(int i)
+{
+    int j, v;
+
+    for(j = 0, v = i; v != 0; v >>= 1, j++);
+
+    return j-1;
+}
+
+int ti68k_get_rom_size(int calc_type)
+{
+    if(calc_type > CALC_MAX)
+    {
+        tiemu_error(_("Bad argument!"));
+        exit(0);
+    }
+
+    return ti_rom_sizes[log_b2(calc_type)];
+}
+
+/*
+	Convert an upgrade into an image.
+  	The image has neither boot block nor certificate.
+*/
+int ti68k_convert_tib_to_image(IMG_INFO *src, unsigned char *dst)
+{
+	int i, j;
+	int num_blocks, last_block;
+	int real_size;
+	HW_PARM_BLOCK hwpb;
+
+	// Fill header
+	real_size = src->size - SPP;
+	src->size = ti68k_get_rom_size(src->calc_type);
+
+	// Write boot block
+	memcpy(src->data, &src->data[SPP + BO], 256);
+	memcpy(dst,src,256);
+	dst+=256;
+
+    // Write hardware param block
+	// fill structure
+	hwpb.len = 24;
+	switch(src->calc_type)
+	{
+		case TI89:
+			hwpb.hardwareID = HWID_TI89;
+			hwpb.hardwareRevision = src->hw_type - 1;
+			break;
+		case TI92p:
+			hwpb.hardwareID = HWID_TI92P;
+			hwpb.hardwareRevision = src->hw_type - 1;
+			break;
+		case V200:
+			hwpb.hardwareID = HWID_V200;
+			hwpb.hardwareRevision = 2;
+			break;
+		case TI89t:
+			hwpb.hardwareID = HWID_TI89T;
+			hwpb.hardwareRevision = 2;
+			break;
+	}
+	hwpb.bootMajor = hwpb.bootRevision = hwpb.bootBuild = 1;
+	hwpb.gateArray = src->hw_type;
+	ti68k_put_hw_param_block((uint8_t *)src->data, src->rom_base, &hwpb);
+
+	// write filler
+	*(dst++)=0xfe; *(dst++)=0xed; *(dst++)=0xba; *(dst++)=0xbe;
+	//fwrite(&hwpb, 1hwpb.len+2, f);
+
+	// write address (pointer)
+	*(dst++)=0x00;
+	*(dst++)=src->rom_base;
+	*(dst++)=0x01;
+	*(dst++)=0x08;
+
+	// write structure
+	*(dst++)=MSB(hwpb.len);
+	*(dst++)=LSB(hwpb.len);
+	*(dst++)=MSB(MSW(hwpb.hardwareID));
+	*(dst++)=LSB(MSW(hwpb.hardwareID));
+	*(dst++)=MSB(LSW(hwpb.hardwareID));
+	*(dst++)=LSB(LSW(hwpb.hardwareID));
+	*(dst++)=MSB(MSW(hwpb.hardwareRevision));
+	*(dst++)=LSB(MSW(hwpb.hardwareRevision));
+	*(dst++)=MSB(LSW(hwpb.hardwareRevision));
+	*(dst++)=LSB(LSW(hwpb.hardwareRevision));
+	*(dst++)=MSB(MSW(hwpb.bootMajor));
+	*(dst++)=LSB(MSW(hwpb.bootMajor));
+	*(dst++)=MSB(LSW(hwpb.bootMajor));
+	*(dst++)=LSB(LSW(hwpb.bootMajor));
+	*(dst++)=MSB(MSW(hwpb.hardwareRevision));
+	*(dst++)=LSB(MSW(hwpb.hardwareRevision));
+	*(dst++)=MSB(LSW(hwpb.hardwareRevision));
+	*(dst++)=LSB(LSW(hwpb.hardwareRevision));
+	*(dst++)=MSB(MSW(hwpb.bootBuild));
+	*(dst++)=LSB(MSW(hwpb.bootBuild));
+	*(dst++)=MSB(LSW(hwpb.bootBuild));
+	*(dst++)=LSB(LSW(hwpb.bootBuild));
+	*(dst++)=MSB(MSW(hwpb.gateArray));
+	*(dst++)=LSB(MSW(hwpb.gateArray));
+	*(dst++)=MSB(LSW(hwpb.gateArray));
+	*(dst++)=LSB(LSW(hwpb.gateArray));
+
+	// Fill with 0xff up-to System Part
+	for(i = 0x108 + hwpb.len+2; i < SPP; i++)
+		*(dst++)=0xff;
+ 
+	// Copy FLASH upgrade at 0x12000 (SPP)
+	num_blocks = real_size / 65536;
+	for(i = 0; i < num_blocks; i++ )
+	{
+		memcpy(dst,&src->data[65536 * i + SPP],65536);
+		dst+=65536;
+	}
+
+	last_block = real_size % 65536;
+	memcpy(dst,&src->data[65536 * i + SPP],last_block);
+	dst+=last_block;
+ 
+	for(j = SPP + real_size; j < src->size; j++)
+		*(dst++)=0xff;
+
+	return 0;
+}
+
+
+/*
+  	This function loads an image.
+*/
+int ti68k_load_image(const char *filename, IMG_INFO *img)
+{
+  	FILE *f;  	
+  	int err;
+
+	// Clear infos
+	memset(img, 0, sizeof(IMG_INFO));
+
+	// Load infos
+	err = ti68k_get_img_infos(filename, img);
+  	if(err)
+    {
+      	tiemu_info(_("Unable to get information on image: %s"), filename);
+      	return err;
+    }
+	
+	// Open file
+	f = fopen(filename, "rb");
+	if(f == NULL)
+	{
+		tiemu_warning("Unable to open this file: <%s>\n", filename);
+		return ERR_CANT_OPEN;
+	}
+
+	// Read pure data
+	if (fseek(f, img->header_size, SEEK_SET))
+	{
+		tiemu_warning("Failed to read from file: <%s>\n", filename);
+		fclose(f);
+		return ERR_CANT_OPEN;
+	}
+
+	img->data = malloc(img->size + 4);
+	if(img->data == NULL)
+		return ERR_MALLOC;
+	if (fread(img->data, 1, img->size, f) < (size_t)img->size)
+	{
+		tiemu_warning("Failed to read from file: <%s>\n", filename);
+		fclose(f);
+		return ERR_CANT_OPEN;
+	}
+
+#if 1
+	{
+		HW_PARM_BLOCK hwblock;
+
+		ti68k_get_hw_param_block((uint8_t *)img->data, img->rom_base, 
+					 &hwblock);
+	}
+#endif
+
+	if (fclose(f))
+	{
+		tiemu_warning("Failed to close file: <%s>\n", filename);
+		return ERR_CANT_OPEN;
+	}
+
+	return 0;
+}
+
+/*
+  	Search the version string in the ROM
+	Arguments:
+  	- ptr: a ROM or update image
+  	- size: the size of the buffer
+  	- version: the returned string version
+*/
+static int get_rom_version(char *ptr, int size, char *version)
+{
+  	int i;
+
+  	strcpy(version, "?.??");
+
+  	for (i = SPP; i < size-16; i += 2)
+    {
+      if (is_num(ptr[i])&&(ptr[i+1]=='.') && is_num(ptr[i+2]) &&
+	  (ptr[i+3]==0)&&is_alnum(ptr[i+4]) && is_alnum(ptr[i+5]) &&
+	  (ptr[i+6]=='/')&&is_alnum(ptr[i+7]) && is_alnum(ptr[i+8]) &&
+	  (ptr[i+9]=='/')&&is_alnum(ptr[i+10]) && is_alnum(ptr[i+11]))
+	  	break;
+
+      if (is_num(ptr[i]) && (ptr[i+1]=='.') && is_num(ptr[i+2]) && 
+	  is_num(ptr[i+3]) && (ptr[i+4]==0) && is_alnum(ptr[i+5]) && 
+	  is_alnum(ptr[i+6]) && (ptr[i+7]=='/') && is_alnum(ptr[i+8]) && 
+	  is_alnum(ptr[i+9]) && (ptr[i+10]=='/') && is_alnum(ptr[i+11]) && 
+	  is_alnum(ptr[i+12]))
+		break;
+	
+	  if (is_num(ptr[i]) && (ptr[i+1]=='.') && is_num(ptr[i+2]) && 
+	  (ptr[i+3]==0) && is_alnum(ptr[i+4]) && is_alnum(ptr[i+5]) && 
+	  is_alnum(ptr[i+6]) && is_alnum(ptr[i+7]) && is_alnum(ptr[i+8]) && 
+	  is_alnum(ptr[i+9]) && is_alnum(ptr[i+10]) && is_alnum(ptr[i+11]))
+	  	break;
+
+      if (is_num(ptr[i]) && (ptr[i+1]=='.') && is_num(ptr[i+2]) && 
+	  is_alnum(ptr[i+3]) && (ptr[i+4]==0) && is_alnum(ptr[i+5]) && 
+	  is_alnum(ptr[i+6]) && is_alnum(ptr[i+7]) && is_alnum(ptr[i+8]) && 
+	  is_alnum(ptr[i+9]) && is_alnum(ptr[i+10]) && is_alnum(ptr[i+11]))
+	  	break;
+    }
+  
+  	if (i < size-16) 
+    {
+      	int n;
+      
+      	for(n = i; n < i+16; n++) 
+		{
+	  		if (ptr[n]==0) 
+	    	{
+	      		strcpy(version, ptr+i);
+	      		(version)[n-i]=0;
+
+	      		return 0;
+	    	}
+		}
+    }
+    
+  	return 0;
+}
+

+ 77 - 0
external/dasm-tigcc/images.h

@@ -0,0 +1,77 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: images.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2003, Romain Lievin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_IMAGES__
+#define __TI68K_IMAGES__
+
+#include <stdint.h>
+
+/*
+  Definitions
+*/
+
+#define IMG_SIGN	"TiEmu img v2.00"
+#define IMG_REV		2	// increase this number when changing the structure below
+
+// Please update the docs/TiEmu_img_format.txt documentation when making changes
+// on the structure below
+
+// dc = don't care for rom/tib
+typedef struct
+{
+	char	signature[16];	// "TiEmu img v2.00" (dc)
+    long    revision;       // structure revision (compatibility)
+	long	header_size;	// size of this structure and offset to pure data (dc)
+
+	char	calc_type;		// calculator type
+	char	version[5];		// firmware revision
+	char	flash;			// EPROM or FLASH
+	char	has_boot;		// FLASH upgrade does not have boot
+	long	size;			// size of pure data
+	char	hw_type;		// hw1 or hw2
+    uint8_t rom_base;       // ROM base address (MSB)
+
+    char    fill[0x40-42];  // round up struct to 0x40 bytes
+	char*	data;			// pure data (temporary use, 8 bytes)
+} IMG_INFO;
+
+/*
+	Functions
+*/
+
+int ti68k_is_a_rom_file(const char *filename);
+int ti68k_is_a_tib_file(const char *filename);
+int ti68k_is_a_img_file(const char *filename);
+
+int ti68k_get_rom_infos(const char *filename, IMG_INFO *rom, int preload);
+int ti68k_get_tib_infos(const char *filename, IMG_INFO *tib, int preload);
+int ti68k_get_img_infos(const char *filename, IMG_INFO *img);
+
+int ti68k_convert_tib_to_image(IMG_INFO *src, unsigned char *dst);
+
+int ti68k_load_image(const char *filename, IMG_INFO *img);
+
+#endif

+ 3 - 0
external/dasm-tigcc/int_def.inc

@@ -0,0 +1,3 @@
+DEFINE_INT_SIZE(4)
+DEFINE_INT_SIZE(2)
+DEFINE_INT_SIZE(1)

+ 41 - 0
external/dasm-tigcc/integers.c

@@ -0,0 +1,41 @@
+/* integers.c: Definitions for integers with arbitrary endianness
+
+   Copyright (C) 2003 Sebastian Reichelt
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#include "integers.h"
+
+// See integers.h for a description of these functions.
+
+#define DEFINE_INT_SIZE(Size) \
+I##Size ReadTI##Size (const TI##Size I) \
+{ \
+	return (ReadI##Size (I)); \
+} \
+I##Size ReadHI##Size (const HI##Size I) \
+{ \
+	return (ReadI##Size (I)); \
+} \
+void WriteTI##Size##_ (TI##Size *I, I##Size V) \
+{ \
+	WriteI##Size (*I, V); \
+} \
+void WriteHI##Size##_ (HI##Size *I, I##Size V) \
+{ \
+	WriteI##Size (*I, V); \
+}
+#include "int_def.inc"
+#undef DEFINE_INT_SIZE

+ 161 - 0
external/dasm-tigcc/integers.h

@@ -0,0 +1,161 @@
+/* integers.h: Definitions for integers with arbitrary endianness
+
+   Copyright (C) 2002-2003 Sebastian Reichelt
+   Copyright (C) 2007 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef INTEGERS_H
+#define INTEGERS_H
+
+#include "generic.h"
+
+#define TARGET_BIG_ENDIAN
+
+// *** Zero Integer Definitions ***
+
+typedef I1 ZI1;
+typedef I2 ZI2;
+typedef I4 ZI4;
+
+#define IsZero(I) (!(I))
+
+#ifdef __i386__
+// This only works on targets which don't care about alignment.
+#define IsZeroI1(I) (IsZero (*((ZI1 *) &(I))))
+#define IsZeroI2(I) (IsZero (*((ZI2 *) &(I))))
+#define IsZeroI4(I) (IsZero (*((ZI4 *) &(I))))
+#else
+// Use only bytewise reads for targets which do care about alignment.
+#define IsZeroI1(I) (IsZero (ReadTI1 (*(TI1*)&(I))))
+#define IsZeroI2(I) (IsZero (ReadTI2 (*(TI2*)&(I))))
+#define IsZeroI4(I) (IsZero (ReadTI4 (*(TI4*)&(I))))
+#endif
+
+// *** Target Integer Definitions ***
+
+// 1 Byte Target Integer
+// Defined as structure to avoid unguarded reading/writing.
+typedef struct ATTRIBUTE_PACKED {
+	I1 Val;
+} TI1_struct;
+typedef TI1_struct ATTRIBUTE_MAY_ALIAS TI1;
+
+// 2 Byte Target Integer
+typedef struct ATTRIBUTE_PACKED {
+#ifdef TARGET_BIG_ENDIAN
+	TI1 Hi, Lo;
+#else /* !TARGET_BIG_ENDIAN */
+	TI1 Lo, Hi;
+#endif /* !TARGET_BIG_ENDIAN */
+} TI2_struct;
+typedef TI2_struct ATTRIBUTE_MAY_ALIAS TI2;
+
+// 4 Byte Target Integer
+typedef struct ATTRIBUTE_PACKED {
+#ifdef TARGET_BIG_ENDIAN
+	TI2 Hi, Lo;
+#else /* !TARGET_BIG_ENDIAN */
+	TI2 Lo, Hi;
+#endif /* !TARGET_BIG_ENDIAN */
+} TI4_struct;
+typedef TI4_struct ATTRIBUTE_MAY_ALIAS TI4;
+
+// *** Host Integer Definitions ***
+
+// 1 Byte Host Integer
+// Defined as structure to avoid unguarded reading/writing.
+typedef struct ATTRIBUTE_PACKED {
+	unsigned char Val;
+} HI1_struct;
+typedef HI1_struct ATTRIBUTE_MAY_ALIAS HI1;
+
+// 2 Byte Host Integer
+typedef struct ATTRIBUTE_PACKED {
+#ifdef HOST_BIG_ENDIAN
+	HI1 Hi, Lo;
+#else /* !HOST_BIG_ENDIAN */
+	HI1 Lo, Hi;
+#endif /* !HOST_BIG_ENDIAN */
+} HI2_struct;
+typedef HI2_struct ATTRIBUTE_MAY_ALIAS HI2;
+
+// 4 Byte Host Integer
+typedef struct ATTRIBUTE_PACKED {
+#ifdef HOST_BIG_ENDIAN
+	HI2 Hi, Lo;
+#else /* !HOST_BIG_ENDIAN */
+	HI2 Lo, Hi;
+#endif /* !HOST_BIG_ENDIAN */
+} HI4_struct;
+typedef HI4_struct ATTRIBUTE_MAY_ALIAS HI4;
+
+// *** Macros to read arbitrary integers ***
+
+#define ReadI1(I) ((I).Val)
+#define ReadI2(I) ((ReadI1 ((I).Hi) << 8)  | ReadI1 ((I).Lo))
+#define ReadI4(I) ((ReadI2 ((I).Hi) << 16) | ReadI2 ((I).Lo))
+
+// *** Functions to read integers ***
+
+#define DEFINE_INT_SIZE(size) I##size ReadTI##size (const TI##size I); I##size ReadHI##size (const HI##size I);
+#include "int_def.inc"
+#undef DEFINE_INT_SIZE
+
+// *** Macros to write arbitrary integers ***
+
+#define WriteI1(I,V) ((I).Val = (V))
+#define WriteI2(I,V) ({ register I2 __V2 = (V); WriteI1 ((I).Hi, (__V2) >> 8);  WriteI1 ((I).Lo, (__V2)); })
+#define WriteI4(I,V) ({ register I4 __V4 = (V); WriteI2 ((I).Hi, (__V4) >> 16); WriteI2 ((I).Lo, (__V4)); })
+
+// *** Functions to write integers ***
+
+#define DEFINE_INT_SIZE(size) void WriteTI##size##_ (TI##size *I, I##size V); void WriteHI##size##_ (HI##size *I, I##size V);
+#include "int_def.inc"
+#undef DEFINE_INT_SIZE
+
+#define WriteTI1(I,V) (WriteTI1_ (&(I), (V)))
+#define WriteTI2(I,V) (WriteTI2_ (&(I), (V)))
+#define WriteTI4(I,V) (WriteTI4_ (&(I), (V)))
+#define WriteHI1(I,V) (WriteHI1_ (&(I), (V)))
+#define WriteHI2(I,V) (WriteHI2_ (&(I), (V)))
+#define WriteHI4(I,V) (WriteHI4_ (&(I), (V)))
+
+// *** Functions to read arbitrary-length target integers ***
+
+// Read an unsigned target integer of specified size from a
+// data buffer.
+IMAX  ReadTI  (const void *Data, SIZE Size);
+// Read a signed target integer of specified size from a
+// data buffer.
+SIMAX ReadSTI (const void *Data, SIZE Size);
+
+// *** Functions to write arbitrary-length target integers ***
+
+// Write a target integer of specified size to a data buffer.
+// The integer may be interpreted as a signed or unsigned
+// value based on the AllowSigned and AllowUnsigned parameters.
+// If the value does not fit into the contents, FALSE is
+// returned.
+BOOLEAN WriteTI (void *Data, SIZE Size, SIMAX Value, BOOLEAN AllowSigned, BOOLEAN AllowUnsigned);
+
+// Add a target integer of specified size to a data buffer.
+// The integer may be interpreted as a signed or unsigned
+// value based on the AllowSigned and AllowUnsigned parameters.
+// If the value does not fit into the contents, FALSE is
+// returned.
+BOOLEAN AddTI (void *Data, SIZE Size, SIMAX Value, BOOLEAN AllowSigned, BOOLEAN AllowUnsigned);
+
+#endif

+ 1627 - 0
external/dasm-tigcc/m68k-dis.c

@@ -0,0 +1,1627 @@
+/* Print Motorola 68k instructions.
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
+   1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   Copyright 2007 Kevin Kofler
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "dis-asm.h"
+#include "opintl.h"
+
+#include "m68k.h"
+
+#include "romcalls.h"
+#include "main.h"
+int DasmFPU(uint16_t code, char *buf);
+
+/* Local function prototypes.  */
+
+const char * const fpcr_names[] =
+{
+  "", "%fpiar", "%fpsr", "%fpiar/%fpsr", "%fpcr",
+  "%fpiar/%fpcr", "%fpsr/%fpcr", "%fpiar/%fpsr/%fpcr"
+};
+
+static const char *const reg_names[] =
+{
+  "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
+  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp",
+  "%ps", "%pc"
+};
+
+/* Name of register halves for MAC/EMAC.
+   Seperate from reg_names since 'spu', 'fpl' look weird.  */
+static const char *const reg_half_names[] =
+{
+  "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
+  "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
+  "%ps", "%pc"
+};
+
+/* Sign-extend an (unsigned char).  */
+#if __STDC__ == 1
+#define COERCE_SIGNED_CHAR(ch) ((signed char) (ch))
+#else
+#define COERCE_SIGNED_CHAR(ch) ((int) (((ch) ^ 0x80) & 0xFF) - 128)
+#endif
+
+/* Get a 1 byte signed integer.  */
+#define NEXTBYTE(p)  (p += 2, FETCH_DATA (info, p), COERCE_SIGNED_CHAR(p[-1]))
+
+/* Get a 2 byte signed integer.  */
+#define COERCE16(x) ((int) (((x) ^ 0x8000) - 0x8000))
+#define NEXTWORD(p)  \
+  (p += 2, FETCH_DATA (info, p), \
+   COERCE16 ((p[-2] << 8) + p[-1]))
+
+/* Get a 2 byte unsigned integer.  */
+#define NEXTUWORD(p)  \
+  (p += 2, FETCH_DATA (info, p), \
+   (unsigned int) ((p[-2] << 8) + p[-1]))
+
+/* Get a 4 byte signed integer.  */
+#define COERCE32(x) ((bfd_signed_vma) ((x) ^ 0x80000000) - 0x80000000)
+#define NEXTLONG(p)  \
+  (p += 4, FETCH_DATA (info, p), \
+   (COERCE32 ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1])))
+
+/* Get a 4 byte unsigned integer.  */
+#define NEXTULONG(p)  \
+  (p += 4, FETCH_DATA (info, p), \
+   (unsigned int) ((((((p[-4] << 8) + p[-3]) << 8) + p[-2]) << 8) + p[-1]))
+
+/* Maximum length of an instruction.  */
+#define MAXLEN 22
+
+#include <setjmp.h>
+
+struct private
+{
+  /* Points to first byte not fetched.  */
+  bfd_byte *max_fetched;
+  bfd_byte the_buffer[MAXLEN];
+  bfd_vma insn_start;
+  jmp_buf bailout;
+};
+
+/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
+   to ADDR (exclusive) are valid.  Returns 1 for success, longjmps
+   on error.  */
+#define FETCH_DATA(info, addr) \
+  ((addr) <= ((struct private *) (info->private_data))->max_fetched \
+   ? 1 : fetch_data ((info), (addr)))
+
+static int
+fetch_data (struct disassemble_info *info, bfd_byte *addr)
+{
+  int status;
+  struct private *priv = (struct private *)info->private_data;
+  bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
+
+  status = (*info->read_memory_func) (start,
+				      priv->max_fetched,
+				      addr - priv->max_fetched,
+				      info);
+  if (status != 0)
+    {
+      (*info->memory_error_func) (status, start, info);
+      longjmp (priv->bailout, 1);
+    }
+  else
+    priv->max_fetched = addr;
+  return 1;
+}
+
+/* This function is used to print to the bit-bucket.  */
+static int
+dummy_printer (FILE *file ATTRIBUTE_UNUSED,
+	       const char *format ATTRIBUTE_UNUSED,
+	       ...)
+{
+  return 0;
+}
+
+static void
+dummy_print_address (bfd_vma vma ATTRIBUTE_UNUSED,
+		     struct disassemble_info *info ATTRIBUTE_UNUSED)
+{
+}
+
+/* Fetch BITS bits from a position in the instruction specified by CODE.
+   CODE is a "place to put an argument", or 'x' for a destination
+   that is a general address (mode and register).
+   BUFFER contains the instruction.  */
+
+static int
+fetch_arg (unsigned char *buffer,
+	   int code,
+	   int bits,
+	   disassemble_info *info)
+{
+  int val = 0;
+
+  switch (code)
+    {
+    case '/': /* MAC/EMAC mask bit.  */
+      val = buffer[3] >> 5;
+      break;
+
+    case 'G': /* EMAC ACC load.  */
+      val = ((buffer[3] >> 3) & 0x2) | ((~buffer[1] >> 7) & 0x1);
+      break;
+
+    case 'H': /* EMAC ACC !load.  */
+      val = ((buffer[3] >> 3) & 0x2) | ((buffer[1] >> 7) & 0x1);
+      break;
+
+    case ']': /* EMAC ACCEXT bit.  */
+      val = buffer[0] >> 2;
+      break;
+
+    case 'I': /* MAC/EMAC scale factor.  */
+      val = buffer[2] >> 1;
+      break;
+
+    case 'F': /* EMAC ACCx.  */
+      val = buffer[0] >> 1;
+      break;
+
+    case 'f':
+      val = buffer[1];
+      break;
+
+    case 's':
+      val = buffer[1];
+      break;
+
+    case 'd':			/* Destination, for register or quick.  */
+      val = (buffer[0] << 8) + buffer[1];
+      val >>= 9;
+      break;
+
+    case 'x':			/* Destination, for general arg.  */
+      val = (buffer[0] << 8) + buffer[1];
+      val >>= 6;
+      break;
+
+    case 'k':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[3] >> 4);
+      break;
+
+    case 'C':
+      FETCH_DATA (info, buffer + 3);
+      val = buffer[3];
+      break;
+
+    case '1':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      val >>= 12;
+      break;
+
+    case '2':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      val >>= 6;
+      break;
+
+    case '3':
+    case 'j':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      break;
+
+    case '4':
+      FETCH_DATA (info, buffer + 5);
+      val = (buffer[4] << 8) + buffer[5];
+      val >>= 12;
+      break;
+
+    case '5':
+      FETCH_DATA (info, buffer + 5);
+      val = (buffer[4] << 8) + buffer[5];
+      val >>= 6;
+      break;
+
+    case '6':
+      FETCH_DATA (info, buffer + 5);
+      val = (buffer[4] << 8) + buffer[5];
+      break;
+
+    case '7':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      val >>= 7;
+      break;
+
+    case '8':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      val >>= 10;
+      break;
+
+    case '9':
+      FETCH_DATA (info, buffer + 3);
+      val = (buffer[2] << 8) + buffer[3];
+      val >>= 5;
+      break;
+
+    case 'e':
+      val = (buffer[1] >> 6);
+      break;
+
+    case 'm':
+      val = (buffer[1] & 0x40 ? 0x8 : 0)
+	| ((buffer[0] >> 1) & 0x7)
+	| (buffer[3] & 0x80 ? 0x10 : 0);
+      break;
+
+    case 'n':
+      val = (buffer[1] & 0x40 ? 0x8 : 0) | ((buffer[0] >> 1) & 0x7);
+      break;
+
+    case 'o':
+      val = (buffer[2] >> 4) | (buffer[3] & 0x80 ? 0x10 : 0);
+      break;
+
+    case 'M':
+      val = (buffer[1] & 0xf) | (buffer[3] & 0x40 ? 0x10 : 0);
+      break;
+
+    case 'N':
+      val = (buffer[3] & 0xf) | (buffer[3] & 0x40 ? 0x10 : 0);
+      break;
+
+    case 'h':
+      val = buffer[2] >> 2;
+      break;
+
+    default:
+      abort ();
+    }
+
+  switch (bits)
+    {
+    case 1:
+      return val & 1;
+    case 2:
+      return val & 3;
+    case 3:
+      return val & 7;
+    case 4:
+      return val & 017;
+    case 5:
+      return val & 037;
+    case 6:
+      return val & 077;
+    case 7:
+      return val & 0177;
+    case 8:
+      return val & 0377;
+    case 12:
+      return val & 07777;
+    default:
+      abort ();
+    }
+}
+
+/* Check if an EA is valid for a particular code.  This is required
+   for the EMAC instructions since the type of source address determines
+   if it is a EMAC-load instruciton if the EA is mode 2-5, otherwise it
+   is a non-load EMAC instruction and the bits mean register Ry.
+   A similar case exists for the movem instructions where the register
+   mask is interpreted differently for different EAs.  */
+
+static bfd_boolean
+m68k_valid_ea (char code, int val)
+{
+  int mode, mask;
+#define M(n0,n1,n2,n3,n4,n5,n6,n70,n71,n72,n73,n74) \
+  (n0 | n1 << 1 | n2 << 2 | n3 << 3 | n4 << 4 | n5 << 5 | n6 << 6 \
+   | n70 << 7 | n71 << 8 | n72 << 9 | n73 << 10 | n74 << 11)
+
+  switch (code)
+    {
+    case '*':
+      mask = M (1,1,1,1,1,1,1,1,1,1,1,1);
+      break;
+    case '~':
+      mask = M (0,0,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case '%':
+      mask = M (1,1,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case ';':
+      mask = M (1,0,1,1,1,1,1,1,1,1,1,1);
+      break;
+    case '@':
+      mask = M (1,0,1,1,1,1,1,1,1,1,1,0);
+      break;
+    case '!':
+      mask = M (0,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '&':
+      mask = M (0,0,1,0,0,1,1,1,1,0,0,0);
+      break;
+    case '$':
+      mask = M (1,0,1,1,1,1,1,1,1,0,0,0);
+      break;
+    case '?':
+      mask = M (1,0,1,0,0,1,1,1,1,0,0,0);
+      break;
+    case '/':
+      mask = M (1,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '|':
+      mask = M (0,0,1,0,0,1,1,1,1,1,1,0);
+      break;
+    case '>':
+      mask = M (0,0,1,0,1,1,1,1,1,0,0,0);
+      break;
+    case '<':
+      mask = M (0,0,1,1,0,1,1,1,1,1,1,0);
+      break;
+    case 'm':
+      mask = M (1,1,1,1,1,0,0,0,0,0,0,0);
+      break;
+    case 'n':
+      mask = M (0,0,0,0,0,1,0,0,0,1,0,0);
+      break;
+    case 'o':
+      mask = M (0,0,0,0,0,0,1,1,1,0,1,1);
+      break;
+    case 'p':
+      mask = M (1,1,1,1,1,1,0,0,0,0,0,0);
+      break;
+    case 'q':
+      mask = M (1,0,1,1,1,1,0,0,0,0,0,0);
+      break;
+    case 'v':
+      mask = M (1,0,1,1,1,1,0,1,1,0,0,0);
+      break;
+    case 'b':
+      mask = M (1,0,1,1,1,1,0,0,0,1,0,0);
+      break;
+    case 'w':
+      mask = M (0,0,1,1,1,1,0,0,0,1,0,0);
+      break;
+    case 'y':
+      mask = M (0,0,1,0,0,1,0,0,0,0,0,0);
+      break;
+    case 'z':
+      mask = M (0,0,1,0,0,1,0,0,0,1,0,0);
+      break;
+    case '4':
+      mask = M (0,0,1,1,1,1,0,0,0,0,0,0);
+      break;
+    default:
+      abort ();
+    }
+#undef M
+
+  mode = (val >> 3) & 7;
+  if (mode == 7)
+    mode += val & 7;
+  return (mask & (1 << mode)) != 0;
+}
+
+/* Print a base register REGNO and displacement DISP, on INFO->STREAM.
+   REGNO = -1 for pc, -2 for none (suppressed).  */
+
+static void
+print_base (int regno, bfd_vma disp, disassemble_info *info)
+{
+  if (regno == -1)
+    {
+      (*info->fprintf_func) (info->stream, "%%pc@(");
+      info->flags = 0;
+      info->target = disp;
+      (*info->print_address_func) (disp, info);
+    }
+  else
+    {
+      char buf[50];
+
+      if (regno == -2)
+	(*info->fprintf_func) (info->stream, "@(");
+      else if (regno == -3)
+	(*info->fprintf_func) (info->stream, "%%zpc@(");
+      else
+	(*info->fprintf_func) (info->stream, "%s@(", reg_names[regno]);
+
+      sprintf_vma (buf, disp);
+      (*info->fprintf_func) (info->stream, "%s", buf);
+    }
+}
+
+/* Print an indexed argument.  The base register is BASEREG (-1 for pc).
+   P points to extension word, in buffer.
+   ADDR is the nominal core address of that extension word.  */
+
+static unsigned char *
+print_indexed (int basereg,
+	       unsigned char *p,
+	       bfd_vma addr,
+	       disassemble_info *info)
+{
+  int word;
+  static const char *const scales[] = { "", "*2", "*4", "*8" };
+  bfd_vma base_disp;
+  bfd_vma outer_disp;
+  char buf[40];
+  char vmabuf[50];
+
+  word = NEXTWORD (p);
+
+  /* (TiEmu 20070404 Kevin Kofler) Only allow valid indexed
+                                   addressing on the 68000. */
+  if (info->mach == bfd_mach_m68000 && ((word & (3 << 9)) || (word & 0x100)))
+    return 0;
+
+  /* Generate the text for the index register.
+     Where this will be output is not yet determined.  */
+  sprintf (buf, "%s.%c%s",
+	   reg_names[(word >> 12) & 0xf],
+	   (word & 0x800) ? 'l' : 'w',
+	   scales[(word >> 9) & 3]);
+
+  /* Handle the 68000 style of indexing.  */
+
+  if ((word & 0x100) == 0)
+    {
+      base_disp = word & 0xff;
+      if ((base_disp & 0x80) != 0)
+	base_disp -= 0x100;
+      if (basereg == -1)
+        {
+          info->flags = 0;
+          info->target = base_disp + addr;
+          (*info->print_address_func) (base_disp, info);
+          (*info->fprintf_func) (info->stream, "(%%pc");
+        }
+      else
+        {
+          (*info->fprintf_func) (info->stream, "%d(%s", (int)base_disp, reg_names[basereg]);
+        }
+      (*info->fprintf_func) (info->stream, ",%s)", buf);
+      return p;
+    }
+
+  /* Handle the generalized kind.  */
+  /* First, compute the displacement to add to the base register.  */
+  if (word & 0200)
+    {
+      if (basereg == -1)
+	basereg = -3;
+      else
+	basereg = -2;
+    }
+  if (word & 0100)
+    buf[0] = '\0';
+  base_disp = 0;
+  switch ((word >> 4) & 3)
+    {
+    case 2:
+      base_disp = NEXTWORD (p);
+      break;
+    case 3:
+      base_disp = NEXTLONG (p);
+    }
+  if (basereg == -1)
+    base_disp += addr;
+
+  /* Handle single-level case (not indirect).  */
+  if ((word & 7) == 0)
+    {
+      print_base (basereg, base_disp, info);
+      if (buf[0] != '\0')
+	(*info->fprintf_func) (info->stream, ",%s", buf);
+      (*info->fprintf_func) (info->stream, ")");
+      return p;
+    }
+
+  /* Two level.  Compute displacement to add after indirection.  */
+  outer_disp = 0;
+  switch (word & 3)
+    {
+    case 2:
+      outer_disp = NEXTWORD (p);
+      break;
+    case 3:
+      outer_disp = NEXTLONG (p);
+    }
+
+  print_base (basereg, base_disp, info);
+  if ((word & 4) == 0 && buf[0] != '\0')
+    {
+      (*info->fprintf_func) (info->stream, ",%s", buf);
+      buf[0] = '\0';
+    }
+  sprintf_vma (vmabuf, outer_disp);
+  (*info->fprintf_func) (info->stream, ")@(%s", vmabuf);
+  if (buf[0] != '\0')
+    (*info->fprintf_func) (info->stream, ",%s", buf);
+  (*info->fprintf_func) (info->stream, ")");
+
+  return p;
+}
+
+/* Returns number of bytes "eaten" by the operand, or
+   return -1 if an invalid operand was found, or -2 if
+   an opcode tabe error was found.
+   ADDR is the pc for this arg to be relative to.  */
+
+static int
+print_insn_arg (const char *d,
+		unsigned char *buffer,
+		unsigned char *p0,
+		bfd_vma addr,
+		disassemble_info *info)
+{
+  int val = 0;
+  int place = d[1];
+  unsigned char *p = p0;
+  int regno;
+  const char *regname;
+  unsigned char *p1;
+  bfd_signed_vma disp;
+  unsigned int uval;
+
+  switch (*d)
+    {
+    case 'c':		/* Cache identifier.  */
+      {
+        static const char *const cacheFieldName[] = { "nc", "dc", "ic", "bc" };
+        val = fetch_arg (buffer, place, 2, info);
+        (*info->fprintf_func) (info->stream, cacheFieldName[val]);
+        break;
+      }
+
+    case 'a':		/* Address register indirect only. Cf. case '+'.  */
+      {
+        (*info->fprintf_func)
+	  (info->stream,
+	   "(%s)",
+	   reg_names[fetch_arg (buffer, place, 3, info) + 8]);
+        break;
+      }
+
+    case '_':		/* 32-bit absolute address for move16.  */
+      {
+        uval = NEXTULONG (p);
+        info->flags = 4;
+        info->target = uval;
+	(*info->print_address_func) (uval, info);
+        break;
+      }
+
+    case 'C':
+      (*info->fprintf_func) (info->stream, "%%ccr");
+      break;
+
+    case 'S':
+      (*info->fprintf_func) (info->stream, "%%sr");
+      break;
+
+    case 'U':
+      (*info->fprintf_func) (info->stream, "%%usp");
+      break;
+
+    case 'E':
+      (*info->fprintf_func) (info->stream, "%%acc");
+      break;
+
+    case 'G':
+      (*info->fprintf_func) (info->stream, "%%macsr");
+      break;
+
+    case 'H':
+      (*info->fprintf_func) (info->stream, "%%mask");
+      break;
+
+    case 'J':
+      {
+	/* FIXME: There's a problem here, different m68k processors call the
+	   same address different names. This table can't get it right
+	   because it doesn't know which processor it's disassembling for.  */
+	static const struct { const char *name; int value; } names[]
+	  = {{"%sfc", 0x000}, {"%dfc", 0x001}, {"%cacr", 0x002},
+	     {"%tc",  0x003}, {"%itt0",0x004}, {"%itt1", 0x005},
+             {"%dtt0",0x006}, {"%dtt1",0x007}, {"%buscr",0x008},
+	     {"%usp", 0x800}, {"%vbr", 0x801}, {"%caar", 0x802},
+	     {"%msp", 0x803}, {"%ssp", 0x804},
+	     {"%flashbar", 0xc04}, {"%rambar", 0xc05}, /* mcf528x added these.  */
+
+	     /* Should we be calling this psr like we do in case 'Y'?  */
+	     {"%mmusr",0x805},
+
+             {"%urp", 0x806}, {"%srp", 0x807}, {"%pcr", 0x808}};
+
+	val = fetch_arg (buffer, place, 12, info);
+	/* (TiEmu 20070404 Kevin Kofler) Extra 68000 validation. */
+	if (info->mach == bfd_mach_m68000 && val != 0x800 && val != 0x804)
+	  return -1;
+	for (regno = sizeof names / sizeof names[0] - 1; regno >= 0; regno--)
+	  if (names[regno].value == val)
+	    {
+	      (*info->fprintf_func) (info->stream, "%s", names[regno].name);
+	      break;
+	    }
+	if (regno < 0)
+	  (*info->fprintf_func) (info->stream, "%d", val);
+      }
+      break;
+
+    case 'Q':
+      val = fetch_arg (buffer, place, 3, info);
+      /* 0 means 8, except for the bkpt instruction... */
+      if (val == 0 && d[1] != 's')
+	val = 8;
+      (*info->fprintf_func) (info->stream, "#%d", val);
+      break;
+
+    case 'x':
+      val = fetch_arg (buffer, place, 3, info);
+      /* 0 means -1.  */
+      if (val == 0)
+	val = -1;
+      (*info->fprintf_func) (info->stream, "#%d", val);
+      break;
+
+    case 'M':
+      if (place == 'h')
+	{
+	  static const char *const scalefactor_name[] = { "<<", ">>" };
+	  val = fetch_arg (buffer, place, 1, info);
+	  (*info->fprintf_func) (info->stream, scalefactor_name[val]);
+	}
+      else
+	{
+	  val = fetch_arg (buffer, place, 8, info);
+	  if (val & 0x80)
+	    val = val - 0x100;
+	  (*info->fprintf_func) (info->stream, "#%d", val);
+	}
+      break;
+
+    case 'T':
+      val = fetch_arg (buffer, place, 4, info);
+      (*info->fprintf_func) (info->stream, "#%d", val);
+      break;
+
+    case 'D':
+      (*info->fprintf_func) (info->stream, "%s",
+			     reg_names[fetch_arg (buffer, place, 3, info)]);
+      break;
+
+    case 'A':
+      (*info->fprintf_func)
+	(info->stream, "%s",
+	 reg_names[fetch_arg (buffer, place, 3, info) + 010]);
+      break;
+
+    case 'R':
+      (*info->fprintf_func)
+	(info->stream, "%s",
+	 reg_names[fetch_arg (buffer, place, 4, info)]);
+      break;
+
+    case 'r':
+      regno = fetch_arg (buffer, place, 4, info);
+      if (regno > 7)
+	(*info->fprintf_func) (info->stream, "(%s)", reg_names[regno]);
+      else
+	(*info->fprintf_func) (info->stream, "(%s)", reg_names[regno]);
+      break;
+
+    case 'F':
+      (*info->fprintf_func)
+	(info->stream, "%%fp%d",
+	 fetch_arg (buffer, place, 3, info));
+      break;
+
+    case 'O':
+      val = fetch_arg (buffer, place, 6, info);
+      if (val & 0x20)
+	(*info->fprintf_func) (info->stream, "%s", reg_names[val & 7]);
+      else
+	(*info->fprintf_func) (info->stream, "%d", val);
+      break;
+
+    case '+':
+      (*info->fprintf_func)
+	(info->stream, "(%s)+",
+	 reg_names[fetch_arg (buffer, place, 3, info) + 8]);
+      break;
+
+    case '-':
+      (*info->fprintf_func)
+	(info->stream, "-(%s)",
+	 reg_names[fetch_arg (buffer, place, 3, info) + 8]);
+      break;
+
+    case 'k':
+      if (place == 'k')
+	(*info->fprintf_func)
+	  (info->stream, "{%s}",
+	   reg_names[fetch_arg (buffer, place, 3, info)]);
+      else if (place == 'C')
+	{
+	  val = fetch_arg (buffer, place, 7, info);
+	  if (val > 63)		/* This is a signed constant.  */
+	    val -= 128;
+	  (*info->fprintf_func) (info->stream, "{#%d}", val);
+	}
+      else
+	return -2;
+      break;
+
+    case '#':
+    case '^':
+      p1 = buffer + (*d == '#' ? 2 : 4);
+      if (place == 's')
+	val = fetch_arg (buffer, place, 4, info);
+      else if (place == 'C')
+	val = fetch_arg (buffer, place, 7, info);
+      else if (place == '8')
+	val = fetch_arg (buffer, place, 3, info);
+      else if (place == '3')
+	val = fetch_arg (buffer, place, 8, info);
+      else if (place == 'b')
+	val = NEXTBYTE (p1);
+      else if (place == 'w' || place == 'W')
+	val = NEXTWORD (p1);
+      else if (place == 'l')
+	val = NEXTLONG (p1);
+      else
+	return -2;
+      (*info->fprintf_func) (info->stream, "#%d", val);
+      break;
+
+    case 'B':
+      if (place == 'b')
+	disp = NEXTBYTE (p);
+      else if (place == 'B')
+	disp = COERCE_SIGNED_CHAR (buffer[1]);
+      else if (place == 'w' || place == 'W')
+	disp = NEXTWORD (p);
+      else if (place == 'l' || place == 'L' || place == 'C')
+	disp = NEXTLONG (p);
+      else if (place == 'g')
+	{
+	  disp = NEXTBYTE (buffer);
+	  if (disp == 0)
+	    disp = NEXTWORD (p);
+	  else if (disp == -1)
+	    disp = NEXTLONG (p);
+	}
+      else if (place == 'c')
+	{
+	  if (buffer[1] & 0x40)		/* If bit six is one, long offset.  */
+	    disp = NEXTLONG (p);
+	  else
+	    disp = NEXTWORD (p);
+	}
+      else
+	return -2;
+
+      info->flags = 1;
+      info->target = addr + disp;
+      (*info->print_address_func) (disp, info);
+      if (disp < 0)
+        (*info->fprintf_func) (info->stream, " /* -0x%x */", (int)-disp);
+      else
+        (*info->fprintf_func) (info->stream, " /* 0x%x */", (int)disp);
+      break;
+
+    case 'd':
+      val = NEXTWORD (p);
+      (*info->fprintf_func)
+	(info->stream, "%d(%s)",
+	 val, reg_names[fetch_arg (buffer, place, 3, info) + 8]);
+      break;
+
+    case 's':
+      (*info->fprintf_func) (info->stream, "%s",
+			     fpcr_names[fetch_arg (buffer, place, 3, info)]);
+      break;
+
+    case 'e':
+      val = fetch_arg(buffer, place, 2, info);
+      (*info->fprintf_func) (info->stream, "%%acc%d", val);
+      break;
+
+    case 'g':
+      val = fetch_arg(buffer, place, 1, info);
+      (*info->fprintf_func) (info->stream, "%%accext%s", val==0 ? "01" : "23");
+      break;
+
+    case 'i':
+      val = fetch_arg(buffer, place, 2, info);
+      if (val == 1)
+	(*info->fprintf_func) (info->stream, "<<");
+      else if (val == 3)
+	(*info->fprintf_func) (info->stream, ">>");
+      else
+	return -1;
+      break;
+
+    case 'I':
+      /* Get coprocessor ID... */
+      val = fetch_arg (buffer, 'd', 3, info);
+
+      if (val != 1)				/* Unusual coprocessor ID?  */
+	(*info->fprintf_func) (info->stream, "(cpid=%d) ", val);
+      break;
+
+    case '4':
+    case '*':
+    case '~':
+    case '%':
+    case ';':
+    case '@':
+    case '!':
+    case '$':
+    case '?':
+    case '/':
+    case '&':
+    case '|':
+    case '<':
+    case '>':
+    case 'm':
+    case 'n':
+    case 'o':
+    case 'p':
+    case 'q':
+    case 'v':
+    case 'b':
+    case 'w':
+    case 'y':
+    case 'z':
+      if (place == 'd')
+	{
+	  val = fetch_arg (buffer, 'x', 6, info);
+	  val = ((val & 7) << 3) + ((val >> 3) & 7);
+	}
+      else
+	val = fetch_arg (buffer, 's', 6, info);
+
+      /* If the <ea> is invalid for *d, then reject this match.  */
+      if (!m68k_valid_ea (*d, val))
+	return -1;
+
+      /* Get register number assuming address register.  */
+      regno = (val & 7) + 8;
+      regname = reg_names[regno];
+      switch (val >> 3)
+	{
+	case 0:
+	  (*info->fprintf_func) (info->stream, "%s", reg_names[val]);
+	  break;
+
+	case 1:
+	  (*info->fprintf_func) (info->stream, "%s", regname);
+	  break;
+
+	case 2:
+	  (*info->fprintf_func) (info->stream, "(%s)", regname);
+	  break;
+
+	case 3:
+	  (*info->fprintf_func) (info->stream, "(%s)+", regname);
+	  break;
+
+	case 4:
+	  (*info->fprintf_func) (info->stream, "-(%s)", regname);
+	  break;
+
+	case 5:
+	  val = NEXTWORD (p);
+	  (*info->fprintf_func) (info->stream, "%d(%s)", val, regname);
+	  Offset2Name (val);
+	  break;
+
+	case 6:
+	  p = print_indexed (regno, p, addr, info);
+	  if (!p) return -1;
+	  break;
+
+	case 7:
+	  switch (val & 7)
+	    {
+	    case 0:
+	      val = NEXTWORD (p);
+	      info->flags = 4;
+	      info->target = val;
+	      (*info->print_address_func) (val, info);
+	      break;
+
+	    case 1:
+	      uval = NEXTULONG (p);
+	      info->flags = 4;
+	      info->target = uval;
+	      (*info->print_address_func) (uval, info);
+	      break;
+
+	    case 2:
+	      val = NEXTWORD (p);
+	      info->flags = 0;
+	      info->target = addr + val;
+	      (*info->print_address_func) (val, info);
+	      (*info->fprintf_func) (info->stream, "(%%pc)");
+	      break;
+
+	    case 3:
+	      p = print_indexed (-1, p, addr, info);
+	      if (!p) return -1;
+	      break;
+
+	    case 4:
+	      switch (place)
+	      {
+		case 'b':
+		  val = NEXTBYTE (p);
+		  break;
+
+		case 'w':
+		  val = NEXTWORD (p);
+		  break;
+
+		case 'l':
+		  val = NEXTLONG (p);
+		  break;
+
+		default:
+		  return -1;
+	      }
+	      (*info->fprintf_func) (info->stream, "#%d", val);
+	      break;
+
+	    default:
+	      return -1;
+	    }
+	}
+
+      /* If place is '/', then this is the case of the mask bit for
+	 mac/emac loads. Now that the arg has been printed, grab the
+	 mask bit and if set, add a '&' to the arg.  */
+      if (place == '/')
+	{
+	  val = fetch_arg (buffer, place, 1, info);
+	  if (val)
+	    info->fprintf_func (info->stream, "&");
+	}
+      break;
+
+    case 'L':
+    case 'l':
+	if (place == 'w')
+	  {
+	    char doneany;
+	    p1 = buffer + 2;
+	    val = NEXTWORD (p1);
+	    /* Move the pointer ahead if this point is farther ahead
+	       than the last.  */
+	    p = p1 > p ? p1 : p;
+	    if (val == 0)
+	      {
+		(*info->fprintf_func) (info->stream, "#0");
+		break;
+	      }
+	    if (*d == 'l')
+	      {
+		int newval = 0;
+
+		for (regno = 0; regno < 16; ++regno)
+		  if (val & (0x8000 >> regno))
+		    newval |= 1 << regno;
+		val = newval;
+	      }
+	    val &= 0xffff;
+	    doneany = 0;
+	    for (regno = 0; regno < 16; ++regno)
+	      if (val & (1 << regno))
+		{
+		  int first_regno;
+
+		  if (doneany)
+		    (*info->fprintf_func) (info->stream, "/");
+		  doneany = 1;
+		  (*info->fprintf_func) (info->stream, "%s", reg_names[regno]);
+		  first_regno = regno;
+		  while (val & (1 << (regno + 1)))
+		    ++regno;
+		  if (regno > first_regno)
+		    (*info->fprintf_func) (info->stream, "-%s",
+					   reg_names[regno]);
+		}
+	  }
+	else if (place == '3')
+	  {
+	    /* `fmovem' insn.  */
+	    char doneany;
+	    val = fetch_arg (buffer, place, 8, info);
+	    if (val == 0)
+	      {
+		(*info->fprintf_func) (info->stream, "#0");
+		break;
+	      }
+	    if (*d == 'l')
+	      {
+		int newval = 0;
+
+		for (regno = 0; regno < 8; ++regno)
+		  if (val & (0x80 >> regno))
+		    newval |= 1 << regno;
+		val = newval;
+	      }
+	    val &= 0xff;
+	    doneany = 0;
+	    for (regno = 0; regno < 8; ++regno)
+	      if (val & (1 << regno))
+		{
+		  int first_regno;
+		  if (doneany)
+		    (*info->fprintf_func) (info->stream, "/");
+		  doneany = 1;
+		  (*info->fprintf_func) (info->stream, "%%fp%d", regno);
+		  first_regno = regno;
+		  while (val & (1 << (regno + 1)))
+		    ++regno;
+		  if (regno > first_regno)
+		    (*info->fprintf_func) (info->stream, "-%%fp%d", regno);
+		}
+	  }
+	else if (place == '8')
+	  {
+	    /* fmoveml for FP status registers.  */
+	    (*info->fprintf_func) (info->stream, "%s",
+				   fpcr_names[fetch_arg (buffer, place, 3,
+							 info)]);
+	  }
+	else
+	  return -2;
+      break;
+
+    case 'X':
+      place = '8';
+    case 'Y':
+    case 'Z':
+    case 'W':
+    case '0':
+    case '1':
+    case '2':
+    case '3':
+      {
+	int val = fetch_arg (buffer, place, 5, info);
+	const char *name = 0;
+
+	switch (val)
+	  {
+	  case 2: name = "%tt0"; break;
+	  case 3: name = "%tt1"; break;
+	  case 0x10: name = "%tc"; break;
+	  case 0x11: name = "%drp"; break;
+	  case 0x12: name = "%srp"; break;
+	  case 0x13: name = "%crp"; break;
+	  case 0x14: name = "%cal"; break;
+	  case 0x15: name = "%val"; break;
+	  case 0x16: name = "%scc"; break;
+	  case 0x17: name = "%ac"; break;
+ 	  case 0x18: name = "%psr"; break;
+	  case 0x19: name = "%pcsr"; break;
+	  case 0x1c:
+	  case 0x1d:
+	    {
+	      int break_reg = ((buffer[3] >> 2) & 7);
+
+	      (*info->fprintf_func)
+		(info->stream, val == 0x1c ? "%%bad%d" : "%%bac%d",
+		 break_reg);
+	    }
+	    break;
+	  default:
+	    (*info->fprintf_func) (info->stream, "<mmu register %d>", val);
+	  }
+	if (name)
+	  (*info->fprintf_func) (info->stream, "%s", name);
+      }
+      break;
+
+    case 'f':
+      {
+	int fc = fetch_arg (buffer, place, 5, info);
+
+	if (fc == 1)
+	  (*info->fprintf_func) (info->stream, "%%dfc");
+	else if (fc == 0)
+	  (*info->fprintf_func) (info->stream, "%%sfc");
+	else
+	  /* xgettext:c-format */
+	  (*info->fprintf_func) (info->stream, _("<function code %d>"), fc);
+      }
+      break;
+
+    case 'V':
+      (*info->fprintf_func) (info->stream, "%%val");
+      break;
+
+    case 't':
+      {
+	int level = fetch_arg (buffer, place, 3, info);
+
+	(*info->fprintf_func) (info->stream, "%d", level);
+      }
+      break;
+
+    case 'u':
+      {
+	short is_upper = 0;
+	int reg = fetch_arg (buffer, place, 5, info);
+
+	if (reg & 0x10)
+	  {
+	    is_upper = 1;
+	    reg &= 0xf;
+	  }
+	(*info->fprintf_func) (info->stream, "%s%s",
+			       reg_half_names[reg],
+			       is_upper ? "u" : "l");
+      }
+      break;
+
+    default:
+      return -2;
+    }
+
+  return p - p0;
+}
+
+/* Try to match the current instruction to best and if so, return the
+   number of bytes consumed from the instruction stream, else zero.  */
+
+static int
+match_insn_m68k (bfd_vma memaddr,
+		 disassemble_info * info,
+		 const struct m68k_opcode * best)
+{
+  unsigned char *save_p;
+  unsigned char *p;
+  const char *d;
+
+  struct private *priv = (struct private *) info->private_data;
+  bfd_byte *buffer = priv->the_buffer;
+  fprintf_ftype save_printer = info->fprintf_func;
+  void (* save_print_address) (bfd_vma, struct disassemble_info *)
+    = info->print_address_func;
+
+  /* Point at first word of argument data,
+     and at descriptor for first argument.  */
+  p = buffer + 2;
+
+  /* Figure out how long the fixed-size portion of the instruction is.
+     The only place this is stored in the opcode table is
+     in the arguments--look for arguments which specify fields in the 2nd
+     or 3rd words of the instruction.  */
+  for (d = best->args; *d; d += 2)
+    {
+      /* I don't think it is necessary to be checking d[0] here;
+	 I suspect all this could be moved to the case statement below.  */
+      if (d[0] == '#')
+	{
+	  if (d[1] == 'l' && p - buffer < 6)
+	    p = buffer + 6;
+	  else if (p - buffer < 4 && d[1] != 'C' && d[1] != '8')
+	    p = buffer + 4;
+	}
+
+      if ((d[0] == 'L' || d[0] == 'l') && d[1] == 'w' && p - buffer < 4)
+	p = buffer + 4;
+
+      switch (d[1])
+	{
+	case '1':
+	case '2':
+	case '3':
+	case '7':
+	case '8':
+	case '9':
+	case 'i':
+	  if (p - buffer < 4)
+	    p = buffer + 4;
+	  break;
+	case '4':
+	case '5':
+	case '6':
+	  if (p - buffer < 6)
+	    p = buffer + 6;
+	  break;
+	default:
+	  break;
+	}
+    }
+
+  /* pflusha is an exceptions.  It takes no arguments but is two words
+     long.  Recognize it by looking at the lower 16 bits of the mask.  */
+  if (p - buffer < 4 && (best->match & 0xFFFF) != 0)
+    p = buffer + 4;
+
+  /* lpstop is another exception.  It takes a one word argument but is
+     three words long.  */
+  if (p - buffer < 6
+      && (best->match & 0xffff) == 0xffff
+      && best->args[0] == '#'
+      && best->args[1] == 'w')
+    {
+      /* Copy the one word argument into the usual location for a one
+	 word argument, to simplify printing it.  We can get away with
+	 this because we know exactly what the second word is, and we
+	 aren't going to print anything based on it.  */
+      p = buffer + 6;
+      FETCH_DATA (info, p);
+      buffer[2] = buffer[4];
+      buffer[3] = buffer[5];
+    }
+
+  FETCH_DATA (info, p);
+
+  d = best->args;
+
+  save_p = p;
+  info->print_address_func = dummy_print_address;
+  info->fprintf_func = (fprintf_ftype) dummy_printer;
+
+  /* We scan the operands twice.  The first time we don't print anything,
+     but look for errors.  */
+  for (; *d; d += 2)
+    {
+      int eaten = print_insn_arg (d, buffer, p, memaddr + (p - buffer), info);
+
+      if (eaten >= 0)
+	p += eaten;
+      else if (eaten == -1)
+	{
+	  info->fprintf_func = save_printer;
+	  info->print_address_func = save_print_address;
+	  return 0;
+	}
+      else
+	{
+	  /* We must restore the print functions before trying to print the
+	     error message.  */
+	  info->fprintf_func = save_printer;
+	  info->print_address_func = save_print_address;
+	  info->fprintf_func (info->stream,
+			      /* xgettext:c-format */
+			      _("<internal error in opcode table: %s %s>\n"),
+			      best->name,  best->args);
+	  return 2;
+	}
+    }
+
+  p = save_p;
+  info->fprintf_func = save_printer;
+  info->print_address_func = save_print_address;
+
+  d = best->args;
+
+  info->fprintf_func (info->stream, "%s", best->name);
+
+  if (*d)
+    info->fprintf_func (info->stream, " ");
+
+  while (*d)
+    {
+      p += print_insn_arg (d, buffer, p, memaddr + (p - buffer), info);
+      d += 2;
+
+      if (*d && *(d - 2) != 'I' && *d != 'k')
+	info->fprintf_func (info->stream, ",");
+    }
+
+  return p - buffer;
+}
+
+/* Try to interpret the instruction at address MEMADDR as one that
+   can execute on a processor with the features given by ARCH_MASK.
+   If successful, print the instruction to INFO->STREAM and return
+   its length in bytes.  Return 0 otherwise.  */
+
+static int
+m68k_scan_mask (bfd_vma memaddr, disassemble_info *info,
+		unsigned int arch_mask)
+{
+  int i;
+  const char *d;
+  static const struct m68k_opcode **opcodes[16];
+  static int numopcodes[16];
+  int val;
+  int major_opcode;
+
+  struct private *priv = (struct private *) info->private_data;
+  bfd_byte *buffer = priv->the_buffer;
+
+  if (!opcodes[0])
+    {
+      /* Speed up the matching by sorting the opcode
+	 table on the upper four bits of the opcode.  */
+      const struct m68k_opcode **opc_pointer[16];
+
+      /* First count how many opcodes are in each of the sixteen buckets.  */
+      for (i = 0; i < m68k_numopcodes; i++)
+	numopcodes[(m68k_opcodes[i].opcode >> 28) & 15]++;
+
+      /* Then create a sorted table of pointers
+	 that point into the unsorted table.  */
+      opc_pointer[0] = xmalloc (sizeof (struct m68k_opcode *)
+				* m68k_numopcodes);
+      opcodes[0] = opc_pointer[0];
+
+      for (i = 1; i < 16; i++)
+	{
+	  opc_pointer[i] = opc_pointer[i - 1] + numopcodes[i - 1];
+	  opcodes[i] = opc_pointer[i];
+	}
+
+      for (i = 0; i < m68k_numopcodes; i++)
+	*opc_pointer[(m68k_opcodes[i].opcode >> 28) & 15]++ = &m68k_opcodes[i];
+    }
+
+  FETCH_DATA (info, buffer + 2);
+  major_opcode = (buffer[0] >> 4) & 15;
+
+  /* F-Line ROM calls (see KerNO doc and thanks to Lionel Debroux)
+     Code written by Romain Liévin for TiEmu */
+  if (major_opcode == 0xf)
+    {
+      int op = (buffer[0] << 8) + buffer[1];
+      int pm;
+      if ((op >= 0xf800) && (op <= 0xfff2))
+        {
+          switch (op)
+            {
+              case 0xfff0:  /* 6 byte bsr w/long word displacement */
+                pm = NEXTLONG(buffer);
+                info->fprintf_func (info->stream, ".word 0xfff0 /*bsr*/; .long ");
+                info->flags = 2;
+                info->target = memaddr + pm + 2;
+                info->print_address_func (pm, info);
+                if (pm < 0)
+                  info->fprintf_func (info->stream, " /* -0x%x */", (-pm) - 2);
+                else
+                  info->fprintf_func (info->stream, " /* 0x%x */", pm + 2);
+                return 6;
+              case 0xfff1:  /* 6 byte bra w/long word displacement */
+                pm = NEXTLONG(buffer);
+                info->fprintf_func (info->stream, ".word 0xfff1 /*bra*/; .long ");
+                info->flags = 2;
+                info->target = memaddr + pm + 2;
+                info->print_address_func (pm, info);
+                if (pm < 0)
+                  info->fprintf_func (info->stream, " /* -0x%x */", (-pm) - 2);
+                else
+                  info->fprintf_func (info->stream, " /* 0x%x */", pm + 2);
+                return 6;
+              case 0xfff2:  /* 4 byte ROM CALL */
+                pm = NEXTUWORD(buffer);
+                info->fprintf_func (info->stream, ".word 0xfff2,0x%04x", pm/4);
+                if (romcalls_is_loaded())
+                  info->fprintf_func (info->stream, " /*%s*/", romcalls_get_name(pm / 4));
+                return 4;
+              case 0xffee:  /* jmp __ld_entry_point_plus_0x8000+word */
+                pm = NEXTWORD(buffer);
+                info->fprintf_func (info->stream, ".word 0xfffe /*jmp*/; .long ");
+                info->flags = 0;
+                info->target = entry_point + pm + 0x8000;
+                info->print_address_func (entry_point + pm + 0x8000, info);
+                info->fprintf_func (info->stream, "-__ld_entry_point_plus_0x8000 /* 0x%x */", pm + 0x8000);
+                return 4;
+              case 0xffef: /* jsr __ld_entry_point_plus_0x8000+word */
+                pm = NEXTWORD(buffer);
+                info->fprintf_func (info->stream, ".word 0xfffe /*jsr*/; .long ");
+                info->flags = 0;
+                info->target = entry_point + pm + 0x8000;
+                info->print_address_func (entry_point + pm + 0x8000, info);
+                info->fprintf_func (info->stream, "-__ld_entry_point_plus_0x8000 /* 0x%x */", pm + 0x8000);
+                return 4;
+              case 0xf8b5:  /* 2 byte ROM call followed by an FPU opcode (special case: _bcd_math) */
+                {
+                  char buf[64];
+                  pm = NEXTUWORD(buffer);
+                  DasmFPU(pm, buf);
+                  info->fprintf_func (info->stream, ".word 0xf8b5,0x%04x /*_bcd_math: %s*/", pm, buf);
+                  return 4;
+                }
+              default:  /* 2 byte ROM CALL */
+                info->fprintf_func (info->stream, ".word 0xf800+0x%x", op & 0x7ff);
+                if (romcalls_is_loaded())
+                  info->fprintf_func (info->stream, " /*%s*/", romcalls_get_name(op & 0x7ff));
+                return 2;
+            }
+        }
+    }
+  /* ER_throw */
+  else if (major_opcode == 0xa)
+    {
+      int op = (buffer[0] << 8) + buffer[1];
+      info->fprintf_func (info->stream, ".word 0xa000+%d /*%s*/", op & 0xfff, ercodes_get_name(op & 0xfff));
+      return 2;
+    }
+
+  /* standard m68k instructions */
+  for (i = 0; i < numopcodes[major_opcode]; i++)
+    {
+      const struct m68k_opcode *opc = opcodes[major_opcode][i];
+      unsigned long opcode = opc->opcode;
+      unsigned long match = opc->match;
+
+      if (((0xff & buffer[0] & (match >> 24)) == (0xff & (opcode >> 24)))
+	  && ((0xff & buffer[1] & (match >> 16)) == (0xff & (opcode >> 16)))
+	  /* Only fetch the next two bytes if we need to.  */
+	  && (((0xffff & match) == 0)
+	      ||
+	      (FETCH_DATA (info, buffer + 4)
+	       && ((0xff & buffer[2] & (match >> 8)) == (0xff & (opcode >> 8)))
+	       && ((0xff & buffer[3] & match) == (0xff & opcode)))
+	      )
+	  && (opc->arch & arch_mask) != 0)
+	{
+	  /* Don't use for printout the variants of divul and divsl
+	     that have the same register number in two places.
+	     The more general variants will match instead.  */
+	  for (d = opc->args; *d; d += 2)
+	    if (d[1] == 'D')
+	      break;
+
+	  /* Don't use for printout the variants of most floating
+	     point coprocessor instructions which use the same
+	     register number in two places, as above.  */
+	  if (*d == '\0')
+	    for (d = opc->args; *d; d += 2)
+	      if (d[1] == 't')
+		break;
+
+	  /* Don't match fmovel with more than one register;
+	     wait for fmoveml.  */
+	  if (*d == '\0')
+	    {
+	      for (d = opc->args; *d; d += 2)
+		{
+		  if (d[0] == 's' && d[1] == '8')
+		    {
+		      val = fetch_arg (buffer, d[1], 3, info);
+		      if ((val & (val - 1)) != 0)
+			break;
+		    }
+		}
+	    }
+
+	  /* Don't match FPU insns with non-default coprocessor ID.  */
+	  if (*d == '\0')
+	    {
+	      for (d = opc->args; *d; d += 2)
+		{
+		  if (d[0] == 'I')
+		    {
+		      val = fetch_arg (buffer, 'd', 3, info);
+		      if (val != 1)
+			break;
+		    }
+		}
+	    }
+
+	  if (*d == '\0')
+	    if ((val = match_insn_m68k (memaddr, info, opc)))
+	      return val;
+	}
+    }
+  return 0;
+}		
+
+/* Table indexed by bfd_mach_arch number indicating which
+   architectural features are supported.  */
+static const unsigned m68k_arch_features[] = 
+{
+  0,
+  m68000,
+  m68000|m68881|m68851,
+  m68010|m68881|m68851,
+  m68020|m68881|m68851,
+  m68030|m68881|m68851,
+  m68040|m68881|m68851,
+  m68060|m68881|m68851,
+  cpu32|m68881,
+  mcfisa_a,
+  mcfisa_a|mcfhwdiv,
+  mcfisa_a|mcfhwdiv|mcfmac,
+  mcfisa_a|mcfhwdiv|mcfemac,
+  mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp,
+  mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp|mcfmac,
+  mcfisa_a|mcfisa_aa|mcfhwdiv|mcfusp|mcfemac,
+  mcfisa_a|mcfhwdiv|mcfisa_b,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfmac,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfemac,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|mcfmac,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|mcfemac,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfmac,
+  mcfisa_a|mcfhwdiv|mcfisa_b|mcfusp|cfloat|mcfemac,
+};
+
+/* Return the architectural features supported by MACH */
+
+unsigned
+bfd_m68k_mach_to_features (int mach)
+{
+  if ((unsigned)mach
+      >= sizeof (m68k_arch_features) / sizeof (m68k_arch_features[0]))
+    mach = 0;
+  return m68k_arch_features[mach];
+}
+/* Print the m68k instruction at address MEMADDR in debugged memory,
+   on INFO->STREAM.  Returns length of the instruction, in bytes.  */
+
+int
+print_insn_m68k (bfd_vma memaddr, disassemble_info *info)
+{
+  unsigned int arch_mask;
+  struct private priv;
+  int val;
+
+  bfd_byte *buffer = priv.the_buffer;
+
+  info->private_data = (PTR) &priv;
+  /* Tell objdump to use two bytes per chunk
+     and six bytes per line for displaying raw data.  */
+  info->bytes_per_chunk = 2;
+  info->bytes_per_line = 6;
+  info->display_endian = BFD_ENDIAN_BIG;
+  priv.max_fetched = priv.the_buffer;
+  priv.insn_start = memaddr;
+
+  if (setjmp (priv.bailout) != 0)
+    /* Error return.  */
+    return -1;
+
+  arch_mask = bfd_m68k_mach_to_features (info->mach);
+  if (!arch_mask)
+    {
+      /* First try printing an m680x0 instruction.  Try printing a Coldfire
+	 one if that fails.  */
+      val = m68k_scan_mask (memaddr, info, m68k_mask);
+      if (val)
+	return val;
+
+      val = m68k_scan_mask (memaddr, info, mcf_mask);
+      if (val)
+	return val;
+    }
+  else
+    {
+      val = m68k_scan_mask (memaddr, info, arch_mask);
+      if (val)
+	return val;
+    }
+
+  /* Handle undefined instructions.  */
+  info->fprintf_func (info->stream, ".word 0x%04x", (buffer[0] << 8) + buffer[1]);
+  return 2;
+}

+ 2429 - 0
external/dasm-tigcc/m68k-opc.c

@@ -0,0 +1,2429 @@
+/* Opcode table for m680[012346]0/m6888[12]/m68851/mcf5200.
+   Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
+
+   This file is part of GDB, GAS, and the GNU binutils.
+
+   GDB, GAS, and the GNU binutils are free software; you can redistribute
+   them and/or modify them under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either version
+   1, or (at your option) any later version.
+
+   GDB, GAS, and the GNU binutils are distributed in the hope that they
+   will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this file; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "m68k.h"
+
+#define one(x) ((unsigned int) (x) << 16)
+#define two(x, y) (((unsigned int) (x) << 16) + (y))
+
+/* The assembler requires that all instances of the same mnemonic must
+   be consecutive.  If they aren't, the assembler will bomb at
+   runtime.  */
+
+const struct m68k_opcode m68k_opcodes[] =
+{
+{"abcd", 2,	one(0140400),	one(0170770), "DsDd", m68000up },
+{"abcd", 2,	one(0140410),	one(0170770), "-s-d", m68000up },
+
+{"adda.w", 2,	one(0150300),	one(0170700), "*wAd", m68000up },
+{"adda.l", 2,	one(0150700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+
+{"addi.b", 4,	one(0003000),	one(0177700), "#b$s", m68000up },
+{"addi.w", 4,	one(0003100),	one(0177700), "#w$s", m68000up },
+{"addi.l", 6,	one(0003200),	one(0177700), "#l$s", m68000up },
+{"addi.l", 6,	one(0003200),	one(0177700), "#lDs", mcfisa_a },
+
+{"addq.b", 2,	one(0050000),	one(0170700), "Qd$b", m68000up },
+{"addq.w", 2,	one(0050100),	one(0170700), "Qd%w", m68000up },
+{"addq.l", 2,	one(0050200),	one(0170700), "Qd%l", m68000up | mcfisa_a },
+
+/* The add opcode can generate the adda, addi, and addq instructions.  */
+{"add.b", 2,	one(0050000),	one(0170700), "Qd$b", m68000up },
+{"add.b", 4,	one(0003000),	one(0177700), "#b$s", m68000up },
+{"add.b", 2,	one(0150000),	one(0170700), ";bDd", m68000up },
+{"add.b", 2,	one(0150400),	one(0170700), "Dd~b", m68000up },
+{"add.w", 2,	one(0050100),	one(0170700), "Qd%w", m68000up },
+{"add.w", 2,	one(0150300),	one(0170700), "*wAd", m68000up },
+{"add.w", 4,	one(0003100),	one(0177700), "#w$s", m68000up },
+{"add.w", 2,	one(0150100),	one(0170700), "*wDd", m68000up },
+{"add.w", 2,	one(0150500),	one(0170700), "Dd~w", m68000up },
+{"add.l", 2,	one(0050200),	one(0170700), "Qd%l", m68000up | mcfisa_a },
+{"add.l", 6,	one(0003200),	one(0177700), "#l$s", m68000up },
+{"add.l", 6,	one(0003200),	one(0177700), "#lDs", mcfisa_a },
+{"add.l", 2,	one(0150700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"add.l", 2,	one(0150200),	one(0170700), "*lDd", m68000up | mcfisa_a },
+{"add.l", 2,	one(0150600),	one(0170700), "Dd~l", m68000up | mcfisa_a },
+
+{"addx.b", 2,	one(0150400),	one(0170770), "DsDd", m68000up },
+{"addx.b", 2,	one(0150410),	one(0170770), "-s-d", m68000up },
+{"addx.w", 2,	one(0150500),	one(0170770), "DsDd", m68000up },
+{"addx.w", 2,	one(0150510),	one(0170770), "-s-d", m68000up },
+{"addx.l", 2,	one(0150600),	one(0170770), "DsDd", m68000up | mcfisa_a },
+{"addx.l", 2,	one(0150610),	one(0170770), "-s-d", m68000up },
+
+{"andi.b", 4,	one(0001000),	one(0177700), "#b$s", m68000up },
+{"andi.b", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"andi.w", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"andi.w", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+{"andi.l", 6,	one(0001200),	one(0177700), "#l$s", m68000up },
+{"andi.l", 6,	one(0001200),	one(0177700), "#lDs", mcfisa_a },
+{"andi", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"andi", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"andi", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+
+/* The and opcode can generate the andi instruction.  */
+{"and.b", 4,	one(0001000),	one(0177700), "#b$s", m68000up },
+{"and.b", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"and.b", 2,	one(0140000),	one(0170700), ";bDd", m68000up },
+{"and.b", 2,	one(0140400),	one(0170700), "Dd~b", m68000up },
+{"and.w", 4,	one(0001100),	one(0177700), "#w$s", m68000up },
+{"and.w", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+{"and.w", 2,	one(0140100),	one(0170700), ";wDd", m68000up },
+{"and.w", 2,	one(0140500),	one(0170700), "Dd~w", m68000up },
+{"and.l", 6,	one(0001200),	one(0177700), "#l$s", m68000up },
+{"and.l", 6,	one(0001200),	one(0177700), "#lDs", mcfisa_a },
+{"and.l", 2,	one(0140200),	one(0170700), ";lDd", m68000up | mcfisa_a },
+{"and.l", 2,	one(0140600),	one(0170700), "Dd~l", m68000up | mcfisa_a },
+{"and", 4,	one(0001100),	one(0177700), "#w$w", m68000up },
+{"and", 4,	one(0001074),	one(0177777), "#bCs", m68000up },
+{"and", 4,	one(0001174),	one(0177777), "#wSs", m68000up },
+{"and", 2,	one(0140100),	one(0170700), ";wDd", m68000up },
+{"and", 2,	one(0140500),	one(0170700), "Dd~w", m68000up },
+
+{"asl.b", 2,	one(0160400),	one(0170770), "QdDs", m68000up },
+{"asl.b", 2,	one(0160440),	one(0170770), "DdDs", m68000up },
+{"asl.w", 2,	one(0160500),	one(0170770), "QdDs", m68000up },
+{"asl.w", 2,	one(0160540),	one(0170770), "DdDs", m68000up },
+{"asl.w", 2,	one(0160700),	one(0177700), "~s",   m68000up },
+{"asl.l", 2,	one(0160600),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"asl.l", 2,	one(0160640),	one(0170770), "DdDs", m68000up | mcfisa_a },
+
+{"asr.b", 2,	one(0160000),	one(0170770), "QdDs", m68000up },
+{"asr.b", 2,	one(0160040),	one(0170770), "DdDs", m68000up },
+{"asr.w", 2,	one(0160100),	one(0170770), "QdDs", m68000up },
+{"asr.w", 2,	one(0160140),	one(0170770), "DdDs", m68000up },
+{"asr.w", 2,	one(0160300),	one(0177700), "~s",   m68000up },
+{"asr.l", 2,	one(0160200),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"asr.l", 2,	one(0160240),	one(0170770), "DdDs", m68000up | mcfisa_a },
+
+{"bhi.w", 2,	one(0061000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bls.w", 2,	one(0061400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bcc.w", 2,	one(0062000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bcs.w", 2,	one(0062400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bne.w", 2,	one(0063000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"beq.w", 2,	one(0063400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bvc.w", 2,	one(0064000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bvs.w", 2,	one(0064400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bpl.w", 2,	one(0065000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bmi.w", 2,	one(0065400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bge.w", 2,	one(0066000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"blt.w", 2,	one(0066400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bgt.w", 2,	one(0067000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"ble.w", 2,	one(0067400),	one(0177777), "BW", m68000up | mcfisa_a },
+
+{"bhi.l", 2,	one(0061377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bls.l", 2,	one(0061777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bcc.l", 2,	one(0062377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bcs.l", 2,	one(0062777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bne.l", 2,	one(0063377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"beq.l", 2,	one(0063777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bvc.l", 2,	one(0064377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bvs.l", 2,	one(0064777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bpl.l", 2,	one(0065377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bmi.l", 2,	one(0065777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bge.l", 2,	one(0066377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"blt.l", 2,	one(0066777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bgt.l", 2,	one(0067377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"ble.l", 2,	one(0067777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+
+{"bhi.s", 2,	one(0061000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bls.s", 2,	one(0061400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bcc.s", 2,	one(0062000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bcs.s", 2,	one(0062400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bne.s", 2,	one(0063000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"beq.s", 2,	one(0063400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bvc.s", 2,	one(0064000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bvs.s", 2,	one(0064400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bpl.s", 2,	one(0065000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bmi.s", 2,	one(0065400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bge.s", 2,	one(0066000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"blt.s", 2,	one(0066400),	one(0177400), "BB", m68000up | mcfisa_a },
+{"bgt.s", 2,	one(0067000),	one(0177400), "BB", m68000up | mcfisa_a },
+{"ble.s", 2,	one(0067400),	one(0177400), "BB", m68000up | mcfisa_a },
+
+{"jhi", 2,	one(0061000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jls", 2,	one(0061400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jcc", 2,	one(0062000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jcs", 2,	one(0062400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jne", 2,	one(0063000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jeq", 2,	one(0063400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jvc", 2,	one(0064000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jvs", 2,	one(0064400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jpl", 2,	one(0065000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jmi", 2,	one(0065400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jge", 2,	one(0066000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jlt", 2,	one(0066400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jgt", 2,	one(0067000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jle", 2,	one(0067400),	one(0177400), "Bg", m68000up | mcfisa_a },
+
+{"bchg", 2,	one(0000500),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bchg", 4,	one(0004100),	one(0177700), "#b$s", m68000up },
+{"bchg", 4,	one(0004100),	one(0177700), "#bqs", mcfisa_a },
+
+{"bclr", 2,	one(0000600),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bclr", 4,	one(0004200),	one(0177700), "#b$s", m68000up },
+{"bclr", 4,	one(0004200),	one(0177700), "#bqs", mcfisa_a },
+
+{"bfchg", 4,	two(0165300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bfclr", 4,	two(0166300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bfexts", 4,	two(0165700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfextu", 4,	two(0164700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfffo", 4,	two(0166700, 0), two(0177700, 0100000),	"/sO2O3D1", m68020up },
+{"bfins", 4,	two(0167700, 0), two(0177700, 0100000),	"D1?sO2O3", m68020up },
+{"bfset", 4,	two(0167300, 0), two(0177700, 0170000),	"?sO2O3",   m68020up },
+{"bftst", 4,	two(0164300, 0), two(0177700, 0170000),	"/sO2O3",   m68020up },
+
+{"bgnd", 2,	one(0045372),	one(0177777), "", cpu32 },
+
+{"bitrev", 2,	one(0000300),	one(0177770), "Ds", mcfisa_aa},
+
+{"bkpt", 2,	one(0044110),	one(0177770), "ts", m68010up },
+
+{"bra.w", 2,	one(0060000),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bra.l", 2,	one(0060377),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bra.s", 2,	one(0060000),	one(0177400), "BB", m68000up | mcfisa_a },
+
+{"bset", 2,	one(0000700),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"bset", 2,	one(0000700),	one(0170700), "Ddvs", mcfisa_a },
+{"bset", 4,	one(0004300),	one(0177700), "#b$s", m68000up },
+{"bset", 4,	one(0004300),	one(0177700), "#bqs", mcfisa_a },
+
+{"bsr.w", 2,	one(0060400),	one(0177777), "BW", m68000up | mcfisa_a },
+{"bsr.l", 2,	one(0060777),	one(0177777), "BL", m68020up | cpu32 | mcfisa_b},
+{"bsr.s", 2,	one(0060400),	one(0177400), "BB", m68000up | mcfisa_a },
+
+{"btst", 2,	one(0000400),	one(0170700), "Dd;b", m68000up | mcfisa_a },
+{"btst", 4,	one(0004000),	one(0177700), "#b@s", m68000up },
+{"btst", 4,	one(0004000),	one(0177700), "#bqs", mcfisa_a },
+
+{"byterev", 2,	one(0001300),	one(0177770), "Ds", mcfisa_aa},
+
+{"callm", 4,	one(0003300),	one(0177700), "#b!s", m68020 },
+
+{"cas2.w", 6,    two(0006374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
+{"cas2.w", 6,    two(0006374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
+{"cas2.l", 6,    two(0007374,0), two(0177777,0007070), "D3D6D2D5r1r4", m68020up },
+{"cas2.l", 6,    two(0007374,0), two(0177777,0007070), "D3D6D2D5R1R4", m68020up },
+
+{"cas.b", 4,	two(0005300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+{"cas.w", 4,	two(0006300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+{"cas.l", 4,	two(0007300, 0), two(0177700, 0177070),	"D3D2~s", m68020up },
+
+{"chk2.b", 4, 	two(0000300,0004000), two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"chk2.w", 4, 	two(0001300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"chk2.l", 4, 	two(0002300,0004000),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+
+{"chk.l", 2,	one(0040400),		one(0170700), ";lDd", m68000up },
+{"chk.w", 2,	one(0040600),		one(0170700), ";wDd", m68000up },
+
+#define SCOPE_LINE (0x1 << 3)
+#define SCOPE_PAGE (0x2 << 3)
+#define SCOPE_ALL  (0x3 << 3)
+
+{"cinva", 2,	one(0xf400|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
+{"cinvl", 2,	one(0xf400|SCOPE_LINE), one(0xff38), "ceas", m68040up },
+{"cinvp", 2,	one(0xf400|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
+
+{"cpusha", 2,	one(0xf420|SCOPE_ALL),  one(0xff38), "ce",   m68040up },
+{"cpushl", 2,	one(0xf420|SCOPE_LINE), one(0xff38), "ceas", m68040up | mcfisa_a },
+{"cpushp", 2,	one(0xf420|SCOPE_PAGE), one(0xff38), "ceas", m68040up },
+
+#undef SCOPE_LINE
+#undef SCOPE_PAGE
+#undef SCOPE_ALL
+
+{"clr.b", 2,	one(0041000),	one(0177700), "$s", m68000up | mcfisa_a },
+{"clr.w", 2,	one(0041100),	one(0177700), "$s", m68000up | mcfisa_a },
+{"clr.l", 2,	one(0041200),	one(0177700), "$s", m68000up | mcfisa_a },
+
+{"cmp2.b", 4,	two(0000300,0), two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"cmp2.w", 4,	two(0001300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+{"cmp2.l", 4,	two(0002300,0),	two(0177700,07777), "!sR1", m68020up | cpu32 },
+
+{"cmpa.w", 2,	one(0130300),	one(0170700), "*wAd", m68000up },
+{"cmpa.l", 2,	one(0130700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+
+{"cmpi.b", 4,	one(0006000),	one(0177700), "#b$s", m68000up },
+{"cmpi.b", 4,	one(0006000),	one(0177700), "#bDs", mcfisa_b },
+{"cmpi.w", 4,	one(0006100),	one(0177700), "#w$s", m68000up },
+{"cmpi.w", 4,	one(0006100),	one(0177700), "#wDs", mcfisa_b },
+{"cmpi.l", 6,	one(0006200),	one(0177700), "#l$s", m68000up },
+{"cmpi.l", 6,	one(0006200),	one(0177700), "#lDs", mcfisa_a },
+
+{"cmpm.b", 2,	one(0130410),	one(0170770), "+s+d", m68000up },
+{"cmpm.w", 2,	one(0130510),	one(0170770), "+s+d", m68000up },
+{"cmpm.l", 2,	one(0130610),	one(0170770), "+s+d", m68000up },
+
+/* The cmp opcode can generate the cmpa, cmpm, and cmpi instructions.  */
+{"cmp.b", 4,	one(0006000),	one(0177700), "#b$s", m68000up },
+{"cmp.b", 4,	one(0006000),	one(0177700), "#bDs", mcfisa_b },
+{"cmp.b", 2,	one(0130410),	one(0170770), "+s+d", m68000up },
+{"cmp.b", 2,	one(0130000),	one(0170700), ";bDd", m68000up },
+{"cmp.b", 2,	one(0130000),	one(0170700), "*bDd", mcfisa_b },
+{"cmp.w", 2,	one(0130300),	one(0170700), "*wAd", m68000up },
+{"cmp.w", 4,	one(0006100),	one(0177700), "#w$s", m68000up },
+{"cmp.w", 4,	one(0006100),	one(0177700), "#wDs", mcfisa_b },
+{"cmp.w", 2,	one(0130510),	one(0170770), "+s+d", m68000up },
+{"cmp.w", 2,	one(0130100),	one(0170700), "*wDd", m68000up | mcfisa_b },
+{"cmp.l", 2,	one(0130700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"cmp.l", 6,	one(0006200),	one(0177700), "#l$s", m68000up },
+{"cmp.l", 6,	one(0006200),	one(0177700), "#lDs", mcfisa_a },
+{"cmp.l", 2,	one(0130610),	one(0170770), "+s+d", m68000up },
+{"cmp.l", 2,	one(0130200),	one(0170700), "*lDd", m68000up | mcfisa_a },
+
+{"dbcc", 2,	one(0052310),	one(0177770), "DsBw", m68000up },
+{"dbcs", 2,	one(0052710),	one(0177770), "DsBw", m68000up },
+{"dbeq", 2,	one(0053710),	one(0177770), "DsBw", m68000up },
+{"dbf", 2,	one(0050710),	one(0177770), "DsBw", m68000up },
+{"dbge", 2,	one(0056310),	one(0177770), "DsBw", m68000up },
+{"dbgt", 2,	one(0057310),	one(0177770), "DsBw", m68000up },
+{"dbhi", 2,	one(0051310),	one(0177770), "DsBw", m68000up },
+{"dble", 2,	one(0057710),	one(0177770), "DsBw", m68000up },
+{"dbls", 2,	one(0051710),	one(0177770), "DsBw", m68000up },
+{"dblt", 2,	one(0056710),	one(0177770), "DsBw", m68000up },
+{"dbmi", 2,	one(0055710),	one(0177770), "DsBw", m68000up },
+{"dbne", 2,	one(0053310),	one(0177770), "DsBw", m68000up },
+{"dbpl", 2,	one(0055310),	one(0177770), "DsBw", m68000up },
+{"dbt", 2,	one(0050310),	one(0177770), "DsBw", m68000up },
+{"dbvc", 2,	one(0054310),	one(0177770), "DsBw", m68000up },
+{"dbvs", 2,	one(0054710),	one(0177770), "DsBw", m68000up },
+
+{"divs.w", 2,	one(0100700),	one(0170700), ";wDd", m68000up | mcfhwdiv },
+
+{"divs.l", 4, 	two(0046100,0006000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
+{"divs.l", 4, 	two(0046100,0004000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divs.l", 4, 	two(0046100,0004000),two(0177700,0107770),"qsDD",   mcfhwdiv },
+
+{"divsl.l", 4, 	two(0046100,0004000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
+{"divsl.l", 4, 	two(0046100,0004000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
+
+{"divu.w", 2,	one(0100300),		one(0170700), ";wDd", m68000up | mcfhwdiv },
+
+{"divu.l", 4,	two(0046100,0002000),two(0177700,0107770),";lD3D1", m68020up|cpu32 },
+{"divu.l", 4,	two(0046100,0000000),two(0177700,0107770),";lDD",   m68020up|cpu32 },
+{"divu.l", 4,	two(0046100,0000000),two(0177700,0107770),"qsDD",   mcfhwdiv },
+
+{"divul.l", 4,	two(0046100,0000000),two(0177700,0107770),";lD3D1",m68020up|cpu32 },
+{"divul.l", 4,	two(0046100,0000000),two(0177700,0107770),";lDD",  m68020up|cpu32 },
+
+{"eori.b", 4,	one(0005000),	one(0177700), "#b$s", m68000up },
+{"eori.b", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eori.w", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eori.w", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eori.l", 6,	one(0005200),	one(0177700), "#l$s", m68000up },
+{"eori.l", 6,	one(0005200),	one(0177700), "#lDs", mcfisa_a },
+{"eori", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eori", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eori", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+
+/* The eor opcode can generate the eori instruction.  */
+{"eor.b", 4,	one(0005000),	one(0177700), "#b$s", m68000up },
+{"eor.b", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eor.b", 2,	one(0130400),	one(0170700), "Dd$s", m68000up },
+{"eor.w", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eor.w", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eor.w", 2,	one(0130500),	one(0170700), "Dd$s", m68000up },
+{"eor.l", 6,	one(0005200),	one(0177700), "#l$s", m68000up },
+{"eor.l", 6,	one(0005200),	one(0177700), "#lDs", mcfisa_a },
+{"eor.l", 2,	one(0130600),	one(0170700), "Dd$s", m68000up | mcfisa_a },
+{"eor", 4,	one(0005074),	one(0177777), "#bCs", m68000up },
+{"eor", 4,	one(0005174),	one(0177777), "#wSs", m68000up },
+{"eor", 4,	one(0005100),	one(0177700), "#w$s", m68000up },
+{"eor", 2,	one(0130500),	one(0170700), "Dd$s", m68000up },
+		
+{"exg", 2,	one(0140500),	one(0170770), "DdDs", m68000up },
+{"exg", 2,	one(0140510),	one(0170770), "AdAs", m68000up },
+{"exg", 2,	one(0140610),	one(0170770), "DdAs", m68000up },
+{"exg", 2,	one(0140610),	one(0170770), "AsDd", m68000up },
+
+{"ext.w", 2,	one(0044200),	one(0177770), "Ds", m68000up|mcfisa_a },
+{"ext.l", 2,	one(0044300),	one(0177770), "Ds", m68000up|mcfisa_a },
+{"extb.l", 2,	one(0044700),	one(0177770), "Ds", m68020up|cpu32|mcfisa_a },
+
+{"ff1", 2,   	one(0002300), one(0177770), "Ds", mcfisa_aa},
+
+/* float stuff starts here */
+
+{"fabsb", 4,	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fabsb", 4,	two(0xF000, 0x5818), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsd", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fabsd", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fabsd", 4,	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fabsd", 4,	two(0xF000, 0x5418), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fabsl", 4,	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fabsl", 4,	two(0xF000, 0x4018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsp", 4,	two(0xF000, 0x4C18), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fabss", 4,	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", cfloat },
+{"fabss", 4,	two(0xF000, 0x4418), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fabsw", 4,	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fabsw", 4,	two(0xF000, 0x5018), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fabsx", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fabsx", 4,	two(0xF000, 0x4818), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fabsx", 4,	two(0xF000, 0x0018), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsabsb", 4,	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsabsb", 4,	two(0xF000, 0x5858), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fsabsd", 4,	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsabsd", 4,	two(0xF000, 0x5458), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsabsl", 4,	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsabsl", 4,	two(0xF000, 0x4058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsp", 4,	two(0xF000, 0x4C58), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsabss", 4,	two(0xF000, 0x4458), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabss", 4,	two(0xF000, 0x4458), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsabsw", 4,	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsabsw", 4,	two(0xF000, 0x5058), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsabsx", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsabsx", 4,	two(0xF000, 0x4858), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsabsx", 4,	two(0xF000, 0x0058), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fdabsb", 4,	two(0xF000, 0x585C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsb", 4,	two(0xF000, 0x585c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up},
+{"fdabsd", 4,	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x005C), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x545C), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdabsd", 4,	two(0xF000, 0x545c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up},
+{"fdabsl", 4,	two(0xF000, 0x405C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsl", 4,	two(0xF000, 0x405c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up},
+{"fdabsp", 4,	two(0xF000, 0x4C5c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up},
+{"fdabss", 4,	two(0xF000, 0x445C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabss", 4,	two(0xF000, 0x445c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up},
+{"fdabsw", 4,	two(0xF000, 0x505C), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdabsw", 4,	two(0xF000, 0x505c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x485c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up},
+{"fdabsx", 4,	two(0xF000, 0x005c), two(0xF1C0, 0xE07F), "IiFt",   m68040up},
+
+{"facosb", 4,	two(0xF000, 0x581C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"facosd", 4,	two(0xF000, 0x541C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"facosl", 4,	two(0xF000, 0x401C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"facosp", 4,	two(0xF000, 0x4C1C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"facoss", 4,	two(0xF000, 0x441C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"facosw", 4,	two(0xF000, 0x501C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"facosx", 4,	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"facosx", 4,	two(0xF000, 0x481C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"facosx", 4,	two(0xF000, 0x001C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"faddb", 4,	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"faddb", 4,	two(0xF000, 0x5822), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddd", 4,	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"faddd", 4,	two(0xF000, 0x5422), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"faddl", 4,	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"faddl", 4,	two(0xF000, 0x4022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddp", 4,	two(0xF000, 0x4C22), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fadds", 4,	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fadds", 4,	two(0xF000, 0x4422), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddw", 4,	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"faddw", 4,	two(0xF000, 0x5022), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"faddx", 4,	two(0xF000, 0x0022), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"faddx", 4,	two(0xF000, 0x4822), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"fsaddb", 4,	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsaddb", 4,	two(0xF000, 0x5862), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddd", 4,	two(0xF000, 0x0062), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsaddd", 4,	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsaddd", 4,	two(0xF000, 0x5462), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsaddl", 4,	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsaddl", 4,	two(0xF000, 0x4062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddp", 4,	two(0xF000, 0x4C62), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsadds", 4,	two(0xF000, 0x4462), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsadds", 4,	two(0xF000, 0x4462), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddw", 4,	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsaddw", 4,	two(0xF000, 0x5062), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsaddx", 4,	two(0xF000, 0x0062), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsaddx", 4,	two(0xF000, 0x4862), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fdaddb", 4,	two(0xF000, 0x5866), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddb", 4,	two(0xF000, 0x5866), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdaddd", 4,	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdaddd", 4,	two(0xF000, 0x5466), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddd", 4,	two(0xF000, 0x5466), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdaddl", 4,	two(0xF000, 0x4066), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddl", 4,	two(0xF000, 0x4066), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdaddp", 4,	two(0xF000, 0x4C66), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdadds", 4,	two(0xF000, 0x4466), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdadds", 4,	two(0xF000, 0x4466), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddw", 4,	two(0xF000, 0x5066), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdaddw", 4,	two(0xF000, 0x5066), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdaddx", 4,	two(0xF000, 0x0066), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdaddx", 4,	two(0xF000, 0x4866), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fasinb", 4,	two(0xF000, 0x580C), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fasind", 4,	two(0xF000, 0x540C), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fasinl", 4,	two(0xF000, 0x400C), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fasinp", 4,	two(0xF000, 0x4C0C), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fasins", 4,	two(0xF000, 0x440C), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fasinw", 4,	two(0xF000, 0x500C), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x480C), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fasinx", 4,	two(0xF000, 0x000C), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fatanb", 4,	two(0xF000, 0x580A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fatand", 4,	two(0xF000, 0x540A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fatanl", 4,	two(0xF000, 0x400A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fatanp", 4,	two(0xF000, 0x4C0A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fatans", 4,	two(0xF000, 0x440A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fatanw", 4,	two(0xF000, 0x500A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x480A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fatanx", 4,	two(0xF000, 0x000A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fatanhb", 4,	two(0xF000, 0x580D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fatanhd", 4,	two(0xF000, 0x540D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fatanhl", 4,	two(0xF000, 0x400D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fatanhp", 4,	two(0xF000, 0x4C0D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fatanhs", 4,	two(0xF000, 0x440D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fatanhw", 4,	two(0xF000, 0x500D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x480D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fatanhx", 4,	two(0xF000, 0x000D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fbeq", 2,	one(0xF081),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbf", 2,	one(0xF080),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbge", 2,	one(0xF093),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgl", 2,	one(0xF096),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgle", 2,	one(0xF097),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbgt", 2,	one(0xF092),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fble", 2,	one(0xF095),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fblt", 2,	one(0xF094),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbne", 2,	one(0xF08E),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnge", 2,	one(0xF09C),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngl", 2,	one(0xF099),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngle", 2,	one(0xF098),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbngt", 2,	one(0xF09D),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnle", 2,	one(0xF09A),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbnlt", 2,	one(0xF09B),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fboge", 2,	one(0xF083),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbogl", 2,	one(0xF086),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbogt", 2,	one(0xF082),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbole", 2,	one(0xF085),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbolt", 2,	one(0xF084),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbor", 2,	one(0xF087),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbseq", 2,	one(0xF091),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbsf", 2,	one(0xF090),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbsne", 2,	one(0xF09E),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbst", 2,	one(0xF09F),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbt", 2,	one(0xF08F),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbueq", 2,	one(0xF089),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbuge", 2,	one(0xF08B),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbugt", 2,	one(0xF08A),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbule", 2,	one(0xF08D),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbult", 2,	one(0xF08C),		one(0xF1FF), "IdBW", mfloat | cfloat },
+{"fbun", 2,	one(0xF088),		one(0xF1FF), "IdBW", mfloat | cfloat },
+
+{"fbeql", 2,	one(0xF0C1),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbfl", 2,	one(0xF0C0),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgel", 2,	one(0xF0D3),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgll", 2,	one(0xF0D6),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbglel", 2,	one(0xF0D7),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbgtl", 2,	one(0xF0D2),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fblel", 2,	one(0xF0D5),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbltl", 2,	one(0xF0D4),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnel", 2,	one(0xF0CE),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngel", 2,	one(0xF0DC),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngll", 2,	one(0xF0D9),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnglel", 2,	one(0xF0D8),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbngtl", 2,	one(0xF0DD),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnlel", 2,	one(0xF0DA),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbnltl", 2,	one(0xF0DB),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogel", 2,	one(0xF0C3),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogll", 2,	one(0xF0C6),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbogtl", 2,	one(0xF0C2),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbolel", 2,	one(0xF0C5),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fboltl", 2,	one(0xF0C4),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fborl", 2,	one(0xF0C7),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbseql", 2,	one(0xF0D1),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbsfl", 2,	one(0xF0D0),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbsnel", 2,	one(0xF0DE),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbstl", 2,	one(0xF0DF),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbtl", 2,	one(0xF0CF),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbueql", 2,	one(0xF0C9),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbugel", 2,	one(0xF0CB),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbugtl", 2,	one(0xF0CA),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbulel", 2,	one(0xF0CD),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbultl", 2,	one(0xF0CC),		one(0xF1FF), "IdBC", mfloat | cfloat },
+{"fbunl", 2,	one(0xF0C8),		one(0xF1FF), "IdBC", mfloat | cfloat },
+
+{"fjeq", 2,	one(0xF081),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjf", 2,	one(0xF080),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjge", 2,	one(0xF093),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgl", 2,	one(0xF096),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgle", 2,	one(0xF097),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjgt", 2,	one(0xF092),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjle", 2,	one(0xF095),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjlt", 2,	one(0xF094),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjne", 2,	one(0xF08E),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnge", 2,	one(0xF09C),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngl", 2,	one(0xF099),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngle", 2,	one(0xF098),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjngt", 2,	one(0xF09D),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnle", 2,	one(0xF09A),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjnlt", 2,	one(0xF09B),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjoge", 2,	one(0xF083),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjogl", 2,	one(0xF086),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjogt", 2,	one(0xF082),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjole", 2,	one(0xF085),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjolt", 2,	one(0xF084),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjor", 2,	one(0xF087),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjseq", 2,	one(0xF091),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjsf", 2,	one(0xF090),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjsne", 2,	one(0xF09E),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjst", 2,	one(0xF09F),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjt", 2,	one(0xF08F),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjueq", 2,	one(0xF089),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjuge", 2,	one(0xF08B),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjugt", 2,	one(0xF08A),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjule", 2,	one(0xF08D),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjult", 2,	one(0xF08C),		one(0xF1BF), "IdBc", mfloat | cfloat },
+{"fjun", 2,	one(0xF088),		one(0xF1BF), "IdBc", mfloat | cfloat },
+
+{"fcmpb", 4,	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpb", 4,	two(0xF000, 0x5838), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcmpd", 4,	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcmpd", 4,	two(0xF000, 0x5438), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fcmpd", 4,	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fcmpl", 4,	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcmpl", 4,	two(0xF000, 0x4038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpp", 4,	two(0xF000, 0x4C38), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcmps", 4,	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcmps", 4,	two(0xF000, 0x4438), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpw", 4,	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcmpw", 4,	two(0xF000, 0x5038), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fcmpx", 4,	two(0xF000, 0x0038), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcmpx", 4,	two(0xF000, 0x4838), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"fcosb", 4,	two(0xF000, 0x581D), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcosd", 4,	two(0xF000, 0x541D), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcosl", 4,	two(0xF000, 0x401D), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcosp", 4,	two(0xF000, 0x4C1D), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcoss", 4,	two(0xF000, 0x441D), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcosw", 4,	two(0xF000, 0x501D), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x481D), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fcosx", 4,	two(0xF000, 0x001D), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fcoshb", 4,	two(0xF000, 0x5819), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fcoshd", 4,	two(0xF000, 0x5419), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fcoshl", 4,	two(0xF000, 0x4019), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fcoshp", 4,	two(0xF000, 0x4C19), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fcoshs", 4,	two(0xF000, 0x4419), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fcoshw", 4,	two(0xF000, 0x5019), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x4819), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fcoshx", 4,	two(0xF000, 0x0019), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fdbeq", 4,	two(0xF048, 0x0001), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbf", 4,	two(0xF048, 0x0000), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbge", 4,	two(0xF048, 0x0013), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgl", 4,	two(0xF048, 0x0016), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgle", 4,	two(0xF048, 0x0017), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbgt", 4,	two(0xF048, 0x0012), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdble", 4,	two(0xF048, 0x0015), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdblt", 4,	two(0xF048, 0x0014), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbne", 4,	two(0xF048, 0x000E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnge", 4,	two(0xF048, 0x001C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngl", 4,	two(0xF048, 0x0019), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngle", 4,	two(0xF048, 0x0018), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbngt", 4,	two(0xF048, 0x001D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnle", 4,	two(0xF048, 0x001A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbnlt", 4,	two(0xF048, 0x001B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdboge", 4,	two(0xF048, 0x0003), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbogl", 4,	two(0xF048, 0x0006), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbogt", 4,	two(0xF048, 0x0002), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbole", 4,	two(0xF048, 0x0005), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbolt", 4,	two(0xF048, 0x0004), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbor", 4,	two(0xF048, 0x0007), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbseq", 4,	two(0xF048, 0x0011), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbsf", 4,	two(0xF048, 0x0010), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbsne", 4,	two(0xF048, 0x001E), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbst", 4,	two(0xF048, 0x001F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbt", 4,	two(0xF048, 0x000F), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbueq", 4,	two(0xF048, 0x0009), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbuge", 4,	two(0xF048, 0x000B), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbugt", 4,	two(0xF048, 0x000A), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbule", 4,	two(0xF048, 0x000D), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbult", 4,	two(0xF048, 0x000C), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+{"fdbun", 4,	two(0xF048, 0x0008), two(0xF1F8, 0xFFFF), "IiDsBw", mfloat },
+
+{"fdivb", 4,	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fdivb", 4,	two(0xF000, 0x5820), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivd", 4,	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdivd", 4,	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fdivd", 4,	two(0xF000, 0x5420), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdivl", 4,	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fdivl", 4,	two(0xF000, 0x4020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivp", 4,	two(0xF000, 0x4C20), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fdivs", 4,	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fdivs", 4,	two(0xF000, 0x4420), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivw", 4,	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fdivw", 4,	two(0xF000, 0x5020), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdivx", 4,	two(0xF000, 0x0020), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fdivx", 4,	two(0xF000, 0x4820), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"fsdivb", 4,	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsdivb", 4,	two(0xF000, 0x5860), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivd", 4,	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsdivd", 4,	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsdivd", 4,	two(0xF000, 0x5460), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsdivl", 4,	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsdivl", 4,	two(0xF000, 0x4060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivp", 4,	two(0xF000, 0x4C60), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsdivs", 4,	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsdivs", 4,	two(0xF000, 0x4460), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivw", 4,	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsdivw", 4,	two(0xF000, 0x5060), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsdivx", 4,	two(0xF000, 0x0060), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsdivx", 4,	two(0xF000, 0x4860), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fddivb", 4,	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fddivb", 4,	two(0xF000, 0x5864), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivd", 4,	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fddivd", 4,	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fddivd", 4,	two(0xF000, 0x5464), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fddivl", 4,	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fddivl", 4,	two(0xF000, 0x4064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivp", 4,	two(0xF000, 0x4C64), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fddivs", 4,	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fddivs", 4,	two(0xF000, 0x4464), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivw", 4,	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fddivw", 4,	two(0xF000, 0x5064), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fddivx", 4,	two(0xF000, 0x0064), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fddivx", 4,	two(0xF000, 0x4864), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fetoxb", 4,	two(0xF000, 0x5810), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fetoxd", 4,	two(0xF000, 0x5410), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fetoxl", 4,	two(0xF000, 0x4010), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fetoxp", 4,	two(0xF000, 0x4C10), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fetoxs", 4,	two(0xF000, 0x4410), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fetoxw", 4,	two(0xF000, 0x5010), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x4810), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fetoxx", 4,	two(0xF000, 0x0010), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fetoxm1b", 4,	two(0xF000, 0x5808), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fetoxm1d", 4,	two(0xF000, 0x5408), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fetoxm1l", 4,	two(0xF000, 0x4008), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fetoxm1p", 4,	two(0xF000, 0x4C08), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fetoxm1s", 4,	two(0xF000, 0x4408), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fetoxm1w", 4,	two(0xF000, 0x5008), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x4808), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fetoxm1x", 4,	two(0xF000, 0x0008), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fgetexpb", 4,	two(0xF000, 0x581E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fgetexpd", 4,	two(0xF000, 0x541E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fgetexpl", 4,	two(0xF000, 0x401E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fgetexpp", 4,	two(0xF000, 0x4C1E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fgetexps", 4,	two(0xF000, 0x441E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fgetexpw", 4,	two(0xF000, 0x501E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x481E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fgetexpx", 4,	two(0xF000, 0x001E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fgetmanb", 4,	two(0xF000, 0x581F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fgetmand", 4,	two(0xF000, 0x541F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fgetmanl", 4,	two(0xF000, 0x401F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fgetmanp", 4,	two(0xF000, 0x4C1F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fgetmans", 4,	two(0xF000, 0x441F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fgetmanw", 4,	two(0xF000, 0x501F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x481F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fgetmanx", 4,	two(0xF000, 0x001F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fintb", 4,	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fintb", 4,	two(0xF000, 0x5801), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintd", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fintd", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt", cfloat },
+{"fintd", 4,	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fintd", 4,	two(0xF000, 0x5401), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fintl", 4,	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fintl", 4,	two(0xF000, 0x4001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintp", 4,	two(0xF000, 0x4C01), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fints", 4,	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fints", 4,	two(0xF000, 0x4401), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintw", 4,	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fintw", 4,	two(0xF000, 0x5001), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintx", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fintx", 4,	two(0xF000, 0x4801), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fintx", 4,	two(0xF000, 0x0001), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fintrzb", 4,	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fintrzb", 4,	two(0xF000, 0x5803), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzd", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fintrzd", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fintrzd", 4,	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fintrzd", 4,	two(0xF000, 0x5403), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fintrzl", 4,	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fintrzl", 4,	two(0xF000, 0x4003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzp", 4,	two(0xF000, 0x4C03), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fintrzs", 4,	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fintrzs", 4,	two(0xF000, 0x4403), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzw", 4,	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fintrzw", 4,	two(0xF000, 0x5003), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fintrzx", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fintrzx", 4,	two(0xF000, 0x4803), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fintrzx", 4,	two(0xF000, 0x0003), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"flog10b", 4,	two(0xF000, 0x5815), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flog10d", 4,	two(0xF000, 0x5415), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flog10l", 4,	two(0xF000, 0x4015), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flog10p", 4,	two(0xF000, 0x4C15), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flog10s", 4,	two(0xF000, 0x4415), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flog10w", 4,	two(0xF000, 0x5015), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x4815), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flog10x", 4,	two(0xF000, 0x0015), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"flog2b", 4,	two(0xF000, 0x5816), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flog2d", 4,	two(0xF000, 0x5416), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flog2l", 4,	two(0xF000, 0x4016), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flog2p", 4,	two(0xF000, 0x4C16), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flog2s", 4,	two(0xF000, 0x4416), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flog2w", 4,	two(0xF000, 0x5016), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x4816), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flog2x", 4,	two(0xF000, 0x0016), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"flognb", 4,	two(0xF000, 0x5814), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flognd", 4,	two(0xF000, 0x5414), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flognl", 4,	two(0xF000, 0x4014), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flognp", 4,	two(0xF000, 0x4C14), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flogns", 4,	two(0xF000, 0x4414), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flognw", 4,	two(0xF000, 0x5014), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flognx", 4,	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flognx", 4,	two(0xF000, 0x4814), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flognx", 4,	two(0xF000, 0x0014), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"flognp1b", 4,	two(0xF000, 0x5806), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"flognp1d", 4,	two(0xF000, 0x5406), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"flognp1l", 4,	two(0xF000, 0x4006), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"flognp1p", 4,	two(0xF000, 0x4C06), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"flognp1s", 4,	two(0xF000, 0x4406), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"flognp1w", 4,	two(0xF000, 0x5006), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x4806), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"flognp1x", 4,	two(0xF000, 0x0006), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fmodb", 4,	two(0xF000, 0x5821), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmodd", 4,	two(0xF000, 0x5421), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmodl", 4,	two(0xF000, 0x4021), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmodp", 4,	two(0xF000, 0x4C21), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmods", 4,	two(0xF000, 0x4421), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmodw", 4,	two(0xF000, 0x5021), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmodx", 4,	two(0xF000, 0x0021), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fmodx", 4,	two(0xF000, 0x4821), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"fmoveb", 4,	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmoveb", 4,	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
+{"fmoveb", 4,	two(0xF000, 0x5800), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmoveb", 4,	two(0xF000, 0x7800), two(0xF1C0, 0xFC7F), "IiF7$b", mfloat },
+{"fmoved", 4,	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmoved", 4,	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7~F", mfloat },
+{"fmoved", 4,	two(0xF000, 0x0000), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fmoved", 4,	two(0xF000, 0x5400), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fmoved", 4,	two(0xF000, 0x7400), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
+{"fmovel", 4,	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmovel", 4,	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7$l", mfloat },
+/* FIXME: the next two variants should not permit moving an address
+   register to anything but the floating point instruction register.  */
+{"fmovel", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmovel", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ls8", mfloat },
+{"fmovel", 4,	two(0xF000, 0x4000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmovel", 4,	two(0xF000, 0x6000), two(0xF1C0, 0xFC7F), "IiF7bs", cfloat },
+  /* Move the FP control registers.  */
+{"fmovel", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8ps", cfloat },
+{"fmovel", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Iibss8", cfloat },
+{"fmovep", 4,	two(0xF000, 0x4C00), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmovep", 4,	two(0xF000, 0x6C00), two(0xF1C0, 0xFC00), "IiF7~pkC", mfloat },
+{"fmovep", 4,	two(0xF000, 0x7C00), two(0xF1C0, 0xFC0F), "IiF7~pDk", mfloat },
+{"fmoves", 4,	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmoves", 4,	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7$f", mfloat },
+{"fmoves", 4,	two(0xF000, 0x4400), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmoves", 4,	two(0xF000, 0x6400), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fmovew", 4,	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmovew", 4,	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7$w", mfloat },
+{"fmovew", 4,	two(0xF000, 0x5000), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmovew", 4,	two(0xF000, 0x7000), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fmovex", 4,	two(0xF000, 0x0000), two(0xF1FF, 0xE07F), "IiF8F7", mfloat },
+{"fmovex", 4,	two(0xF000, 0x4800), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fmovex", 4,	two(0xF000, 0x6800), two(0xF1C0, 0xFC7F), "IiF7~x", mfloat },
+
+{"fsmoveb", 4,	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsmoveb", 4,	two(0xF000, 0x5840), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmoveb", 4,	two(0xF000, 0x7840), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsmoved", 4,	two(0xF000, 0x5440), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsmoved", 4,	two(0xF000, 0x7440), two(0xF1C0, 0xFC7F), "IiF7ws", cfloat },
+{"fsmovel", 4,	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsmovel", 4,	two(0xF000, 0x4040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmovel", 4,	two(0xF000, 0x6040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmoves", 4,	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsmoves", 4,	two(0xF000, 0x4440), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmoves", 4,	two(0xF000, 0x6440), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmovew", 4,	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsmovew", 4,	two(0xF000, 0x5040), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmovew", 4,	two(0xF000, 0x7040), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fsmovex", 4,	two(0xF000, 0x0040), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsmovex", 4,	two(0xF000, 0x4840), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsmovep", 4,	two(0xF000, 0x4C40), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+
+{"fdmoveb", 4,	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdmoveb", 4,	two(0xF000, 0x5844), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmoveb", 4,	two(0xF000, 0x7844), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdmoved", 4,	two(0xF000, 0x5444), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdmoved", 4,	two(0xF000, 0x7444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovel", 4,	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdmovel", 4,	two(0xF000, 0x4044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmovel", 4,	two(0xF000, 0x6044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmoves", 4,	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdmoves", 4,	two(0xF000, 0x4444), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmoves", 4,	two(0xF000, 0x6444), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovew", 4,	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdmovew", 4,	two(0xF000, 0x5044), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmovew", 4,	two(0xF000, 0x7044), two(0xF1C0, 0xFC7F), "IiF7qs", cfloat },
+{"fdmovex", 4,	two(0xF000, 0x0044), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdmovex", 4,	two(0xF000, 0x4844), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdmovep", 4,	two(0xF000, 0x4C44), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+
+{"fmovecrx", 4,	two(0xF000, 0x5C00), two(0xF1FF, 0xFC00), "Ii#CF7", mfloat },
+
+{"fmovemd", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Iizsl3", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Iizs#3", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Iil3ys", cfloat },
+{"fmovemd", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Ii#3ys", cfloat },
+
+{"fmovemx", 4,	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
+{"fmovemx", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
+{"fmovemx", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
+{"fmovemx", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
+
+{"fmoveml", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmoveml", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
+/* FIXME: In the next instruction, we should only permit %dn if the
+   target is a single register.  We should only permit %an if the
+   target is a single %fpiar.  */
+{"fmoveml", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*lL8", mfloat },
+
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Iizsl3", cfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Iizs#3", cfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Iil3ys", cfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Ii#3ys", cfloat },
+
+{"fmovem", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "IdL3-s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Idl3&s", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+sl3", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&sl3", mfloat },
+{"fmovem", 4,	two(0xF020, 0xE000), two(0xF1F8, 0xFF00), "Id#3-s", mfloat },
+{"fmovem", 4,	two(0xF020, 0xE800), two(0xF1F8, 0xFF8F), "IiDk-s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF000), two(0xF1C0, 0xFF00), "Id#3&s", mfloat },
+{"fmovem", 4,	two(0xF000, 0xF800), two(0xF1C0, 0xFF8F), "IiDk&s", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD000), two(0xF1F8, 0xFF00), "Id+s#3", mfloat },
+{"fmovem", 4,	two(0xF018, 0xD800), two(0xF1F8, 0xFF8F), "Ii+sDk", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD000), two(0xF1C0, 0xFF00), "Id&s#3", mfloat },
+{"fmovem", 4,	two(0xF000, 0xD800), two(0xF1C0, 0xFF8F), "Ii&sDk", mfloat },
+{"fmovem", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "Iis8%s", mfloat },
+{"fmovem", 4,	two(0xF000, 0x8000), two(0xF1C0, 0xE3FF), "Ii*ss8", mfloat },
+{"fmovem", 4,	two(0xF000, 0xA000), two(0xF1C0, 0xE3FF), "IiL8~s", mfloat },
+{"fmovem", 4,	two(0xF000, 0x8000), two(0xF2C0, 0xE3FF), "Ii*sL8", mfloat },
+
+{"fmulb", 4,	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fmulb", 4,	two(0xF000, 0x5823), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmuld", 4,	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fmuld", 4,	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fmuld", 4,	two(0xF000, 0x5423), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fmull", 4,	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fmull", 4,	two(0xF000, 0x4023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulp", 4,	two(0xF000, 0x4C23), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fmuls", 4,	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fmuls", 4,	two(0xF000, 0x4423), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulw", 4,	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fmulw", 4,	two(0xF000, 0x5023), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fmulx", 4,	two(0xF000, 0x0023), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fmulx", 4,	two(0xF000, 0x4823), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"fsmulb", 4,	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsmulb", 4,	two(0xF000, 0x5863), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmuld", 4,	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsmuld", 4,	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsmuld", 4,	two(0xF000, 0x5463), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsmull", 4,	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsmull", 4,	two(0xF000, 0x4063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulp", 4,	two(0xF000, 0x4C63), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsmuls", 4,	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsmuls", 4,	two(0xF000, 0x4463), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulw", 4,	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsmulw", 4,	two(0xF000, 0x5063), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsmulx", 4,	two(0xF000, 0x0063), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsmulx", 4,	two(0xF000, 0x4863), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fdmulb", 4,	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdmulb", 4,	two(0xF000, 0x5867), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmuld", 4,	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdmuld", 4,	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdmuld", 4,	two(0xF000, 0x5467), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdmull", 4,	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdmull", 4,	two(0xF000, 0x4067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulp", 4,	two(0xF000, 0x4C67), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdmuls", 4,	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdmuls", 4,	two(0xF000, 0x4467), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulw", 4,	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdmulw", 4,	two(0xF000, 0x5067), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdmulx", 4,	two(0xF000, 0x0067), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdmulx", 4,	two(0xF000, 0x4867), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+
+{"fnegb", 4,	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fnegb", 4,	two(0xF000, 0x581A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegd", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fnegd", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fnegd", 4,	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fnegd", 4,	two(0xF000, 0x541A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fnegl", 4,	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fnegl", 4,	two(0xF000, 0x401A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegp", 4,	two(0xF000, 0x4C1A), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fnegs", 4,	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fnegs", 4,	two(0xF000, 0x441A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegw", 4,	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fnegw", 4,	two(0xF000, 0x501A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fnegx", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fnegx", 4,	two(0xF000, 0x481A), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fnegx", 4,	two(0xF000, 0x001A), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsnegb", 4,	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fsnegb", 4,	two(0xF000, 0x585A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegd", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsnegd", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fsnegd", 4,	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fsnegd", 4,	two(0xF000, 0x545A), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsnegl", 4,	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fsnegl", 4,	two(0xF000, 0x405A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegp", 4,	two(0xF000, 0x4C5A), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fsnegs", 4,	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fsnegs", 4,	two(0xF000, 0x445A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegw", 4,	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fsnegw", 4,	two(0xF000, 0x505A), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsnegx", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fsnegx", 4,	two(0xF000, 0x485A), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fsnegx", 4,	two(0xF000, 0x005A), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fdnegb", 4,	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdnegb", 4,	two(0xF000, 0x585E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegd", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdnegd", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fdnegd", 4,	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdnegd", 4,	two(0xF000, 0x545E), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdnegl", 4,	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdnegl", 4,	two(0xF000, 0x405E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegp", 4,	two(0xF000, 0x4C5E), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdnegs", 4,	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdnegs", 4,	two(0xF000, 0x445E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegw", 4,	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdnegw", 4,	two(0xF000, 0x505E), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdnegx", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdnegx", 4,	two(0xF000, 0x485E), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdnegx", 4,	two(0xF000, 0x005E), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fnop", 4,	two(0xF280, 0x0000), two(0xFFFF, 0xFFFF), "Ii", mfloat | cfloat },
+
+{"fremb", 4,	two(0xF000, 0x5825), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fremd", 4,	two(0xF000, 0x5425), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"freml", 4,	two(0xF000, 0x4025), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fremp", 4,	two(0xF000, 0x4C25), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"frems", 4,	two(0xF000, 0x4425), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fremw", 4,	two(0xF000, 0x5025), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fremx", 4,	two(0xF000, 0x0025), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fremx", 4,	two(0xF000, 0x4825), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+{"frestore", 2,	one(0xF140),		one(0xF1C0), "Id<s", mfloat },
+{"frestore", 2,	one(0xF140),		one(0xF1C0), "Idys", cfloat },
+
+{"fsave", 2,	one(0xF100),		one(0xF1C0), "Id>s", mfloat },
+{"fsave", 2,	one(0xF100),		one(0xF1C0), "Idzs", cfloat },
+
+{"fscaleb", 4,	two(0xF000, 0x5826), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fscaled", 4,	two(0xF000, 0x5426), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fscalel", 4,	two(0xF000, 0x4026), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fscalep", 4,	two(0xF000, 0x4C26), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fscales", 4,	two(0xF000, 0x4426), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fscalew", 4,	two(0xF000, 0x5026), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fscalex", 4,	two(0xF000, 0x0026), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fscalex", 4,	two(0xF000, 0x4826), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+
+/* $ is necessary to prevent the assembler from using PC-relative.
+   If @ were used, "label: fseq label" could produce "ftrapeq", 2,
+   because "label" became "pc@label".  */
+{"fseq", 4,	two(0xF040, 0x0001), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsf", 4,	two(0xF040, 0x0000), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsge", 4,	two(0xF040, 0x0013), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgl", 4,	two(0xF040, 0x0016), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgle", 4,	two(0xF040, 0x0017), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsgt", 4,	two(0xF040, 0x0012), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsle", 4,	two(0xF040, 0x0015), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fslt", 4,	two(0xF040, 0x0014), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsne", 4,	two(0xF040, 0x000E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnge", 4,	two(0xF040, 0x001C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngl", 4,	two(0xF040, 0x0019), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngle", 4,	two(0xF040, 0x0018), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsngt", 4,	two(0xF040, 0x001D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnle", 4,	two(0xF040, 0x001A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsnlt", 4,	two(0xF040, 0x001B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsoge", 4,	two(0xF040, 0x0003), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsogl", 4,	two(0xF040, 0x0006), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsogt", 4,	two(0xF040, 0x0002), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsole", 4,	two(0xF040, 0x0005), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsolt", 4,	two(0xF040, 0x0004), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsor", 4,	two(0xF040, 0x0007), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsseq", 4,	two(0xF040, 0x0011), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fssf", 4,	two(0xF040, 0x0010), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fssne", 4,	two(0xF040, 0x001E), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsst", 4,	two(0xF040, 0x001F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fst", 4,	two(0xF040, 0x000F), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsueq", 4,	two(0xF040, 0x0009), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsuge", 4,	two(0xF040, 0x000B), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsugt", 4,	two(0xF040, 0x000A), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsule", 4,	two(0xF040, 0x000D), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsult", 4,	two(0xF040, 0x000C), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+{"fsun", 4,	two(0xF040, 0x0008), two(0xF1C0, 0xFFFF), "Ii$s", mfloat },
+
+{"fsgldivb", 4,	two(0xF000, 0x5824), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsgldivd", 4,	two(0xF000, 0x5424), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsgldivl", 4,	two(0xF000, 0x4024), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsgldivp", 4,	two(0xF000, 0x4C24), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsgldivs", 4,	two(0xF000, 0x4424), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsgldivw", 4,	two(0xF000, 0x5024), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x4824), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsgldivx", 4,	two(0xF000, 0x0024), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsglmulb", 4,	two(0xF000, 0x5827), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsglmuld", 4,	two(0xF000, 0x5427), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsglmull", 4,	two(0xF000, 0x4027), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsglmulp", 4,	two(0xF000, 0x4C27), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsglmuls", 4,	two(0xF000, 0x4427), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsglmulw", 4,	two(0xF000, 0x5027), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x4827), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsglmulx", 4,	two(0xF000, 0x0027), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsinb", 4,	two(0xF000, 0x580E), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsind", 4,	two(0xF000, 0x540E), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsinl", 4,	two(0xF000, 0x400E), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsinp", 4,	two(0xF000, 0x4C0E), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsins", 4,	two(0xF000, 0x440E), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsinw", 4,	two(0xF000, 0x500E), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x480E), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsinx", 4,	two(0xF000, 0x000E), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsincosb", 4,	two(0xF000, 0x5830), two(0xF1C0, 0xFC78), "Ii;bF3F7", mfloat },
+{"fsincosd", 4,	two(0xF000, 0x5430), two(0xF1C0, 0xFC78), "Ii;FF3F7", mfloat },
+{"fsincosl", 4,	two(0xF000, 0x4030), two(0xF1C0, 0xFC78), "Ii;lF3F7", mfloat },
+{"fsincosp", 4,	two(0xF000, 0x4C30), two(0xF1C0, 0xFC78), "Ii;pF3F7", mfloat },
+{"fsincoss", 4,	two(0xF000, 0x4430), two(0xF1C0, 0xFC78), "Ii;fF3F7", mfloat },
+{"fsincosw", 4,	two(0xF000, 0x5030), two(0xF1C0, 0xFC78), "Ii;wF3F7", mfloat },
+{"fsincosx", 4,	two(0xF000, 0x0030), two(0xF1C0, 0xE078), "IiF8F3F7", mfloat },
+{"fsincosx", 4,	two(0xF000, 0x4830), two(0xF1C0, 0xFC78), "Ii;xF3F7", mfloat },
+
+{"fsinhb", 4,	two(0xF000, 0x5802), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsinhd", 4,	two(0xF000, 0x5402), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsinhl", 4,	two(0xF000, 0x4002), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsinhp", 4,	two(0xF000, 0x4C02), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsinhs", 4,	two(0xF000, 0x4402), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsinhw", 4,	two(0xF000, 0x5002), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x4802), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsinhx", 4,	two(0xF000, 0x0002), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fsqrtb", 4,	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsqrtb", 4,	two(0xF000, 0x5804), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fsqrtd", 4,	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsqrtd", 4,	two(0xF000, 0x5404), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsqrtl", 4,	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsqrtl", 4,	two(0xF000, 0x4004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtp", 4,	two(0xF000, 0x4C04), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsqrts", 4,	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsqrts", 4,	two(0xF000, 0x4404), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtw", 4,	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsqrtw", 4,	two(0xF000, 0x5004), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsqrtx", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsqrtx", 4,	two(0xF000, 0x4804), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsqrtx", 4,	two(0xF000, 0x0004), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fssqrtb", 4,	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fssqrtb", 4,	two(0xF000, 0x5841), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fssqrtd", 4,	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fssqrtd", 4,	two(0xF000, 0x5441), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fssqrtl", 4,	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fssqrtl", 4,	two(0xF000, 0x4041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtp", 4,	two(0xF000, 0x4C41), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fssqrts", 4,	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fssqrts", 4,	two(0xF000, 0x4441), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtw", 4,	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fssqrtw", 4,	two(0xF000, 0x5041), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssqrtx", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fssqrtx", 4,	two(0xF000, 0x4841), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fssqrtx", 4,	two(0xF000, 0x0041), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fdsqrtb", 4,	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdsqrtb", 4,	two(0xF000, 0x5845), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   cfloat },
+{"fdsqrtd", 4,	two(0xF000, 0x5445), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdsqrtd", 4,	two(0xF000, 0x5445), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdsqrtl", 4,	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdsqrtl", 4,	two(0xF000, 0x4045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtp", 4,	two(0xF000, 0x4C45), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdsqrts", 4,	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdsqrts", 4,	two(0xF000, 0x4445), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtw", 4,	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdsqrtw", 4,	two(0xF000, 0x5045), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsqrtx", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdsqrtx", 4,	two(0xF000, 0x4845), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdsqrtx", 4,	two(0xF000, 0x0045), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fsubb", 4,	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"fsubb", 4,	two(0xF000, 0x5828), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubd", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fsubd", 4,	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"fsubd", 4,	two(0xF000, 0x5428), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fsubl", 4,	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"fsubl", 4,	two(0xF000, 0x4028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubp", 4,	two(0xF000, 0x4C28), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"fsubs", 4,	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"fsubs", 4,	two(0xF000, 0x4428), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubw", 4,	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"fsubw", 4,	two(0xF000, 0x5028), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fsubx", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"fsubx", 4,	two(0xF000, 0x4828), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"fsubx", 4,	two(0xF000, 0x0028), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"fssubb", 4,	two(0xF000, 0x5868), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubb", 4,	two(0xF000, 0x5868), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fssubd", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fssubd", 4,	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fssubd", 4,	two(0xF000, 0x5468), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fssubl", 4,	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fssubl", 4,	two(0xF000, 0x4068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubp", 4,	two(0xF000, 0x4C68), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fssubs", 4,	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fssubs", 4,	two(0xF000, 0x4468), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubw", 4,	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fssubw", 4,	two(0xF000, 0x5068), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fssubx", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fssubx", 4,	two(0xF000, 0x4868), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fssubx", 4,	two(0xF000, 0x0068), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"fdsubb", 4,	two(0xF000, 0x586c), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubb", 4,	two(0xF000, 0x586c), two(0xF1C0, 0xFC7F), "Ii;bF7", m68040up },
+{"fdsubd", 4,	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiF8F7", cfloat },
+{"fdsubd", 4,	two(0xF000, 0x546c), two(0xF1C0, 0xFC7F), "IiwsF7", cfloat },
+{"fdsubd", 4,	two(0xF000, 0x546c), two(0xF1C0, 0xFC7F), "Ii;FF7", m68040up },
+{"fdsubl", 4,	two(0xF000, 0x406c), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubl", 4,	two(0xF000, 0x406c), two(0xF1C0, 0xFC7F), "Ii;lF7", m68040up },
+{"fdsubp", 4,	two(0xF000, 0x4C6c), two(0xF1C0, 0xFC7F), "Ii;pF7", m68040up },
+{"fdsubs", 4,	two(0xF000, 0x446c), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubs", 4,	two(0xF000, 0x446c), two(0xF1C0, 0xFC7F), "Ii;fF7", m68040up },
+{"fdsubw", 4,	two(0xF000, 0x506c), two(0xF1C0, 0xFC7F), "IibsF7", cfloat },
+{"fdsubw", 4,	two(0xF000, 0x506c), two(0xF1C0, 0xFC7F), "Ii;wF7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiF8F7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x486c), two(0xF1C0, 0xFC7F), "Ii;xF7", m68040up },
+{"fdsubx", 4,	two(0xF000, 0x006c), two(0xF1C0, 0xE07F), "IiFt",   m68040up },
+
+{"ftanb", 4,	two(0xF000, 0x580F), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftand", 4,	two(0xF000, 0x540F), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftanl", 4,	two(0xF000, 0x400F), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftanp", 4,	two(0xF000, 0x4C0F), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftans", 4,	two(0xF000, 0x440F), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftanw", 4,	two(0xF000, 0x500F), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x480F), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftanx", 4,	two(0xF000, 0x000F), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"ftanhb", 4,	two(0xF000, 0x5809), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftanhd", 4,	two(0xF000, 0x5409), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftanhl", 4,	two(0xF000, 0x4009), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftanhp", 4,	two(0xF000, 0x4C09), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftanhs", 4,	two(0xF000, 0x4409), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftanhw", 4,	two(0xF000, 0x5009), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x4809), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftanhx", 4,	two(0xF000, 0x0009), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"ftentoxb", 4,	two(0xF000, 0x5812), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftentoxd", 4,	two(0xF000, 0x5412), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftentoxl", 4,	two(0xF000, 0x4012), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftentoxp", 4,	two(0xF000, 0x4C12), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftentoxs", 4,	two(0xF000, 0x4412), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftentoxw", 4,	two(0xF000, 0x5012), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x4812), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftentoxx", 4,	two(0xF000, 0x0012), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"ftrapeq", 4,	two(0xF07C, 0x0001), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapf", 4,	two(0xF07C, 0x0000), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapge", 4,	two(0xF07C, 0x0013), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgl", 4,	two(0xF07C, 0x0016), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgle", 4,	two(0xF07C, 0x0017), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapgt", 4,	two(0xF07C, 0x0012), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftraple", 4,	two(0xF07C, 0x0015), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftraplt", 4,	two(0xF07C, 0x0014), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapne", 4,	two(0xF07C, 0x000E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnge", 4,	two(0xF07C, 0x001C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngl", 4,	two(0xF07C, 0x0019), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngle", 4,two(0xF07C, 0x0018), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapngt", 4,	two(0xF07C, 0x001D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnle", 4,	two(0xF07C, 0x001A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapnlt", 4,	two(0xF07C, 0x001B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapoge", 4,	two(0xF07C, 0x0003), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapogl", 4,	two(0xF07C, 0x0006), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapogt", 4,	two(0xF07C, 0x0002), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapole", 4,	two(0xF07C, 0x0005), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapolt", 4,	two(0xF07C, 0x0004), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapor", 4,	two(0xF07C, 0x0007), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapseq", 4,	two(0xF07C, 0x0011), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapsf", 4,	two(0xF07C, 0x0010), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapsne", 4,	two(0xF07C, 0x001E), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapst", 4,	two(0xF07C, 0x001F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapt", 4,	two(0xF07C, 0x000F), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapueq", 4,	two(0xF07C, 0x0009), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapuge", 4,	two(0xF07C, 0x000B), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapugt", 4,	two(0xF07C, 0x000A), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapule", 4,	two(0xF07C, 0x000D), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapult", 4,	two(0xF07C, 0x000C), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+{"ftrapun", 4,	two(0xF07C, 0x0008), two(0xF1FF, 0xFFFF), "Ii", mfloat },
+
+{"ftrapeqw", 4,	two(0xF07A, 0x0001), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapfw", 4,	two(0xF07A, 0x0000), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapgew", 4,	two(0xF07A, 0x0013), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapglw", 4,	two(0xF07A, 0x0016), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapglew", 4,two(0xF07A, 0x0017), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapgtw", 4,	two(0xF07A, 0x0012), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraplew", 4,	two(0xF07A, 0x0015), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapltw", 4,	two(0xF07A, 0x0014), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnew", 4,	two(0xF07A, 0x000E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapngew", 4,two(0xF07A, 0x001C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnglw", 4,two(0xF07A, 0x0019), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnglew", 4,two(0xF07A, 0x0018), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapngtw", 4,two(0xF07A, 0x001D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnlew", 4,two(0xF07A, 0x001A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapnltw", 4,two(0xF07A, 0x001B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapogew", 4,two(0xF07A, 0x0003), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapoglw", 4,two(0xF07A, 0x0006), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapogtw", 4,two(0xF07A, 0x0002), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapolew", 4,two(0xF07A, 0x0005), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapoltw", 4,two(0xF07A, 0x0004), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraporw", 4,	two(0xF07A, 0x0007), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapseqw", 4,two(0xF07A, 0x0011), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapsfw", 4,	two(0xF07A, 0x0010), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapsnew", 4,two(0xF07A, 0x001E), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapstw", 4,	two(0xF07A, 0x001F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftraptw", 4,	two(0xF07A, 0x000F), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapueqw", 4,two(0xF07A, 0x0009), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapugew", 4,two(0xF07A, 0x000B), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapugtw", 4,two(0xF07A, 0x000A), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapulew", 4,two(0xF07A, 0x000D), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapultw", 4,two(0xF07A, 0x000C), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+{"ftrapunw", 4,	two(0xF07A, 0x0008), two(0xF1FF, 0xFFFF), "Ii^w", mfloat },
+
+{"ftrapeql", 4,	two(0xF07B, 0x0001), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapfl", 4,	two(0xF07B, 0x0000), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgel", 4,	two(0xF07B, 0x0013), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgll", 4,	two(0xF07B, 0x0016), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapglel", 4,two(0xF07B, 0x0017), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapgtl", 4,	two(0xF07B, 0x0012), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraplel", 4,	two(0xF07B, 0x0015), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapltl", 4,	two(0xF07B, 0x0014), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnel", 4,	two(0xF07B, 0x000E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngel", 4,two(0xF07B, 0x001C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngll", 4,two(0xF07B, 0x0019), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnglel", 4,two(0xF07B, 0x0018), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapngtl", 4,two(0xF07B, 0x001D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnlel", 4,two(0xF07B, 0x001A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapnltl", 4,two(0xF07B, 0x001B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogel", 4,two(0xF07B, 0x0003), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogll", 4,two(0xF07B, 0x0006), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapogtl", 4,two(0xF07B, 0x0002), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapolel", 4,two(0xF07B, 0x0005), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapoltl", 4,two(0xF07B, 0x0004), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraporl", 4,	two(0xF07B, 0x0007), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapseql", 4,two(0xF07B, 0x0011), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapsfl", 4,	two(0xF07B, 0x0010), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapsnel", 4,two(0xF07B, 0x001E), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapstl", 4,	two(0xF07B, 0x001F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftraptl", 4,	two(0xF07B, 0x000F), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapueql", 4,two(0xF07B, 0x0009), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapugel", 4,two(0xF07B, 0x000B), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapugtl", 4,two(0xF07B, 0x000A), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapulel", 4,two(0xF07B, 0x000D), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapultl", 4,two(0xF07B, 0x000C), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+{"ftrapunl", 4,	two(0xF07B, 0x0008), two(0xF1FF, 0xFFFF), "Ii^l", mfloat },
+
+{"ftstb", 4,	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Ii;b", mfloat },
+{"ftstb", 4,	two(0xF000, 0x583A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstd", 4,	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", cfloat },
+{"ftstd", 4,	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Ii;F", mfloat },
+{"ftstd", 4,	two(0xF000, 0x543A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstl", 4,	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Ii;l", mfloat },
+{"ftstl", 4,	two(0xF000, 0x403A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstp", 4,	two(0xF000, 0x4C3A), two(0xF1C0, 0xFC7F), "Ii;p", mfloat },
+{"ftsts", 4,	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Ii;f", mfloat },
+{"ftsts", 4,	two(0xF000, 0x443A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstw", 4,	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Ii;w", mfloat },
+{"ftstw", 4,	two(0xF000, 0x503A), two(0xF1C0, 0xFC7F), "Iibs", cfloat },
+{"ftstx", 4,	two(0xF000, 0x003A), two(0xF1C0, 0xE07F), "IiF8", mfloat },
+{"ftstx", 4,	two(0xF000, 0x483A), two(0xF1C0, 0xFC7F), "Ii;x", mfloat },
+
+{"ftwotoxb", 4,	two(0xF000, 0x5811), two(0xF1C0, 0xFC7F), "Ii;bF7", mfloat },
+{"ftwotoxd", 4,	two(0xF000, 0x5411), two(0xF1C0, 0xFC7F), "Ii;FF7", mfloat },
+{"ftwotoxl", 4,	two(0xF000, 0x4011), two(0xF1C0, 0xFC7F), "Ii;lF7", mfloat },
+{"ftwotoxp", 4,	two(0xF000, 0x4C11), two(0xF1C0, 0xFC7F), "Ii;pF7", mfloat },
+{"ftwotoxs", 4,	two(0xF000, 0x4411), two(0xF1C0, 0xFC7F), "Ii;fF7", mfloat },
+{"ftwotoxw", 4,	two(0xF000, 0x5011), two(0xF1C0, 0xFC7F), "Ii;wF7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiF8F7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x4811), two(0xF1C0, 0xFC7F), "Ii;xF7", mfloat },
+{"ftwotoxx", 4,	two(0xF000, 0x0011), two(0xF1C0, 0xE07F), "IiFt",   mfloat },
+
+{"halt", 2,	one(0045310),	one(0177777), "",     m68060 | mcfisa_a },
+
+{"illegal", 2,	one(0045374),	one(0177777), "",     m68000up | mcfisa_a },
+{"intouch", 2,	one(0xf428),	one(0xfff8), "As",    mcfisa_b },
+
+{"jmp", 2,	one(0047300),	one(0177700), "!s", m68000up | mcfisa_a },
+
+{"jra", 2,	one(0060000),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jra", 2,	one(0047300),	one(0177700), "!s", m68000up | mcfisa_a },
+
+{"jsr", 2,	one(0047200),	one(0177700), "!s", m68000up | mcfisa_a },
+
+{"jbsr", 2,	one(0060400),	one(0177400), "Bg", m68000up | mcfisa_a },
+{"jbsr", 2,	one(0047200),	one(0177700), "!s", m68000up | mcfisa_a },
+
+{"lea", 2,	one(0040700),	one(0170700), "!sAd", m68000up | mcfisa_a },
+
+{"lpstop", 6,	two(0174000,0000700),two(0177777,0177777),"#w", cpu32|m68060 },
+
+{"link.w", 4,	one(0047120),	one(0177770), "As#w", m68000up | mcfisa_a },
+{"link.l", 6,	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
+{"link", 4,	one(0047120),	one(0177770), "As#W", m68000up | mcfisa_a },
+{"link", 6,	one(0044010),	one(0177770), "As#l", m68020up | cpu32 },
+
+{"lsl.b", 2,	one(0160410),	one(0170770), "QdDs", m68000up },
+{"lsl.b", 2,	one(0160450),	one(0170770), "DdDs", m68000up },
+{"lsl.w", 2,	one(0160510),	one(0170770), "QdDs", m68000up },
+{"lsl.w", 2,	one(0160550),	one(0170770), "DdDs", m68000up },
+{"lsl.w", 2,	one(0161700),	one(0177700), "~s",   m68000up },
+{"lsl.l", 2,	one(0160610),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"lsl.l", 2,	one(0160650),	one(0170770), "DdDs", m68000up | mcfisa_a },
+
+{"lsr.b", 2,	one(0160010),	one(0170770), "QdDs", m68000up },
+{"lsr.b", 2,	one(0160050),	one(0170770), "DdDs", m68000up },
+{"lsr.w", 2,	one(0160110),	one(0170770), "QdDs", m68000up },
+{"lsr.w", 2,	one(0160150),	one(0170770), "DdDs", m68000up },
+{"lsr.w", 2,	one(0161300),	one(0177700), "~s",   m68000up },
+{"lsr.l", 2,	one(0160210),	one(0170770), "QdDs", m68000up | mcfisa_a },
+{"lsr.l", 2,	one(0160250),	one(0170770), "DdDs", m68000up | mcfisa_a },
+
+{"mac.w", 4,  	two(0xa080, 0x0000), two(0xf180, 0x0910), "uNuoiI4/Rn", mcfmac },
+{"mac.w", 4,  	two(0xa080, 0x0200), two(0xf180, 0x0910), "uNuoMh4/Rn", mcfmac },
+{"mac.w", 4,  	two(0xa080, 0x0000), two(0xf180, 0x0f10), "uNuo4/Rn", mcfmac },
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf1b0, 0x0900), "uMumiI", mcfmac },
+{"mac.w", 4,  	two(0xa000, 0x0200), two(0xf1b0, 0x0900), "uMumMh", mcfmac },
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf1b0, 0x0f00), "uMum", mcfmac },
+
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf100, 0x0900), "uNuoiI4/RneG", mcfemac },/* Ry,Rx,SF,<ea>,accX.  */
+{"mac.w", 4,  	two(0xa000, 0x0200), two(0xf100, 0x0900), "uNuoMh4/RneG", mcfemac },/* Ry,Rx,+1/-1,<ea>,accX.  */
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf100, 0x0f00), "uNuo4/RneG", mcfemac },/* Ry,Rx,<ea>,accX.  */
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf130, 0x0900), "uMumiIeH", mcfemac },/* Ry,Rx,SF,accX.  */
+{"mac.w", 4,  	two(0xa000, 0x0200), two(0xf130, 0x0900), "uMumMheH", mcfemac },/* Ry,Rx,+1/-1,accX.  */
+{"mac.w", 4,  	two(0xa000, 0x0000), two(0xf130, 0x0f00), "uMumeH", mcfemac }, /* Ry,Rx,accX.  */
+
+{"mac.l", 4,  	two(0xa080, 0x0800), two(0xf180, 0x0910), "RNRoiI4/Rn", mcfmac },
+{"mac.l", 4,  	two(0xa080, 0x0a00), two(0xf180, 0x0910), "RNRoMh4/Rn", mcfmac },
+{"mac.l", 4,  	two(0xa080, 0x0800), two(0xf180, 0x0f10), "RNRo4/Rn", mcfmac },
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf1b0, 0x0b00), "RMRmiI", mcfmac },
+{"mac.l", 4,  	two(0xa000, 0x0a00), two(0xf1b0, 0x0b00), "RMRmMh", mcfmac },
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf1b0, 0x0800), "RMRm", mcfmac },
+
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf100, 0x0900), "R3R1iI4/RneG", mcfemac },
+{"mac.l", 4,  	two(0xa000, 0x0a00), two(0xf100, 0x0900), "R3R1Mh4/RneG", mcfemac },
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf100, 0x0f00), "R3R14/RneG", mcfemac },
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf130, 0x0900), "RMRmiIeH", mcfemac },
+{"mac.l", 4,  	two(0xa000, 0x0a00), two(0xf130, 0x0900), "RMRmMheH", mcfemac },
+{"mac.l", 4,  	two(0xa000, 0x0800), two(0xf130, 0x0f00), "RMRmeH", mcfemac },
+
+/* NOTE: The mcf5200 family programmer's reference manual does not
+   indicate the byte form of the movea instruction is invalid (as it
+   is on 68000 family cpus).  However, experiments on the 5202 yeild
+   unexpected results.  The value is copied, but it is not sign extended
+   (as is done with movea.w) and the top three bytes in the address
+   register are not disturbed.  I don't know if this is the intended
+   behavior --- it could be a hole in instruction decoding (Motorola
+   decided not to trap all invalid instructions for performance reasons)
+   --- but I suspect that it is not.
+
+   I reported this to Motorola ISD Technical Communications Support,
+   which replied that other coldfire assemblers reject movea.b.  For
+   this reason I've decided to not allow moveab.
+
+	jtc@cygnus.com - 97/01/24.  */
+
+{"movea.l", 2,	one(0020100),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"movea.w", 2,	one(0030100),	one(0170700), "*wAd", m68000up | mcfisa_a },
+
+{"movclr.l", 2,	one(0xA1C0),	one(0xf9f0), "eFRs", mcfemac },
+
+{"movec", 4,	one(0047173),	one(0177777), "R1Jj", m68010up | mcfisa_a },
+{"movec", 4,	one(0047173),	one(0177777), "R1#j", m68010up | mcfisa_a },
+{"movec", 4,	one(0047172),	one(0177777), "JjR1", m68010up },
+{"movec", 4,	one(0047172),	one(0177777), "#jR1", m68010up },
+
+{"movem.w", 4,	one(0044200),	one(0177700), "Lw&s", m68000up },
+{"movem.w", 4,	one(0044240),	one(0177770), "lw-s", m68000up },
+{"movem.w", 4,	one(0044200),	one(0177700), "#w>s", m68000up },
+{"movem.w", 4,	one(0046200),	one(0177700), "<sLw", m68000up },
+{"movem.w", 4,	one(0046200),	one(0177700), "<s#w", m68000up },
+{"movem.l", 4,	one(0044300),	one(0177700), "Lw&s", m68000up },
+{"movem.l", 4,	one(0044340),	one(0177770), "lw-s", m68000up },
+{"movem.l", 4,	one(0044300),	one(0177700), "#w>s", m68000up },
+{"movem.l", 4,	one(0046300),	one(0177700), "<sLw", m68000up },
+{"movem.l", 4,	one(0046300),	one(0177700), "<s#w", m68000up },
+/* FIXME: need specifier for mode 2 and 5 to simplify below insn patterns.  */
+{"movem.l", 4,	one(0044320),	one(0177770), "Lwas", mcfisa_a },
+{"movem.l", 4,	one(0044320),	one(0177770), "#was", mcfisa_a },
+{"movem.l", 4,	one(0044350),	one(0177770), "Lwds", mcfisa_a },
+{"movem.l", 4,	one(0044350),	one(0177770), "#wds", mcfisa_a },
+{"movem.l", 4,	one(0046320),	one(0177770), "asLw", mcfisa_a },
+{"movem.l", 4,	one(0046320),	one(0177770), "as#w", mcfisa_a },
+{"movem.l", 4,	one(0046350),	one(0177770), "dsLw", mcfisa_a },
+{"movem.l", 4,	one(0046350),	one(0177770), "ds#w", mcfisa_a },
+
+{"movep.w", 2,	one(0000410),	one(0170770), "dsDd", m68000up },
+{"movep.w", 2,	one(0000610),	one(0170770), "Ddds", m68000up },
+{"movep.l", 2,	one(0000510),	one(0170770), "dsDd", m68000up },
+{"movep.l", 2,	one(0000710),	one(0170770), "Ddds", m68000up },
+
+{"moveq", 2,	one(0070000),	one(0170400), "MsDd", m68000up | mcfisa_a },
+{"moveq", 2,	one(0070000),	one(0170400), "#BDd", m68000up | mcfisa_a },
+
+/* The move opcode can generate the movea and moveq instructions.  */
+{"move.b", 2,	one(0010000),	one(0170000), ";b$d", m68000up },
+{"move.b", 2,	one(0010000),	one(0170070), "Ds$d", mcfisa_a },
+{"move.b", 2,	one(0010020),	one(0170070), "as$d", mcfisa_a },
+{"move.b", 2,	one(0010030),	one(0170070), "+s$d", mcfisa_a },
+{"move.b", 2,	one(0010040),	one(0170070), "-s$d", mcfisa_a },
+{"move.b", 2,	one(0010000),	one(0170000), "nsqd", mcfisa_a },
+{"move.b", 2,	one(0010000),	one(0170700), "obDd", mcfisa_a },
+{"move.b", 2,	one(0010200),	one(0170700), "obad", mcfisa_a },
+{"move.b", 2,	one(0010300),	one(0170700), "ob+d", mcfisa_a },
+{"move.b", 2,	one(0010400),	one(0170700), "ob-d", mcfisa_a },
+{"move.b", 2,	one(0010000),	one(0170000), "obnd", mcfisa_b },
+
+{"move.w", 2,	one(0030000),	one(0170000), "*w%d", m68000up },
+{"move.w", 2,	one(0030000),	one(0170000), "ms%d", mcfisa_a },
+{"move.w", 2,	one(0030000),	one(0170000), "nspd", mcfisa_a },
+{"move.w", 2,	one(0030000),	one(0170000), "owmd", mcfisa_a },
+{"move.w", 2,	one(0030000),	one(0170000), "ownd", mcfisa_b },
+{"move.w", 2,	one(0040300),	one(0177700), "Ss$s", m68000up },
+{"move.w", 2,	one(0040300),	one(0177770), "SsDs", mcfisa_a },
+{"move.w", 2,	one(0041300),	one(0177700), "Cs$s", m68010up },
+{"move.w", 2,	one(0041300),	one(0177770), "CsDs", mcfisa_a },
+{"move.w", 2,	one(0042300),	one(0177700), ";wCd", m68000up },
+{"move.w", 2,	one(0042300),	one(0177700), "DsCd", mcfisa_a },
+{"move.w", 4,	one(0042374),	one(0177777), "#wCd", mcfisa_a },
+{"move.w", 2,	one(0043300),	one(0177700), ";wSd", m68000up },
+{"move.w", 2,	one(0043300),	one(0177700), "DsSd", mcfisa_a },
+{"move.w", 4,	one(0043374),	one(0177777), "#wSd", mcfisa_a },
+
+{"move.l", 2,	one(0070000),	one(0170400), "MsDd", m68000up | mcfisa_a },
+{"move.l", 2,	one(0020000),	one(0170000), "*l%d", m68000up },
+{"move.l", 2,	one(0020000),	one(0170000), "ms%d", mcfisa_a },
+{"move.l", 2,	one(0020000),	one(0170000), "nspd", mcfisa_a },
+{"move.l", 2,	one(0020000),	one(0170000), "olmd", mcfisa_a },
+{"move.l", 2,	one(0020000),	one(0170000), "olnd", mcfisa_b },
+{"move.l", 2,	one(0047140),	one(0177770), "AsUd", m68000up | mcfusp },
+{"move.l", 2,	one(0047150),	one(0177770), "UdAs", m68000up | mcfusp },
+{"move.l", 2,	one(0120600),	one(0177760), "EsRs", mcfmac },
+{"move.l", 2,	one(0120400),	one(0177760), "RsEs", mcfmac },
+{"move.l", 6,	one(0120474),	one(0177777), "#lEs", mcfmac },
+{"move.l", 2,	one(0124600),	one(0177760), "GsRs", mcfmac },
+{"move.l", 2,	one(0124400),	one(0177760), "RsGs", mcfmac },
+{"move.l", 6,	one(0124474),	one(0177777), "#lGs", mcfmac },
+{"move.l", 2,	one(0126600),	one(0177760), "HsRs", mcfmac },
+{"move.l", 2,	one(0126400),	one(0177760), "RsHs", mcfmac },
+{"move.l", 6,	one(0126474),	one(0177777), "#lHs", mcfmac },
+{"move.l", 2,	one(0124700),	one(0177777), "GsCs", mcfmac },
+
+{"move.l", 2,	one(0xa180),	one(0xf9f0), "eFRs", mcfemac }, /* ACCx,Rx.  */
+{"move.l", 2,	one(0xab80),	one(0xfbf0), "g]Rs", mcfemac }, /* ACCEXTx,Rx.  */
+{"move.l", 2,	one(0xa980),	one(0xfff0), "G-Rs", mcfemac }, /* macsr,Rx.  */
+{"move.l", 2,	one(0xad80),	one(0xfff0), "H-Rs", mcfemac }, /* mask,Rx.  */
+{"move.l", 2,	one(0xa110),	one(0xf9fc), "efeF", mcfemac }, /* ACCy,ACCx.  */
+{"move.l", 2,	one(0xa9c0),	one(0xffff), "G-C-", mcfemac }, /* macsr,ccr.  */
+{"move.l", 2,	one(0xa100),	one(0xf9f0), "RseF", mcfemac }, /* Rx,ACCx.  */
+{"move.l", 6,	one(0xa13c),	one(0xf9ff), "#leF", mcfemac }, /* #,ACCx.  */
+{"move.l", 2,	one(0xab00),	one(0xfbc0), "Rsg]", mcfemac }, /* Rx,ACCEXTx.  */
+{"move.l", 6,	one(0xab3c),	one(0xfbff), "#lg]", mcfemac }, /* #,ACCEXTx.  */
+{"move.l", 2,	one(0xa900),	one(0xffc0), "RsG-", mcfemac }, /* Rx,macsr.  */
+{"move.l", 6,	one(0xa93c),	one(0xffff), "#lG-", mcfemac }, /* #,macsr.  */
+{"move.l", 2,	one(0xad00),	one(0xffc0), "RsH-", mcfemac }, /* Rx,mask.  */
+{"move.l", 6,	one(0xad3c),	one(0xffff), "#lH-", mcfemac }, /* #,mask.  */
+
+{"move", 2,	one(0030000),	one(0170000), "*w%d", m68000up },
+{"move", 2,	one(0030000),	one(0170000), "ms%d", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "nspd", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "owmd", mcfisa_a },
+{"move", 2,	one(0030000),	one(0170000), "ownd", mcfisa_b },
+{"move", 2,	one(0040300),	one(0177700), "Ss$s", m68000up },
+{"move", 2,	one(0040300),	one(0177770), "SsDs", mcfisa_a },
+{"move", 2,	one(0041300),	one(0177700), "Cs$s", m68010up },
+{"move", 2,	one(0041300),	one(0177770), "CsDs", mcfisa_a },
+{"move", 2,	one(0042300),	one(0177700), ";wCd", m68000up },
+{"move", 2,	one(0042300),	one(0177700), "DsCd", mcfisa_a },
+{"move", 4,	one(0042374),	one(0177777), "#wCd", mcfisa_a },
+{"move", 2,	one(0043300),	one(0177700), ";wSd", m68000up },
+{"move", 2,	one(0043300),	one(0177700), "DsSd", mcfisa_a },
+{"move", 4,	one(0043374),	one(0177777), "#wSd", mcfisa_a },
+
+{"move", 2,	one(0047140),	one(0177770), "AsUd", m68000up },
+{"move", 2,	one(0047150),	one(0177770), "UdAs", m68000up },
+
+{"mov3q.l", 2,	one(0120500),	one(0170700), "xd%s", mcfisa_b },
+{"mvs.b", 2,	one(0070400),	one(0170700), "*bDd", mcfisa_b },
+{"mvs.w", 2,	one(0070500),	one(0170700), "*wDd", mcfisa_b },
+{"mvz.b", 2,	one(0070600),	one(0170700), "*bDd", mcfisa_b },
+{"mvz.w", 2,	one(0070700),	one(0170700), "*wDd", mcfisa_b },
+
+{"moves.b", 4,	two(0007000, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"moves.b", 4,	two(0007000, 04000), two(0177700, 07777), "R1~s", m68010up },
+{"moves.w", 4,	two(0007100, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"moves.w", 4,	two(0007100, 04000), two(0177700, 07777), "R1~s", m68010up },
+{"moves.l", 4,	two(0007200, 0),     two(0177700, 07777), "~sR1", m68010up },
+{"moves.l", 4,	two(0007200, 04000), two(0177700, 07777), "R1~s", m68010up },
+
+{"move16", 4,	two(0xf620, 0x8000), two(0xfff8, 0x8fff), "+s+1", m68040up },
+{"move16", 2,	one(0xf600),		one(0xfff8), "+s_L", m68040up },
+{"move16", 2,	one(0xf608),		one(0xfff8), "_L+s", m68040up },
+{"move16", 2,	one(0xf610),		one(0xfff8), "as_L", m68040up },
+{"move16", 2,	one(0xf618),		one(0xfff8), "_Las", m68040up },
+
+{"msac.w", 4,  	two(0xa080, 0x0100), two(0xf180, 0x0910), "uNuoiI4/Rn", mcfmac },
+{"msac.w", 4,  	two(0xa080, 0x0300), two(0xf180, 0x0910), "uNuoMh4/Rn", mcfmac },
+{"msac.w", 4,  	two(0xa080, 0x0100), two(0xf180, 0x0f10), "uNuo4/Rn", mcfmac },
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf1b0, 0x0900), "uMumiI", mcfmac },
+{"msac.w", 4,  	two(0xa000, 0x0300), two(0xf1b0, 0x0900), "uMumMh", mcfmac },
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf1b0, 0x0f00), "uMum", mcfmac },
+
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf100, 0x0900), "uMumiI4/RneG", mcfemac },/* Ry,Rx,SF,<ea>,accX.  */
+{"msac.w", 4,  	two(0xa000, 0x0300), two(0xf100, 0x0900), "uMumMh4/RneG", mcfemac },/* Ry,Rx,+1/-1,<ea>,accX.  */
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf100, 0x0f00), "uMum4/RneG", mcfemac },/* Ry,Rx,<ea>,accX.  */
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf130, 0x0900), "uMumiIeH", mcfemac },/* Ry,Rx,SF,accX.  */
+{"msac.w", 4,  	two(0xa000, 0x0300), two(0xf130, 0x0900), "uMumMheH", mcfemac },/* Ry,Rx,+1/-1,accX.  */
+{"msac.w", 4,  	two(0xa000, 0x0100), two(0xf130, 0x0f00), "uMumeH", mcfemac }, /* Ry,Rx,accX.  */
+
+{"msac.l", 4,  	two(0xa080, 0x0900), two(0xf180, 0x0910), "RNRoiI4/Rn", mcfmac },
+{"msac.l", 4,  	two(0xa080, 0x0b00), two(0xf180, 0x0910), "RNRoMh4/Rn", mcfmac },
+{"msac.l", 4,  	two(0xa080, 0x0900), two(0xf180, 0x0f10), "RNRo4/Rn", mcfmac },
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf1b0, 0x0b00), "RMRmiI", mcfmac },
+{"msac.l", 4,  	two(0xa000, 0x0b00), two(0xf1b0, 0x0b00), "RMRmMh", mcfmac },
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf1b0, 0x0800), "RMRm", mcfmac },
+
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf100, 0x0900), "R3R1iI4/RneG", mcfemac },
+{"msac.l", 4,  	two(0xa000, 0x0b00), two(0xf100, 0x0900), "R3R1Mh4/RneG", mcfemac },
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf100, 0x0f00), "R3R14/RneG", mcfemac },
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf130, 0x0900), "RMRmiIeH", mcfemac },
+{"msac.l", 4,  	two(0xa000, 0x0b00), two(0xf130, 0x0900), "RMRmMheH", mcfemac },
+{"msac.l", 4,  	two(0xa000, 0x0900), two(0xf130, 0x0f00), "RMRmeH", mcfemac },
+
+{"muls.w", 2,	one(0140700),		one(0170700), ";wDd", m68000up|mcfisa_a },
+{"muls.l", 4,	two(0046000,004000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
+{"muls.l", 4,	two(0046000,004000), two(0177700,0107770), "qsD1", mcfisa_a },
+{"muls.l", 4,	two(0046000,006000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
+
+{"mulu.w", 2,	one(0140300),		one(0170700), ";wDd", m68000up|mcfisa_a },
+{"mulu.l", 4,	two(0046000,000000), two(0177700,0107770), ";lD1", m68020up|cpu32 },
+{"mulu.l", 4,	two(0046000,000000), two(0177700,0107770), "qsD1", mcfisa_a },
+{"mulu.l", 4,	two(0046000,002000), two(0177700,0107770), ";lD3D1",m68020up|cpu32 },
+
+{"nbcd", 2,	one(0044000),	one(0177700), "$s", m68000up },
+
+{"neg.b", 2,	one(0042000),	one(0177700), "$s", m68000up },
+{"neg.w", 2,	one(0042100),	one(0177700), "$s", m68000up },
+{"neg.l", 2,	one(0042200),	one(0177700), "$s", m68000up },
+{"neg.l", 2,	one(0042200),	one(0177700), "Ds", mcfisa_a},
+
+{"negx.b", 2,	one(0040000),	one(0177700), "$s", m68000up },
+{"negx.w", 2,	one(0040100),	one(0177700), "$s", m68000up },
+{"negx.l", 2,	one(0040200),	one(0177700), "$s", m68000up },
+{"negx.l", 2,	one(0040200),	one(0177700), "Ds", mcfisa_a},
+
+{"nop", 2,	one(0047161),	one(0177777), "", m68000up | mcfisa_a},
+
+{"not.b", 2,	one(0043000),	one(0177700), "$s", m68000up },
+{"not.w", 2,	one(0043100),	one(0177700), "$s", m68000up },
+{"not.l", 2,	one(0043200),	one(0177700), "$s", m68000up },
+{"not.l", 2,	one(0043200),	one(0177700), "Ds", mcfisa_a},
+
+{"ori.b", 4,	one(0000000),	one(0177700), "#b$s", m68000up },
+{"ori.b", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"ori.w", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"ori.w", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"ori.l", 6,	one(0000200),	one(0177700), "#l$s", m68000up },
+{"ori.l", 6,	one(0000200),	one(0177700), "#lDs", mcfisa_a },
+{"ori", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"ori", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"ori", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+
+/* The or opcode can generate the ori instruction.  */
+{"or.b", 4,	one(0000000),	one(0177700), "#b$s", m68000up },
+{"or.b", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"or.b", 2,	one(0100000),	one(0170700), ";bDd", m68000up },
+{"or.b", 2,	one(0100400),	one(0170700), "Dd~s", m68000up },
+{"or.w", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"or.w", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"or.w", 2,	one(0100100),	one(0170700), ";wDd", m68000up },
+{"or.w", 2,	one(0100500),	one(0170700), "Dd~s", m68000up },
+{"or.l", 6,	one(0000200),	one(0177700), "#l$s", m68000up },
+{"or.l", 6,	one(0000200),	one(0177700), "#lDs", mcfisa_a },
+{"or.l", 2,	one(0100200),	one(0170700), ";lDd", m68000up | mcfisa_a },
+{"or.l", 2,	one(0100600),	one(0170700), "Dd~s", m68000up | mcfisa_a },
+{"or", 4,	one(0000074),	one(0177777), "#bCs", m68000up },
+{"or", 4,	one(0000100),	one(0177700), "#w$s", m68000up },
+{"or", 4,	one(0000174),	one(0177777), "#wSs", m68000up },
+{"or", 2,	one(0100100),	one(0170700), ";wDd", m68000up },
+{"or", 2,	one(0100500),	one(0170700), "Dd~s", m68000up },
+
+{"pack", 4,	one(0100500),	one(0170770), "DsDd#w", m68020up },
+{"pack", 4,	one(0100510),	one(0170770), "-s-d#w", m68020up },
+
+{"pbac", 2,	one(0xf087),	one(0xffbf), "Bc", m68851 },
+{"pbac.w", 2,	one(0xf087),	one(0xffff), "BW", m68851 },
+{"pbas", 2,	one(0xf086),	one(0xffbf), "Bc", m68851 },
+{"pbas.w", 2,	one(0xf086),	one(0xffff), "BW", m68851 },
+{"pbbc", 2,	one(0xf081),	one(0xffbf), "Bc", m68851 },
+{"pbbc.w", 2,	one(0xf081),	one(0xffff), "BW", m68851 },
+{"pbbs", 2,	one(0xf080),	one(0xffbf), "Bc", m68851 },
+{"pbbs.w", 2,	one(0xf080),	one(0xffff), "BW", m68851 },
+{"pbcc", 2,	one(0xf08f),	one(0xffbf), "Bc", m68851 },
+{"pbcc.w", 2,	one(0xf08f),	one(0xffff), "BW", m68851 },
+{"pbcs", 2,	one(0xf08e),	one(0xffbf), "Bc", m68851 },
+{"pbcs.w", 2,	one(0xf08e),	one(0xffff), "BW", m68851 },
+{"pbgc", 2,	one(0xf08d),	one(0xffbf), "Bc", m68851 },
+{"pbgc.w", 2,	one(0xf08d),	one(0xffff), "BW", m68851 },
+{"pbgs", 2,	one(0xf08c),	one(0xffbf), "Bc", m68851 },
+{"pbgs.w", 2,	one(0xf08c),	one(0xffff), "BW", m68851 },
+{"pbic", 2,	one(0xf08b),	one(0xffbf), "Bc", m68851 },
+{"pbic.w", 2,	one(0xf08b),	one(0xffff), "BW", m68851 },
+{"pbis", 2,	one(0xf08a),	one(0xffbf), "Bc", m68851 },
+{"pbis.w", 2,	one(0xf08a),	one(0xffff), "BW", m68851 },
+{"pblc", 2,	one(0xf083),	one(0xffbf), "Bc", m68851 },
+{"pblc.w", 2,	one(0xf083),	one(0xffff), "BW", m68851 },
+{"pbls", 2,	one(0xf082),	one(0xffbf), "Bc", m68851 },
+{"pbls.w", 2,	one(0xf082),	one(0xffff), "BW", m68851 },
+{"pbsc", 2,	one(0xf085),	one(0xffbf), "Bc", m68851 },
+{"pbsc.w", 2,	one(0xf085),	one(0xffff), "BW", m68851 },
+{"pbss", 2,	one(0xf084),	one(0xffbf), "Bc", m68851 },
+{"pbss.w", 2,	one(0xf084),	one(0xffff), "BW", m68851 },
+{"pbwc", 2,	one(0xf089),	one(0xffbf), "Bc", m68851 },
+{"pbwc.w", 2,	one(0xf089),	one(0xffff), "BW", m68851 },
+{"pbws", 2,	one(0xf088),	one(0xffbf), "Bc", m68851 },
+{"pbws.w", 2,	one(0xf088),	one(0xffff), "BW", m68851 },
+
+{"pdbac", 4,	two(0xf048, 0x0007),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbas", 4,	two(0xf048, 0x0006),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbbc", 4,	two(0xf048, 0x0001),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbbs", 4,	two(0xf048, 0x0000),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbcc", 4,	two(0xf048, 0x000f),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbcs", 4,	two(0xf048, 0x000e),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbgc", 4,	two(0xf048, 0x000d),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbgs", 4,	two(0xf048, 0x000c),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbic", 4,	two(0xf048, 0x000b),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbis", 4,	two(0xf048, 0x000a),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdblc", 4,	two(0xf048, 0x0003),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbls", 4,	two(0xf048, 0x0002),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbsc", 4,	two(0xf048, 0x0005),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbss", 4,	two(0xf048, 0x0004),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbwc", 4,	two(0xf048, 0x0009),	two(0xfff8, 0xffff), "DsBw", m68851 },
+{"pdbws", 4,	two(0xf048, 0x0008),	two(0xfff8, 0xffff), "DsBw", m68851 },
+
+{"pea", 2,	one(0044100),		one(0177700), "!s", m68000up|mcfisa_a },
+
+{"pflusha", 2,	one(0xf518),		one(0xfff8), "", m68040up },
+{"pflusha", 4,	two(0xf000,0x2400), two(0xffff,0xffff), "", m68030 | m68851 },
+
+{"pflush", 4,   two(0xf000,0x3010), two(0xffc0,0xfe10), "T3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3810), two(0xffc0,0xfe10), "T3T9&s", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3008), two(0xffc0,0xfe18), "D3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3808), two(0xffc0,0xfe18), "D3T9&s", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3000), two(0xffc0,0xfe1e), "f3T9", m68030|m68851 },
+{"pflush", 4,   two(0xf000,0x3800), two(0xffc0,0xfe1e), "f3T9&s", m68030|m68851 },
+{"pflush", 2,	one(0xf508),		one(0xfff8), "as", m68040up },
+{"pflush", 2,	one(0xf508),		one(0xfff8), "As", m68040up },
+
+{"pflushan", 2,	one(0xf510),		one(0xfff8), "", m68040up },
+{"pflushn", 2,	one(0xf500),		one(0xfff8), "as", m68040up },
+{"pflushn", 2,	one(0xf500),		one(0xfff8), "As", m68040up },
+
+{"pflushr", 4,	two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s", m68851 },
+
+{"pflushs", 4,	two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c10), two(0xfff8, 0xfe10), "T3T9&s", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9", m68851 },
+{"pflushs", 4,	two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s", m68851 },
+
+{"ploadr", 4,   two(0xf000,0x2210), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
+{"ploadr", 4,   two(0xf000,0x2208), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
+{"ploadr", 4,   two(0xf000,0x2200), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2010), two(0xffc0,0xfff0), "T3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2008), two(0xffc0,0xfff8), "D3&s", m68030|m68851 },
+{"ploadw", 4,   two(0xf000,0x2000), two(0xffc0,0xfffe), "f3&s", m68030|m68851 },
+
+{"plpar", 2,	one(0xf5c8),		one(0xfff8), "as", m68060 },
+{"plpaw", 2,	one(0xf588),		one(0xfff8), "as", m68060 },
+
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xffff), "*l08", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x5c00), two(0xffc0,0xffff), "*w18", m68851 },
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xe3ff), "*b28", m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xffff), "08%s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x5e00), two(0xffc0,0xffff), "18%s", m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xe3ff), "28%s", m68851 },
+{"pmove", 4,    two(0xf000,0x4000), two(0xffc0,0xe3ff), "|sW8", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x4200), two(0xffc0,0xe3ff), "W8~s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6200), two(0xffc0,0xe3e3), "*wX3", m68851 },
+{"pmove", 4,    two(0xf000,0x6000), two(0xffc0,0xe3e3), "X3%s", m68851 },
+{"pmove", 4,    two(0xf000,0x6000), two(0xffc0,0xffff), "*wY8", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6200), two(0xffc0,0xffff), "Y8%s", m68030|m68851 },
+{"pmove", 4,    two(0xf000,0x6600), two(0xffc0,0xffff), "Z8%s", m68851 },
+{"pmove", 4,    two(0xf000,0x0800), two(0xffc0,0xfbff), "*l38", m68030 },
+{"pmove", 4,    two(0xf000,0x0a00), two(0xffc0,0xfbff), "38%s", m68030 },
+
+{"pmovefd", 4,	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "*l08", m68030 },
+{"pmovefd", 4,	two(0xf000, 0x4100),	two(0xffc0, 0xe3ff), "|sW8", m68030 },
+{"pmovefd", 4,	two(0xf000, 0x0900),	two(0xffc0, 0xfbff), "*l38", m68030 },
+
+{"prestore", 2,	one(0xf140),		one(0xffc0), "<s", m68851 },
+
+{"psave", 2,	one(0xf100),		one(0xffc0), ">s", m68851 },
+
+{"psac", 4,	two(0xf040, 0x0007),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psas", 4,	two(0xf040, 0x0006),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psbc", 4,	two(0xf040, 0x0001),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psbs", 4,	two(0xf040, 0x0000),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pscc", 4,	two(0xf040, 0x000f),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pscs", 4,	two(0xf040, 0x000e),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psgc", 4,	two(0xf040, 0x000d),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psgs", 4,	two(0xf040, 0x000c),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psic", 4,	two(0xf040, 0x000b),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psis", 4,	two(0xf040, 0x000a),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pslc", 4,	two(0xf040, 0x0003),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psls", 4,	two(0xf040, 0x0002),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pssc", 4,	two(0xf040, 0x0005),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psss", 4,	two(0xf040, 0x0004),	two(0xffc0, 0xffff), "$s", m68851 },
+{"pswc", 4,	two(0xf040, 0x0009),	two(0xffc0, 0xffff), "$s", m68851 },
+{"psws", 4,	two(0xf040, 0x0008),	two(0xffc0, 0xffff), "$s", m68851 },
+
+{"ptestr", 4, 	two(0xf000,0x8210), two(0xffc0, 0xe3f0), "T3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8310), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8208), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8308), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8200), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
+{"ptestr", 4, 	two(0xf000,0x8300), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
+{"ptestr", 2,	one(0xf568),		one(0xfff8), "as", m68040 },
+
+{"ptestw", 4, 	two(0xf000,0x8010), two(0xffc0,0xe3f0), "T3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8110), two(0xffc0,0xe310), "T3&st8A9", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8008), two(0xffc0,0xe3f8), "D3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8108), two(0xffc0,0xe318), "D3&st8A9", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8000), two(0xffc0,0xe3fe), "f3&st8", m68030|m68851 },
+{"ptestw", 4, 	two(0xf000,0x8100), two(0xffc0,0xe31e), "f3&st8A9", m68030|m68851 },
+{"ptestw", 2,	one(0xf548),		one(0xfff8), "as", m68040 },
+
+{"ptrapacw", 6,	two(0xf07a, 0x0007),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapacl", 6,	two(0xf07b, 0x0007),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapac", 4,	two(0xf07c, 0x0007),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapasw", 6,	two(0xf07a, 0x0006),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapasl", 6,	two(0xf07b, 0x0006),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapas", 4,	two(0xf07c, 0x0006),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapbcw", 6,	two(0xf07a, 0x0001),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapbcl", 6,	two(0xf07b, 0x0001),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapbc", 4,	two(0xf07c, 0x0001),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapbsw", 6,	two(0xf07a, 0x0000),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapbsl", 6,	two(0xf07b, 0x0000),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapbs", 4,	two(0xf07c, 0x0000),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapccw", 6,	two(0xf07a, 0x000f),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapccl", 6,	two(0xf07b, 0x000f),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapcc", 4,	two(0xf07c, 0x000f),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapcsw", 6,	two(0xf07a, 0x000e),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapcsl", 6,	two(0xf07b, 0x000e),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapcs", 4,	two(0xf07c, 0x000e),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapgcw", 6,	two(0xf07a, 0x000d),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapgcl", 6,	two(0xf07b, 0x000d),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapgc", 4,	two(0xf07c, 0x000d),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapgsw", 6,	two(0xf07a, 0x000c),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapgsl", 6,	two(0xf07b, 0x000c),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapgs", 4,	two(0xf07c, 0x000c),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapicw", 6,	two(0xf07a, 0x000b),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapicl", 6,	two(0xf07b, 0x000b),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapic", 4,	two(0xf07c, 0x000b),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapisw", 6,	two(0xf07a, 0x000a),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapisl", 6,	two(0xf07b, 0x000a),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapis", 4,	two(0xf07c, 0x000a),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptraplcw", 6,	two(0xf07a, 0x0003),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptraplcl", 6,	two(0xf07b, 0x0003),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptraplc", 4,	two(0xf07c, 0x0003),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptraplsw", 6,	two(0xf07a, 0x0002),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptraplsl", 6,	two(0xf07b, 0x0002),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapls", 4,	two(0xf07c, 0x0002),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapscw", 6,	two(0xf07a, 0x0005),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapscl", 6,	two(0xf07b, 0x0005),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapsc", 4,	two(0xf07c, 0x0005),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapssw", 6,	two(0xf07a, 0x0004),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapssl", 6,	two(0xf07b, 0x0004),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapss", 4,	two(0xf07c, 0x0004),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapwcw", 6,	two(0xf07a, 0x0009),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapwcl", 6,	two(0xf07b, 0x0009),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapwc", 4,	two(0xf07c, 0x0009),	two(0xffff, 0xffff), "",   m68851 },
+
+{"ptrapwsw", 6,	two(0xf07a, 0x0008),	two(0xffff, 0xffff), "#w", m68851 },
+{"ptrapwsl", 6,	two(0xf07b, 0x0008),	two(0xffff, 0xffff), "#l", m68851 },
+{"ptrapws", 4,	two(0xf07c, 0x0008),	two(0xffff, 0xffff), "",   m68851 },
+
+{"pulse", 2,	one(0045314),		one(0177777), "", m68060 | mcfisa_a },
+
+{"pvalid", 4,	two(0xf000, 0x2800),	two(0xffc0, 0xffff), "Vs&s", m68851 },
+{"pvalid", 4,	two(0xf000, 0x2c00),	two(0xffc0, 0xfff8), "A3&s", m68851 },
+
+  /* FIXME: don't allow Dw==Dx. */
+{"rems.l", 4,    two(0x4c40, 0x0800),    two(0xffc0, 0x8ff8), "qsD3D1", mcfhwdiv },
+{"remu.l", 4,    two(0x4c40, 0x0000),    two(0xffc0, 0x8ff8), "qsD3D1", mcfhwdiv },
+
+{"reset", 2,	one(0047160),		one(0177777), "", m68000up },
+
+{"rol.b", 2,	one(0160430),		one(0170770), "QdDs", m68000up },
+{"rol.b", 2,	one(0160470),		one(0170770), "DdDs", m68000up },
+{"rol.w", 2,	one(0160530),		one(0170770), "QdDs", m68000up },
+{"rol.w", 2,	one(0160570),		one(0170770), "DdDs", m68000up },
+{"rol.w", 2,	one(0163700),		one(0177700), "~s",   m68000up },
+{"rol.l", 2,	one(0160630),		one(0170770), "QdDs", m68000up },
+{"rol.l", 2,	one(0160670),		one(0170770), "DdDs", m68000up },
+
+{"ror.b", 2,	one(0160030),		one(0170770), "QdDs", m68000up },
+{"ror.b", 2,	one(0160070),		one(0170770), "DdDs", m68000up },
+{"ror.w", 2,	one(0160130),		one(0170770), "QdDs", m68000up },
+{"ror.w", 2,	one(0160170),		one(0170770), "DdDs", m68000up },
+{"ror.w", 2,	one(0163300),		one(0177700), "~s",   m68000up },
+{"ror.l", 2,	one(0160230),		one(0170770), "QdDs", m68000up },
+{"ror.l", 2,	one(0160270),		one(0170770), "DdDs", m68000up },
+
+{"roxl.b", 2,	one(0160420),		one(0170770), "QdDs", m68000up },
+{"roxl.b", 2,	one(0160460),		one(0170770), "DdDs", m68000up },
+{"roxl.w", 2,	one(0160520),		one(0170770), "QdDs", m68000up },
+{"roxl.w", 2,	one(0160560),		one(0170770), "DdDs", m68000up },
+{"roxl.w", 2,	one(0162700),		one(0177700), "~s",   m68000up },
+{"roxl.l", 2,	one(0160620),		one(0170770), "QdDs", m68000up },
+{"roxl.l", 2,	one(0160660),		one(0170770), "DdDs", m68000up },
+
+{"roxr.b", 2,	one(0160020),		one(0170770), "QdDs", m68000up },
+{"roxr.b", 2,	one(0160060),		one(0170770), "DdDs", m68000up },
+{"roxr.w", 2,	one(0160120),		one(0170770), "QdDs", m68000up },
+{"roxr.w", 2,	one(0160160),		one(0170770), "DdDs", m68000up },
+{"roxr.w", 2,	one(0162300),		one(0177700), "~s",   m68000up },
+{"roxr.l", 2,	one(0160220),		one(0170770), "QdDs", m68000up },
+{"roxr.l", 2,	one(0160260),		one(0170770), "DdDs", m68000up },
+
+{"rtd", 4,	one(0047164),		one(0177777), "#w", m68010up },
+		
+{"rte", 2,	one(0047163),		one(0177777), "",   m68000up | mcfisa_a },
+		
+{"rtm", 2,	one(0003300),		one(0177760), "Rs", m68020 },
+		
+{"rtr", 2,	one(0047167),		one(0177777), "",   m68000up },
+		
+{"rts", 2,	one(0047165),		one(0177777), "",   m68000up | mcfisa_a },
+
+{"sats.l", 2,	one(0046200),		one(0177770), "Ds", mcfisa_b },
+
+{"sbcd", 2,	one(0100400),		one(0170770), "DsDd", m68000up },
+{"sbcd", 2,	one(0100410),		one(0170770), "-s-d", m68000up },
+
+{"scc", 2,	one(0052300),	one(0177700), "$s", m68000up },
+{"scc", 2,	one(0052300),	one(0177700), "Ds", mcfisa_a },
+{"scs", 2,	one(0052700),	one(0177700), "$s", m68000up },
+{"scs", 2,	one(0052700),	one(0177700), "Ds", mcfisa_a },
+{"seq", 2,	one(0053700),	one(0177700), "$s", m68000up },
+{"seq", 2,	one(0053700),	one(0177700), "Ds", mcfisa_a },
+{"sf", 2,	one(0050700),	one(0177700), "$s", m68000up },
+{"sf", 2,	one(0050700),	one(0177700), "Ds", mcfisa_a },
+{"sge", 2,	one(0056300),	one(0177700), "$s", m68000up },
+{"sge", 2,	one(0056300),	one(0177700), "Ds", mcfisa_a },
+{"sgt", 2,	one(0057300),	one(0177700), "$s", m68000up },
+{"sgt", 2,	one(0057300),	one(0177700), "Ds", mcfisa_a },
+{"shi", 2,	one(0051300),	one(0177700), "$s", m68000up },
+{"shi", 2,	one(0051300),	one(0177700), "Ds", mcfisa_a },
+{"sle", 2,	one(0057700),	one(0177700), "$s", m68000up },
+{"sle", 2,	one(0057700),	one(0177700), "Ds", mcfisa_a },
+{"sls", 2,	one(0051700),	one(0177700), "$s", m68000up },
+{"sls", 2,	one(0051700),	one(0177700), "Ds", mcfisa_a },
+{"slt", 2,	one(0056700),	one(0177700), "$s", m68000up },
+{"slt", 2,	one(0056700),	one(0177700), "Ds", mcfisa_a },
+{"smi", 2,	one(0055700),	one(0177700), "$s", m68000up },
+{"smi", 2,	one(0055700),	one(0177700), "Ds", mcfisa_a },
+{"sne", 2,	one(0053300),	one(0177700), "$s", m68000up },
+{"sne", 2,	one(0053300),	one(0177700), "Ds", mcfisa_a },
+{"spl", 2,	one(0055300),	one(0177700), "$s", m68000up },
+{"spl", 2,	one(0055300),	one(0177700), "Ds", mcfisa_a },
+{"st", 2,	one(0050300),	one(0177700), "$s", m68000up },
+{"st", 2,	one(0050300),	one(0177700), "Ds", mcfisa_a },
+{"svc", 2,	one(0054300),	one(0177700), "$s", m68000up },
+{"svc", 2,	one(0054300),	one(0177700), "Ds", mcfisa_a },
+{"svs", 2,	one(0054700),	one(0177700), "$s", m68000up },
+{"svs", 2,	one(0054700),	one(0177700), "Ds", mcfisa_a },
+
+{"stop", 4,	one(0047162),	one(0177777), "#w", m68000up | mcfisa_a },
+
+{"strldsr", 4, two(0040347,0043374), two(0177777,0177777), "#w", mcfisa_aa},
+
+{"suba.l", 2,	one(0110700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"suba.w", 2,	one(0110300),	one(0170700), "*wAd", m68000up },
+
+{"subi.b", 4,	one(0002000),	one(0177700), "#b$s", m68000up },
+{"subi.w", 4,	one(0002100),	one(0177700), "#w$s", m68000up },
+{"subi.l", 6,	one(0002200),	one(0177700), "#l$s", m68000up },
+{"subi.l", 6,	one(0002200),	one(0177700), "#lDs", mcfisa_a },
+
+{"subq.b", 2,	one(0050400),	one(0170700), "Qd%s", m68000up },
+{"subq.w", 2,	one(0050500),	one(0170700), "Qd%s", m68000up },
+{"subq.l", 2,	one(0050600),	one(0170700), "Qd%s", m68000up | mcfisa_a },
+
+/* The sub opcode can generate the suba, subi, and subq instructions.  */
+{"sub.b", 2,	one(0050400),	one(0170700), "Qd%s", m68000up },
+{"sub.b", 4,	one(0002000),	one(0177700), "#b$s", m68000up },
+{"sub.b", 2,	one(0110000),	one(0170700), ";bDd", m68000up },
+{"sub.b", 2,	one(0110400),	one(0170700), "Dd~s", m68000up },
+{"sub.w", 2,	one(0050500),	one(0170700), "Qd%s", m68000up },
+{"sub.w", 4,	one(0002100),	one(0177700), "#w$s", m68000up },
+{"sub.w", 2,	one(0110300),	one(0170700), "*wAd", m68000up },
+{"sub.w", 2,	one(0110100),	one(0170700), "*wDd", m68000up },
+{"sub.w", 2,	one(0110500),	one(0170700), "Dd~s", m68000up },
+{"sub.l", 2,	one(0050600),	one(0170700), "Qd%s", m68000up | mcfisa_a },
+{"sub.l", 6,	one(0002200),	one(0177700), "#l$s", m68000up },
+{"sub.l", 6,	one(0002200),	one(0177700), "#lDs", mcfisa_a },
+{"sub.l", 2,	one(0110700),	one(0170700), "*lAd", m68000up | mcfisa_a },
+{"sub.l", 2,	one(0110200),	one(0170700), "*lDd", m68000up | mcfisa_a },
+{"sub.l", 2,	one(0110600),	one(0170700), "Dd~s", m68000up | mcfisa_a },
+
+{"subx.b", 2,	one(0110400),	one(0170770), "DsDd", m68000up },
+{"subx.b", 2,	one(0110410),	one(0170770), "-s-d", m68000up },
+{"subx.w", 2,	one(0110500),	one(0170770), "DsDd", m68000up },
+{"subx.w", 2,	one(0110510),	one(0170770), "-s-d", m68000up },
+{"subx.l", 2,	one(0110600),	one(0170770), "DsDd", m68000up | mcfisa_a },
+{"subx.l", 2,	one(0110610),	one(0170770), "-s-d", m68000up },
+
+{"swap", 2,	one(0044100),	one(0177770), "Ds", m68000up | mcfisa_a },
+
+/* swbeg and swbegl are magic constants used on sysV68.  The compiler
+   generates them before a switch table.  They tell the debugger and
+   disassembler that a switch table follows.  The parameter is the
+   number of elements in the table.  swbeg means that the entries in
+   the table are word (2 byte) sized, and swbegl means that the
+   entries in the table are longword (4 byte) sized.  */
+{"swbeg", 4,	one(0045374),	one(0177777), "#w",   m68000up | mcfisa_a },
+{"swbeg.l", 6,	one(0045375),	one(0177777), "#l",   m68000up | mcfisa_a },
+
+{"tas", 2,	one(0045300),	one(0177700), "$s", m68000up | mcfisa_b},
+
+#define TBL1(name,insn_size,signed,round,size)					\
+  {name, insn_size, two(0174000, (signed<<11)|(!round<<10)|(size<<6)|0000400),	\
+     two(0177700,0107777), "!sD1", cpu32 },				\
+  {name, insn_size, two(0174000, (signed<<11)|(!round<<10)|(size<<6)),		\
+     two(0177770,0107770), "DsD3D1", cpu32 }
+#define TBL(name1, name2, name3, s, r) \
+  TBL1(name1, 4, s, r, 0), TBL1(name2, 4, s, r, 1), TBL1(name3, 4, s, r, 2)
+TBL("tblsb", "tblsw", "tblsl", 2, 1),
+TBL("tblsnb", "tblsnw", "tblsnl", 2, 0),
+TBL("tblub", "tbluw", "tblul", 0, 1),
+TBL("tblunb", "tblunw", "tblunl", 0, 0),
+
+{"trap", 2,	one(0047100),	one(0177760), "Ts", m68000up | mcfisa_a },
+
+{"trapcc", 2,	one(0052374),	one(0177777), "", m68020up | cpu32 },
+{"trapcs", 2,	one(0052774),	one(0177777), "", m68020up | cpu32 },
+{"trapeq", 2,	one(0053774),	one(0177777), "", m68020up | cpu32 },
+{"trapf", 2,	one(0050774),	one(0177777), "", m68020up | cpu32 | mcfisa_a },
+{"trapge", 2,	one(0056374),	one(0177777), "", m68020up | cpu32 },
+{"trapgt", 2,	one(0057374),	one(0177777), "", m68020up | cpu32 },
+{"traphi", 2,	one(0051374),	one(0177777), "", m68020up | cpu32 },
+{"traple", 2,	one(0057774),	one(0177777), "", m68020up | cpu32 },
+{"trapls", 2,	one(0051774),	one(0177777), "", m68020up | cpu32 },
+{"traplt", 2,	one(0056774),	one(0177777), "", m68020up | cpu32 },
+{"trapmi", 2,	one(0055774),	one(0177777), "", m68020up | cpu32 },
+{"trapne", 2,	one(0053374),	one(0177777), "", m68020up | cpu32 },
+{"trappl", 2,	one(0055374),	one(0177777), "", m68020up | cpu32 },
+{"trapt", 2,	one(0050374),	one(0177777), "", m68020up | cpu32 },
+{"trapvc", 2,	one(0054374),	one(0177777), "", m68020up | cpu32 },
+{"trapvs", 2,	one(0054774),	one(0177777), "", m68020up | cpu32 },
+
+{"trapcc.w", 4,	one(0052372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapcs.w", 4,	one(0052772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapeq.w", 4,	one(0053772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapf.w", 4,	one(0050772),	one(0177777), "#w", m68020up|cpu32|mcfisa_a},
+{"trapge.w", 4,	one(0056372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapgt.w", 4,	one(0057372),	one(0177777), "#w", m68020up|cpu32 },
+{"traphi.w", 4,	one(0051372),	one(0177777), "#w", m68020up|cpu32 },
+{"traple.w", 4,	one(0057772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapls.w", 4,	one(0051772),	one(0177777), "#w", m68020up|cpu32 },
+{"traplt.w", 4,	one(0056772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapmi.w", 4,	one(0055772),	one(0177777), "#w", m68020up|cpu32 },
+{"trapne.w", 4,	one(0053372),	one(0177777), "#w", m68020up|cpu32 },
+{"trappl.w", 4,	one(0055372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapt.w", 4,	one(0050372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapvc.w", 4,	one(0054372),	one(0177777), "#w", m68020up|cpu32 },
+{"trapvs.w", 4,	one(0054772),	one(0177777), "#w", m68020up|cpu32 },
+
+{"trapcc.l", 6,	one(0052373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapcs.l", 6,	one(0052773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapeq.l", 6,	one(0053773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapf.l", 6,	one(0050773),	one(0177777), "#l", m68020up|cpu32|mcfisa_a},
+{"trapge.l", 6,	one(0056373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapgt.l", 6,	one(0057373),	one(0177777), "#l", m68020up|cpu32 },
+{"traphi.l", 6,	one(0051373),	one(0177777), "#l", m68020up|cpu32 },
+{"traple.l", 6,	one(0057773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapls.l", 6,	one(0051773),	one(0177777), "#l", m68020up|cpu32 },
+{"traplt.l", 6,	one(0056773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapmi.l", 6,	one(0055773),	one(0177777), "#l", m68020up|cpu32 },
+{"trapne.l", 6,	one(0053373),	one(0177777), "#l", m68020up|cpu32 },
+{"trappl.l", 6,	one(0055373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapt.l", 6,	one(0050373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapvc.l", 6,	one(0054373),	one(0177777), "#l", m68020up|cpu32 },
+{"trapvs.l", 6,	one(0054773),	one(0177777), "#l", m68020up|cpu32 },
+
+{"trapv", 2,	one(0047166),	one(0177777), "", m68000up },
+
+{"tst.b", 2,	one(0045000),	one(0177700), ";b", m68020up|cpu32|mcfisa_a },
+{"tst.b", 2,	one(0045000),	one(0177700), "$b", m68000up },
+{"tst.w", 2,	one(0045100),	one(0177700), "*w", m68020up|cpu32|mcfisa_a },
+{"tst.w", 2,	one(0045100),	one(0177700), "$w", m68000up },
+{"tst.l", 2,	one(0045200),	one(0177700), "*l", m68020up|cpu32|mcfisa_a },
+{"tst.l", 2,	one(0045200),	one(0177700), "$l", m68000up },
+
+{"unlk", 2,	one(0047130),	one(0177770), "As", m68000up | mcfisa_a },
+
+{"unpk", 4,	one(0100600),	one(0170770), "DsDd#w", m68020up },
+{"unpk", 4,	one(0100610),	one(0170770), "-s-d#w", m68020up },
+
+{"wddata.b", 2,	one(0175400),   one(0177700), "~s", mcfisa_a },
+{"wddata.w", 2,	one(0175500),   one(0177700), "~s", mcfisa_a },
+{"wddata.l", 2,	one(0175600),   one(0177700), "~s", mcfisa_a },
+
+{"wdebug", 4,	two(0175720, 03),	two(0177770, 0xffff), "as", mcfisa_a },
+{"wdebug", 4,	two(0175750, 03),	two(0177770, 0xffff), "ds", mcfisa_a },
+};
+
+const int m68k_numopcodes = sizeof m68k_opcodes / sizeof m68k_opcodes[0];
+
+/* These aliases used to be in the above table, each one duplicating
+   all of the entries for its primary exactly.  This table was
+   constructed by mechanical processing of the opcode table, with a
+   small number of tweaks done by hand.  There are probably a lot more
+   aliases above that could be moved down here, except for very minor
+   differences.  */
+
+const struct m68k_opcode_alias m68k_opcode_aliases[] =
+{
+#if 0
+  { "add",	"addw", },
+  { "adda",	"addaw", },
+  { "addi",	"addiw", },
+  { "addq",	"addqw", },
+  { "addx",	"addxw", },
+  { "asl",	"aslw", },
+  { "asr",	"asrw", },
+  { "bhi",	"bhiw", },
+  { "bls",	"blsw", },
+  { "bcc",	"bccw", },
+  { "bcs",	"bcsw", },
+  { "bne",	"bnew", },
+  { "beq",	"beqw", },
+  { "bvc",	"bvcw", },
+  { "bvs",	"bvsw", },
+  { "bpl",	"bplw", },
+  { "bmi",	"bmiw", },
+  { "bge",	"bgew", },
+  { "blt",	"bltw", },
+  { "bgt",	"bgtw", },
+  { "ble",	"blew", },
+  { "bra",	"braw", },
+  { "bsr",	"bsrw", },
+  { "bhib",	"bhis", },
+  { "blsb",	"blss", },
+  { "bccb",	"bccs", },
+  { "bcsb",	"bcss", },
+  { "bneb",	"bnes", },
+  { "beqb",	"beqs", },
+  { "bvcb",	"bvcs", },
+  { "bvsb",	"bvss", },
+  { "bplb",	"bpls", },
+  { "bmib",	"bmis", },
+  { "bgeb",	"bges", },
+  { "bltb",	"blts", },
+  { "bgtb",	"bgts", },
+  { "bleb",	"bles", },
+  { "brab",	"bras", },
+  { "bsrb",	"bsrs", },
+  { "bhs",	"bccw" },
+  { "bhss",	"bccs" },
+  { "bhsb",	"bccs" },
+  { "bhsw",	"bccw" },
+  { "bhsl",	"bccl" },
+  { "blo",	"bcsw" },
+  { "blos",	"bcss" },
+  { "blob",	"bcss" },
+  { "blow",	"bcsw" },
+  { "blol",	"bcsl" },
+  { "br",	"braw", },
+  { "brs",	"bras", },
+  { "brb",	"bras", },
+  { "brw",	"braw", },
+  { "brl",	"bral", },
+  { "jfnlt",	"bcc", },	/* Apparently a sun alias.  */
+  { "jfngt",	"ble", },	/* Apparently a sun alias.  */
+  { "jfeq",	"beqs", },	/* Apparently a sun alias.  */
+  { "bchgb",	"bchg", },
+  { "bchgl",	"bchg", },
+  { "bclrb",	"bclr", },
+  { "bclrl",	"bclr", },
+  { "bsetb",	"bset", },
+  { "bsetl",	"bset", },
+  { "btstb",	"btst", },
+  { "btstl",	"btst", },
+  { "cas2",	"cas2w", },
+  { "cas",	"casw", },
+  { "chk2",	"chk2w", },
+  { "chk",	"chkw", },
+  { "clr",	"clrw", },
+  { "cmp2",	"cmp2w", },
+  { "cmpa",	"cmpaw", },
+  { "cmpi",	"cmpiw", },
+  { "cmpm",	"cmpmw", },
+  { "cmp",	"cmpw", },
+  { "dbccw",	"dbcc", },
+  { "dbcsw",	"dbcs", },
+  { "dbeqw",	"dbeq", },
+  { "dbfw",	"dbf", },
+  { "dbgew",	"dbge", },
+  { "dbgtw",	"dbgt", },
+  { "dbhiw",	"dbhi", },
+  { "dblew",	"dble", },
+  { "dblsw",	"dbls", },
+  { "dbltw",	"dblt", },
+  { "dbmiw",	"dbmi", },
+  { "dbnew",	"dbne", },
+  { "dbplw",	"dbpl", },
+  { "dbtw",	"dbt", },
+  { "dbvcw",	"dbvc", },
+  { "dbvsw",	"dbvs", },
+  { "dbhs",	"dbcc", },
+  { "dbhsw",	"dbcc", },
+  { "dbra",	"dbf", },
+  { "dbraw",	"dbf", },
+  { "tdivsl",	"divsl", },
+  { "divs",	"divsw", },
+  { "divu",	"divuw", },
+  { "ext",	"extw", },
+  { "extbw",	"extw", },
+  { "extwl",	"extl", },
+  { "fbneq",	"fbne", },
+  { "fbsneq",	"fbsne", },
+  { "fdbneq",	"fdbne", },
+  { "fdbsneq",	"fdbsne", },
+  { "fmovecr",	"fmovecrx", },
+  { "fmovm",	"fmovem", },
+  { "fsneq",	"fsne", },
+  { "fssneq",	"fssne", },
+  { "ftrapneq",	"ftrapne", },
+  { "ftrapsneq", "ftrapsne", },
+  { "fjneq",	"fjne", },
+  { "fjsneq",	"fjsne", },
+  { "jmpl",	"jmp", },
+  { "jmps",	"jmp", },
+  { "jsrl",	"jsr", },
+  { "jsrs",	"jsr", },
+  { "leal",	"lea", },
+  { "lsl",	"lslw", },
+  { "lsr",	"lsrw", },
+  { "mac",	"macw" },
+  { "movea",	"moveaw", },
+  { "movem",	"movemw", },
+  { "movml",	"moveml", },
+  { "movmw",	"movemw", },
+  { "movm",	"movemw", },
+  { "movep",	"movepw", },
+  { "movpw",	"movepw", },
+  { "moves",	"movesw" },
+  { "muls",	"mulsw", },
+  { "mulu",	"muluw", },
+  { "msac",	"msacw" },
+  { "nbcdb",	"nbcd" },
+  { "neg",	"negw", },
+  { "negx",	"negxw", },
+  { "not",	"notw", },
+  { "peal",	"pea", },
+  { "rol",	"rolw", },
+  { "ror",	"rorw", },
+  { "roxl",	"roxlw", },
+  { "roxr",	"roxrw", },
+  { "sats",	"satsl", },
+  { "sbcdb",	"sbcd", },
+  { "sccb",	"scc", },
+  { "scsb",	"scs", },
+  { "seqb",	"seq", },
+  { "sfb",	"sf", },
+  { "sgeb",	"sge", },
+  { "sgtb",	"sgt", },
+  { "shib",	"shi", },
+  { "sleb",	"sle", },
+  { "slsb",	"sls", },
+  { "sltb",	"slt", },
+  { "smib",	"smi", },
+  { "sneb",	"sne", },
+  { "splb",	"spl", },
+  { "stb",	"st", },
+  { "svcb",	"svc", },
+  { "svsb",	"svs", },
+  { "sfge",	"sge", },
+  { "sfgt",	"sgt", },
+  { "sfle",	"sle", },
+  { "sflt",	"slt", },
+  { "sfneq",	"sne", },
+  { "suba",	"subaw", },
+  { "subi",	"subiw", },
+  { "subq",	"subqw", },
+  { "sub",	"subw", },
+  { "subx",	"subxw", },
+  { "swapw",	"swap", },
+  { "tasb",	"tas", },
+  { "tpcc",	"trapcc", },
+  { "tcc",	"trapcc", },
+  { "tst",	"tstw", },
+  { "jbra",	"jra", },
+  { "jbhi",	"jhi", },
+  { "jbls",	"jls", },
+  { "jbcc",	"jcc", },
+  { "jbcs",	"jcs", },
+  { "jbne",	"jne", },
+  { "jbeq",	"jeq", },
+  { "jbvc",	"jvc", },
+  { "jbvs",	"jvs", },
+  { "jbpl",	"jpl", },
+  { "jbmi",	"jmi", },
+  { "jbge",	"jge", },
+  { "jblt",	"jlt", },
+  { "jbgt",	"jgt", },
+  { "jble",	"jle", },
+  { "movql",	"moveq", },
+  { "moveql",	"moveq", },
+  { "movl",	"movel", },
+  { "movq",	"moveq", },
+  { "moval",	"moveal", },
+  { "movaw",	"moveaw", },
+  { "movb",	"moveb", },
+  { "movc",	"movec", },
+  { "movecl",	"movec", },
+  { "movpl",	"movepl", },
+  { "movw",	"movew", },
+  { "movsb",	"movesb", },
+  { "movsl",	"movesl", },
+  { "movsw",	"movesw", },
+  { "mov3q",	"mov3ql", },
+
+  { "tdivul",	"divul", },	/* For m68k-svr4.  */
+  { "fmovb",	"fmoveb", },
+  { "fsmovb",	"fsmoveb", },
+  { "fdmovb",	"fdmoveb", },
+  { "fmovd",	"fmoved", },
+  { "fsmovd",	"fsmoved", },
+  { "fmovl",	"fmovel", },
+  { "fsmovl",	"fsmovel", },
+  { "fdmovl",	"fdmovel", },
+  { "fmovp",	"fmovep", },
+  { "fsmovp",	"fsmovep", },
+  { "fdmovp",	"fdmovep", },
+  { "fmovs",	"fmoves", },
+  { "fsmovs",	"fsmoves", },
+  { "fdmovs",	"fdmoves", },
+  { "fmovw",	"fmovew", },
+  { "fsmovw",	"fsmovew", },
+  { "fdmovw",	"fdmovew", },
+  { "fmovx",	"fmovex", },
+  { "fsmovx",	"fsmovex", },
+  { "fdmovx",	"fdmovex", },
+  { "fmovcr",	"fmovecr", },
+  { "fmovcrx",	"fmovecrx", },
+  { "ftestb",	"ftstb", },
+  { "ftestd",	"ftstd", },
+  { "ftestl",	"ftstl", },
+  { "ftestp",	"ftstp", },
+  { "ftests",	"ftsts", },
+  { "ftestw",	"ftstw", },
+  { "ftestx",	"ftstx", },
+
+  { "bitrevl",  "bitrev", },
+  { "byterevl", "byterev", },
+  { "ff1l",     "ff1", },
+#endif /* 0 */
+};
+
+const int m68k_numaliases =
+  sizeof m68k_opcode_aliases / sizeof m68k_opcode_aliases[0];

+ 368 - 0
external/dasm-tigcc/m68k.h

@@ -0,0 +1,368 @@
+/* Opcode table header for m680[01234]0/m6888[12]/m68851.
+   Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2001,
+   2003, 2004, 2006 Free Software Foundation, Inc.
+
+   This file is part of GDB, GAS, and the GNU binutils.
+
+   GDB, GAS, and the GNU binutils are free software; you can redistribute
+   them and/or modify them under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either version
+   1, or (at your option) any later version.
+
+   GDB, GAS, and the GNU binutils are distributed in the hope that they
+   will be useful, but WITHOUT ANY WARRANTY; without even the implied
+   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+   the GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this file; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA.  */
+
+/* These are used as bit flags for the arch field in the m68k_opcode
+   structure.  */
+#define	_m68k_undef  0
+#define	m68000   0x001
+#define	m68010   0x002
+#define	m68020   0x004
+#define	m68030   0x008
+#define	m68040   0x010
+#define m68060   0x020
+#define	m68881   0x040
+#define	m68851   0x080
+#define cpu32	 0x100		/* e.g., 68332 */
+#define m68k_mask  0x1ff
+
+#define mcfmac   0x200		/* ColdFire MAC. */
+#define mcfemac  0x400		/* ColdFire EMAC. */
+#define cfloat   0x800		/* ColdFire FPU.  */
+#define mcfhwdiv 0x1000		/* ColdFire hardware divide.  */
+
+#define mcfisa_a 0x2000		/* ColdFire ISA_A.  */
+#define mcfisa_aa 0x4000	/* ColdFire ISA_A+.  */
+#define mcfisa_b 0x8000		/* ColdFire ISA_B.  */
+#define mcfusp   0x10000	/* ColdFire USP instructions.  */
+#define mcf_mask 0x1f200
+
+/* Handy aliases.  */
+#define	m68040up   (m68040 | m68060)
+#define	m68030up   (m68030 | m68040up)
+#define	m68020up   (m68020 | m68030up)
+#define	m68010up   (m68010 | cpu32 | m68020up)
+#define	m68000up   (m68000 | m68010up)
+
+#define	mfloat  (m68881 | m68040 | m68060)
+#define	mmmu    (m68851 | m68030 | m68040 | m68060)
+
+/* The structure used to hold information for an opcode.  */
+
+struct m68k_opcode
+{
+  /* The opcode name.  */
+  const char *name;
+  /* The pseudo-size of the instruction(in bytes).  Used to determine
+     number of bytes necessary to disassemble the instruction.  */
+  unsigned int size;
+  /* The opcode itself.  */
+  unsigned long opcode;
+  /* The mask used by the disassembler.  */
+  unsigned long match;
+  /* The arguments.  */
+  const char *args;
+  /* The architectures which support this opcode.  */
+  unsigned int arch;
+};
+
+/* The structure used to hold information for an opcode alias.  */
+
+struct m68k_opcode_alias
+{
+  /* The alias name.  */
+  const char *alias;
+  /* The instruction for which this is an alias.  */
+  const char *primary;
+};
+
+/* We store four bytes of opcode for all opcodes because that is the
+   most any of them need.  The actual length of an instruction is
+   always at least 2 bytes, and is as much longer as necessary to hold
+   the operands it has.
+
+   The match field is a mask saying which bits must match particular
+   opcode in order for an instruction to be an instance of that
+   opcode.
+
+   The args field is a string containing two characters for each
+   operand of the instruction.  The first specifies the kind of
+   operand; the second, the place it is stored.  */
+
+/* Kinds of operands:
+   Characters used: AaBbCcDdEeFfGgHIiJkLlMmnOopQqRrSsTtU VvWwXxYyZz01234|*~%;@!&$?/<>#^+-
+
+   D  data register only.  Stored as 3 bits.
+   A  address register only.  Stored as 3 bits.
+   a  address register indirect only.  Stored as 3 bits.
+   R  either kind of register.  Stored as 4 bits.
+   r  either kind of register indirect only.  Stored as 4 bits.
+      At the moment, used only for cas2 instruction.
+   F  floating point coprocessor register only.   Stored as 3 bits.
+   O  an offset (or width): immediate data 0-31 or data register.
+      Stored as 6 bits in special format for BF... insns.
+   +  autoincrement only.  Stored as 3 bits (number of the address register).
+   -  autodecrement only.  Stored as 3 bits (number of the address register).
+   Q  quick immediate data.  Stored as 3 bits.
+      This matches an immediate operand only when value is in range 1 .. 8.
+   M  moveq immediate data.  Stored as 8 bits.
+      This matches an immediate operand only when value is in range -128..127
+   T  trap vector immediate data.  Stored as 4 bits.
+
+   k  K-factor for fmove.p instruction.   Stored as a 7-bit constant or
+      a three bit register offset, depending on the field type.
+
+   #  immediate data.  Stored in special places (b, w or l)
+      which say how many bits to store.
+   ^  immediate data for floating point instructions.   Special places
+      are offset by 2 bytes from '#'...
+   B  pc-relative address, converted to an offset
+      that is treated as immediate data.
+   d  displacement and register.  Stores the register as 3 bits
+      and stores the displacement in the entire second word.
+
+   C  the CCR.  No need to store it; this is just for filtering validity.
+   S  the SR.  No need to store, just as with CCR.
+   U  the USP.  No need to store, just as with CCR.
+   E  the MAC ACC.  No need to store, just as with CCR.
+   e  the EMAC ACC[0123].
+   G  the MAC/EMAC MACSR.  No need to store, just as with CCR.
+   g  the EMAC ACCEXT{01,23}.
+   H  the MASK.  No need to store, just as with CCR.
+   i  the MAC/EMAC scale factor.
+
+   I  Coprocessor ID.   Not printed if 1.   The Coprocessor ID is always
+      extracted from the 'd' field of word one, which means that an extended
+      coprocessor opcode can be skipped using the 'i' place, if needed.
+
+   s  System Control register for the floating point coprocessor.
+
+   J  Misc register for movec instruction, stored in 'j' format.
+	Possible values:
+	0x000	SFC	Source Function Code reg	[60, 40, 30, 20, 10]
+	0x001	DFC	Data Function Code reg		[60, 40, 30, 20, 10]
+	0x002   CACR    Cache Control Register          [60, 40, 30, 20, mcf]
+	0x003	TC	MMU Translation Control		[60, 40]
+	0x004	ITT0	Instruction Transparent
+				Translation reg 0	[60, 40]
+	0x005	ITT1	Instruction Transparent
+				Translation reg 1	[60, 40]
+	0x006	DTT0	Data Transparent
+				Translation reg 0	[60, 40]
+	0x007	DTT1	Data Transparent
+				Translation reg 1	[60, 40]
+	0x008	BUSCR	Bus Control Register		[60]
+	0x800	USP	User Stack Pointer		[60, 40, 30, 20, 10]
+        0x801   VBR     Vector Base reg                 [60, 40, 30, 20, 10, mcf]
+	0x802	CAAR	Cache Address Register		[        30, 20]
+	0x803	MSP	Master Stack Pointer		[    40, 30, 20]
+	0x804	ISP	Interrupt Stack Pointer		[    40, 30, 20]
+	0x805	MMUSR	MMU Status reg			[    40]
+	0x806	URP	User Root Pointer		[60, 40]
+	0x807	SRP	Supervisor Root Pointer		[60, 40]
+	0x808	PCR	Processor Configuration reg	[60]
+	0xC00	ROMBAR	ROM Base Address Register	[520X]
+	0xC04	RAMBAR0	RAM Base Address Register 0	[520X]
+	0xC05	RAMBAR1	RAM Base Address Register 0	[520X]
+	0xC0F	MBAR0	RAM Base Address Register 0	[520X]
+        0xC04   FLASHBAR FLASH Base Address Register    [mcf528x]
+        0xC05   RAMBAR  Static RAM Base Address Register [mcf528x]
+
+    L  Register list of the type d0-d7/a0-a7 etc.
+       (New!  Improved!  Can also hold fp0-fp7, as well!)
+       The assembler tries to see if the registers match the insn by
+       looking at where the insn wants them stored.
+
+    l  Register list like L, but with all the bits reversed.
+       Used for going the other way. . .
+
+    c  cache identifier which may be "nc" for no cache, "ic"
+       for instruction cache, "dc" for data cache, or "bc"
+       for both caches.  Used in cinv and cpush.  Always
+       stored in position "d".
+
+    u  Any register, with ``upper'' or ``lower'' specification.  Used
+       in the mac instructions with size word.
+
+ The remainder are all stored as 6 bits using an address mode and a
+ register number; they differ in which addressing modes they match.
+
+   *  all					(modes 0-6,7.0-4)
+   ~  alterable memory				(modes 2-6,7.0,7.1)
+   						(not 0,1,7.2-4)
+   %  alterable					(modes 0-6,7.0,7.1)
+						(not 7.2-4)
+   ;  data					(modes 0,2-6,7.0-4)
+						(not 1)
+   @  data, but not immediate			(modes 0,2-6,7.0-3)
+						(not 1,7.4)
+   !  control					(modes 2,5,6,7.0-3)
+						(not 0,1,3,4,7.4)
+   &  alterable control				(modes 2,5,6,7.0,7.1)
+						(not 0,1,3,4,7.2-4)
+   $  alterable data				(modes 0,2-6,7.0,7.1)
+						(not 1,7.2-4)
+   ?  alterable control, or data register	(modes 0,2,5,6,7.0,7.1)
+						(not 1,3,4,7.2-4)
+   /  control, or data register			(modes 0,2,5,6,7.0-3)
+						(not 1,3,4,7.4)
+   >  *save operands				(modes 2,4,5,6,7.0,7.1)
+						(not 0,1,3,7.2-4)
+   <  *restore operands				(modes 2,3,5,6,7.0-3)
+						(not 0,1,4,7.4)
+
+   coldfire move operands:
+   m  						(modes 0-4)
+   n						(modes 5,7.2)
+   o						(modes 6,7.0,7.1,7.3,7.4)
+   p						(modes 0-5)
+
+   coldfire bset/bclr/btst/mulsl/mulul operands:
+   q						(modes 0,2-5)
+   v						(modes 0,2-5,7.0,7.1)
+   b                                            (modes 0,2-5,7.2)
+   w                                            (modes 2-5,7.2)
+   y						(modes 2,5)
+   z						(modes 2,5,7.2)
+   x  mov3q immediate operand.
+   4						(modes 2,3,4,5)
+  */
+
+/* For the 68851:  */
+/* I didn't use much imagination in choosing the
+   following codes, so many of them aren't very
+   mnemonic. -rab
+
+   0  32 bit pmmu register
+	Possible values:
+	000	TC	Translation Control Register (68030, 68851)
+
+   1  16 bit pmmu register
+	111	AC	Access Control (68851)
+
+   2  8 bit pmmu register
+	100	CAL	Current Access Level (68851)
+	101	VAL	Validate Access Level (68851)
+	110	SCC	Stack Change Control (68851)
+
+   3  68030-only pmmu registers (32 bit)
+	010	TT0	Transparent Translation reg 0
+			(aka Access Control reg 0 -- AC0 -- on 68ec030)
+	011	TT1	Transparent Translation reg 1
+			(aka Access Control reg 1 -- AC1 -- on 68ec030)
+
+   W  wide pmmu registers
+	Possible values:
+	001	DRP	Dma Root Pointer (68851)
+	010	SRP	Supervisor Root Pointer (68030, 68851)
+	011	CRP	Cpu Root Pointer (68030, 68851)
+
+   f	function code register (68030, 68851)
+	0	SFC
+	1	DFC
+
+   V	VAL register only (68851)
+
+   X	BADx, BACx (16 bit)
+	100	BAD	Breakpoint Acknowledge Data (68851)
+	101	BAC	Breakpoint Acknowledge Control (68851)
+
+   Y	PSR (68851) (MMUSR on 68030) (ACUSR on 68ec030)
+   Z	PCSR (68851)
+
+   |	memory 		(modes 2-6, 7.*)
+
+   t  address test level (68030 only)
+      Stored as 3 bits, range 0-7.
+      Also used for breakpoint instruction now.
+
+*/
+
+/* Places to put an operand, for non-general operands:
+   Characters used: BbCcDdFfGgHhIijkLlMmNnostWw123456789/
+
+   s  source, low bits of first word.
+   d  dest, shifted 9 in first word
+   1  second word, shifted 12
+   2  second word, shifted 6
+   3  second word, shifted 0
+   4  third word, shifted 12
+   5  third word, shifted 6
+   6  third word, shifted 0
+   7  second word, shifted 7
+   8  second word, shifted 10
+   9  second word, shifted 5
+   D  store in both place 1 and place 3; for divul and divsl.
+   B  first word, low byte, for branch displacements
+   W  second word (entire), for branch displacements
+   L  second and third words (entire), for branch displacements
+      (also overloaded for move16)
+   b  second word, low byte
+   w  second word (entire) [variable word/long branch offset for dbra]
+   W  second word (entire) (must be signed 16 bit value)
+   l  second and third word (entire)
+   g  variable branch offset for bra and similar instructions.
+      The place to store depends on the magnitude of offset.
+   t  store in both place 7 and place 8; for floating point operations
+   c  branch offset for cpBcc operations.
+      The place to store is word two if bit six of word one is zero,
+      and words two and three if bit six of word one is one.
+   i  Increment by two, to skip over coprocessor extended operands.   Only
+      works with the 'I' format.
+   k  Dynamic K-factor field.   Bits 6-4 of word 2, used as a register number.
+      Also used for dynamic fmovem instruction.
+   C  floating point coprocessor constant - 7 bits.  Also used for static
+      K-factors...
+   j  Movec register #, stored in 12 low bits of second word.
+   m  For M[S]ACx; 4 bits split with MSB shifted 6 bits in first word
+      and remaining 3 bits of register shifted 9 bits in first word.
+      Indicate upper/lower in 1 bit shifted 7 bits in second word.
+      Use with `R' or `u' format.
+   n  `m' withouth upper/lower indication. (For M[S]ACx; 4 bits split
+      with MSB shifted 6 bits in first word and remaining 3 bits of
+      register shifted 9 bits in first word.  No upper/lower
+      indication is done.)  Use with `R' or `u' format.
+   o  For M[S]ACw; 4 bits shifted 12 in second word (like `1').
+      Indicate upper/lower in 1 bit shifted 7 bits in second word.
+      Use with `R' or `u' format.
+   M  For M[S]ACw; 4 bits in low bits of first word.  Indicate
+      upper/lower in 1 bit shifted 6 bits in second word.  Use with
+      `R' or `u' format.
+   N  For M[S]ACw; 4 bits in low bits of second word.  Indicate
+      upper/lower in 1 bit shifted 6 bits in second word.  Use with
+      `R' or `u' format.
+   h  shift indicator (scale factor), 1 bit shifted 10 in second word
+
+ Places to put operand, for general operands:
+   d  destination, shifted 6 bits in first word
+   b  source, at low bit of first word, and immediate uses one byte
+   w  source, at low bit of first word, and immediate uses two bytes
+   l  source, at low bit of first word, and immediate uses four bytes
+   s  source, at low bit of first word.
+      Used sometimes in contexts where immediate is not allowed anyway.
+   f  single precision float, low bit of 1st word, immediate uses 4 bytes
+   F  double precision float, low bit of 1st word, immediate uses 8 bytes
+   x  extended precision float, low bit of 1st word, immediate uses 12 bytes
+   p  packed float, low bit of 1st word, immediate uses 12 bytes
+   G  EMAC accumulator, load  (bit 4 2nd word, !bit8 first word)
+   H  EMAC accumulator, non load  (bit 4 2nd word, bit 8 first word)
+   F  EMAC ACCx
+   f  EMAC ACCy
+   I  MAC/EMAC scale factor
+   /  Like 's', but set 2nd word, bit 5 if trailing_ampersand set
+   ]  first word, bit 10
+*/
+
+extern const struct m68k_opcode m68k_opcodes[];
+extern const struct m68k_opcode_alias m68k_opcode_aliases[];
+
+extern const int m68k_numopcodes, m68k_numaliases;
+
+/* end of m68k-opcode.h */

+ 42 - 0
external/dasm-tigcc/macros.h

@@ -0,0 +1,42 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: macros.h 2450 2006-06-07 20:03:00Z roms $ */
+
+/*  libtifiles - Ti File Format library, a part of the TiLP project
+ *  Copyright (C) 1999-2006  Romain Liévin
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIEMU_MACROS__
+#define __TIEMU_MACROS__
+
+#include <stdint.h>
+
+// extract a word from a longword
+# define LSW(l) (uint16_t) ((l) & 0x0000FFFF)
+# define MSW(l) (uint16_t)(((l) & 0xFFFF0000) >> 16)
+
+// extract a byte from a word
+# define LSB(w) (uint8_t) ((w) & 0x00FF)
+# define MSB(w) (uint8_t)(((w) & 0xFF00) >> 8)
+
+// extract a nibble from a byte
+# define LSN(b)  ((b) & 0x0F)
+# define MSN(b) (((b) & 0xF0) >> 4)
+
+// convert 2 nibbles into a BCD byte
+# define BCD(b) (10*MSN(b)+LSN(b))
+
+#endif

+ 719 - 0
external/dasm-tigcc/main.c

@@ -0,0 +1,719 @@
+/*
+   dasm-tigcc - Disassembler for TI calculators
+
+   Copyright (C) 2000-2002 Thomas Nussbaumer
+   Copyright (C) 2005 Lionel Debroux
+   Copyright (C) 2007 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+*/
+
+/* The code in this file is based on ttdasm, but with the VTI-derived code
+   removed. Calls to VTI functions have been replaced with calls to the
+   equivalent TiEmu functions. */
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "main.h"
+#include "tt.h"
+#include "ti68k_def.h"
+#include "images.h"
+#include "timem.h"
+#include "mem.h"
+#include "romcalls.h"
+#include "disasm.h"
+
+
+//=============================================================================
+// outputs usage information of this tool
+//=============================================================================
+void PrintUsage() {
+    fprintf(USAGE_OUT, "dasm-tigcc 1.00 - Disassembler for TI calculators\n\n"                \
+                       "Copyright (C) 2000-2002 Thomas Nussbaumer\n"                          \
+                       "Copyright (C) 2005 Lionel Debroux\n"                                  \
+                       "Copyright (C) 2007 Kevin Kofler\n"                                    \
+                       "Portions (GDB) Copyright (C) 1986-2007 Free Software Foundation\n"    \
+                       "Portions (TiEmu) Copyright (C) 2000-2007 Romain Lievin et. al.\n"     \
+                       "Portions (ld-tigcc) Copyright (C) 2002-2004 Sebastian Reichelt\n\n"   \
+                       "This program is free software; you may redistribute it under the\n"   \
+                       "terms of the the GNU General Public License. There is NO warranty;\n" \
+                       "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"\
+                       "Usage: dasm-tigcc [flags] [<infile>]\n\n"                             \
+                       "       -o <number>       ... use given offset as start point\n"       \
+                       "       -l <bytes>        ... disassemble number of given bytes\n"     \
+                       "       -r <romfile>      ... disassemble given rom file\n"            \
+                       "       -f                ... show ROM function table\n"               \
+                       "       -name             ... show possible ROM calls\n"               \
+                       "       -virtual <number> ... use additionally virtual offset\n"       \
+                       "       -nolabels         ... use no labels in output\n"               \
+                       "       -raw              ... treat file as raw binary\n"              \
+                       "       -vti              ... treat file as VTI save file\n"           \
+                       "       -stub             ... prints additionally information of\n"    \
+                       "                             kernel based programs\n\n"               \
+                       "       disassembles a TI89/TI92plus NOSTUB executable,\n"             \
+                       "       a TI89/TI92plus raw dump,parts of a given ROM file or\n"       \
+                       "       a VTI save file.\n\n"                                          \
+                       "       NOTE1: the offset and the length can be specified as\n"        \
+                       "              hex numbers, too (for example: -o 0x4c)\n\n"            \
+                       "       NOTE2: offsets are not treated as pure file offsets,\n"        \
+                       "              but are handled depending on the target.\n"             \
+                       "              Within executables offset 0 starts at file offset\n"    \
+                       "              88 which is just behind the header and the length\n"    \
+                       "              information. Offsets within ROM files maps\n"           \
+                       "              directly to the real addresses within the calculator.\n\n");
+}
+
+
+int            calc_type;
+unsigned char* rom;
+unsigned char* ram;
+int            initialPC;
+int            initIntTabOfs;
+unsigned char* mem[256];
+unsigned char  unused[0x10000];
+int            label_parse = 0;
+int            no_labels   = 0;
+uint32_t       rom_base;
+uint32_t       rom_size;
+uint32_t       ram_size;
+uint32_t       entry_point;
+static uint32_t abs_labels_start = 0;
+static uint32_t abs_labels_len = 0;
+
+#define GET_WORD(m)   ((unsigned short)((((m)[0]) << 8) + ((m)[1])))
+
+uint32_t* label_list       = NULL;
+int   label_count      = 0;
+int   labels_allocated = 0;
+
+#define LABEL_ALLOC_STEP 10
+
+//=============================================================================
+// adds a label to the list
+//=============================================================================
+int AddLabel(uint32_t address) {
+    int i = -1;
+
+    if (label_count != 0) {
+        for (i=0;i<label_count;i++) if (label_list[i] == address) return 1;
+    }
+
+    if (label_count == labels_allocated) {
+        uint32_t* tmp = (uint32_t*)realloc(label_list,(labels_allocated+LABEL_ALLOC_STEP)*sizeof(uint32_t));
+        if (!tmp) {
+            label_parse = 0;
+            return 0;
+        }
+        label_list = tmp;
+        labels_allocated+=LABEL_ALLOC_STEP;
+    }
+    label_list[label_count++] = address;
+    return 1;
+}
+
+
+//=============================================================================
+// adds a label to the list
+//=============================================================================
+char label_name[200];
+char* GetLabel(uint32_t address) {
+    int i = -1;
+
+    if (no_labels) return NULL;
+
+    if (label_count != 0) {
+        for (i=0;i<label_count;i++) if (label_list[i] == address) break;
+    }
+    if (i != label_count && i != -1) {
+        sprintf(label_name,"__L%lX",(unsigned long)label_list[i]);
+        return label_name;
+    }
+    return NULL;
+}
+
+
+void PrintAddress (int32_t reladdr, uint32_t absaddr, int flags, void *stream,
+                   void (*fprintf_f) (void *, const char *, ...),
+                   void (*fputs_f) (const char *, void *))
+{
+    if ((flags & 4) && !(absaddr >= abs_labels_start && absaddr < abs_labels_start + abs_labels_len)) {
+        fprintf_f(stream, "0x%lX", (unsigned long) absaddr);
+        return;
+    }
+    if (label_parse) {
+        AddLabel(absaddr);
+    } else {
+        char *s = GetLabel(absaddr);
+        if (!s) {
+            if (flags & 1) {
+                if (reladdr < 0)
+                    fprintf_f(stream, ".-0x%X", (int) -reladdr);
+                else
+                    fprintf_f(stream, ".+0x%X", (int) reladdr);
+            } else {
+                if (reladdr < 0)
+                    fprintf_f(stream, "-0x%X", (int) -reladdr);
+                else
+                    fprintf_f(stream, "0x%X", (int) reladdr);
+            }
+        } else {
+            fprintf_f(stream, "%s", s);
+            if (flags & 2)
+                fputs_f("-.", stream);
+        }
+    }
+}
+
+
+static void PrintROMInfo(IMG_INFO *info) {
+    switch (info->calc_type) {
+      case TI92: printf("TI92  "); break;
+      case TI89: printf("TI89  "); break;
+      case TI92p: printf("TI92p  "); break;
+      case V200: printf("V200  "); break;
+      case TI89t: printf("TI89t  "); break;
+    }
+    if (info->calc_type==TI92 && info->rom_base==0x20) printf("INTERNAL ");
+    if (!info->has_boot) printf("UPDATE ");
+    if (!info->flash==FLASH_ROM) printf("FLASHROM ");
+}
+
+
+//=============================================================================
+// frees buffers used for ROM
+//=============================================================================
+void CleanupROM() {
+   if (rom) free(rom);
+   if (ram) free(ram);
+   rom = 0;
+}
+
+
+//=============================================================================
+// load a ROM file
+//=============================================================================
+int LoadROM(char* filename) {
+    IMG_INFO       info;
+
+    rom  = (unsigned char*)malloc(4096*1024+3);
+    ram  = (unsigned char*)malloc(256*1024+3);
+
+    if (!rom || !ram) {
+        CleanupROM();
+            fprintf(stderr,"ERROR: cannot allocate memory for ROM\n");
+        return 0;
+    }
+
+    memset(rom,0xff,4096*1024+3);
+
+    if (ti68k_is_a_rom_file(filename)) {
+        if (ti68k_get_rom_infos(filename,&info,1)) return 0;
+        printf("/*[ ");PrintROMInfo(&info);printf("]*/\n");
+    } else if (ti68k_is_a_tib_file(filename)) {
+        if (ti68k_get_tib_infos(filename,&info,1)) return 0;
+        printf("/*[ ");PrintROMInfo(&info);printf("]*/\n");
+    } else if (ti68k_is_a_img_file(filename)) {
+        if (ti68k_load_image(filename,&info)) return 0;
+        printf("/*[ ");PrintROMInfo(&info);printf("]*/\n");
+    } else {
+        fprintf(stderr,"ERROR: invalid ROM filename %s (neither .ROM nor .TIB nor .IMG)\n",filename);
+        CleanupROM();
+        return 0;
+    }
+    calc_type = info.calc_type;
+
+    if (info.has_boot)
+        memcpy(rom,info.data,info.size);
+    else
+        ti68k_convert_tib_to_image(&info,rom);
+    rom_base = info.rom_base << 16;
+    rom_size = info.size;
+    ram_size = (rom_size==1024*1024)?0x100000:0x200000;
+
+    if (info.flash==FLASH_ROM) {
+        initialPC     = rd_long(&rom[0x1208c]);
+        initIntTabOfs = 0x12088;
+    }
+    else {
+        initialPC     = rd_long(&rom[4]);
+        initIntTabOfs = 0;
+    }
+
+    free(info.data);
+
+    printf("/*[initialPC     = 0x%x (%d)]*/\n",initialPC,initialPC);
+    printf("/*[initIntTabOfs = 0x%x (%d)]*/\n\n",initIntTabOfs,initIntTabOfs);
+
+    return 1;
+}
+
+
+//=============================================================================
+// initialize memory pointers
+//=============================================================================
+void InitMemoryPointers() {
+    memset(ram, 0, 0x40000);
+    memcpy(ram, rom+initIntTabOfs, 256);
+    memset(unused, 0x14, 0x10000);
+    hw_mem_init();
+}
+
+
+static const char* offsetname_ptr;
+
+//=============================================================================
+// helper function for disassembling engine
+//=============================================================================
+void Offset2Name(int addr) {
+    offsetname_ptr = (romcalls_is_loaded() && !(addr & 3)
+                      && addr < (NMAX_ROMCALLS << 2))
+                     ? romcalls_get_name(addr >> 2) : 0;
+}
+
+
+//=============================================================================
+// disassemble given buffer until length bytes are processed
+// the given offset is used just for the address output in the comment
+//=============================================================================
+void Disassemble(unsigned char* mem,int length,int used_offset,
+                 int virtual_offset,int show_possible)
+{
+    char buffer[1024];
+    int  start = 0;
+    int  bytes;
+    int  i;
+
+    //printf("starting ...\n");
+
+    if (!no_labels) {
+        label_parse=1;
+        while (start < length) {
+            bytes = Dasm68000(mem+start,buffer,start+used_offset+virtual_offset);
+
+            if (!label_parse) {
+                printf("ERROR: OUT-OF-MEMORY - cannot add that much levels\n");
+                return;
+            }
+            start+=bytes;
+        }
+
+        start       = 0;
+        label_parse = 0;
+    }
+
+    printf("asm(\"\n");
+
+    while (start < length) {
+        if (!no_labels) {
+            char* s = GetLabel(start+used_offset+virtual_offset);
+            if (s) printf("%s:\n",s);
+        }
+        offsetname_ptr = 0;
+        bytes = Dasm68000(mem+start,buffer,start+used_offset+virtual_offset);
+        printf("%s",buffer);
+        for (i=strlen(buffer);i<30;i++) printf(" ");
+        printf("/* [0x%X (%u)] ",start+used_offset+virtual_offset,start+used_offset+virtual_offset);
+        for (i=0;i<bytes;i++) printf("%02x ",*(mem+start+i));
+        for (i=bytes;i<6;i++) printf("   ");
+        if (show_possible) {
+            if (offsetname_ptr) printf("?%s? */\n",offsetname_ptr);
+            else                printf("*/\n");
+        }
+        else {
+            printf("*/\n");
+        }
+        start+=bytes;
+    }
+    printf("\");\n");
+}
+
+
+//=============================================================================
+// outputs header details of kernel-based programs or libraries
+//=============================================================================
+void OutputStubDetails(unsigned char* mem) {
+    int i,offset,count;
+    printf("******** STUB-HEADER INFO *********\n");
+
+    if ((!strncmp((char*)(mem+4),"68kP",4)) || (!strncmp((char*)(mem+4),"68kL",4))) {
+        printf("signature:        %c%c%c%c\n",*(mem+4),*(mem+5),*(mem+6),*(mem+7));
+
+        printf("relcount:         %d\n",GET_WORD(mem+8));
+        printf("offset comment:   0x%04x\n",GET_WORD(mem+0xa));
+        printf("offset main:      0x%04x\n",GET_WORD(mem+0xc));
+        printf("offset exit:      0x%04x\n",GET_WORD(mem+0xe));
+        printf("compatiblity:     0x%04x\n",GET_WORD(mem+0x10));
+        printf("offset BSS:       0x%04x\n",GET_WORD(mem+0x14));
+        offset = GET_WORD(mem+0x16);
+        printf("offset export:    0x%04x\n",offset);
+        printf("offset RAM table: 0x%04x\n",GET_WORD(mem+0x18));
+        printf("********* EXPORT TABLE ************\n");
+        count = GET_WORD(mem+offset);
+        for (i=0;i<count;i++) printf("export@%04x:      0x%04x\n",i,GET_WORD(mem+offset+2+i*2));
+    }
+    else {
+        printf("--- not found --- (missing 68kP or 68kL)\n");
+    }
+}
+
+
+//=============================================================================
+// its a main ...
+//=============================================================================
+int main(int argc,char *argv[]) {
+    char*          infile = 0;
+    FILE*          ifp;
+    char           sig[9];
+    int            length;
+    unsigned char* data;
+    int            n;
+    int            given_offset            = -1;
+    int            given_length            = -1;
+    char*          given_rom               = 0;
+    int            show_functions          = 0;
+    int            show_possible_functions = 0;
+    int            virtual_offset          = 0;
+    int            raw                     = 0;
+    int            vti                     = 0;
+    int            stub                    = 0;
+
+    //---------------------------------------------------------------
+    // check for too less arguments
+    //---------------------------------------------------------------
+    if (argc < 2) {
+        PrintUsage();
+        return 1;
+    }
+
+    printf("/* Disassembled with dasm-tigcc\n\n"
+           "   Copyright (C) 2000-2002 Thomas Nussbaumer\n"
+           "   Copyright (C) 2005 Lionel Debroux\n"
+           "   Copyright (C) 2007 Kevin Kofler\n"
+           "   Portions (GDB) Copyright (C) 1986-2007 Free Software Foundation\n"
+           "   Portions (TiEmu) Copyright (C) 2000-2007 Romain Lievin et. al.\n"
+           "   Portions (ld-tigcc) Copyright (C) 2002-2004 Sebastian Reichelt */\n\n");
+
+    //---------------------------------------------------------------
+    // parse commandline arguments
+    //---------------------------------------------------------------
+    for (n=1; n<argc; n++) {
+        if (!strcmp(argv[n], "-o")) {
+            // handle offset commandline tag
+            if (n == argc -1) {
+                PrintUsage();
+                return 1;
+            }
+            else {
+                if (!strncmp(argv[n+1],"0x",2)) {
+                    if (sscanf(&argv[n+1][2],"%x",&given_offset) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                else {
+                    if (sscanf(argv[n+1],"%d",&given_offset) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                if (given_offset<0) {
+                    fprintf(stderr,"ERROR: offset cannot be negative\n");
+                    return 1;
+                }
+                n++;
+            }
+        }
+        else if (!strcmp(argv[n], "-virtual")) {
+            // handle virtual offset commandline tag
+            if (n == argc -1) {
+                PrintUsage();
+                return 1;
+            }
+            else {
+                if (!strncmp(argv[n+1],"0x",2)) {
+                    if (sscanf(&argv[n+1][2],"%x",&virtual_offset) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                else {
+                    if (sscanf(argv[n+1],"%d",&virtual_offset) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                if (virtual_offset<0) {
+                    fprintf(stderr,"ERROR: offset cannot be negative\n");
+                    return 1;
+                }
+                n++;
+            }
+        }
+        else if (!strcmp(argv[n], "-l")) {
+            // handle length commandline tag
+            if (n == argc -1) {
+                PrintUsage();
+                return 1;
+            }
+            else {
+                if (!strncmp(argv[n+1],"0x",2)) {
+                    if (sscanf(&argv[n+1][2],"%x",&given_length) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                else {
+                    if (sscanf(argv[n+1],"%d",&given_length) != 1) {
+                        PrintUsage();
+                        return 1;
+                    }
+                }
+                if (given_length<0) {
+                    fprintf(stderr,"ERROR: length cannot be negative\n");
+                    return 1;
+                }
+                n++;
+            }
+        }
+        else if (!strcmp(argv[n], "-r")) {
+            // handle romfile commandline tag
+            if (n == argc -1) {
+                PrintUsage();
+                return 1;
+            }
+            else {
+                given_rom = argv[n+1];
+                n++;
+            }
+        }
+        else if (!strcmp(argv[n], "-f")) {
+            // handle show ROM functions commandline tag
+            show_functions = 1;
+        }
+        else if (!strcmp(argv[n], "-vti")) {
+            // handle show ROM functions commandline tag
+            vti = 1;
+            if (raw || given_rom) {
+                fprintf(stderr,"ERROR: cannot use -vti with -r or -raw\n");
+                return 1;
+            }
+        }
+        else if (!strcmp(argv[n], "-stub")) {
+            // shows additionally informations about kernel based programs
+            stub = 1;
+        }
+        else if (!strcmp(argv[n], "-raw")) {
+            // handle show ROM functions commandline tag
+            raw = 1;
+            if (vti || given_rom) {
+                fprintf(stderr,"ERROR: cannot use -raw with -r or -vti\n");
+                return 1;
+            }
+        }
+        else if (!strcmp(argv[n], "-name")) {
+            // handle show possible ROM functions commandline tag
+            show_possible_functions = 1;
+        }
+        else if (!strcmp(argv[n], "-nolabels")) {
+            // handle show possible ROM functions commandline tag
+            no_labels = 1;
+        }
+        else if (argv[n][0] == '-') {
+            fprintf(stderr,"ERROR: invalid option %s",argv[n]);
+            return 1;
+        }
+
+        else if (!infile) infile = argv[n];
+        else {
+            PrintUsage();
+            return 1;
+        }
+    }
+
+    //---------------------------------------------------------------
+    // some parameter validation checks
+    //---------------------------------------------------------------
+    if (!infile && !given_rom) {
+        fprintf(stderr,"ERROR: neither file nor ROM is given\n");
+        return 1;
+    }
+
+    if (infile && given_rom) {
+        fprintf(stderr,"ERROR: cannot use file and ROM at the same time\n");
+        return 1;
+    }
+
+    if (show_functions && infile) {
+        fprintf(stderr,"WARNING: cannot show ROM functions (only possible with given ROM)\n");
+    }
+
+
+    //---------------------------------------------------------------
+    // load ROM file if user had supplied a ROM filename
+    //---------------------------------------------------------------
+    if (given_rom) {
+        if (!LoadROM(given_rom)) {
+            fprintf(stderr,"/*[program terminated due to ROM loading error]*/\n");
+            return 1;
+        }
+        InitMemoryPointers();
+        romcalls_load(0);
+    } else romcalls_load(1);
+
+    //----------------------------------------------------
+    // treat ROM disassembling
+    //----------------------------------------------------
+    if (given_rom) {
+        if (show_functions) {
+            uint32_t addr;
+            int size;
+            int i;
+
+            romcalls_get_table_infos(&addr, (uint32_t *)&size);
+            for(i = 0; i < size; i++) {
+                const char *name = romcalls_get_name(i);
+                addr = romcalls_get_addr(i);
+                printf("%06x (%07d) %s\n",addr,addr,name);
+            }
+            CleanupROM();
+            return 0;
+        }
+
+
+        if (given_offset == -1 || given_length == -1) {
+            fprintf(stderr,"ERROR: please specify offset and length\n");
+            CleanupROM();
+            return 1;
+        }
+
+        if (!(data = malloc(given_length+20))) {
+            fprintf(stderr,"ERROR: cannot allocate %d bytes\n",given_length+20);
+            CleanupROM();
+            return 1;
+        }
+
+        for (n=0;n<given_length;n++) data[n] = hw_get_byte(given_offset+n);
+
+        abs_labels_start = given_offset + virtual_offset;
+        abs_labels_len = given_length;
+
+        Disassemble(data,given_length,given_offset,virtual_offset,show_possible_functions);
+        if (label_list) free(label_list);
+        CleanupROM();
+        free(data);
+        return 0;
+    }
+
+    //----------------------------------------------------
+    // if we'll come here user wants to disassemble a file
+    //----------------------------------------------------
+    entry_point = virtual_offset;
+
+    if (!(ifp = fopen(infile,"rb"))) {
+        fprintf(stderr,"ERROR: cannot open inputfile %s\n",infile);
+        if (given_rom) CleanupROM();
+        return 1;
+    }
+
+    if (!vti && !raw) {
+        memset(sig,0,9);
+        if (fread(sig,1,8,ifp) < 8) {
+            fprintf(stderr,"ERROR: read error\n");
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+
+        if (strcmp(sig,SIGNATURE_TI89) && strcmp(sig,SIGNATURE_TI92P)) {
+            fprintf(stderr,"ERROR: neither TI89 nor TI92p executable\n");
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+    }
+
+    fseek(ifp,0,SEEK_END);
+    length = ftell(ifp);
+
+    if (vti) {
+        length -= 0x100;
+        if (given_offset != -1 && given_offset >= 256000) {
+            fprintf(stderr,"ERROR: given offset is too large (%d >= 256000)\n",given_offset);
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+        if (length < 256000+0x100) {
+            fprintf(stderr,"ERROR: given file no valid VTI save file (too short)\n");
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+    }
+    else {
+        if (!raw) {
+            length -= 90; // 86 bytes for header + 2 bytes for length + 2 bytes for trailing checksum
+        }
+        if (given_offset != -1 && given_offset >= length) {
+            fprintf(stderr,"ERROR: given offset is too large (%d >= %d)\n",given_offset,length);
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+
+        if (given_length != -1 && given_length >= length) {
+            fprintf(stderr,"ERROR: given length is too large (%d >= %d)\n",given_length,length);
+            fclose(ifp);
+            if (given_rom) CleanupROM();
+            return 1;
+        }
+    }
+
+    rewind(ifp);
+    if (!raw) {
+        if (vti) fseek(ifp,0x100,SEEK_SET);
+        else     fseek(ifp,88,SEEK_SET);
+    }
+
+    if (!(data = malloc(length+20))) {
+        fprintf(stderr,"ERROR: cannot allocate %d bytes\n",length+20);
+        fclose(ifp);
+        if (given_rom) CleanupROM();
+        return 1;
+    }
+
+    memset(data,0,length+20);
+    if (fread(data,1,length,ifp) < (size_t) length) {
+        fprintf(stderr,"ERROR: read error\n");
+        fclose(ifp);
+        return 1;
+    }
+    fclose(ifp);
+
+    if (given_length != -1) length = given_length;
+    if (given_offset == -1) given_offset = 0;
+
+    if (stub) OutputStubDetails(data+given_offset);
+
+    Disassemble(data+given_offset,length,given_offset,virtual_offset,show_possible_functions);
+    if (label_list) free(label_list);
+
+    if (given_rom) CleanupROM();
+    free(data);
+    return 0;
+}
+

+ 35 - 0
external/dasm-tigcc/main.h

@@ -0,0 +1,35 @@
+/*
+   dasm-tigcc - Disassembler for TI calculators
+
+   Copyright (C) 2000-2002 Thomas Nussbaumer
+   Copyright (C) 2005 Lionel Debroux
+   Copyright (C) 2007 Kevin Kofler
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
+*/
+
+#include <stdint.h>
+extern int calc_type;
+extern unsigned char *ram;
+extern unsigned char *rom;
+extern unsigned char unused[0x10000];
+extern uint32_t rom_base;
+extern uint32_t rom_size;
+extern uint32_t ram_size;
+extern uint32_t entry_point;
+void PrintAddress (int32_t reladdr, uint32_t absaddr, int flags, void *stream,
+                   void (*fprintf_f) (void *, const char *, ...),
+                   void (*fputs_f) (const char *, void *));
+void Offset2Name(int addr);

+ 122 - 0
external/dasm-tigcc/mem.c

@@ -0,0 +1,122 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: RAM, PROM/FLASH, I/O ports and bkpts
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#include "main.h"
+#include "mem.h"
+#include "ti68k_def.h"
+#include "mem89.h"
+#include "mem92.h"
+#include "mem92p.h"
+#include "mem89tm.h"
+#include "memv2.h"
+
+// 000000-0fffff : RAM (128 or 256 KB)
+// 100000-1fffff : 
+// 200000-2fffff : internal ROM (TI92, TI89, V200) or unused
+// 300000-3fffff : idem
+// 400000-4fffff : external ROM (TI92, TI92-II, TI92+) or unused
+// 500000-5fffff : idem
+// 600000-6fffff : memory mapped I/O (all HW)
+// 700000-7fffff : memory mapped I/O (HW2, HW3)
+// 800000-8fffff : ROM (TI89 Titanium) or unused
+// 900000-9fffff : idem
+// a00000-afffff : idem
+// b00000-bfffff : idem
+// c00000-cfffff : unused
+// d00000-dfffff :	 ...
+// e00000-efffff :   ...
+// d00000-ffffff : unused
+
+static GETBYTE_FUNC	get_byte_ptr;	// set on memXX.c or hwprot.c
+static GETWORD_FUNC	get_word_ptr;
+static GETLONG_FUNC	get_long_ptr;
+
+GETBYTE_FUNC	mem_get_byte_ptr;	// set by memXX.c:tiXX_mem_init
+GETWORD_FUNC	mem_get_word_ptr;
+GETLONG_FUNC	mem_get_long_ptr;
+
+REALADR_FUNC	mem_get_real_addr_ptr;
+
+/* Mem init/exit */
+
+int hw_mem_init(void)
+{
+    // set banks and mappers on per calc basis
+    switch(calc_type)
+    {
+    case TI92:  ti92_mem_init();  break;
+    case TI92p: ti92p_mem_init(); break;
+    case TI89:  ti89_mem_init();  break;
+    case V200:  v200_mem_init();  break;
+    case TI89t: ti89t_mem_init(); break;
+    default: break;
+    }
+
+		get_byte_ptr = mem_get_byte_ptr;
+		get_word_ptr = mem_get_word_ptr;
+		get_long_ptr = mem_get_long_ptr;
+
+    return 0;
+}
+
+uint8_t* hw_get_real_address(uint32_t adr)
+{
+	return mem_get_real_addr_ptr(adr);
+}
+
+uint32_t hw_get_long(uint32_t adr) 
+{
+    adr &= 0xFFFFFF;
+	return get_long_ptr(adr);
+}
+
+uint16_t hw_get_word(uint32_t adr) 
+{
+    adr &= 0xFFFFFF;
+	return get_word_ptr(adr);
+}
+
+uint8_t hw_get_byte(uint32_t adr) 
+{
+    adr &= 0xFFFFFF;
+	return get_byte_ptr(adr);
+}
+
+uint8_t hw_get_byte_noexcept(uint32_t adr) 
+{
+    adr &= 0xFFFFFF;
+	return get_byte_ptr(adr);
+}

+ 70 - 0
external/dasm-tigcc/mem.h

@@ -0,0 +1,70 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEMORY__
+#define __TI68K_MEMORY__
+
+#include "stdint.h"
+
+/* Typedefs */
+
+typedef uint8_t  (*GETBYTE_FUNC) (uint32_t);
+typedef uint16_t (*GETWORD_FUNC) (uint32_t);
+typedef uint32_t (*GETLONG_FUNC) (uint32_t);
+
+typedef uint8_t* (*REALADR_FUNC) (uint32_t addr);
+
+extern GETBYTE_FUNC	mem_get_byte_ptr;
+extern GETWORD_FUNC	mem_get_word_ptr;
+extern GETLONG_FUNC	mem_get_long_ptr;
+
+extern REALADR_FUNC mem_get_real_addr_ptr;
+
+/* Functions */
+
+int hw_mem_init(void);
+
+// defs similar to UAE's memory.h (interface)
+extern uint8_t  hw_get_byte_noexcept(uint32_t addr);
+extern uint8_t  hw_get_byte(uint32_t addr);
+extern uint16_t hw_get_word(uint32_t addr);
+extern uint32_t hw_get_long(uint32_t addr);
+
+extern uint8_t* hw_get_real_address(uint32_t addr);
+
+/* Useful macros for memory access */
+
+#define IN_BOUNDS(a,v,b)	(((v) >= (a)) && ((v) <= (b)))
+#define IN_RANGE(v,b,r)		(((v) >= (b)) && ((v) <= ((b) + ((r)-1))))
+
+#define get_b(ptr,adr,mask)	(ptr[(adr) & (mask)])
+#define get_w(ptr,adr,mask)	((uint16_t) ((get_b(ptr,adr,mask) <<  8) | get_b(ptr,(adr)+1,mask)))
+#define get_l(ptr,adr,mask)	((uint32_t)	((get_w(ptr,adr,mask) << 16) | get_w(ptr,(adr)+2,mask)))
+
+#define get_p(ptr,adr,mask)  ((ptr) + ((adr) & (mask)))
+
+#endif

+ 137 - 0
external/dasm-tigcc/mem89.c

@@ -0,0 +1,137 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem89.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: TI89 FLASH without Hardware Protection.
+	Some values may be hard-coded for performance reasons !
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mem.h"
+#include "mem89.h"
+#include "ti68k_def.h"
+#include "mem_size.h"
+#include "main.h"
+
+// 000000-0fffff : RAM (256 KB)
+// 100000-1fffff : ghost of RAM
+// 200000-2fffff : internal FLASH (TI89/V200)
+// 300000-3fffff : 
+// 400000-4fffff : internal FLASH (V200) or nothing (TI89)
+// 500000-5fffff : 
+// 600000-6fffff : memory mapped I/O (all HW)
+// 700000-7fffff : memory mapped I/O (HW2, HW3)
+// 800000-8fffff : unused
+// 900000-9fffff :	 ... 
+// a00000-afffff : 
+// b00000-bfffff : 
+// c00000-cfffff : 
+// d00000-dfffff :
+// e00000-efffff :   ...
+// d00000-ffffff : unused
+
+int ti89_mem_init(void)
+{
+	// set mappers
+	mem_get_byte_ptr = ti89_get_byte;
+	mem_get_word_ptr = ti89_get_word;
+	mem_get_long_ptr = ti89_get_long;
+
+	mem_get_real_addr_ptr = ti89_get_real_addr;
+
+    return 0;
+}
+
+uint8_t* ti89_get_real_addr(uint32_t adr)
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_p(ram, adr, RAM_SIZE_TI89 - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_p(rom, adr, ROM_SIZE_TI89 - 1);
+	}
+
+	return unused;
+}
+
+uint32_t ti89_get_long(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_l(ram, adr, RAM_SIZE_TI89 - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_l(rom, adr, ROM_SIZE_TI89 - 1);
+	}
+
+    return 0x14141414;
+}
+
+uint16_t ti89_get_word(uint32_t adr) 
+{
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_w(ram, adr, RAM_SIZE_TI89 - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_w(rom, adr, ROM_SIZE_TI89 - 1);
+	}
+
+    return 0x1414;
+}
+
+uint8_t ti89_get_byte(uint32_t adr) 
+{    
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_b(ram, adr, RAM_SIZE_TI89 - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_b(rom, adr, ROM_SIZE_TI89 - 1);
+	}
+	
+
+    return 0x14;
+}

+ 43 - 0
external/dasm-tigcc/mem89.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEM89__
+#define __TI68K_MEM89__
+
+#include <stdint.h>
+
+/* Functions */
+
+int ti89_mem_init(void);
+
+uint8_t  ti89_get_byte(uint32_t addr);
+uint16_t ti89_get_word(uint32_t addr);
+uint32_t ti89_get_long(uint32_t addr);
+
+uint8_t* ti89_get_real_addr(uint32_t addr);
+
+#endif

+ 146 - 0
external/dasm-tigcc/mem89tm.c

@@ -0,0 +1,146 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem89tm.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: TI89 Titanium without any HW protection
+	Some values may be hard-coded for performance reasons !
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mem.h"
+#include "mem89tm.h"
+#include "ti68k_def.h"
+#include "mem_size.h"
+#include "main.h"
+
+// 000000-03ffff : RAM (256 KB), not mirrored
+// 100000-1fffff : unused
+// 200000-2fffff : image of 0x000000 (ghost, not mirrored)
+// 300000-3fffff : unused
+// 400000-4fffff : image of 0x000000 (ghost, not mirrored)
+// 500000-5fffff : unused
+// 600000-6fffff : memory mapped I/O (all HW)
+// 700000-7fffff : memory mapped I/O (HW2, HW3), non ghost'ed
+// 800000-8fffff : ROM (TI89 Titanium)
+// 900000-9fffff : idem
+// a00000-afffff : idem
+// b00000-bfffff : idem
+// c00000-cfffff : unused
+// d00000-dfffff :	 ...
+// e00000-efffff :   ...
+// d00000-ffffff : unused
+
+int ti89t_mem_init(void)
+{
+	// set mappers
+	mem_get_byte_ptr = ti89t_get_byte;
+	mem_get_word_ptr = ti89t_get_word;
+	mem_get_long_ptr = ti89t_get_long;
+
+	mem_get_real_addr_ptr = ti89t_get_real_addr;
+
+    return 0;
+}
+
+uint8_t* ti89t_get_real_addr(uint32_t adr)
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x03ffff) ||
+	   IN_BOUNDS(0x200000, adr, 0x23ffff) ||
+	   IN_BOUNDS(0x400000, adr, 0x43ffff))
+	{
+		return get_p(ram, adr, 0x03ffff);
+	}
+
+	// FLASH access
+    else if(IN_BOUNDS(0x800000, adr, 0xbfffff))			
+	{
+		return get_p(rom, adr, ROM_SIZE_TI89T - 1);
+	}
+
+	return unused;
+}
+
+uint32_t ti89t_get_long(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x03ffff) ||
+	   IN_BOUNDS(0x200000, adr, 0x23ffff) ||
+	   IN_BOUNDS(0x400000, adr, 0x43ffff))
+	{
+		return get_l(ram, adr, 0x03ffff);
+	}
+
+	// FLASH access
+    else if(IN_BOUNDS(0x800000, adr, 0xbfffff))			
+	{
+		return get_l(rom, adr, ROM_SIZE_TI89T - 1);
+	}
+
+    return 0x14141414;
+}
+
+uint16_t ti89t_get_word(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x03ffff) ||
+	   IN_BOUNDS(0x200000, adr, 0x23ffff) ||
+	   IN_BOUNDS(0x400000, adr, 0x43ffff))
+	{
+		return get_w(ram, adr, 0x03ffff);
+	}
+
+	// FLASH access
+    else if(IN_BOUNDS(0x800000, adr, 0xbfffff))			
+	{
+		return get_w(rom, adr, ROM_SIZE_TI89T - 1);
+	}
+
+    return 0x1414;
+}
+
+uint8_t ti89t_get_byte(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x03ffff) ||
+	   IN_BOUNDS(0x200000, adr, 0x23ffff) ||
+	   IN_BOUNDS(0x400000, adr, 0x43ffff))
+	{
+		return get_b(ram, adr, 0x03ffff);
+	}
+
+	// FLASH access
+    else if(IN_BOUNDS(0x800000, adr, 0xbfffff))			
+	{
+		return get_b(rom, adr, ROM_SIZE_TI89T - 1);
+	}
+
+    return 0x14;
+}

+ 43 - 0
external/dasm-tigcc/mem89tm.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEM89T__
+#define __TI68K_MEM89T__
+
+#include <stdint.h>
+
+/* Functions */
+
+int ti89t_mem_init(void);
+
+uint8_t  ti89t_get_byte(uint32_t addr);
+uint16_t ti89t_get_word(uint32_t addr);
+uint32_t ti89t_get_long(uint32_t addr);
+
+uint8_t* ti89t_get_real_addr(uint32_t addr);
+
+#endif

+ 127 - 0
external/dasm-tigcc/mem92.c

@@ -0,0 +1,127 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem92.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: TI92 ROM v1.x & v2.x
+	Some values may be hard-coded for performance reasons !
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mem.h"
+#include "mem92.h"
+#include "ti68k_def.h"
+#include "mem_size.h"
+#include "main.h"
+
+// 000000-1fffff : RAM (128 or 256 KB)
+// 200000-3fffff : internal ROM (TI92 1.x) or unused
+// 400000-5fffff : external ROM (TI92 2.x) or unused
+// 600000-6fffff : memory mapped I/O
+// 700000-ffffff : unused
+
+int ti92_mem_init(void)
+{
+	// set mappers
+	mem_get_byte_ptr = ti92_get_byte;
+	mem_get_word_ptr = ti92_get_word;
+	mem_get_long_ptr = ti92_get_long;
+
+	mem_get_real_addr_ptr = ti92_get_real_addr;
+
+    return 0;
+}
+
+uint8_t* ti92_get_real_addr(uint32_t adr)
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_p(ram, adr, ram_size - 1);
+	}
+
+    // PROM access
+	else if(IN_RANGE(adr, rom_base, 2*MB))
+	{
+		return get_p(rom, adr, rom_size - 1);
+	}
+
+    return unused;
+}
+
+uint32_t ti92_get_long(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_l(ram, adr, ram_size - 1);
+	}
+
+    // PROM access
+	else if(IN_RANGE(adr, rom_base, 2*MB))
+	{
+		return get_l(rom, adr, rom_size - 1);
+	}
+
+    return 0x14141414;
+}
+
+uint16_t ti92_get_word(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_w(ram, adr, ram_size - 1);
+	}
+
+    // PROM access
+	else if(IN_RANGE(adr, rom_base, 2*MB))
+	{
+		return get_w(rom, adr, rom_size - 1);
+	}
+
+    return 0x1414;
+}
+
+uint8_t ti92_get_byte(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_b(ram, adr, ram_size - 1);
+	}
+
+    // PROM access
+	else if(IN_RANGE(adr, rom_base, 2*MB))
+	{
+		return get_b(rom, adr, rom_size - 1);
+	}
+
+    return 0x14;
+}

+ 43 - 0
external/dasm-tigcc/mem92.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEM92__
+#define __TI68K_MEM92__
+
+#include <stdint.h>
+
+/* Functions */
+
+int ti92_mem_init(void);
+
+uint8_t  ti92_get_byte(uint32_t addr);
+uint16_t ti92_get_word(uint32_t addr);
+uint32_t ti92_get_long(uint32_t addr);
+
+uint8_t* ti92_get_real_addr(uint32_t addr);
+
+#endif

+ 138 - 0
external/dasm-tigcc/mem92p.c

@@ -0,0 +1,138 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem92p.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: TI92+ FLASH without Hardware Protection
+	Some values may be hard-coded for performance reasons !
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mem.h"
+#include "mem92p.h"
+#include "ti68k_def.h"
+#include "mem_size.h"
+#include "main.h"
+
+// 000000-0fffff : RAM (256 KB)
+// 100000-1fffff : ghost of RAM
+// 200000-2fffff : ghost of FLASH (HW2)
+// 300000-3fffff : unused
+// 400000-4fffff : external FLASH
+// 500000-5fffff : idem
+// 600000-6fffff : memory mapped I/O (all HW)
+// 700000-7fffff : memory mapped I/O (HW2)
+// 800000-8fffff : unused
+// 900000-9fffff :	 ... 
+// a00000-afffff : 
+// b00000-bfffff : 
+// c00000-cfffff : 
+// d00000-dfffff :
+// e00000-efffff :   ...
+// d00000-ffffff : unused
+
+int ti92p_mem_init(void)
+{
+	// set mappers
+	mem_get_byte_ptr = ti92p_get_byte;
+	mem_get_word_ptr = ti92p_get_word;
+	mem_get_long_ptr = ti92p_get_long;
+
+	mem_get_real_addr_ptr = ti92p_get_real_addr;
+  
+    return 0;
+}
+
+uint8_t* ti92p_get_real_addr(uint32_t adr)
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_p(ram, adr, RAM_SIZE_TI92P - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_p(rom, adr, ROM_SIZE_TI92P - 1);
+	}
+	
+	return unused;
+}
+
+uint32_t ti92p_get_long(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_l(ram, adr, RAM_SIZE_TI92P - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_l(rom, adr, ROM_SIZE_TI92P - 1);
+	}
+	
+    return 0x14141414;
+}
+
+uint16_t ti92p_get_word(uint32_t adr) 
+{
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_w(ram, adr, RAM_SIZE_TI92P - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_w(rom, adr, ROM_SIZE_TI92P - 1);
+	}
+	
+    return 0x1414;
+}
+
+uint8_t ti92p_get_byte(uint32_t adr) 
+{    
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_b(ram, adr, RAM_SIZE_TI92P - 1);
+	}
+
+    // FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_b(rom, adr, ROM_SIZE_TI92P - 1);
+	}
+	
+    return 0x14;
+}

+ 43 - 0
external/dasm-tigcc/mem92p.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEM92p__
+#define __TI68K_MEM92p__
+
+#include <stdint.h>
+
+/* Functions */
+
+int ti92p_mem_init(void);
+
+uint8_t  ti92p_get_byte(uint32_t addr);
+uint16_t ti92p_get_word(uint32_t addr);
+uint32_t ti92p_get_long(uint32_t addr);
+
+uint8_t* ti92p_get_real_addr(uint32_t addr);
+
+#endif

+ 77 - 0
external/dasm-tigcc/mem_size.h

@@ -0,0 +1,77 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: mem_size.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2002, Romain Lievin, Julien Blache
+ *  Copyright (c) 2003-2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __TI68K_MEMSIZE__
+#define __TI68K_MEMSIZE__
+
+/*
+	Size of some common memory devices.
+	0 means not supported & used by the hand-held.
+*/
+
+#define RAM_SIZE_TI92_I		(128*KB)
+#define RAM_SIZE_TI92_II	(256*KB)
+#define RAM_SIZE_TI89		(256*KB)
+#define RAM_SIZE_TI92P		(256*KB)
+#define RAM_SIZE_V200		(256*KB)
+#define RAM_SIZE_TI89T		(256*KB)
+
+#define ROM_SIZE_TI92_I		(1*MB)
+#define ROM_SIZE_TI92_II	(2*MB)
+#define ROM_SIZE_TI89		(2*MB)
+#define ROM_SIZE_TI92P		(2*MB)
+#define ROM_SIZE_V200		(4*MB)
+#define ROM_SIZE_TI89T		(4*MB)
+
+#define ROM_BASE_TI92_I		(0)	// 0x200000 or 0x400000
+#define ROM_BASE_TI92_II	0x400000
+#define ROM_BASE_TI89		0x200000
+#define ROM_BASE_TI92P		0x400000
+#define ROM_BASE_V200		0x200000
+#define ROM_BASE_TI89T		0x800000
+
+#define IO1_SIZE_TI92_I		32
+#define IO1_SIZE_TI92_II	32
+#define IO1_SIZE_TI89		32
+#define IO1_SIZE_TI92P		32
+#define IO1_SIZE_V200		32
+#define IO1_SIZE_TI89T		32
+
+#define IO2_SIZE_TI92_I		0
+#define IO2_SIZE_TI92_II	0
+#define IO2_SIZE_TI89		32
+#define IO2_SIZE_TI92P		32
+#define IO2_SIZE_V200		32
+#define IO2_SIZE_TI89T		256	// seems to be 128 instead of 64 ?!
+
+#define IO3_SIZE_TI92_I		0
+#define IO3_SIZE_TI92_II	0
+#define IO3_SIZE_TI89		0
+#define IO3_SIZE_TI92P		0
+#define IO3_SIZE_V200		0
+#define IO3_SIZE_TI89T		256
+
+#endif

+ 138 - 0
external/dasm-tigcc/memv2.c

@@ -0,0 +1,138 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: memv2.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory management: V200 FLASH without Hardware Protection
+	Some values may be hard-coded for performance reasons !
+*/
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "mem.h"
+#include "memv2.h"
+#include "ti68k_def.h"
+#include "mem_size.h"
+#include "main.h"
+
+// 000000-0fffff : RAM (256 KB)
+// 100000-1fffff : ghost of RAM
+// 200000-2fffff : internal FLASH (v200/V200)
+// 300000-3fffff : 
+// 400000-4fffff : internal FLASH (V200) or nothing (v200)
+// 500000-5fffff : 
+// 600000-6fffff : memory mapped I/O (all HW)
+// 700000-7fffff : memory mapped I/O (HW2, HW3)
+// 800000-8fffff : unused
+// 900000-9fffff :	 ... 
+// a00000-afffff : 
+// b00000-bfffff : 
+// c00000-cfffff : 
+// d00000-dfffff :
+// e00000-efffff :   ...
+// d00000-ffffff : unused
+
+int v200_mem_init(void)
+{
+	// set mappers
+	mem_get_byte_ptr = v200_get_byte;
+	mem_get_word_ptr = v200_get_word;
+	mem_get_long_ptr = v200_get_long;
+
+	mem_get_real_addr_ptr = v200_get_real_addr;
+
+    return 0;
+}
+
+uint8_t* v200_get_real_addr(uint32_t adr)
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_p(ram, adr, RAM_SIZE_V200 - 1);
+	}
+
+	// FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_p(rom, adr-0x200000, ROM_SIZE_V200 - 1);
+	}
+
+	return unused;
+}
+
+uint32_t v200_get_long(uint32_t adr) 
+{
+	// RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_l(ram, adr, RAM_SIZE_V200 - 1);
+	}
+
+	// FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_l(rom, adr-0x200000, ROM_SIZE_V200 - 1);
+	}
+
+    return 0x14141414;
+}
+
+uint16_t v200_get_word(uint32_t adr) 
+{
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_w(ram, adr, RAM_SIZE_V200 - 1);
+	}
+
+	// FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_w(rom, adr-0x200000, ROM_SIZE_V200 - 1);
+	}
+
+    return 0x1414;
+}
+
+uint8_t v200_get_byte(uint32_t adr) 
+{    
+    // RAM access
+	if(IN_BOUNDS(0x000000, adr, 0x1fffff))
+	{
+		return get_b(ram, adr, RAM_SIZE_V200 - 1);
+	}
+
+	// FLASH access
+	else if(IN_BOUNDS(0x200000, adr, 0x5fffff))
+	{
+		return get_b(rom, adr-0x200000, ROM_SIZE_V200 - 1);
+	}
+
+    return 0x14;
+}

+ 43 - 0
external/dasm-tigcc/memv2.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: main.c 245 2004-05-23 20:45:43Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_MEMv2__
+#define __TI68K_MEMv2__
+
+#include <stdint.h>
+
+/* Functions */
+
+int v200_mem_init(void);
+
+uint8_t  v200_get_byte(uint32_t addr);
+uint16_t v200_get_word(uint32_t addr);
+uint32_t v200_get_long(uint32_t addr);
+
+uint8_t* v200_get_real_addr(uint32_t addr);
+
+#endif

+ 42 - 0
external/dasm-tigcc/opintl.h

@@ -0,0 +1,42 @@
+/* opintl.h - opcodes specific header for gettext code.
+   Copyright 1998, 1999, 2000 Free Software Foundation, Inc.
+
+   Written by Tom Tromey <tromey@cygnus.com>
+
+   This file is part of the opcodes library used by GAS and the GNU binutils.
+
+   You should have received a copy of the GNU General Public License
+   along with GAS; see the file COPYING.  If not, write to the Free
+   Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
+   02110-1301, USA. */
+
+#ifdef ENABLE_NLS
+# include <libintl.h>
+/* Note the use of dgetext() and PACKAGE here, rather than gettext().
+   
+   This is because the code in this directory is used to build a library which
+   will be linked with code in other directories to form programs.  We want to
+   maintain a seperate translation file for this directory however, rather
+   than being forced to merge it with that of any program linked to
+   libopcodes.  This is a library, so it cannot depend on the catalog
+   currently loaded.
+
+   In order to do this, we have to make sure that when we extract messages we
+   use the OPCODES domain rather than the domain of the program that included
+   the opcodes library, (eg OBJDUMP).  Hence we use dgettext (PACKAGE, String)
+   and define PACKAGE to be 'opcodes'.  (See the code in configure).  */
+# define _(String) dgettext (PACKAGE, String)
+# ifdef gettext_noop
+#  define N_(String) gettext_noop (String)
+# else
+#  define N_(String) (String)
+# endif
+#else
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define textdomain(Domainname) while (0) /* nothing */
+# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+# define _(String) (String)
+# define N_(String) (String)
+#endif

+ 167 - 0
external/dasm-tigcc/romcalls.c

@@ -0,0 +1,167 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: romcalls.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2006-2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Symbols (ROM calls address and names)
+*/
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "romcalls.h"
+#include "images.h"
+#include "ti68k_def.h"
+#include "timem.h"
+#include "main.h"
+
+static int loaded = 0;		// loaded
+static int addr_loaded = 0;	// addresses loaded
+
+static ROM_CALL table[NMAX_ROMCALLS] = {
+/* Generated from romcalls.txt by replacing:
+   ([^:]*):(.*)
+   with:
+   {0x\1,0,"\2"},
+   in Kate. */
+#include "romcalls.inc"
+};	// list by id
+static int size;
+
+
+/* =========== */
+
+/*
+	Retrieve base address of ROM calls table and size.
+*/
+void romcalls_get_table_infos(uint32_t *base, uint32_t *size)
+{
+	*base = *size = 0;
+
+	if(calc_type == TI92)
+		return;
+
+	*base = rd_long(&rom[0x12000 + 0x88 + 0xC8]);
+	*size = rd_long(&rom[((*base-4) & 0x0fffff)]);
+}
+
+/*
+	Given a ROM call ID, retrieve address of ROM call.
+*/
+void romcalls_get_symbol_address(int id, uint32_t *addr)
+{
+	uint32_t base;
+
+	base = rd_long(&rom[0x12000 + 0x88 + 0xC8]);
+	*addr = rd_long(&rom[(base & 0x0fffff) + 4*id]); 
+}
+
+/* =========== */
+
+/*
+	Fill the addr field from ROM calls located in FLASH. Don't touch other fields !
+	And construct list from ROM call table.
+*/
+static int merge_from_flash(void)
+{
+	uint32_t addr;
+	int i;
+
+	romcalls_get_table_infos(&addr, (uint32_t *)&size);
+	if(size == 0)
+		return -1;
+
+	for(i = 0; i < size; i++)
+	{
+		if(table[i].name == NULL)
+			table[i].name = strdup("unknown");
+
+		table[i].addr = rd_long(&rom[(addr & 0x0fffff) + (i << 2)]); 
+	}
+	
+	addr_loaded = 1;
+
+	return 0;
+}
+
+/*
+	Load ROM calls from file and FLASH and merge.
+	Return value:
+	 0 if successful
+	-1 if error
+	-3 if TI92
+*/
+int romcalls_load(int noflash)
+{
+	// check whether parsing is possible
+	if(calc_type == TI92) return -3;
+
+	if(!noflash && merge_from_flash())
+		return -1;
+
+	loaded = !0;
+
+    return 0;
+}
+
+int romcalls_is_loaded(void)
+{
+	return loaded;
+}
+
+/* =========== */
+
+// cache last search (disasm)
+static int last_id = 0;	
+
+// returns id or -1
+int romcalls_is_addr(uint32_t addr)
+{
+	int i;
+
+	if(!addr_loaded)	return -1;
+
+	for(i = 0; i < size; i++)
+	{
+		if(addr == table[i].addr)
+			return last_id = i;
+	}
+
+	return -1;
+}
+
+const char* romcalls_get_name(int id)
+{
+	if(!loaded)	return "not loaded";
+	return table[id].name;
+}
+
+uint32_t romcalls_get_addr(int id)
+{
+	return table[id].addr;
+}

+ 67 - 0
external/dasm-tigcc/romcalls.h

@@ -0,0 +1,67 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: romcalls.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+  Breakpoint definitions
+*/
+
+#ifndef __ROMCALLS__
+#define __ROMCALLS__
+
+#include <stdio.h>
+#include <stdint.h>
+
+#define NMAX_ROMCALLS	0x800
+
+/* Types */
+
+typedef struct
+{
+	int			id;
+    uint32_t    addr;
+    const char*       name;
+} ROM_CALL;
+
+/* Functions */
+
+void romcalls_get_table_infos(uint32_t *base, uint32_t *size);
+void romcalls_get_symbol_address(int id, uint32_t *addr);
+int romcalls_load(int noflash);
+int romcalls_is_loaded(void);
+
+int romcalls_is_addr(uint32_t addr);
+
+const char* romcalls_get_name(int id);
+uint32_t romcalls_get_addr(int id);
+
+const char* ercodes_get_name(unsigned id);
+
+#define ROMCALL_ID(elt)		(((ROM_CALL *)(elt->data))->id)
+#define ROMCALL_NAME(elt)	(((ROM_CALL *)(elt->data))->name)
+#define ROMCALL_ADDR(elt)	(((ROM_CALL *)(elt->data))->addr)
+
+#endif

+ 1558 - 0
external/dasm-tigcc/romcalls.inc

@@ -0,0 +1,1558 @@
+
+{0x0,0,"FirstWindow"},
+{0x1,0,"WinActivate"},
+{0x2,0,"WinAttr"},
+{0x3,0,"WinBackupToScr"},
+{0x4,0,"WinBackground"},
+{0x5,0,"WinBegin"},
+{0x6,0,"WinBitmapGet"},
+{0x7,0,"WinBitmapPut"},
+{0x8,0,"WinBitmapSize"},
+{0x9,0,"WinCharXY"},
+{0xA,0,"WinChar"},
+{0xB,0,"WinClose"},
+{0xC,0,"WinClr"},
+{0xD,0,"WinDeactivate"},
+{0xE,0,"WinDupStat"},
+{0xF,0,"WinEllipse"},
+{0x10,0,"WinFill"},
+{0x11,0,"WinFillLines2"},
+{0x12,0,"WinFillTriangle"},
+{0x13,0,"WinFont"},
+{0x14,0,"WinGetCursor"},
+{0x15,0,"WinHide"},
+{0x16,0,"WinHome"},
+{0x17,0,"WinLine"},
+{0x18,0,"WinLineNC"},
+{0x19,0,"WinLineTo"},
+{0x1A,0,"WinLineRel"},
+{0x1B,0,"WinMoveCursor"},
+{0x1C,0,"WinMoveTo"},
+{0x1D,0,"WinMoveRel"},
+{0x1E,0,"WinOpen"},
+{0x1F,0,"WinPixGet"},
+{0x20,0,"WinPixSet"},
+{0x21,0,"WinRect"},
+{0x22,0,"WinReOpen"},
+{0x23,0,"WinScrollH"},
+{0x24,0,"WinScrollV"},
+{0x25,0,"WinStr"},
+{0x26,0,"WinStrXY"},
+{0x27,0,"DrawWinBorder"},
+{0x28,0,"ScrRectDivide"},
+{0x29,0,"RectWinToWin"},
+{0x2A,0,"RectWinToScr"},
+{0x2B,0,"UpdateWindows"},
+{0x2C,0,"MakeWinRect"},
+{0x2D,0,"ScrToWin"},
+{0x2E,0,"ScrToHome"},
+{0x2F,0,"ScrRect"},
+{0x30,0,"Dialog"},
+{0x31,0,"NoCallBack / ROM_CALL_31"},
+{0x32,0,"DialogDo"},
+{0x33,0,"DialogAdd"},
+{0x34,0,"DialogNew"},
+{0x35,0,"DrawStaticButton"},
+{0x36,0,"MenuBegin"},
+{0x37,0,"MenuCheck"},
+{0x38,0,"MenuEnd"},
+{0x39,0,"MenuKey"},
+{0x3A,0,"MenuOn"},
+{0x3B,0,"MenuPopup"},
+{0x3C,0,"MenuSubStat"},
+{0x3D,0,"MenuTopStat"},
+{0x3E,0,"MenuTopSelect"},
+{0x3F,0,"MenuTopRedef"},
+{0x40,0,"MenuGetTopRedef"},
+{0x41,0,"MenuAddText"},
+{0x42,0,"MenuAddIcon"},
+{0x43,0,"MenuNew"},
+{0x44,0,"PopupAddText"},
+{0x45,0,"PopupNew"},
+{0x46,0,"PopupClear"},
+{0x47,0,"PopupDo"},
+{0x48,0,"PopupText"},
+{0x49,0,"MenuUpdate"},
+{0x4A,0,"Parse2DExpr"},
+{0x4B,0,"Parse2DMultiExpr"},
+{0x4C,0,"Print2DExpr"},
+{0x4D,0,"Parms2D"},
+{0x4E,0,"display_statements"},
+{0x4F,0,"Parse1DExpr"},
+{0x50,0,"pushkey"},
+{0x51,0,"ngetchx"},
+{0x52,0,"kbhit"},
+{0x53,0,"sprintf"},
+{0x54,0,"getcalc"},
+{0x55,0,"sendcalc"},
+{0x56,0,"LIO_Send"},
+{0x57,0,"LIO_Get"},
+{0x58,0,"LIO_Receive"},
+{0x59,0,"LIO_GetMultiple"},
+{0x5A,0,"LIO_SendData"},
+{0x5B,0,"LIO_RecvData"},
+{0x5C,0,"SymAdd"},
+{0x5D,0,"SymAddMain"},
+{0x5E,0,"SymDel"},
+{0x5F,0,"HSymDel"},
+{0x60,0,"SymFind"},
+{0x61,0,"SymFindMain"},
+{0x62,0,"SymFindHome"},
+{0x63,0,"SymMove"},
+{0x64,0,"FolderAdd"},
+{0x65,0,"FolderCur"},
+{0x66,0,"FolderDel"},
+{0x67,0,"FolderFind"},
+{0x68,0,"FolderGetCur"},
+{0x69,0,"FolderOp"},
+{0x6A,0,"FolderRename"},
+{0x6B,0,"FolderCount"},
+{0x6C,0,"SymFindFirst"},
+{0x6D,0,"SymFindNext"},
+{0x6E,0,"SymFindPrev"},
+{0x6F,0,"SymFindFoldername"},
+{0x70,0,"AddSymToFolder"},
+{0x71,0,"FindSymInFolder"},
+{0x72,0,"FolderCurTemp"},
+{0x73,0,"FolderAddTemp"},
+{0x74,0,"FolderDelTemp"},
+{0x75,0,"FolderDelAllTemp"},
+{0x76,0,"TempFolderName"},
+{0x77,0,"IsMainFolderStr"},
+{0x78,0,"ParseSymName"},
+{0x79,0,"DerefSym"},
+{0x7A,0,"HSYMtoName"},
+{0x7B,0,"StrToTokN"},
+{0x7C,0,"TokToStrN"},
+{0x7D,0,"CheckGraphRef"},
+{0x7E,0,"ClearUserDef"},
+{0x7F,0,"CheckLinkLockFlag"},
+{0x80,0,"TokenizeSymName"},
+{0x81,0,"SymCmp"},
+{0x82,0,"SymCpy"},
+{0x83,0,"SymCpy0"},
+{0x84,0,"ValidateSymName"},
+{0x85,0,"VarRecall"},
+{0x86,0,"VarStore"},
+{0x87,0,"VarStoreLink"},
+{0x88,0,"QSysProtected"},
+{0x89,0,"CheckSysFunc"},
+{0x8A,0,"GetSysGraphRef"},
+{0x8B,0,"CheckReservedName"},
+{0x8C,0,"SymSysVar"},
+{0x8D,0,"ValidateStore"},
+{0x8E,0,"ResetSymFlags"},
+{0x8F,0,"HeapAvail"},
+{0x90,0,"HeapAlloc"},
+{0x91,0,"HeapAllocESTACK"},
+{0x92,0,"HeapAllocHigh"},
+{0x93,0,"HeapAllocThrow"},
+{0x94,0,"HeapAllocHighThrow"},
+{0x95,0,"HeapCompress"},
+{0x96,0,"HeapDeref"},
+{0x97,0,"HeapFree"},
+{0x98,0,"HeapFreeIndir"},
+{0x99,0,"HLock"},
+{0x9A,0,"HeapLock"},
+{0x9B,0,"HeapGetLock"},
+{0x9C,0,"HeapMax"},
+{0x9D,0,"HeapRealloc"},
+{0x9E,0,"HeapSize"},
+{0x9F,0,"HeapUnlock"},
+{0xA0,0,"HeapMoveHigh"},
+{0xA1,0,"HeapEnd"},
+{0xA2,0,"HeapAllocPtr"},
+{0xA3,0,"HeapFreePtr"},
+{0xA4,0,"NeedStack"},
+{0xA5,0,"TE_close"},
+{0xA6,0,"TE_checkSlack"},
+{0xA7,0,"TE_empty"},
+{0xA8,0,"TE_focus"},
+{0xA9,0,"TE_handleEvent"},
+{0xAA,0,"TE_indicateReadOnly"},
+{0xAB,0,"TE_isBlank"},
+{0xAC,0,"TE_open"},
+{0xAD,0,"TE_openFixed"},
+{0xAE,0,"TE_pasteText"},
+{0xAF,0,"TE_reopen"},
+{0xB0,0,"TE_reopenPlain"},
+{0xB1,0,"TE_select"},
+{0xB2,0,"TE_shrinkWrap"},
+{0xB3,0,"TE_unfocus"},
+{0xB4,0,"TE_updateCommand"},
+{0xB5,0,"_bcd_math"},
+{0xB6,0,"bcdadd"},
+{0xB7,0,"bcdsub"},
+{0xB8,0,"bcdmul"},
+{0xB9,0,"bcddiv"},
+{0xBA,0,"bcdneg"},
+{0xBB,0,"bcdcmp"},
+{0xBC,0,"bcdlong"},
+{0xBD,0,"bcdbcd"},
+{0xBE,0,"EX_getArg"},
+{0xBF,0,"EX_getBCD"},
+{0xC0,0,"EX_stoBCD"},
+{0xC1,0,"CB_replaceTEXT"},
+{0xC2,0,"CB_fetchTEXT"},
+{0xC3,0,"CU_restore"},
+{0xC4,0,"CU_start"},
+{0xC5,0,"CU_stop"},
+{0xC6,0,"EV_captureEvents"},
+{0xC7,0,"EV_clearPasteString"},
+{0xC8,0,"EV_getc"},
+{0xC9,0,"EV_getSplitRect"},
+{0xCA,0,"EV_notifySwitchGraph"},
+{0xCB,0,"EV_paintOneWindow"},
+{0xCC,0,"EV_paintWindows"},
+{0xCD,0,"EV_restorePainting"},
+{0xCE,0,"EV_sendEvent"},
+{0xCF,0,"EV_sendEventSide"},
+{0xD0,0,"EV_sendString"},
+{0xD1,0,"EV_setCmdCheck"},
+{0xD2,0,"EV_setCmdState"},
+{0xD3,0,"EV_setFKeyState"},
+{0xD4,0,"EV_startApp"},
+{0xD5,0,"EV_startSide"},
+{0xD6,0,"EV_startTask"},
+{0xD7,0,"EV_suspendPainting"},
+{0xD8,0,"EV_switch"},
+{0xD9,0,"MO_currentOptions"},
+{0xDA,0,"MO_defaults"},
+{0xDB,0,"MO_digestOptions"},
+{0xDC,0,"MO_isMultigraphTask"},
+{0xDD,0,"MO_modeDialog"},
+{0xDE,0,"MO_notifyModeChange"},
+{0xDF,0,"MO_sendQuit"},
+{0xE0,0,"ST_angle"},
+{0xE1,0,"ST_batt"},
+{0xE2,0,"ST_busy"},
+{0xE3,0,"ST_eraseHelp"},
+{0xE4,0,"ST_folder"},
+{0xE5,0,"ST_graph"},
+{0xE6,0,"ST_helpMsg"},
+{0xE7,0,"ST_modKey"},
+{0xE8,0,"ST_precision"},
+{0xE9,0,"ST_readOnly"},
+{0xEA,0,"ST_stack"},
+{0xEB,0,"ST_refDsp"},
+{0xEC,0,"OSCheckBreak"},
+{0xED,0,"OSClearBreak"},
+{0xEE,0,"OSEnableBreak"},
+{0xEF,0,"OSDisableBreak"},
+{0xF0,0,"OSRegisterTimer"},
+{0xF1,0,"OSFreeTimer"},
+{0xF2,0,"OSTimerCurVal"},
+{0xF3,0,"OSTimerExpired"},
+{0xF4,0,"OSTimerRestart"},
+{0xF5,0,"acos"},
+{0xF6,0,"asin"},
+{0xF7,0,"atan"},
+{0xF8,0,"atan2"},
+{0xF9,0,"cos"},
+{0xFA,0,"sin"},
+{0xFB,0,"tan"},
+{0xFC,0,"cosh"},
+{0xFD,0,"sinh"},
+{0xFE,0,"tanh"},
+{0xFF,0,"exp"},
+{0x100,0,"log"},
+{0x101,0,"log10"},
+{0x102,0,"modf"},
+{0x103,0,"pow"},
+{0x104,0,"sqrt"},
+{0x105,0,"ceil"},
+{0x106,0,"fabs"},
+{0x107,0,"floor"},
+{0x108,0,"fmod"},
+{0x109,0,"top_estack"},
+{0x10A,0,"next_expression_index"},
+{0x10B,0,"gr_active"},
+{0x10C,0,"gr_other"},
+{0x10D,0,"ABT_dialog"},
+{0x10E,0,"HomeExecute"},
+{0x10F,0,"HomePushEStack"},
+{0x110,0,"SP_Define"},
+{0x111,0,"store_data_var"},
+{0x112,0,"recall_data_var"},
+{0x113,0,"CharNumber"},
+{0x114,0,"spike_optionD"},
+{0x115,0,"spike_geo_titles"},
+{0x116,0,"spike_in_editor"},
+{0x117,0,"dv_create_graph_titles"},
+{0x118,0,"spike_titles_in_editor"},
+{0x119,0,"dv_findColumn"},
+{0x11A,0,"spike_chk_gr_dirty"},
+{0x11B,0,"GetStatValue"},
+{0x11C,0,"partial_len"},
+{0x11D,0,"paint_all_except"},
+{0x11E,0,"EQU_select"},
+{0x11F,0,"EQU_setStyle"},
+{0x120,0,"EQU_getNameInfo"},
+{0x121,0,"checkCurrent"},
+{0x122,0,"BN_power17Mod"},
+{0x123,0,"BN_powerMod"},
+{0x124,0,"BN_prodMod"},
+{0x125,0,"CAT_dialog"},
+{0x126,0,"caddcert / ROM_CALL_126"},
+{0x127,0,"cdecrypt"},
+{0x128,0,"ceof"},
+{0x129,0,"cfindcertfield / handleVarLinkKey"},
+{0x12A,0,"cfindfield"},
+{0x12B,0,"cgetc"},
+{0x12C,0,"cgetcert / HeapWalk"},
+{0x12D,0,"cgetflen"},
+{0x12E,0,"cgetfnl"},
+{0x12F,0,"cgetnl"},
+{0x130,0,"cgetns"},
+{0x131,0,"cgetvernum / ROM_CALL_131"},
+{0x132,0,"copen"},
+{0x133,0,"copensub"},
+{0x134,0,"cputhdr"},
+{0x135,0,"cputnl"},
+{0x136,0,"cputns"},
+{0x137,0,"cread"},
+{0x138,0,"ctell"},
+{0x139,0,"cwrite"},
+{0x13A,0,"cacos"},
+{0x13B,0,"casin"},
+{0x13C,0,"catan"},
+{0x13D,0,"cacosh"},
+{0x13E,0,"casinh"},
+{0x13F,0,"catanh"},
+{0x140,0,"ccos"},
+{0x141,0,"csin"},
+{0x142,0,"ctan"},
+{0x143,0,"ccosh"},
+{0x144,0,"csinh"},
+{0x145,0,"ctanh"},
+{0x146,0,"csqrt"},
+{0x147,0,"cln"},
+{0x148,0,"clog10"},
+{0x149,0,"cexp"},
+{0x14A,0,"CustomBegin"},
+{0x14B,0,"CustomMenuItem"},
+{0x14C,0,"CustomEnd"},
+{0x14D,0,"ReallocExprStruct"},
+{0x14E,0,"SearchExprStruct"},
+{0x14F,0,"handleRclKey"},
+{0x150,0,"CustomFree"},
+{0x151,0,"ERD_dialog"},
+{0x152,0,"ERD_process"},
+{0x153,0,"ER_throwVar"},
+{0x154,0,"ER_catch"},
+{0x155,0,"ER_success"},
+{0x156,0,"EV_centralDispatcher"},
+{0x157,0,"EV_defaultHandler"},
+{0x158,0,"EV_eventLoop"},
+{0x159,0,"EV_registerMenu"},
+{0x15A,0,"EX_patch"},
+{0x15B,0,"EM_abandon"},
+{0x15C,0,"EM_blockErase / OSFastArrows"},
+{0x15D,0,"EM_blockVerifyErase"},
+{0x15E,0,"EM_delete / AB_getGateArrayVersion"},
+{0x15F,0,"EM_findEmptySlot"},
+{0x160,0,"EM_GC"},
+{0x161,0,"EM_moveSymFromExtMem"},
+{0x162,0,"EM_moveSymToExtMem"},
+{0x163,0,"EM_open / SetAlphaStatus"},
+{0x164,0,"EM_put / GetAlphaStatus"},
+{0x165,0,"EM_survey"},
+{0x166,0,"EM_twinSymFromExtMem"},
+{0x167,0,"EM_write"},
+{0x168,0,"EM_writeToExtMem / ROM_CALL_168"},
+{0x169,0,"FL_addCert"},
+{0x16A,0,"FL_download"},
+{0x16B,0,"FL_getHardwareParmBlock"},
+{0x16C,0,"FL_getCert"},
+{0x16D,0,"FL_getVerNum"},
+{0x16E,0,"EQU_deStatus"},
+{0x16F,0,"cmpstri"},
+{0x170,0,"fix_loop_displacements"},
+{0x171,0,"FL_write"},
+{0x172,0,"fpisanint"},
+{0x173,0,"fpisodd"},
+{0x174,0,"round12"},
+{0x175,0,"round14"},
+{0x176,0,"GD_Circle"},
+{0x177,0,"GD_Line"},
+{0x178,0,"GD_HVLine"},
+{0x179,0,"GD_Pen"},
+{0x17A,0,"GD_Eraser"},
+{0x17B,0,"GD_Text"},
+{0x17C,0,"GD_Select"},
+{0x17D,0,"GD_Contour"},
+{0x17E,0,"GKeyIn"},
+{0x17F,0,"GKeyDown"},
+{0x180,0,"GKeyFlush"},
+{0x181,0,"HelpKeys"},
+{0x182,0,"QModeKey"},
+{0x183,0,"QSysKey"},
+{0x184,0,"WordInList"},
+{0x185,0,"BitmapGet"},
+{0x186,0,"BitmapInit"},
+{0x187,0,"BitmapPut"},
+{0x188,0,"BitmapSize"},
+{0x189,0,"ScrRectFill"},
+{0x18A,0,"ScrRectOverlap"},
+{0x18B,0,"ScrRectScroll"},
+{0x18C,0,"ScrRectShift"},
+{0x18D,0,"QScrRectOverlap"},
+{0x18E,0,"FontGetSys"},
+{0x18F,0,"FontSetSys"},
+{0x190,0,"FontCharWidth"},
+{0x191,0,"DrawClipChar"},
+{0x192,0,"DrawClipEllipse"},
+{0x193,0,"DrawClipLine"},
+{0x194,0,"DrawClipPix"},
+{0x195,0,"DrawClipRect"},
+{0x196,0,"DrawMultiLines"},
+{0x197,0,"DrawStrWidth"},
+{0x198,0,"FillTriangle"},
+{0x199,0,"FillLines2"},
+{0x19A,0,"SetCurAttr"},
+{0x19B,0,"SetCurClip"},
+{0x19C,0,"LineTo"},
+{0x19D,0,"MoveTo"},
+{0x19E,0,"ScreenClear"},
+{0x19F,0,"GetPix"},
+{0x1A0,0,"SaveScrState"},
+{0x1A1,0,"RestoreScrState"},
+{0x1A2,0,"PortSet"},
+{0x1A3,0,"PortRestore"},
+{0x1A4,0,"DrawChar"},
+{0x1A5,0,"DrawFkey"},
+{0x1A6,0,"DrawIcon"},
+{0x1A7,0,"DrawLine"},
+{0x1A8,0,"DrawPix"},
+{0x1A9,0,"DrawStr"},
+{0x1AA,0,"GM_Value"},
+{0x1AB,0,"GM_Intersect"},
+{0x1AC,0,"GM_Integrate"},
+{0x1AD,0,"GM_Inflection"},
+{0x1AE,0,"GM_TanLine"},
+{0x1AF,0,"GM_Math1"},
+{0x1B0,0,"GM_Derivative"},
+{0x1B1,0,"GM_DistArc"},
+{0x1B2,0,"GM_Shade"},
+{0x1B3,0,"YCvtFtoWin"},
+{0x1B4,0,"DlgMessage"},
+{0x1B5,0,"SetGraphMode"},
+{0x1B6,0,"Regraph"},
+{0x1B7,0,"GrAxes"},
+{0x1B8,0,"gr_xres_pixel"},
+{0x1B9,0,"CptFuncX"},
+{0x1BA,0,"XCvtPtoF"},
+{0x1BB,0,"YCvtPtoF"},
+{0x1BC,0,"YCvtFtoP"},
+{0x1BD,0,"XCvtFtoP"},
+{0x1BE,0,"GrLineFlt"},
+{0x1BF,0,"FuncLineFlt"},
+{0x1C0,0,"GrClipLine"},
+{0x1C1,0,"CptDeltax"},
+{0x1C2,0,"CptDeltay"},
+{0x1C3,0,"CkValidDelta"},
+{0x1C4,0,"GR_Pan"},
+{0x1C5,0,"FindFunc"},
+{0x1C6,0,"FindGrFunc"},
+{0x1C7,0,"grFuncName"},
+{0x1C8,0,"gr_initCondName"},
+{0x1C9,0,"CptIndep"},
+{0x1CA,0,"gr_CptIndepInc"},
+{0x1CB,0,"gr_del_locals"},
+{0x1CC,0,"gr_DelFolder"},
+{0x1CD,0,"gr_openFolder"},
+{0x1CE,0,"setup_more_graph_fun"},
+{0x1CF,0,"unlock_more_graph_fun"},
+{0x1D0,0,"execute_graph_func"},
+{0x1D1,0,"cpt_gr_fun"},
+{0x1D2,0,"cpt_gr_param"},
+{0x1D3,0,"cpt_gr_polar"},
+{0x1D4,0,"gr_execute_seq"},
+{0x1D5,0,"CountGrFunc"},
+{0x1D6,0,"FirstSeqPlot"},
+{0x1D7,0,"cleanup_seq_mem"},
+{0x1D8,0,"time_loop"},
+{0x1D9,0,"InitTimeSeq"},
+{0x1DA,0,"seqWebInit"},
+{0x1DB,0,"run_one_seq"},
+{0x1DC,0,"gr_seq_value"},
+{0x1DD,0,"StepCk"},
+{0x1DE,0,"seqStepCk"},
+{0x1DF,0,"rngLen"},
+{0x1E0,0,"gdb_len"},
+{0x1E1,0,"gdb_store"},
+{0x1E2,0,"gdb_recall"},
+{0x1E3,0,"gr_DispLabels"},
+{0x1E4,0,"GraphOrTableCmd"},
+{0x1E5,0,"ck_valid_float"},
+{0x1E6,0,"CreateEmptyList"},
+{0x1E7,0,"QSkipGraphErr"},
+{0x1E8,0,"gr_find_de_result"},
+{0x1E9,0,"InitDEAxesRng"},
+{0x1EA,0,"InitDEMem"},
+{0x1EB,0,"de_loop"},
+{0x1EC,0,"cleanup_de_mem"},
+{0x1ED,0,"gr_de_value"},
+{0x1EE,0,"gr_find_func_index"},
+{0x1EF,0,"CptLastIndepDE"},
+{0x1F0,0,"de_initRes"},
+{0x1F1,0,"gr_del_vars_in_folder"},
+{0x1F2,0,"gr_de_axes_lbl"},
+{0x1F3,0,"gr_execute_de"},
+{0x1F4,0,"gr_delete_fldpic"},
+{0x1F5,0,"gr_remove_fldpic"},
+{0x1F6,0,"gr_add_fldpic"},
+{0x1F7,0,"gr_stopic"},
+{0x1F8,0,"gr_find_el"},
+{0x1F9,0,"deStepCk"},
+{0x1FA,0,"gr_ck_solvergraph"},
+{0x1FB,0,"GR3_addContours"},
+{0x1FC,0,"GraphActivate"},
+{0x1FD,0,"GR3_freeDB"},
+{0x1FE,0,"GR3_handleEvent"},
+{0x1FF,0,"GR3_paint3d"},
+{0x200,0,"GR3_xyToWindow"},
+{0x201,0,"GS_PlotTrace"},
+{0x202,0,"GS_PlotAll"},
+{0x203,0,"PlotDel"},
+{0x204,0,"PlotPut"},
+{0x205,0,"PlotGet"},
+{0x206,0,"PlotInit"},
+{0x207,0,"PlotDup"},
+{0x208,0,"PlotSize"},
+{0x209,0,"PlotLookup"},
+{0x20A,0,"QActivePlots"},
+{0x20B,0,"QPlotActive"},
+{0x20C,0,"GT_BackupToScr"},
+{0x20D,0,"GT_CalcDepVals"},
+{0x20E,0,"GT_CenterGraphCursor"},
+{0x20F,0,"GT_CursorKey"},
+{0x210,0,"GT_DspFreeTraceCoords"},
+{0x211,0,"GT_DspTraceCoords"},
+{0x212,0,"GT_DspMsg"},
+{0x213,0,"GT_Error"},
+{0x214,0,"GT_Format"},
+{0x215,0,"GT_FreeTrace"},
+{0x216,0,"GT_IncXY"},
+{0x217,0,"GT_KeyIn"},
+{0x218,0,"GT_QFloatCursorsInRange"},
+{0x219,0,"GT_Regraph"},
+{0x21A,0,"GT_Regraph_if_neccy"},
+{0x21B,0,"GT_Open"},
+{0x21C,0,"GT_SaveAs"},
+{0x21D,0,"GT_SelFunc"},
+{0x21E,0,"GT_SetGraphRange"},
+{0x21F,0,"GT_SetCursorXY"},
+{0x220,0,"GT_ShowMarkers"},
+{0x221,0,"GT_Trace"},
+{0x222,0,"GT_ValidGraphRanges"},
+{0x223,0,"GT_WinBound"},
+{0x224,0,"GT_WinCursor"},
+{0x225,0,"GYcoord"},
+{0x226,0,"GXcoord"},
+{0x227,0,"round12_err"},
+{0x228,0,"GT_Set_Graph_Format"},
+{0x229,0,"GT_PrintCursor"},
+{0x22A,0,"GT_DE_Init_Conds"},
+{0x22B,0,"GZ_Box"},
+{0x22C,0,"GZ_Center"},
+{0x22D,0,"GZ_Decimal"},
+{0x22E,0,"GZ_Fit"},
+{0x22F,0,"GZ_InOut"},
+{0x230,0,"GZ_Integer"},
+{0x231,0,"GZ_Previous"},
+{0x232,0,"GZ_Recall"},
+{0x233,0,"GZ_SetFactors"},
+{0x234,0,"GZ_Square"},
+{0x235,0,"GZ_Standard"},
+{0x236,0,"GZ_Stat"},
+{0x237,0,"GZ_Store"},
+{0x238,0,"GZ_Trig"},
+{0x239,0,"HeapGetHandle"},
+{0x23A,0,"HeapPtrToHandle"},
+{0x23B,0,"FreeHandles"},
+{0x23C,0,"HS_chopFIFO"},
+{0x23D,0,"HS_countFIFO"},
+{0x23E,0,"HS_deleteFIFONode"},
+{0x23F,0,"HS_freeAll"},
+{0x240,0,"HS_freeFIFONode"},
+{0x241,0,"HS_getAns"},
+{0x242,0,"HS_getEntry"},
+{0x243,0,"HS_getFIFONode"},
+{0x244,0,"HS_popEStack"},
+{0x245,0,"HS_newFIFONode"},
+{0x246,0,"HS_pushFIFONode"},
+{0x247,0,"HToESI"},
+{0x248,0,"OSInitKeyInitDelay"},
+{0x249,0,"OSInitBetweenKeyDelay"},
+{0x24A,0,"OSCheckSilentLink"},
+{0x24B,0,"OSLinkCmd"},
+{0x24C,0,"OSLinkReset"},
+{0x24D,0,"OSLinkOpen"},
+{0x24E,0,"OSLinkClose"},
+{0x24F,0,"OSReadLinkBlock"},
+{0x250,0,"OSWriteLinkBlock"},
+{0x251,0,"OSLinkTxQueueInquire"},
+{0x252,0,"OSLinkTxQueueActive"},
+{0x253,0,"LIO_SendProduct"},
+{0x254,0,"MD5Init"},
+{0x255,0,"MD5Update"},
+{0x256,0,"MD5Final"},
+{0x257,0,"MD5Done"},
+{0x258,0,"convert_to_TI_92"},
+{0x259,0,"gen_version"},
+{0x25A,0,"is_executable"},
+{0x25B,0,"NG_RPNToText"},
+{0x25C,0,"NG_approxESI"},
+{0x25D,0,"NG_execute"},
+{0x25E,0,"NG_graphESI"},
+{0x25F,0,"NG_rationalESI"},
+{0x260,0,"NG_tokenize"},
+{0x261,0,"NG_setup_graph_fun"},
+{0x262,0,"NG_cleanup_graph_fun"},
+{0x263,0,"push_END_TAG"},
+{0x264,0,"push_LIST_TAG"},
+{0x265,0,"tokenize_if_TI_92_or_text"},
+{0x266,0,"setjmp"},
+{0x267,0,"longjmp"},
+{0x268,0,"VarGraphRefBitsClear"},
+{0x269,0,"VarInit / is0"},
+{0x26A,0,"memcpy"},
+{0x26B,0,"memmove"},
+{0x26C,0,"strcpy"},
+{0x26D,0,"strncpy"},
+{0x26E,0,"strcat"},
+{0x26F,0,"strncat"},
+{0x270,0,"memcmp"},
+{0x271,0,"strcmp"},
+{0x272,0,"strncmp"},
+{0x273,0,"memchr"},
+{0x274,0,"strchr"},
+{0x275,0,"strcspn"},
+{0x276,0,"strpbrk"},
+{0x277,0,"strrchr"},
+{0x278,0,"strspn"},
+{0x279,0,"strstr"},
+{0x27A,0,"strtok"},
+{0x27B,0,"_memset"},
+{0x27C,0,"memset"},
+{0x27D,0,"strerror"},
+{0x27E,0,"strlen"},
+{0x27F,0,"SymAddTwin"},
+{0x280,0,"SymDelTwin"},
+{0x281,0,"LoadSymFromFindHandle"},
+{0x282,0,"MakeHSym"},
+{0x283,0,"SymFindPtr"},
+{0x284,0,"*OSVRegisterTimer*"},
+{0x285,0,"*OSVFreeTimer*"},
+{0x286,0,"sincos"},
+{0x287,0,"asinh"},
+{0x288,0,"acosh"},
+{0x289,0,"atanh"},
+{0x28A,0,"itrig"},
+{0x28B,0,"trig"},
+{0x28C,0,"VarOpen"},
+{0x28D,0,"VarSaveAs"},
+{0x28E,0,"VarNew"},
+{0x28F,0,"VarCreateFolderPopup"},
+{0x290,0,"VarSaveTitle"},
+{0x291,0,"WinWidth"},
+{0x292,0,"WinHeight"},
+{0x293,0,"XR_stringPtr"},
+{0x294,0,"OSReset"},
+{0x295,0,"SumStoChkMem"},
+{0x296,0,"OSContrastUp"},
+{0x297,0,"OSContrastDn"},
+{0x298,0,"OSKeyScan"},
+{0x299,0,"OSGetStatKeys"},
+{0x29A,0,"off"},
+{0x29B,0,"idle"},
+{0x29C,0,"OSSetSR"},
+{0x29D,0,"AB_prodid"},
+{0x29E,0,"AB_prodname"},
+{0x29F,0,"AB_serno"},
+{0x2A0,0,"cgetcertrevno"},
+{0x2A1,0,"cgetsn"},
+{0x2A2,0,"de_rng_no_graph"},
+{0x2A3,0,"EV_hook"},
+{0x2A4,0,"_ds16u16"},
+{0x2A5,0,"_ms16u16"},
+{0x2A6,0,"_du16u16"},
+{0x2A7,0,"_mu16u16"},
+{0x2A8,0,"_ds32s32"},
+{0x2A9,0,"_ms32s32"},
+{0x2AA,0,"_du32u32"},
+{0x2AB,0,"_mu32u32"},
+
+{0x2AC,0,"assign_between"},
+{0x2AD,0,"did_push_var_val"},
+{0x2AE,0,"does_push_fetch"},
+{0x2AF,0,"delete_list_element"},
+{0x2B0,0,"push_ans_entry"},
+{0x2B1,0,"index_after_match_endtag"},
+{0x2B2,0,"push_indir_name"},
+{0x2B3,0,"push_user_func"},
+{0x2B4,0,"store_func_def"},
+{0x2B5,0,"store_to_subscripted_element"},
+{0x2B6,0,"index_below_display_expression_aux"},
+{0x2B7,0,"get_key_ptr"},
+{0x2B8,0,"get_list_indices"},
+{0x2B9,0,"get_matrix_indices"},
+{0x2BA,0,"init_list_indices"},
+{0x2BB,0,"init_matrix_indices"},
+{0x2BC,0,"push_float_qr_fact"},
+{0x2BD,0,"push_lu_fact"},
+{0x2BE,0,"push_symbolic_qr_fact"},
+{0x2BF,0,"are_expressions_identical"},
+{0x2C0,0,"compare_expressions"},
+{0x2C1,0,"find_error_message"},
+{0x2C2,0,"check_estack_size"},
+{0x2C3,0,"delete_between"},
+{0x2C4,0,"deleted_between"},
+{0x2C5,0,"delete_expression"},
+{0x2C6,0,"deleted_expression"},
+{0x2C7,0,"estack_to_short"},
+{0x2C8,0,"estack_to_ushort"},
+{0x2C9,0,"factor_base_index"},
+{0x2CA,0,"factor_exponent_index"},
+{0x2CB,0,"GetValue"},
+{0x2CC,0,"im_index"},
+{0x2CD,0,"index_numeric_term"},
+{0x2CE,0,"index_of_lead_base_of_lead_term"},
+{0x2CF,0,"index_main_var"},
+{0x2D0,0,"is_advanced_tag"},
+{0x2D1,0,"is_antisymmetric"},
+{0x2D2,0,"is_complex_number"},
+{0x2D3,0,"is_complex0"},
+{0x2D4,0,"is_free_of_tag"},
+{0x2D5,0,"is_independent_of"},
+{0x2D6,0,"is_independent_of_de_seq_vars"},
+{0x2D7,0,"is_independent_of_tail"},
+{0x2D8,0,"is_independent_of_elements"},
+{0x2D9,0,"is_monomial"},
+{0x2DA,0,"is_monomial_in_kernel"},
+{0x2DB,0,"is_narrowly_independent_of"},
+{0x2DC,0,"is_symmetric"},
+{0x2DD,0,"is_tail_independent_of"},
+{0x2DE,0,"lead_base_index"},
+{0x2DF,0,"lead_exponent_index"},
+{0x2E0,0,"lead_factor_index"},
+{0x2E1,0,"lead_term_index"},
+{0x2E2,0,"main_gen_var_index"},
+{0x2E3,0,"map_unary_over_comparison"},
+{0x2E4,0,"min_quantum"},
+{0x2E5,0,"move_between_to_top"},
+{0x2E6,0,"moved_between_to_top"},
+{0x2E7,0,"numeric_factor_index"},
+{0x2E8,0,"push_between"},
+{0x2E9,0,"push_expr_quantum"},
+{0x2EA,0,"push_expr2_quantum"},
+{0x2EB,0,"push_next_arb_int"},
+{0x2EC,0,"push_next_arb_real"},
+{0x2ED,0,"push_next_internal_var"},
+{0x2EE,0,"push_quantum"},
+{0x2EF,0,"push_quantum_pair"},
+{0x2F0,0,"reductum_index"},
+{0x2F1,0,"remaining_factors_index"},
+{0x2F2,0,"re_index"},
+{0x2F3,0,"reset_estack_size"},
+{0x2F4,0,"reset_control_flags"},
+{0x2F5,0,"can_be_approxed"},
+{0x2F6,0,"compare_complex_magnitudes"},
+{0x2F7,0,"compare_Floats"},
+{0x2F8,0,"did_push_cnvrt_Float_to_integer"},
+{0x2F9,0,"estack_number_to_Float"},
+{0x2FA,0,"float_class"},
+{0x2FB,0,"frexp10"},
+{0x2FC,0,"gcd_exact_whole_Floats"},
+{0x2FD,0,"init_float / is1"},
+{0x2FE,0,"is_Float_exact_whole_number"},
+{0x2FF,0,"is_float_infinity"},
+{0x300,0,"is_float_negative_zero"},
+{0x301,0,"is_float_positive_zero"},
+{0x302,0,"is_float_signed_infinity"},
+{0x303,0,"is_float_transfinite"},
+{0x304,0,"is_float_unsigned_inf_or_nan"},
+{0x305,0,"is_float_unsigned_zero"},
+{0x306,0,"is_nan"},
+{0x307,0,"likely_approx_to_complex_number"},
+{0x308,0,"likely_approx_to_number"},
+{0x309,0,"norm1_complex_Float"},
+{0x30A,0,"push_Float"},
+{0x30B,0,"push_Float_to_nonneg_int"},
+{0x30C,0,"push_Float_to_rat"},
+{0x30D,0,"push_cnvrt_integer_if_whole_nmb"},
+{0x30E,0,"push_overflow_to_infinity"},
+{0x30F,0,"push_pow"},
+{0x310,0,"push_round_Float"},
+{0x311,0,"should_and_did_push_approx_arg2"},
+{0x312,0,"signum_Float"},
+{0x313,0,"did_push_to_polar"},
+{0x314,0,"push_degrees"},
+{0x315,0,"push_format"},
+{0x316,0,"push_getkey"},
+{0x317,0,"push_getfold"},
+{0x318,0,"push_getmode"},
+{0x319,0,"push_gettype"},
+{0x31A,0,"push_instring"},
+{0x31B,0,"push_mrow_aux"},
+{0x31C,0,"push_part"},
+{0x31D,0,"push_pttest"},
+{0x31E,0,"push_pxltest"},
+{0x31F,0,"push_rand"},
+{0x320,0,"push_randpoly"},
+{0x321,0,"push_setfold"},
+{0x322,0,"push_setgraph"},
+{0x323,0,"push_setmode"},
+{0x324,0,"push_settable"},
+{0x325,0,"push_str_to_expr"},
+{0x326,0,"push_string"},
+{0x327,0,"push_switch"},
+{0x328,0,"push_to_cylin"},
+{0x329,0,"push_to_sphere"},
+{0x32A,0,"cmd_andpic"},
+{0x32B,0,"cmd_blddata"},
+{0x32C,0,"cmd_circle"},
+{0x32D,0,"cmd_clrdraw"},
+{0x32E,0,"cmd_clrerr"},
+{0x32F,0,"cmd_clrgraph"},
+{0x330,0,"cmd_clrhome"},
+{0x331,0,"cmd_clrio"},
+{0x332,0,"cmd_clrtable"},
+{0x333,0,"cmd_copyvar"},
+{0x334,0,"cmd_cubicreg"},
+{0x335,0,"cmd_custmoff"},
+{0x336,0,"cmd_custmon"},
+{0x337,0,"cmd_custom"},
+{0x338,0,"cmd_cycle"},
+{0x339,0,"cmd_cyclepic"},
+{0x33A,0,"cmd_delfold"},
+{0x33B,0,"cmd_delvar"},
+{0x33C,0,"cmd_dialog"},
+{0x33D,0,"cmd_disp"},
+{0x33E,0,"cmd_dispg"},
+{0x33F,0,"cmd_disphome"},
+{0x340,0,"cmd_disptbl"},
+{0x341,0,"cmd_drawfunc"},
+{0x342,0,"cmd_drawinv"},
+{0x343,0,"cmd_drawparm"},
+{0x344,0,"cmd_drawpol"},
+{0x345,0,"cmd_else"},
+{0x346,0,"cmd_endfor"},
+{0x347,0,"cmd_endloop"},
+{0x348,0,"cmd_endtry"},
+{0x349,0,"cmd_endwhile"},
+{0x34A,0,"cmd_exit"},
+{0x34B,0,"cmd_expreg"},
+{0x34C,0,"cmd_fill"},
+{0x34D,0,"cmd_fnoff"},
+{0x34E,0,"cmd_fnon"},
+{0x34F,0,"cmd_for"},
+{0x350,0,"cmd_get"},
+{0x351,0,"cmd_getcalc"},
+{0x352,0,"cmd_goto"},
+{0x353,0,"cmd_graph"},
+{0x354,0,"cmd_if"},
+{0x355,0,"cmd_ifthen"},
+{0x356,0,"cmd_input"},
+{0x357,0,"cmd_inputstr"},
+{0x358,0,"cmd_line"},
+{0x359,0,"cmd_linehorz"},
+{0x35A,0,"cmd_linetan"},
+{0x35B,0,"cmd_linevert"},
+{0x35C,0,"cmd_linreg"},
+{0x35D,0,"cmd_lnreg"},
+{0x35E,0,"cmd_local"},
+{0x35F,0,"cmd_lock"},
+{0x360,0,"cmd_logistic"},
+{0x361,0,"cmd_medmed"},
+{0x362,0,"cmd_movevar"},
+{0x363,0,"cmd_newdata"},
+{0x364,0,"cmd_newfold"},
+{0x365,0,"cmd_newpic"},
+{0x366,0,"cmd_newplot"},
+{0x367,0,"cmd_newprob"},
+{0x368,0,"cmd_onevar"},
+{0x369,0,"cmd_output"},
+{0x36A,0,"cmd_passerr"},
+{0x36B,0,"cmd_pause"},
+{0x36C,0,"cmd_plotsoff"},
+{0x36D,0,"cmd_plotson"},
+{0x36E,0,"cmd_popup"},
+{0x36F,0,"cmd_powerreg"},
+{0x370,0,"cmd_printobj"},
+{0x371,0,"cmd_prompt"},
+{0x372,0,"cmd_ptchg"},
+{0x373,0,"cmd_ptoff"},
+{0x374,0,"cmd_pton"},
+{0x375,0,"cmd_pttext"},
+{0x376,0,"cmd_pxlchg"},
+{0x377,0,"cmd_pxlcircle"},
+{0x378,0,"cmd_pxlhorz"},
+{0x379,0,"cmd_pxlline"},
+{0x37A,0,"cmd_pxloff"},
+{0x37B,0,"cmd_pxlon"},
+{0x37C,0,"cmd_pxltext"},
+{0x37D,0,"cmd_pxlvert"},
+{0x37E,0,"cmd_quadreg"},
+{0x37F,0,"cmd_quartreg"},
+{0x380,0,"cmd_randseed"},
+{0x381,0,"cmd_rclgdb"},
+{0x382,0,"cmd_rclpic"},
+{0x383,0,"cmd_rename"},
+{0x384,0,"cmd_request"},
+{0x385,0,"cmd_return"},
+{0x386,0,"cmd_rplcpic"},
+{0x387,0,"cmd_send"},
+{0x388,0,"cmd_sendcalc"},
+{0x389,0,"cmd_sendchat"},
+{0x38A,0,"cmd_shade"},
+{0x38B,0,"cmd_showstat"},
+{0x38C,0,"cmd_sinreg"},
+{0x38D,0,"cmd_slpline"},
+{0x38E,0,"cmd_sorta"},
+{0x38F,0,"cmd_sortd"},
+{0x390,0,"cmd_stogdb"},
+{0x391,0,"cmd_stopic"},
+{0x392,0,"cmd_style"},
+{0x393,0,"cmd_table"},
+{0x394,0,"cmd_text"},
+{0x395,0,"cmd_toolbar"},
+{0x396,0,"cmd_trace"},
+{0x397,0,"cmd_try"},
+{0x398,0,"cmd_twovar"},
+{0x399,0,"cmd_unlock"},
+{0x39A,0,"cmd_while"},
+{0x39B,0,"cmd_xorpic"},
+{0x39C,0,"cmd_zoombox"},
+{0x39D,0,"cmd_zoomdata"},
+{0x39E,0,"cmd_zoomdec"},
+{0x39F,0,"cmd_zoomfit"},
+{0x3A0,0,"cmd_zoomin"},
+{0x3A1,0,"cmd_zoomint"},
+{0x3A2,0,"cmd_zoomout"},
+{0x3A3,0,"cmd_zoomprev"},
+{0x3A4,0,"cmd_zoomrcl"},
+{0x3A5,0,"cmd_zoomsqr"},
+{0x3A6,0,"cmd_zoomstd"},
+{0x3A7,0,"cmd_zoomsto"},
+{0x3A8,0,"cmd_zoomtrig"},
+{0x3A9,0,"OSenqueue"},
+{0x3AA,0,"OSdequeue"},
+{0x3AB,0,"OSqinquire"},
+{0x3AC,0,"OSqhead"},
+{0x3AD,0,"OSqclear"},
+{0x3AE,0,"did_push_divide_units"},
+{0x3AF,0,"has_unit_base"},
+{0x3B0,0,"init_unit_system"},
+{0x3B1,0,"is_units_term"},
+{0x3B2,0,"push_auto_units_conversion"},
+{0x3B3,0,"push_unit_system_list"},
+{0x3B4,0,"setup_unit_system"},
+{0x3B5,0,"all_tail"},
+{0x3B6,0,"any_tail"},
+{0x3B7,0,"is_matrix"},
+{0x3B8,0,"is_square_matrix"},
+{0x3B9,0,"is_valid_smap_aggregate"},
+{0x3BA,0,"last_element_index"},
+{0x3BB,0,"map_tail"},
+{0x3BC,0,"map_tail_Int"},
+{0x3BD,0,"push_list_plus"},
+{0x3BE,0,"push_list_times"},
+{0x3BF,0,"push_reversed_tail"},
+{0x3C0,0,"push_sq_matrix_to_whole_number"},
+{0x3C1,0,"push_transpose_aux"},
+{0x3C2,0,"push_zero_partial_column"},
+{0x3C3,0,"remaining_element_count"},
+{0x3C4,0,"push_offset_array"},
+{0x3C5,0,"push_matrix_product"},
+{0x3C6,0,"is_pathname"},
+{0x3C7,0,"next_token"},
+{0x3C8,0,"nonblank"},
+{0x3C9,0,"push_parse_prgm_or_func_text"},
+{0x3CA,0,"push_parse_text"},
+{0x3CB,0,"push_var"},
+
+{0x3CC,0,"memucmp"},
+{0x3CD,0,"ROM_CALL_3CD"},
+{0x3CE,0,"ROM_CALL_3CE"},
+{0x3CF,0,"EM_GetArchiveMemoryBeginning"},
+{0x3D0,0,"LIO_SendIdList"},
+{0x3D1,0,"ROM_CALL_3D1"},
+{0x3D2,0,"OO_GetEndOfAllFlashApps"},
+{0x3D3,0,"ROM_CALL_3D3"},
+{0x3D4,0,"FAccess"},
+{0x3D5,0,"FClose"},
+{0x3D6,0,"FCreate"},
+{0x3D7,0,"FDelete"},
+{0x3D8,0,"FEof"},
+{0x3D9,0,"FFindFirst"},
+{0x3DA,0,"FFindNext"},
+{0x3DB,0,"FGetC"},
+{0x3DC,0,"FGetPos"},
+{0x3DD,0,"FGetSize"},
+{0x3DE,0,"FOpen"},
+{0x3DF,0,"FPutC"},
+{0x3E0,0,"FRead"},
+{0x3E1,0,"FSetPos"},
+{0x3E2,0,"FSetBufSize"},
+{0x3E3,0,"FSetSize"},
+{0x3E4,0,"FSetVer"},
+{0x3E5,0,"FStatus"},
+{0x3E6,0,"FType"},
+{0x3E7,0,"FWrite"},
+{0x3E8,0,"ROM_CALL_3E8"},
+{0x3E9,0,"TokenizeName"},
+{0x3EA,0,"ROM_CALL_3EA"},
+{0x3EB,0,"KeyYesOrNo"},
+{0x3EC,0,"ROM_CALL_3EC"},
+{0x3ED,0,"BitmapSizeExt"},
+{0x3EE,0,"DrawStrWidthP"},
+{0x3EF,0,"CalcBitmapSize"},
+{0x3F0,0,"DynMenuChange"},
+{0x3F1,0,"DynMenuAdd"},
+{0x3F2,0,"MenuLoad"},
+{0x3F3,0,"MenuItemDef"},
+{0x3F4,0,"MenuFlags"},
+{0x3F5,0,"PopupBegin"},
+{0x3F6,0,"PopupBeginDo"},
+{0x3F7,0,"ROM_CALL_3F7"},
+{0x3F8,0,"ROM_CALL_3F8"},
+{0x3F9,0,"init_float"},
+{0x3FA,0,"OO_CondGetAttr"},
+{0x3FB,0,"OO_Deref"},
+{0x3FC,0,"OO_GetAppAttr"},
+{0x3FD,0,"OO_GetAttr"},
+{0x3FE,0,"OO_HasAttr"},
+{0x3FF,0,"OO_New"},
+{0x400,0,"OO_SetAppAttr"},
+{0x401,0,"OO_SetAttr"},
+{0x402,0,"OO_NextACB"},
+{0x403,0,"OO_PrevACB"},
+{0x404,0,"OO_InstallSystemHook"},
+{0x405,0,"OO_UninstallSystemHook"},
+{0x406,0,"OO_AppNameToACB"},
+{0x407,0,"stricmp"},
+{0x408,0,"statStart"},
+{0x409,0,"statEnd"},
+{0x40A,0,"statFree"},
+{0x40B,0,"QstatRcl"},
+{0x40C,0,"ROM_CALL_40C"},
+{0x40D,0,"ROM_CALL_40D"},
+{0x40E,0,"ROM_CALL_40E"},
+{0x40F,0,"are_units_consistent"},
+{0x410,0,"ROM_CALL_410"},
+{0x411,0,"WinBitmapSizeExt"},
+{0x412,0,"ROM_CALL_412"},
+{0x413,0,"ROM_CALL_413"},
+{0x414,0,"WinRemove"},
+{0x415,0,"RectWinToScrExt"},
+{0x416,0,"ROM_CALL_416"},
+{0x417,0,"ROM_CALL_417"},
+{0x418,0,"ROM_CALL_418"},
+{0x419,0,"MenuOff"},
+{0x41A,0,"QMenuTopSelect"},
+{0x41B,0,"ROM_CALL_41B"},
+{0x41C,0,"ROM_CALL_41C"},
+{0x41D,0,"ROM_CALL_41D"},
+{0x41E,0,"ROM_CALL_41E"},
+{0x41F,0,"ROM_CALL_41F"},
+{0x420,0,"ROM_CALL_420"},
+{0x421,0,"ROM_CALL_421"},
+{0x422,0,"ROM_CALL_422"},
+{0x423,0,"OO_Destroy"},
+{0x424,0,"ROM_CALL_424"},
+{0x425,0,"OO_appGetPublicStorage"},
+{0x426,0,"OO_appIsMarkedDelete"},
+{0x427,0,"OO_appMarkDelete"},
+{0x428,0,"ROM_CALL_428"},
+{0x429,0,"OO_appSetPublicStorage"},
+{0x42A,0,"ROM_CALL_42A"},
+{0x42B,0,"ROM_CALL_42B"},
+{0x42C,0,"ClientToScr"},
+{0x42D,0,"MakeScrRect"},
+{0x42E,0,"SetWinClip"},
+{0x42F,0,"WinToScr"},
+{0x430,0,"pSymPG"},
+{0x431,0,"OSModKeyStatus"},
+{0x432,0,"bottom_estack"},
+{0x433,0,"ROM_CALL_433"},
+{0x434,0,"BatTooLowFlash"},
+{0x435,0,"GetDataType"},
+{0x436,0,"SmapTypeStrings"},
+{0x437,0,"ROM_CALL_437"},
+{0x438,0,"ROM_CALL_438"},
+{0x439,0,"ROM_CALL_439"},
+{0x43A,0,"GetFuncPrgmBodyPtr"},
+{0x43B,0,"DataTypeNames"},
+{0x43C,0,"AM_Beginning_AMS1xx w/o MaxMem"},
+{0x43D,0,"FlashMemoryEnd"},
+{0x43E,0,"CertificateMemory"},
+{0x43F,0,"ReleaseDate"},
+{0x440,0,"ReleaseVersion"},
+{0x441,0,"HeapTable"},
+{0x442,0,"CTypeTable"},
+{0x443,0,"ST_flags"},
+{0x444,0,"VarOptList"},
+{0x445,0,"ROM_CALL_445"},
+{0x446,0,"ROM_CALL_446"},
+{0x447,0,"MO_option"},
+{0x448,0,"cmd_archive"},
+{0x449,0,"cmd_unarchiv"},
+{0x44A,0,"ROM_CALL_44A"},
+{0x44B,0,"ROM_CALL_44B"},
+{0x44C,0,"clear_error_context"},
+{0x44D,0,"push_expression"},
+{0x44E,0,"push_simplify"},
+{0x44F,0,"push_simplify_statements"},
+{0x450,0,"push_simplify_expressions"},
+{0x451,0,"OO_firstACB"},
+{0x452,0,"EV_appA"},
+{0x453,0,"EV_appB"},
+{0x454,0,"EV_getAppID"},
+{0x455,0,"ROM_CALL_455"},
+{0x456,0,"SetOK"},
+{0x457,0,"ROM_CALL_457"},
+{0x458,0,"EV_appSide"},
+{0x459,0,"ROM_CALL_459"},
+{0x45A,0,"ROM_CALL_45A"},
+{0x45B,0,"ROM_CALL_45B"},
+{0x45C,0,"EV_currentApp"},
+{0x45D,0,"EV_runningApp"},
+{0x45E,0,"ROM_CALL_45E"},
+{0x45F,0,"hStrAppend"},
+{0x460,0,"ROM_CALL_460"},
+{0x461,0,"ROM_CALL_461"},
+{0x462,0,"ROM_CALL_462"},
+{0x463,0,"gr_flags"},
+{0x464,0,"FLOATTAB"},
+{0x465,0,"is_cFloat_agg"},
+{0x466,0,"NG_control"},
+{0x467,0,"primary_tag_list"},
+{0x468,0,"ROM_CALL_468"},
+{0x469,0,"estack_to_float"},
+{0x46A,0,"ROM_CALL_46A"},
+{0x46B,0,"ROM_CALL_46B"},
+{0x46C,0,"GetTagStr"},
+{0x46D,0,"EV_errorCode"},
+{0x46E,0,"OSOnBreak"},
+{0x46F,0,"ROM_CALL_46F"},
+{0x470,0,"ROM_CALL_470"},
+{0x471,0,"ROM_CALL_471"},
+{0x472,0,"LCD_MEM"},
+{0x473,0,"ROM_CALL_473"},
+{0x474,0,"HeapShuffle"},
+{0x475,0,"ERD_notice"},
+{0x476,0,"ERD_dismissNotice"},
+{0x477,0,"OO_GetFlashAppSize"},
+{0x478,0,"ROM_CALL_478"},
+{0x479,0,"ROM_CALL_479"},
+{0x47A,0,"ROM_CALL_47A"},
+{0x47B,0,"ROM_CALL_47B"},
+{0x47C,0,"WinLineExt"},
+{0x47D,0,"ForceFloat"},
+{0x47E,0,"ROM_CALL_47E"},
+{0x47F,0,"ROM_CALL_47F"},
+{0x480,0,"ROM_CALL_480"},
+{0x481,0,"alphaLockOn"},
+{0x482,0,"alphaLockOff"},
+{0x483,0,"restoreAlphaLock"},
+{0x484,0,"cmd_lu_fact"},
+{0x485,0,"cmd_qr_fact"},
+{0x486,0,"ROM_CALL_486"},
+{0x487,0,"ROM_CALL_487"},
+{0x488,0,"is_variable"},
+{0x489,0,"push_substitute_no_simplify"},
+{0x48A,0,"push_zstr"},
+{0x48B,0,"is_complex_Float"},
+{0x48C,0,"ROM_CALL_48C"},
+{0x48D,0,"ROM_CALL_48D"},
+{0x48E,0,"EV_quit"},
+{0x48F,0,"OO_SuperFrame"},
+{0x490,0,"OO_InstallAppHook"},
+{0x491,0,"OO_UninstallAppHook"},
+{0x492,0,"OO_InstallAppHookByName"},
+{0x493,0,"OO_UninstallAppHookByName"},
+{0x494,0,"ROM_CALL_494"},
+{0x495,0,"ROM_CALL_495"},
+{0x496,0,"push_augment"},
+{0x497,0,"push_char"},
+{0x498,0,"push_coldim"},
+{0x499,0,"push_colnorm"},
+{0x49A,0,"push_cumsum"},
+{0x49B,0,"push_cylin_vector"},
+{0x49C,0,"push_dense_poly_eval"},
+{0x49D,0,"push_determinant"},
+{0x49E,0,"push_diag"},
+{0x49F,0,"push_dimension"},
+{0x4A0,0,"push_dot_add"},
+{0x4A1,0,"push_dot_mult"},
+{0x4A2,0,"push_dot_sub"},
+{0x4A3,0,"push_dotproduct"},
+{0x4A4,0,"push_identity_mat"},
+{0x4A5,0,"push_left"},
+{0x4A6,0,"push_list_to_mat"},
+{0x4A7,0,"push_matnorm"},
+{0x4A8,0,"push_mat_to_list"},
+{0x4A9,0,"push_mean"},
+{0x4AA,0,"push_median"},
+{0x4AB,0,"push_mid"},
+{0x4AC,0,"push_mrow"},
+{0x4AD,0,"push_mrowadd"},
+{0x4AE,0,"push_newlist"},
+{0x4AF,0,"push_newmat"},
+{0x4B0,0,"push_ord"},
+{0x4B1,0,"push_polar_vector"},
+{0x4B2,0,"push_prodlist"},
+{0x4B3,0,"push_radians"},
+{0x4B4,0,"push_randmat"},
+{0x4B5,0,"push_randnorm"},
+{0x4B6,0,"push_red_row_ech"},
+{0x4B7,0,"push_right"},
+{0x4B8,0,"push_rotate"},
+{0x4B9,0,"push_round"},
+{0x4BA,0,"push_rowadd"},
+{0x4BB,0,"push_rowdim"},
+{0x4BC,0,"push_rownorm"},
+{0x4BD,0,"push_rowswap"},
+{0x4BE,0,"push_row_echelon"},
+{0x4BF,0,"push_sequence"},
+{0x4C0,0,"push_shift"},
+{0x4C1,0,"push_simult"},
+{0x4C2,0,"push_sphere_vector"},
+{0x4C3,0,"push_stddev"},
+{0x4C4,0,"push_submat"},
+{0x4C5,0,"push_sumlist"},
+{0x4C6,0,"push_to_dd"},
+{0x4C7,0,"push_to_dms"},
+{0x4C8,0,"push_unitv"},
+{0x4C9,0,"push_variance"},
+{0x4CA,0,"ROM_CALL_4CA"},
+{0x4CB,0,"ROM_CALL_4CB"},
+{0x4CC,0,"ROM_CALL_4CC"},
+{0x4CD,0,"push_dot_div"},
+{0x4CE,0,"push_cross_product"},
+{0x4CF,0,"push_eigvc"},
+{0x4D0,0,"push_eigvl"},
+{0x4D1,0,"ROM_CALL_4D1"},
+{0x4D2,0,"push_transpose"},
+{0x4D3,0,"sf_width"},
+{0x4D4,0,"strtod"},
+{0x4D5,0,"ROM_CALL_4D5"},
+{0x4D6,0,"freeIdList"},
+{0x4D7,0,"ROM_CALL_4D7"},
+{0x4D8,0,"ST_progressBar"},
+{0x4D9,0,"ST_progressUpdate"},
+{0x4DA,0,"ST_progressIncrement"},
+{0x4DB,0,"ST_progressDismiss"},
+{0x4DC,0,"ROM_CALL_4DC"},
+{0x4DD,0,"push_assignment"},
+{0x4DE,0,"FirstNonblank"},
+{0x4DF,0,"is_negative_number"},
+{0x4E0,0,"is_positive_number_or_neg0frac"},
+{0x4E1,0,"is_negative_number_or_pos0frac_or_pos0int"},
+{0x4E2,0,"is_positive_number"},
+{0x4E3,0,"push_long_to_integer"},
+{0x4E4,0,"push_ulong_to_integer"},
+{0x4E5,0,"push_ushort_to_integer"},
+{0x4E6,0,"ROM_CALL_4E6"},
+{0x4E7,0,"push0"},
+{0x4E8,0,"push1"},
+{0x4E9,0,"push0_tag"},
+{0x4EA,0,"push1_tag"},
+{0x4EB,0,"push_half"},
+{0x4EC,0,"push_exact0"},
+{0x4ED,0,"push_exact_minus1"},
+{0x4EE,0,"push_minus1"},
+{0x4EF,0,"push_minus1_tag"},
+{0x4F0,0,"push_minus_half"},
+{0x4F1,0,"push_negate_quantum_as_negint"},
+{0x4F2,0,"push_exact1"},
+{0x4F3,0,"OO_GetFirstFlashAppSectorAddress"},
+{0x4F4,0,"ROM_CALL_4F4"},
+{0x4F5,0,"OO_DestroyAll"},
+{0x4F6,0,"ROM_CALL_4F6"},
+{0x4F7,0,"push_approx"},
+{0x4F8,0,"push_internal_simplify"},
+{0x4F9,0,"push_polar_to_rect_x"},
+{0x4FA,0,"push_polar_to_rect_y"},
+{0x4FB,0,"ROM_CALL_4FB"},
+{0x4FC,0,"FiftyMsecTick"},
+{0x4FD,0,"ROM_CALL_4FD"},
+{0x4FE,0,"ROM_CALL_4FE"},
+{0x4FF,0,"strtol"},
+{0x500,0,"WinBeginPaint"},
+{0x501,0,"WinEndPaint"},
+{0x502,0,"ROM_CALL_502"},
+{0x503,0,"CU_cursorState"},
+{0x504,0,"ROM_CALL_504"},
+{0x505,0,"ROM_CALL_505"},
+{0x506,0,"HomeAlone"},
+{0x507,0,"ER_throwFrame"},
+
+{0x508,0,"is_minus1"},
+{0x509,0,"is_pos_int_and_eq_quantum"},
+{0x50A,0,"is_reciprocal_of_quantum"},
+{0x50B,0,"is_whole_number"},
+{0x50C,0,"integer_non_unknown"},
+{0x50D,0,"compare_numbers"},
+{0x50E,0,"push_quantum_as_nonnegative_int"},
+{0x50F,0,"push_reciprocal_of_quantum"},
+{0x510,0,"push_minus_recip_of_quantum"},
+{0x511,0,"push_quantum_pair_as_pos_frac"},
+{0x512,0,"push_pi"},
+{0x513,0,"push_pi_on_quantum"},
+{0x514,0,"push_gcd_numbers"},
+{0x515,0,"push_is_prime"},
+{0x516,0,"get_lb"},
+{0x517,0,"get_ub"},
+{0x518,0,"add_to_top"},
+{0x519,0,"replace_top2_with_sum"},
+{0x51A,0,"push_difference"},
+{0x51B,0,"subtract_from_top"},
+{0x51C,0,"replace_top2_with_difference"},
+{0x51D,0,"add1_to_top"},
+{0x51E,0,"subtract1_from_top"},
+{0x51F,0,"push_arg_plus_1"},
+{0x520,0,"push_arg_minus_1"},
+{0x521,0,"push_product"},
+{0x522,0,"times_top"},
+{0x523,0,"replace_top2_with_prod"},
+{0x524,0,"push_negate"},
+{0x525,0,"negate_top"},
+{0x526,0,"push_ratio"},
+{0x527,0,"divide_top"},
+{0x528,0,"replace_top2_with_ratio"},
+{0x529,0,"raise_to_top"},
+{0x52A,0,"replace_top2_with_pow"},
+{0x52B,0,"push_sqrt"},
+{0x52C,0,"push_square"},
+{0x52D,0,"replace_top_with_reciprocal"},
+{0x52E,0,"push_exp"},
+{0x52F,0,"push_ln"},
+{0x530,0,"push_log10"},
+{0x531,0,"push_sin2"},
+{0x532,0,"push_sin"},
+{0x533,0,"push_cos"},
+{0x534,0,"push_tan"},
+{0x535,0,"push_trig"},
+{0x536,0,"push_asin"},
+{0x537,0,"push_acos"},
+{0x538,0,"push_atan"},
+{0x539,0,"push_rec_to_angle"},
+{0x53A,0,"push_sinh"},
+{0x53B,0,"push_cosh"},
+{0x53C,0,"push_tanh"},
+{0x53D,0,"push_asinh"},
+{0x53E,0,"push_acosh"},
+{0x53F,0,"push_atanh"},
+{0x540,0,"push_factorial"},
+{0x541,0,"push_perm"},
+{0x542,0,"push_comb"},
+{0x543,0,"push_abs"},
+{0x544,0,"push_sign"},
+{0x545,0,"push_re"},
+{0x546,0,"push_im"},
+{0x547,0,"push_conj"},
+{0x548,0,"push_phase"},
+{0x549,0,"push_r_cis"},
+{0x54A,0,"push_floor"},
+{0x54B,0,"push_ceiling"},
+{0x54C,0,"push_mod"},
+{0x54D,0,"push_integer_part"},
+{0x54E,0,"push_fractional_part"},
+{0x54F,0,"push_integer_quotient"},
+{0x550,0,"push_integer_remainder"},
+{0x551,0,"push_integer_gcd"},
+{0x552,0,"push_integer_lcm"},
+{0x553,0,"push_min1"},
+{0x554,0,"push_max1"},
+{0x555,0,"push_percent"},
+{0x556,0,"is_term_improper"},
+{0x557,0,"push_make_proper"},
+{0x558,0,"push_standardize"},
+{0x559,0,"replace_top2_with_imre"},
+{0x55A,0,"push_numerator"},
+{0x55B,0,"push_denominator"},
+{0x55C,0,"push_nonnumeric_factors"},
+{0x55D,0,"push_constant_factors"},
+{0x55E,0,"push_nonconstant_factors"},
+{0x55F,0,"push_dependent_factors"},
+{0x560,0,"push_independent_factors"},
+{0x561,0,"push_but_factor"},
+{0x562,0,"index_rmng_fctrs_start_fctr_tag"},
+{0x563,0,"index_rmng_fctrs_start_base_tag"},
+{0x564,0,"index_rmng_fctrs_start_base"},
+{0x565,0,"index_rmng_factor"},
+{0x566,0,"push_constant_terms"},
+{0x567,0,"push_nonconstant_terms"},
+{0x568,0,"push_dependent_terms"},
+{0x569,0,"push_independent_terms"},
+{0x56A,0,"push_but_term"},
+{0x56B,0,"is_polynomial_in_var_or_kern"},
+{0x56C,0,"is_totally_polynomial"},
+{0x56D,0,"is_neg_lead_numr_coef_re_part"},
+{0x56E,0,"next_var_or_kernel_index"},
+{0x56F,0,"push_var_kern_tail"},
+{0x570,0,"push_poly_deg_in_var_or_kernel"},
+{0x571,0,"linear_degree"},
+{0x572,0,"did_push_lincf"},
+{0x573,0,"is_positive"},
+{0x574,0,"is_nonnegative"},
+{0x575,0,"is_negative"},
+{0x576,0,"is_nonpositive"},
+{0x577,0,"is_never0"},
+{0x578,0,"is_equivalent_to"},
+{0x579,0,"and_onto_top"},
+{0x57A,0,"replace_top2_with_and"},
+{0x57B,0,"or_onto_top"},
+{0x57C,0,"replace_top2_with_or"},
+{0x57D,0,"push_when"},
+{0x57E,0,"lead_disjunct_term_index"},
+{0x57F,0,"remaining_disjuncts_index"},
+{0x580,0,"lead_conjunct_factor_index"},
+{0x581,0,"remaining_conjuncts_index"},
+{0x582,0,"push_but_conjunct_factor"},
+{0x583,0,"push_nsolve"},
+{0x584,0,"push_solve"},
+{0x585,0,"push_csolve"},
+{0x586,0,"push_zeros"},
+{0x587,0,"push_czeros"},
+{0x588,0,"did_push_series"},
+{0x589,0,"push_min"},
+{0x58A,0,"push_max"},
+{0x58B,0,"push_desolve"},
+{0x58C,0,"push_div_dif_1f"},
+{0x58D,0,"push_div_dif_1c"},
+{0x58E,0,"ROM_CALL_58E"},
+{0x58F,0,"LOC_getLocalDateFormat"},
+{0x590,0,"LOC_formatDate"},
+{0x591,0,"LOC_localVersionDate"},
+{0x592,0,"FKeyI_H"},
+{0x593,0,"is_constant"},
+{0x594,0,"push_sum"},
+{0x595,0,"push_exponentiate"},
+{0x596,0,"push_dot_exponentiate"},
+{0x597,0,"push_reciprocal"},
+{0x598,0,"push_min2"},
+{0x599,0,"push_max2"},
+{0x59A,0,"push_expand"},
+{0x59B,0,"push_comdenom"},
+{0x59C,0,"push_factor"},
+{0x59D,0,"push_poly_qr"},
+{0x59E,0,"push_gcd_then_cofactors"},
+{0x59F,0,"index_reductum_with_tag_base"},
+{0x5A0,0,"has_different_variable"},
+{0x5A1,0,"index_if_pushed_binomial_info"},
+{0x5A2,0,"index_if_pushed_qquad_info"},
+{0x5A3,0,"push_equals"},
+{0x5A4,0,"push_not_equals"},
+{0x5A5,0,"push_greater_than"},
+{0x5A6,0,"push_less_than"},
+{0x5A7,0,"push_greater_than_or_equals"},
+{0x5A8,0,"push_less_than_or_equals"},
+{0x5A9,0,"is_real"},
+{0x5AA,0,"push_not"},
+{0x5AB,0,"push_and"},
+{0x5AC,0,"push_or"},
+{0x5AD,0,"push_lim"},
+{0x5AE,0,"push_1st_derivative"},
+{0x5AF,0,"push_nth_derivative"},
+{0x5B0,0,"did_push_approx_inflection_point"},
+{0x5B1,0,"did_push_anti_deriv"},
+{0x5B2,0,"push_def_int"},
+{0x5B3,0,"push_nint"},
+{0x5B4,0,"push_summation"},
+{0x5B5,0,"push_extended_prod"},
+{0x5B6,0,"replace_top_with_post_simplified"},
+
+{0x5B7,0,"is_undefined"},
+{0x5B8,0,"did_map_aggregate_arg"},
+{0x5B9,0,"push_substitute_simplify"},
+{0x5BA,0,"abs"},
+{0x5BB,0,"div"},
+{0x5BC,0,"labs"},
+{0x5BD,0,"ldiv"},
+{0x5BE,0,"push_substitute_using_such_that"},
+{0x5BF,0,"estack_max_index"},
+{0x5C0,0,"RAtionalize_tol"},
+{0x5C1,0,"IM_re_tol"},
+{0x5C2,0,"ARb_real_count"},
+{0x5C3,0,"ARb_int_count"},
+{0x5C4,0,"ROM_CALL_5C4"},
+{0x5C5,0,"ROM_CALL_5C5"},
+{0x5C6,0,"ROM_CALL_5C6"},
+{0x5C7,0,"ROM_CALL_5C7"},
+{0x5C8,0,"ROM_CALL_5C8"},
+{0x5C9,0,"ROM_CALL_5C9"},
+{0x5CA,0,"ROM_CALL_5CA"},
+{0x5CB,0,"ROM_CALL_5CB"},
+{0x5CC,0,"ROM_CALL_5CC"},
+{0x5CD,0,"Integer0Index"},
+{0x5CE,0,"Integer1Index"},
+{0x5CF,0,"IntegerMinus1Index"},
+{0x5D0,0,"Float0Index"},
+{0x5D1,0,"Float1Index"},
+{0x5D2,0,"FloatMinus1Index"},
+{0x5D3,0,"FloatPiIndex"},
+{0x5D4,0,"FloatExp1Index"},
+{0x5D5,0,"index_true"},
+{0x5D6,0,"index_false"},
+{0x5D7,0,"NG_such_that_index"},
+{0x5D8,0,"ROM_CALL_5D8"},
+{0x5D9,0,"errno"},
+{0x5DA,0,"EX_getBasecodeParmBlock"},
+{0x5DB,0,"WinStrXYWrap"},
+{0x5DC,0,"RM_Type"},
+{0x5DD,0,"HS_FirstFIFONodeHandle"},
+{0x5DE,0,"HS_MaxExpressions"},
+{0x5DF,0,"EV_flags"},
+{0x5E0,0,"FloatHalfIndex"},
+{0x5E1,0,"Integer2Index"},
+
+{0x5E2,0,"ROM_CALL_5E2"},
+{0x5E3,0,"OSCheckLinkOpen"},
+{0x5E4,0,"ROM_CALL_5E4"},
+{0x5E5,0,"ROM_CALL_5E5"},
+{0x5E6,0,"ROM_CALL_5E6"},
+{0x5E7,0,"ROM_CALL_5E7"},
+{0x5E8,0,"ROM_CALL_5E8"},
+{0x5E9,0,"ROM_CALL_5E9"},
+{0x5EA,0,"ROM_CALL_5EA"},
+{0x5EB,0,"ROM_CALL_5EB"},
+{0x5EC,0,"ROM_CALL_5EC"},
+{0x5ED,0,"ROM_CALL_5ED"},
+{0x5EE,0,"ROM_CALL_5EE"},
+
+{0x5EF,0,"ROM_CALL_5EF"},
+{0x5F0,0,"ROM_CALL_5F0"},
+{0x5F1,0,"DateAndTime_SetDlg"},
+{0x5F2,0,"DateAndTime_Set"},
+{0x5F3,0,"DateAndTime_Get"},
+{0x5F4,0,"DayOfTheWeek"},
+{0x5F5,0,"ClockOn"},
+{0x5F6,0,"ClockOff"},
+{0x5F7,0,"IsClockOn"},
+{0x5F8,0,"Timer_Start"},
+{0x5F9,0,"Timer_Value"},
+{0x5FA,0,"TimeZone_Get"},
+{0x5FB,0,"TimeZone_Set"},
+{0x5FC,0,"DateFormat_Get"},
+{0x5FD,0,"DateFormat_Set"},
+{0x5FE,0,"DateStr"},
+{0x5FF,0,"TimeFormat_Get"},
+{0x600,0,"TimeFormat_Set"},
+{0x601,0,"TimeStr"},
+{0x602,0,"*readHandshake*"},
+{0x603,0,"*writeHandshake*"},
+{0x604,0,"*startBPTimer*"},
+{0x605,0,"*stopBPTimer*"},
+{0x606,0,"ROM_CALL_606"},
+
+{0x607,0,"GetFlashMemoryEnd"},
+
+{0x608,0,"ROM_CALL_608"},
+{0x609,0,"ROM_CALL_609"},
+{0x60A,0,"ROM_CALL_60A"},
+{0x60B,0,"ROM_CALL_60B"},
+{0x60C,0,"ROM_CALL_60C"},

+ 240 - 0
external/dasm-tigcc/rwfile.c

@@ -0,0 +1,240 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: rwfile.c 3227 2007-02-26 19:40:27Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+/*
+  This unit contains some miscellaneous but useful functions.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+#include <sys/stat.h>
+
+#include "tifiles.h"
+#include "integers.h"
+
+#define tifiles_error(x...) (fprintf(stderr, x),fprintf(stderr, "\n"))
+
+/********************/
+/* Read/Write bytes */
+/********************/
+
+/*
+   Read a block of 'n' bytes from a file
+   - s [out]: a buffer for storing the data
+   - f [in]: a file descriptor
+   - [out]: -1 if error, 0 otherwise.
+*/
+int fread_n_bytes(FILE * f, int n, uint8_t *s)
+{
+  int i;
+
+  if (s == NULL) 
+    for (i = 0; i < n; i++)
+      fgetc(f);
+  else 
+	if(fread(s, 1, n, f) < (size_t)n)
+		return -1;
+
+  return 0;
+}
+
+/*
+  Write a string of 'n' chars max (NULL padded) to a file
+  - s [in]: a string
+  - f [in]: a file descriptor
+  - [out]: -1 if error, 0 otherwise.
+*/
+int fwrite_n_bytes(FILE * f, int n, const uint8_t *s)
+{
+  if(fwrite(s, 1, n, f) < (size_t)n)
+	  return -1;
+
+  return 0;
+}
+
+/**********************/
+/* Read/Write strings */
+/**********************/
+
+/*
+   Read a string of 'n' chars max from a file
+   - s [out]: a buffer for storing the string
+   - f [in]: a file descriptor
+   - [out]: -1 if error, 0 otherwise.
+*/
+int fread_n_chars(FILE * f, int n, char *s)
+{
+	int i;
+	
+	if(fread_n_bytes(f, n, (uint8_t *)s) < 0) 
+		return -1;
+
+	if(s != NULL)
+	{	
+		// set NULL terminator
+		s[n] = '\0';
+		// and set unused bytes to 0
+		for(i = strlen(s); i < n; i++)
+			s[i] = '\0';
+	}
+
+	return 0;
+}
+
+/*
+  Write a string of 'n' chars max (NULL padded) to a file
+  - s [in]: a string
+  - f [in]: a file descriptor
+  - [out]: -1 if error, 0 otherwise.
+*/
+int fwrite_n_chars(FILE * f, int n, const char *s)
+{
+  int i;
+  int l = n;
+
+  l = strlen(s);
+  if (l > n) 
+  {
+    tifiles_error("string passed in 'write_string8' is too long (>n chars).\n");
+    abort();
+  }
+
+  for (i = 0; i < l; i++)
+    if(fputc(s[i], f) == EOF)
+		return -1;
+  for (i = l; i < n; i++) 
+    if(fputc(0x00, f) == EOF)
+		return -1;
+
+  return 0;
+}
+
+/*
+  Write a string of 'n' chars max (SPC padded) to a file
+  - s [in]: a string
+  - f [in]: a file descriptor
+  - [out]: -1 if error, 0 otherwise.
+*/
+int fwrite_n_chars2(FILE * f, int n, const char *s)
+{
+  int i;
+  int l = n;
+
+  l = strlen(s);
+  if (l > n) 
+  {
+    tifiles_error("string passed in 'write_string8' is too long (>n chars).\n");
+    abort();
+  }
+
+  for (i = 0; i < l; i++)
+    if(fputc(s[i], f) == EOF)
+		return -1;
+  for (i = l; i < n; i++) 
+    if(fputc(0x20, f) == EOF)
+		return -1;
+
+  return 0;
+}
+
+
+int fread_8_chars(FILE * f, char *s)
+{
+  return fread_n_chars(f, 8, s);
+}
+
+int fwrite_8_chars(FILE * f, const char *s)
+{
+  return fwrite_n_chars(f, 8, s);
+}
+
+int fskip(FILE * f, int n)
+{
+  return fseek(f, n, SEEK_CUR);
+}
+
+/***************************/
+/* Read byte/word/longword */
+/***************************/
+
+int fread_byte(FILE * f, uint8_t * data)
+{
+  if (data != NULL)
+	  return (fread((void *) data, sizeof(uint8_t), 1, f) < 1) ? -1 : 0;
+  else
+    return fskip(f, 1);
+
+  return 0;
+}
+
+int fread_word(FILE * f, uint16_t * data)
+{
+  int ret = 0;
+
+  if (data != NULL)
+  {
+	  ret = (fread((void *) data, sizeof(uint16_t), 1, f) < 1) ? -1 : 0;
+	*data = ReadHI2(*(HI2*)data);
+  }
+  else
+    ret = fskip(f, 2);
+
+  return ret;
+}
+
+int fread_long(FILE * f, uint32_t * data)
+{
+  int ret = 0;
+
+  if (data != NULL)
+  {
+	  ret = (fread((void *) data, sizeof(uint32_t), 1, f) < 1) ? -1 : 0;
+	*data = ReadHI4(*(HI4*)data);
+  }
+  else
+    ret = fskip(f, 4);
+
+  return ret;
+}
+
+/****************************/
+/* Write byte/word/longword */
+/****************************/
+
+int fwrite_byte(FILE * f, uint8_t data)
+{
+	return (fwrite(&data, sizeof(uint8_t), 1, f) < 1) ? -1 : 0;
+}
+
+int fwrite_word(FILE * f, uint16_t data)
+{
+	WriteHI2(*(HI2*)&data, data);
+	return (fwrite(&data, sizeof(uint16_t), 1, f) < 1) ? -1 : 0;
+}
+
+int fwrite_long(FILE * f, uint32_t data)
+{
+	WriteHI4(*(HI4*)&data, data);
+  return (fwrite(&data, sizeof(uint32_t), 1, f) < 1) ? -1 : 0;
+}

+ 48 - 0
external/dasm-tigcc/rwfile.h

@@ -0,0 +1,48 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: misc.h 368 2004-03-22 18:42:08Z roms $ */
+
+/*  libtifiles - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIFILES_MISC__
+#define __TIFILES_MISC__
+
+#define gfopen fopen
+
+int fread_n_bytes(FILE * f, int n, uint8_t *s);
+int fwrite_n_bytes(FILE * f, int n, const uint8_t *s);
+
+int fread_n_chars(FILE * f, int n, char *s);
+int fwrite_n_chars(FILE * f, int n, const char *s);
+int fwrite_n_chars2(FILE * f, int n, const char *s);
+
+int fread_8_chars(FILE * f, char *s);
+int fwrite_8_chars(FILE * f, const char *s);
+
+int fskip(FILE * f, int n);
+
+int fread_byte(FILE * f, uint8_t * data);
+int fread_word(FILE * f, uint16_t * data);
+int fread_long(FILE * f, uint32_t * data);
+
+int fwrite_byte(FILE * f, uint8_t data);
+int fwrite_word(FILE * f, uint16_t data);
+int fwrite_long(FILE * f, uint32_t data);
+
+#endif

+ 40 - 0
external/dasm-tigcc/sysdep.h

@@ -0,0 +1,40 @@
+/* Random host-dependent support code.
+   Copyright 1995, 1997, 2000 Free Software Foundation, Inc.
+   Written by Ken Raeburn.
+   Copyright 2007 Kevin Kofler
+
+   This file is part of libopcodes, the opcodes library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define PTR void *
+
+#ifdef __GNUC__
+#define ATTRIBUTE_FPTR_PRINTF_2 __attribute__((__format__(__printf__,2,3)))
+#define ATTRIBUTE_UNUSED __attribute__((__unused__))
+#else
+#define ATTRIBUTE_FPTR_PRINTF_2 /**/
+#define ATTRIBUTE_UNUSED /**/
+#endif
+
+extern void *xmalloc(size_t);
+extern void *xcalloc(size_t, size_t);
+
+#define ARCH_m68k

+ 66 - 0
external/dasm-tigcc/ti68k_def.h

@@ -0,0 +1,66 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: ti68k_def.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2002, Romain Liévin, Julien Blache
+ *  Copyright (c) 2003-2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+
+#ifndef __TI68K_DEFS__
+#define __TI68K_DEFS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Constants */
+
+#define MAXCHARS	256
+
+#define TI92 		(1 << 0)
+#define TI89 		(1 << 1)
+#define TI92p	 	(1 << 2)
+#define V200		(1 << 3)
+#define TI89t		(1 << 4)
+#define CALC_MAX    TI89t
+  
+#define EXTERNAL	0
+#define INTERNAL 	1
+
+#define EPROM_ROM	0
+#define FLASH_ROM 	2
+
+#define KB			(1024)
+#define MB			(1024*KB)
+
+#define HW1			1
+#define HW2			2
+#define HW3         3
+#define HW4         4
+
+#define LCDMEM_W	240		// LCD _memory_ height
+#define LCDMEM_H	128		// LCD _memory_ height
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 50 - 0
external/dasm-tigcc/ti68k_err.h

@@ -0,0 +1,50 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: ti68k_err.h 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2002, Romain Lievin, Julien Blache
+ *  Copyright (c) 2003-2004, Romain Liévin
+ *  Copyright (c) 2005-2006, Romain Liévin, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TI68K_ERRCODES__
+#define __TI68K_ERRCODES__
+
+/* Error codes ERR_...  */
+/* Error codes must begin at 768 up to 1023 */
+
+// New codes
+#define ERR_NONE				0
+#define ERR_CANT_OPEN			768
+#define ERR_INVALID_IMAGE		770
+#define ERR_INVALID_UPGRADE		771
+#define ERR_NO_IMAGE			772
+#define ERR_INVALID_ROM_SIZE	774
+#define ERR_NOT_TI_FILE			775
+#define ERR_MALLOC				776
+#define ERR_CANT_OPEN_DIR		777
+#define ERR_CANT_UPGRADE		778
+#define	ERR_INVALID_ROM			779
+
+#define ERR_CANT_OPEN_STATE		780
+#define ERR_REVISION_MATCH		781
+#define ERR_HEADER_MATCH		782
+#define ERR_STATE_MATCH			783
+
+#endif

+ 156 - 0
external/dasm-tigcc/tifiles.h

@@ -0,0 +1,156 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: tifiles.h 3205 2007-02-24 11:09:24Z roms $ */
+
+/*  libTIFILES - file format library, a part of the TiLP project
+ *  Copyright (C) 1999-2005  Romain Liévin
+ *  Copyright (C) 2007 Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __TIFILES_H__
+#define __TIFILES_H__
+
+#include <stdint.h>
+#define TIEXPORT2 /**/
+#define TICALL /**/
+
+#define FILES_NCALCS	14	// # of supported calcs
+
+/**
+ * CalcModel:
+ *
+ * An enumeration which contains the following calculator types:
+ **/
+#if !defined(__TICONV_H__)
+typedef enum 
+{
+	CALC_NONE = 0,
+	CALC_TI73, CALC_TI82, CALC_TI83, CALC_TI83P, CALC_TI84P, CALC_TI85, CALC_TI86,
+	CALC_TI89, CALC_TI89T, CALC_TI92, CALC_TI92P, CALC_V200,
+	CALC_TI84P_USB, CALC_TI89T_USB,
+} CalcModel;
+#endif
+
+/**
+ * DeviceType:
+ *
+ * An enumeration which contains soem device IDs for FLASH apps:
+ **/
+typedef enum
+{
+	DEVICE_TYPE_83P = 0x73,
+	DEVICE_TYPE_73	= 0x74,
+	DEVICE_TYPE_89  = 0x98,
+	DEVICE_TYPE_92P = 0x88,
+} DeviceType;
+
+/**
+ * FlashPage:
+ * @offset: FLASH offset (see TI link guide).
+ * @page: FLASH page (see TI link guide).
+ * @flag: see link guide.
+ * @size: length of pure data (up to 16384 bytes)
+ * @data: pure FLASH data.
+ *
+ * A generic structure used to store the content of a TI8x memory page for FLASH.
+ **/
+typedef struct 
+{
+  uint16_t	addr;
+  uint16_t	page;
+  uint8_t	flag;
+  uint16_t	size;
+  uint8_t*	data;
+
+} FlashPage;
+
+/**
+ * FlashContent:
+ * @model: a calculator model.
+ * @revision_major:
+ * @revision_minor:
+ * @flags:
+ * @object_type:
+ * @revision_day:
+ * @revision_month:
+ * @revision_year:
+ * @name: name of FLASH app or OS
+ * @device_type: a device ID
+ * @data_type: a type ID
+ * @hw_id: hardware ID (used on TI9x only, 0 otherwise)
+ * @data_length: length of pure data
+ * @data_part: pure FLASH data (TI9x only) or license or certificate
+ * @num_pages: number of FLASH pages (TI8x only)
+ * @pages: NULL-terminated array of FLASH pages (TI8x only)
+ * @next: pointer to next structure (linked list of contents)
+ *
+ * A generic structure used to store the content of a FLASH file (os or app).
+ **/
+typedef struct _FlashContent FlashContent;
+struct _FlashContent
+{
+  CalcModel		model;
+
+  //FlashHeader	header;
+  uint8_t		revision_major;
+  uint8_t		revision_minor;
+  uint8_t		flags;
+  uint8_t		object_type;
+  uint8_t		revision_day;
+  uint8_t		revision_month;
+  uint16_t		revision_year;
+  char			name[9];
+  uint8_t		device_type;
+  uint8_t		data_type;
+  uint8_t		hw_id;
+  uint32_t		data_length;
+
+  uint8_t*		data_part;	// TI9x only
+  int			num_pages;	// TI8x only
+  FlashPage**	pages;		// TI8x only
+
+  FlashContent*	next;		// TI9x only
+};
+
+/* Functions */
+
+// namespace scheme: library_class_function like tifiles_fext_get
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  /*********************/
+  /* General functions */
+  /*********************/
+
+  // filetypes.c
+  TIEXPORT2 int TICALL tifiles_file_is_ti (const char *filename);
+  TIEXPORT2 int TICALL tifiles_file_is_os(const char *filename);
+  TIEXPORT2 int TICALL tifiles_file_is_tib (const char *filename);
+  TIEXPORT2 int TICALL tifiles_file_is_flash (const char *filename);
+  TIEXPORT2 CalcModel TICALL tifiles_file_get_model (const char *filename);
+
+  // filesXX.c
+  TIEXPORT2 FlashContent* TICALL tifiles_content_create_flash(CalcModel model);
+  TIEXPORT2 int           TICALL tifiles_content_delete_flash(FlashContent *content);
+  TIEXPORT2 int TICALL tifiles_file_read_flash(const char *filename, FlashContent *content);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif

+ 57 - 0
external/dasm-tigcc/timem.c

@@ -0,0 +1,57 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: timem.c 2268 2006-11-06 17:18:51Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Liévin
+ *  Copyright (c) 2001-2003, Romain Liévin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Liévin
+ *  Copyright (c) 2007, Kevin Kofler
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/*
+    Memory access (take care of little/big endian issues)
+*/
+
+#include <stdint.h>
+
+#include "timem.h"
+#include "integers.h"
+
+/* General functions (not related to TI memory) */
+
+uint16_t rd_word(uint8_t *p)
+{
+  return ReadI2(*(TI2*)p);
+}
+
+uint32_t rd_long(uint8_t *p)
+{
+  return ReadI4(*(TI4*)p);
+}
+
+void wr_word(uint8_t *p, uint16_t d)
+{
+  WriteI2(*(TI2*)p,d);
+}
+
+void wr_long(uint8_t *p, uint32_t d)
+{
+  WriteI4(*(TI4*)p,d);
+}

+ 43 - 0
external/dasm-tigcc/timem.h

@@ -0,0 +1,43 @@
+/* Hey EMACS -*- linux-c -*- */
+/* $Id: romcalls.h 864 2005-02-22 09:54:05Z roms $ */
+
+/*  TiEmu - Tiemu Is an EMUlator
+ *
+ *  Copyright (c) 2000-2001, Thomas Corvazier, Romain Lievin
+ *  Copyright (c) 2001-2003, Romain Lievin
+ *  Copyright (c) 2003, Julien Blache
+ *  Copyright (c) 2004, Romain Liévin
+ *  Copyright (c) 2005, Romain Li�in
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __TIMEM__
+#define __TIMEM__
+
+#include <stdint.h>
+
+/*
+	Functions
+*/
+
+uint16_t rd_word(uint8_t *p);
+uint32_t rd_long(uint8_t *p);
+
+void wr_word(uint8_t *p, uint16_t d);
+void wr_long(uint8_t *p, uint32_t d);
+
+
+#endif

+ 73 - 0
external/dasm-tigcc/tt.h

@@ -0,0 +1,73 @@
+/******************************************************************************
+*
+* project name:    TIGCC Tools Suite 
+* file name:       tt.h
+* initial date:    13/08/2000
+* author:          thomas.nussbaumer@gmx.net 
+* description:     generic definitions for TIGCC Tools Suite
+*
+******************************************************************************/
+
+/*
+  This file is part of the TIGCC Tools Suite.
+
+  This file is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  As a special exception, UNMODIFIED copies of some TIGCC Tools Suite utilities
+  may also be redistributed or sold without source code, for any purpose. (The
+  Lesser General Public License restrictions do apply in other respects; for
+  example, they cover modification of the program.) Please refer to the main
+  source file for the individual utility as to whether this is the case for a
+  particular tool. This exception notice must be removed on modified copies of
+  this file.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#ifndef __TT_H__
+#define __TT_H__
+
+#define CALC_TI89    0
+#define CALC_TI92P   1
+
+#define SIGNATURE_TI89   "**TI89**"
+#define SIGNATURE_TI92P  "**TI92P*" 
+
+#define DEFAULT_FOLDER   "main"
+
+#define DEFAULT_ITEMS_PER_LINE  10
+
+#define USAGE_OUT  stdout
+
+#endif
+
+//#############################################################################
+//###################### NO MORE FAKES BEYOND THIS LINE #######################
+//#############################################################################
+//
+//=============================================================================
+// Revision History
+//=============================================================================
+//
+// Revision 1.3  2000/08/23 20:29:43  Thomas Nussbaumer
+// added a 'P' to the TI92p definitions
+//
+// Revision 1.2  2000/08/23 01:04:41  Thomas Nussbaumer
+// corrected signature of TI92p
+//
+// Revision 1.1  2000/08/13 20:24:16  Thomas Nussbaumer
+// initial version
+//
+//
+//
+//

+ 32 - 0
external/dasm-tigcc/xmalloc.c

@@ -0,0 +1,32 @@
+ /*
+  * UAE - The Un*x Amiga Emulator
+  *
+  * Various stuff missing in some OSes.
+  *
+  * Copyright 1997 Bernd Schmidt
+  */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include "sysdep.h"
+
+void *xmalloc(size_t n)
+{
+    void *a = malloc (n);
+    if (a == NULL) {
+	fprintf (stderr, "virtual memory exhausted\n");
+	abort ();
+    }
+    return a;
+}
+
+void *xcalloc (size_t n, size_t size)
+{
+    void *a = calloc (n, size);
+    if (a == NULL) {
+	fprintf (stderr, "virtual memory exhausted\n");
+	abort ();
+    }
+    return a;
+}