Merge branch 'master' of https://github.com/cc65/cc65 into c1p
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
|
||||
<url url="mailto:polluks@sdf.lonestar.org" name="Stefan A. Haubenthal">,<newline>
|
||||
<url url="mailto:greg.king5@verizon.net" name="Greg King">
|
||||
<date>2014-03-27
|
||||
<date>2015-01-09
|
||||
|
||||
<abstract>
|
||||
An overview over the Atmos runtime system as it is implemented for the cc65 C
|
||||
@@ -32,27 +32,39 @@ more than one platform. Please see the function reference for more
|
||||
information.
|
||||
|
||||
|
||||
|
||||
<sect>Binary format<p>
|
||||
|
||||
The standard binary output format generated by the linker for the Atmos target
|
||||
is a machine language program with a 17 byte tape header including a cc65 tag.
|
||||
The standard load and autostart address is $500.
|
||||
is a machine language program with a one-line BASIC stub that jumps to the
|
||||
machine-language part through <tt/CALL/. It has one sacrificial byte attached
|
||||
to the end (a bug in the Oric ROM means that BASIC can put a variable on top
|
||||
of the last byte that was loaded). It has a 24-byte tape header. A file can
|
||||
be CLOADed as a BASIC program, and started by typing <tt/RUN/. The standard
|
||||
load address is $501.
|
||||
|
||||
|
||||
|
||||
<sect>Memory layout<p>
|
||||
|
||||
In the standard setup, cc65 generated programs use the memory from
|
||||
$500 to $9800, so nearly 37K of memory (including the stack) is
|
||||
In the standard setup, cc65-generated programs use the memory from
|
||||
$0501 to $9800; so, nearly 37K of memory (including the stack) is
|
||||
available. ROM calls are possible without further precautions.
|
||||
|
||||
If your program needs more memory, and it won't use TGI graphics, then you can
|
||||
use the ld65 command-line option, <tt/-D __GRAB__=1/, when building the
|
||||
program, to include the graphics screen RAM. Then, nearly 44K of memory
|
||||
($0501 to $B400) is available.
|
||||
|
||||
Special locations:
|
||||
|
||||
<descrip>
|
||||
<tag/Stack/
|
||||
The C runtime stack is located at $97FF and growing downwards.
|
||||
The C runtime stack is located at $97FF (or $B3FF), and grows
|
||||
downwards.
|
||||
|
||||
<tag/Heap/
|
||||
The C heap is located at the end of the program and grows towards the C
|
||||
The C heap is located at the end of the program, and grows towards the C
|
||||
runtime stack.
|
||||
|
||||
</descrip><p>
|
||||
@@ -90,7 +102,7 @@ structures; accessing the struct fields will access the chip registers.
|
||||
<descrip>
|
||||
|
||||
<tag><tt/VIA/</tag>
|
||||
Access to the VIA (versatile interface adapter) chip is available via the
|
||||
Access to the VIA (Versatile Interface Adapter) chip is available via the
|
||||
<tt/VIA/ variable. The structure behind this variable is explained in <tt/_6522.h/.
|
||||
|
||||
</descrip><p>
|
||||
@@ -117,7 +129,8 @@ The names in the parentheses denote the symbols to be used for static linking of
|
||||
|
||||
<sect1>Graphics drivers<p>
|
||||
|
||||
The default drivers, <tt/tgi_stddrv (tgi_static_stddrv)/, point to <tt/atmos-240-200-2.tgi (atmos_240_200_2_tgi)/.
|
||||
The default drivers, <tt/tgi_stddrv (tgi_static_stddrv)/,
|
||||
point to <tt/atmos-240-200-2.tgi (atmos_240_200_2_tgi)/.
|
||||
|
||||
<descrip>
|
||||
|
||||
@@ -175,13 +188,14 @@ No mouse drivers are currently available for the Atmos.
|
||||
|
||||
<sect1>Disk I/O<p>
|
||||
|
||||
The existing library for the Atmos doesn't implement C file
|
||||
I/O. There are hacks for the <tt/read()/ and <tt/write()/ routines in
|
||||
place, which will make functions work that read from and write to <tt/stdout/
|
||||
(like <tt/printf()/). However, those functions have some shortcomings which
|
||||
won't be fixed, because they're going to be replaced anyway.
|
||||
The existing library for the Atmos doesn't implement C file I/O. There are
|
||||
hacks for the <tt/read()/ and <tt/write()/ routines in place, which will make
|
||||
functions work that read from <tt/stdin/ and write to <tt/stdout/ and
|
||||
<tt/stderr/ (such as <tt/printf()/). However, those functions have some
|
||||
shortcomings which won't be fixed, because they're going to be replaced
|
||||
anyway.
|
||||
|
||||
To be more concrete, the limitation means that you cannot use any of the
|
||||
To be more concrete, that limitation means that you cannot use any of the
|
||||
following functions (and a few others):
|
||||
|
||||
<itemize>
|
||||
@@ -202,7 +216,14 @@ following functions (and a few others):
|
||||
|
||||
<sect1>Function keys<p>
|
||||
|
||||
These are defined to be FUNCT + number key.
|
||||
They are defined to be FUNCT + a number key.
|
||||
|
||||
|
||||
<sect1>Capitals lock<p>
|
||||
|
||||
The keyboard's "CAPS Lock" mode is turned off while the program is running.
|
||||
The previous mode (usually, CAPS Lock turned on [because Oric BASIC keywords
|
||||
must be UPPER-case]) is restored when the program stops.
|
||||
|
||||
|
||||
<sect1>Passing arguments to the program<p>
|
||||
@@ -211,10 +232,12 @@ Command-line arguments can be passed to <tt/main()/. Since that is not
|
||||
supported directly by BASIC, the following syntax was chosen:
|
||||
|
||||
<tscreen><verb>
|
||||
CALL#500:REM ARG1 " ARG2 IS QUOTED" ARG3 "" ARG5
|
||||
RUN:REM arg1 " ARG2 IS QUOTED" ARG3 "" ARG5
|
||||
</verb></tscreen>
|
||||
|
||||
<enum>
|
||||
<item>You must turn <tt/CAPS/ lock off (tap CTRL-T) when you want to type
|
||||
lower-case arguments (but, <tt/RUN/ and <tt/REM/ must be UPPER-case).
|
||||
<item>Arguments are separated by spaces.
|
||||
<item>Arguments may be quoted.
|
||||
<item>Leading and trailing spaces around an argument are ignored. Spaces within
|
||||
@@ -225,6 +248,15 @@ supported directly by BASIC, the following syntax was chosen:
|
||||
</enum>
|
||||
|
||||
|
||||
<sect1>Automatic starting<p>
|
||||
|
||||
Usually, a cc65-built program just will sit quietly in memory, after it is
|
||||
CLOADed. It waits for you to start it (by typing BASIC's <tt/RUN/ command).
|
||||
But, if you want to create a program that will start running immediately after
|
||||
it is loaded, then you can use the linker command-line option
|
||||
<tt/-D __AUTORUN__=$C7/.
|
||||
|
||||
|
||||
<sect1>Interrupts<p>
|
||||
|
||||
The runtime for the Atmos uses routines marked as <tt/.INTERRUPTOR/ for
|
||||
|
||||
122
doc/da65.sgml
122
doc/da65.sgml
@@ -2,12 +2,14 @@
|
||||
|
||||
<article>
|
||||
<title>da65 Users Guide
|
||||
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
|
||||
<date>2003-08-08
|
||||
<author>
|
||||
<url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">,<newline>
|
||||
<url url="mailto:greg.king5@verizon.net" name="Greg King">
|
||||
<date>2014-11-23
|
||||
|
||||
<abstract>
|
||||
da65 is a 6502/65C02 disassembler that is able to read user supplied
|
||||
information about its input data for better results. The output is ready for
|
||||
da65 is a 6502/65C02 disassembler that is able to read user-supplied
|
||||
information about its input data, for better results. The output is ready for
|
||||
feeding into ca65, the macro assembler supplied with the cc65 C compiler.
|
||||
</abstract>
|
||||
|
||||
@@ -23,7 +25,7 @@ the cc65 C compiler and generates output that is suitable for the ca65
|
||||
macro assembler.
|
||||
|
||||
Besides generating output for ca65, one of the design goals was that the user
|
||||
is able to feed additional information about the code into the disassembler
|
||||
is able to feed additional information about the code into the disassembler,
|
||||
for improved results. This information may include the location and size of
|
||||
tables, and their format.
|
||||
|
||||
@@ -106,11 +108,16 @@ Here is a description of all the command line options:
|
||||
<tag><tt>--cpu type</tt></tag>
|
||||
|
||||
Set the CPU type. The option takes a parameter, which may be one of
|
||||
<itemize>
|
||||
<item>6502
|
||||
<item>6502x
|
||||
<item>65sc02
|
||||
<item>65c02
|
||||
<item>huc6280
|
||||
</itemize>
|
||||
|
||||
6502, 6502x, 65sc02, 65c02, huc6280
|
||||
|
||||
6502x is the NMOS 6502 with illegal opcodes. huc6280 is the CPU of the PC
|
||||
engine. Support for the 65816 is currently not available.
|
||||
6502x is for the NMOS 6502 with unofficial opcodes. huc6280 is the CPU of
|
||||
the PC engine. Support for the 65816 currently is not available.
|
||||
|
||||
|
||||
<label id="option--formfeeds">
|
||||
@@ -125,7 +132,7 @@ Here is a description of all the command line options:
|
||||
<tag><tt>-g, --debug-info</tt></tag>
|
||||
|
||||
This option adds the <tt/.DEBUGINFO/ command to the output file, so the
|
||||
assembler will generate debug information when reassembling the generated
|
||||
assembler will generate debug information when re-assembling the generated
|
||||
output.
|
||||
|
||||
|
||||
@@ -241,7 +248,7 @@ unsupported.
|
||||
The disassembler works by creating an attribute map for the whole address
|
||||
space ($0000 - $FFFF). Initially, all attributes are cleared. Then, an
|
||||
external info file (if given) is read. Disassembly is done in several passes.
|
||||
In all passes with the exception of the last one, information about the
|
||||
In all passes, with the exception of the last one, information about the
|
||||
disassembled code is gathered and added to the symbol and attribute maps. The
|
||||
last pass generates output using the information from the maps.
|
||||
|
||||
@@ -275,19 +282,19 @@ 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
|
||||
value is a keyword; in this case, the keyword is given as-is (without quotes or
|
||||
anything). Each attribute is terminated by a semicolon.
|
||||
|
||||
<tscreen><verb>
|
||||
group-name { attribute1 attribute-value; attribute2 attribute-value; }
|
||||
group-name { attribute1 attribute-value; attribute2 attribute-value; }
|
||||
</verb></tscreen>
|
||||
|
||||
|
||||
<sect1>Comments<p>
|
||||
|
||||
Comments start with a hash mark (<tt/#/) and extend from the position of
|
||||
Comments start with a hash mark (<tt/#/); and, extend from the position of
|
||||
the mark to the end of the current line. Hash marks inside of strings will
|
||||
of course <em/not/ start a comment.
|
||||
<em/not/ start a comment, of course.
|
||||
|
||||
|
||||
<sect1>Specifying global options<label id="global-options"><p>
|
||||
@@ -543,18 +550,17 @@ disassembled code. The following attributes are recognized:
|
||||
|
||||
<tag><tt>END</tt></tag>
|
||||
Followed by a numerical value. Specifies the end address of the segment. The
|
||||
end address is last the address that is part of the segment.
|
||||
end address is the last address that is a part of the segment.
|
||||
|
||||
<tag><tt>NAME</tt></tag>
|
||||
The attribute is followed by a string value which gives the name of the
|
||||
segment.
|
||||
</descrip>
|
||||
|
||||
All attributes are mandatory. Segments may not overlap. Since there is no
|
||||
explicit "end this segment" pseudo op, the disassembler cannot notify the
|
||||
assembler that one segment has ended. This may lead to errors if you don't
|
||||
define your segments carefully. As a rule of thumb, if you're using segments,
|
||||
your should define segments for all disassembled code.
|
||||
All attributes are mandatory. Segments must not overlap. The disassembler will
|
||||
change back to the (default) <tt/.code/ segment after the end of each defined
|
||||
segment. That might not be what you want. As a rule of thumb, if you're using
|
||||
segments, you should define segments for all disassembled code.
|
||||
|
||||
|
||||
<sect1>Specifying Assembler Includes<label id="infofile-asminc"><p>
|
||||
@@ -563,8 +569,8 @@ The <tt/ASMINC/ directive is used to give the names of input files containing
|
||||
symbol assignments in assembler syntax:
|
||||
|
||||
<tscreen><verb>
|
||||
Name = value
|
||||
Name := value
|
||||
Name = value
|
||||
Name := value
|
||||
</verb></tscreen>
|
||||
|
||||
The usual conventions apply for symbol names. Values may be specified as hex
|
||||
@@ -613,48 +619,46 @@ directives explained above:
|
||||
};
|
||||
|
||||
# One segment for the whole stuff
|
||||
SEGMENT { START $E000; END $FFFF; NAME kernal; };
|
||||
SEGMENT { START $E000; END $FFFF; NAME "kernal"; };
|
||||
|
||||
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; };
|
||||
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; };
|
||||
# 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; };
|
||||
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
|
||||
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; };
|
||||
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; };
|
||||
LABEL { NAME "hanmi"; ADDR $FFFA; };
|
||||
LABEL { NAME "hares"; ADDR $FFFC; };
|
||||
LABEL { NAME "hairq"; ADDR $FFFE; };
|
||||
</verb></tscreen>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<sect>Copyright<p>
|
||||
|
||||
da65 (and all cc65 binutils) are (C) Copyright 1998-2007 Ullrich von
|
||||
Bassewitz. For usage of the binaries and/or sources the following
|
||||
da65 (and all cc65 binutils) is (C) Copyright 1998-2011, Ullrich von
|
||||
Bassewitz. For usage of the binaries and/or sources, the following
|
||||
conditions do apply:
|
||||
|
||||
This software is provided 'as-is', without any expressed or implied
|
||||
@@ -666,20 +670,16 @@ including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
<enum>
|
||||
<item> The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
<item> Altered source versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
<item> This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
<item> The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
<item> Altered source versions must be plainly marked as such, and must not
|
||||
be misrepresented as being the original software.
|
||||
<item> This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
</enum>
|
||||
|
||||
|
||||
|
||||
</article>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user