The next release will be 0.98.37
[nasm.git] / ndisasm.1
blobfc95922d27755dda302eeeaf5e7e1b300ebecafb
1 .\" $Id$
2 .\"
3 .\" This file is part of NASM and is released under the NASM License.
4 .\"
5 .TH NDISASM 1 "The Netwide Assembler Project"
6 .SH NAME
7 ndisasm \- the Netwide Disassembler \- 80x86 binary file disassembler
8 .SH SYNOPSIS
9 .B ndisasm
11 .B \-o
12 origin
13 ] [
14 .B \-s
15 sync-point [...]]
17 .B \-a
19 .B \-i
20 ] [
21 .B \-b
22 bits
23 ] [
24 .B -u
25 ] [
26 .B \-e
27 hdrlen
28 ] [
29 .B \-k
30 offset,length [...]]
31 infile
32 .br
33 .B ndisasm \-h
34 .br
35 .B ndisasm \-r
36 .SH DESCRIPTION
37 The
38 .B ndisasm
39 command generates a disassembly listing of the binary file
40 .I infile
41 and directs it to stdout.
42 .SS OPTIONS
43 .TP
44 .B \-h
45 Causes
46 .B ndisasm
47 to exit immediately, after giving a summary of its invocation
48 options.
49 .TP
50 .BI \-r
51 Causes
52 .B ndisasm
53 to exit immediately, after displaying its version number.
54 .TP
55 .BI \-o " origin"
56 Specifies the notional load address for the file. This option causes
57 .B ndisasm
58 to get the addresses it lists down the left hand margin, and the
59 target addresses of PC-relative jumps and calls, right.
60 .TP
61 .BI \-s " sync-point"
62 Manually specifies a synchronisation address, such that
63 .B ndisasm
64 will not output any machine instruction which encompasses bytes on
65 both sides of the address. Hence the instruction which
66 .I starts
67 at that address will be correctly disassembled.
68 .TP
69 .BI \-e " hdrlen"
70 Specifies a number of bytes to discard from the beginning of the
71 file before starting disassembly. This does not count towards the
72 calculation of the disassembly offset: the first
73 .I disassembled
74 instruction will be shown starting at the given load address.
75 .TP
76 .BI \-k " offset,length"
77 Specifies that
78 .I length
79 bytes, starting from disassembly offset
80 .IR offset ,
81 should be skipped over without generating any output. The skipped
82 bytes still count towards the calculation of the disassembly offset.
83 .TP
84 .BR \-a " or " \-i
85 Enables automatic (or intelligent) sync mode, in which
86 .B ndisasm
87 will attempt to guess where synchronisation should be performed, by
88 means of examining the target addresses of the relative jumps and
89 calls it disassembles.
90 .TP
91 .BI \-b " bits"
92 Specifies either 16-bit or 32-bit mode. The default is 16-bit mode.
93 .TP
94 .B \-u
95 Specifies 32-bit mode, more compactly than using `-b 32'.
96 .TP
97 .BI \-p " vendor"
98 Prefers instructions as defined by
99 .I vendor
100 in case of a conflict.  Known
101 .I vendor
102 names include
103 .BR intel ,
104 .BR amd ,
105 .BR cyrix ,
107 .BR idt .
108 The default is
109 .BR intel .
112 .SH RESTRICTIONS
113 .B ndisasm
114 only disassembles binary files: it has no understanding of the
115 header information present in object or executable files. If you
116 want to disassemble an object file, you should probably be using
117 .BR objdump "(" 1 ")."
119 Auto-sync mode won't necessarily cure all your synchronisation
120 problems: a sync marker can only be placed automatically if a jump
121 or call instruction is found to refer to it
122 .I before
123 .B ndisasm
124 actually disassembles that part of the code. Also, if spurious jumps
125 or calls result from disassembling non-machine-code data, sync
126 markers may get placed in strange places. Feel free to turn
127 auto-sync off and go back to doing it manually if necessary.
129 .B ndisasm
130 can only keep track of 8192 sync markers internally at once: this is
131 to do with portability, since DOS machines don't take kindly to more
132 than 64K being allocated at a time.
134 .SH SEE ALSO
135 .BR objdump "(" 1 ")."