-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
185 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
MZF Disassembler | ||
================ | ||
|
||
This is a utility for retrieving information from an MZF image. | ||
|
||
For editing or assembling, see AS2MZF_. | ||
|
||
Please see ReadTheDocs_ for the latest documentation. | ||
|
||
|
||
.. _AS2MZF: http://www.sharpmz.org/mz-700/as2mzf.htm | ||
.. _ReadTheDocs: http://mzput.readthedocs.io/en/latest/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Contributors | ||
============ | ||
|
||
The author would like to acknowledge Karl-Heinz Mau for: | ||
|
||
- Testing the Windows program and giving feedback. | ||
- Hosting_ the project. | ||
|
||
|
||
.. _Hosting: https://www.sharpmz.org/mzfdisass.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.. doc_test documentation. | ||
.. include:: ../README.rst | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
introduction | ||
installation | ||
usage | ||
credits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Installation | ||
============ | ||
|
||
Binaries | ||
-------- | ||
|
||
There are pre-compiled binaries for Linux_ and Windows_. After unzipping the | ||
archive, the binary for Linux can be found in ``mzfdisas/src/linux/release``, | ||
for Windows it can be found in ``mzfdisas\src\w32\release``. | ||
|
||
|
||
From source | ||
----------- | ||
|
||
Retrieve the source code with Git. | ||
|
||
:: | ||
|
||
git clone https://github.com/jfjlaros/mzfdisas.git | ||
|
||
To compile for Linux: | ||
|
||
:: | ||
|
||
cd mzfdisas/src/linux | ||
sh build.sh | ||
|
||
For Windows, use: | ||
|
||
:: | ||
|
||
cd mzfdisas\src\w32 | ||
build.bat | ||
|
||
The binary will be placed in the ``release`` subdirectory. | ||
|
||
|
||
.. _Linux: https://sharpmz.org/download/mzfdisas.zip | ||
.. _Windows: https://sharpmz.org/download/mzfdisas32.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Introduction | ||
============ | ||
|
||
When disassembling a file, alignment can be a problem. Take the following code | ||
for example: | ||
|
||
:: | ||
|
||
0000: c3 04 00 jp 0004h ; jump to address 0004 | ||
0003: 06 ; just a byte with value 06 | ||
0004: 00 nop ; no operation | ||
|
||
The disassembled code will look like this: | ||
|
||
:: | ||
|
||
0000: c3 04 00 jp 0004h ; jump to address 0004 | ||
0003: 06 00 ld b,00 ; put 00 in register b | ||
|
||
This problem is caused by the disassembler itself since it can not distinguish | ||
data from code. To disassemble the example correctly the user should restart | ||
the disassembly procedure from address ``0004`` in order to retrieve the | ||
``nop`` instruction. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
Usage | ||
===== | ||
|
||
To start inspecting or disassembling an image named ``image.mzf``, use the | ||
following command: | ||
|
||
:: | ||
|
||
mzfdisas image.mzf | ||
|
||
|
||
Dump mode | ||
--------- | ||
|
||
Disassembly is not useful when inspecting data. Normally, a hex editor would | ||
suffice, but since the ASCII table of the MZ is non-standard, a dump mode is | ||
included in this program. | ||
|
||
|
||
Console | ||
------- | ||
|
||
The console is used for user interaction. | ||
|
||
.. figure:: ../doc/mzfdisass1.gif | ||
:alt: Header display | ||
|
||
Header display | ||
|
||
When the program starts, the contents of the header and the addresses in the | ||
header are displayed and a prompt (``>``) is shown. By typing ``u``, one page | ||
of code will be disassembled. | ||
|
||
.. figure:: ../doc/mzfdisass4.gif | ||
:alt: Header display | ||
|
||
Header display | ||
|
||
Type ``d`` to switch to dump mode and ``u`` to dump a page. | ||
|
||
.. figure:: ../doc/mzfdisass3.gif | ||
:alt: Header display | ||
|
||
Header display | ||
|
||
Typing ``d`` again will put the program back in disassemble mode. | ||
|
||
The console recognises the following commands: | ||
|
||
+-----------+----------------------------------------------------+ | ||
| command | description | | ||
+===========+====================================================+ | ||
| jxxxx | Set the address pointer to xxxx. | | ||
+-----------+----------------------------------------------------+ | ||
| e | Go to the execution address found in the header. | | ||
+-----------+----------------------------------------------------+ | ||
| l | Go to the load address found in the header. | | ||
+-----------+----------------------------------------------------+ | ||
| d | Toggle disassemble / dump mode. | | ||
+-----------+----------------------------------------------------+ | ||
| u | Disassemble or dump one page. | | ||
+-----------+----------------------------------------------------+ | ||
| h | Print a help message. | | ||
+-----------+----------------------------------------------------+ | ||
| q | Quit. | | ||
+-----------+----------------------------------------------------+ | ||
|
||
Type ``h`` for help. | ||
|
||
.. figure:: ../doc/mzfdisass2.gif | ||
:alt: Header display | ||
|
||
Header display | ||
|
||
|
||
Other features | ||
-------------- | ||
|
||
All undocumented opcodes are implemented, as well as the duplicates. Inactive | ||
opcodes will decode as a duplicate undocumented nop instruction. | ||
|
||
Sources: | ||
|
||
- `Undocumented opcodes`_. | ||
- `More undocumented opcodes`_. | ||
|
||
|
||
.. _Undocumented opcodes: https://web.archive.org/web/20030415064150/http://www.geocities.com/SiliconValley/Peaks/3938/z80undoc.htm | ||
.. _More undocumented opcodes: http://www.mdfsnet.f9.co.uk/Docs/Comp/Z80/UnDocOps |