[go: up one dir, main page]

File: z80dasm.1

package info (click to toggle)
z80dasm 1.1.5-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 3,276 kB
  • sloc: asm: 70,115; ansic: 2,541; sh: 1,255; makefile: 275
file content (143 lines) | stat: -rw-r--r-- 5,316 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
.TH Z80DASM 1 2007-06-14 "Tomaz Solc" "Z80 disassembler User's manual"
.SH NAME
z80dasm \- Z80 assembly generating disassembler
.SH SYNOPSIS
.B z80dasm
[
.I options
]
.I file
.SH DESCRIPTION
.B z80dasm
disassembles a binary file containing Z80 machine code into Z80 assembly language source (including a number of undocumented opcodes). It can try to guess locations of labels in the code or the labels can be specified by hand in the form of a symbol file. If given proper information the disassembler can also split the binary file into code and data sections of several different types.
.P
Generated source file can be assembled back into the original binary using z80asm, zasm or the original Zilog assembler (when the 
.B \-\-zilog
option was used).
.SH OPTIONS
.TP
.B \-a, \-\-address
Print the address of the memory location corresponding to each line of assembly code in a comment at the end of the line. 
.TP
.B \-b, \-\-block-def=FILE
Read block information from a file. If this option is not specified the default is for the entire file to contain machine code. See
.B BLOCK FILE
below.
.TP
.B \-g, \-\-origin=ORG
Specify the start address of the binary code being disassembled. A corresponding 
.I org
directive is generated in the output file.  The argument is read in hexadecimal if  it  begins with 0x or 0X, in octal if it begins with 0, and in base 10 otherwise. Default is 0x0100. 
.TP
.B \-h, \-\-help
Show summary of options and exit.
.TP
.B \-l, \-\-labels
Try to guess label locations from jump instructions and add them to the assembly code.
.TP
.B "\-o, \-\-output=FILE
Specify the output file. Default is to write to standard output.
.TP
.B \-s, \-\-sym-output=FILE
Write symbol information into a file.
.TP
.B \-S, \-\-sym-input=FILE
Read symbol information from a file. See 
.B SYMBOL FILE 
below.
.TP
.B \-t, \-\-source
Print the binary data corresponding to each line of assembly code in a comment at the end of the line. Data is printed in hex and ASCII. This is useful for identifying data sections in the first disassembly.
.TP
.B \-u, \-\-undoc
By default, all undocumented instructions are disassembled as
.I defb
directives with the instruction name in a comment. This is due to missing or buggy support for many of these instructions in z80asm. If this option is specified, undocumented instructions are written directly into the disassembly.
.TP
.B \-v, \-\-verbose
Increase verbosity level.  Specify multiple times to be more verbose.  Messages are sent to standard error.
.TP
.B \-V, \-\-version
Display version information and exit.
.TP
.B \-z, \-\-zilog
Enable compatibility mode for the original Zilog Z80 assembler. This currently only changes the syntax of relative jumps.

.SH SYMBOL FILE
Symbol files written by 
.B z80dasm 
can be directly used as input symbol files with the 
.B --sym-input
option. The following directives are recognized in input symbol files and are propagated to the output symbol files:

.TP
.BR include " ""filename"""
Include another symbol file. Double quotes are mandatory. Included files must be in the current directory.

.TP
.BR "" symbol: " equ" " value"
Define a symbol with a value. The value is read in hexadecimal if it begins with 0x or 0X, in octal if it begins with 0, and in base 10 otherwise. Default is 0x0100. 

.TP
.BR ; " comment"
All characters between a semi-colon and end of line are ignored.

.SH BLOCK FILE
Block files specify the boundaries between different blocks (sections) of binary data in the disassembler input file. The following directives are recognized:

.TP
.BR "" name: " [ unlabeled ] [ start | first ] " "address" " [ unlabeled ] [ end | last ] " "address" " type" " type"
Define a block with the start and end address that contains a certain type of binary data.

Start address is the 16 bit address of the first byte in the block. Keywords "start" and "first" are synonymous. If the keyword "end" is used, the end address is the 16 bit address of the last byte in the block plus one. If the keyword "last" is used, the end address is the 16 bit address of the last byte in block.

Normally labels are defined at the addresses specified in the block definition. This can be suppressed by adding the keyword "unlabeled" before the address.

.TP
.BR ; " comment"
All characters between a semi-colon and end of line are ignored.

.P
The following block types are supported:

.TP
.B code
Block containing Z80 machine code. Data in this block will be written in Z80 assembly language.

.TP
.B bytedata
Data block containing separate bytes. Data in this block will be written with 
.I defb
directives.

.TP
.B worddata
Data block containing 16 bit words (low order byte first). Data in this block will be written with 
.I defw
directives.

.TP
.B pointers
Data block containing 16 bit pointers (low order byte first). This type is
equivalent to 
.B worddata
except that values will be replaced with labels where that is possible.

.SH DIAGNOSTICS
If disassembly was successful 
.B z80dasm
returns 0. On error diagnostic messages are printed to standard error and
.B z80dasm
returns 1.

.SH BUGS
Please report bugs to 
.I
tomaz.solc@tablix.org
.SH AUTHOR
.B z80dasm 
is based largely on
.B dz80
, written by Jan Panteltje. Feature enhancements and bug fixes were made by Tomaz Solc.
.SH SEE ALSO
.BR z80asm (1)