The info file contains lists of specifications grouped together. Each group directive has an identifying token and an attribute list enclosed in curly braces. Attributes have a name followed by a value. The syntax of the value depends on the type of the attribute. String attributes are places in double quotes, numeric attributes may be specified as decimal numbers or hexadecimal with a leading dollar sign. There are also attributes where the attribute value is a keyword, in this case the keyword is given as is (without quotes or anything). Each attribute is terminated by a semicolon.
group-name { attribute1 attribute-value; attribute2 attribute-value; }
Comments start with a hash mark (#
) and extend from the position of
the mark to the end of the current line. Hash marks inside of strings will
of course not start a comment.
Global options may be specified in a group with the name GLOBAL
. The
following attributes are recognized:
COMMENTS
This attribute may be used instead of the
--comments
option on the command line. It takes a numerical
parameter between 0 and 4. Higher values increase the amount of information
written to the output file in form of comments.
CPU
This attribute may be used instead of the
--cpu
option on the command line. It takes a string parameter.
INPUTNAME
The attribute is followed by a string value, which gives the name of the input file to read. If it is present, the disassembler does not accept an input file name on the command line.
INPUTOFFS
The attribute is followed by a numerical value that gives an offset into the input file which is skipped before reading data. The attribute may be used to skip headers or unwanted code sections in the input file.
INPUTSIZE
INPUTSIZE
is followed by a numerical value that gives the amount of
data to read from the input file. Data beyond INPUTOFFS + INPUTSIZE
is ignored.
OUTPUTNAME
The attribute is followed by string value, which gives the name of the
output file to write. If it is present, specification of an output file on
the command line using the
-o
option is
not allowed.
The default is to use stdout
for output, so without this attribute or
the corresponding command line option
-o
the output will go to the terminal.
PAGELENGTH
This attribute may be used instead of the
--pagelength
option on the command line. It takes a numerical
parameter. Using zero as page length (which is the default) means that no
pages are generated.
STARTADDR
This attribute may be used instead of the
--start-addr
option on the command line. It takes a numerical
parameter. The default for the start address is $10000 minus the size of
the input file (this assumes that the input file is a ROM that contains the
reset and irq vectors).
The RANGE
directive is used to give information about address ranges. The
following attributes are recognized:
COMMENT
This attribute is only allowed if a label is also given. It takes a string
as argument. See the description of the
LABEL
directive for an explanation.
END
This gives the end address of the range. The end address is inclusive, that means, it is part of the range. Of course, it may not be smaller than the start address.
NAME
This is a convenience attribute. It takes a string argument and will cause
the disassembler to define a label for the start of the range with the
given name. So a separate
LABEL
directive is not needed.
START
This gives the start address of the range.
TYPE
This attribute specifies the type of data within the range. The attribute value is one of the following keywords:
ADDRTABLE
The range consists of data and is disassembled as a table of words
(16 bit values). The difference to the WORDTABLE
type is that
a label is defined for each entry in the table.
BYTETABLE
The range consists of data and is disassembled as a byte table.
CODE
The range consists of code.
DBYTETABLE
The range consists of data and is disassembled as a table of dbytes (double byte values, 16 bit values with the low byte containing the most significant byte of the 16 bit value).
DWORDTABLE
The range consists of data and is disassembled as a table of double words (32 bit values).
RTSTABLE
The range consists of data and is disassembled as a table of words (16 bit
values). The values are interpreted as words that are pushed onto the
stack and jump to it via RTS
. This means that they contain
address-1
of a function, for which a label will get defined by the
disassembler.
SKIP
The range is simply ignored when generating the output file. Please note
that this means that reassembling the output file will not generate
the original file, not only because the missing piece in between, but also
because the following code will be located on wrong addresses. Output
generated with SKIP
ranges will need manual rework.
TEXTTABLE
The range consists of readable text.
WORDTABLE
The range consists of data and is disassembled as a table of words (16 bit values).
The LABEL
directive is used to give names for labels in the disassembled
code. The following attributes are recognized:
ADDR
Followed by a numerical value. Specifies the value of the label.
COMMENT
Attribute argument is a string. The comment will show up in a separate line before the label, if the label is within code or data range, or after the label if it is outside.
Example output:
foo := $0001 ; Comment for label named "foo"
; Comment for label named "bar"
bar:
NAME
The attribute is followed by a string value which gives the name of the label.
SIZE
This attribute is optional and may be used to specify the size of the data
that follows. If a size greater than 1 is specified, the disassembler will
create labels in the form label+offs
for all bytes within the given
range, where label
is the label name given with the NAME
attribute, and offs
is the offset within the data.
The ASMINC
directive is used to give the names of input files containing
symbol assignments in assembler syntax:
Name = value
Name := value
The usual conventions apply for symbol names. Values may be specified as hex (leading $), binary (leading %) or decimal. The values may optionally be signed.
NOTE: The include file parser is very simple. Expressions are not allowed, and
anything but symbol assignments is flagged as an error (but see the
IGNOREUNKNOWN
directive below).
The following attributes are recognized:
FILE
Followed by a string value. Specifies the name of the file to read.
COMMENTSTART
The optional attribute is followed by a character constant. It specifies the
character that starts a comment. The default value is a semicolon. This
value is ignored if IGNOREUNKNOWN
is true.
IGNOREUNKNOWN
This attribute is optional and is followed by a boolean value. It allows to ignore input lines that don't have a valid syntax. This allows to read in assembler include files that contain more than just symbol assignments. Note: When this attribute is used, the disassembler will ignore any errors in the given include file. This may have undesired side effects.
The following is a short example for an info file that contains most of the directives explained above:
# This is a comment. It extends to the end of the line
GLOBAL {
OUTPUTNAME "kernal.s";
INPUTNAME "kernal.bin";
STARTADDR $E000;
PAGELENGTH 0; # No paging
CPU "6502";
};
RANGE { START $E612; END $E631; TYPE Code; };
RANGE { START $E632; END $E640; TYPE ByteTable; };
RANGE { START $EA51; END $EA84; TYPE RtsTable; };
RANGE { START $EC6C; END $ECAB; TYPE RtsTable; };
RANGE { START $ED08; END $ED11; TYPE AddrTable; };
# Zero page variables
LABEL { NAME "fnadr"; ADDR $90; SIZE 3; };
LABEL { NAME "sal"; ADDR $93; };
LABEL { NAME "sah"; ADDR $94; };
LABEL { NAME "sas"; ADDR $95; };
# Stack
LABEL { NAME "stack"; ADDR $100; SIZE 255; };
# Indirect vectors
LABEL { NAME "cinv"; ADDR $300; SIZE 2; }; # IRQ
LABEL { NAME "cbinv"; ADDR $302; SIZE 2; }; # BRK
LABEL { NAME "nminv"; ADDR $304; SIZE 2; }; # NMI
# Jump table at end of kernal ROM
LABEL { NAME "kscrorg"; ADDR $FFED; };
LABEL { NAME "kplot"; ADDR $FFF0; };
LABEL { NAME "kiobase"; ADDR $FFF3; };
LABEL { NAME "kgbye"; ADDR $FFF6; };
# Hardware vectors
LABEL { NAME "hanmi"; ADDR $FFFA; };
LABEL { NAME "hares"; ADDR $FFFC; };
LABEL { NAME "hairq"; ADDR $FFFE; };