Skip to content

Commit

Permalink
Restructured documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfjlaros committed Jun 19, 2018
1 parent 1b5cb78 commit 2234464
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 110 deletions.
110 changes: 0 additions & 110 deletions README.md

This file was deleted.

12 changes: 12 additions & 0 deletions README.rst
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
10 changes: 10 additions & 0 deletions docs/credits.rst
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
12 changes: 12 additions & 0 deletions docs/index.rst
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
39 changes: 39 additions & 0 deletions docs/installation.rst
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
23 changes: 23 additions & 0 deletions docs/introduction.rst
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.
89 changes: 89 additions & 0 deletions docs/usage.rst
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

0 comments on commit 2234464

Please sign in to comment.