1 .\" Copyright (c) 2011 Chris Spiegel.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .Nd disassemble Z\-machine stories
35 .Op Fl A Ar address_file
41 utility disassembles Z\-machine stories, displaying the results in a
44 disassembler. The main difference to
48 has knowledge of how Infocom and Inform lay out story files. As such,
50 can get confused by stories that do not conform to a layout it expects.
53 is able to find code (such as action routines) that
55 will not detect, because
57 only finds code that is reachable directly from the initial program
58 counter address. If you know the address of code that is not reachable
59 from the initial program counter address,
61 can decode it if you use the
67 The following options are available:
68 .Bl -tag -width indent
72 starts disassembling at the address at byte
74 in the header, which is the starting location of the program counter.
77 option allows other addresses to be used as a starting location.
80 options can be given, allowing multiple addresses to be examined.
81 Addresses must be specified in hexadecimal, with an optional leading
86 option is used, the story's reported program counter starting address
87 will not be examined. If you wish to include it as well, specify an
89 .It Fl A Ar address_file
90 This is identical to the
92 option, except that addresses are read, one per line, from the file
98 read from standard input.
100 Disable buffered output. This is intended to be used with the
102 option, to ensure that in case of abnormal program termination (such as
103 a segfault), the last-processed instruction will be seen. Such abnormal
104 terminations are the result of bugs in
106 so this is primarily an option to aid in development and debugging.
108 In addition to the instructions, print out a hexadecimal representation
109 of the constituent bytes of each instruction. See also the
115 option will not dump the constituent bytes of strings, because these
116 tend to be very long. The
120 to dump the strings as well as instructions.
122 If an unknown opcode is found or an attempt is made to jump outside of
125 will exit with an error message. This option instructs it to continue
126 to attempt to disassemble. All bets are off at this point, although in
129 will continue to disassemble correctly.
131 When printing strings, use a
133 character to represent a newline instead
134 of an actual newline characer.
137 runs in two phases. First, it scans through a story file, decoding
138 everything that appears to be an instruction. Next, it displays the
139 decoded instructions in order. This second phase is what's normally
142 option also displays the first phase.
146 option is selected, the display of bytes is wrapped at
148 bytes per line, so the screen is less cluttered. If no
150 option is given, a default of 8 is used.
153 .An "Chris Spiegel" Aq cspiegel@gmail.com