uvmac/docs/extras/fdisasm/c/index.html
2020-03-14 15:28:01 -04:00

1 line
16 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title> FDisasm (Stable) </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="canonical" href="index.html">
</head>
<body>
<div>
<i> <a href="https://www.gryphel.com/index.html">www.gryphel.com</a>/c/<a href="../../../index.html">minivmac</a>/<a href="../../index.html">extras</a>/<a href="../index.html">fdisasm</a>/c
- <a href="https://www.gryphel.com/c/c/feedback.html">feedback</a> </i>
</div>
<hr>
<h2 align=center>
FDisasm (Stable)
</h2>
<hr>
<p> Download </p>
<blockquote>
<p> <a href="https://www.gryphel.com/d/minivmac/extras/fdisasm/c/fdisasm-1.2.8.zip">fdisasm-1.2.8.zip</a>
(98K) a zipped hfs disk image and checksum file.
The disk image can be mounted with Mini vMac.
Includes source code. </p>
<p>
<a href="https://www.gryphel.com/d/minivmac/extras/fdisasm/c/fdplusv3-0.4.3.zip">fdplusv3-0.4.3.zip</a>
(25K) a disk image containing all the formatting information needed
to disassemble a Macintosh Plus ROM image
(version 3, final - checksum 4D1F8172).
</p>
<p>
<a href="roms.html">ROM Formatting Information</a> -
more images to disassemble other Macintosh ROMs.
</p>
</blockquote>
<p>
FDisasm is a formatting disassembler for Motorola 680x0 code.
It makes it possible to distribute the means to create an
annotated disassembly of copyrighted code (such as Macintosh
ROM images), without distributing that code or files derived from it.
</p>
<p>
To use FDisasm to disassemble the Macintosh Plus ROM, launch
Mini vMac and boot from a disk image containing
a system folder. Mount the fdplusv3-0.4.3 disk image, and import
a copy of the Macintosh Plus ROM onto it. (Such as by using
<a href="../../importfl/index.html">ImportFl</a>.) Mount the
fdisasm-1.2.8 disk image, copy the FDisasm application
to the fdplus disk image, and then eject the fdisasm
image. Rename the ROM image
to &ldquo;bin&rdquo;, and then launch the FDisasm application. The
program displays a progress indicator, and quits when
it is finished. (It could take five minutes at 1x speed,
so set speed to &ldquo;all out&rdquo;. At &ldquo;all out&rdquo; speed it
takes under 10 seconds to finish on my Mac Mini.) When the program
finishes, the output is in a file named &ldquo;listing&rdquo;.
</p>
<p>
This listing file is over 2 megabytes. The program
MPW Shell 3.2.3 works in Mini vMac and can work with such
large text files. But probably almost nobody else has an
old copy of MPW. (The final version of MPW still available
for free download requires a Mac II or later.) Instead
you can export the listing file to the host computer
(such as by using <a href="../../exportfl/index.html">ExportFl</a>),
and find some program there that can view it. (For
OS X, TextWrangler would work, for example.)
</p>
<p>
<b>Warning</b> : Not enough people are paying
enough attention to FDisasm (especially me) for
it to be relied upon. If you notice something
odd in the output, double check it, and if
it is wrong, please report it to
<a href="https://www.gryphel.com/c/feedback.html">me</a>.
</p>
<p>
This listing file is derived (in terms of copyright
law) from the Macintosh Plus ROM, and so may not be
redistributed.
</p>
<p>
To disassemble the Macintosh 128/512 ROM, follow the above
instructions, except use the fdmac128-0.3.0 disk image, and
of course use a ROM image from a Macintosh 128 or 512.
And similarly for the Macintosh SE, Macintosh
II, and PowerBook 100 ROMs.
</p>
<p>
Here are some details about the formatting information
files used by FDisasm:
</p>
<p>
The only file required by FDisasm is &ldquo;bin&rdquo;. But if this is
all it finds, it will just create a hexadecimal dump of
the file. To disassemble code, it needs to know where
the code is. It looks for a file named &ldquo;bin_map&rdquo; for
this information. It also looks for a file named &ldquo;bin_names&rdquo;
for names of locations within &ldquo;bin&rdquo;, and for a file
named &ldquo;abs_names&rdquo; for names of absolute memory locations,
and for a file named &ldquo;trap_names&rdquo; for names of A-line
instructions. A file named &ldquo;format&rdquo; can give additional
formatting information, and comments to include in the listing.
</p>
<p>
The
<a href="../../findcode/index.html">FindCode</a>
tool can help to create the files &ldquo;bin_map&rdquo; and
&ldquo;bin_names&rdquo;.
</p>
<p>
The
<a href="../../findres/index.html">FindRes</a>
tool will create
an initial &ldquo;format&rdquo; file for Macintosh resources, and
also &ldquo;bin_map&rdquo; and a set of entry points to feed
to FindCode.
</p>
<p>
Besides ROM images, FDisasm can also disassemble
Macintosh 680x0 applications. But the code and other
resources are located in the &ldquo;resource fork&rdquo; of such
appplications, while FDisasm only operates
on the &ldquo;data fork&rdquo; of the file &ldquo;bin&rdquo;.
The <a href="../../getrsfrk/index.html">GetRsFrk</a> tool gets
the resource fork of a file you select, and saves
it into the data fork of &ldquo;bin&rdquo;.
An alternative is
<a href="../../aspack/index.html">asPack</a>,
which also saves the data fork and the meta data into &ldquo;bin&rdquo;,
in AppleSingle format.
</p>
<p>
FDisasm has some compile time options. The default values are
defined in &ldquo;source/CNFGDLFT.i&rdquo;, and these defaults
can be changed in &ldquo;source/CONFIGUR.i&rdquo;. For example,
the following variation does not output the address and hex
fields, resulting in output that is suitable for passing to an
assembler:
</p>
<p> Download </p>
<blockquote>
<p> <a href="https://www.gryphel.com/d/minivmac/extras/fdisasm/c/fdis0002-1.2.8.zip">fdis0002-1.2.8.zip</a>
(25K) variation of FDisasm. </p>
</blockquote>
<p>
The software that has become FDisasm, FindCode, and
FindRes was my first serious programming
project, started in 1985 in Basic, and later converted
to Pascal, and now converted to C when I got back to
it recently. I wonder if 23 years to first
public release is any kind of record.
</p>
<p>
Here are the md5 checksums for the downloads, signed with
<a href="https://www.gryphel.com/c/keys/k5.html">Gryphel Key 5</a>:
</p>
<blockquote>
<pre>
--------- GRY SIGNED TEXT ---------
68588698451c803723c539422ff9ae5e fdisasm-1.2.8.zip
bc264523ff71300fa386adf0ff0b3038 fdis0002-1.2.8.zip
90a7acb8a693b6fdfefbc65902c2fc7a fdplusv2-0.4.3.zip
1eca6ffb1343b52f86776d144c850fb1 fdplusv3-0.4.3.zip
645909aae4ffbe62f30ab29bd8f8a59a fdmac128v1-0.4.4.zip
508d5d06c0a2bd4c6626cb48a69abe1d fdmac128v2-0.4.4.zip
47aec46ed23a55952e09e93fb3ced1b6 fdmacse-0.5.1.zip
9bb504a156f11531fc763dac3df0f7b7 fdmacii-0.2.2.zip
5497d5df84b048c67a75e68f97cbe63d fdpb100-0.2.1.zip
4e9d5774471acae4eb08b575a297552c fdtwiggy-0.1.0.zip
------- BEGIN GRY SIGNATURE -------
Gry/4Xa8CFcUzxdN/DrrEloS+5SFpDl6cgKjSxE0F1WdkN2+pizBTEiuBLgcFR8m
tJf5SWEhy57hEAF+aPvJCkDoLMfA7OIH3gDI98hCSYjQMq0t90fkGkD1MbEiP88V
HpzJ3bsqDyECExvNTXO8tXyl4mNVnwMg6w3vi4hBl/8mgq2HOcLunvRuhwkyjJal
-------- END GRY SIGNATURE --------
</pre>
</blockquote>
<p> See the
<a href="../../../appc/index.html">Compiling</a>
page for instructions on compiling FDisasm from the source code. </p>
<p> You can redistribute FDisasm and/or modify it under the terms
of version 2 of the GNU General Public License as published by
the Free Software Foundation. See the included file COPYING. </p>
<p> FDisasm 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
license for more details. </p>
<p> News: </p>
<p>
<b> April 7, 2019 </b>
version 1.2.8 will now output &ldquo;.W&rdquo; for word sized
operations, rather than relying on the default being word. I
feel this is better style.
<a href="../../reasm/index.html">ReAsm</a>
currently requires this. There are also some new compile time
options for improving compatibility with ReAsm, such as forcing
labels to be on a separate line, and using tab to indent instructions.
These options are used in the fdis0002 variation.
</p>
<p>
<b> February 17, 2019 </b>
version 1.2.7 fixes a bug
<a href="https://www.gryphel.com/c/mail/v9.html#m129">reported by Ryan</a>
that affected disassembling floating point conditional
long branches. It also partially reverts for now a change made
in 1.2.6. If an instruction (or data) that is about to be output is
longer than the space left to be disassembled, it will now
not abort outputting the instruction, and just give a warning.
This version also starts to provide ways to avoid the situations
that lead to this problem. Disassembly of PC relative addressing
modes can now use the AC and SC options for adding or subtracting
a constant. There is a new &lsquo;,&rsquo; option to indicate which
argument options like AC and SC apply to. It also now checks that
such one time options are actually used by the current instruction,
and prints a warning if not.
</p>
<p>
<b> January 6, 2019 </b>
version 1.2.6 adds a &ldquo;BN&rdquo; option to modify &ldquo;B&rdquo;,
&ldquo;W&rdquo; or &ldquo;L&rdquo; options to output binary instead of
hex. Also, if an instruction (or data) that is about to be output is
longer than the space left to be disassembled, then the output is
aborted, and the remaining space is output as data of unknown format.
Also, the AM option (which modifies the D option) now can take an
address as well as a name, and checks the address is correct. Similarly
the J option can now take a name, making the JM option obsolete. The
&ldquo;A&rdquo;, &ldquo;H&rdquo;, and &ldquo;Z&rdquo; options have
been changed to compile time options, which can be specified in the
new file &ldquo;CONFIGUR.i&rdquo; with the default values specified
in &ldquo;CNFGDLFT.i&rdquo;.
</p>
<p>
<b> December 30, 2018 </b>
version 1.2.5 properly limits the size of the hex field. Previously
the hex field would be incorrect for very long lines, such as can be
generated with the new &ldquo;C&rdquo; option. (For the future,
it would be good to limit the length of lines generated by this
option.)
</p>
<p>
<b> December 23, 2018 </b>
version 1.2.4 adds an &ldquo;AL&rdquo; option in the format file
for aligment relative to a base address.
</p>
<p>
<b> December 16, 2018 </b>
version 1.2.3 adds a &ldquo;C&rdquo; option in the format file
for text fields. Also, for the &ldquo;D&rdquo; option (offset
fields), there are three new modifiers: &ldquo;AC&rdquo; for an
added constant, &ldquo;SC&rdquo; for a subtracted constant,
and &ldquo;DC&rdquo; for a constant devided by.
</p>
<p>
<b> December 9, 2018 </b>
version 1.2.2 adds the ability to specify labels in the format file (in
addition to the &ldquo;bin_names&rdquo; file), so that a single address
can have multiple labels. Also in the format file, you can now specify a
one time name to use in an address field argument (overriding the
&ldquo;bin_names&rdquo; file). Similarly, in the format file, can you
specify a name to use for the current base address used by the D option.
The FindRes tool has been updated to begin to take advantage.
</p>
<p>
<b> July 13, 2016 </b>
version 1.2.1 adds the ability to format jump table offsets
as the difference between two symbolic labels (instead
of only listing the numeric value).
Mac Plus and Mac 128K formatting information has been updated to
take advantage.
</p>
<p>
<b> July 1, 2016 </b>
version 1.2.0 adds initial support for FPU instructions,
and works well enough to correctly disassemble
the Floating-Point Arithmetic Package (PACK 4)
of the Macintosh II ROM (verified with the MPW Assembler).
The disk image with the
Mac II formatting information has also been updated.
</p>
<p>
<b> June 24, 2016 </b>
version 1.1.9 now works well enough that feeding the output
to the MPW Assembler gets back the original binary for
the Macintosh II ROM. Except that the Floating-Point Arithmetic Package
(PACK 4) is not disassembled because FPU instructions
are not yet handled. The disk image with the
Mac II formatting information has also been updated.
</p>
<p>
The specific changes include:
The 68020 forms of Mul and Div instructions are now supported.
Also the ExtB.L instruction. A bug in MoveC is fixed.
A bug in Bitfield register width argument is fixed.
And also the code is restructured a bit to better match
the code in Mini vMac CPU emulation, for easier comparison.
</p>
<p>
<b> June 15, 2016 </b>
version 1.1.8 now works well enough that feeding the output
to the MPW Assembler gets back the original binary for
the Macintosh PowerBook 100 ROM. Even though the PowerBook
100 has a 68000 CPU, this ROM has some 68020 code. FDisasm
can now better handle the full extension word format of
addressing mode 6, the absolute long addressing mode,
and the Bitfield instructions. The disk image with the
PowerBook 100 formatting information has also been updated.
</p>
<p>
<b> January 1, 2015 </b>
version 1.1.7 now works well enough that feeding the output
to the MPW Assembler gets back the original binary for
the Macintosh Plus ROM, the Macintosh 128/512 ROM, and
the Macintosh SE ROM.
</p>
<p>
This involved figuring out what syntax the MPW Assembler
accepts for PC relative address mode, when not using
a symbolic label. (It is expecting an address, not the offset.)
The MoveC instruction is now better supported. And there
is a fix for the MoveP instruction.
</p>
<p>
The disk images with formatting information have been updated
for Macintosh Plus ROM, the Macintosh 128/512 ROM, and
the Macintosh SE ROM. The '.' character in labels is not
accepted by the MPW Assembler, and so replaced with '_'.
Also, in a few cases, two addresses were labeled with the same
name. But only one of the two are used by the ROM, and
so the other label was removed.
</p>
<p>
<b> December 30, 2014 </b>
version 1.1.6 fixes incorrect size field for BTST instruction
as reported by
<a href="http://www.bigmessowires.com/">Steve Chamberlin</a>.
There are also a number of other changes to better allow
the MPW Assembler to assemble the output of FDisasm and
get back the original binary.
</p>
<p>
<b> December 28, 2014 </b>
version 1.1.5 changes format of negative hex numbers from
&ldquo;$-A&rdquo; to &ldquo;-$A&rdquo;, so as to work
with the Easy 68K assembler, as requested by
<a href="http://www.bigmessowires.com/">Steve Chamberlin</a>.
</p>
<p>
<b> December 26, 2014 </b>
version 1.1.4 fixes a number of bugs reported by
<a href="http://www.bigmessowires.com/">Steve Chamberlin</a>.
</p>
<p>
<b> May 17, 2014 </b>
fdmac128-0.4.1 includes information
<a href="https://www.gryphel.com/c/mail/v1.html#140517a">reported by Tom Frikker</a>
about initials at the end of the Mac 128k ROM. This lead to finding a
<a href="http://macgui.com/news/article.php?t=336">report by &lsquo;Dog Cow&rsquo;</a>
about more initials in the Twiggy Mac ROM (for an early prototype).
So there may only be two initials in the Mac 128k ROM because the
rest got overwritten, like happened in later versions of the Macintosh
Plus ROM.
</p>
<p>
<b> September 12, 2012 </b>
version 1.1.3 includes code from
<a href="http://www.synack.net/~bbraun/">Rob Braun</a>
for the "pmove, pload, and
pflush family of instructions for the 68851 and 68030".
</p>
<p>
<b> September 7, 2012 </b>
version 1.1.2 includes a bug fix from
<a href="http://www.synack.net/~bbraun/">Rob Braun</a>.
A 32 bit offset
for the Bsr or Bra instruction was not decoded correctly.
</p>
<p>
<b> October 6, 2011 </b>
fdplus-0.4.0 merges in changes from
<a href="http://www.bigmessowires.com/">Steve Chamberlin</a>,
that "added many more
comments of my own, and many new meaningful names for
previously-unamed routine entry points, especially in areas
related to the boot sequence and Sony disk driver".
</p>
<p>
<b> September 25, 2011 </b>
new versions of all the formatting information disk images,
removing the FDisasm application. The version of the
application on them was out of date.
</p>
<p>
<b> June 5, 2011 </b>
version 1.1.1 fixes a bug reported by "Ben". The size field was
not correct for AddQ and SubQ.
</p>
<p> : </p>
<p> If you find FDisasm useful, please consider
<a href="https://www.gryphel.com/c/help/index.html">helping the Gryphel Project</a>,
of which it is a part. </p>
<a href="https://www.gryphel.com/index.html">
<img src="https://www.gryphel.com/d/gryphel-32.gif" width=32 height=32 border=0
alt="gryphel logo, 1K"
>
</a>
<hr>
<div>
<i> <a href="https://www.gryphel.com/index.html">www.gryphel.com</a>/c/<a href="../../../index.html">minivmac</a>/<a href="../../index.html">extras</a>/<a href="../index.html">fdisasm</a>/c
- <a href="https://www.gryphel.com/c/feedback.html">feedback</a> </i>
<br>
copyright (c) 2019 Paul C. Pratt - last update 2/18/2019
</div>
</body>
</html>