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