mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-25 02:33:09 +00:00
Import cxmon-3.2 source.
This commit is contained in:
parent
d73ff7c871
commit
041fb86fdf
8
cxmon/AUTHORS
Normal file
8
cxmon/AUTHORS
Normal file
@ -0,0 +1,8 @@
|
||||
'mon' was written by
|
||||
Christian Bauer <www.cebix.net>
|
||||
Marc Hellwig <Marc.Hellwig@uni-mainz.de>
|
||||
|
||||
with contributions from
|
||||
Gwenolé Beauchesne (64-bit support and PPC extensions)
|
||||
|
||||
The 680x0 and 80x86 disassemblers are taken from GNU binutils.
|
340
cxmon/COPYING
Normal file
340
cxmon/COPYING
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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
|
||||
|
||||
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-1307 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.
|
20
cxmon/ChangeLog
Normal file
20
cxmon/ChangeLog
Normal file
@ -0,0 +1,20 @@
|
||||
V3.2 - 64-bit fixes to 680x0 disassembler, added AltiVec instructions to PPC
|
||||
disassembler, fixes to Z80 disassembler (hl->ix/iy and relative jumps)
|
||||
V3.1 - Make LowMem globals as predefined variables, fix 64-bit support, enable
|
||||
x86-64 disassembler with "d8664" command, removed input line length
|
||||
restrictions
|
||||
V3.0 - Replaced 680x0 and 80x86 disassemblers with the ones from GNU binutils,
|
||||
added symbolic display of MacOS low memory globals to PPC disassembler,
|
||||
MacOS features in PPC disassembler are controlled by "-m" argument,
|
||||
real memory mode is entered by "-r" argument, extended 8080 disassembler
|
||||
to Z80, name changed from "mon" to "cxmon"
|
||||
V2.2 - Switched to autoconf/automake, fixed some minor bugs in the PPC
|
||||
disassembler, commands made modular, added binary dump (b) command
|
||||
V2.1 - Compiled for BeOS R4, opens Terminal window when started from Tracker,
|
||||
implemented 8080 disassembler, included Unix makefile
|
||||
V2.0 - Unified PPC and x86 release
|
||||
V1.5 - Non-interactive mode, real mode
|
||||
V1.4 - Implemented 6502 and 680x0 disassemblers
|
||||
V1.3 - Now uses libreadline
|
||||
Disassembler: prints SPR names instead of numbers, fixed bugs
|
||||
V1.0 - Initial release
|
182
cxmon/INSTALL
Normal file
182
cxmon/INSTALL
Normal file
@ -0,0 +1,182 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
20
cxmon/Makefile.am
Normal file
20
cxmon/Makefile.am
Normal file
@ -0,0 +1,20 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
SUBDIRS = src
|
||||
|
||||
# Requires automake 1.5
|
||||
AUTOMAKE_OPTIONS = foreign 1.5
|
||||
|
||||
# Manpages
|
||||
man_MANS = cxmon.1
|
||||
|
||||
EXTRA_DIST = cxmon.1
|
||||
|
||||
dist-hook: cxmon.spec
|
||||
cp cxmon.spec $(distdir)
|
||||
|
||||
# Rule to build tar-gzipped distribution package
|
||||
$(PACKAGE)-$(VERSION).tar.gz: dist
|
||||
|
||||
# Rule to build RPM distribution package
|
||||
rpm: $(PACKAGE)-$(VERSION).tar.gz
|
||||
rpm -ta --clean $(PACKAGE)-$(VERSION).tar.gz
|
657
cxmon/Makefile.in
Normal file
657
cxmon/Makefile.in
Normal file
@ -0,0 +1,657 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = .
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = .
|
||||
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
|
||||
$(srcdir)/cxmon.spec.in $(top_srcdir)/configure AUTHORS \
|
||||
COPYING ChangeLog INSTALL depcomp install-sh missing
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno configure.status.lineno
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = cxmon.spec
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
man1dir = $(mandir)/man1
|
||||
am__installdirs = "$(DESTDIR)$(man1dir)"
|
||||
NROFF = nroff
|
||||
MANS = $(man_MANS)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
am__remove_distdir = \
|
||||
{ test ! -d $(distdir) \
|
||||
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
|
||||
&& rm -fr $(distdir); }; }
|
||||
DIST_ARCHIVES = $(distdir).tar.gz
|
||||
GZIP_ENV = --best
|
||||
distuninstallcheck_listfiles = find . -type f -print
|
||||
distcleancheck_listfiles = find . -type f -print
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = src
|
||||
|
||||
# Requires automake 1.5
|
||||
AUTOMAKE_OPTIONS = foreign 1.5
|
||||
|
||||
# Manpages
|
||||
man_MANS = cxmon.1
|
||||
EXTRA_DIST = cxmon.1
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
|
||||
cd $(srcdir) && $(AUTOMAKE) --foreign \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: $(am__configure_deps)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
cxmon.spec: $(top_builddir)/config.status $(srcdir)/cxmon.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
uninstall-info-am:
|
||||
install-man1: $(man1_MANS) $(man_MANS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
|
||||
else file=$$i; fi; \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
uninstall-man1:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
|
||||
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
|
||||
for i in $$l2; do \
|
||||
case "$$i" in \
|
||||
*.1*) list="$$list $$i" ;; \
|
||||
esac; \
|
||||
done; \
|
||||
for i in $$list; do \
|
||||
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
|
||||
case "$$ext" in \
|
||||
1*) ;; \
|
||||
*) ext='1' ;; \
|
||||
esac; \
|
||||
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
|
||||
inst=`echo $$inst | sed -e 's/^.*\///'`; \
|
||||
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
|
||||
echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
|
||||
rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
|
||||
done
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkdir_p) $(distdir)/.
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$(top_distdir)" distdir="$(distdir)" \
|
||||
dist-hook
|
||||
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
|
||||
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
|
||||
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|
||||
|| chmod -R a+r $(distdir)
|
||||
dist-gzip: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-bzip2: distdir
|
||||
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-tarZ: distdir
|
||||
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-shar: distdir
|
||||
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist-zip: distdir
|
||||
-rm -f $(distdir).zip
|
||||
zip -rq $(distdir).zip $(distdir)
|
||||
$(am__remove_distdir)
|
||||
|
||||
dist dist-all: distdir
|
||||
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
|
||||
$(am__remove_distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
case '$(DIST_ARCHIVES)' in \
|
||||
*.tar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
|
||||
*.tar.bz2*) \
|
||||
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
|
||||
*.tar.Z*) \
|
||||
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
|
||||
*.shar.gz*) \
|
||||
GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
|
||||
*.zip*) \
|
||||
unzip $(distdir).zip ;;\
|
||||
esac
|
||||
chmod -R a-w $(distdir); chmod a+w $(distdir)
|
||||
mkdir $(distdir)/_build
|
||||
mkdir $(distdir)/_inst
|
||||
chmod a-w $(distdir)
|
||||
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
|
||||
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
|
||||
&& cd $(distdir)/_build \
|
||||
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
|
||||
$(DISTCHECK_CONFIGURE_FLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
|
||||
distuninstallcheck \
|
||||
&& chmod -R a-w "$$dc_install_base" \
|
||||
&& ({ \
|
||||
(cd ../.. && umask 077 && mkdir "$$dc_destdir") \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
|
||||
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
|
||||
} || { rm -rf "$$dc_destdir"; exit 1; }) \
|
||||
&& rm -rf "$$dc_destdir" \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist \
|
||||
&& rm -rf $(DIST_ARCHIVES) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
|
||||
$(am__remove_distdir)
|
||||
@(echo "$(distdir) archives ready for distribution: "; \
|
||||
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
|
||||
sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
|
||||
distuninstallcheck:
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
echo " (check DESTDIR support)"; \
|
||||
fi ; \
|
||||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(MANS) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(man1dir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am: install-man
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man: install-man1
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am uninstall-man
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
uninstall-man: uninstall-man1
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
|
||||
check-am clean clean-generic clean-recursive ctags \
|
||||
ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
|
||||
dist-shar dist-tarZ dist-zip distcheck distclean \
|
||||
distclean-generic distclean-hdr distclean-recursive \
|
||||
distclean-tags distcleancheck distdir distuninstallcheck dvi \
|
||||
dvi-am html html-am info info-am install install-am \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-man1 \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-generic \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am uninstall-man \
|
||||
uninstall-man1
|
||||
|
||||
|
||||
dist-hook: cxmon.spec
|
||||
cp cxmon.spec $(distdir)
|
||||
|
||||
# Rule to build tar-gzipped distribution package
|
||||
$(PACKAGE)-$(VERSION).tar.gz: dist
|
||||
|
||||
# Rule to build RPM distribution package
|
||||
rpm: $(PACKAGE)-$(VERSION).tar.gz
|
||||
rpm -ta --clean $(PACKAGE)-$(VERSION).tar.gz
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
437
cxmon/README
Normal file
437
cxmon/README
Normal file
@ -0,0 +1,437 @@
|
||||
|
||||
cxmon, Version 3.2
|
||||
A command-line file manipulation tool and disassembler
|
||||
|
||||
Copyright (C) 1997-2007 Christian Bauer, Marc Hellwig
|
||||
GNU binutils disassemblers Copyright (C) 1988, 89, 91, 93, 94, 95, 96, 97, 1998
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
cxmon is available under the terms of the GNU General Public License. See the
|
||||
file "COPYING" that is included in the distribution for details.
|
||||
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
cxmon is an interactive command-driven file manipulation tool that is
|
||||
inspired by the "Amiga Monitor" by Timo Rossi. It has commands and features
|
||||
similar to a machine code monitor/debugger, but it lacks any functions for
|
||||
running/tracing code. There are, however, built-in PowerPC, 680x0, 80x86,
|
||||
x86-64, 6502 and Z80 disassemblers and special support for disassembling
|
||||
MacOS code. By default, cxmon operates on a fixed-size (but adjustable)
|
||||
memory buffer with adresses starting at 0.
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Please consult the file "INSTALL" for installation instructions.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
cxmon can be started from the Shell or from the Tracker (BeOS), but command
|
||||
line history doesn't work when started from the Tracker.
|
||||
|
||||
Options:
|
||||
-m enables symbolic MacOS A-Trap and low memory globals display in the
|
||||
680x0 disassembler
|
||||
-r makes cxmon operate in real (virtual) memory space instead of an
|
||||
allocated buffer
|
||||
|
||||
If no additional command line arguments are given, cxmon enters interactive
|
||||
mode. Otherwise, all remaining arguments are interpreted and executed as cxmon
|
||||
commands.
|
||||
|
||||
The default buffer size is 1MB.
|
||||
|
||||
The cxmon command prompt looks like this:
|
||||
|
||||
[00000000]->
|
||||
|
||||
The number in brackets is the value of "." (the "current address", see the
|
||||
section on expressions). You can get a short command overview by entering
|
||||
"h".
|
||||
|
||||
Commands that create a longer output can be interrupted with Ctrl-C.
|
||||
|
||||
To quit cxmon, enter the command "x".
|
||||
|
||||
|
||||
Constants, variables and expressions
|
||||
------------------------------------
|
||||
|
||||
The default number base is hexadecimal. Decimal numbers must be prefixed with
|
||||
"_". Hexadecimal numbers may also be prefixed with "$" for clarity. Numbers
|
||||
can also be entered as ASCII characters enclosed in single quotes (e.g. 'BAPP'
|
||||
is the same as $42415050). All numbers are 32-bit values (one word).
|
||||
|
||||
With the "set" command, variables can be defined that hold 32-bit integer
|
||||
values. A variable is referred to by its name. Variable names may be arbitrary
|
||||
combinations of digits and letters (they may also start with a digit) that
|
||||
are not also valid hexadecimal numbers. Names are case-sensitive.
|
||||
|
||||
cxmon accepts expressions in all places where you have to specify a number.
|
||||
The following operators are available and have the same meaning and
|
||||
precedence as in the C programming language:
|
||||
|
||||
~ complement
|
||||
+ unary plus
|
||||
- unary minus
|
||||
* multiplication
|
||||
/ integer division
|
||||
% modulo
|
||||
+ addition
|
||||
- subtraction
|
||||
<< shift left
|
||||
>> shift right
|
||||
& bitwise AND
|
||||
^ bitwise exclusive OR
|
||||
| bitwise inclusive OR
|
||||
|
||||
Parentheses may be used to change the evaluation order of sub-expressions.
|
||||
|
||||
There are two special symbols that can be used in expressions:
|
||||
|
||||
. represents the "current address" (the value of "." is also displayed in
|
||||
the command prompt). What exactly the current address is, depends on the
|
||||
command last executed. The display commands set "." to the address after
|
||||
the last address displayed, the "hunt" commands sets "." to the address
|
||||
of the first found occurence of the search string, etc.
|
||||
: is used by the "apply" ("y") command and holds the value of the byte/
|
||||
half-word/word at the current address.
|
||||
|
||||
The "modify" (":"), "fill" ("f") and "hunt" ("h") commands require you to
|
||||
specify a byte string. Byte strings consist of an arbitrary number of byte
|
||||
values and ASCII strings separated by commas. Examples:
|
||||
|
||||
"string"
|
||||
12,34,56,78,9a,bc,de,f0
|
||||
"this",0a,"is a string",0a,"with","newlines",_10
|
||||
|
||||
|
||||
The buffer
|
||||
----------
|
||||
|
||||
Those cxmon commands that operate on "memory" operate on a buffer allocated
|
||||
by cxmon whose size is adjustable with the "@" command. The default buffer
|
||||
size is 1MB. The buffer is an array of bytes where each byte has a 32-bit
|
||||
integer address. Addresses start at 0 and are taken modulo the buffer size
|
||||
(i.e. for the default 1MB buffer, addresses 0 and 100000 refer to the same
|
||||
byte).
|
||||
|
||||
The buffer is the working area of cxmon where you load files into, manipulate
|
||||
them, and write files back from. Arbitraty portions of the buffer may be used
|
||||
as scratch space.
|
||||
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
The following commands are available in cxmon ('[]' marks a parameter than
|
||||
can be left out):
|
||||
|
||||
|
||||
x Quit cxmon
|
||||
|
||||
quits cxmon and returns to the shell.
|
||||
|
||||
|
||||
h Show help text
|
||||
|
||||
displays a short overview of commands.
|
||||
|
||||
|
||||
?? Show list of commands
|
||||
|
||||
displays a short list of available commands.
|
||||
|
||||
|
||||
ver Show version
|
||||
|
||||
shows the version number of cxmon.
|
||||
|
||||
|
||||
? expression Calculate expression
|
||||
|
||||
displays the value of the given expression in hex, decimal, and ASCII
|
||||
characters. If the value is negative, it is displayed as a signed and unsigned
|
||||
number.
|
||||
|
||||
|
||||
@ [size] Reallocate buffer
|
||||
|
||||
changes the size of the buffer to the given number of bytes while preserving
|
||||
the contents of the buffer. If the "size" argument is omitted, the current
|
||||
buffer size is displayed.
|
||||
|
||||
|
||||
i [start [end]] ASCII memory dump
|
||||
|
||||
displays the buffer contents from address "start" to address "end" as ASCII
|
||||
characters. Entering "i" without arguments is equivalent to "i .". The value
|
||||
of "." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
b [start [end]] Binary memory dump
|
||||
|
||||
displays the buffer contents from address "start" to address "end" in a binary
|
||||
format. Entering "b" without arguments is equivalent to "b .". The value of
|
||||
"." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
m [start [end]] Hex/ASCII memory dump
|
||||
|
||||
displays the buffer contents from address "start" to address "end" as hex
|
||||
words and ASCII characters. Entering "m" without arguments is equivalent to
|
||||
"m .". The value of "." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d [start [end]] Disassemble PowerPC code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d" without arguments is equivalent to "d .". The value of "." is
|
||||
set to the address after the last address displayed.
|
||||
|
||||
|
||||
d65 [start [end]] Disassemble 6502 code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d65" without arguments is equivalent to "d65 .". The value of
|
||||
"." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d68 [start [end]] Disassemble 680x0 code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d68" without arguments is equivalent to "d68 .". The value of
|
||||
"." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d80 [start [end]] Disassemble Z80 code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d80" without arguments is equivalent to "d80 .". The value of
|
||||
"." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d86 [start [end]] Disassemble 80x86 (32-bit) code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d86" without arguments is equivalent to "d86 .". The value of
|
||||
"." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d8086 [start [end]] Disassemble 80x86 (16-bit) code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d8086" without arguments is equivalent to "d8086 .". The value
|
||||
of "." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
d8664 [start [end]] Disassemble x86-64 code
|
||||
|
||||
disassembles the buffer contents from address "start" to address "end".
|
||||
Entering "d8086" without arguments is equivalent to "d8086 .". The value
|
||||
of "." is set to the address after the last address displayed.
|
||||
|
||||
|
||||
: start string Modify memory
|
||||
|
||||
puts the specified byte string at the address "start" into the buffer. The
|
||||
value of "." is set to the address after the last address modified.
|
||||
|
||||
|
||||
f start end string Fill memory
|
||||
|
||||
fill the buffer in the range from "start" to (and including) "end" with the
|
||||
given byte string.
|
||||
|
||||
|
||||
y[b|h|w] start end expr Apply expression to memory
|
||||
|
||||
works like the "fill" ("f") command, but it doesn't fill with a byte string
|
||||
but with the value of an expression that is re-evaluated for each buffer
|
||||
location to be filled. The command comes in three flavors: "y"/"yb" works on
|
||||
bytes (8-bit), "yh" on half-words (16-bit) and "yw" on words (32-bit). The
|
||||
value of "." is the current address to be modified, the value of ":" holds
|
||||
the contents of this address before modification.
|
||||
|
||||
Examples:
|
||||
yw 0 fff :<<8 shifts all words in the address range 0..fff to the left
|
||||
by 8 bits (you can use this to convert bitmap data from
|
||||
ARGB to RGBA format, for example)
|
||||
y 0 1234 ~: inverts all bytes in the address range 0..1234
|
||||
yh 2 ff 20000/. creates a table of the fractional parts of the reciprocals
|
||||
of 1..7f
|
||||
|
||||
|
||||
t start end dest Transfer memory
|
||||
|
||||
transfers the buffer contents from "start" to (and including) "end" to "dest".
|
||||
Source and destination may overlap.
|
||||
|
||||
|
||||
c start end dest Compare memory
|
||||
|
||||
compares the buffer contents in the range from "start" to (and including)
|
||||
"end" with the contents at "dest". The addresses of all different bytes and
|
||||
the total number of differences (decimal) are printed.
|
||||
|
||||
|
||||
h start end string Search for byte string
|
||||
|
||||
searches for the given byte string in the buffer starting at "start" up to
|
||||
(and including) "end". The addresses and the total number of occurrences are
|
||||
displayed. The value of "." is set to the address of the first occurrence.
|
||||
|
||||
|
||||
\ "command" Execute shell command
|
||||
|
||||
executes the given shell command which must be enclosed in quotes.
|
||||
|
||||
|
||||
ls [args] List directory contents
|
||||
|
||||
works as the shell command "ls".
|
||||
|
||||
|
||||
rm [args] Remove file(s)
|
||||
|
||||
works as the shell command "rm".
|
||||
|
||||
|
||||
cp [args] Copy file(s)
|
||||
|
||||
works as the shell command "cp".
|
||||
|
||||
|
||||
mv [args] Move file(s)
|
||||
|
||||
works as the shell command "mv".
|
||||
|
||||
|
||||
cd directory Change current directory
|
||||
|
||||
works as the shell command "cd". The name of the directory doesn't have to be
|
||||
enclosed in quotes.
|
||||
|
||||
|
||||
o ["file"] Redirect output
|
||||
|
||||
When a file name is specified, all following output is redirected to this
|
||||
file. The file name must be enclosed in quotation marks even if it contains
|
||||
no spaces. Entering "o" without parameters closes the file and directs the
|
||||
output into the terminal window again.
|
||||
|
||||
|
||||
[ start "file" Load data from file
|
||||
|
||||
loads the contents of the specified file into the buffer starting from address
|
||||
"start". The file name must be enclosed in quotation marks even if it contains
|
||||
no spaces. The value of "." is set to the address after the last address
|
||||
affected by the load.
|
||||
|
||||
|
||||
] start size "file" Save data to file
|
||||
|
||||
writes "size" number of bytes of the buffer from "start" to the specified file.
|
||||
The file name must be enclosed in quotation marks even if it contains no spaces.
|
||||
|
||||
|
||||
set [var[=value]] Set/clear/show variables
|
||||
|
||||
If no arguments are given, all currently defined variables are displayed.
|
||||
Otherwise, the value of "var" is set to the specified value. If "=value"
|
||||
is omitted, the variable "var" is cleared.
|
||||
|
||||
|
||||
cv Clear all variables
|
||||
|
||||
clears all currently defined variables.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
Here are some simple examples for what is possible with cxmon.
|
||||
|
||||
Join "file1" and "file2" to "file3":
|
||||
|
||||
[ 0 "file1"
|
||||
[ . "file2"
|
||||
] 0 . "file3"
|
||||
|
||||
Remove the first 24 bytes (e.g. an unneeded header) of a file:
|
||||
|
||||
[ 0 "file"
|
||||
] 18 .-18 "file"
|
||||
|
||||
Load the cxmon executable and search for PowerPC "nop" commands:
|
||||
|
||||
[ 0 "cxmon"
|
||||
h 0 . 60,00,00,00
|
||||
|
||||
Create a modified version of cxmon so that the prompt has " $" instead of
|
||||
"->":
|
||||
|
||||
[ 0 "cxmon"
|
||||
set size=.
|
||||
h 0 . "->"
|
||||
: . " $"
|
||||
] 0 size "cxmon1"
|
||||
|
||||
Convert a binary file which contains 16-bit numbers in little-endian format
|
||||
to big-endian format (or vice-versa):
|
||||
|
||||
[ 0 "file"
|
||||
yh 0 .-1 :>>8|:<<8
|
||||
] 0 . "file"
|
||||
|
||||
Load a BeBox boot ROM image and start disassembling the system reset handler:
|
||||
|
||||
[ 0 "bootnub.image"
|
||||
d 100
|
||||
|
||||
|
||||
Using cxmon in your own programs
|
||||
--------------------------------
|
||||
|
||||
cxmon provides a simple interface for integration in other programs. It can,
|
||||
for example, be used as a monitor/debugger for an emulator (it is used in
|
||||
Basilisk II in this way).
|
||||
|
||||
Here's how to do it (all functions are defined in the mon.h header file):
|
||||
|
||||
1. Link all the cxmon object files, except main.o, to your program.
|
||||
2. In your program, call mon_init() before using any other cxmon functions.
|
||||
3. After calling mon_init(), set the mon_read_byte and mon_write_byte
|
||||
function pointers to the routines used for accessing memory.
|
||||
4. You can use mon_add_command() to add new commands to cxmon by specifying
|
||||
the command name, function and help text. From within your command
|
||||
function, you can use mon_get_token() and mon_expression() to parse the
|
||||
arguments and the mon_read/write_*() functions to access memory.
|
||||
5. To enter cxmon, call the mon() function like this:
|
||||
|
||||
char *args[3] = {"mon", "-r", NULL};
|
||||
mon(2, args);
|
||||
|
||||
6. If you're done with cxmon, call mon_exit().
|
||||
|
||||
|
||||
History
|
||||
-------
|
||||
|
||||
Please consult the file "ChangeLog" for the release history.
|
||||
|
||||
|
||||
Christian Bauer
|
||||
www.cebix.net
|
||||
|
||||
Marc Hellwig
|
||||
<Marc.Hellwig@uni-mainz.de>
|
862
cxmon/aclocal.m4
vendored
Normal file
862
cxmon/aclocal.m4
vendored
Normal file
@ -0,0 +1,862 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.6])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])
|
||||
AC_SUBST([$1_FALSE])
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.58])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||
#
|
||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||
# created by `make install' are always world readable, even if the
|
||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||
# This was a mistake. There are at least two reasons why we must not
|
||||
# use `-m 0755':
|
||||
# - it causes special bits like SGID to be ignored,
|
||||
# - it may be too restrictive (some setups expect 775 directories).
|
||||
#
|
||||
# Do not use -m 0755 and let people choose whatever they expect by
|
||||
# setting umask.
|
||||
#
|
||||
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
||||
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
||||
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
||||
# concurrently, both version can detect that a/ is missing, but only
|
||||
# one can create it and the other will error out. Consequently we
|
||||
# restrict ourselves to GNU make (using the --version option ensures
|
||||
# this.)
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([mkdir_p])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
100
cxmon/config.h.in
Normal file
100
cxmon/config.h.in
Normal file
@ -0,0 +1,100 @@
|
||||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <history.h> header file. */
|
||||
#undef HAVE_HISTORY_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `curses' library (-lcurses). */
|
||||
#undef HAVE_LIBCURSES
|
||||
|
||||
/* Define to 1 if you have the `Hcurses' library (-lHcurses). */
|
||||
#undef HAVE_LIBHCURSES
|
||||
|
||||
/* Define to 1 if you have the `ncurses' library (-lncurses). */
|
||||
#undef HAVE_LIBNCURSES
|
||||
|
||||
/* Define to 1 if you have the `readline' library (-lreadline). */
|
||||
#undef HAVE_LIBREADLINE
|
||||
|
||||
/* Define to 1 if you have the `termcap' library (-ltermcap). */
|
||||
#undef HAVE_LIBTERMCAP
|
||||
|
||||
/* Define to 1 if you have the `terminfo' library (-lterminfo). */
|
||||
#undef HAVE_LIBTERMINFO
|
||||
|
||||
/* Define to 1 if you have the `termlib' library (-ltermlib). */
|
||||
#undef HAVE_LIBTERMLIB
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <readline.h> header file. */
|
||||
#undef HAVE_READLINE_H
|
||||
|
||||
/* Define to 1 if you have the <readline/history.h> header file. */
|
||||
#undef HAVE_READLINE_HISTORY_H
|
||||
|
||||
/* Define to 1 if you have the <readline/readline.h> header file. */
|
||||
#undef HAVE_READLINE_READLINE_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of a `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of a `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of a `long long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG_LONG
|
||||
|
||||
/* The size of a `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of a `void *', as computed by sizeof. */
|
||||
#undef SIZEOF_VOID_P
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
8368
cxmon/configure
vendored
Executable file
8368
cxmon/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
49
cxmon/configure.ac
Normal file
49
cxmon/configure.ac
Normal file
@ -0,0 +1,49 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl Written in 2000 by Christian Bauer
|
||||
|
||||
AC_INIT
|
||||
AC_CONFIG_SRCDIR(src/mon.cpp)
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
dnl This defines PACKAGE and VERSION.
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
AM_INIT_AUTOMAKE([cxmon], [3.2])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CXXCPP
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_RANLIB
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(unistd.h readline.h history.h readline/readline.h readline/history.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
|
||||
dnl Checks for libraries.
|
||||
AC_CHECK_LIB(ncurses, tgetent, ,
|
||||
AC_CHECK_LIB(termcap, tgetent, ,
|
||||
AC_CHECK_LIB(termlib, tgetent, ,
|
||||
AC_CHECK_LIB(terminfo, tgetent, ,
|
||||
AC_CHECK_LIB(Hcurses, tgetent, ,
|
||||
AC_CHECK_LIB(curses, tgetent))))))
|
||||
AC_CHECK_LIB(readline, readline)
|
||||
|
||||
dnl Generate Makefile.
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
cxmon.spec
|
||||
src/Makefile
|
||||
src/disass/Makefile
|
||||
])
|
||||
|
||||
dnl Print summary.
|
||||
echo "Configuration done. Now type \"make\"."
|
56
cxmon/cxmon.1
Normal file
56
cxmon/cxmon.1
Normal file
@ -0,0 +1,56 @@
|
||||
.TH cxmon 1 "January, 2007"
|
||||
.SH NAME
|
||||
cxmon \- a command-line file manipulation tool and disassembler
|
||||
.SH SYNOPSIS
|
||||
.B cxmon
|
||||
[\-m] [\-r]
|
||||
.RI [ commands\&... ]
|
||||
.SH DESCRIPTION
|
||||
.B cxmon
|
||||
is an interactive command-driven file manipulation tool that is inspired by
|
||||
the "Amiga Monitor" by Timo Rossi. It has commands and features similar to a
|
||||
machine code monitor/debugger, but it lacks any functions for running/tracing
|
||||
code. There are, however, built-in PowerPC, 680x0, 80x86, 6502 and Z80
|
||||
disassemblers and special support for disassembling MacOS code. By default,
|
||||
cxmon operates on a fixed-size (but adjustable) memory buffer with adresses
|
||||
starting at 0.
|
||||
.PP
|
||||
Type "h" to get a list of supported commands.
|
||||
.PP
|
||||
For more information, see the included "README" file.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B \-m
|
||||
enables symbolic MacOS A-Trap and low memory globals display in the 680x0
|
||||
disassembler
|
||||
.TP
|
||||
.B \-r
|
||||
makes cxmon operate in real (virtual) memory space instead of an allocated
|
||||
buffer
|
||||
.PP
|
||||
If no additional command line arguments are given, cxmon enters interactive
|
||||
mode. Otherwise, all remaining arguments are interpreted and executed as cxmon
|
||||
commands.
|
||||
.SH AUTHORS
|
||||
Christian Bauer <www.cebix.net>
|
||||
.br
|
||||
Marc Hellwig <Marc.Hellwig@uni-mainz.de>
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1997-2007 Christian Bauer, Marc Hellwig
|
||||
.br
|
||||
GNU binutils disassemblers Copyright \(co 1988, 89, 91, 93, 94, 95, 96, 97, 1998
|
||||
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
42
cxmon/cxmon.spec
Normal file
42
cxmon/cxmon.spec
Normal file
@ -0,0 +1,42 @@
|
||||
%define name cxmon
|
||||
%define version 3.2
|
||||
%define release 1
|
||||
|
||||
Summary: Command-line file manipulation tool and disassembler
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
License: GPL
|
||||
Group: Utilities/File
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: http://cxmon.cebix.net/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Prefix: %{_prefix}
|
||||
|
||||
%description
|
||||
cxmon is an interactive command-driven file manipulation tool that is
|
||||
inspired by the "Amiga Monitor" by Timo Rossi. It has commands and features
|
||||
similar to a machine code monitor/debugger, but it lacks any functions for
|
||||
running/tracing code. There are, however, built-in PowerPC, 680x0, 80x86,
|
||||
x86-64, 6502 and Z80 disassemblers and special support for disassembling
|
||||
MacOS code.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
%makeinstall
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS ChangeLog COPYING README
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
42
cxmon/cxmon.spec.in
Normal file
42
cxmon/cxmon.spec.in
Normal file
@ -0,0 +1,42 @@
|
||||
%define name @PACKAGE@
|
||||
%define version @VERSION@
|
||||
%define release 1
|
||||
|
||||
Summary: Command-line file manipulation tool and disassembler
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
License: GPL
|
||||
Group: Utilities/File
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
URL: http://cxmon.cebix.net/
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Prefix: %{_prefix}
|
||||
|
||||
%description
|
||||
cxmon is an interactive command-driven file manipulation tool that is
|
||||
inspired by the "Amiga Monitor" by Timo Rossi. It has commands and features
|
||||
similar to a machine code monitor/debugger, but it lacks any functions for
|
||||
running/tracing code. There are, however, built-in PowerPC, 680x0, 80x86,
|
||||
x86-64, 6502 and Z80 disassemblers and special support for disassembling
|
||||
MacOS code.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
%configure
|
||||
make
|
||||
|
||||
%install
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
%makeinstall
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc AUTHORS ChangeLog COPYING README
|
||||
%{_bindir}/*
|
||||
%{_mandir}/man1/*
|
530
cxmon/depcomp
Executable file
530
cxmon/depcomp
Executable file
@ -0,0 +1,530 @@
|
||||
#! /bin/sh
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
|
||||
scriptversion=2005-07-09.11
|
||||
|
||||
# Copyright (C) 1999, 2000, 2003, 2004, 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, 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.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
|
||||
|
||||
case $1 in
|
||||
'')
|
||||
echo "$0: No command. Try \`$0 --help' for more information." 1>&2
|
||||
exit 1;
|
||||
;;
|
||||
-h | --h*)
|
||||
cat <<\EOF
|
||||
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
|
||||
|
||||
Run PROGRAMS ARGS to compile a file, generating dependencies
|
||||
as side-effects.
|
||||
|
||||
Environment variables:
|
||||
depmode Dependency tracking mode.
|
||||
source Source file read by `PROGRAMS ARGS'.
|
||||
object Object file output by `PROGRAMS ARGS'.
|
||||
DEPDIR directory where to store dependencies.
|
||||
depfile Dependency file to output.
|
||||
tmpdepfile Temporary file to use when outputing dependencies.
|
||||
libtool Whether libtool is used (yes/no).
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>.
|
||||
EOF
|
||||
exit $?
|
||||
;;
|
||||
-v | --v*)
|
||||
echo "depcomp $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
|
||||
echo "depcomp: Variables source, object and depmode must be set" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
|
||||
depfile=${depfile-`echo "$object" |
|
||||
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
|
||||
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
|
||||
|
||||
rm -f "$tmpdepfile"
|
||||
|
||||
# Some modes work just like other modes, but use different flags. We
|
||||
# parameterize here, but still list the modes in the big case below,
|
||||
# to make depend.m4 easier to write. Note that we *cannot* use a case
|
||||
# here, because this file can only contain one case statement.
|
||||
if test "$depmode" = hp; then
|
||||
# HP compiler uses -M and no extra arg.
|
||||
gccflag=-M
|
||||
depmode=gcc
|
||||
fi
|
||||
|
||||
if test "$depmode" = dashXmstdout; then
|
||||
# This is just like dashmstdout with a different argument.
|
||||
dashmflag=-xM
|
||||
depmode=dashmstdout
|
||||
fi
|
||||
|
||||
case "$depmode" in
|
||||
gcc3)
|
||||
## gcc 3 implements dependency tracking that does exactly what
|
||||
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
|
||||
## it if -MD -MP comes after the -MF stuff. Hmm.
|
||||
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
mv "$tmpdepfile" "$depfile"
|
||||
;;
|
||||
|
||||
gcc)
|
||||
## There are various ways to get dependency output from gcc. Here's
|
||||
## why we pick this rather obscure method:
|
||||
## - Don't want to use -MD because we'd like the dependencies to end
|
||||
## up in a subdir. Having to rename by hand is ugly.
|
||||
## (We might end up doing this anyway to support other compilers.)
|
||||
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
|
||||
## -MM, not -M (despite what the docs say).
|
||||
## - Using -M directly means running the compiler twice (even worse
|
||||
## than renaming).
|
||||
if test -z "$gccflag"; then
|
||||
gccflag=-MD,
|
||||
fi
|
||||
"$@" -Wp,"$gccflag$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
|
||||
## The second -e expression handles DOS-style file names with drive letters.
|
||||
sed -e 's/^[^:]*: / /' \
|
||||
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
|
||||
## This next piece of magic avoids the `deleted header file' problem.
|
||||
## The problem is that when a header file which appears in a .P file
|
||||
## is deleted, the dependency causes make to die (because there is
|
||||
## typically no way to rebuild the header). We avoid this by adding
|
||||
## dummy dependencies for each header file. Too bad gcc doesn't do
|
||||
## this for us directly.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" |
|
||||
## Some versions of gcc put a space before the `:'. On the theory
|
||||
## that the space means something, we add a space to the output as
|
||||
## well.
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
hp)
|
||||
# This case exists only to let depend.m4 do its work. It works by
|
||||
# looking at the text of this script. This case will never be run,
|
||||
# since it is checked for above.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
sgi)
|
||||
if test "$libtool" = yes; then
|
||||
"$@" "-Wp,-MDupdate,$tmpdepfile"
|
||||
else
|
||||
"$@" -MDupdate "$tmpdepfile"
|
||||
fi
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
|
||||
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
|
||||
echo "$object : \\" > "$depfile"
|
||||
|
||||
# Clip off the initial element (the dependent). Don't try to be
|
||||
# clever and replace this with sed code, as IRIX sed won't handle
|
||||
# lines with more than a fixed number of characters (4096 in
|
||||
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
|
||||
# the IRIX cc adds comments like `#:fec' to the end of the
|
||||
# dependency line.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
|
||||
tr '
|
||||
' ' ' >> $depfile
|
||||
echo >> $depfile
|
||||
|
||||
# The second pass generates a dummy entry for each header file.
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" \
|
||||
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
|
||||
>> $depfile
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
# The sourcefile does not contain any dependencies, so just
|
||||
# store a dummy comment line, to avoid errors with the Makefile
|
||||
# "include basename.Plo" scheme.
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
icc)
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
# sub/foo.o: sub/foo.c
|
||||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
tru64)
|
||||
# The Tru64 compiler uses -MD to generate dependencies as a side
|
||||
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
|
||||
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
|
||||
# dependencies in `foo.d' instead, so we check for that too.
|
||||
# Subdirectories are respected.
|
||||
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
|
||||
test "x$dir" = "x$object" && dir=
|
||||
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
|
||||
|
||||
if test "$libtool" = yes; then
|
||||
# With Tru64 cc, shared objects can also be used to make a
|
||||
# static library. This mecanism is used in libtool 1.4 series to
|
||||
# handle both shared and static libraries in a single compilation.
|
||||
# With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
|
||||
#
|
||||
# With libtool 1.5 this exception was removed, and libtool now
|
||||
# generates 2 separate objects for the 2 libraries. These two
|
||||
# compilations output dependencies in in $dir.libs/$base.o.d and
|
||||
# in $dir$base.o.d. We have to check for both files, because
|
||||
# one of the two compilations can be disabled. We should prefer
|
||||
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
|
||||
# automatically cleaned when .libs/ is deleted, while ignoring
|
||||
# the former would cause a distcleancheck panic.
|
||||
tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
|
||||
tmpdepfile2=$dir$base.o.d # libtool 1.5
|
||||
tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
|
||||
tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
|
||||
"$@" -Wc,-MD
|
||||
else
|
||||
tmpdepfile1=$dir$base.o.d
|
||||
tmpdepfile2=$dir$base.d
|
||||
tmpdepfile3=$dir$base.d
|
||||
tmpdepfile4=$dir$base.d
|
||||
"$@" -MD
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
exit $stat
|
||||
fi
|
||||
|
||||
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
|
||||
do
|
||||
test -f "$tmpdepfile" && break
|
||||
done
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
#nosideeffect)
|
||||
# This comment above is used by automake to tell side-effect
|
||||
# dependency tracking mechanisms from slower ones.
|
||||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
test -z "$dashmflag" && dashmflag=-M
|
||||
# Require at least two characters before searching for `:'
|
||||
# in the target name. This is to cope with DOS-style filenames:
|
||||
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
|
||||
"$@" $dashmflag |
|
||||
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
tr ' ' '
|
||||
' < "$tmpdepfile" | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
dashXmstdout)
|
||||
# This case only exists to satisfy depend.m4. It is never actually
|
||||
# run, as this mode is specially recognized in the preamble.
|
||||
exit 1
|
||||
;;
|
||||
|
||||
makedepend)
|
||||
"$@" || exit $?
|
||||
# Remove any Libtool call
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
# X makedepend
|
||||
shift
|
||||
cleared=no
|
||||
for arg in "$@"; do
|
||||
case $cleared in
|
||||
no)
|
||||
set ""; shift
|
||||
cleared=yes ;;
|
||||
esac
|
||||
case "$arg" in
|
||||
-D*|-I*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
# Strip any option that makedepend may not understand. Remove
|
||||
# the object too, otherwise makedepend will parse it as a source file.
|
||||
-*|$object)
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"; shift ;;
|
||||
esac
|
||||
done
|
||||
obj_suffix="`echo $object | sed 's/^.*\././'`"
|
||||
touch "$tmpdepfile"
|
||||
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
|
||||
rm -f "$depfile"
|
||||
cat < "$tmpdepfile" > "$depfile"
|
||||
sed '1,2d' "$tmpdepfile" | tr ' ' '
|
||||
' | \
|
||||
## Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
## correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile" "$tmpdepfile".bak
|
||||
;;
|
||||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
if test "$libtool" = yes; then
|
||||
while test $1 != '--mode=compile'; do
|
||||
shift
|
||||
done
|
||||
shift
|
||||
fi
|
||||
|
||||
# Remove `-o $object'.
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case $arg in
|
||||
-o)
|
||||
shift
|
||||
;;
|
||||
$object)
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift # fnord
|
||||
shift # $arg
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
"$@" -E |
|
||||
sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
|
||||
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
|
||||
sed '$ s: \\$::' > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
cat < "$tmpdepfile" >> "$depfile"
|
||||
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
|
||||
set fnord "$@"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
set fnord "$@" "$arg"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
"$@" -E |
|
||||
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
|
||||
rm -f "$depfile"
|
||||
echo "$object : \\" > "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
|
||||
echo " " >> "$depfile"
|
||||
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
none)
|
||||
exec "$@"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown depmode $depmode" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
323
cxmon/install-sh
Executable file
323
cxmon/install-sh
Executable file
@ -0,0 +1,323 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2005-05-14.22
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch. It can only install one file at a time, a restriction
|
||||
# shared with many OS's install programs.
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit="${DOITPROG-}"
|
||||
|
||||
# put in absolute paths if you don't have them in your path; or use env. vars.
|
||||
|
||||
mvprog="${MVPROG-mv}"
|
||||
cpprog="${CPPROG-cp}"
|
||||
chmodprog="${CHMODPROG-chmod}"
|
||||
chownprog="${CHOWNPROG-chown}"
|
||||
chgrpprog="${CHGRPPROG-chgrp}"
|
||||
stripprog="${STRIPPROG-strip}"
|
||||
rmprog="${RMPROG-rm}"
|
||||
mkdirprog="${MKDIRPROG-mkdir}"
|
||||
|
||||
chmodcmd="$chmodprog 0755"
|
||||
chowncmd=
|
||||
chgrpcmd=
|
||||
stripcmd=
|
||||
rmcmd="$rmprog -f"
|
||||
mvcmd="$mvprog"
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dstarg=
|
||||
no_target_directory=
|
||||
|
||||
usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
-c (ignored)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test -n "$1"; do
|
||||
case $1 in
|
||||
-c) shift
|
||||
continue;;
|
||||
|
||||
-d) dir_arg=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) chmodcmd="$chmodprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-s) stripcmd=$stripprog
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-t) dstarg=$2
|
||||
shift
|
||||
shift
|
||||
continue;;
|
||||
|
||||
-T) no_target_directory=true
|
||||
shift
|
||||
continue;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
*) # When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
test -n "$dir_arg$dstarg" && break
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dstarg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dstarg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dstarg=$arg
|
||||
done
|
||||
break;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test -z "$1"; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
case $src in
|
||||
-*) src=./$src ;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
src=
|
||||
|
||||
if test -d "$dst"; then
|
||||
mkdircmd=:
|
||||
chmodcmd=
|
||||
else
|
||||
mkdircmd=$mkdirprog
|
||||
fi
|
||||
else
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dstarg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dstarg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst ;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dstarg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst/`basename "$src"`
|
||||
fi
|
||||
fi
|
||||
|
||||
# This sed command emulates the dirname command.
|
||||
dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
|
||||
|
||||
# Make sure that the destination directory exists.
|
||||
|
||||
# Skip lots of stat calls in the usual case.
|
||||
if test ! -d "$dstdir"; then
|
||||
defaultIFS='
|
||||
'
|
||||
IFS="${IFS-$defaultIFS}"
|
||||
|
||||
oIFS=$IFS
|
||||
# Some sh's can't handle IFS=/ for some reason.
|
||||
IFS='%'
|
||||
set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
pathcomp=
|
||||
|
||||
while test $# -ne 0 ; do
|
||||
pathcomp=$pathcomp$1
|
||||
shift
|
||||
if test ! -d "$pathcomp"; then
|
||||
$mkdirprog "$pathcomp"
|
||||
# mkdir can fail with a `File exist' error in case several
|
||||
# install-sh are creating the directory concurrently. This
|
||||
# is OK.
|
||||
test -d "$pathcomp" || exit
|
||||
fi
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
$doit $mkdircmd "$dst" \
|
||||
&& { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
|
||||
|
||||
else
|
||||
dstfile=`basename "$dst"`
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
trap '(exit $?); exit' 1 2 13 15
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
$doit $cpprog "$src" "$dsttmp" &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
|
||||
&& { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
|
||||
&& { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
|
||||
&& { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
{ $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| {
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
if test -f "$dstdir/$dstfile"; then
|
||||
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
|
||||
|| $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
|
||||
|| {
|
||||
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
else
|
||||
:
|
||||
fi
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
|
||||
}
|
||||
}
|
||||
fi || { (exit 1); exit 1; }
|
||||
done
|
||||
|
||||
# The final little trick to "correctly" pass the exit status to the exit trap.
|
||||
{
|
||||
(exit 0); exit 0
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
360
cxmon/missing
Executable file
360
cxmon/missing
Executable file
@ -0,0 +1,360 @@
|
||||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
|
||||
scriptversion=2005-06-08.21
|
||||
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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.
|
||||
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run=:
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.ac; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
msg="missing on your system"
|
||||
|
||||
case "$1" in
|
||||
--run)
|
||||
# Try to run requested program, and just exit if it succeeds.
|
||||
run=
|
||||
shift
|
||||
"$@" && exit 0
|
||||
# Exit code 63 means version mismatch. This often happens
|
||||
# when the user try to use an ancient version of a tool on
|
||||
# a file that requires a minimum version. In this case we
|
||||
# we should proceed has if the program had been absent, or
|
||||
# if --run hadn't been passed.
|
||||
if test $? = 63; then
|
||||
run=:
|
||||
msg="probably too old"
|
||||
fi
|
||||
;;
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
--run try to run the given command, and emulate it if it fails
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
help2man touch the output file
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
tar try tar, gnutar, gtar, then tar without non-portable flags
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
|
||||
Send bug reports to <bug-automake@gnu.org>."
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing $scriptversion (GNU Automake)"
|
||||
exit $?
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
# Now exit if we have it, but it failed. Also exit now if we
|
||||
# don't have it and --version was passed (most likely to detect
|
||||
# the program).
|
||||
case "$1" in
|
||||
lex|yacc)
|
||||
# Not GNU programs, they don't have --version.
|
||||
;;
|
||||
|
||||
tar)
|
||||
if test -n "$run"; then
|
||||
echo 1>&2 "ERROR: \`tar' requires --run"
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
|
||||
# We have it, but it failed.
|
||||
exit 1
|
||||
elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
|
||||
# Could not run --version or --help. This is probably someone
|
||||
# running `$TOOL --version' or `$TOOL --help' to check whether
|
||||
# $TOOL exists and not knowing $TOOL uses missing.
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
# If it does not exist, or fails to run (possibly an outdated version),
|
||||
# try to emulate it.
|
||||
case "$1" in
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`${configure_ac}'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`acconfig.h' or \`${configure_ac}'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
autom4te)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, but is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
|
||||
if test -f "$file"; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo "#! /bin/sh"
|
||||
echo "# Created by GNU Automake missing as a replacement of"
|
||||
echo "# $ $@"
|
||||
echo "exit 0"
|
||||
chmod +x $file
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' $msg. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
help2man)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a dependency of a manual page. You may need the
|
||||
\`Help2man' package in order for those modifications to take
|
||||
effect. You can get \`Help2man' from any GNU archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
|
||||
fi
|
||||
if [ -f "$file" ]; then
|
||||
touch $file
|
||||
else
|
||||
test -z "$file" || exec >$file
|
||||
echo ".ab help2man is required to generate this page"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is $msg. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
# The file to touch is that specified with -o ...
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
# ... or it is the one specified with @setfilename ...
|
||||
infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
|
||||
# ... or it is derived from the source name (dir/f.texi becomes f.info)
|
||||
test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
|
||||
fi
|
||||
# If the file does not exist, the user really needs makeinfo;
|
||||
# let's fail without touching anything.
|
||||
test -f $file || exit 1
|
||||
touch $file
|
||||
;;
|
||||
|
||||
tar)
|
||||
shift
|
||||
|
||||
# We have already tried tar in the generic part.
|
||||
# Look for gnutar/gtar before invocation to avoid ugly error
|
||||
# messages.
|
||||
if (gnutar --version > /dev/null 2>&1); then
|
||||
gnutar "$@" && exit 0
|
||||
fi
|
||||
if (gtar --version > /dev/null 2>&1); then
|
||||
gtar "$@" && exit 0
|
||||
fi
|
||||
firstarg="$1"
|
||||
if shift; then
|
||||
case "$firstarg" in
|
||||
*o*)
|
||||
firstarg=`echo "$firstarg" | sed s/o//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
case "$firstarg" in
|
||||
*h*)
|
||||
firstarg=`echo "$firstarg" | sed s/h//`
|
||||
tar "$firstarg" "$@" && exit 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
echo 1>&2 "\
|
||||
WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
||||
You may want to install GNU tar or Free paxutils, or check the
|
||||
command line arguments."
|
||||
exit 1
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and is $msg.
|
||||
You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-end: "$"
|
||||
# End:
|
10
cxmon/src/Makefile.am
Normal file
10
cxmon/src/Makefile.am
Normal file
@ -0,0 +1,10 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
SUBDIRS = disass
|
||||
|
||||
bin_PROGRAMS = cxmon
|
||||
cxmon_SOURCES = main.cpp mon.cpp mon.h mon_6502.cpp mon_z80.cpp mon_atraps.h \
|
||||
mon_cmd.cpp mon_cmd.h mon_disass.cpp mon_disass.h mon_lowmem.cpp mon_lowmem.h \
|
||||
mon_ppc.cpp sysdeps.h
|
||||
|
||||
cxmon_LDADD = disass/libdisass.a
|
528
cxmon/src/Makefile.in
Normal file
528
cxmon/src/Makefile.in
Normal file
@ -0,0 +1,528 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
bin_PROGRAMS = cxmon$(EXEEXT)
|
||||
subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
am_cxmon_OBJECTS = main.$(OBJEXT) mon.$(OBJEXT) mon_6502.$(OBJEXT) \
|
||||
mon_z80.$(OBJEXT) mon_cmd.$(OBJEXT) mon_disass.$(OBJEXT) \
|
||||
mon_lowmem.$(OBJEXT) mon_ppc.$(OBJEXT)
|
||||
cxmon_OBJECTS = $(am_cxmon_OBJECTS)
|
||||
cxmon_DEPENDENCIES = disass/libdisass.a
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
|
||||
-o $@
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(cxmon_SOURCES)
|
||||
DIST_SOURCES = $(cxmon_SOURCES)
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = disass
|
||||
cxmon_SOURCES = main.cpp mon.cpp mon.h mon_6502.cpp mon_z80.cpp mon_atraps.h \
|
||||
mon_cmd.cpp mon_cmd.h mon_disass.cpp mon_disass.h mon_lowmem.cpp mon_lowmem.h \
|
||||
mon_ppc.cpp sysdeps.h
|
||||
|
||||
cxmon_LDADD = disass/libdisass.a
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
|
||||
if test -f $$p \
|
||||
; then \
|
||||
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
$(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
|
||||
echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
|
||||
rm -f "$(DESTDIR)$(bindir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
cxmon$(EXEEXT): $(cxmon_OBJECTS) $(cxmon_DEPENDENCIES)
|
||||
@rm -f cxmon$(EXEEXT)
|
||||
$(CXXLINK) $(cxmon_LDFLAGS) $(cxmon_OBJECTS) $(cxmon_LDADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_6502.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_cmd.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_disass.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_lowmem.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_ppc.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mon_z80.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(bindir)"; do \
|
||||
test -z "$$dir" || $(mkdir_p) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am: install-binPROGRAMS
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
|
||||
clean clean-binPROGRAMS clean-generic clean-recursive ctags \
|
||||
ctags-recursive distclean distclean-compile distclean-generic \
|
||||
distclean-recursive distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-binPROGRAMS \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs installdirs-am \
|
||||
maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-recursive mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
|
||||
tags tags-recursive uninstall uninstall-am \
|
||||
uninstall-binPROGRAMS uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
8
cxmon/src/disass/Makefile.am
Normal file
8
cxmon/src/disass/Makefile.am
Normal file
@ -0,0 +1,8 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
noinst_LIBRARIES = libdisass.a
|
||||
libdisass_a_SOURCES = ansidecl.h bfd.h dis-asm.h floatformat.c floatformat.h \
|
||||
i386-dis.c m68k-dis.c m68k-opc.c m68k.h opintl.h
|
||||
|
||||
# Extra includes, for <sysdeps.h>
|
||||
INCLUDES = -I$(srcdir)/..
|
385
cxmon/src/disass/Makefile.in
Normal file
385
cxmon/src/disass/Makefile.in
Normal file
@ -0,0 +1,385 @@
|
||||
# Makefile.in generated by automake 1.9.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ../..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
subdir = src/disass
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(install_sh) -d
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
AR = ar
|
||||
ARFLAGS = cru
|
||||
libdisass_a_AR = $(AR) $(ARFLAGS)
|
||||
libdisass_a_LIBADD =
|
||||
am_libdisass_a_OBJECTS = floatformat.$(OBJEXT) i386-dis.$(OBJEXT) \
|
||||
m68k-dis.$(OBJEXT) m68k-opc.$(OBJEXT)
|
||||
libdisass_a_OBJECTS = $(am_libdisass_a_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
SOURCES = $(libdisass_a_SOURCES)
|
||||
DIST_SOURCES = $(libdisass_a_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build_alias = @build_alias@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host_alias = @host_alias@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
noinst_LIBRARIES = libdisass.a
|
||||
libdisass_a_SOURCES = ansidecl.h bfd.h dis-asm.h floatformat.c floatformat.h \
|
||||
i386-dis.c m68k-dis.c m68k-opc.c m68k.h opintl.h
|
||||
|
||||
|
||||
# Extra includes, for <sysdeps.h>
|
||||
INCLUDES = -I$(srcdir)/..
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/disass/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/disass/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libdisass.a: $(libdisass_a_OBJECTS) $(libdisass_a_DEPENDENCIES)
|
||||
-rm -f libdisass.a
|
||||
$(libdisass_a_AR) libdisass.a $(libdisass_a_OBJECTS) $(libdisass_a_LIBADD)
|
||||
$(RANLIB) libdisass.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/floatformat.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i386-dis.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m68k-dis.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m68k-opc.Po@am__quote@
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
uninstall-info-am:
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-noinstLIBRARIES ctags distclean distclean-compile \
|
||||
distclean-generic distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
295
cxmon/src/disass/ansidecl.h
Normal file
295
cxmon/src/disass/ansidecl.h
Normal file
@ -0,0 +1,295 @@
|
||||
/* ANSI and traditional C compatability macros
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* ANSI and traditional C compatibility macros
|
||||
|
||||
ANSI C is assumed if __STDC__ is #defined.
|
||||
|
||||
Macro ANSI C definition Traditional C definition
|
||||
----- ---- - ---------- ----------- - ----------
|
||||
ANSI_PROTOTYPES 1 not defined
|
||||
PTR `void *' `char *'
|
||||
PTRCONST `void *const' `char *'
|
||||
LONG_DOUBLE `long double' `double'
|
||||
const not defined `'
|
||||
volatile not defined `'
|
||||
signed not defined `'
|
||||
VA_START(ap, var) va_start(ap, var) va_start(ap)
|
||||
|
||||
Note that it is safe to write "void foo();" indicating a function
|
||||
with no return value, in all K+R compilers we have been able to test.
|
||||
|
||||
For declaring functions with prototypes, we also provide these:
|
||||
|
||||
PARAMS ((prototype))
|
||||
-- for functions which take a fixed number of arguments. Use this
|
||||
when declaring the function. When defining the function, write a
|
||||
K+R style argument list. For example:
|
||||
|
||||
char *strcpy PARAMS ((char *dest, char *source));
|
||||
...
|
||||
char *
|
||||
strcpy (dest, source)
|
||||
char *dest;
|
||||
char *source;
|
||||
{ ... }
|
||||
|
||||
|
||||
VPARAMS ((prototype, ...))
|
||||
-- for functions which take a variable number of arguments. Use
|
||||
PARAMS to declare the function, VPARAMS to define it. For example:
|
||||
|
||||
int printf PARAMS ((const char *format, ...));
|
||||
...
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
For writing functions which take variable numbers of arguments, we
|
||||
also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
|
||||
hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
|
||||
thoroughly than the simple VA_START() macro mentioned above.
|
||||
|
||||
VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
|
||||
Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
|
||||
corresponding to the list of fixed arguments. Then use va_arg
|
||||
normally to get the variable arguments, or pass your va_list object
|
||||
around. You do not declare the va_list yourself; VA_OPEN does it
|
||||
for you.
|
||||
|
||||
Here is a complete example:
|
||||
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
int result;
|
||||
|
||||
VA_OPEN (ap, format);
|
||||
VA_FIXEDARG (ap, const char *, format);
|
||||
|
||||
result = vfprintf (stdout, format, ap);
|
||||
VA_CLOSE (ap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
You can declare variables either before or after the VA_OPEN,
|
||||
VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
|
||||
and end of a block. They must appear at the same nesting level,
|
||||
and any variables declared after VA_OPEN go out of scope at
|
||||
VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
|
||||
argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
|
||||
pairs in a single function in case you need to traverse the
|
||||
argument list more than once.
|
||||
|
||||
For ease of writing code which uses GCC extensions but needs to be
|
||||
portable to other compilers, we provide the GCC_VERSION macro that
|
||||
simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
|
||||
wrappers around __attribute__. Also, __extension__ will be #defined
|
||||
to nothing if it doesn't work. See below.
|
||||
|
||||
This header also defines a lot of obsolete macros:
|
||||
CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
|
||||
AND, DOTS, NOARGS. Don't use them. */
|
||||
|
||||
#ifndef _ANSIDECL_H
|
||||
#define _ANSIDECL_H 1
|
||||
|
||||
/* Every source file includes this file,
|
||||
so they will all get the switch for lint. */
|
||||
/* LINTLIBRARY */
|
||||
|
||||
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
|
||||
older preprocessors. Thus we can't define something like this:
|
||||
|
||||
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
|
||||
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
|
||||
|
||||
and then test "#if HAVE_GCC_VERSION(2,7)".
|
||||
|
||||
So instead we use the macro below and test it against specific values. */
|
||||
|
||||
/* This macro simplifies testing whether we are using gcc, and if it
|
||||
is of a particular minimum version. (Both major & minor numbers are
|
||||
significant.) This macro will evaluate to 0 if we are not using
|
||||
gcc at all. */
|
||||
#ifndef GCC_VERSION
|
||||
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#endif /* GCC_VERSION */
|
||||
|
||||
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
|
||||
/* All known AIX compilers implement these things (but don't always
|
||||
define __STDC__). The RISC/OS MIPS compiler defines these things
|
||||
in SVR4 mode, but does not define __STDC__. */
|
||||
|
||||
#define ANSI_PROTOTYPES 1
|
||||
#define PTR void *
|
||||
#define PTRCONST void *const
|
||||
#define LONG_DOUBLE long double
|
||||
|
||||
#define PARAMS(ARGS) ARGS
|
||||
#define VPARAMS(ARGS) ARGS
|
||||
#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
|
||||
|
||||
/* variadic function helper macros */
|
||||
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
|
||||
use without inhibiting further decls and without declaring an
|
||||
actual variable. */
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, T, N) struct Qdmy
|
||||
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
|
||||
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
|
||||
it too, but it's not in C89. */
|
||||
#undef inline
|
||||
#if __STDC_VERSION__ > 199901L
|
||||
/* it's a keyword */
|
||||
#else
|
||||
# if GCC_VERSION >= 2007
|
||||
# define inline __inline__ /* __inline__ prevents -pedantic warnings */
|
||||
# else
|
||||
# define inline /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* These are obsolete. Do not use. */
|
||||
#ifndef IN_GCC
|
||||
#define CONST const
|
||||
#define VOLATILE volatile
|
||||
#define SIGNED signed
|
||||
|
||||
#define PROTO(type, name, arglist) type name arglist
|
||||
#define EXFUN(name, proto) name proto
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
#define AND ,
|
||||
#define DOTS , ...
|
||||
#define NOARGS void
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#else /* Not ANSI C. */
|
||||
|
||||
#undef ANSI_PROTOTYPES
|
||||
#define PTR char *
|
||||
#define PTRCONST PTR
|
||||
#define LONG_DOUBLE double
|
||||
|
||||
#define PARAMS(args) ()
|
||||
#define VPARAMS(args) (va_alist) va_dcl
|
||||
#define VA_START(va_list, var) va_start(va_list)
|
||||
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
|
||||
|
||||
/* some systems define these in header files for non-ansi mode */
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
#undef inline
|
||||
#define const
|
||||
#define volatile
|
||||
#define signed
|
||||
#define inline
|
||||
|
||||
#ifndef IN_GCC
|
||||
#define CONST
|
||||
#define VOLATILE
|
||||
#define SIGNED
|
||||
|
||||
#define PROTO(type, name, arglist) type name ()
|
||||
#define EXFUN(name, proto) name()
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#define AND ;
|
||||
#define DOTS
|
||||
#define NOARGS
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#endif /* ANSI C. */
|
||||
|
||||
/* Define macros for some gcc attributes. This permits us to use the
|
||||
macros freely, and know that they will come into play for the
|
||||
version of gcc in which they are supported. */
|
||||
|
||||
#if (GCC_VERSION < 2007)
|
||||
# define __attribute__(x)
|
||||
#endif
|
||||
|
||||
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
|
||||
#ifndef ATTRIBUTE_MALLOC
|
||||
# if (GCC_VERSION >= 2096)
|
||||
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC
|
||||
# endif /* GNUC >= 2.96 */
|
||||
#endif /* ATTRIBUTE_MALLOC */
|
||||
|
||||
/* Attributes on labels were valid as of gcc 2.93. */
|
||||
#ifndef ATTRIBUTE_UNUSED_LABEL
|
||||
# if (GCC_VERSION >= 2093)
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif /* GNUC >= 2.93 */
|
||||
#endif /* ATTRIBUTE_UNUSED_LABEL */
|
||||
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#endif /* ATTRIBUTE_UNUSED */
|
||||
|
||||
#ifndef ATTRIBUTE_NORETURN
|
||||
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
|
||||
#endif /* ATTRIBUTE_NORETURN */
|
||||
|
||||
#ifndef ATTRIBUTE_PRINTF
|
||||
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
|
||||
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
|
||||
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
|
||||
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
|
||||
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
|
||||
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_PRINTF */
|
||||
|
||||
/* We use __extension__ in some places to suppress -pedantic warnings
|
||||
about GCC extensions. This feature didn't work properly before
|
||||
gcc 2.8. */
|
||||
#if GCC_VERSION < 2008
|
||||
#define __extension__
|
||||
#endif
|
||||
|
||||
/* Bootstrap support: Adjust certain macros defined by Autoconf,
|
||||
which are only valid for the stage1 compiler. If we detect
|
||||
a modern version of GCC, we are probably in stage2 or beyond,
|
||||
so unconditionally reset the values. Note that const, inline,
|
||||
etc. have been dealt with above. */
|
||||
#if (GCC_VERSION >= 2007)
|
||||
# ifndef HAVE_LONG_DOUBLE
|
||||
# define HAVE_LONG_DOUBLE 1
|
||||
# endif
|
||||
#endif /* GCC >= 2.7 */
|
||||
|
||||
#endif /* ansidecl.h */
|
66
cxmon/src/disass/bfd.h
Normal file
66
cxmon/src/disass/bfd.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* bfd.h - Dummy bfd library header file
|
||||
*/
|
||||
|
||||
#include "sysdeps.h"
|
||||
#include "ansidecl.h"
|
||||
|
||||
enum bfd_flavour {
|
||||
bfd_target_unknown_flavour
|
||||
};
|
||||
|
||||
enum bfd_endian {
|
||||
BFD_ENDIAN_BIG,
|
||||
BFD_ENDIAN_LITTLE,
|
||||
BFD_ENDIAN_UNKNOWN
|
||||
};
|
||||
|
||||
enum bfd_architecture {
|
||||
bfd_arch_unknown,
|
||||
bfd_arch_m68k,
|
||||
#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
|
||||
bfd_arch_i386
|
||||
#define bfd_mach_i386_i386 0
|
||||
#define bfd_mach_i386_i8086 1
|
||||
#define bfd_mach_i386_i386_intel_syntax 2
|
||||
#define bfd_mach_x86_64 3
|
||||
#define bfd_mach_x86_64_intel_syntax 4
|
||||
};
|
||||
|
||||
typedef struct symbol_cache_entry {
|
||||
CONST char *name;
|
||||
} asymbol;
|
||||
|
||||
typedef uint64 bfd_vma;
|
||||
typedef int64 bfd_signed_vma;
|
||||
typedef unsigned char bfd_byte;
|
||||
|
||||
typedef struct _bfd bfd;
|
||||
struct _bfd;
|
||||
|
||||
#if SIZEOF_LONG == 8
|
||||
#define BFD_HOST_64BIT_LONG 1
|
||||
#endif
|
||||
|
||||
// 64-bit vma
|
||||
#define BFD64
|
||||
|
||||
#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
|
315
cxmon/src/disass/dis-asm.h
Normal file
315
cxmon/src/disass/dis-asm.h
Normal file
@ -0,0 +1,315 @@
|
||||
/* Interface between the opcode library and its callers.
|
||||
|
||||
Copyright 2001, 2002 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., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, 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) PARAMS((PTR, const char*, ...));
|
||||
|
||||
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;
|
||||
PTR stream;
|
||||
PTR 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. */
|
||||
unsigned long insn_sets;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* 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
|
||||
PTR 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)
|
||||
PARAMS ((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)
|
||||
PARAMS ((int status, bfd_vma memaddr, struct disassemble_info *info));
|
||||
|
||||
/* Function called to print ADDR. */
|
||||
void (*print_address_func)
|
||||
PARAMS ((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)
|
||||
PARAMS ((bfd_vma addr, 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;
|
||||
|
||||
/* 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)
|
||||
PARAMS((bfd_vma, disassemble_info *));
|
||||
|
||||
extern int print_insn_big_mips PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_little_mips PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_i386 PARAMS ((bfd_vma, disassemble_info *));
|
||||
extern int print_insn_i386_att PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_i386_intel PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_ia64 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_i370 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_m68hc11 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_m68hc12 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_m68k PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_z8001 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_z8002 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_h8300 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_h8300h PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_h8300s PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_h8500 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_alpha PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_big_arm PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_little_arm PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_sparc PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_big_a29k PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_little_a29k PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_avr PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_d10v PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_d30v PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_dlx PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_fr30 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_hppa PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_i860 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_i960 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_m32r PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_m88k PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_mcore PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_mmix PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_mn10200 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_mn10300 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_ns32k PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_openrisc PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_big_or32 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_little_or32 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_pdp11 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_pj PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_big_powerpc PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_little_powerpc PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_rs6000 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_s390 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_sh PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_tic30 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_tic54x PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_tic80 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_v850 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_vax PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_w65 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_xstormy16 PARAMS ((bfd_vma, disassemble_info*));
|
||||
extern int print_insn_sh64 PARAMS ((bfd_vma, disassemble_info *));
|
||||
extern int print_insn_sh64x_media PARAMS ((bfd_vma, disassemble_info *));
|
||||
extern int print_insn_frv PARAMS ((bfd_vma, disassemble_info *));
|
||||
|
||||
extern disassembler_ftype arc_get_disassembler PARAMS ((void *));
|
||||
extern disassembler_ftype cris_get_disassembler PARAMS ((bfd *));
|
||||
|
||||
extern void print_arm_disassembler_options PARAMS ((FILE *));
|
||||
extern void parse_arm_disassembler_option PARAMS ((char *));
|
||||
extern int get_arm_regname_num_options PARAMS ((void));
|
||||
extern int set_arm_regname_option PARAMS ((int));
|
||||
extern int get_arm_regnames PARAMS ((int, const char **, const char **, const char ***));
|
||||
|
||||
/* Fetch the disassembler for a given BFD, if that support is available. */
|
||||
extern disassembler_ftype disassembler PARAMS ((bfd *));
|
||||
|
||||
/* Document any target specific options available from the disassembler. */
|
||||
extern void disassembler_usage PARAMS ((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
|
||||
PARAMS ((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 PARAMS ((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
|
||||
PARAMS ((bfd_vma, struct disassemble_info *));
|
||||
|
||||
/* Always true. */
|
||||
extern int generic_symbol_at_address
|
||||
PARAMS ((bfd_vma, struct disassemble_info *));
|
||||
|
||||
/* Macro to initialize a disassemble_info struct. This should be called
|
||||
by all applications creating such a struct. */
|
||||
#define INIT_DISASSEMBLE_INFO(INFO, STREAM, FPRINTF_FUNC) \
|
||||
(INFO).flavour = bfd_target_unknown_flavour, \
|
||||
(INFO).arch = bfd_arch_unknown, \
|
||||
(INFO).mach = 0, \
|
||||
(INFO).insn_sets = 0, \
|
||||
(INFO).endian = BFD_ENDIAN_UNKNOWN, \
|
||||
(INFO).octets_per_byte = 1, \
|
||||
INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC)
|
||||
|
||||
/* Call this macro to initialize only the internal variables for the
|
||||
disassembler. Architecture dependent things such as byte order, or machine
|
||||
variant are not touched by this macro. This makes things much easier for
|
||||
GDB which must initialize these things separately. */
|
||||
|
||||
#define INIT_DISASSEMBLE_INFO_NO_ARCH(INFO, STREAM, FPRINTF_FUNC) \
|
||||
(INFO).fprintf_func = (fprintf_ftype)(FPRINTF_FUNC), \
|
||||
(INFO).stream = (PTR)(STREAM), \
|
||||
(INFO).symbols = NULL, \
|
||||
(INFO).num_symbols = 0, \
|
||||
(INFO).private_data = NULL, \
|
||||
(INFO).buffer = NULL, \
|
||||
(INFO).buffer_vma = 0, \
|
||||
(INFO).buffer_length = 0, \
|
||||
(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).flags = 0, \
|
||||
(INFO).bytes_per_line = 0, \
|
||||
(INFO).bytes_per_chunk = 0, \
|
||||
(INFO).display_endian = BFD_ENDIAN_UNKNOWN, \
|
||||
(INFO).disassembler_options = NULL, \
|
||||
(INFO).insn_info_valid = 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif /* ! defined (DIS_ASM_H) */
|
401
cxmon/src/disass/floatformat.c
Normal file
401
cxmon/src/disass/floatformat.c
Normal file
@ -0,0 +1,401 @@
|
||||
/* IEEE floating point support routines, for GDB, the GNU Debugger.
|
||||
Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "floatformat.h"
|
||||
#include <math.h> /* ldexp */
|
||||
#ifdef __STDC__
|
||||
#include <stddef.h>
|
||||
extern void *memcpy (void *s1, const void *s2, size_t n);
|
||||
extern void *memset (void *s, int c, size_t n);
|
||||
#else
|
||||
extern char *memcpy ();
|
||||
extern char *memset ();
|
||||
#endif
|
||||
|
||||
/* The odds that CHAR_BIT will be anything but 8 are low enough that I'm not
|
||||
going to bother with trying to muck around with whether it is defined in
|
||||
a system header, what we do if not, etc. */
|
||||
#define FLOATFORMAT_CHAR_BIT 8
|
||||
|
||||
/* floatformats for IEEE single and double, big and little endian. */
|
||||
const struct floatformat floatformat_ieee_single_big =
|
||||
{
|
||||
floatformat_big, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no
|
||||
};
|
||||
const struct floatformat floatformat_ieee_single_little =
|
||||
{
|
||||
floatformat_little, 32, 0, 1, 8, 127, 255, 9, 23, floatformat_intbit_no
|
||||
};
|
||||
const struct floatformat floatformat_ieee_double_big =
|
||||
{
|
||||
floatformat_big, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
|
||||
};
|
||||
const struct floatformat floatformat_ieee_double_little =
|
||||
{
|
||||
floatformat_little, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
|
||||
};
|
||||
|
||||
/* floatformat for IEEE double, little endian byte order, with big endian word
|
||||
ordering, as on the ARM. */
|
||||
|
||||
const struct floatformat floatformat_ieee_double_littlebyte_bigword =
|
||||
{
|
||||
floatformat_littlebyte_bigword, 64, 0, 1, 11, 1023, 2047, 12, 52, floatformat_intbit_no
|
||||
};
|
||||
|
||||
const struct floatformat floatformat_i387_ext =
|
||||
{
|
||||
floatformat_little, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
|
||||
floatformat_intbit_yes
|
||||
};
|
||||
const struct floatformat floatformat_m68881_ext =
|
||||
{
|
||||
/* Note that the bits from 16 to 31 are unused. */
|
||||
floatformat_big, 96, 0, 1, 15, 0x3fff, 0x7fff, 32, 64, floatformat_intbit_yes
|
||||
};
|
||||
const struct floatformat floatformat_i960_ext =
|
||||
{
|
||||
/* Note that the bits from 0 to 15 are unused. */
|
||||
floatformat_little, 96, 16, 17, 15, 0x3fff, 0x7fff, 32, 64,
|
||||
floatformat_intbit_yes
|
||||
};
|
||||
const struct floatformat floatformat_m88110_ext =
|
||||
{
|
||||
#ifdef HARRIS_FLOAT_FORMAT
|
||||
/* Harris uses raw format 128 bytes long, but the number is just an ieee
|
||||
double, and the last 64 bits are wasted. */
|
||||
floatformat_big,128, 0, 1, 11, 0x3ff, 0x7ff, 12, 52,
|
||||
floatformat_intbit_no
|
||||
#else
|
||||
floatformat_big, 80, 0, 1, 15, 0x3fff, 0x7fff, 16, 64,
|
||||
floatformat_intbit_yes
|
||||
#endif /* HARRIS_FLOAT_FORMAT */
|
||||
};
|
||||
const struct floatformat floatformat_arm_ext =
|
||||
{
|
||||
/* Bits 1 to 16 are unused. */
|
||||
floatformat_big, 96, 0, 17, 15, 0x3fff, 0x7fff, 32, 64,
|
||||
floatformat_intbit_yes
|
||||
};
|
||||
|
||||
static unsigned long get_field PARAMS ((unsigned char *,
|
||||
enum floatformat_byteorders,
|
||||
unsigned int,
|
||||
unsigned int,
|
||||
unsigned int));
|
||||
|
||||
/* Extract a field which starts at START and is LEN bytes long. DATA and
|
||||
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
|
||||
static unsigned long
|
||||
get_field (data, order, total_len, start, len)
|
||||
unsigned char *data;
|
||||
enum floatformat_byteorders order;
|
||||
unsigned int total_len;
|
||||
unsigned int start;
|
||||
unsigned int len;
|
||||
{
|
||||
unsigned long result;
|
||||
unsigned int cur_byte;
|
||||
int cur_bitshift;
|
||||
|
||||
/* Start at the least significant part of the field. */
|
||||
cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
cur_byte = (total_len / FLOATFORMAT_CHAR_BIT) - cur_byte - 1;
|
||||
cur_bitshift =
|
||||
((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT;
|
||||
result = *(data + cur_byte) >> (-cur_bitshift);
|
||||
cur_bitshift += FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
++cur_byte;
|
||||
else
|
||||
--cur_byte;
|
||||
|
||||
/* Move towards the most significant part of the field. */
|
||||
while (cur_bitshift < len)
|
||||
{
|
||||
if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
|
||||
/* This is the last byte; zero out the bits which are not part of
|
||||
this field. */
|
||||
result |=
|
||||
(*(data + cur_byte) & ((1 << (len - cur_bitshift)) - 1))
|
||||
<< cur_bitshift;
|
||||
else
|
||||
result |= *(data + cur_byte) << cur_bitshift;
|
||||
cur_bitshift += FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
++cur_byte;
|
||||
else
|
||||
--cur_byte;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifndef min
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
/* Convert from FMT to a double.
|
||||
FROM is the address of the extended float.
|
||||
Store the double in *TO. */
|
||||
|
||||
void
|
||||
floatformat_to_double (fmt, from, to)
|
||||
const struct floatformat *fmt;
|
||||
char *from;
|
||||
double *to;
|
||||
{
|
||||
unsigned char *ufrom = (unsigned char *)from;
|
||||
double dto;
|
||||
long exponent;
|
||||
unsigned long mant;
|
||||
unsigned int mant_bits, mant_off;
|
||||
int mant_bits_left;
|
||||
int special_exponent; /* It's a NaN, denorm or zero */
|
||||
|
||||
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
|
||||
fmt->exp_start, fmt->exp_len);
|
||||
/* Note that if exponent indicates a NaN, we can't really do anything useful
|
||||
(not knowing if the host has NaN's, or how to build one). So it will
|
||||
end up as an infinity or something close; that is OK. */
|
||||
|
||||
mant_bits_left = fmt->man_len;
|
||||
mant_off = fmt->man_start;
|
||||
dto = 0.0;
|
||||
|
||||
special_exponent = exponent == 0 || exponent == fmt->exp_nan;
|
||||
|
||||
/* Don't bias zero's, denorms or NaNs. */
|
||||
if (!special_exponent)
|
||||
exponent -= fmt->exp_bias;
|
||||
|
||||
/* Build the result algebraically. Might go infinite, underflow, etc;
|
||||
who cares. */
|
||||
|
||||
/* If this format uses a hidden bit, explicitly add it in now. Otherwise,
|
||||
increment the exponent by one to account for the integer bit. */
|
||||
|
||||
if (!special_exponent)
|
||||
if (fmt->intbit == floatformat_intbit_no)
|
||||
dto = ldexp (1.0, exponent);
|
||||
else
|
||||
exponent++;
|
||||
|
||||
while (mant_bits_left > 0)
|
||||
{
|
||||
mant_bits = min (mant_bits_left, 32);
|
||||
|
||||
mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
|
||||
mant_off, mant_bits);
|
||||
|
||||
dto += ldexp ((double)mant, exponent - mant_bits);
|
||||
exponent -= mant_bits;
|
||||
mant_off += mant_bits;
|
||||
mant_bits_left -= mant_bits;
|
||||
}
|
||||
|
||||
/* Negate it if negative. */
|
||||
if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
|
||||
dto = -dto;
|
||||
*to = dto;
|
||||
}
|
||||
|
||||
static void put_field PARAMS ((unsigned char *, enum floatformat_byteorders,
|
||||
unsigned int,
|
||||
unsigned int,
|
||||
unsigned int,
|
||||
unsigned long));
|
||||
|
||||
/* Set a field which starts at START and is LEN bytes long. DATA and
|
||||
TOTAL_LEN are the thing we are extracting it from, in byteorder ORDER. */
|
||||
static void
|
||||
put_field (data, order, total_len, start, len, stuff_to_put)
|
||||
unsigned char *data;
|
||||
enum floatformat_byteorders order;
|
||||
unsigned int total_len;
|
||||
unsigned int start;
|
||||
unsigned int len;
|
||||
unsigned long stuff_to_put;
|
||||
{
|
||||
unsigned int cur_byte;
|
||||
int cur_bitshift;
|
||||
|
||||
/* Start at the least significant part of the field. */
|
||||
cur_byte = (start + len) / FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
cur_byte = (total_len / FLOATFORMAT_CHAR_BIT) - cur_byte - 1;
|
||||
cur_bitshift =
|
||||
((start + len) % FLOATFORMAT_CHAR_BIT) - FLOATFORMAT_CHAR_BIT;
|
||||
*(data + cur_byte) &=
|
||||
~(((1 << ((start + len) % FLOATFORMAT_CHAR_BIT)) - 1) << (-cur_bitshift));
|
||||
*(data + cur_byte) |=
|
||||
(stuff_to_put & ((1 << FLOATFORMAT_CHAR_BIT) - 1)) << (-cur_bitshift);
|
||||
cur_bitshift += FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
++cur_byte;
|
||||
else
|
||||
--cur_byte;
|
||||
|
||||
/* Move towards the most significant part of the field. */
|
||||
while (cur_bitshift < len)
|
||||
{
|
||||
if (len - cur_bitshift < FLOATFORMAT_CHAR_BIT)
|
||||
{
|
||||
/* This is the last byte. */
|
||||
*(data + cur_byte) &=
|
||||
~((1 << (len - cur_bitshift)) - 1);
|
||||
*(data + cur_byte) |= (stuff_to_put >> cur_bitshift);
|
||||
}
|
||||
else
|
||||
*(data + cur_byte) = ((stuff_to_put >> cur_bitshift)
|
||||
& ((1 << FLOATFORMAT_CHAR_BIT) - 1));
|
||||
cur_bitshift += FLOATFORMAT_CHAR_BIT;
|
||||
if (order == floatformat_little)
|
||||
++cur_byte;
|
||||
else
|
||||
--cur_byte;
|
||||
}
|
||||
}
|
||||
|
||||
/* The converse: convert the double *FROM to an extended float
|
||||
and store where TO points. Neither FROM nor TO have any alignment
|
||||
restrictions. */
|
||||
|
||||
void
|
||||
floatformat_from_double (fmt, from, to)
|
||||
CONST struct floatformat *fmt;
|
||||
double *from;
|
||||
char *to;
|
||||
{
|
||||
double dfrom;
|
||||
int exponent;
|
||||
double mant;
|
||||
unsigned int mant_bits, mant_off;
|
||||
int mant_bits_left;
|
||||
unsigned char *uto = (unsigned char *)to;
|
||||
|
||||
memcpy (&dfrom, from, sizeof (dfrom));
|
||||
memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
|
||||
if (dfrom == 0)
|
||||
return; /* Result is zero */
|
||||
if (dfrom != dfrom)
|
||||
{
|
||||
/* From is NaN */
|
||||
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
|
||||
fmt->exp_len, fmt->exp_nan);
|
||||
/* Be sure it's not infinity, but NaN value is irrel */
|
||||
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
|
||||
32, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* If negative, set the sign bit. */
|
||||
if (dfrom < 0)
|
||||
{
|
||||
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
|
||||
dfrom = -dfrom;
|
||||
}
|
||||
|
||||
/* How to tell an infinity from an ordinary number? FIXME-someday */
|
||||
|
||||
mant = frexp (dfrom, &exponent);
|
||||
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start, fmt->exp_len,
|
||||
exponent + fmt->exp_bias - 1);
|
||||
|
||||
mant_bits_left = fmt->man_len;
|
||||
mant_off = fmt->man_start;
|
||||
while (mant_bits_left > 0)
|
||||
{
|
||||
unsigned long mant_long;
|
||||
mant_bits = mant_bits_left < 32 ? mant_bits_left : 32;
|
||||
|
||||
mant *= 4294967296.0;
|
||||
mant_long = (unsigned long)mant;
|
||||
mant -= mant_long;
|
||||
|
||||
/* If the integer bit is implicit, then we need to discard it.
|
||||
If we are discarding a zero, we should be (but are not) creating
|
||||
a denormalized number which means adjusting the exponent
|
||||
(I think). */
|
||||
if (mant_bits_left == fmt->man_len
|
||||
&& fmt->intbit == floatformat_intbit_no)
|
||||
{
|
||||
mant_long &= 0x7fffffff;
|
||||
mant_bits -= 1;
|
||||
}
|
||||
else if (mant_bits < 32)
|
||||
{
|
||||
/* The bits we want are in the most significant MANT_BITS bits of
|
||||
mant_long. Move them to the least significant. */
|
||||
mant_long >>= 32 - mant_bits;
|
||||
}
|
||||
|
||||
put_field (uto, fmt->byteorder, fmt->totalsize,
|
||||
mant_off, mant_bits, mant_long);
|
||||
mant_off += mant_bits;
|
||||
mant_bits_left -= mant_bits;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef IEEE_DEBUG
|
||||
|
||||
/* This is to be run on a host which uses IEEE floating point. */
|
||||
|
||||
void
|
||||
ieee_test (n)
|
||||
double n;
|
||||
{
|
||||
double result;
|
||||
char exten[16];
|
||||
|
||||
floatformat_to_double (&floatformat_ieee_double_big, &n, &result);
|
||||
if (n != result)
|
||||
printf ("Differ(to): %.20g -> %.20g\n", n, result);
|
||||
floatformat_from_double (&floatformat_ieee_double_big, &n, &result);
|
||||
if (n != result)
|
||||
printf ("Differ(from): %.20g -> %.20g\n", n, result);
|
||||
|
||||
floatformat_from_double (&floatformat_m68881_ext, &n, exten);
|
||||
floatformat_to_double (&floatformat_m68881_ext, exten, &result);
|
||||
if (n != result)
|
||||
printf ("Differ(to+from): %.20g -> %.20g\n", n, result);
|
||||
|
||||
#if IEEE_DEBUG > 1
|
||||
/* This is to be run on a host which uses 68881 format. */
|
||||
{
|
||||
long double ex = *(long double *)exten;
|
||||
if (ex != n)
|
||||
printf ("Differ(from vs. extended): %.20g\n", n);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
ieee_test (0.5);
|
||||
ieee_test (256.0);
|
||||
ieee_test (0.12345);
|
||||
ieee_test (234235.78907234);
|
||||
ieee_test (-512.0);
|
||||
ieee_test (-0.004321);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
111
cxmon/src/disass/floatformat.h
Normal file
111
cxmon/src/disass/floatformat.h
Normal file
@ -0,0 +1,111 @@
|
||||
/* IEEE floating point support declarations, for GDB, the GNU Debugger.
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
|
||||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if !defined (FLOATFORMAT_H)
|
||||
#define FLOATFORMAT_H 1
|
||||
|
||||
#include "ansidecl.h"
|
||||
|
||||
/* A floatformat consists of a sign bit, an exponent and a mantissa. Once the
|
||||
bytes are concatenated according to the byteorder flag, then each of those
|
||||
fields is contiguous. We number the bits with 0 being the most significant
|
||||
(i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
|
||||
contains with the *_start and *_len fields. */
|
||||
|
||||
/* What is the order of the bytes. */
|
||||
|
||||
enum floatformat_byteorders {
|
||||
|
||||
/* Standard little endian byte order.
|
||||
EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
|
||||
|
||||
floatformat_little,
|
||||
|
||||
/* Standard big endian byte order.
|
||||
EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
|
||||
|
||||
floatformat_big,
|
||||
|
||||
/* Little endian byte order but big endian word order.
|
||||
EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
|
||||
|
||||
floatformat_littlebyte_bigword
|
||||
|
||||
};
|
||||
|
||||
enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
|
||||
|
||||
struct floatformat
|
||||
{
|
||||
enum floatformat_byteorders byteorder;
|
||||
unsigned int totalsize; /* Total size of number in bits */
|
||||
|
||||
/* Sign bit is always one bit long. 1 means negative, 0 means positive. */
|
||||
unsigned int sign_start;
|
||||
|
||||
unsigned int exp_start;
|
||||
unsigned int exp_len;
|
||||
/* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */
|
||||
unsigned int exp_bias;
|
||||
/* Exponent value which indicates NaN. This is the actual value stored in
|
||||
the float, not adjusted by the exp_bias. This usually consists of all
|
||||
one bits. */
|
||||
unsigned int exp_nan;
|
||||
|
||||
unsigned int man_start;
|
||||
unsigned int man_len;
|
||||
|
||||
/* Is the integer bit explicit or implicit? */
|
||||
enum floatformat_intbit intbit;
|
||||
};
|
||||
|
||||
/* floatformats for IEEE single and double, big and little endian. */
|
||||
|
||||
extern const struct floatformat floatformat_ieee_single_big;
|
||||
extern const struct floatformat floatformat_ieee_single_little;
|
||||
extern const struct floatformat floatformat_ieee_double_big;
|
||||
extern const struct floatformat floatformat_ieee_double_little;
|
||||
|
||||
/* floatformat for ARM IEEE double, little endian bytes and big endian words */
|
||||
|
||||
extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
|
||||
|
||||
/* floatformats for various extendeds. */
|
||||
|
||||
extern const struct floatformat floatformat_i387_ext;
|
||||
extern const struct floatformat floatformat_m68881_ext;
|
||||
extern const struct floatformat floatformat_i960_ext;
|
||||
extern const struct floatformat floatformat_m88110_ext;
|
||||
extern const struct floatformat floatformat_arm_ext;
|
||||
|
||||
/* Convert from FMT to a double.
|
||||
FROM is the address of the extended float.
|
||||
Store the double in *TO. */
|
||||
|
||||
extern void
|
||||
floatformat_to_double PARAMS ((const struct floatformat *, char *, double *));
|
||||
|
||||
/* The converse: convert the double *FROM to FMT
|
||||
and store where TO points. */
|
||||
|
||||
extern void
|
||||
floatformat_from_double PARAMS ((const struct floatformat *,
|
||||
double *, char *));
|
||||
|
||||
#endif /* defined (FLOATFORMAT_H) */
|
4146
cxmon/src/disass/i386-dis.c
Normal file
4146
cxmon/src/disass/i386-dis.c
Normal file
File diff suppressed because it is too large
Load Diff
1248
cxmon/src/disass/m68k-dis.c
Normal file
1248
cxmon/src/disass/m68k-dis.c
Normal file
File diff suppressed because it is too large
Load Diff
2066
cxmon/src/disass/m68k-opc.c
Normal file
2066
cxmon/src/disass/m68k-opc.c
Normal file
File diff suppressed because it is too large
Load Diff
315
cxmon/src/disass/m68k.h
Normal file
315
cxmon/src/disass/m68k.h
Normal file
@ -0,0 +1,315 @@
|
||||
/* Opcode table header for m680[01234]0/m6888[12]/m68851.
|
||||
Copyright 1989, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation.
|
||||
|
||||
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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* These are used as bit flags for the arch field in the m68k_opcode
|
||||
structure. */
|
||||
#define _m68k_undef 0
|
||||
#define m68000 0x001
|
||||
#define m68008 m68000 /* synonym for -m68000. otherwise unused. */
|
||||
#define m68010 0x002
|
||||
#define m68020 0x004
|
||||
#define m68030 0x008
|
||||
#define m68ec030 m68030 /* similar enough to -m68030 to ignore differences;
|
||||
gas will deal with the few differences. */
|
||||
#define m68040 0x010
|
||||
/* there is no 68050 */
|
||||
#define m68060 0x020
|
||||
#define m68881 0x040
|
||||
#define m68882 m68881 /* synonym for -m68881. otherwise unused. */
|
||||
#define m68851 0x080
|
||||
#define cpu32 0x100 /* e.g., 68332 */
|
||||
#define mcf5200 0x200
|
||||
|
||||
/* 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 | m68882 | 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 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: AaBCcDdFfIJkLlMmnOopQqRrSsTtUVvWXYZ0123|*~%;@!&$?/<>#^+-
|
||||
|
||||
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.
|
||||
|
||||
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]
|
||||
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]
|
||||
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]
|
||||
|
||||
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".
|
||||
|
||||
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,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 operands:
|
||||
q (modes 0,2-5)
|
||||
v (modes 0,2-5,7.0,7.1)
|
||||
*/
|
||||
|
||||
/* 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:
|
||||
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.
|
||||
|
||||
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
|
||||
*/
|
||||
|
||||
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 */
|
34
cxmon/src/disass/opintl.h
Normal file
34
cxmon/src/disass/opintl.h
Normal file
@ -0,0 +1,34 @@
|
||||
/* opintl.h - opcodes specific header for gettext code.
|
||||
Copyright (C) 1998 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, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
#ifdef ENABLE_NLS
|
||||
# include <libintl.h>
|
||||
# define _(String) dgettext (PACKAGE, String)
|
||||
# ifdef gettext_noop
|
||||
# define N_(String) gettext_noop (String)
|
||||
# else
|
||||
# define N_(String) (String)
|
||||
# endif
|
||||
#else
|
||||
/* Stubs that do something close enough. */
|
||||
# define textdomain(String) (String)
|
||||
# define gettext(String) (String)
|
||||
# define dgettext(Domain,Message) (Message)
|
||||
# define dcgettext(Domain,Message,Type) (Message)
|
||||
# define bindtextdomain(Domain,Directory) (Domain)
|
||||
# define _(String) (String)
|
||||
# define N_(String) (String)
|
||||
/* In this case we don't care about the value. */
|
||||
# ifndef LC_MESSAGES
|
||||
# define LC_MESSAGES 0
|
||||
# endif
|
||||
#endif
|
118
cxmon/src/main.cpp
Normal file
118
cxmon/src/main.cpp
Normal file
@ -0,0 +1,118 @@
|
||||
/*
|
||||
* main.cpp - Wrapper program for standalone cxmon
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include "mon.h"
|
||||
|
||||
|
||||
#ifdef __BEOS__
|
||||
#include <AppKit.h>
|
||||
#include <KernelKit.h>
|
||||
#include <StorageKit.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Detect if program was launched from Shell or Tracker
|
||||
static bool launched_from_tracker(void)
|
||||
{
|
||||
char *cmd = getenv("_");
|
||||
if (cmd == NULL || strlen(cmd) < 7)
|
||||
return false;
|
||||
return !strcmp(cmd + strlen(cmd) - 7 , "Tracker");
|
||||
}
|
||||
|
||||
// Open Terminal window with given title for stdio, returns false on error
|
||||
static bool open_stdio(const char *title)
|
||||
{
|
||||
// Create key
|
||||
char key_name[64];
|
||||
bigtime_t t = system_time();
|
||||
sprintf(key_name, "%Ld", t);
|
||||
|
||||
// Make pipe names
|
||||
char out_pipe_name[64], in_pipe_name[64];
|
||||
sprintf(out_pipe_name, "/pipe/debug_out_%s", key_name);
|
||||
sprintf(in_pipe_name, "/pipe/debug_in_%s", key_name);
|
||||
|
||||
// Create semaphore
|
||||
char sem_name[B_OS_NAME_LENGTH], sem_id_str[B_OS_NAME_LENGTH];
|
||||
sprintf(sem_name, "debug_glue_%s", key_name);
|
||||
sem_id glue_sem = create_sem(0, sem_name);
|
||||
sprintf(sem_id_str, "%d", glue_sem);
|
||||
|
||||
// Make path for "Terminal" app
|
||||
char term_path[B_PATH_NAME_LENGTH];
|
||||
find_directory(B_BEOS_APPS_DIRECTORY, -1, false, term_path, 1024);
|
||||
strcat(term_path, "/Terminal");
|
||||
|
||||
// Load "Terminal"
|
||||
const char *t_argv[6];
|
||||
t_argv[0] = term_path;
|
||||
t_argv[1] = "-t";
|
||||
t_argv[2] = (char *)title;
|
||||
t_argv[3] = "/bin/debug_glue";
|
||||
t_argv[4] = key_name;
|
||||
t_argv[5] = sem_id_str;
|
||||
thread_id th = load_image(6, t_argv, (const char **)environ);
|
||||
if (th < 0) {
|
||||
delete_sem(glue_sem);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Start "Terminal"
|
||||
resume_thread(th);
|
||||
status_t err = acquire_sem_etc(glue_sem, 1, B_TIMEOUT, 5000000);
|
||||
delete_sem(glue_sem);
|
||||
if (err)
|
||||
return false;
|
||||
|
||||
// Open input/output pipes
|
||||
FILE *in = freopen(in_pipe_name, "rb", stdin);
|
||||
if (in == NULL)
|
||||
return false;
|
||||
FILE *out = freopen(out_pipe_name, "wb", stdout);
|
||||
if (out == NULL) {
|
||||
fclose(in);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set buffer modes
|
||||
setvbuf(stdout, NULL, _IOLBF, 0);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Main program
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
#ifdef __BEOS__
|
||||
// Launched from Tracker? Then open terminal window
|
||||
if (launched_from_tracker()) {
|
||||
if (!open_stdio("mon"))
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Execute mon
|
||||
mon_init();
|
||||
mon(argc, argv);
|
||||
mon_exit();
|
||||
return 0;
|
||||
}
|
1255
cxmon/src/mon.cpp
Normal file
1255
cxmon/src/mon.cpp
Normal file
File diff suppressed because it is too large
Load Diff
100
cxmon/src/mon.h
Normal file
100
cxmon/src/mon.h
Normal file
@ -0,0 +1,100 @@
|
||||
/*
|
||||
* mon.h - cxmon main program
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 MON_H
|
||||
#define MON_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
/*
|
||||
* Initialization, deinitialization and invocation
|
||||
*/
|
||||
|
||||
void mon_init();
|
||||
void mon_exit();
|
||||
void mon(int argc, char **argv);
|
||||
|
||||
|
||||
/*
|
||||
* Definitions for adding commands to mon
|
||||
*/
|
||||
|
||||
// Input tokens
|
||||
enum Token {
|
||||
T_NULL, // Invalid token
|
||||
T_END, // End of line
|
||||
T_NUMBER, // Hexadecimal/decimal number (uint32)
|
||||
T_STRING, // String enclosed in ""
|
||||
T_NAME, // Variable name
|
||||
T_DOT, // '.'
|
||||
T_COLON, // ':'
|
||||
T_COMMA, // ','
|
||||
T_LPAREN, // '('
|
||||
T_RPAREN, // ')'
|
||||
T_PLUS, // '+'
|
||||
T_MINUS, // '-'
|
||||
T_MUL, // '*'
|
||||
T_DIV, // '/'
|
||||
T_MOD, // '%'
|
||||
T_AND, // '&'
|
||||
T_OR, // '|'
|
||||
T_EOR, // '^'
|
||||
T_SHIFTL, // '<<'
|
||||
T_SHIFTR, // '>>'
|
||||
T_NOT, // '~'
|
||||
T_ASSIGN // '='
|
||||
};
|
||||
|
||||
// Scanner variables
|
||||
extern enum Token mon_token; // Last token read
|
||||
extern uintptr mon_number; // Contains the number if mon_token==T_NUMBER
|
||||
extern char *mon_string; // Contains the string if mon_token==T_STRING
|
||||
extern char *mon_name; // Contains the variable name if mon_token==T_NAME
|
||||
|
||||
// Streams for input, output and error messages
|
||||
extern FILE *monin, *monout, *monerr;
|
||||
|
||||
// Current address, value of '.' in expressions
|
||||
extern uintptr mon_dot_address;
|
||||
|
||||
extern bool mon_use_real_mem; // Flag: mon is using real memory
|
||||
extern uint32 mon_mem_size; // Size of mon buffer (if mon_use_real_mem = false)
|
||||
|
||||
extern bool mon_macos_mode; // Flag: enable features in the disassembler for working with MacOS code
|
||||
|
||||
// Add command to mon
|
||||
extern void mon_add_command(const char *name, void (*func)(), const char *help_text);
|
||||
|
||||
// Functions for commands
|
||||
extern void mon_error(const char *s); // Print error message
|
||||
extern enum Token mon_get_token(); // Get next token
|
||||
extern bool mon_expression(uintptr *number); // Parse expression
|
||||
extern bool mon_aborted(); // Check if Ctrl-C was pressed
|
||||
|
||||
// Memory access
|
||||
extern uint32 (*mon_read_byte)(uintptr adr);
|
||||
extern void (*mon_write_byte)(uintptr adr, uint32 b);
|
||||
extern uint32 mon_read_half(uintptr adr);
|
||||
extern void mon_write_half(uintptr adr, uint32 w);
|
||||
extern uint32 mon_read_word(uintptr adr);
|
||||
extern void mon_write_word(uintptr adr, uint32 l);
|
||||
|
||||
#endif
|
232
cxmon/src/mon_6502.cpp
Normal file
232
cxmon/src/mon_6502.cpp
Normal file
@ -0,0 +1,232 @@
|
||||
/*
|
||||
* mon_6502.cpp - 6502 disassembler
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include "mon.h"
|
||||
#include "mon_disass.h"
|
||||
|
||||
|
||||
// Addressing modes
|
||||
enum AddrMode {
|
||||
A_IMPL,
|
||||
A_ACCU, // A
|
||||
A_IMM, // #zz
|
||||
A_REL, // Branches
|
||||
A_ZERO, // zz
|
||||
A_ZEROX, // zz,x
|
||||
A_ZEROY, // zz,y
|
||||
A_ABS, // zzzz
|
||||
A_ABSX, // zzzz,x
|
||||
A_ABSY, // zzzz,y
|
||||
A_IND, // (zzzz)
|
||||
A_INDX, // (zz,x)
|
||||
A_INDY // (zz),y
|
||||
};
|
||||
|
||||
// Mnemonics
|
||||
enum Mnemonic {
|
||||
M_ADC, M_AND, M_ASL, M_BCC, M_BCS, M_BEQ, M_BIT, M_BMI, M_BNE, M_BPL,
|
||||
M_BRK, M_BVC, M_BVS, M_CLC, M_CLD, M_CLI, M_CLV, M_CMP, M_CPX, M_CPY,
|
||||
M_DEC, M_DEX, M_DEY, M_EOR, M_INC, M_INX, M_INY, M_JMP, M_JSR, M_LDA,
|
||||
M_LDX, M_LDY, M_LSR, M_NOP, M_ORA, M_PHA, M_PHP, M_PLA, M_PLP, M_ROL,
|
||||
M_ROR, M_RTI, M_RTS, M_SBC, M_SEC, M_SED, M_SEI, M_STA, M_STX, M_STY,
|
||||
M_TAX, M_TAY, M_TSX, M_TXA, M_TXS, M_TYA,
|
||||
|
||||
M_ILLEGAL, // Undocumented opcodes start here
|
||||
|
||||
M_IANC, M_IANE, M_IARR, M_IASR, M_IDCP, M_IISB, M_IJAM, M_INOP, M_ILAS,
|
||||
M_ILAX, M_ILXA, M_IRLA, M_IRRA, M_ISAX, M_ISBC, M_ISBX, M_ISHA, M_ISHS,
|
||||
M_ISHX, M_ISHY, M_ISLO, M_ISRE,
|
||||
|
||||
M_MAXIMUM // Highest element
|
||||
};
|
||||
|
||||
// Mnemonic for each opcode
|
||||
static const Mnemonic mnemonic[256] = {
|
||||
M_BRK , M_ORA , M_IJAM, M_ISLO, M_INOP, M_ORA, M_ASL , M_ISLO, // 00
|
||||
M_PHP , M_ORA , M_ASL , M_IANC, M_INOP, M_ORA, M_ASL , M_ISLO,
|
||||
M_BPL , M_ORA , M_IJAM, M_ISLO, M_INOP, M_ORA, M_ASL , M_ISLO, // 10
|
||||
M_CLC , M_ORA , M_INOP, M_ISLO, M_INOP, M_ORA, M_ASL , M_ISLO,
|
||||
M_JSR , M_AND , M_IJAM, M_IRLA, M_BIT , M_AND, M_ROL , M_IRLA, // 20
|
||||
M_PLP , M_AND , M_ROL , M_IANC, M_BIT , M_AND, M_ROL , M_IRLA,
|
||||
M_BMI , M_AND , M_IJAM, M_IRLA, M_INOP, M_AND, M_ROL , M_IRLA, // 30
|
||||
M_SEC , M_AND , M_INOP, M_IRLA, M_INOP, M_AND, M_ROL , M_IRLA,
|
||||
M_RTI , M_EOR , M_IJAM, M_ISRE, M_INOP, M_EOR, M_LSR , M_ISRE, // 40
|
||||
M_PHA , M_EOR , M_LSR , M_IASR, M_JMP , M_EOR, M_LSR , M_ISRE,
|
||||
M_BVC , M_EOR , M_IJAM, M_ISRE, M_INOP, M_EOR, M_LSR , M_ISRE, // 50
|
||||
M_CLI , M_EOR , M_INOP, M_ISRE, M_INOP, M_EOR, M_LSR , M_ISRE,
|
||||
M_RTS , M_ADC , M_IJAM, M_IRRA, M_INOP, M_ADC, M_ROR , M_IRRA, // 60
|
||||
M_PLA , M_ADC , M_ROR , M_IARR, M_JMP , M_ADC, M_ROR , M_IRRA,
|
||||
M_BVS , M_ADC , M_IJAM, M_IRRA, M_INOP, M_ADC, M_ROR , M_IRRA, // 70
|
||||
M_SEI , M_ADC , M_INOP, M_IRRA, M_INOP, M_ADC, M_ROR , M_IRRA,
|
||||
M_INOP, M_STA , M_INOP, M_ISAX, M_STY , M_STA, M_STX , M_ISAX, // 80
|
||||
M_DEY , M_INOP, M_TXA , M_IANE, M_STY , M_STA, M_STX , M_ISAX,
|
||||
M_BCC , M_STA , M_IJAM, M_ISHA, M_STY , M_STA, M_STX , M_ISAX, // 90
|
||||
M_TYA , M_STA , M_TXS , M_ISHS, M_ISHY, M_STA, M_ISHX, M_ISHA,
|
||||
M_LDY , M_LDA , M_LDX , M_ILAX, M_LDY , M_LDA, M_LDX , M_ILAX, // a0
|
||||
M_TAY , M_LDA , M_TAX , M_ILXA, M_LDY , M_LDA, M_LDX , M_ILAX,
|
||||
M_BCS , M_LDA , M_IJAM, M_ILAX, M_LDY , M_LDA, M_LDX , M_ILAX, // b0
|
||||
M_CLV , M_LDA , M_TSX , M_ILAS, M_LDY , M_LDA, M_LDX , M_ILAX,
|
||||
M_CPY , M_CMP , M_INOP, M_IDCP, M_CPY , M_CMP, M_DEC , M_IDCP, // c0
|
||||
M_INY , M_CMP , M_DEX , M_ISBX, M_CPY , M_CMP, M_DEC , M_IDCP,
|
||||
M_BNE , M_CMP , M_IJAM, M_IDCP, M_INOP, M_CMP, M_DEC , M_IDCP, // d0
|
||||
M_CLD , M_CMP , M_INOP, M_IDCP, M_INOP, M_CMP, M_DEC , M_IDCP,
|
||||
M_CPX , M_SBC , M_INOP, M_IISB, M_CPX , M_SBC, M_INC , M_IISB, // e0
|
||||
M_INX , M_SBC , M_NOP , M_ISBC, M_CPX , M_SBC, M_INC , M_IISB,
|
||||
M_BEQ , M_SBC , M_IJAM, M_IISB, M_INOP, M_SBC, M_INC , M_IISB, // f0
|
||||
M_SED , M_SBC , M_INOP, M_IISB, M_INOP, M_SBC, M_INC , M_IISB
|
||||
};
|
||||
|
||||
// Addressing mode for each opcode
|
||||
static const AddrMode adr_mode[256] = {
|
||||
A_IMPL, A_INDX, A_IMPL, A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // 00
|
||||
A_IMPL, A_IMM , A_ACCU, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // 10
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX,
|
||||
A_ABS , A_INDX, A_IMPL, A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // 20
|
||||
A_IMPL, A_IMM , A_ACCU, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // 30
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX,
|
||||
A_IMPL, A_INDX, A_IMPL, A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // 40
|
||||
A_IMPL, A_IMM , A_ACCU, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // 50
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX,
|
||||
A_IMPL, A_INDX, A_IMPL, A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // 60
|
||||
A_IMPL, A_IMM , A_ACCU, A_IMM , A_IND , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // 70
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX,
|
||||
A_IMM , A_INDX, A_IMM , A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // 80
|
||||
A_IMPL, A_IMM , A_IMPL, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROY, A_ZEROY, // 90
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSY , A_ABSY,
|
||||
A_IMM , A_INDX, A_IMM , A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // a0
|
||||
A_IMPL, A_IMM , A_IMPL, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROY, A_ZEROY, // b0
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSY , A_ABSY,
|
||||
A_IMM , A_INDX, A_IMM , A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // c0
|
||||
A_IMPL, A_IMM , A_IMPL, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // d0
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX,
|
||||
A_IMM , A_INDX, A_IMM , A_INDX, A_ZERO , A_ZERO , A_ZERO , A_ZERO, // e0
|
||||
A_IMPL, A_IMM , A_IMPL, A_IMM , A_ABS , A_ABS , A_ABS , A_ABS,
|
||||
A_REL , A_INDY, A_IMPL, A_INDY, A_ZEROX, A_ZEROX, A_ZEROX, A_ZEROX, // f0
|
||||
A_IMPL, A_ABSY, A_IMPL, A_ABSY, A_ABSX , A_ABSX , A_ABSX , A_ABSX
|
||||
};
|
||||
|
||||
// Chars for each mnemonic
|
||||
static const char mnem_1[] = "aaabbbbbbbbbbcccccccdddeiiijjllllnopppprrrrssssssstttttt?aaaadijnlllrrsssssssss";
|
||||
static const char mnem_2[] = "dnscceimnprvvllllmppeeeonnnmsdddsorhhlloottbeeetttaasxxy?nnrscsaoaaxlrabbhhhhlr";
|
||||
static const char mnem_3[] = "cdlcsqtielkcscdivpxycxyrcxypraxyrpaapaplrisccdiaxyxyxasa?cerrpbmpsxaaaxcxasxyoe";
|
||||
|
||||
// Instruction length for each addressing mode
|
||||
static const int adr_length[] = {1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2};
|
||||
|
||||
|
||||
/*
|
||||
* Disassemble one instruction, return number of bytes
|
||||
*/
|
||||
|
||||
int disass_6502(FILE *f, uint32 adr, uint8 op, uint8 lo, uint8 hi)
|
||||
{
|
||||
AddrMode mode = adr_mode[op];
|
||||
Mnemonic mnem = mnemonic[op];
|
||||
|
||||
// Display instruction bytes in hex
|
||||
switch (adr_length[mode]) {
|
||||
case 1:
|
||||
fprintf(f, "%02x\t\t", op);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
fprintf(f, "%02x %02x\t\t", op, lo);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
fprintf(f, "%02x %02x %02x\t", op, lo, hi);
|
||||
break;
|
||||
}
|
||||
|
||||
// Tag undocumented opcodes with an asterisk
|
||||
if (mnem > M_ILLEGAL)
|
||||
fputc('*', f);
|
||||
else
|
||||
fputc(' ', f);
|
||||
|
||||
// Print mnemonic
|
||||
fprintf(f, "%c%c%c ", mnem_1[mnem], mnem_2[mnem], mnem_3[mnem]);
|
||||
|
||||
// Print argument
|
||||
switch (mode) {
|
||||
case A_IMPL:
|
||||
break;
|
||||
|
||||
case A_ACCU:
|
||||
fprintf(f, "a");
|
||||
break;
|
||||
|
||||
case A_IMM:
|
||||
fprintf(f, "#$%02x", lo);
|
||||
break;
|
||||
|
||||
case A_REL:
|
||||
fprintf(f, "$%04x", (adr + 2) + (int8)lo);
|
||||
break;
|
||||
|
||||
case A_ZERO:
|
||||
fprintf(f, "$%02x", lo);
|
||||
break;
|
||||
|
||||
case A_ZEROX:
|
||||
fprintf(f, "$%02x,x", lo);
|
||||
break;
|
||||
|
||||
case A_ZEROY:
|
||||
fprintf(f, "$%02x,y", lo);
|
||||
break;
|
||||
|
||||
case A_ABS:
|
||||
fprintf(f, "$%04x", (hi << 8) | lo);
|
||||
break;
|
||||
|
||||
case A_ABSX:
|
||||
fprintf(f, "$%04x,x", (hi << 8) | lo);
|
||||
break;
|
||||
|
||||
case A_ABSY:
|
||||
fprintf(f, "$%04x,y", (hi << 8) | lo);
|
||||
break;
|
||||
|
||||
case A_IND:
|
||||
fprintf(f, "($%04x)", (hi << 8) | lo);
|
||||
break;
|
||||
|
||||
case A_INDX:
|
||||
fprintf(f, "($%02x,x)", lo);
|
||||
break;
|
||||
|
||||
case A_INDY:
|
||||
fprintf(f, "($%02x),y", lo);
|
||||
break;
|
||||
}
|
||||
|
||||
fputc('\n', f);
|
||||
return adr_length[mode];
|
||||
}
|
1212
cxmon/src/mon_atraps.h
Normal file
1212
cxmon/src/mon_atraps.h
Normal file
File diff suppressed because it is too large
Load Diff
666
cxmon/src/mon_cmd.cpp
Normal file
666
cxmon/src/mon_cmd.cpp
Normal file
@ -0,0 +1,666 @@
|
||||
/*
|
||||
* mon_cmd.cpp - cxmon standard commands
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "mon.h"
|
||||
#include "mon_cmd.h"
|
||||
#include "mon_disass.h"
|
||||
|
||||
#ifndef VERSION
|
||||
#define VERSION "3"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* range_args = [expression] [[COMMA] expression] END
|
||||
*
|
||||
* Read start address to "adr", end address to "end_adr".
|
||||
* "adr" defaults to '.', "end_adr" defaults to '.'+def_range
|
||||
*
|
||||
* true: OK, false: Error
|
||||
*/
|
||||
|
||||
static bool range_args(uintptr *adr, uintptr *end_adr, uint32 def_range)
|
||||
{
|
||||
*adr = mon_dot_address;
|
||||
*end_adr = mon_dot_address + def_range;
|
||||
|
||||
if (mon_token == T_END)
|
||||
return true;
|
||||
else {
|
||||
if (!mon_expression(adr))
|
||||
return false;
|
||||
*end_adr = *adr + def_range;
|
||||
if (mon_token == T_END)
|
||||
return true;
|
||||
else {
|
||||
if (mon_token == T_COMMA) mon_get_token();
|
||||
if (!mon_expression(end_adr))
|
||||
return false;
|
||||
return mon_token == T_END;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* byte_string = (expression | STRING) {COMMA (expression | STRING)} END
|
||||
*/
|
||||
|
||||
static bool byte_string(uint8 *&str, uintptr &len)
|
||||
{
|
||||
uintptr value;
|
||||
|
||||
static const int GRANULARITY = 16; // must be a power of 2
|
||||
str = NULL;
|
||||
len = 0;
|
||||
goto start;
|
||||
|
||||
for (;;) {
|
||||
if (mon_token == T_COMMA) {
|
||||
mon_get_token();
|
||||
|
||||
start:
|
||||
if (mon_token == T_STRING) {
|
||||
unsigned n = strlen(mon_string);
|
||||
str = (uint8 *)realloc(str, (len + n - 1 + GRANULARITY) & ~(GRANULARITY - 1));
|
||||
memcpy(str + len, mon_string, n);
|
||||
len += n;
|
||||
mon_get_token();
|
||||
} else if (mon_expression(&value)) {
|
||||
str = (uint8 *)realloc(str, (len + GRANULARITY) & ~(GRANULARITY - 1));
|
||||
str[len] = value;
|
||||
len++;
|
||||
} else {
|
||||
if (str)
|
||||
free(str);
|
||||
return false;
|
||||
}
|
||||
|
||||
} else if (mon_token == T_END) {
|
||||
return true;
|
||||
} else {
|
||||
mon_error("',' expected");
|
||||
if (str)
|
||||
free(str);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert character to printable character
|
||||
*/
|
||||
|
||||
static inline uint8 char2print(uint8 c)
|
||||
{
|
||||
return (c >= 0x20 && c <= 0x7e) ? c : '.';
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Show version
|
||||
* ver
|
||||
*/
|
||||
|
||||
void version(void)
|
||||
{
|
||||
fprintf(monout, "cxmon V" VERSION "\n");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Redirect output
|
||||
* o [file]
|
||||
*/
|
||||
|
||||
void redir_output(void)
|
||||
{
|
||||
// Close old file
|
||||
if (monout != monerr) {
|
||||
fclose(monout);
|
||||
monout = monerr;
|
||||
return;
|
||||
}
|
||||
|
||||
// No argument given?
|
||||
if (mon_token == T_END)
|
||||
return;
|
||||
|
||||
// Otherwise open file
|
||||
if (mon_token == T_STRING) {
|
||||
mon_get_token();
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
if (!(monout = fopen(mon_string, "w")))
|
||||
mon_error("Unable to open file");
|
||||
} else
|
||||
mon_error("'\"' around file name expected");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Compute and display expression
|
||||
* ? expression
|
||||
*/
|
||||
|
||||
void print_expr(void)
|
||||
{
|
||||
uintptr val;
|
||||
|
||||
if (!mon_expression(&val))
|
||||
return;
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (val > 0x7fffffff) {
|
||||
fprintf(monout, "Hex unsigned: $%08x\n"
|
||||
"Hex signed : -$%08x\n"
|
||||
"Dec unsigned: %u\n"
|
||||
"Dec signed : %d\n", val, -val, val, val);
|
||||
fprintf(monout, "Char : '%c%c%c%c'\n", char2print(val >> 24), char2print(val >> 16), char2print(val >> 8), char2print(val));
|
||||
} else {
|
||||
fprintf(monout, "Hex : $%08x\n"
|
||||
"Dec : %d\n", val, val);
|
||||
fprintf(monout, "Char: '%c%c%c%c'\n", char2print(val >> 24), char2print(val >> 16), char2print(val >> 8), char2print(val));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Execute shell command
|
||||
* \ "command"
|
||||
*/
|
||||
|
||||
void shell_command(void)
|
||||
{
|
||||
if (mon_token != T_STRING) {
|
||||
mon_error("'\"' around command expected");
|
||||
return;
|
||||
}
|
||||
mon_get_token();
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
system(mon_string);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Memory dump
|
||||
* m [start [end]]
|
||||
*/
|
||||
|
||||
#define MEMDUMP_BPL 16 // Bytes per line
|
||||
|
||||
void memory_dump(void)
|
||||
{
|
||||
uintptr adr, end_adr;
|
||||
uint8 mem[MEMDUMP_BPL + 1];
|
||||
|
||||
mem[MEMDUMP_BPL] = 0;
|
||||
|
||||
if (!range_args(&adr, &end_adr, 16 * MEMDUMP_BPL - 1)) // 16 lines unless end address specified
|
||||
return;
|
||||
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr: adr % mon_mem_size);
|
||||
for (int i=0; i<MEMDUMP_BPL; i++, adr++) {
|
||||
if (i % 4 == 0)
|
||||
fprintf(monout, " %08x", mon_read_word(adr));
|
||||
mem[i] = char2print(mon_read_byte(adr));
|
||||
}
|
||||
fprintf(monout, " '%s'\n", mem);
|
||||
}
|
||||
|
||||
mon_dot_address = adr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* ASCII dump
|
||||
* i [start [end]]
|
||||
*/
|
||||
|
||||
#define ASCIIDUMP_BPL 64 // Bytes per line
|
||||
|
||||
void ascii_dump(void)
|
||||
{
|
||||
uintptr adr, end_adr;
|
||||
uint8 str[ASCIIDUMP_BPL + 1];
|
||||
|
||||
str[ASCIIDUMP_BPL] = 0;
|
||||
|
||||
if (!range_args(&adr, &end_adr, 16 * ASCIIDUMP_BPL - 1)) // 16 lines unless end address specified
|
||||
return;
|
||||
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
for (int i=0; i<ASCIIDUMP_BPL; i++, adr++)
|
||||
str[i] = char2print(mon_read_byte(adr));
|
||||
fprintf(monout, " '%s'\n", str);
|
||||
}
|
||||
|
||||
mon_dot_address = adr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Binary dump
|
||||
* b [start [end]]
|
||||
*/
|
||||
|
||||
void binary_dump(void)
|
||||
{
|
||||
uintptr adr, end_adr;
|
||||
uint8 str[9];
|
||||
|
||||
str[8] = 0;
|
||||
|
||||
if (!range_args(&adr, &end_adr, 7)) // 8 lines unless end address specified
|
||||
return;
|
||||
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx:", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
uint8 b = mon_read_byte(adr);
|
||||
for (int m=0x80, i=0; i<8; m>>=1, i++)
|
||||
str[i] = (b & m) ? '*' : '.';
|
||||
fprintf(monout, " '%s'\n", str);
|
||||
adr++;
|
||||
}
|
||||
|
||||
mon_dot_address = adr;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Disassemble
|
||||
* d [start [end]]
|
||||
* d65 [start [end]]
|
||||
* d68 [start [end]]
|
||||
* d80 [start [end]]
|
||||
* d86 [start [end]]
|
||||
* d8086 [start [end]]
|
||||
*/
|
||||
|
||||
enum CPUType {
|
||||
CPU_PPC,
|
||||
CPU_6502,
|
||||
CPU_680x0,
|
||||
CPU_Z80,
|
||||
CPU_80x86_32,
|
||||
CPU_80x86_16,
|
||||
CPU_x86_64
|
||||
};
|
||||
|
||||
static void disassemble(CPUType type)
|
||||
{
|
||||
uintptr adr, end_adr;
|
||||
|
||||
if (!range_args(&adr, &end_adr, 16 * 4 - 1)) // 16 lines unless end address specified
|
||||
return;
|
||||
|
||||
switch (type) {
|
||||
case CPU_PPC:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
uint32 w = mon_read_word(adr);
|
||||
fprintf(monout, "%0*lx: %08x\t", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size, w);
|
||||
disass_ppc(monout, mon_use_real_mem ? adr : adr % mon_mem_size, w);
|
||||
adr += 4;
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_6502:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
uint8 op = mon_read_byte(adr);
|
||||
uint8 lo = mon_read_byte(adr + 1);
|
||||
uint8 hi = mon_read_byte(adr + 2);
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_6502(monout, mon_use_real_mem ? adr : adr % mon_mem_size, op, lo, hi);
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_680x0:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_68k(monout, mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_Z80:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_z80(monout, mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_x86_64:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 64);
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_80x86_32:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 32);
|
||||
}
|
||||
break;
|
||||
|
||||
case CPU_80x86_16:
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
fprintf(monout, "%0*lx: ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
adr += disass_x86(monout, mon_use_real_mem ? adr : adr % mon_mem_size, 16);
|
||||
}
|
||||
}
|
||||
|
||||
mon_dot_address = adr;
|
||||
}
|
||||
|
||||
void disassemble_ppc(void)
|
||||
{
|
||||
disassemble(CPU_PPC);
|
||||
}
|
||||
|
||||
void disassemble_6502(void)
|
||||
{
|
||||
disassemble(CPU_6502);
|
||||
}
|
||||
|
||||
void disassemble_680x0(void)
|
||||
{
|
||||
disassemble(CPU_680x0);
|
||||
}
|
||||
|
||||
void disassemble_z80(void)
|
||||
{
|
||||
disassemble(CPU_Z80);
|
||||
}
|
||||
|
||||
void disassemble_80x86_32(void)
|
||||
{
|
||||
disassemble(CPU_80x86_32);
|
||||
}
|
||||
|
||||
void disassemble_80x86_16(void)
|
||||
{
|
||||
disassemble(CPU_80x86_16);
|
||||
}
|
||||
|
||||
void disassemble_x86_64(void)
|
||||
{
|
||||
disassemble(CPU_x86_64);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Modify memory
|
||||
* : addr bytestring
|
||||
*/
|
||||
|
||||
void modify(void)
|
||||
{
|
||||
uintptr adr, len, src_adr = 0;
|
||||
uint8 *str;
|
||||
|
||||
if (!mon_expression(&adr))
|
||||
return;
|
||||
if (!byte_string(str, len))
|
||||
return;
|
||||
|
||||
while (src_adr < len)
|
||||
mon_write_byte(adr++, str[src_adr++]);
|
||||
mon_dot_address = adr;
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fill
|
||||
* f start end bytestring
|
||||
*/
|
||||
|
||||
void fill(void)
|
||||
{
|
||||
uintptr adr, end_adr, len, src_adr = 0;
|
||||
uint8 *str;
|
||||
|
||||
if (!mon_expression(&adr))
|
||||
return;
|
||||
if (!mon_expression(&end_adr))
|
||||
return;
|
||||
if (!byte_string(str, len))
|
||||
return;
|
||||
|
||||
while (adr <= end_adr)
|
||||
mon_write_byte(adr++, str[src_adr++ % len]);
|
||||
|
||||
free(str);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Transfer memory
|
||||
* t start end dest
|
||||
*/
|
||||
|
||||
void transfer(void)
|
||||
{
|
||||
uintptr adr, end_adr, dest;
|
||||
int num;
|
||||
|
||||
if (!mon_expression(&adr))
|
||||
return;
|
||||
if (!mon_expression(&end_adr))
|
||||
return;
|
||||
if (!mon_expression(&dest))
|
||||
return;
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
num = end_adr - adr + 1;
|
||||
|
||||
if (dest < adr)
|
||||
for (int i=0; i<num; i++)
|
||||
mon_write_byte(dest++, mon_read_byte(adr++));
|
||||
else {
|
||||
dest += end_adr - adr;
|
||||
for (int i=0; i<num; i++)
|
||||
mon_write_byte(dest--, mon_read_byte(end_adr--));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Compare
|
||||
* c start end dest
|
||||
*/
|
||||
|
||||
void compare(void)
|
||||
{
|
||||
uintptr adr, end_adr, dest;
|
||||
int num = 0;
|
||||
|
||||
if (!mon_expression(&adr))
|
||||
return;
|
||||
if (!mon_expression(&end_adr))
|
||||
return;
|
||||
if (!mon_expression(&dest))
|
||||
return;
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
while (adr <= end_adr && !mon_aborted()) {
|
||||
if (mon_read_byte(adr) != mon_read_byte(dest)) {
|
||||
fprintf(monout, "%0*lx ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
num++;
|
||||
if (!(num & 7))
|
||||
fputc('\n', monout);
|
||||
}
|
||||
adr++; dest++;
|
||||
}
|
||||
|
||||
if (num & 7)
|
||||
fputc('\n', monout);
|
||||
fprintf(monout, "%d byte(s) different\n", num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Search for byte string
|
||||
* h start end bytestring
|
||||
*/
|
||||
|
||||
void hunt(void)
|
||||
{
|
||||
uintptr adr, end_adr, len;
|
||||
uint8 *str;
|
||||
int num = 0;
|
||||
|
||||
if (!mon_expression(&adr))
|
||||
return;
|
||||
if (!mon_expression(&end_adr))
|
||||
return;
|
||||
if (!byte_string(str, len))
|
||||
return;
|
||||
|
||||
while ((adr+len-1) <= end_adr && !mon_aborted()) {
|
||||
uint32 i;
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
if (mon_read_byte(adr + i) != str[i])
|
||||
break;
|
||||
|
||||
if (i == len) {
|
||||
fprintf(monout, "%0*lx ", int(2 * sizeof(adr)), mon_use_real_mem ? adr : adr % mon_mem_size);
|
||||
num++;
|
||||
if (num == 1)
|
||||
mon_dot_address = adr;
|
||||
if (!(num & 7))
|
||||
fputc('\n', monout);
|
||||
}
|
||||
adr++;
|
||||
}
|
||||
|
||||
free(str);
|
||||
|
||||
if (num & 7)
|
||||
fputc('\n', monout);
|
||||
fprintf(monout, "Found %d occurrences\n", num);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Load data
|
||||
* [ start "file"
|
||||
*/
|
||||
|
||||
void load_data(void)
|
||||
{
|
||||
uintptr start_adr;
|
||||
FILE *file;
|
||||
int fc;
|
||||
|
||||
if (!mon_expression(&start_adr))
|
||||
return;
|
||||
if (mon_token == T_END) {
|
||||
mon_error("Missing file name");
|
||||
return;
|
||||
}
|
||||
if (mon_token != T_STRING) {
|
||||
mon_error("'\"' around file name expected");
|
||||
return;
|
||||
}
|
||||
mon_get_token();
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(file = fopen(mon_string, "rb")))
|
||||
mon_error("Unable to open file");
|
||||
else {
|
||||
uintptr adr = start_adr;
|
||||
|
||||
while ((fc = fgetc(file)) != EOF)
|
||||
mon_write_byte(adr++, fc);
|
||||
fclose(file);
|
||||
|
||||
fprintf(monerr, "%08x bytes read from %0*lx to %0*lx\n", adr - start_adr, int(2 * sizeof(adr)), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, int(2 * sizeof(adr)), mon_use_real_mem ? adr-1 : (adr-1) % mon_mem_size);
|
||||
mon_dot_address = adr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Save data
|
||||
* ] start size "file"
|
||||
*/
|
||||
|
||||
void save_data(void)
|
||||
{
|
||||
uintptr start_adr, size;
|
||||
FILE *file;
|
||||
|
||||
if (!mon_expression(&start_adr))
|
||||
return;
|
||||
if (!mon_expression(&size))
|
||||
return;
|
||||
if (mon_token == T_END) {
|
||||
mon_error("Missing file name");
|
||||
return;
|
||||
}
|
||||
if (mon_token != T_STRING) {
|
||||
mon_error("'\"' around file name expected");
|
||||
return;
|
||||
}
|
||||
mon_get_token();
|
||||
if (mon_token != T_END) {
|
||||
mon_error("Too many arguments");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(file = fopen(mon_string, "wb")))
|
||||
mon_error("Unable to create file");
|
||||
else {
|
||||
uintptr adr = start_adr, end_adr = start_adr + size - 1;
|
||||
|
||||
while (adr <= end_adr)
|
||||
fputc(mon_read_byte(adr++), file);
|
||||
fclose(file);
|
||||
|
||||
fprintf(monerr, "%08x bytes written from %0*lx to %0*lx\n", size, int(2 * sizeof(adr)), mon_use_real_mem ? start_adr : start_adr % mon_mem_size, int(2 * sizeof(adr)), mon_use_real_mem ? end_adr : end_adr % mon_mem_size);
|
||||
}
|
||||
}
|
46
cxmon/src/mon_cmd.h
Normal file
46
cxmon/src/mon_cmd.h
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* mon_cmd.h - cxmon standard commands
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 MON_CMD_H
|
||||
#define MON_CMD_H
|
||||
|
||||
extern void version(void);
|
||||
extern void redir_output(void);
|
||||
extern void print_expr(void);
|
||||
extern void shell_command(void);
|
||||
extern void memory_dump(void);
|
||||
extern void ascii_dump(void);
|
||||
extern void binary_dump(void);
|
||||
extern void disassemble_ppc(void);
|
||||
extern void disassemble_6502(void);
|
||||
extern void disassemble_680x0(void);
|
||||
extern void disassemble_z80(void);
|
||||
extern void disassemble_80x86_32(void);
|
||||
extern void disassemble_80x86_16(void);
|
||||
extern void disassemble_x86_64(void);
|
||||
extern void modify(void);
|
||||
extern void fill(void);
|
||||
extern void transfer(void);
|
||||
extern void compare(void);
|
||||
extern void hunt(void);
|
||||
extern void load_data(void);
|
||||
extern void save_data(void);
|
||||
|
||||
#endif
|
204
cxmon/src/mon_disass.cpp
Normal file
204
cxmon/src/mon_disass.cpp
Normal file
@ -0,0 +1,204 @@
|
||||
/*
|
||||
* mon_disass.cpp - Disassemblers
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "mon.h"
|
||||
#include "mon_disass.h"
|
||||
|
||||
#include "mon_atraps.h"
|
||||
#include "mon_lowmem.h"
|
||||
|
||||
|
||||
// Flag: enable MacOS A-Trap and LM globals lookup in 68k disassembler
|
||||
bool mon_macos_mode = false;
|
||||
|
||||
|
||||
/*
|
||||
* GNU disassembler callbacks
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
#include "disass/dis-asm.h"
|
||||
|
||||
int buffer_read_memory(bfd_vma from, bfd_byte *to, unsigned int length, struct disassemble_info *info)
|
||||
{
|
||||
while (length--)
|
||||
*to++ = mon_read_byte(from++);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void perror_memory(int status, bfd_vma memaddr, struct disassemble_info *info)
|
||||
{
|
||||
info->fprintf_func(info->stream, "Unknown error %d\n", status);
|
||||
}
|
||||
|
||||
bool lookup_lowmem;
|
||||
|
||||
void generic_print_address(bfd_vma addr, struct disassemble_info *info)
|
||||
{
|
||||
if (lookup_lowmem && addr >= 0x100 && addr < 0x3000) {
|
||||
if (((addr >= 0x400 && addr < 0x800) || (addr >= 0xe00 && addr < 0x1e00)) && ((addr & 3) == 0)) {
|
||||
// Look for address in A-Trap table
|
||||
uint16 opcode = (addr < 0xe00 ? 0xa000 + (addr - 0x400) / 4 : 0xa800 + (addr - 0xe00) / 4);
|
||||
uint16 mask = (addr < 0xe00 ? 0xf8ff : 0xffff);
|
||||
const atrap_info *p = atraps;
|
||||
while (p->word) {
|
||||
if ((p->word & mask) == opcode) {
|
||||
info->fprintf_func(info->stream, p->name);
|
||||
return;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
} else {
|
||||
// Look for address in low memory globals table
|
||||
const lowmem_info *p = lowmem;
|
||||
while (p->name) {
|
||||
if (addr >= p[0].addr && addr < p[1].addr) {
|
||||
if (addr == p[0].addr)
|
||||
info->fprintf_func(info->stream, "%s", p->name);
|
||||
else
|
||||
info->fprintf_func(info->stream, "%s+%d", p->name, addr - p->addr);
|
||||
return;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (addr >= UVAL64(0x100000000))
|
||||
info->fprintf_func(info->stream, "$%08x%08x", (uint32)(addr >> 32), (uint32)addr);
|
||||
else
|
||||
info->fprintf_func(info->stream, "$%08x", (uint32)addr);
|
||||
}
|
||||
|
||||
int generic_symbol_at_address(bfd_vma addr, struct disassemble_info *info)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void print_68k_invalid_opcode(unsigned long opcode, struct disassemble_info *info)
|
||||
{
|
||||
if (mon_macos_mode) {
|
||||
// Look for MacOS A-Trap
|
||||
const atrap_info *p = atraps;
|
||||
while (p->word) {
|
||||
if (p->word == opcode) {
|
||||
info->fprintf_func(info->stream, p->name);
|
||||
return;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
}
|
||||
info->fprintf_func(info->stream, "?");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* sprintf into a "stream"
|
||||
*/
|
||||
|
||||
struct SFILE {
|
||||
char *buffer;
|
||||
char *current;
|
||||
};
|
||||
|
||||
static int mon_sprintf(SFILE *f, const char *format, ...)
|
||||
{
|
||||
int n;
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsprintf(f->current, format, args);
|
||||
f->current += n = strlen(f->current);
|
||||
va_end(args);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Disassemble one instruction, return number of bytes
|
||||
*/
|
||||
|
||||
int disass_68k(FILE *f, uint32 adr)
|
||||
{
|
||||
// Initialize info for GDB disassembler
|
||||
disassemble_info info;
|
||||
char buf[1024];
|
||||
SFILE sfile = {buf, buf};
|
||||
sfile.buffer = buf;
|
||||
sfile.current = buf;
|
||||
INIT_DISASSEMBLE_INFO(info, (FILE *)&sfile, (fprintf_ftype)mon_sprintf);
|
||||
|
||||
// Disassemble instruction
|
||||
lookup_lowmem = mon_macos_mode;
|
||||
int num = print_insn_m68k(adr, &info);
|
||||
|
||||
for (int i=0; i<6; i+=2) {
|
||||
if (num > i)
|
||||
fprintf(f, "%04x ", mon_read_half(adr + i));
|
||||
else
|
||||
fprintf(f, " ");
|
||||
}
|
||||
if (num == 8)
|
||||
fprintf(f, "%04x\t%s\n", mon_read_half(adr + 6), buf);
|
||||
else if (num > 8)
|
||||
fprintf(f, "...\t%s\n", buf);
|
||||
else
|
||||
fprintf(f, " \t%s\n", buf);
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
int disass_x86(FILE *f, uint32 adr, uint32 bits)
|
||||
{
|
||||
// Initialize info for GDB disassembler
|
||||
disassemble_info info;
|
||||
char buf[1024];
|
||||
SFILE sfile = {buf, buf};
|
||||
sfile.buffer = buf;
|
||||
sfile.current = buf;
|
||||
INIT_DISASSEMBLE_INFO(info, (FILE *)&sfile, (fprintf_ftype)mon_sprintf);
|
||||
if (bits == 16)
|
||||
info.mach = bfd_mach_i386_i8086;
|
||||
else if (bits == 64)
|
||||
info.mach = bfd_mach_x86_64;
|
||||
|
||||
// Disassemble instruction
|
||||
lookup_lowmem = false;
|
||||
int num = print_insn_i386_att(adr, &info);
|
||||
|
||||
for (int i=0; i<6; i++) {
|
||||
if (num > i)
|
||||
fprintf(f, "%02x ", mon_read_byte(adr + i));
|
||||
else
|
||||
fprintf(f, " ");
|
||||
}
|
||||
if (num == 7)
|
||||
fprintf(f, "%02x\t%s\n", mon_read_byte(adr + 7), buf);
|
||||
else if (num > 7)
|
||||
fprintf(f, "..\t%s\n", buf);
|
||||
else
|
||||
fprintf(f, " \t%s\n", buf);
|
||||
|
||||
return num;
|
||||
}
|
30
cxmon/src/mon_disass.h
Normal file
30
cxmon/src/mon_disass.h
Normal file
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* mon_disass.h - Disassemblers
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 MON_DISASS_H
|
||||
#define MON_DISASS_H
|
||||
|
||||
extern void disass_ppc(FILE *f, unsigned int adr, unsigned int w);
|
||||
extern int disass_68k(FILE *f, uint32 adr);
|
||||
extern int disass_x86(FILE *f, uint32 adr, uint32 bits = 32);
|
||||
extern int disass_6502(FILE *f, uint32 adr, uint8 op, uint8 lo, uint8 hi);
|
||||
extern int disass_z80(FILE *f, uint32 adr);
|
||||
|
||||
#endif
|
579
cxmon/src/mon_lowmem.cpp
Normal file
579
cxmon/src/mon_lowmem.cpp
Normal file
@ -0,0 +1,579 @@
|
||||
/*
|
||||
* mon_lowmem.cpp - MacOS low memory globals definitions
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include "mon_lowmem.h"
|
||||
|
||||
// Array of low memory globals in ascending order
|
||||
const lowmem_info lowmem[] = {
|
||||
{"MonkeyLives" , 0x100},
|
||||
{"ScrVRes" , 0x102},
|
||||
{"ScrHRes" , 0x104},
|
||||
{"ScreenRow" , 0x106},
|
||||
{"MemTop" , 0x108},
|
||||
{"BufPtr" , 0x10C},
|
||||
{"StkLowPt" , 0x110},
|
||||
{"HeapEnd" , 0x114},
|
||||
{"TheZone" , 0x118},
|
||||
{"UTableBase" , 0x11C},
|
||||
{"MacJump" , 0x120},
|
||||
{"DskRtnAdr" , 0x124},
|
||||
{"PollRtnAdr" , 0x128},
|
||||
{"DskVerify" , 0x12C},
|
||||
{"LoadTrap" , 0x12D},
|
||||
{"MmInOK" , 0x12E},
|
||||
{"CPUFlag" , 0x12F},
|
||||
{"ApplLimit" , 0x130},
|
||||
{"SonyVars" , 0x134},
|
||||
{"PWMValue" , 0x138},
|
||||
{"PollStack" , 0x13A},
|
||||
{"PollProc" , 0x13E},
|
||||
{"DskErr" , 0x142},
|
||||
{"SysEvtMask" , 0x144},
|
||||
{"SysEvtBuf" , 0x146},
|
||||
{"EventQueue" , 0x14A},
|
||||
{"EvtBufCnt" , 0x154},
|
||||
{"RndSeed" , 0x156},
|
||||
{"SysVersion" , 0x15A},
|
||||
{"SEvtEnb" , 0x15C},
|
||||
{"DSWndUpdate" , 0x15D},
|
||||
{"FontFlag" , 0x15E},
|
||||
{"IntFlag" , 0x15F},
|
||||
{"VBLQueue" , 0x160},
|
||||
{"Ticks" , 0x16A},
|
||||
{"MBTicks" , 0x16E},
|
||||
{"MBState" , 0x172},
|
||||
{"Tocks" , 0x173},
|
||||
{"KeyMap" , 0x174},
|
||||
{"KeypadMap" , 0x17C},
|
||||
{"KeyLast" , 0x184},
|
||||
{"KeyTime" , 0x186},
|
||||
{"KeyRepTime" , 0x18A},
|
||||
{"KeyThresh" , 0x18E},
|
||||
{"KeyRepThresh" , 0x190},
|
||||
{"Lvl1DT" , 0x192},
|
||||
{"Lvl2DT" , 0x1B2},
|
||||
{"UnitNtryCnt" , 0x1D2},
|
||||
{"VIA" , 0x1D4},
|
||||
{"SCCRd" , 0x1D8},
|
||||
{"SCCWr" , 0x1DC},
|
||||
{"IWM" , 0x1E0},
|
||||
{"GetParam" , 0x1E4},
|
||||
{"SysParam" , 0x1F8},
|
||||
{"SPValid" , 0x1F8},
|
||||
{"SPATalkA" , 0x1F9},
|
||||
{"SPATalkB" , 0x1FA},
|
||||
{"SPConfig" , 0x1FB},
|
||||
{"SPPortA" , 0x1FC},
|
||||
{"SPPortB" , 0x1FE},
|
||||
{"SPAlarm" , 0x200},
|
||||
{"SPFont" , 0x204},
|
||||
{"SPKbd" , 0x206},
|
||||
{"SPPrint" , 0x207},
|
||||
{"SPVolCtl" , 0x208},
|
||||
{"SPClikCaret" , 0x209},
|
||||
{"SPMisc1" , 0x20A},
|
||||
{"SPMisc2" , 0x20B},
|
||||
{"Time" , 0x20C},
|
||||
{"BootDrive" , 0x210},
|
||||
{"JShell" , 0x212},
|
||||
{"SFSaveDisk" , 0x214},
|
||||
{"KbdVars" , 0x216},
|
||||
{"KbdLast" , 0x218},
|
||||
{"JKybdTask" , 0x21A},
|
||||
{"KbdType" , 0x21E},
|
||||
{"AlarmState" , 0x21F},
|
||||
{"MemErr" , 0x220},
|
||||
{"JFigTrkSpd" , 0x222},
|
||||
{"JDiskPrime" , 0x226},
|
||||
{"JRdAddr" , 0x22A},
|
||||
{"JRdData" , 0x22E},
|
||||
{"JWrData" , 0x232},
|
||||
{"JSeek" , 0x236},
|
||||
{"JSetupPoll" , 0x23A},
|
||||
{"JRecal" , 0x23E},
|
||||
{"JControl" , 0x242},
|
||||
{"JWakeUp" , 0x246},
|
||||
{"JReSeek" , 0x24A},
|
||||
{"JMakeSpdTbl" , 0x24E},
|
||||
{"JAdrDisk" , 0x252},
|
||||
{"JSetSpeed" , 0x256},
|
||||
{"NiblTbl" , 0x25A},
|
||||
{"FlEvtMask" , 0x25E},
|
||||
{"SdVolume" , 0x260},
|
||||
{"SdEnable/Finder" , 0x261},
|
||||
{"SoundVars" , 0x262},
|
||||
{"SoundBase" , 0x266},
|
||||
{"SoundVBL" , 0x26A},
|
||||
{"SoundDCE" , 0x27A},
|
||||
{"SoundActive" , 0x27E},
|
||||
{"SoundLevel" , 0x27F},
|
||||
{"CurPitch" , 0x280},
|
||||
{"Switcher" , 0x282},
|
||||
{"SwitcherTPtr" , 0x286},
|
||||
{"RSDHndl" , 0x28A},
|
||||
{"ROM85" , 0x28E},
|
||||
{"PortAUse" , 0x290},
|
||||
{"PortBUse" , 0x291},
|
||||
{"ScreenVars" , 0x292},
|
||||
{"JGNEFilter" , 0x29A},
|
||||
{"Key1Trans" , 0x29E},
|
||||
{"Key2Trans" , 0x2A2},
|
||||
{"SysZone" , 0x2A6},
|
||||
{"ApplZone" , 0x2AA},
|
||||
{"ROMBase" , 0x2AE},
|
||||
{"RAMBase" , 0x2B2},
|
||||
{"ExpandMem" , 0x2B6},
|
||||
{"DSAlertTab" , 0x2BA},
|
||||
{"ExtStsDT" , 0x2BE},
|
||||
{"SCCASts" , 0x2CE},
|
||||
{"SCCBSts" , 0x2CF},
|
||||
{"SerialVars" , 0x2D0},
|
||||
{"ABusVars" , 0x2D8},
|
||||
{"ABusDCE" , 0x2DC},
|
||||
{"FinderName" , 0x2E0},
|
||||
{"DoubleTime" , 0x2F0},
|
||||
{"CaretTime" , 0x2F4},
|
||||
{"ScrDmpEnb" , 0x2F8},
|
||||
{"ScrDmpType" , 0x2F9},
|
||||
{"TagData" , 0x2FA},
|
||||
{"BufTgFNum" , 0x2FC},
|
||||
{"BufTgFFlg" , 0x300},
|
||||
{"BufTgFBkNum" , 0x302},
|
||||
{"BufTgDate" , 0x304},
|
||||
{"DrvQHdr" , 0x308},
|
||||
{"PWMBuf2" , 0x312},
|
||||
{"HpChk/MacPgm" , 0x316},
|
||||
{"Lo3Bytes" , 0x31A},
|
||||
{"MinStack" , 0x31E},
|
||||
{"DefltStack" , 0x322},
|
||||
{"MMDefFlags" , 0x326},
|
||||
{"GZRootHnd" , 0x328},
|
||||
{"GZRootPtr" , 0x32C},
|
||||
{"GZMoveHnd" , 0x330},
|
||||
{"DSDrawProc" , 0x334},
|
||||
{"EjectNotify" , 0x338},
|
||||
{"IAZNotify" , 0x33C},
|
||||
{"CurDB" , 0x340},
|
||||
{"NxtDB" , 0x342},
|
||||
{"MaxDB" , 0x344},
|
||||
{"FlushOnly" , 0x346},
|
||||
{"RegRsrc" , 0x347},
|
||||
{"FLckUnlck" , 0x348},
|
||||
{"FrcSync" , 0x349},
|
||||
{"NewMount" , 0x34A},
|
||||
{"NoEject" , 0x34B},
|
||||
{"DrMstrBlk" , 0x34C},
|
||||
{"FCBSPtr" , 0x34E},
|
||||
{"DefVCBPtr" , 0x352},
|
||||
{"VCBQHdr" , 0x356},
|
||||
{"FSQHdr" , 0x360},
|
||||
{"FSQHead" , 0x362},
|
||||
{"FSQTail" , 0x366},
|
||||
{"HFSStkTop" , 0x36A},
|
||||
{"HFSStkPtr" , 0x36E},
|
||||
{"WDCBsPtr" , 0x372},
|
||||
{"HFSFlags" , 0x376},
|
||||
{"CacheFlag" , 0x377},
|
||||
{"SysBMCPtr" , 0x378},
|
||||
{"SysVolCPtr" , 0x37C},
|
||||
{"SysCtlCPtr" , 0x380},
|
||||
{"DefVRefNum" , 0x384},
|
||||
{"PMSPPtr" , 0x386},
|
||||
{"HFSTagData" , 0x38A},
|
||||
{"HFSDSErr" , 0x392},
|
||||
{"CacheVars" , 0x394},
|
||||
{"CurDirStore" , 0x398},
|
||||
{"CacheCom" , 0x39C},
|
||||
{"FmtDefaults" , 0x39E},
|
||||
{"ErCode" , 0x3A2},
|
||||
{"Params" , 0x3A4},
|
||||
{"FSTemp8" , 0x3D6},
|
||||
{"FSIOErr" , 0x3DE},
|
||||
{"FSQueueHook" , 0x3E2},
|
||||
{"ExtFSHook" , 0x3E6},
|
||||
{"DskSwtchHook" , 0x3EA},
|
||||
{"ReqstVol" , 0x3EE},
|
||||
{"ToExtFS" , 0x3F2},
|
||||
{"FSFCBLen" , 0x3F6},
|
||||
{"DSAlertRect" , 0x3F8},
|
||||
{"JHideCrsr" , 0x800},
|
||||
{"JShowCrsr" , 0x804},
|
||||
{"JShieldCrsr" , 0x808},
|
||||
{"JScrnAddr" , 0x80C},
|
||||
{"JScrnSize" , 0x810},
|
||||
{"JInitCrsr" , 0x814},
|
||||
{"JSetCrsr" , 0x818},
|
||||
{"JCrsrObscure" , 0x81C},
|
||||
{"JUpdateProc" , 0x820},
|
||||
{"ScrnBase" , 0x824},
|
||||
{"MTemp" , 0x828},
|
||||
{"RawMouse" , 0x82C},
|
||||
{"Mouse" , 0x830},
|
||||
{"CrsrPin" , 0x834},
|
||||
{"CrsrRect" , 0x83C},
|
||||
{"TheCrsr" , 0x844},
|
||||
{"CrsrAddr" , 0x888},
|
||||
{"JAllocCrsr" , 0x88C},
|
||||
{"JSetCCrsr" , 0x890},
|
||||
{"JOpcodeProc" , 0x894},
|
||||
{"CrsrBase" , 0x898},
|
||||
{"CrsrDevice" , 0x89C},
|
||||
{"SrcDevice" , 0x8A0},
|
||||
{"MainDevice" , 0x8A4},
|
||||
{"DeviceList" , 0x8A8},
|
||||
{"CrsrRow" , 0x8AC},
|
||||
{"QDColors" , 0x8B0},
|
||||
{"CrsrVis" , 0x8CC},
|
||||
{"CrsrBusy" , 0x8CD},
|
||||
{"CrsrNew" , 0x8CE},
|
||||
{"CrsrCouple" , 0x8CF},
|
||||
{"CrsrState" , 0x8D0},
|
||||
{"CrsrObscure" , 0x8D2},
|
||||
{"CrsrScale" , 0x8D3},
|
||||
{"MouseMask" , 0x8D6},
|
||||
{"MouseOffset" , 0x8DA},
|
||||
{"JournalFlag" , 0x8DE},
|
||||
{"JSwapFont" , 0x8E0},
|
||||
{"JFontInfo" , 0x8E4},
|
||||
{"JournalRef" , 0x8E8},
|
||||
{"CrsrThresh" , 0x8EC},
|
||||
{"JCrsrTask" , 0x8EE},
|
||||
{"WWExist" , 0x8F2},
|
||||
{"QDExist" , 0x8F3},
|
||||
{"JFetch" , 0x8F4},
|
||||
{"JStash" , 0x8F8},
|
||||
{"JIODone" , 0x8FC},
|
||||
{"CurApRefNum" , 0x900},
|
||||
{"LaunchFlag" , 0x902},
|
||||
{"FondState" , 0x903},
|
||||
{"CurrentA5" , 0x904},
|
||||
{"CurStackBase" , 0x908},
|
||||
{"LoadFiller" , 0x90C},
|
||||
{"CurApName" , 0x910},
|
||||
{"SaveSegHandle" , 0x930},
|
||||
{"CurJTOffset" , 0x934},
|
||||
{"CurPageOption" , 0x936},
|
||||
{"HiliteMode" , 0x938},
|
||||
{"LoaderPBlock" , 0x93A},
|
||||
{"PrintErr" , 0x944},
|
||||
{"ChooserBits" , 0x946},
|
||||
{"PrFlags" , 0x946},
|
||||
{"PrType" , 0x947},
|
||||
{"PrRefNum" , 0x952},
|
||||
{"LastPGlobal" , 0x954},
|
||||
{"ScrapSize" , 0x960},
|
||||
{"ScrapHandle" , 0x964},
|
||||
{"ScrapCount" , 0x968},
|
||||
{"ScrapState" , 0x96A},
|
||||
{"ScrapName" , 0x96C},
|
||||
{"ScrapTag" , 0x970},
|
||||
{"RomFont0" , 0x980},
|
||||
{"AppFontID" , 0x984},
|
||||
{"SaveFondFlags" , 0x986},
|
||||
{"FMDefaultSize" , 0x987},
|
||||
{"CurFMFamily" , 0x988},
|
||||
{"CurFMSize" , 0x98A},
|
||||
{"CurFMFace" , 0x98C},
|
||||
{"CurFMNeedBits" , 0x98D},
|
||||
{"CurFMDevice" , 0x98E},
|
||||
{"CurFMNumer" , 0x990},
|
||||
{"CurFMDenom" , 0x994},
|
||||
{"FOutError" , 0x998},
|
||||
{"FOutFontHandle" , 0x99A},
|
||||
{"FOutBold" , 0x99E},
|
||||
{"FOutItalic" , 0x99F},
|
||||
{"FOutULOffset" , 0x9A0},
|
||||
{"FOutULShadow" , 0x9A1},
|
||||
{"FOutULThick" , 0x9A2},
|
||||
{"FOutShadow" , 0x9A3},
|
||||
{"FOutExtra" , 0x9A4},
|
||||
{"FOutAscent" , 0x9A5},
|
||||
{"FOutDescent" , 0x9A6},
|
||||
{"FOutWidMax" , 0x9A7},
|
||||
{"FOutLeading" , 0x9A8},
|
||||
{"FOutUnused" , 0x9A9},
|
||||
{"FOutNumer" , 0x9AA},
|
||||
{"FOutDenom" , 0x9AE},
|
||||
{"FMDotsPerInch" , 0x9B2},
|
||||
{"FMStyleTab" , 0x9B6},
|
||||
{"ToolScratch" , 0x9CE},
|
||||
{"WindowList" , 0x9D6},
|
||||
{"SaveUpdate" , 0x9DA},
|
||||
{"PaintWhite" , 0x9DC},
|
||||
{"WMgrPort" , 0x9DE},
|
||||
{"DeskPort" , 0x9E2},
|
||||
{"OldStructure" , 0x9E6},
|
||||
{"OldContent" , 0x9EA},
|
||||
{"GrayRgn" , 0x9EE},
|
||||
{"SaveVisRgn" , 0x9F2},
|
||||
{"DragHook" , 0x9F6},
|
||||
{"TempRect" , 0x9FA},
|
||||
{"OneOne" , 0xA02},
|
||||
{"MinusOne" , 0xA06},
|
||||
{"TopMenuItem" , 0xA0A},
|
||||
{"AtMenuBottom" , 0xA0C},
|
||||
{"IconBitmap" , 0xA0E},
|
||||
{"MenuList" , 0xA1C},
|
||||
{"MBarEnable" , 0xA20},
|
||||
{"CurDeKind" , 0xA22},
|
||||
{"MenuFlash" , 0xA24},
|
||||
{"TheMenu" , 0xA26},
|
||||
{"SavedHandle" , 0xA28},
|
||||
{"MBarHook" , 0xA2C},
|
||||
{"MenuHook" , 0xA30},
|
||||
{"DragPattern" , 0xA34},
|
||||
{"DeskPattern" , 0xA3C},
|
||||
{"DragFlag" , 0xA44},
|
||||
{"CurDragAction" , 0xA46},
|
||||
{"FPState" , 0xA4A},
|
||||
{"TopMapHndl" , 0xA50},
|
||||
{"SysMapHndl" , 0xA54},
|
||||
{"SysMap" , 0xA58},
|
||||
{"CurMap" , 0xA5A},
|
||||
{"ResReadOnly" , 0xA5C},
|
||||
{"ResLoad" , 0xA5E},
|
||||
{"ResErr" , 0xA60},
|
||||
{"TaskLock" , 0xA62},
|
||||
{"FScaleDisable" , 0xA63},
|
||||
{"CurActivate" , 0xA64},
|
||||
{"CurDeactive" , 0xA68},
|
||||
{"DeskHook" , 0xA6C},
|
||||
{"TEDoText" , 0xA70},
|
||||
{"TERecal" , 0xA74},
|
||||
{"ApplScratch" , 0xA78},
|
||||
{"GhostWindow" , 0xA84},
|
||||
{"CloseOrnHook" , 0xA88},
|
||||
{"ResumeProc" , 0xA8C},
|
||||
{"RestProc" , 0xA8C},
|
||||
{"SaveProc" , 0xA90},
|
||||
{"SaveSP" , 0xA94},
|
||||
{"ANumber" , 0xA98},
|
||||
{"ACount" , 0xA9A},
|
||||
{"DABeeper" , 0xA9C},
|
||||
{"DAStrings" , 0xAA0},
|
||||
{"TEScrpLength" , 0xAB0},
|
||||
{"TEScrpHandle" , 0xAB4},
|
||||
{"AppPacks" , 0xAB8},
|
||||
{"SysResName" , 0xAD8},
|
||||
{"SoundGlue" , 0xAE8},
|
||||
{"AppParmHandle" , 0xAEC},
|
||||
{"DSErrCode" , 0xAF0},
|
||||
{"ResErrProc" , 0xAF2},
|
||||
{"TEWdBreak" , 0xAF6},
|
||||
{"DlgFont" , 0xAFA},
|
||||
{"LastTGlobal" , 0xAFC},
|
||||
{"TrapAgain" , 0xB00},
|
||||
{"KeyMVars" , 0xB04},
|
||||
{"ROMMapHndl" , 0xB06},
|
||||
{"PWMBuf1" , 0xB0A},
|
||||
{"BootMask" , 0xB0E},
|
||||
{"WidthPtr" , 0xB10},
|
||||
{"ATalkHk1" , 0xB14},
|
||||
{"LAPMgrPtr" , 0xB18},
|
||||
{"FourDHack" , 0xB1C},
|
||||
{"UnSwitchedFlags" , 0xB20},
|
||||
{"SwitchedFlags" , 0xB21},
|
||||
{"HWCfgFlags" , 0xB22},
|
||||
{"TimeSCSIDB" , 0xB24},
|
||||
{"Top2MenuItem" , 0xB26},
|
||||
{"At2MenuBottom" , 0xB28},
|
||||
{"WidthTabHandle" , 0xB2A},
|
||||
{"SCSIDrvrs" , 0xB2E},
|
||||
{"TimeVars" , 0xB30},
|
||||
{"BtDskRfn" , 0xB34},
|
||||
{"BootTmp8" , 0xB36},
|
||||
{"NTSC" , 0xB3E},
|
||||
{"T1Arbitrate" , 0xB3F},
|
||||
{"JDiskSel" , 0xB40},
|
||||
{"JSendCmd" , 0xB44},
|
||||
{"JDCDReset" , 0xB48},
|
||||
{"LastSPExtra" , 0xB4C},
|
||||
{"FileShareVars" , 0xB50},
|
||||
{"MenuDisable" , 0xB54},
|
||||
{"MBDFHndl" , 0xB58},
|
||||
{"MBSaveLoc" , 0xB5C},
|
||||
{"BNMQHdr" , 0xB60},
|
||||
{"BackgrounderVars" , 0xB64},
|
||||
{"MenuLayer" , 0xB68},
|
||||
{"OmegaSANE" , 0xB6C},
|
||||
{"CarlByte" , 0xB72},
|
||||
{"SystemInfo" , 0xB73},
|
||||
{"VMGlobals" , 0xB78},
|
||||
{"Twitcher2" , 0xB7C},
|
||||
{"RMgrHiVars" , 0xB80},
|
||||
{"HSCHndl" , 0xB84},
|
||||
{"PadRsrc" , 0xB88},
|
||||
{"ResOneDeep" , 0xB9A},
|
||||
{"PadRsrc2" , 0xB9C},
|
||||
{"RomMapInsert" , 0xB9E},
|
||||
{"TmpResLoad" , 0xB9F},
|
||||
{"IntlSpec" , 0xBA0},
|
||||
{"RMgrPerm" , 0xBA4},
|
||||
{"WordRedraw" , 0xBA5},
|
||||
{"SysFontFam" , 0xBA6},
|
||||
{"DefFontSize" , 0xBA8},
|
||||
{"MBarHeight" , 0xBAA},
|
||||
{"TESysJust" , 0xBAC},
|
||||
{"HiHeapMark" , 0xBAE},
|
||||
{"SegHiEnable" , 0xBB2},
|
||||
{"FDevDisable" , 0xBB3},
|
||||
{"CommToolboxGlob" , 0xBB4},
|
||||
{"CMVector" , 0xBB4},
|
||||
{"ShutDwnQHdr" , 0xBBC},
|
||||
{"NewUnused" , 0xBC0},
|
||||
{"LastFOND" , 0xBC2},
|
||||
{"FONDID" , 0xBC6},
|
||||
{"App2Packs" , 0xBC8},
|
||||
{"MAErrProc" , 0xBE8},
|
||||
{"MASuperTab" , 0xBEC},
|
||||
{"MimeGlobs" , 0xBF0},
|
||||
{"FractEnable" , 0xBF4},
|
||||
{"UsedFWidth" , 0xBF5},
|
||||
{"FScaleHFact" , 0xBF6},
|
||||
{"FScaleVFact" , 0xBFA},
|
||||
{"SCCIOPFlag" , 0xBFE},
|
||||
{"MacJmpFlag" , 0xBFF},
|
||||
{"SCSIBase" , 0xC00},
|
||||
{"SCSIDMA" , 0xC04},
|
||||
{"SCSIHsk" , 0xC08},
|
||||
{"SCSIGlobals" , 0xC0C},
|
||||
{"RGBBlack" , 0xC10},
|
||||
{"RGBWhite" , 0xC16},
|
||||
{"FMSynth" , 0xC1C},
|
||||
{"RowBits" , 0xC20},
|
||||
{"ColLines" , 0xC22},
|
||||
{"ScreenBytes" , 0xC24},
|
||||
{"IOPMgrVars" , 0xC28},
|
||||
{"NMIFlag" , 0xC2C},
|
||||
{"VidType" , 0xC2D},
|
||||
{"VidMode" , 0xC2E},
|
||||
{"SCSIPoll" , 0xC2F},
|
||||
{"SEVarBase" , 0xC30},
|
||||
{"MacsBugSP" , 0xC6C},
|
||||
{"MacsBugPC" , 0xC70},
|
||||
{"MacsBugSR" , 0xC74},
|
||||
{"MMUFlags" , 0xCB0},
|
||||
{"MMUType" , 0xCB1},
|
||||
{"MMU32bit" , 0xCB2},
|
||||
{"MachineType" , 0xCB3},
|
||||
{"MMUTbl24" , 0xCB4},
|
||||
{"MMUTbl32" , 0xCB8},
|
||||
{"SInfoPtr" , 0xCBC},
|
||||
{"ASCBase" , 0xCC0},
|
||||
{"SMGlobals" , 0xCC4},
|
||||
{"TheGDevice" , 0xCC8},
|
||||
{"CQDGlobals" , 0xCCC},
|
||||
{"AuxWinHead" , 0xCD0},
|
||||
{"AuxCtlHead" , 0xCD4},
|
||||
{"DeskCPat" , 0xCD8},
|
||||
{"SetOSDefKey" , 0xCDC},
|
||||
{"LastBinPat" , 0xCE0},
|
||||
{"DeskPatEnable" , 0xCE8},
|
||||
{"TimeVIADB" , 0xCEA},
|
||||
{"VIA2Base" , 0xCEC},
|
||||
{"VMVectors" , 0xCF0},
|
||||
{"ADBBase" , 0xCF8},
|
||||
{"WarmStart" , 0xCFC},
|
||||
{"TimeDBRA" , 0xD00},
|
||||
{"TimeSCCDB" , 0xD02},
|
||||
{"SlotQDT" , 0xD04},
|
||||
{"SlotPrTbl" , 0xD08},
|
||||
{"SlotVBLQ" , 0xD0C},
|
||||
{"ScrnVBLPtr" , 0xD10},
|
||||
{"SlotTICKS" , 0xD14},
|
||||
{"PowerMgrVars" , 0xD18},
|
||||
{"AGBHandle" , 0xD1C},
|
||||
{"TableSeed" , 0xD20},
|
||||
{"SRsrcTblPtr" , 0xD24},
|
||||
{"JVBLTask" , 0xD28},
|
||||
{"WMgrCPort" , 0xD2C},
|
||||
{"VertRRate" , 0xD30},
|
||||
{"SynListHandle" , 0xD32},
|
||||
{"LastFore" , 0xD36},
|
||||
{"LastBG" , 0xD3A},
|
||||
{"LastMode" , 0xD3E},
|
||||
{"LastDepth" , 0xD40},
|
||||
{"FMExist" , 0xD42},
|
||||
{"SavedHilite" , 0xD43},
|
||||
{"ShieldDepth" , 0xD4C},
|
||||
{"MenuCInfo" , 0xD50},
|
||||
{"MBProcHndl" , 0xD54},
|
||||
{"MBFlash" , 0xD5C},
|
||||
{"ChunkyDepth" , 0xD60},
|
||||
{"CrsrPtr" , 0xD62},
|
||||
{"PortList" , 0xD66},
|
||||
{"MickeyBytes" , 0xD6A},
|
||||
{"QDErr" , 0xD6E},
|
||||
{"VIA2DT" , 0xD70},
|
||||
{"SInitFlags" , 0xD90},
|
||||
{"DTQueue" , 0xD92},
|
||||
{"DTQFlags" , 0xD92},
|
||||
{"DTskQHdr" , 0xD94},
|
||||
{"DTskQTail" , 0xD98},
|
||||
{"JDTInstall" , 0xD9C},
|
||||
{"HiliteRGB" , 0xDA0},
|
||||
{"OldTimeSCSIDB" , 0xDA6},
|
||||
{"DSCtrAdj" , 0xDA8},
|
||||
{"IconTLAddr" , 0xDAC},
|
||||
{"VideoInfoOK" , 0xDB0},
|
||||
{"EndSRTPtr" , 0xDB4},
|
||||
{"SDMJmpTblPtr" , 0xDB8},
|
||||
{"JSwapMMU" , 0xDBC},
|
||||
{"SdmBusErr" , 0xDC0},
|
||||
{"LastTxGDevice" , 0xDC4},
|
||||
{"PMgrHandle" , 0xDC8},
|
||||
{"LayerPalette" , 0xDCC},
|
||||
{"AddrMapFlags" , 0xDD0},
|
||||
{"UnivROMFlags" , 0xDD4},
|
||||
{"UniversalInfoPtr" , 0xDD8},
|
||||
{"BootGlobPtr" , 0xDDC},
|
||||
{"EgretGlobals" , 0xDE0},
|
||||
{"SaneTrapAddr" , 0xDE4},
|
||||
{"Warhol" , 0xDE8},
|
||||
{"MemVectors24" , 0x1E00},
|
||||
{"Mem2Vectors24" , 0x1EE0},
|
||||
{"Phys2Log" , 0x1EF0},
|
||||
{"RealMemTop" , 0x1EF4},
|
||||
{"PhysMemTop" , 0x1EF8},
|
||||
{"MMFlags" , 0x1EFC},
|
||||
{"MemVectors32" , 0x1F00},
|
||||
{"DrawCrsrVector" , 0x1FB8},
|
||||
{"EraseCrsrVector" , 0x1FBC},
|
||||
{"PSCIntTbl" , 0x1FC0},
|
||||
{"DSPGlobals" , 0x1FC4},
|
||||
{"FP040Vects" , 0x1FC8},
|
||||
{"FPBSUNVec" , 0x1FCC},
|
||||
{"FPUNFLVec" , 0x1FD0},
|
||||
{"FPOPERRVec" , 0x1FD4},
|
||||
{"FPOVFLVec" , 0x1FD8},
|
||||
{"FPSNANVec" , 0x1FDC},
|
||||
{"Mem2Vectors32" , 0x1FE0},
|
||||
{"SCSI2Base" , 0x1FF0},
|
||||
{"LockMemCt" , 0x1FF4},
|
||||
{"DockingGlobals" , 0x1FF8},
|
||||
{"VectorPtr" , 0x2000},
|
||||
{"BasesValid1" , 0x2400},
|
||||
{"BasesValid2" , 0x2404},
|
||||
{"ExtValid1" , 0x2408},
|
||||
{"ExtValid2" , 0x240C},
|
||||
{NULL , 0xFFFF}
|
||||
};
|
32
cxmon/src/mon_lowmem.h
Normal file
32
cxmon/src/mon_lowmem.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* mon_lowmem.h - MacOS low memory globals definitions
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 MON_LOWMEM_H
|
||||
#define MON_LOWMEM_H
|
||||
|
||||
struct lowmem_info {
|
||||
const char *name;
|
||||
uint16 addr;
|
||||
};
|
||||
|
||||
// Array of low memory globals in ascending order
|
||||
extern const lowmem_info lowmem[];
|
||||
|
||||
#endif
|
1129
cxmon/src/mon_ppc.cpp
Normal file
1129
cxmon/src/mon_ppc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
604
cxmon/src/mon_z80.cpp
Normal file
604
cxmon/src/mon_z80.cpp
Normal file
@ -0,0 +1,604 @@
|
||||
/*
|
||||
* mon_z80.cpp - Z80 disassembler
|
||||
*
|
||||
* cxmon (C) 1997-2007 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 "sysdeps.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "mon.h"
|
||||
#include "mon_disass.h"
|
||||
|
||||
|
||||
// Addressing modes
|
||||
enum AddrMode {
|
||||
A_IMPL,
|
||||
A_IMM8, // xx
|
||||
A_IMM16, // xxxx
|
||||
A_ABS8, // (xx)
|
||||
A_ABS16, // (xxxx)
|
||||
A_REL, // relative
|
||||
A_A, // a
|
||||
A_HL, // hl or ix or iy
|
||||
A_SP, // sp
|
||||
A_REG1, // 8-bit register (bits 0..2 of opcode) or (hl)/(ix+d)/(iy+d)
|
||||
A_REG1X, // 8-bit register (bits 0..2 of opcode) or (hl)/(ix+d)/(iy+d), don't substitute h or l on prefixes
|
||||
A_REG2, // 8-bit register (bits 3..5 of opcode) or (hl)/(ix+d)/(iy+d)
|
||||
A_REG2X, // 8-bit register (bits 3..5 of opcode) or (hl)/(ix+d)/(iy+d), don't substitute h or l on prefixes
|
||||
A_REG3, // 16-bit register (bits 4..5 of opcode) bc/de/hl/sp
|
||||
A_REG4, // 16-bit register (bits 4..5 of opcode) bc/de/hl/af
|
||||
A_COND, // condition code (bits 3..5 of opcode)
|
||||
A_COND2, // condition code (bits 3..4 of opcode)
|
||||
A_BIT, // bit number (bits 3..5 of opcode)
|
||||
A_BIT_REG1, // bit number (bits 3..5 of opcode) followed by 8-bit register (bits 0..2 of opcode)
|
||||
A_RST, // restart
|
||||
A_BC_IND, // (bc)
|
||||
A_DE_IND, // (de)
|
||||
A_HL_IND, // (hl) or (ix) or (iy)
|
||||
A_XY_IND, // (ix+d) or (iy+d)
|
||||
A_SP_IND, // (sp)
|
||||
A_DE_HL, // de,hl
|
||||
A_AF_AF, // af,af'
|
||||
};
|
||||
|
||||
// Mnemonics
|
||||
enum Mnemonic {
|
||||
M_ADC, M_ADD, M_AND, M_BIT, M_CALL, M_CCF, M_CP, M_CPD, M_CPDR, M_CPI,
|
||||
M_CPIR, M_CPL, M_DAA, M_DEC, M_DI, M_DJNZ, M_EI, M_EX, M_EXX, M_HALT,
|
||||
M_IM0, M_IM1, M_IM2, M_IN, M_INC, M_IND, M_INDR, M_INI, M_INIR, M_JP,
|
||||
M_JR, M_LD, M_LDD, M_LDDR, M_LDI, M_LDIR, M_NEG, M_NOP, M_OR, M_OTDR,
|
||||
M_OTIR, M_OUT, M_OUTD, M_OUTI, M_POP, M_PUSH, M_RES, M_RET, M_RETI,
|
||||
M_RETN, M_RL, M_RLA, M_RLC, M_RLCA, M_RLD, M_RR, M_RRA, M_RRC, M_RRCA,
|
||||
M_RRD, M_RST, M_SBC, M_SCF, M_SET, M_SL1, M_SLA, M_SRA, M_SRL, M_SUB,
|
||||
M_XOR,
|
||||
M_ILLEGAL,
|
||||
|
||||
M_MAXIMUM
|
||||
};
|
||||
|
||||
// Chars for each mnemonic
|
||||
static const char mnem_1[] = "aaabccccccccddddeeehiiiiiiiiijjlllllnnoooooopprrrrrrrrrrrrrrrssssssssx?";
|
||||
static const char mnem_2[] = "ddniacppppppaeijixxammmnnnnnnprdddddeorttuuuoueeeelllllrrrrrsbcellrruo ";
|
||||
static const char mnem_3[] = "cddtlf ddiilac n xl cddii ddiigp ditttpssttt accd accdtcft1aalbr ";
|
||||
static const char mnem_4[] = " l r r z t012 r r r r rr di h in a a ";
|
||||
|
||||
// Mnemonic for each opcode
|
||||
static const Mnemonic mnemonic[256] = {
|
||||
M_NOP , M_LD , M_LD , M_INC , M_INC , M_DEC , M_LD , M_RLCA, // 00
|
||||
M_EX , M_ADD, M_LD , M_DEC , M_INC , M_DEC , M_LD , M_RRCA,
|
||||
M_DJNZ, M_LD , M_LD , M_INC , M_INC , M_DEC , M_LD , M_RLA , // 10
|
||||
M_JR , M_ADD, M_LD , M_DEC , M_INC , M_DEC , M_LD , M_RRA ,
|
||||
M_JR , M_LD , M_LD , M_INC , M_INC , M_DEC , M_LD , M_DAA , // 20
|
||||
M_JR , M_ADD, M_LD , M_DEC , M_INC , M_DEC , M_LD , M_CPL ,
|
||||
M_JR , M_LD , M_LD , M_INC , M_INC , M_DEC , M_LD , M_SCF , // 30
|
||||
M_JR , M_ADD, M_LD , M_DEC , M_INC , M_DEC , M_LD , M_CCF ,
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , // 40
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD ,
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , // 50
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD ,
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , // 60
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD ,
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_HALT, M_LD , // 70
|
||||
M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD , M_LD ,
|
||||
M_ADD , M_ADD, M_ADD, M_ADD , M_ADD , M_ADD , M_ADD , M_ADD , // 80
|
||||
M_ADC , M_ADC, M_ADC, M_ADC , M_ADC , M_ADC , M_ADC , M_ADC ,
|
||||
M_SUB , M_SUB, M_SUB, M_SUB , M_SUB , M_SUB , M_SUB , M_SUB , // 90
|
||||
M_SBC , M_SBC, M_SBC, M_SBC , M_SBC , M_SBC , M_SBC , M_SBC ,
|
||||
M_AND , M_AND, M_AND, M_AND , M_AND , M_AND , M_AND , M_AND , // a0
|
||||
M_XOR , M_XOR, M_XOR, M_XOR , M_XOR , M_XOR , M_XOR , M_XOR ,
|
||||
M_OR , M_OR , M_OR , M_OR , M_OR , M_OR , M_OR , M_OR , // b0
|
||||
M_CP , M_CP , M_CP , M_CP , M_CP , M_CP , M_CP , M_CP ,
|
||||
M_RET , M_POP, M_JP , M_JP , M_CALL, M_PUSH , M_ADD , M_RST , // c0
|
||||
M_RET , M_RET, M_JP , M_ILLEGAL, M_CALL, M_CALL , M_ADC , M_RST ,
|
||||
M_RET , M_POP, M_JP , M_OUT , M_CALL, M_PUSH , M_SUB , M_RST , // d0
|
||||
M_RET , M_EXX, M_JP , M_IN , M_CALL, M_ILLEGAL, M_SBC , M_RST ,
|
||||
M_RET , M_POP, M_JP , M_EX , M_CALL, M_PUSH , M_AND , M_RST , // e0
|
||||
M_RET , M_JP , M_JP , M_EX , M_CALL, M_ILLEGAL, M_XOR , M_RST ,
|
||||
M_RET , M_POP, M_JP , M_DI , M_CALL, M_PUSH , M_OR , M_RST , // f0
|
||||
M_RET , M_LD , M_JP , M_EI , M_CALL, M_ILLEGAL, M_CP , M_RST
|
||||
};
|
||||
|
||||
// Source/destination addressing modes for each opcode
|
||||
#define A(d,s) (((A_ ## d) << 8) | (A_ ## s))
|
||||
|
||||
static const int adr_mode[256] = {
|
||||
A(IMPL,IMPL) , A(REG3,IMM16) , A(BC_IND,A) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) , // 00
|
||||
A(AF_AF,IMPL) , A(HL,REG3) , A(A,BC_IND) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) ,
|
||||
A(REL,IMPL) , A(REG3,IMM16) , A(DE_IND,A) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) , // 10
|
||||
A(REL,IMPL) , A(HL,REG3) , A(A,DE_IND) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) ,
|
||||
A(COND2,REL) , A(REG3,IMM16) , A(ABS16,HL) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) , // 20
|
||||
A(COND2,REL) , A(HL,REG3) , A(HL,ABS16) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) ,
|
||||
A(COND2,REL) , A(REG3,IMM16) , A(ABS16,A) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) , // 30
|
||||
A(COND2,REL) , A(HL,REG3) , A(A,ABS16) , A(REG3,IMPL) , A(REG2,IMPL) , A(REG2,IMPL) , A(REG2,IMM8) , A(IMPL,IMPL) ,
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) , // 40
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) ,
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) , // 50
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) ,
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) , // 60
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) ,
|
||||
A(REG2,REG1X) , A(REG2,REG1X) , A(REG2,REG1X), A(REG2,REG1X), A(REG2,REG1X), A(REG2,REG1X), A(IMPL,IMPL) , A(REG2,REG1X), // 70
|
||||
A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2,REG1) , A(REG2X,REG1), A(REG2,REG1) ,
|
||||
A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , // 80
|
||||
A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) ,
|
||||
A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , // 90
|
||||
A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) , A(A,REG1) ,
|
||||
A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , // a0
|
||||
A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) ,
|
||||
A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , // b0
|
||||
A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) , A(REG1,IMPL) ,
|
||||
A(COND,IMPL) , A(REG4,IMPL) , A(COND,IMM16), A(IMM16,IMPL), A(COND,IMM16), A(REG4,IMPL) , A(A,IMM8) , A(RST,IMPL) , // c0
|
||||
A(COND,IMPL) , A(IMPL,IMPL) , A(COND,IMM16), A(IMPL,IMPL) , A(COND,IMM16), A(IMM16,IMPL), A(A,IMM8) , A(RST,IMPL) ,
|
||||
A(COND,IMPL) , A(REG4,IMPL) , A(COND,IMM16), A(ABS8,A) , A(COND,IMM16), A(REG4,IMPL) , A(IMM8,IMPL) , A(RST,IMPL) , // d0
|
||||
A(COND,IMPL) , A(IMPL,IMPL) , A(COND,IMM16), A(A,ABS8) , A(COND,IMM16), A(IMPL,IMPL) , A(A,IMM8) , A(RST,IMPL) ,
|
||||
A(COND,IMPL) , A(REG4,IMPL) , A(COND,IMM16), A(SP_IND,HL) , A(COND,IMM16), A(REG4,IMPL) , A(IMM8,IMPL) , A(RST,IMPL) , // e0
|
||||
A(COND,IMPL) , A(HL_IND,IMPL), A(COND,IMM16), A(DE_HL,IMPL), A(COND,IMM16), A(IMPL,IMPL) , A(IMM8,IMPL) , A(RST,IMPL) ,
|
||||
A(COND,IMPL) , A(REG4,IMPL) , A(COND,IMM16), A(IMPL,IMPL) , A(COND,IMM16), A(REG4,IMPL) , A(IMM8,IMPL) , A(RST,IMPL) , // f0
|
||||
A(COND,IMPL) , A(SP,HL) , A(COND,IMM16), A(IMPL,IMPL) , A(COND,IMM16), A(IMPL,IMPL) , A(IMM8,IMPL) , A(RST,IMPL)
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* sprintf into a "stream"
|
||||
*/
|
||||
|
||||
struct SFILE {
|
||||
char *buffer;
|
||||
char *current;
|
||||
};
|
||||
|
||||
static int mon_sprintf(SFILE *f, const char *format, ...)
|
||||
{
|
||||
int n;
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vsprintf(f->current, format, args);
|
||||
f->current += n = strlen(f->current);
|
||||
va_end(args);
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Disassemble one instruction, return number of bytes
|
||||
*/
|
||||
|
||||
static const char *reg_name[] = {"b", "c", "d", "e", "h", "l", "*", "a"};
|
||||
static const char *reg_name_ix[] = {"b", "c", "d", "e", "hx", "lx", "*", "a"}; // undoc
|
||||
static const char *reg_name_iy[] = {"b", "c", "d", "e", "hy", "ly", "*", "a"}; // undoc
|
||||
static const char *reg_name_16[] = {"bc", "de", "hl", "sp"};
|
||||
static const char *reg_name_16_2[] = {"bc", "de", "hl", "af"};
|
||||
static const char *cond_name[] = {"nz", "z", "nc", "c", "po", "pe", "p", "m"};
|
||||
|
||||
static void operand(SFILE *f, char mode, uint32 &adr, uint8 op, bool ix, bool iy)
|
||||
{
|
||||
switch (mode) {
|
||||
case A_IMPL:
|
||||
break;
|
||||
|
||||
case A_IMM8:
|
||||
mon_sprintf(f, "$%02x", mon_read_byte(adr)); adr++;
|
||||
break;
|
||||
|
||||
case A_IMM16:
|
||||
mon_sprintf(f, "$%04x", (mon_read_byte(adr + 1) << 8) | mon_read_byte(adr)); adr += 2;
|
||||
break;
|
||||
|
||||
case A_ABS8:
|
||||
mon_sprintf(f, "($%02x)", mon_read_byte(adr)); adr++;
|
||||
break;
|
||||
|
||||
case A_ABS16:
|
||||
mon_sprintf(f, "($%04x)", (mon_read_byte(adr + 1) << 8) | mon_read_byte(adr)); adr += 2;
|
||||
break;
|
||||
|
||||
case A_REL:
|
||||
mon_sprintf(f, "$%04x", (adr + 1 + (int8)mon_read_byte(adr)) & 0xffff); adr++;
|
||||
break;
|
||||
|
||||
case A_A:
|
||||
mon_sprintf(f, "a");
|
||||
break;
|
||||
|
||||
case A_HL:
|
||||
mon_sprintf(f, ix ? "ix" : (iy ? "iy" : "hl"));
|
||||
break;
|
||||
|
||||
case A_SP:
|
||||
mon_sprintf(f, "sp");
|
||||
break;
|
||||
|
||||
case A_REG1:
|
||||
case A_REG1X: {
|
||||
int reg = op & 7;
|
||||
if (reg == 6) {
|
||||
if (ix || iy) {
|
||||
mon_sprintf(f, "(%s+$%02x)", ix ? "ix" : "iy", mon_read_byte(adr)); adr++;
|
||||
} else {
|
||||
mon_sprintf(f, "(hl)");
|
||||
}
|
||||
} else if (mode == A_REG1) {
|
||||
mon_sprintf(f, "%s", ix ? reg_name_ix[reg] : (iy ? reg_name_iy[reg] : reg_name[reg]));
|
||||
} else {
|
||||
mon_sprintf(f, "%s", reg_name[reg]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case A_REG2:
|
||||
case A_REG2X: {
|
||||
int reg = (op >> 3) & 7;
|
||||
if (reg == 6) {
|
||||
if (ix || iy) {
|
||||
mon_sprintf(f, "(%s+$%02x)", ix ? "ix" : "iy", mon_read_byte(adr)); adr++;
|
||||
} else {
|
||||
mon_sprintf(f, "(hl)");
|
||||
}
|
||||
} else if (mode == A_REG2) {
|
||||
mon_sprintf(f, "%s", ix ? reg_name_ix[reg] : (iy ? reg_name_iy[reg] : reg_name[reg]));
|
||||
} else {
|
||||
mon_sprintf(f, "%s", reg_name[reg]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case A_REG3: {
|
||||
int reg = (op >> 4) & 3;
|
||||
if (reg == 2 && (ix || iy)) {
|
||||
mon_sprintf(f, ix ? "ix" : "iy");
|
||||
} else {
|
||||
mon_sprintf(f, reg_name_16[reg]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case A_REG4: {
|
||||
int reg = (op >> 4) & 3;
|
||||
if (reg == 2 && (ix || iy)) {
|
||||
mon_sprintf(f, ix ? "ix" : "iy");
|
||||
} else {
|
||||
mon_sprintf(f, reg_name_16_2[reg]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case A_COND:
|
||||
mon_sprintf(f, cond_name[(op >> 3) & 7]);
|
||||
break;
|
||||
|
||||
case A_COND2:
|
||||
mon_sprintf(f, cond_name[(op >> 3) & 3]);
|
||||
break;
|
||||
|
||||
case A_BIT:
|
||||
mon_sprintf(f, "%d", (op >> 3) & 7);
|
||||
break;
|
||||
|
||||
case A_BIT_REG1: { // undoc
|
||||
int reg = op & 7;
|
||||
if (reg == 6) {
|
||||
mon_sprintf(f, "%d", (op >> 3) & 7);
|
||||
} else {
|
||||
mon_sprintf(f, "%d,%s", (op >> 3) & 7, reg_name[reg]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case A_RST:
|
||||
mon_sprintf(f, "$%02x", op & 0x38);
|
||||
break;
|
||||
|
||||
case A_BC_IND:
|
||||
mon_sprintf(f, "(bc)");
|
||||
break;
|
||||
|
||||
case A_DE_IND:
|
||||
mon_sprintf(f, "(de)");
|
||||
break;
|
||||
|
||||
case A_HL_IND:
|
||||
mon_sprintf(f, ix ? "(ix)" : (iy ? "(iy)" : "(hl)"));
|
||||
break;
|
||||
|
||||
case A_XY_IND: // undoc
|
||||
mon_sprintf(f, "(%s+$%02x)", ix ? "ix" : "iy", mon_read_byte(adr)); adr++;
|
||||
break;
|
||||
|
||||
case A_SP_IND:
|
||||
mon_sprintf(f, "(sp)");
|
||||
break;
|
||||
|
||||
case A_DE_HL:
|
||||
mon_sprintf(f, "de,hl");
|
||||
break;
|
||||
|
||||
case A_AF_AF:
|
||||
mon_sprintf(f, "af,af'");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int print_instr(SFILE *f, Mnemonic mnem, AddrMode dst_mode, AddrMode src_mode, uint32 adr, uint8 op, bool ix, bool iy)
|
||||
{
|
||||
uint32 orig_adr = adr;
|
||||
|
||||
// Print mnemonic
|
||||
mon_sprintf(f, "%c%c%c%c ", mnem_1[mnem], mnem_2[mnem], mnem_3[mnem], mnem_4[mnem]);
|
||||
|
||||
// Print destination operand
|
||||
operand(f, dst_mode, adr, op, ix, iy);
|
||||
|
||||
// Print source operand
|
||||
if (src_mode != A_IMPL)
|
||||
mon_sprintf(f, ",");
|
||||
operand(f, src_mode, adr, op, ix, iy);
|
||||
|
||||
return adr - orig_adr;
|
||||
}
|
||||
|
||||
static int disass_cb(SFILE *f, uint32 adr, bool ix, bool iy)
|
||||
{
|
||||
int num;
|
||||
|
||||
// Fetch opcode
|
||||
uint8 op;
|
||||
if (ix || iy) {
|
||||
op = mon_read_byte(adr + 1);
|
||||
num = 2;
|
||||
} else {
|
||||
op = mon_read_byte(adr);
|
||||
num = 1;
|
||||
}
|
||||
|
||||
// Decode mnemonic and addressing modes
|
||||
Mnemonic mnem = M_ILLEGAL;
|
||||
AddrMode dst_mode = A_IMPL, src_mode = A_IMPL;
|
||||
|
||||
switch (op & 0xc0) {
|
||||
case 0x00:
|
||||
dst_mode = A_REG1X;
|
||||
if ((ix || iy) && ((op & 7) != 6))
|
||||
src_mode = A_XY_IND;
|
||||
switch ((op >> 3) & 7) {
|
||||
case 0: mnem = M_RLC; break;
|
||||
case 1: mnem = M_RRC; break;
|
||||
case 2: mnem = M_RL; break;
|
||||
case 3: mnem = M_RR; break;
|
||||
case 4: mnem = M_SLA; break;
|
||||
case 5: mnem = M_SRA; break;
|
||||
case 6: mnem = M_SL1; break; // undoc
|
||||
case 7: mnem = M_SRL; break;
|
||||
}
|
||||
break;
|
||||
case 0x40:
|
||||
mnem = M_BIT; dst_mode = A_BIT;
|
||||
if (ix || iy)
|
||||
src_mode = A_XY_IND;
|
||||
else
|
||||
src_mode = A_REG1;
|
||||
break;
|
||||
case 0x80:
|
||||
mnem = M_RES;
|
||||
if (ix || iy) {
|
||||
dst_mode = A_BIT_REG1;
|
||||
src_mode = A_XY_IND;
|
||||
} else {
|
||||
dst_mode = A_BIT;
|
||||
src_mode = A_REG1;
|
||||
}
|
||||
break;
|
||||
case 0xc0:
|
||||
mnem = M_SET;
|
||||
if (ix || iy) {
|
||||
dst_mode = A_BIT_REG1;
|
||||
src_mode = A_XY_IND;
|
||||
} else {
|
||||
dst_mode = A_BIT;
|
||||
src_mode = A_REG1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Print instruction
|
||||
print_instr(f, mnem, dst_mode, src_mode, adr, op, ix, iy);
|
||||
return num;
|
||||
}
|
||||
|
||||
static int disass_ed(SFILE *f, uint32 adr)
|
||||
{
|
||||
// Fetch opcode
|
||||
uint8 op = mon_read_byte(adr);
|
||||
|
||||
// Decode mnemonic and addressing modes
|
||||
Mnemonic mnem;
|
||||
AddrMode dst_mode = A_IMPL, src_mode = A_IMPL;
|
||||
|
||||
switch (op) {
|
||||
case 0x40:
|
||||
case 0x48:
|
||||
case 0x50:
|
||||
case 0x58:
|
||||
case 0x60:
|
||||
case 0x68:
|
||||
case 0x78:
|
||||
mon_sprintf(f, "in %s,(c)", reg_name[(op >> 3) & 7]);
|
||||
return 1;
|
||||
case 0x70:
|
||||
mon_sprintf(f, "in (c)");
|
||||
return 1;
|
||||
|
||||
case 0x41:
|
||||
case 0x49:
|
||||
case 0x51:
|
||||
case 0x59:
|
||||
case 0x61:
|
||||
case 0x69:
|
||||
case 0x79:
|
||||
mon_sprintf(f, "out (c),%s", reg_name[(op >> 3) & 7]);
|
||||
return 1;
|
||||
case 0x71: // undoc
|
||||
mon_sprintf(f, "out (c),0");
|
||||
return 1;
|
||||
|
||||
case 0x42:
|
||||
case 0x52:
|
||||
case 0x62:
|
||||
case 0x72:
|
||||
mnem = M_SBC; dst_mode = A_HL; src_mode = A_REG3;
|
||||
break;
|
||||
|
||||
case 0x43:
|
||||
case 0x53:
|
||||
case 0x63:
|
||||
case 0x73:
|
||||
mnem = M_LD; dst_mode = A_ABS16; src_mode = A_REG3;
|
||||
break;
|
||||
|
||||
case 0x4a:
|
||||
case 0x5a:
|
||||
case 0x6a:
|
||||
case 0x7a:
|
||||
mnem = M_ADC; dst_mode = A_HL; src_mode = A_REG3;
|
||||
break;
|
||||
|
||||
case 0x4b:
|
||||
case 0x5b:
|
||||
case 0x6b:
|
||||
case 0x7b:
|
||||
mnem = M_LD; dst_mode = A_REG3; src_mode = A_ABS16;
|
||||
break;
|
||||
|
||||
case 0x44:
|
||||
case 0x4c: // undoc
|
||||
case 0x54: // undoc
|
||||
case 0x5c: // undoc
|
||||
case 0x64: // undoc
|
||||
case 0x6c: // undoc
|
||||
case 0x74: // undoc
|
||||
case 0x7c: // undoc
|
||||
mnem = M_NEG;
|
||||
break;
|
||||
|
||||
case 0x45:
|
||||
case 0x55: // undoc
|
||||
case 0x5d: // undoc
|
||||
case 0x65: // undoc
|
||||
case 0x6d: // undoc
|
||||
case 0x75: // undoc
|
||||
case 0x7d: // undoc
|
||||
mnem = M_RETN;
|
||||
break;
|
||||
case 0x4d: mnem = M_RETI; break;
|
||||
|
||||
case 0x46:
|
||||
case 0x4e: // undoc
|
||||
case 0x66: // undoc
|
||||
case 0x6e: // undoc
|
||||
mnem = M_IM0;
|
||||
break;
|
||||
case 0x56:
|
||||
case 0x76: // undoc
|
||||
mnem = M_IM1;
|
||||
break;
|
||||
case 0x5e:
|
||||
case 0x7e: // undoc
|
||||
mnem = M_IM2;
|
||||
break;
|
||||
|
||||
case 0x47:
|
||||
mon_sprintf(f, "ld i,a");
|
||||
return 1;
|
||||
case 0x4f:
|
||||
mon_sprintf(f, "ld r,a");
|
||||
return 1;
|
||||
case 0x57:
|
||||
mon_sprintf(f, "ld a,i");
|
||||
return 1;
|
||||
case 0x5f:
|
||||
mon_sprintf(f, "ld a,r");
|
||||
return 1;
|
||||
|
||||
case 0x67: mnem = M_RRD; break;
|
||||
case 0x6f: mnem = M_RLD; break;
|
||||
|
||||
case 0xa0: mnem = M_LDI; break;
|
||||
case 0xa1: mnem = M_CPI; break;
|
||||
case 0xa2: mnem = M_INI; break;
|
||||
case 0xa3: mnem = M_OUTI; break;
|
||||
case 0xa8: mnem = M_LDD; break;
|
||||
case 0xa9: mnem = M_CPD; break;
|
||||
case 0xaa: mnem = M_IND; break;
|
||||
case 0xab: mnem = M_OUTD; break;
|
||||
case 0xb0: mnem = M_LDIR; break;
|
||||
case 0xb1: mnem = M_CPIR; break;
|
||||
case 0xb2: mnem = M_INIR; break;
|
||||
case 0xb3: mnem = M_OTIR; break;
|
||||
case 0xb8: mnem = M_LDDR; break;
|
||||
case 0xb9: mnem = M_CPDR; break;
|
||||
case 0xba: mnem = M_INDR; break;
|
||||
case 0xbb: mnem = M_OTDR; break;
|
||||
|
||||
default:
|
||||
mnem = M_NOP;
|
||||
break;
|
||||
}
|
||||
|
||||
// Print instruction
|
||||
return print_instr(f, mnem, dst_mode, src_mode, adr + 1, op, false, false) + 1;
|
||||
}
|
||||
|
||||
static int disass(SFILE *f, uint32 adr, bool ix, bool iy)
|
||||
{
|
||||
uint8 op = mon_read_byte(adr);
|
||||
if (op == 0xcb)
|
||||
return disass_cb(f, adr + 1, ix, iy) + 1;
|
||||
else
|
||||
return print_instr(f, mnemonic[op], AddrMode(adr_mode[op] >> 8), AddrMode(adr_mode[op] & 0xff), adr + 1, op, ix, iy) + 1;
|
||||
}
|
||||
|
||||
int disass_z80(FILE *f, uint32 adr)
|
||||
{
|
||||
int num;
|
||||
char buf[64];
|
||||
SFILE sfile = {buf, buf};
|
||||
|
||||
switch (mon_read_byte(adr)) {
|
||||
case 0xdd: // ix prefix
|
||||
num = disass(&sfile, adr + 1, true, false) + 1;
|
||||
break;
|
||||
case 0xed:
|
||||
num = disass_ed(&sfile, adr + 1) + 1;
|
||||
break;
|
||||
case 0xfd: // iy prefix
|
||||
num = disass(&sfile, adr + 1, false, true) + 1;
|
||||
break;
|
||||
default:
|
||||
num = disass(&sfile, adr, false, false);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i=0; i<4; i++) {
|
||||
if (num > i)
|
||||
fprintf(f, "%02x ", mon_read_byte(adr + i));
|
||||
else
|
||||
fprintf(f, " ");
|
||||
}
|
||||
|
||||
fprintf(f, "\t%s\n", buf);
|
||||
return num;
|
||||
}
|
96
cxmon/src/sysdeps.h
Normal file
96
cxmon/src/sysdeps.h
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* sysdeps.h - System dependent definitions
|
||||
*
|
||||
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig
|
||||
*
|
||||
* 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 SYSDEPS_H
|
||||
#define SYSDEPS_H
|
||||
|
||||
#ifndef __STDC__
|
||||
#error "Your compiler is not ANSI. Get a real one."
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifndef STDC_HEADERS
|
||||
#error "You don't have ANSI C header files."
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <sys/types.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* Data types */
|
||||
|
||||
#ifdef __BEOS__
|
||||
|
||||
#include <support/ByteOrder.h>
|
||||
|
||||
#else
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
#if SIZEOF_SHORT == 2
|
||||
typedef unsigned short uint16;
|
||||
typedef short int16;
|
||||
#elif SIZEOF_INT == 2
|
||||
typedef unsigned int uint16;
|
||||
typedef int int16;
|
||||
#else
|
||||
#error "No 2 byte type, you lose."
|
||||
#endif
|
||||
#if SIZEOF_INT == 4
|
||||
typedef unsigned int uint32;
|
||||
typedef int int32;
|
||||
#elif SIZEOF_LONG == 4
|
||||
typedef unsigned long uint32;
|
||||
typedef long int32;
|
||||
#else
|
||||
#error "No 4 byte type, you lose."
|
||||
#endif
|
||||
#if SIZEOF_LONG == 8
|
||||
typedef unsigned long uint64;
|
||||
typedef long int64;
|
||||
#define VAL64(a) (a ## l)
|
||||
#define UVAL64(a) (a ## ul)
|
||||
#elif SIZEOF_LONG_LONG == 8
|
||||
typedef unsigned long long uint64;
|
||||
typedef long long int64;
|
||||
#define VAL64(a) (a ## LL)
|
||||
#define UVAL64(a) (a ## uLL)
|
||||
#else
|
||||
#error "No 8 byte type, you lose."
|
||||
#endif
|
||||
#if SIZEOF_VOID_P == 4
|
||||
typedef uint32 uintptr;
|
||||
typedef int32 intptr;
|
||||
#elif SIZEOF_VOID_P == 8
|
||||
typedef uint64 uintptr;
|
||||
typedef int64 intptr;
|
||||
#else
|
||||
#error "Unsupported size of pointer"
|
||||
#endif
|
||||
|
||||
#endif // def __BEOS__
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user