diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 000000000..176a458f9
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+* text=auto
diff --git a/.github/checks/Makefile b/.github/checks/Makefile
new file mode 100644
index 000000000..18cc153d4
--- /dev/null
+++ b/.github/checks/Makefile
@@ -0,0 +1,16 @@
+
+.PHONY: checkstyle tabs lastline spaces noexec
+
+checkstyle: tabs lastline spaces noexec
+
+tabs: tabs.sh
+ @./tabs.sh
+
+lastline: lastline.sh
+ @./lastline.sh
+
+spaces: spaces.sh
+ @./spaces.sh
+
+noexec: noexec.sh
+ @./noexec.sh
diff --git a/.github/checks/lastline.sh b/.github/checks/lastline.sh
new file mode 100755
index 000000000..d80d2fb57
--- /dev/null
+++ b/.github/checks/lastline.sh
@@ -0,0 +1,25 @@
+#! /bin/bash
+OLDCWD=`pwd`
+SCRIPT_PATH=`dirname $0`
+CHECK_PATH=.
+
+cd $SCRIPT_PATH/../../
+
+nl='
+'
+nl=$'\n'
+r1="${nl}$"
+FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | while read f; do
+ t=$(tail -c2 $f; printf x)
+ [[ ${t%x} =~ $r1 ]] || echo "$f"
+done`
+
+cd $OLDCWD
+
+if [ x"$FILES"x != xx ]; then
+ echo "error: found following files that have no newline at the end:" >&2
+ for n in $FILES; do
+ echo $n >&2
+ done
+ exit -1
+fi
diff --git a/.github/checks/noexec.sh b/.github/checks/noexec.sh
new file mode 100755
index 000000000..c76ae481d
--- /dev/null
+++ b/.github/checks/noexec.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+OLDCWD=`pwd`
+SCRIPT_PATH=`dirname $0`
+CHECK_PATH=.
+
+cd $SCRIPT_PATH/../../
+
+FILES=`find $CHECK_PATH -executable -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print`
+
+cd $OLDCWD
+
+if [ x"$FILES"x != xx ]; then
+ echo "error: executable flag is set for the following files:" >&2
+ for n in $FILES; do
+ echo $n >&2
+ done
+ exit -1
+fi
diff --git a/.github/checks/spaces.sh b/.github/checks/spaces.sh
new file mode 100755
index 000000000..945e9acc3
--- /dev/null
+++ b/.github/checks/spaces.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+OLDCWD=`pwd`
+SCRIPT_PATH=`dirname $0`
+CHECK_PATH=.
+
+cd $SCRIPT_PATH/../../
+
+FILES=`find $CHECK_PATH -type f \( -name \*.inc -o -name Makefile -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l ' $'`
+
+cd $OLDCWD
+
+if [ x"$FILES"x != xx ]; then
+ echo "error: found dangling spaces in the following files:" >&2
+ for n in $FILES; do
+ echo $n >&2
+ done
+ exit -1
+fi
diff --git a/.github/checks/tabs.sh b/.github/checks/tabs.sh
new file mode 100755
index 000000000..1c32def17
--- /dev/null
+++ b/.github/checks/tabs.sh
@@ -0,0 +1,18 @@
+#! /bin/bash
+OLDCWD=`pwd`
+SCRIPT_PATH=`dirname $0`
+CHECK_PATH=.
+
+cd $SCRIPT_PATH/../../
+
+FILES=`find $CHECK_PATH -type f \( \( -name \*.inc -a \! -name Makefile.inc \) -o -name \*.cfg -o -name \*.\[chs\] -o -name \*.mac -o -name \*.asm -o -name \*.sgml \) -print | grep -v "libwrk/" | grep -v "testwrk/" | xargs grep -l $'\t'`
+
+cd $OLDCWD
+
+if [ x"$FILES"x != xx ]; then
+ echo "error: found TABs in the following files:" >&2
+ for n in $FILES; do
+ echo $n >&2
+ done
+ exit -1
+fi
diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml
new file mode 100644
index 000000000..0ba0c6a1f
--- /dev/null
+++ b/.github/workflows/build-on-pull-request.yml
@@ -0,0 +1,69 @@
+name: Build Pull Request
+on: [pull_request]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build_linux:
+ name: Build and Test (Linux)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Install Dependencies
+ shell: bash
+ run: |
+ sudo apt-get update
+ sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64
+
+ - shell: bash
+ run: git config --global core.autocrlf input
+ - name: Checkout Source
+ uses: actions/checkout@v2
+
+ - name: Do some simple style checks
+ shell: bash
+ run: make -j2 checkstyle
+ - name: Build the tools.
+ shell: bash
+ run: make -j2 bin USER_CFLAGS=-Werror
+ - name: Build the utilities.
+ shell: bash
+ run: make -j2 util
+ - name: Build the platform libraries.
+ shell: bash
+ run: make -j2 lib QUIET=1
+ - name: Run the regression tests.
+ shell: bash
+ run: make test QUIET=1
+ - name: Test that the samples can be built.
+ run: make -C samples platforms
+ - name: Test that the targettest programs can be built.
+ run: make -C targettest platforms
+ - name: Build the document files.
+ shell: bash
+ run: make -j2 doc
+ - name: Build 64-bit Windows versions of the tools.
+ run: |
+ make -C src clean
+ make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
+
+ build_windows:
+ name: Build (Windows)
+ runs-on: windows-latest
+
+ steps:
+ - shell: bash
+ run: git config --global core.autocrlf input
+
+ - name: Checkout Source
+ uses: actions/checkout@v2
+
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.1
+
+ - name: Build app (debug)
+ run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
+
+ - name: Build app (release)
+ run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
diff --git a/.github/workflows/snapshot-on-push-master.yml b/.github/workflows/snapshot-on-push-master.yml
new file mode 100644
index 000000000..769d778d5
--- /dev/null
+++ b/.github/workflows/snapshot-on-push-master.yml
@@ -0,0 +1,127 @@
+name: Snapshot Build
+on:
+ push:
+ branches:
+ master
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ build_windows:
+ name: Build (Windows)
+ if: github.repository == 'cc65/cc65'
+ runs-on: windows-latest
+
+ steps:
+ - shell: bash
+ run: git config --global core.autocrlf input
+
+ - name: Checkout Source
+ uses: actions/checkout@v2
+
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.1
+
+ - name: Build app (debug)
+ run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Debug
+
+ - name: Build app (release)
+ run: msbuild src\cc65.sln -t:rebuild -property:Configuration=Release
+
+ build_linux:
+ name: Build, Test, and Snapshot (Linux)
+ if: github.repository == 'cc65/cc65'
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Install Dependencies
+ shell: bash
+ run: |
+ sudo apt-get update
+ sudo apt-get install linuxdoc-tools-info gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
+
+ - shell: bash
+ run: git config --global core.autocrlf input
+ - name: Checkout Source
+ uses: actions/checkout@v2
+
+ - name: Do some simple style checks
+ shell: bash
+ run: make -j2 checkstyle
+ - name: Build the tools.
+ shell: bash
+ run: |
+ make -j2 bin USER_CFLAGS=-Werror
+ make -j2 util
+ - name: Build the platform libraries.
+ shell: bash
+ run: make -j2 lib QUIET=1
+ - name: Run the regression tests.
+ shell: bash
+ run: make test QUIET=1
+ - name: Test that the samples can be built.
+ shell: bash
+ run: make -j2 samples
+ - name: Remove the output from the samples tests.
+ shell: bash
+ run: make -C samples clean
+ - name: Remove programs in util directory
+ shell: bash
+ run: make -C util clean
+ - name: Build the document files.
+ shell: bash
+ run: make -j2 doc
+ - name: Build and package 64-bit Windows versions of the tools.
+ run: |
+ make -C src clean
+ make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=x86_64-w64-mingw32-
+ make zip
+ mv cc65.zip cc65-snapshot-win64.zip
+ - name: Build and package 32-bit Windows versions of the tools.
+ run: |
+ make -C src clean
+ make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
+ make zip
+ mv cc65.zip cc65-snapshot-win32.zip
+
+ - name: Upload a 32-bit Snapshot Zip
+ uses: actions/upload-artifact@v2
+ with:
+ name: cc65-snapshot-win32.zip
+ path: cc65-snapshot-win32.zip
+ - name: Upload a 64-bit Snapshot Zip
+ uses: actions/upload-artifact@v2
+ with:
+ name: cc65-snapshot-win64.zip
+ path: cc65-snapshot-win64.zip
+
+ - name: Get the online documents repo.
+ uses: actions/checkout@v2
+ with:
+ repository: cc65/doc
+ path: doc.git
+ - name: Update the online documents.
+ run: |
+ cd doc.git
+ rm *.*
+ cp ../html/*.* .
+ git config user.name "cc65-github"
+ git config user.email "cc65.nomail@github.com"
+ git config push.default simple
+ git add -A
+ git commit -m "Updated from cc65 commit ${GITHUB_SHA}."
+ #git push -v
+
+ # enter secrets under "repository secrets"
+ - name: Upload snapshot to sourceforge
+ uses: nogsantos/scp-deploy@master
+ with:
+ src: cc65-snapshot-win32.zip
+ host: ${{ secrets.SSH_HOST }}
+ remote: ${{ secrets.SSH_DIR }}
+ port: ${{ secrets.SSH_PORT }}
+ user: ${{ secrets.SSH_USER }}
+ key: ${{ secrets.SSH_KEY }}
+
+ # TODO: Publish snapshot zip at https://github.com/cc65/cc65.github.io
diff --git a/.gitignore b/.gitignore
index 196cdc3d7..9112484b8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,13 +1,12 @@
/bin/
-/emd/
/html/
/info/
-/joy/
/lib/
/libwrk/
-/mou/
-/ser/
-/targetutil/
+/target/
/testwrk/
-/tgi/
/wrk/
+/cc65.zip
+/util/atari/*.exe
+/util/gamate/*.exe
+
diff --git a/.travis.yml b/.travis.yml
index 10ea789cf..4b0919a10 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,18 +1,26 @@
-language:
- - c
-install:
- - sudo apt-get update
- - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass
-script:
- - make bin USER_CFLAGS=-Werror
- - make lib QUIET=1
- - make -C test
- - make -C src clean
- - make bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
- - make doc zip
-after_success:
- - make -f Makefile.travis
-env:
- global:
- - secure: "h+hoQdEHGPLNwaqGKmSaM8NBRDLc2X+W05VsnNG2Feq/wPv/AiBjONNlzN7jRf6D6f3aoPXaQ2Lc3bYWdxGvFRCmwiofdxkJI9n5L8HPHLZ2lf37MQsXmGJzoTFOvjPLj73H6HlbI9Ux0El3zO6hvalxiXj6TfoZ41dbhNyvpYk="
- - secure: "A4hMEe5RRfUtYjFGbT7QAvT1Tyo434N+/TiuQeQ4q0L46c79LnXuGQzbFLOFZshZiplLkJr7lFg466CoI1bf2L0cQOew/LesMhE75v0HQ7tZnExWhdpAk0ri6nWixbjn/dmQ0+HxjzJ48A44DMMBYcvSIsO4vflvuJ8etfSg42k="
+language: c
+
+jobs:
+ include:
+
+ - os: linux
+ name: Linux
+ install:
+ - sudo apt-get update
+ - sudo apt-get install linuxdoc-tools linuxdoc-tools-info binutils-mingw-w64-i686 gcc-mingw-w64-i686 sshpass
+ script:
+ - make -j2 bin USER_CFLAGS=-Werror
+ - make -j2 lib QUIET=1
+ - make test QUIET=1
+ - make -j2 samples
+ - make -C src clean
+ - make -j2 bin USER_CFLAGS=-Werror CROSS_COMPILE=i686-w64-mingw32-
+ - make -C samples clean
+ - make -j2 doc zip
+ after_success:
+ - make -f Makefile.travis
+
+ - os: windows
+ name: Windows
+ script:
+ - src/msbuild.cmd src\\cc65.sln
diff --git a/Contributing.md b/Contributing.md
new file mode 100644
index 000000000..5861a9c2e
--- /dev/null
+++ b/Contributing.md
@@ -0,0 +1,165 @@
+This document contains all kinds of information that you should know if you want to contribute to the cc65 project. Before you start, please read all of it. If something is not clear to you, please ask - this document is an ongoing effort and may well be incomplete.
+
+(''Note:'' The word "must" indicates a requirement. The word "should" indicates a recomendation.)
+
+*this is work in progress and is constantly updated - if in doubt, please ask*
+
+# generally
+
+* You must obey these rules when contributing new code or documentation to cc65. We are well aware that not all existing code may respect all rules outlined here - but this is no reason for you not to respect them.
+* One commit/patch/PR per issue. Do not mix several things unless they are very closely related.
+
+# Codestyle rules
+
+## All Sources
+
+### TABs and spaces
+
+This is an ongoing controversial topic - everyone knows that. However, the following is how we do it :)
+
+* TAB characters must be expanded to spaces.
+* 4 spaces per indention level (rather than 8) are preferred, especially if there are many different levels.
+* No extra spaces at the end of lines.
+* All text files must end with new-line characters. Don't leave the last line "dangling".
+
+The (bash) scripts used to check the above rules can be found in ```.github/check```. You can also run all checks using ```make check```.
+
+### misc
+
+* 80 characters is the desired maximum width of files. But, it isn't a "strong" rule; sometimes, you will want to type longer lines, in order to keep the parts of expressions or comments together on the same line.
+* You should avoid typing non-ASCII characters.
+* If you change "normal" source code into comments, then you must add a comment about why that code is a comment.
+* When you want to create a comment from several lines of code, you should use preprocessor lines, instead of ```/* */``` or "```;```". Example:
+
+#if 0
+ one ();
+ two ();
+ three = two () + one ();
+#endif
+
+* You should type upper case characters for hex values.
+* When you type zero-page addresses in hexadecimal, you should type two hex characters (after the hex prefix). When you type non-zero-page addresses in hex, you should type four hex characters.
+* When you type lists of addresses, it is a good idea to sort them in ascending numerical order. That makes it easier for readers to build mental pictures of where things are in an address space. And, it is easier to see how big the variables and buffers are. Example:
+
+xCoord := $0703
+yCoord := $0705 ; (this address implies that xCoord is 16 bits)
+cmdbuf := $0706 ; (this address implies that yCoord is 8 bits)
+cmdlen := $0786 ; (this address implies that cmdbuf is 128 bytes)
+color := $0787
+
+
+## C Sources
+
+The following is still very incomplete - if in doubt please look at existing sourcefiles and adapt to the existing style
+
+* Your files should obey the C89 standard.
+* We generally have a "no warnings" policy
+* Warnings must not be hidden by using typecasts - fix the code instead
+ * In printf-style functions use the PRIX64 (and similar) macros to deal with 64bit values
+* The normal indentation width should be four spaces.
+* You must use ANSI C comments (```/* */```); you must not use C++ comments (```//```).
+* When you add functions to an existing file, you should separate them by the same number of blank lines that separate the functions that already are in that file.
+* All function declarations must be followed by a comment block that tells at least briefly what the function does, what the parameters are, and what is returned. This comment must sit between the declaration and the function body, like this:
+
+int foo(int bar)
+/* Add 1 to bar, takes bar and returns the result */
+{
+ return bar + 1;
+}
+
+* When a function's argument list wraps around to a next line, you should indent that next line by either the normal width or enough spaces to align it with the arguments on the previous line.
+* All declarations in a block must be at the beginning of that block.
+* You should put a blank line between a list of local variable declarations and the first line of code.
+* Always use curly braces even for single statements after ```if```, and the single statement should go into a new line.
+* Use "cuddling" braces, ie the opening brace goes in the same line as the ```if```:
+
+if (foo > 42) {
+ bar = 23;
+}
+
+* Should the ```if``` statement be followed by an empty conditional block, there should be a comment telling why this is the case
+
+* You must separate function names and parameter/argument lists by one space.
+* When declaring/defining pointers, you must put the asterisk (```*```) next to the data type, with a space between it and the variable's name. Examples:
+
+ int* namedPtr[5];
+ char* nextLine (FILE* f);
+
+
+### Header files
+
+Headers that belong to the standard library (libc) must conform with the C standard. That means:
+* all non standard functions, or functions that only exist in a certain standard, should be in #ifdefs
+ * the same is true for macros or typedefs
+
+#if __CC65_STD__ == __CC65_STD_C99__
+/* stuff that only exists in C99 here */
+#endif
+#if __CC65_STD__ == __CC65_STD_CC65__
+/* non standard stuff here */
+#endif
+
The standard binary file format generated by the linker for the
-Apple ][ target is a binary program with a 4 byte DOS 3.3 header
-containing the load address and load length. The default load address is
-$803.
+Apple ][ target is an file.
+The default load address is $803.
-) includes the option for those programs
-omits the DOS 3.3 header. The right AppleCommander option to put system files
-without a header on a ProDOS 8 disk image is ) includes the option Memory layout
@@ -75,13 +67,30 @@ However while running module constructors/destructors the Language Card is disab
Enabling the Language Card allows to use it as additional memory for cc65
generated code. However code is never automatically placed there. Rather code
needs to be explicitly placed in the Language Card either per file by compiling
-with .
+on the parameters. There are
+several useful settings:
+
+
+
+ LC address: $D400, LC size: $C00
+ For plain vanilla ProDOS 8 which doesn't actually use the Language Card bank 2
+ memory from $D400 to $DFFF. This is the default setting.
+
+ LC address: $D000, LC size: $1000
+ For ProDOS 8 together with the function LC address: $D000, LC size: $3000
+ For plain vanilla DOS 3.3 which doesn't make use of the Language Card at all.
+
+
@@ -93,126 +102,152 @@ The apple2 package comes with additional secondary linker config files, which
are used via default config file (
+default config file (
-Default configuration optimized for a binary program running on ProDOS 8 with
-BASIC.SYSTEM. A plain vanilla ProDOS 8 doesn't actually use the Language Card
-bank 2 memory from $D400 to $DFFF.
+Default configuration for a binary program.
+
+Parameters:
-
- From $803 to $95FF (35.5 KB)
-
-
- From $D400 to $DFFF (3 KB)
-
- Variable (default: $803)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: Yes. Use
+
+ Default: $800. Use
+ Default: $9600. Use
+
+ Default: $D400. Use
-
-
- From $803 to $95FF (35.5 KB)
-
-
- From $D000 to $FFFF (12 KB)
-
-
- Variable (default: $803)
-
-
- DOS 3.3 header (address and length)
+
+ Default: $C00. Use
-Configuration for a system program running on ProDOS 8.
+Configuration for a system program running on ProDOS 8 and using the memory from
+$2000 to $BEFF.
+
+Parameters:
-
- From $2000 to $BEFF (39.75 KB)
+
+ Default: Yes. Use
- From $D400 to $DFFF (3 KB)
+
+ Default: $800. Use
- Fixed ($2000)
+
+ Default: $D400. Use
- None
+
+ Default: $C00. Use
-
+
-Configuration optimized for a binary program running on ProDOS 8 without
-BASIC.SYSTEM. Intended to be used with testcode/lib/apple/hgrtest.c
+for an example of such a program.
-A program loaded by LOADER.SYSTEM works like a ProDOS 8 system program but
-isn't tied to the start address $2000. Thus with the default start
-address $800 the main memory area is increased by 6 KB.
+Parameters:
-
- From $800 to $BEFF (45.75 KB)
-
-
- From $D400 to $DFFF (3 KB)
-
- Variable (default: $800)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: Yes. Use
+ Default: $800. Use
+ Default: $9600. Use
+ Default: $D400. Use
+ Default: $C00. Use
-
+
-Configuration optimized for a binary program running on ProDOS 8 without
-BASIC.SYSTEM. Intended to be used with samples/overlaydemo.c for more
+information on overlays.
-If a ProDOS 8 system program doesn't quit to the ProDOS 8 dispatcher but rather
-reboots the machine after exit then a plain vanilla ProDOS 8 doesn't make use of
-the Language Card bank 2 at all.
-
-This setup makes nearly 50 KB available to a cc65 program - on a 64 KB machine!
+Parameters:
-
- From $800 to $BEFF (45.75 KB)
+
+ Default: $803. Use
- From $D000 to $DFFF (4 KB)
+
+ Default: Yes. Use
+ Default: $800. Use
+ Default: $9600. Use
+ Default: $D400. Use
+ Default: $C00. Use
+ Default: $1000. Use
+
+
+
+
+Configuration for an assembler program that doesn't need a special setup.
+
+Parameters:
+
+
- Variable (default: $800)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: No. Use
@@ -230,14 +265,15 @@ range.
The easiest (and for really large programs in fact the only) way to have a cc65
program use the memory from $800 to $2000 is to link it as binary
-(as opposed to system) program using the linker configuration
- with start address
-$803 and load it with the targetutil LOADER.SYSTEM. The program then works
-like a system program (i.e. quits to the ProDOS dispatcher).
+(as opposed to system) program using the default linker configuration
+ with Heap
@@ -245,7 +281,7 @@ example the program , but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
-the memory from $800 to $2000 can be added to the heap by calling
+the memory from $800 to $1FFF can be added to the heap by calling
This driver features a resolution of 280×192 with 8 colors and two
hires pages. Note that programs using this driver will have to be linked
- with
@@ -374,7 +410,7 @@ The names in the parentheses denote the symbols to be used for static linking of
for an AppleMouse II Card compatible firmware. The default bounding
box is [0..279,0..191].
- Programs using this driver will have to be linked with
Driver for the Apple II Super Serial Card. Supports up to 19200 baud,
- hardware flow control (RTS/CTS) and interrupt driven receives. Note
- that because of the peculiarities of the 6551 chip transmits are not
+ requires hardware flow control (RTS/CTS) and does interrupt driven receives.
+ Note that because of the peculiarities of the 6551 chip transmits are not
interrupt driven, and the transceiver blocks if the receiver asserts
flow control because of a full buffer.
@@ -417,7 +453,7 @@ BASIC.SYSTEM) there are some limitations for DOS 3.3:
- Disk File I/O
+ Disk file I/O
There's no disk file I/O support. Any attempt to use it yields an error with
Direct console I/O
-
+The Apple ][ has no color text mode. Therefore the functions
+Random number generator
-
+The random number seed is generated from the time the program waits for user input.
+Therefore it is necessary to wait for at least one user keypress either via Standard
+I/O or via Direct console I/O before initializing the pseudo random number generator.
+
+
+Realtime clock
+
+There are several types of realtime clocks. It's not desirable to have specific code
+for all of them. As ProDOS 8 supports file timestamps, realtime clock owners usually
+use ProDOS 8 drivers for their realtime clock. Those drivers read the realtime clock
+and write the result to the date/time location in RAM ($BF90 to $BF93).
+ProDOS 8 reads the date/time from that RAM location. If there's no realtime clock the
+RAM location keeps containing zeros. ProDOS 8 uses those zeros as timestamps and the
+files show up in a directory as .
+Specifying file types for fopen
+
+
+
+ Explanation of File Types
+
+ ProDOS 8 associates a file type and an auxiliary type with each file.
+ These type specifications are separate from the file's name, unlike
+ Windows which uses the file name's suffix (a.k.a.
+ extension) to specify the file type. For example, Specifying the File Type and Auxiliary Type
+
+ There are two global variables provided that allow the file type
+ and auxiliary type to be specified before a call to
+
+ extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
+ extern unsigned int _auxtype; /* Default: 0 */
+
+
+
+ The header file Example
+
+ A text file cannot be created with just the
+ standard C functions because they default to the binary type
+
+
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <apple2.h>
+
+ void main(void)
+ {
+ FILE *out;
+ char *name = "MY.FAVS";
+
+ /*-----------------------------*/
+
+ _filetype = PRODOS_T_TXT;
+ _auxtype = PRODOS_AUX_T_TXT_SEQ;
+
+ /*-----------------------------*/
+
+ if ((out = fopen(name, "w")) != NULL) {
+ fputs("Jorah Mormont\r", out);
+ fputs("Brienne of Tarth\r", out);
+ fputs("Daenerys Targaryen\r", out);
+ fputs("Sandor Clegane\r", out);
+ if (fclose(out) == EOF) {
+ fprintf(stderr, "fclose failed for %s: %s", name, strerror(errno));
+ }
+ }
+ else {
+ fprintf(stderr, "fopen failed for %s: %s", name, strerror(errno));
+ }
+ }
+
+
+
+
+
License
@@ -518,14 +680,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
- 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.
- Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
- This notice may not be removed or altered from any source
- distribution.
+ 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.
+ Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+ This notice may not be removed or altered from any source
+ distribution.
diff --git a/doc/apple2enh.sgml b/doc/apple2enh.sgml
index 215c6d384..15ceed04f 100644
--- a/doc/apple2enh.sgml
+++ b/doc/apple2enh.sgml
@@ -1,10 +1,8 @@
-
Enhanced Apple //e specific information for cc65
-2014-04-10
An overview over the enhanced Apple //e runtime system as it is
@@ -34,20 +32,14 @@ more information.
Binary format
The standard binary file format generated by the linker for the
-enhanced Apple //e target is a binary program with a 4 byte DOS 3.3 header
-containing the load address and load length. The default load address is
-$803.
+enhanced Apple //e target is an file.
+The default load address is $803.
-) includes the option for those programs
-omits the DOS 3.3 header. The right AppleCommander option to put system files
-without a header on a ProDOS 8 disk image is ) includes the option Memory layout
@@ -75,13 +67,30 @@ However while running module constructors/destructors the Language Card is disab
Enabling the Language Card allows to use it as additional memory for cc65
generated code. However code is never automatically placed there. Rather code
needs to be explicitly placed in the Language Card either per file by compiling
-with .
+on the parameters. There are
+several useful settings:
+
+
+
+ LC address: $D400, LC size: $C00
+ For plain vanilla ProDOS 8 which doesn't actually use the Language Card bank 2
+ memory from $D400 to $DFFF. This is the default setting.
+
+ LC address: $D000, LC size: $1000
+ For ProDOS 8 together with the function LC address: $D000, LC size: $3000
+ For plain vanilla DOS 3.3 which doesn't make use of the Language Card at all.
+
+
@@ -93,126 +102,152 @@ The apple2enh package comes with additional secondary linker config files, which
are used via default config file (
+default config file (
-Default configuration optimized for a binary program running on ProDOS 8 with
-BASIC.SYSTEM. A plain vanilla ProDOS 8 doesn't actually use the Language Card
-bank 2 memory from $D400 to $DFFF.
+Default configuration for a binary program.
+
+Parameters:
-
- From $803 to $95FF (35.5 KB)
-
-
- From $D400 to $DFFF (3 KB)
-
- Variable (default: $803)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: Yes. Use
+
+ Default: $800. Use
+ Default: $9600. Use
+
+ Default: $D400. Use
-
-
- From $803 to $95FF (35.5 KB)
-
-
- From $D000 to $FFFF (12 KB)
-
-
- Variable (default: $803)
-
-
- DOS 3.3 header (address and length)
+
+ Default: $C00. Use
-Configuration for a system program running on ProDOS 8.
+Configuration for a system program running on ProDOS 8 and using the memory from
+$2000 to $BEFF.
+
+Parameters:
-
- From $2000 to $BEFF (39.75 KB)
+
+ Default: Yes. Use
- From $D400 to $DFFF (3 KB)
+
+ Default: $800. Use
- Fixed ($2000)
+
+ Default: $D400. Use
- None
+
+ Default: $C00. Use
-
+
-Configuration optimized for a binary program running on ProDOS 8 without
-BASIC.SYSTEM. Intended to be used with testcode/lib/apple/hgrtest.c
+for an example of such a program.
-A program loaded by LOADER.SYSTEM works like a ProDOS 8 system program but
-isn't tied to the start address $2000. Thus with the default start
-address $800 the main memory area is increased by 6 KB.
+Parameters:
-
- From $800 to $BEFF (45.75 KB)
-
-
- From $D400 to $DFFF (3 KB)
-
- Variable (default: $800)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: Yes. Use
+ Default: $800. Use
+ Default: $9600. Use
+ Default: $D400. Use
+ Default: $C00. Use
-
+
-Configuration optimized for a binary program running on ProDOS 8 without
-BASIC.SYSTEM. Intended to be used with samples/overlaydemo.c for more
+information on overlays.
-If a ProDOS 8 system program doesn't quit to the ProDOS 8 dispatcher but rather
-reboots the machine after exit then a plain vanilla ProDOS 8 doesn't make use of
-the Language Card bank 2 at all.
-
-This setup makes nearly 50 KB available to a cc65 program - on a 64 KB machine!
+Parameters:
-
- From $800 to $BEFF (45.75 KB)
+
+ Default: $803. Use
- From $D000 to $DFFF (4 KB)
+
+ Default: Yes. Use
+ Default: $800. Use
+ Default: $9600. Use
+ Default: $D400. Use
+ Default: $C00. Use
+ Default: $1000. Use
+
+
+
+
+Configuration for an assembler program that doesn't need a special setup.
+
+Parameters:
+
+
- Variable (default: $800)
+ Default: $803. Use
- DOS 3.3 header (address and length)
+
+ Default: No. Use
@@ -230,14 +265,15 @@ range.
The easiest (and for really large programs in fact the only) way to have a cc65
program use the memory from $800 to $2000 is to link it as binary
-(as opposed to system) program using the linker configuration
- with start address
-$803 and load it with the targetutil LOADER.SYSTEM. The program then works
-like a system program (i.e. quits to the ProDOS dispatcher).
+(as opposed to system) program using the default linker configuration
+ with Heap
@@ -245,7 +281,7 @@ example the program , but
uses the heap either explicitly or implicitly (i.e. by loading a driver) then
-the memory from $800 to $2000 can be added to the heap by calling
+the memory from $800 to $1FFF can be added to the heap by calling
@@ -296,10 +332,9 @@ usage.
get_ostype
rebootafterexit
ser_apple2_slot
-textframe
-textframexy
tgi_apple2_mix
videomode
+waitvsync
@@ -328,8 +363,8 @@ The names in the parentheses denote the symbols to be used for static linking of
This driver features a resolution of 280×192 with 8 colors and two
hires pages. Note that programs using this driver will have to be linked
- with
@@ -354,7 +389,7 @@ The names in the parentheses denote the symbols to be used for static linking of
Gives access to 47.5 KB RAM (190 pages of 256 bytes each) on an Extended
80-Column Text Card.
-
+
Note that this driver doesn't check for the actual existence of the memory
and that it doesn't check for ProDOS 8 RAM disk content!
@@ -393,8 +428,8 @@ The names in the parentheses denote the symbols to be used for static linking of
Driver for the Apple II Super Serial Card. Supports up to 19200 baud,
- hardware flow control (RTS/CTS) and interrupt driven receives. Note
- that because of the peculiarities of the 6551 chip transmits are not
+ requires hardware flow control (RTS/CTS) and does interrupt driven receives.
+ Note that because of the peculiarities of the 6551 chip transmits are not
interrupt driven, and the transceiver blocks if the receiver asserts
flow control because of a full buffer.
@@ -418,7 +453,7 @@ BASIC.SYSTEM) there are some limitations for DOS 3.3:
- Disk File I/O
+ Disk file I/O
There's no disk file I/O support. Any attempt to use it yields an error with
Direct console I/O
-
+The enhanced Apple //e has no color text mode. Therefore the functions
+Random number generator
-
+The random number seed is generated from the time the program waits for user input.
+Therefore it is necessary to wait for at least one user keypress either via Standard
+I/O or via Direct console I/O before initializing the pseudo random number generator.
+
+
+Realtime clock
+
+There are several types of realtime clocks. It's not desirable to have specific code
+for all of them. As ProDOS 8 supports file timestamps, realtime clock owners usually
+use ProDOS 8 drivers for their realtime clock. Those drivers read the realtime clock
+and write the result to the date/time location in RAM ($BF90 to $BF93).
+ProDOS 8 reads the date/time from that RAM location. If there's no realtime clock the
+RAM location keeps containing zeros. ProDOS 8 uses those zeros as timestamps and the
+files show up in a directory as .
has the single
parameter
@@ -512,6 +574,105 @@ url="ca65.html" name="assembler manual">.
+Specifying file types for fopen
+
+
+
+ Explanation of File Types
+
+ ProDOS 8 associates a file type and an auxiliary type with each file.
+ These type specifications are separate from the file's name, unlike
+ Windows which uses the file name's suffix (a.k.a.
+ extension) to specify the file type. For example, Specifying the File Type and Auxiliary Type
+
+ There are two global variables provided that allow the file type
+ and auxiliary type to be specified before a call to
+
+ extern unsigned char _filetype; /* Default: PRODOS_T_BIN */
+ extern unsigned int _auxtype; /* Default: 0 */
+
+
+
+ The header file Example
+
+ A text file cannot be created with just the
+ standard C functions because they default to the binary type
+
+
+ #include <stdio.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <apple2.h>
+
+ void main(void)
+ {
+ FILE *out;
+ char *name = "MY.FAVS";
+
+ /*-----------------------------*/
+
+ _filetype = PRODOS_T_TXT;
+ _auxtype = PRODOS_AUX_T_TXT_SEQ;
+
+ /*-----------------------------*/
+
+ if ((out = fopen(name, "w")) != NULL) {
+ fputs("Jorah Mormont\r", out);
+ fputs("Brienne of Tarth\r", out);
+ fputs("Daenerys Targaryen\r", out);
+ fputs("Sandor Clegane\r", out);
+ if (fclose(out) == EOF) {
+ fprintf(stderr, "fclose failed for %s: %s", name, strerror(errno));
+ }
+ }
+ else {
+ fprintf(stderr, "fopen failed for %s: %s", name, strerror(errno));
+ }
+ }
+
+
+
+
+
License
@@ -524,14 +685,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
- 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.
- Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
- This notice may not be removed or altered from any source
- distribution.
+ 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.
+ Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+ This notice may not be removed or altered from any source
+ distribution.
diff --git a/doc/ar65.sgml b/doc/ar65.sgml
index 136defd40..900a0a92b 100644
--- a/doc/ar65.sgml
+++ b/doc/ar65.sgml
@@ -1,10 +1,8 @@
-
ar65 Users Guide
-19.07.2000
ar65 is an archiver for object files generated by ca65. It allows to create
@@ -32,16 +30,17 @@ for the cc65 compiler. ar65 is part of this suite.
The archiver is called as follows:
- Usage: ar65 lib file|module ...
- Operation is one of:
- a Add modules
- d Delete modules
- l List library contents
- x Extract modules
- V Print the archiver version
+ Usage: ar65 lib file|module ...
+ Operations are some of:
+ r Add modules
+ d Delete modules
+ t List library table
+ v Increase verbosity (put before other operation)
+ x Extract modules
+ V Print the archiver version
-You may add modules to a library using the `a' command. If the library
+You may add modules to a library using the
- ar65 a mysubs.lib sub1.o sub2.o
+ ar65 r mysubs.lib sub1.o sub2.o
-This will add two modules to the library `mysubs.lib' creating the
+This will add two modules to the library 'mysubs.lib' creating the
library if necessary. If the library contains modules named sub1.o or
sub2.o, they are replaced by the new ones.
Modules names in the library are stored without the path, so, using
- ar65 a mysubs.lib ofiles/sub1.o ofiles/sub2.o
+ ar65 v v r mysubs.lib ofiles/sub1.o ofiles/sub2.o
-will add two modules named `sub1.o' and `sub2.o' to the library.
+will verbose add two modules named 'sub1.o' and 'sub2.o' to the library.
-Deleting modules from a library is done with the `d' command. You may not
+Deleting modules from a library is done with the
- ar65 d mysubs.lib sub1.o
+ ar65 d mysubs.lib sub1.o
-This will delete the module named `sub1.o' from the library, printing an
+This will delete the module named 'sub1.o' from the library, printing an
error if the library does not contain that module.
-The `l' command prints a list of all modules in the library. Any module
-names on the command line are ignored.
+The
- ar65 l mysubs.lib
+ ar65 tv mysubs.lib
-Using the `x' command, you may extract modules from the library. The
+Using the
- ar65 x mysubs.lib sub1.o
+ ar65 x mysubs.lib sub1.o
-The `V' command prints the version number of the assembler. If you send
+The
- 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.
- Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
- This notice may not be removed or altered from any source
- distribution.
+ 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.
+ Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+ This notice may not be removed or altered from any source
+ distribution.
-
-
-
diff --git a/doc/atari.sgml b/doc/atari.sgml
index 47ce050e1..170ffd5fb 100644
--- a/doc/atari.sgml
+++ b/doc/atari.sgml
@@ -1,12 +1,10 @@
-
Atari specific information for cc65
and
-2014-04-24
An overview over the Atari runtime system as it is implemented for the cc65 C
@@ -31,7 +29,7 @@ supports XL type or newer machines (excluding the 600XL).
The , it is
+, it is
recommended to use the
-Sceen memory and display list are moved below the program start address.
+Screen memory and display list are moved below the program start address.
The ROM is disabled, making the memory in the areas [$C000-$CFFF]
and [$D800-$FFF9] available.
Character generator data is copied from ROM to the CHARGEN location specified in the
@@ -133,7 +131,7 @@ With the default load address of $2400 this gives a usable memory range o
[$2400-$CFFF].
Please note that the first load chunk (which checks the system
-compatibilty and available memory) will always be loaded at
+compatibility and available memory) will always be loaded at
$2E00, regardless of the specified start address. This address
can only be changed by a custom linker config file.
@@ -148,7 +146,7 @@ Special locations:
($58).
+
+This config file allows writing multi segment binaries easily, without having to
+write the header explicitly on each segment.
+
+It is similar to the
This config file can be used to create 8K or 16K cartridges. It's suited both
@@ -229,8 +240,20 @@ for C and assembly language programs.
The size of a cassette boot file is restricted to 32K. Larger programs
would need to be split in more parts and the parts to be loaded manually.
-To write the generated file to a cassette, a utility to run
-on an Atari is provided in the
+
+This config file shows how to write a binary using the ATARI (xex) file format
+support on LD65, this simplifies the memory areas and allows to add new memory
+areas easily without writing new headers and trailers.
+
+Note that the default C library includes the system-check chunk, so in this
+linker configuration we suppress the importing of the header and trailer for
+this chunk by defining the standard import symbols to a 0 value. For the
+initialization address of the system-check chunk, the INITAD is set directly in
+the configuration.
@@ -255,12 +278,40 @@ The files generated by this config file include the
load chunk. It can
optionally be left out, see .
+
+
+Similar to the Platform specific header files
Programs containing Atari specific code may use the
+...
+ OS.savmsc = ScreenMemory;
+ OS.color4 = 14; // white frame
+ if (OS.stick0 != 15 || OS.ch != 255) // key or stick input?
+...
+
+
+Please note that memory location 762/$2FA is called "Atari specific functions
@@ -275,11 +326,13 @@ See the for declaration and u
_getcolor
_getdefdev
_graphics
+_is_cmdline_dos
_rest_vecs
_save_vecs
_scroll
_setcolor
_setcolor_low
+waitvsync
@@ -316,6 +369,125 @@ chip registers.
+Display lists
+
+A major feature of the Atari graphics chip "ANTIC" is to
+process instructions for the display generation.
+cc65 supports constructing these display lists by offering defines
+for the instructions. In conjunction with the "void"-variable extension
+of cc65, display lists can be created quite comfortable:
+
+
+...
+unsigned char ScreenMemory[100];
+
+void DisplayList =
+{
+ DL_BLK8,
+ DL_BLK8,
+ DL_BLK8,
+ DL_LMS(DL_CHR20x8x2),
+ ScreenMemory,
+ DL_CHR20x8x2,
+ DL_CHR20x8x2,
+ DL_CHR20x8x2,
+ DL_BLK4,
+ DL_CHR20x8x2,
+ DL_JVB,
+ &DisplayList
+};
+...
+OS.sdlst = &DisplayList;
+...
+
+
+Please inspect the Character mapping
+
+The Atari has two representations for characters:
+
+ ATASCII is character mapping which is similar to ASCII and used
+by the CIO system of the OS. This is the default mapping of cc65 when
+producing code for the atari target.
+ The internal/screen mapping represents the real value of the
+screen ram when showing a character.
+
+
+For direct memory access (simplicity and speed) enabling the internal
+mapping can be useful. This can be achieved by including the
+"For assembler sources the macro "
+
+You can switch back to the ATASCII mapping by including
+"
+#include <atari_screen_charmap.h>
+char pcScreenMappingString[] = "Hello Atari!";
+
+#include <atari_atascii_charmap.h>
+char pcAtasciiMappingString[] = "Hello Atari!";
+
+
+delivers correct results, while
+
+
+#include <atari_screen_charmap.h>
+char* pcScreenMappingString = "Hello Atari!";
+
+#include <atari_atascii_charmap.h>
+char* pcAtasciiMappingString = "Hello Atari!";
+
+
+does not.
+
+Keyboard codes
+
+For direct keyboard scanning in conjunction with e.g. the OS location "CH" (764/$2FC),
+all keyboard codes are available as defined values on C and assembler side.
+
+Example:
+
+...
+ while (!kbhit());
+ switch (OS.ch)
+ {
+ case KEY_RETURN:
+ ...
+ case KEY_SPACE:
+ ...
+ case KEY_1:
+ ...
+ }
+...
+
+
+You can find the C defines in the file "Loadable drivers
-Currently there is one RS232 driver. It uses the R: device (therefore
-an R: driver needs to be installed) and was tested with the 850
-interface module.
+Currently there is one RS232 driver. It supports up to 9600 baud, requires hardware flow control
+(RTS/CTS) and uses the R: device (therefore an R: driver needs to be installed). It was tested
+with the 850 interface module.
@@ -764,14 +788,14 @@ You may use cheap local labels as an easy way to reuse common label
names like "Loop". Here is an example:
- Clear: lda #$00 ; Global label
- ldy #$20
- @Loop: sta Mem,y ; Local label
- dey
- bne @Loop ; Ok
- rts
- Sub: ... ; New global label
- bne @Loop ; ERROR: Unknown identifier!
+ Clear: lda #$00 ; Global label
+ ldy #$20
+ @Loop: sta Mem,y ; Local label
+ dey
+ bne @Loop ; Ok
+ rts
+ Sub: ... ; New global label
+ bne @Loop ; ERROR: Unknown identifier!
Unnamed labels
@@ -787,23 +811,23 @@ reference (use the n'th label in forward direction). An example will help to
understand this:
- : lda (ptr1),y ; #1
- cmp (ptr2),y
- bne :+ ; -> #2
- tax
- beq :+++ ; -> #4
- iny
- bne :- ; -> #1
- inc ptr1+1
- inc ptr2+1
- bne :- ; -> #1
+ : lda (ptr1),y ; #1
+ cmp (ptr2),y
+ bne :+ ; -> #2
+ tax
+ beq :+++ ; -> #4
+ iny
+ bne :- ; -> #1
+ inc ptr1+1
+ inc ptr2+1
+ bne :- ; -> #1
- : bcs :+ ; #2 -> #3
- ldx #$FF
- rts
+ : bcs :+ ; #2 -> #3
+ ldx #$FF
+ rts
- : ldx #$01 ; #3
- : rts ; #4
+ : ldx #$01 ; #3
+ : rts ; #4
As you can see from the example, unnamed labels will make even short
@@ -835,15 +859,15 @@ errors. Because of these problems, the general advice is,
- .DEFINE two 2
- .DEFINE version "SOS V2.3"
+ .DEFINE two 2
+ .DEFINE version "SOS V2.3"
- four = two * two ; Ok
- .byte version ; Ok
+ four = two * two ; Ok
+ .byte version ; Ok
- .PROC ; Start local scope
- two = 3 ; Will give "2 = 3" - invalid!
- .ENDPROC
+ .PROC ; Start local scope
+ two = 3 ; Will give "2 = 3" - invalid!
+ .ENDPROC
@@ -1164,7 +1188,21 @@ an explanation on how this is done.
Address sizes of symbols
+The address size of a symbol can be specified with a prefix:
+
+z: zeropage addressing (8 bits).
+a: absolute addressing (16 bits).
+f: far addressing (24 bits).
+
+
+The zeropage addressing override can be used to ensure the use of optimal
+zeropage instructions, or correct cases where the size isn't yet known
+due to the single-pass assembly model.
+
+The larger addressing overrides can be used to promote a smaller address
+to absolute or far addressing, instead of being automatically fit into
+a smaller addressing type.
Memory models
-Pseudo functions expect their arguments in parenthesis, and they have a result,
-either a string or an expression.
+Pseudo functions expect their arguments in parentheses, and they have a result,
+either a string or an expression value.
.ADDRSIZE
- The .BANK
The or similar functions to address just part of it.
- Please note that .BLANK
- Builtin function. The function evaluates its argument in braces and yields
+ Builtin function. The function evaluates its argument in parentheses and yields
"false" if the argument is non blank (there is an argument), and "true" if
there is no argument. The token list that makes up the function argument
may optionally be enclosed in curly braces. This allows the inclusion of
@@ -1413,7 +1451,7 @@ either a string or an expression.
As an example, the
- .if .blank({arg})
+ .if .blank({arg})
@@ -1429,25 +1467,60 @@ either a string or an expression.
Example:
- .include .concat ("myheader", ".", "inc")
+ .include .concat ("myheader", ".", "inc")
This is the same as the command
- .include "myheader.inc"
+ .include "myheader.inc"
.CONST
- Builtin function. The function evaluates its argument in braces and
+ Builtin function. The function evaluates its argument in parentheses and
yields "true" if the argument is a constant expression (that is, an
expression that yields a constant value at assembly time) and "false"
otherwise. As an example, the .IFCONST statement may be replaced by
- .if .const(a + 3)
+ .if .const(a + 3)
+
+
+
+.DEF, .DEFINED
+
+ Builtin function. The function expects an identifier as argument in parentheses.
+ The argument is evaluated, and the function yields "true" if the identifier
+ is a symbol that already is defined somewhere in the source file up to the
+ current position. Otherwise, the function yields false. As an example, the
+ statement may be replaced by
+
+
+ .if .defined(a)
+
+
+
+.DEFINEDMACRO
+
+ Builtin function. The function expects an identifier as argument in parentheses.
+ The argument is evaluated, and the function yields "true" if the identifier
+ already has been defined as the name of a macro. Otherwise, the function yields
+ false. Example:
+
+
+ .macro add foo
+ clc
+ adc foo
+ .endmacro
+
+ .if .definedmacro(add)
+ add #$01
+ .else
+ clc
+ adc #$01
+ .endif
@@ -1477,7 +1550,7 @@ either a string or an expression.
Example:
- .macro makelabel arg1, arg2
+ .macro makelabel arg1, arg2
.ident (.concat (arg1, arg2)):
.endmacro
@@ -1487,6 +1560,23 @@ either a string or an expression.
+.ISMNEM, .ISMNEMONIC
+
+ Builtin function. The function expects an identifier as argument in parentheses.
+ The argument is evaluated, and the function yields "true" if the identifier
+ is defined as an instruction mnemonic that is recognized by the assembler.
+ Example:
+
+
+ .if .not .ismnemonic(ina)
+ .macro ina
+ clc
+ adc #$01
+ .endmacro
+ .endif
+
+
+
.LEFT
Builtin function. Extracts the left part of a given token list.
@@ -1494,7 +1584,7 @@ either a string or an expression.
Syntax:
- .LEFT (<int expr>, <token list>)
+ .LEFT (<int expr>, <token list>)
The first integer expression gives the number of tokens to extract from
@@ -1509,16 +1599,16 @@ either a string or an expression.
(immediate addressing mode), use something like this:
- .macro ldax arg
- ...
- .if (.match (.left (1, {arg}), #))
+ .macro ldax arg
+ ...
+ .if (.match (.left (1, {arg}), #))
- ; ldax called with immediate operand
- ...
+ ; ldax called with immediate operand
+ ...
- .endif
- ...
- .endmacro
+ .endif
+ ...
+ .endmacro
See also the and
- .MATCH(<token list #1>, <token list #2>)
+ .MATCH(<token list #1>, <token list #2>)
Both token list may contain arbitrary tokens with the exception of the
@@ -1581,16 +1671,16 @@ either a string or an expression.
to check for this and print and error for invalid calls.
- .macro asr arg
+ .macro asr arg
- .if (.not .blank(arg)) .and (.not .match ({arg}, a))
- .error "Syntax error"
- .endif
+ .if (.not .blank(arg)) .and (.not .match ({arg}, a))
+ .error "Syntax error"
+ .endif
- cmp #$80 ; Bit 7 into carry
- lsr a ; Shift carry into bit 7
+ cmp #$80 ; Bit 7 into carry
+ lsr a ; Shift carry into bit 7
- .endmacro
+ .endmacro
The macro will only accept no arguments, or one argument that must be the
@@ -1606,14 +1696,14 @@ either a string or an expression.
The syntax is
- .MAX (<value #1>, <value #2>)
+ .MAX (<value #1>, <value #2>)
Example:
; Reserve space for the larger of two data blocks
- savearea: .max (.sizeof (foo), .sizeof (bar))
+ savearea: .res .max (.sizeof (foo), .sizeof (bar))
See:
@@ -1627,7 +1717,7 @@ either a string or an expression.
Syntax:
- .MID (<int expr>, <int expr>, <token list>)
+ .MID (<int expr>, <int expr>, <token list>)
The first integer expression gives the starting token in the list (the first
@@ -1643,16 +1733,16 @@ either a string or an expression.
(immediate addressing mode), use something like this:
- .macro ldax arg
- ...
- .if (.match (.mid (0, 1, {arg}), #))
+ .macro ldax arg
+ ...
+ .if (.match (.mid (0, 1, {arg}), #))
- ; ldax called with immediate operand
- ...
+ ; ldax called with immediate operand
+ ...
- .endif
- ...
- .endmacro
+ .endif
+ ...
+ .endmacro
See also the and
- .MIN (<value #1>, <value #2>)
+ .MIN (<value #1>, <value #2>)
Example:
- ; Reserve space for some data, but 256 bytes minimum
- savearea: .min (.sizeof (foo), 256)
+ ; Reserve space for some data, but 256 bytes maximum
+ savearea: .res .min (.sizeof (foo), 256)
See:
@@ -1681,14 +1771,14 @@ either a string or an expression.
.REF, .REFERENCED
- Builtin function. The function expects an identifier as argument in braces.
+ Builtin function. The function expects an identifier as argument in parentheses.
The argument is evaluated, and the function yields "true" if the identifier
is a symbol that has already been referenced somewhere in the source file up
to the current position. Otherwise the function yields false. As an example,
the statement may be replaced by
- .if .referenced(a)
+ .if .referenced(a)
See:
@@ -1701,7 +1791,7 @@ either a string or an expression.
Syntax:
- .RIGHT (<int expr>, <token list>)
+ .RIGHT (<int expr>, <token list>)
The first integer expression gives the number of tokens to extract from the
@@ -1716,18 +1806,18 @@ either a string or an expression.
.SIZEOF
-
-.STRAT
-
- Builtin function. The function accepts a string and an index as
- arguments and returns the value of the character at the given position
- as an integer value. The index is zero based.
-
- Example:
-
-
- .macro M Arg
- ; Check if the argument string starts with '#'
- .if (.strat (Arg, 0) = '#')
- ...
- .endif
- .endmacro
-
-
-
.SPRINTF
Builtin function. It expects a format string as first argument. The number
@@ -1825,9 +1897,27 @@ either a string or an expression.
+.STRAT
+
+ Builtin function. The function accepts a string and an index as
+ arguments and returns the value of the character at the given position
+ as an integer value. The index is zero based.
+
+ Example:
+
+
+ .macro M Arg
+ ; Check if the argument string starts with '#'
+ .if (.strat (Arg, 0) = '#')
+ ...
+ .endif
+ .endmacro
+
+
+
.STRING
- Builtin function. The function accepts an argument in braces and converts
+ Builtin function. The function accepts an argument in parentheses and converts
this argument into a string constant. The argument may be an identifier, or
a constant numeric value.
@@ -1837,16 +1927,16 @@ either a string or an expression.
Example:
- ; Emulate other assemblers:
- .macro section name
- .segment .string(name)
- .endmacro
+ ; Emulate other assemblers:
+ .macro section name
+ .segment .string(name)
+ .endmacro
.STRLEN
- Builtin function. The function accepts a string argument in braces and
+ Builtin function. The function accepts a string argument in parentheses and
evaluates to the length of the string.
Example:
@@ -1855,15 +1945,15 @@ either a string or an expression.
a leading length byte.
- .macro PString Arg
- .byte .strlen(Arg), Arg
- .endmacro
+ .macro PString Arg
+ .byte .strlen(Arg), Arg
+ .endmacro
.TCOUNT
- Builtin function. The function accepts a token list in braces. The function
+ Builtin function. The function accepts a token list in parentheses. The function
result is the number of tokens given as argument. The token list may
optionally be enclosed into curly braces which are not considered part of
the list and not counted. Enclosement in curly braces allows the inclusion
@@ -1877,15 +1967,15 @@ either a string or an expression.
load instructions, the '#' token has to get stripped from the argument:
- .macro ldax arg
- .if (.match (.mid (0, 1, {arg}), #))
- ; ldax called with immediate operand
- lda #<(.right (.tcount ({arg})-1, {arg}))
- ldx #>(.right (.tcount ({arg})-1, {arg}))
- .else
- ...
- .endif
- .endmacro
+ .macro ldax arg
+ .if (.match (.mid (0, 1, {arg}), #))
+ ; ldax called with immediate operand
+ lda #<(.right (.tcount ({arg})-1, {arg}))
+ ldx #>(.right (.tcount ({arg})-1, {arg}))
+ .else
+ ...
+ .endif
+ .endmacro
@@ -1898,7 +1988,7 @@ either a string or an expression.
The syntax is
- .XMATCH(<token list #1>, <token list #2>)
+ .XMATCH(<token list #1>, <token list #2>)
Both token list may contain arbitrary tokens with the exception of the
@@ -1958,7 +2048,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .addr $0D00, $AF13, _Clear
+ .addr $0D00, $AF13, _Clear
See: ,
- .align 256
+ .align 256
Some unexpected behaviour might occur if there are multiple
- Msg: .asciiz "Hello world"
+ Msg: .asciiz "Hello world"
This will put the string "Hello world" followed by a binary zero into
the current segment. There may be more strings separated by commas, but
- the binary zero is only appended once (after the last one).
+ the binary zero is only appended once (after the last one). Strings will
+ be translated using the current character mapping definition.
+
+See: ,,
+ .ASSERT
@@ -2063,7 +2157,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .assert * = $8000, error, "Code not at $8000"
+ .assert * = $8000, error, "Code not at $8000"
The example assertion will check that the current location is at $8000,
@@ -2095,7 +2189,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .autoimport + ; Switch on auto import
+ .autoimport + ; Switch on auto import
.BANKBYTES
@@ -2109,17 +2203,17 @@ Here's a list of all control commands and a description, what they do:
.define MyTable TableItem0, TableItem1, TableItem2, TableItem3
- TableLookupLo: .lobytes MyTable
- TableLookupHi: .hibytes MyTable
- TableLookupBank: .bankbytes MyTable
+ TableLookupLo: .lobytes MyTable
+ TableLookupHi: .hibytes MyTable
+ TableLookupBank: .bankbytes MyTable
which is equivalent to
TableLookupLo: .byte <TableItem0, <TableItem1, <TableItem2, <TableItem3
- TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
- TableLookupBank: .byte ^TableItem0, ^TableItem1, ^TableItem2, ^TableItem3
+ TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
+ TableLookupBank: .byte ^TableItem0, ^TableItem1, ^TableItem2, ^TableItem3
See also: ,
@@ -2133,7 +2227,7 @@ Here's a list of all control commands and a description, what they do:
so this is a shortcut for
- .segment "BSS"
+ .segment "BSS"
See also the command.
@@ -2142,15 +2236,19 @@ Here's a list of all control commands and a description, what they do:
.BYT, .BYTE
Define byte sized data. Must be followed by a sequence of (byte ranged)
- expressions or strings.
+ expressions or strings. Strings will be translated using the current
+ character mapping definition.
Example:
- .byte "Hello "
- .byt "world", $0D, $00
+ .byte "Hello "
+ .byt "world", $0D, $00
+See: ,
+
+
.CASE
@@ -2163,23 +2261,24 @@ Here's a list of all control commands and a description, what they do:
Example:
- .case - ; Identifiers are not case sensitive
+ .case - ; Identifiers are not case sensitive
.CHARMAP
- Apply a custom mapping for characters. The command is followed by two
- numbers. The first one is the index of the source character (range 1..255),
+ Apply a custom mapping for characters for the commands and . The command
+ is followed by two numbers. The first one is the index of the source character
+ (range 0..255);
the second one is the mapping (range 0..255). The mapping applies to all
- character and string constants when they generate output, and overrides a
- mapping table specified with the
+ character and string constants
command line switch.
Example:
-
- .charmap $41, $61 ; Map 'A' to 'a'
+ .charmap $41, $61 ; Map 'A' to 'a'
@@ -2189,7 +2288,7 @@ Here's a list of all control commands and a description, what they do:
"CODE", so this is a shortcut for
- .segment "CODE"
+ .segment "CODE"
See also the command.
@@ -2225,8 +2324,8 @@ Here's a list of all control commands and a description, what they do:
Example:
- .condes ModuleInit, constructor
- .condes ModInit, 0, 16
+ .condes ModuleInit, constructor
+ .condes ModInit, 0, 16
See the ,
- .constructor ModuleInit
- .constructor ModInit, 16
+ .constructor ModuleInit
+ .constructor ModInit, 16
See the and
- .segment "DATA"
+ .segment "DATA"
See also the command.
@@ -2288,13 +2387,13 @@ Here's a list of all control commands and a description, what they do:
Example:
- .dbyt $1234, $4512
+ .dbyt $1234, $4512
This will emit the bytes
- $12 $34 $45 $12
+ $12 $34 $45 $12
into the current segment in that order.
@@ -2311,7 +2410,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .debuginfo + ; Generate debug info
+ .debuginfo + ; Generate debug info
@@ -2319,7 +2418,7 @@ Here's a list of all control commands and a description, what they do:
Start a define style macro definition. The command is followed by an
identifier (the macro name) and optionally by a list of formal arguments
- in braces.
+ in parentheses.
Please note that .
-.DEF, .DEFINED
-
- Builtin function. The function expects an identifier as argument in braces.
- The argument is evaluated, and the function yields "true" if the identifier
- is a symbol that is already defined somewhere in the source file up to the
- current position. Otherwise the function yields false. As an example, the
- statement may be replaced by
-
-
- .if .defined(a)
-
-
-
-.DEFINEDMACRO
-
- Builtin function. The function expects an identifier as argument in braces.
- The argument is evaluated, and the function yields "true" if the identifier
- has already been defined as the name of a macro. Otherwise the function yields
- false. Example:
-
-
- .macro add foo
- clc
- adc foo
- .endmacro
-
- .if .definedmacro(add)
- add #$01
- .else
- clc
- adc #$01
- .endif
-
-
-
.DESTRUCTOR
Export a symbol and mark it as a module destructor. This may be used
@@ -2399,8 +2463,8 @@ Here's a list of all control commands and a description, what they do:
Example:
- .destructor ModuleDone
- .destructor ModDone, 16
+ .destructor ModuleDone
+ .destructor ModDone, 16
See the and
- .dword $12344512, $12FA489
+ .dword $12344512, $12FA489
@@ -2461,7 +2525,7 @@ Here's a list of all control commands and a description, what they do:
.ENDPROC
- End of local lexical level (see ).
+ End of the local lexical level (see ).
.ENDREP, .ENDREPEAT
@@ -2471,7 +2535,7 @@ Here's a list of all control commands and a description, what they do:
.ENDSCOPE
- End of local lexical level (see /).
+ End of the local lexical level (see /).
.ENDSTRUCT
@@ -2495,8 +2559,8 @@ Here's a list of all control commands and a description, what they do:
otherwise the enumeration members are placed in the enclosing scope.
In the enumeration body, symbols are declared. The first symbol has a value
- of zero, and each following symbol will get the value of the preceding plus
- one. This behaviour may be overridden by an explicit assignment. Two symbols
+ of zero, and each following symbol will get the value of the preceding, plus
+ one. That behaviour may be overridden by an explicit assignment. Two symbols
may have the same value.
Example:
@@ -2509,9 +2573,9 @@ Here's a list of all control commands and a description, what they do:
.endenum
- Above example will create a new scope named
.scope errorcodes
@@ -2540,12 +2604,12 @@ Here's a list of all control commands and a description, what they do:
.endenum
- In this example, the enumeration does not have a name, which means that the
- members will be visible in the enclosing scope and can be used in this scope
+ In that example, the enumeration does not have a name, which means that the
+ members will be visible in the enclosing scope, and can be used in that scope
without explicit scoping. The first member (.ERROR
@@ -2560,13 +2624,13 @@ Here's a list of all control commands and a description, what they do:
Example:
- .if foo = 1
- ...
- .elseif bar = 1
- ...
- .else
- .error "Must define foo or bar!"
- .endif
+ .if foo = 1
+ ...
+ .elseif bar = 1
+ ...
+ .else
+ .error "Must define foo or bar!"
+ .endif
See also: ,
@@ -2599,7 +2663,7 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .export foo
+ .export foo
.export bar: far
.export foobar: far = foo * bar
.export baz := foobar, zap: far = baz - bar
@@ -2622,7 +2686,7 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .exportzp foo, bar
+ .exportzp foo, bar
.exportzp baz := $02
@@ -2637,7 +2701,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .faraddr DrawCircle, DrawRectangle, DrawHexagon
+ .faraddr DrawCircle, DrawRectangle, DrawHexagon
See:
@@ -2655,13 +2719,13 @@ Here's a list of all control commands and a description, what they do:
Example:
- .if foo = 1
- ...
- .elseif bar = 1
- ...
- .else
- .fatal "Must define foo or bar!"
- .endif
+ .if foo = 1
+ ...
+ .elseif bar = 1
+ ...
+ .else
+ .fatal "Must define foo or bar!"
+ .endif
See also: ,
@@ -2678,7 +2742,7 @@ Here's a list of all control commands and a description, what they do:
enabled it, so using
- .FEATURE xxx
+ .FEATURE xxx
will enable the feature until end of assembly is reached.
@@ -2695,10 +2759,26 @@ Here's a list of all control commands and a description, what they do:
at_in_identifiers
- Accept the at character (`@') as a valid character in identifiers. The
+ Accept the at character ('@') as a valid character in identifiers. The
at character is not allowed to start an identifier, even with this
feature enabled.
+ bracket_as_indirect
+
+ Use [] instead of () for the indirect addressing modes.
+ Example:
+
+
+ lda [$82]
+ lda [$82,x]
+ lda [$82],y
+ jmp [$fffe]
+ jmp [table,x]
+
+ / for more information.
+
c_comments
Allow C like comments using /* and */ as left and right
@@ -2714,13 +2794,13 @@ Here's a list of all control commands and a description, what they do:
dollar_in_identifiers
- Accept the dollar sign (`$') as a valid character in identifiers. The
+ Accept the dollar sign ('$') as a valid character in identifiers. The
dollar character is not allowed to start an identifier, even with this
feature enabled.
dollar_is_pc
- The dollar sign may be used as an alias for the star (`*'), which
+ The dollar sign may be used as an alias for the star ('*'), which
gives the value of the current PC in expressions.
Note: Assignment to the pseudo variable is not allowed.
@@ -2738,7 +2818,7 @@ Here's a list of all control commands and a description, what they do:
leading_dot_in_identifiers
- Accept the dot (`.') as the first character of an identifier. This may be
+ Accept the dot ('.') as the first character of an identifier. This may be
used for example to create macro names that start with a dot emulating
control directives of other assemblers. Note however, that none of the
reserved keywords built into the assembler, that starts with a dot, may be
@@ -2774,12 +2854,29 @@ Here's a list of all control commands and a description, what they do:
pc_assignment
- Allow assignments to the PC symbol (`*' or `$' if command (which is usually not needed, so just
removing the lines with the assignments may also be an option when porting
code written for older assemblers).
+ string_escapes
+
+ Allow C-style backslash escapes within string constants to embed
+ special characters. The following escapes are accepted:
+
+ \\ backslash ($5C)
+ \' single quote ($27)
+ \" double quote ($22)
+ \t tab ($09)
+ \r carriage return ($0D)
+ \n newline ($0A)
+ \xNN ($NN)
+
+
+ Note that string escapes are converted to platform-specific characters in
+ the same way that other characters are converted.
+
ubiquitous_idents
Allow the use of instructions names as names for macros and symbols. This
@@ -2809,7 +2906,7 @@ Here's a list of all control commands and a description, what they do:
assembler, the features
- labels_without_colons, pc_assignment, loose_char_term
+ labels_without_colons, pc_assignment, loose_char_term
may be helpful. They do not make ca65 completely compatible, so you may not
@@ -2829,9 +2926,9 @@ Here's a list of all control commands and a description, what they do:
The command is followed by one of the keywords
- author
- comment
- compiler
+ author
+ comment
+ compiler
a comma and a string. The option is written into the object file
@@ -2842,9 +2939,9 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .fileopt comment, "Code stolen from my brother"
- .fileopt compiler, "BASIC 2.0"
- .fopt author, "J. R. User"
+ .fileopt comment, "Code stolen from my brother"
+ .fileopt compiler, "BASIC 2.0"
+ .fopt author, "J. R. User"
@@ -2860,7 +2957,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .forceimport needthisone, needthistoo
+ .forceimport needthisone, needthistoo
See:
@@ -2877,7 +2974,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .global foo, bar
+ .global foo, bar
@@ -2893,7 +2990,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .globalzp foo, bar
+ .globalzp foo, bar
.HIBYTES
@@ -2906,14 +3003,14 @@ Here's a list of all control commands and a description, what they do:
.lobytes $1234, $2345, $3456, $4567
- .hibytes $fedc, $edcb, $dcba, $cba9
+ .hibytes $fedc, $edcb, $dcba, $cba9
which is equivalent to
.byte $34, $45, $56, $67
- .byte $fe, $ed, $dc, $cb
+ .byte $fe, $ed, $dc, $cb
Example:
@@ -2921,15 +3018,15 @@ Here's a list of all control commands and a description, what they do:
.define MyTable TableItem0, TableItem1, TableItem2, TableItem3
- TableLookupLo: .lobytes MyTable
- TableLookupHi: .hibytes MyTable
+ TableLookupLo: .lobytes MyTable
+ TableLookupHi: .hibytes MyTable
which is equivalent to
TableLookupLo: .byte <TableItem0, <TableItem1, <TableItem2, <TableItem3
- TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
+ TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
See also: ,
@@ -2974,7 +3071,7 @@ Here's a list of all control commands and a description, what they do:
Conditional assembly: Check if there are any remaining tokens in this line,
and evaluate to FALSE if this is the case, and to TRUE otherwise. If the
condition is not true, further lines are not assembled until an , or
+ id=".ELSE" name=".ELSE">
, or
directive.
This command is often used to check if a macro parameter was given. Since an
@@ -2984,13 +3081,13 @@ Here's a list of all control commands and a description, what they do:
Example:
- .macro arg1, arg2
- .ifblank arg2
- lda #arg1
- .else
- lda #arg2
- .endif
- .endmacro
+ .macro arg1, arg2
+ .ifblank arg2
+ lda #arg1
+ .else
+ lda #arg2
+ .endif
+ .endmacro
See also:
@@ -3011,7 +3108,7 @@ Here's a list of all control commands and a description, what they do:
.IFDEF
Conditional assembly: Check if a symbol is defined. Must be followed by
- a symbol name. The condition is true if the the given symbol is already
+ a symbol name. The condition is true if the given symbol is already
defined, and false otherwise.
See also:
@@ -3032,12 +3129,12 @@ Here's a list of all control commands and a description, what they do:
Example:
- .macro arg1, arg2
- lda #arg1
- .ifnblank arg2
- lda #arg2
- .endif
- .endmacro
+ .macro arg1, arg2
+ lda #arg1
+ .ifnblank arg2
+ lda #arg2
+ .endif
+ .endmacro
See also:
@@ -3046,7 +3143,7 @@ Here's a list of all control commands and a description, what they do:
.IFNDEF
Conditional assembly: Check if a symbol is defined. Must be followed by
- a symbol name. The condition is true if the the given symbol is not
+ a symbol name. The condition is true if the given symbol is not
defined, and false otherwise.
See also:
@@ -3055,7 +3152,7 @@ Here's a list of all control commands and a description, what they do:
.IFNREF
Conditional assembly: Check if a symbol is referenced. Must be followed
- by a symbol name. The condition is true if if the the given symbol was
+ by a symbol name. The condition is true if the given symbol was
not referenced before, and false otherwise.
See also:
@@ -3067,6 +3164,12 @@ Here's a list of all control commands and a description, what they do:
(see command).
+.IFP4510
+
+ Conditional assembly: Check if the assembler is currently in 4510 mode
+ (see command).
+
+
.IFP816
Conditional assembly: Check if the assembler is currently in 65816 mode
@@ -3079,6 +3182,12 @@ Here's a list of all control commands and a description, what they do:
(see command).
+.IFPDTV
+
+ Conditional assembly: Check if the assembler is currently in 6502DTV mode
+ (see command).
+
+
.IFPSC02
Conditional assembly: Check if the assembler is currently in 65SC02 mode
@@ -3088,7 +3197,7 @@ Here's a list of all control commands and a description, what they do:
.IFREF
Conditional assembly: Check if a symbol is referenced. Must be followed
- by a symbol name. The condition is true if if the the given symbol was
+ by a symbol name. The condition is true if the given symbol was
referenced before, and false otherwise.
This command may be used to build subroutine libraries in include files
@@ -3097,14 +3206,15 @@ Here's a list of all control commands and a description, what they do:
Example:
- .ifref ToHex ; If someone used this subroutine
- ToHex: tay ; Define subroutine
- lda HexTab,y
- rts
- .endif
+ .ifref ToHex ; If someone used this subroutine
+ ToHex: tay ; Define subroutine
+ lda HexTab,y
+ rts
+ .endif
- See also:
+ See also: , and
+ .IMPORT
@@ -3116,7 +3226,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .import foo
+ .import foo
.import bar: zeropage
@@ -3132,7 +3242,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .importzp foo, bar
+ .importzp foo, bar
See:
@@ -3150,14 +3260,14 @@ Here's a list of all control commands and a description, what they do:
Example:
- ; Include whole file
- .incbin "sprites.dat"
+ ; Include whole file
+ .incbin "sprites.dat"
- ; Include file starting at offset 256
- .incbin "music.dat", $100
+ ; Include file starting at offset 256
+ .incbin "music.dat", $100
- ; Read 100 bytes starting at offset 200
- .incbin "graphics.dat", 200, 100
+ ; Read 100 bytes starting at offset 200
+ .incbin "graphics.dat", 200, 100
@@ -3168,7 +3278,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .include "subs.inc"
+ .include "subs.inc"
@@ -3193,8 +3303,8 @@ Here's a list of all control commands and a description, what they do:
Example:
- .interruptor IrqHandler
- .interruptor Handler, 16
+ .interruptor IrqHandler
+ .interruptor Handler, 16
See the command and the separate
@@ -3202,23 +3312,6 @@ Here's a list of all control commands and a description, what they do:
the feature in more detail.
-.ISMNEM, .ISMNEMONIC
-
- Builtin function. The function expects an identifier as argument in braces.
- The argument is evaluated, and the function yields "true" if the identifier
- is defined as an instruction mnemonic that is recognized by the assembler.
- Example:
-
-
- .if .not .ismnemonic(ina)
- .macro ina
- clc
- adc #$01
- .endmacro
- .endif
-
-
-
.LINECONT
Switch on or off line continuations using the backslash character
@@ -3232,10 +3325,10 @@ Here's a list of all control commands and a description, what they do:
Example:
- .linecont + ; Allow line continuations
+ .linecont + ; Allow line continuations
- lda \
- #$20 ; This is legal now
+ lda \
+ #$20 ; This is legal now
@@ -3253,7 +3346,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .list on ; Enable listing output
+ .list on ; Enable listing output
@@ -3268,12 +3361,28 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .listbytes unlimited ; List all bytes
- .listbytes 12 ; List the first 12 bytes
- .incbin "data.bin" ; Include large binary file
+ .listbytes unlimited ; List all bytes
+ .listbytes 12 ; List the first 12 bytes
+ .incbin "data.bin" ; Include large binary file
+.LITERAL
+
+ Define byte sized data. Must be followed by a sequence of (byte ranged)
+ expressions or strings. Strings will disregard the current character
+ mapping definition and will be interpreted literally.
+
+ Example:
+
+
+ .literal "Hello "
+ .literal "world", $0D, $00
+
+
+See: ,
+
+
.LOBYTES
Define byte sized data by extracting only the low byte (that is, bits 0-7) from
@@ -3284,14 +3393,14 @@ Here's a list of all control commands and a description, what they do:
.lobytes $1234, $2345, $3456, $4567
- .hibytes $fedc, $edcb, $dcba, $cba9
+ .hibytes $fedc, $edcb, $dcba, $cba9
which is equivalent to
.byte $34, $45, $56, $67
- .byte $fe, $ed, $dc, $cb
+ .byte $fe, $ed, $dc, $cb
Example:
@@ -3299,15 +3408,15 @@ Here's a list of all control commands and a description, what they do:
.define MyTable TableItem0, TableItem1, TableItem2, TableItem3
- TableLookupLo: .lobytes MyTable
- TableLookupHi: .hibytes MyTable
+ TableLookupLo: .lobytes MyTable
+ TableLookupHi: .hibytes MyTable
which is equivalent to
TableLookupLo: .byte <TableItem0, <TableItem1, <TableItem2, <TableItem3
- TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
+ TableLookupHi: .byte >TableItem0, >TableItem1, >TableItem2, >TableItem3
See also: ,
@@ -3348,15 +3457,15 @@ Here's a list of all control commands and a description, what they do:
Example:
- .localchar '?'
+ .localchar '?'
- Clear: lda #$00 ; Global label
- ?Loop: sta Mem,y ; Local label
- dey
- bne ?Loop ; Ok
- rts
- Sub: ... ; New global label
- bne ?Loop ; ERROR: Unknown identifier!
+ Clear: lda #$00 ; Global label
+ ?Loop: sta Mem,y ; Local label
+ dey
+ bne ?Loop ; Ok
+ rts
+ Sub: ... ; New global label
+ bne ?Loop ; ERROR: Unknown identifier!
@@ -3370,8 +3479,8 @@ Here's a list of all control commands and a description, what they do:
atari Defines the scrcode macro.
cbm Defines the scrcode macro.
cpu Defines constants for the .CPU variable.
- generic Defines generic macroes like add, sub, and blt.
- longbranch Defines conditional long-jump macroes.
+ generic Defines generic macros like add, sub, and blt.
+ longbranch Defines conditional long-jump macros.
Including a macro package twice, or including a macro package that
@@ -3380,10 +3489,10 @@ Here's a list of all control commands and a description, what they do:
Example:
- .macpack longbranch ; Include macro package
+ .macpack longbranch ; Include macro package
- cmp #$20 ; Set condition codes
- jne Label ; Jump long on condition
+ cmp #$20 ; Set condition codes
+ jne Label ; Jump long on condition
Macro packages are explained in more detail in section
- .macro ldax arg ; Define macro ldax
+ .macro ldax arg ; Define macro ldax
lda arg
ldx arg+1
@@ -3430,7 +3539,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .org $7FF ; Emit code starting at $7FF
+ .org $7FF ; Emit code starting at $7FF
@@ -3443,7 +3552,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .out "This code was written by the codebuster(tm)"
+ .out "This code was written by the codebuster(tm)"
See also: ,
@@ -3458,7 +3567,18 @@ Here's a list of all control commands and a description, what they do:
command line option.
See: , and
+ name=".PSC02">
, and
+
+
+
+.P4510
+
+ Enable the 4510 instruction set. This is a superset of the 65C02 and
+ 6502 instruction sets.
+
+ See: , , and
+ .P816
@@ -3467,7 +3587,8 @@ Here's a list of all control commands and a description, what they do:
6502 instruction sets.
See: , and
+ name=".PSC02">
, and
+ .PAGELEN, .PAGELENGTH
@@ -3483,9 +3604,9 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .pagelength 66 ; Use 66 lines per listing page
+ .pagelength 66 ; Use 66 lines per listing page
- .pagelength unlimited ; Unlimited page length
+ .pagelength unlimited ; Unlimited page length
@@ -3495,7 +3616,31 @@ Here's a list of all control commands and a description, what they do:
6502 and 65SC02 instructions.
See: , and
+ name=".PSC02">
, and
+
+
+
+.PDTV
+
+ Enable the 6502DTV instruction set. This is a superset of the 6502
+ instruction set.
+
+ See:
+
+
+.POPCHARMAP
+
+ Pop the last character mapping from the stack, and activate it.
+
+ This command will switch back to the character mapping that was last pushed onto the
+ character mapping stack using the
+ command, and remove this entry from the stack.
+
+ The assembler will print an error message if the mappting stack is empty when
+ this command is issued.
+
+ See: , .POPCPU
@@ -3547,15 +3692,15 @@ Here's a list of all control commands and a description, what they do:
Example:
- .proc Clear ; Define Clear subroutine, start new level
- lda #$00
- L1: sta Mem,y ; L1 is local and does not cause a
- ; duplicate symbol error if used in other
- ; places
- dey
- bne L1 ; Reference local symbol
- rts
- .endproc ; Leave lexical level
+ .proc Clear ; Define Clear subroutine, start new level
+ lda #$00
+ L1: sta Mem,y ; L1 is local and does not cause a
+ ; duplicate symbol error if used in other
+ ; places
+ dey
+ bne L1 ; Reference local symbol
+ rts
+ .endproc ; Leave lexical level
See: / and , and
+ name=".PC02">, and
+
+
+
+.PUSHCHARMAP
+
+ Push the currently active character mapping onto a stack. The stack has a size of 16
+ entries.
+
+ to switch to another character mapping and to restore the old
+ character mapping later, without knowledge of the current mapping.
+
+ The assembler will print an error message if the character mapping stack is already full,
+ when this command is issued.
+
+ See: , .PUSHCPU
@@ -3603,6 +3765,46 @@ Here's a list of all control commands and a description, what they do:
See:
+.REFERTO, .REFTO
+
+ Mark a symbol as referenced.
+
+ It is useful in combination with the
+ command. A subroutine with two entry points can be created. When the first
+ entry point is called, it sets some default value as an argument, and falls
+ through into the second entry point. .REFERTO helps to ensure that
+ the second part is included into binary when only the first entry point is
+ actually used from the code.
+
+ Example:
+
+
+ .ifref NegateValue ; If this subroutine is used
+ NegateValue: ; Define it
+ lda #0
+ sec
+ sbc Value
+ .ifref ResetValue ; If the ResetValue is also used
+ jmp SetValue ; Jump over it
+ .else
+ .refto SetValue ; Ensure that SetValue will be included
+ .endif
+ .endif
+
+ .ifref ResetValue ; If this subroutine is used
+ ResetValue: ; Define it
+ lda #0 ; Set a default value
+ .refto SetValue ; Ensure that SetValue will be included
+ .endif
+
+ .ifref SetValue ; If this or previous subroutine is used
+ SetValue:
+ sta Value
+ rts
+ .endif
+
+
+
.RELOC
Switch back to relocatable mode. See the
- .macro Crypt Arg
- .repeat .strlen(Arg), I
- .byte .strat(Arg, I) ^ $55
- .endrep
- .endmacro
+ .macro Crypt Arg
+ .repeat .strlen(Arg), I
+ .byte .strat(Arg, I) ^ $55
+ .endrep
+ .endmacro
See:
@@ -3651,8 +3853,8 @@ Here's a list of all control commands and a description, what they do:
Example:
- ; Reserve 12 bytes of memory with value $AA
- .res 12, $AA
+ ; Reserve 12 bytes of memory with value $AA
+ .res 12, $AA
@@ -3662,7 +3864,7 @@ Here's a list of all control commands and a description, what they do:
"RODATA", so this is a shortcut for
- .segment "RODATA"
+ .segment "RODATA"
The RODATA segment is a segment that is used by the compiler for
@@ -3690,11 +3892,11 @@ Here's a list of all control commands and a description, what they do:
Example:
- .scope Error ; Start new scope named Error
+ .scope Error ; Start new scope named Error
None = 0 ; No error
File = 1 ; File error
Parse = 2 ; Parse error
- .endscope ; Close lexical level
+ .endscope ; Close lexical level
...
lda #Error::File ; Use symbol from scope Error
@@ -3728,7 +3930,7 @@ Here's a list of all control commands and a description, what they do:
page and direct (short) addressing is possible for data in this segment.
Beware: Only labels in a segment with the zeropage attribute are marked
- as reachable by short addressing. The `*' (PC counter) operator will
+ as reachable by short addressing. The '*' (PC counter) operator will
work as in other segments and will create absolute variable values.
Please note that a segment cannot have two different address sizes. A
@@ -3737,10 +3939,10 @@ Here's a list of all control commands and a description, what they do:
Examples:
- .segment "ROM2" ; Switch to ROM2 segment
- .segment "ZP2": zeropage ; New direct segment
- .segment "ZP2" ; Ok, will use last attribute
- .segment "ZP2": absolute ; Error, redecl mismatch
+ .segment "ROM2" ; Switch to ROM2 segment
+ .segment "ZP2": zeropage ; New direct segment
+ .segment "ZP2" ; Ok, will use last attribute
+ .segment "ZP2": absolute ; Error, redecl mismatch
See: , command line option,
- namely: 6502, 6502X, 65SC02, 65C02, 65816 and HuC6280.
+ namely: 6502, 6502X, 6502DTV, 65SC02, 65C02, 65816, 4510 and HuC6280.
See: ,
,
+ ,
,
,
,
,
,
+ ,
,
@@ -3799,8 +4003,8 @@ Here's a list of all control commands and a description, what they do:
Example:
- .smart ; Be smart
- .smart - ; Stop being smart
+ .smart ; Be smart
+ .smart - ; Stop being smart
See: ,
@@ -3870,17 +4074,17 @@ Here's a list of all control commands and a description, what they do:
Example:
- .macro jne target
- .local L1
- .ifndef target
- .warning "Forward jump in jne, cannot optimize!"
- beq L1
- jmp target
- L1:
- .else
- ...
- .endif
- .endmacro
+ .macro jne target
+ .local L1
+ .ifndef target
+ .warning "Forward jump in jne, cannot optimize!"
+ beq L1
+ jmp target
+ L1:
+ .else
+ ...
+ .endif
+ .endmacro
See also: ,
@@ -3896,7 +4100,7 @@ Here's a list of all control commands and a description, what they do:
Example:
- .word $0D00, $AF13, _Clear
+ .word $0D00, $AF13, _Clear
@@ -4217,34 +4421,41 @@ different:
- Macros defined with may not
- span more than a line. You may use line continuation (see ) to spread the definition over
- more than one line for increased readability, but the macro itself
- may not contain an end-of-line token.
+ Macros defined with may not
+ span more than a line. You may use line continuation (see ) to spread the definition over
+ more than one line for increased readability, but the macro itself
+ may not contain an end-of-line token.
- Macros defined with share
- the name space with classic macros, but they are detected and replaced
- at the scanner level. While classic macros may be used in every place,
- where a mnemonic or other directive is allowed, style macros are allowed anywhere in a line. So
- they are more versatile in some situations.
+ Macros defined with share
+ the name space with classic macros, but they are detected and replaced
+ at the scanner level. While classic macros may be used in every place,
+ where a mnemonic or other directive is allowed, style macros are allowed anywhere in a line. So
+ they are more versatile in some situations.
- style macros may take
- parameters. While classic macros may have empty parameters, this is
- not true for style macros.
- For this macro type, the number of actual parameters must match
- exactly the number of formal parameters.
+ style macros may take
+ parameters. While classic macros may have empty parameters, this is
+ not true for style macros.
+ For this macro type, the number of actual parameters must match
+ exactly the number of formal parameters.
- To make this possible, formal parameters are enclosed in braces when
- defining the macro. If there are no parameters, the empty braces may
- be omitted.
+ To make this possible, formal parameters are enclosed in parentheses when
+ defining the macro. If there are no parameters, the empty parentheses may
+ be omitted.
- Since style macros may not
- contain end-of-line tokens, there are things that cannot be done. They
- may not contain several processor instructions for example. So, while
- some things may be done with both macro types, each type has special
- usages. The types complement each other.
+ Since style macros may not
+ contain end-of-line tokens, there are things that cannot be done. They
+ may not contain several processor instructions for example. So, while
+ some things may be done with both macro types, each type has special
+ usages. The types complement each other.
+
+ Parentheses work differently from C macros.
+ The common practice of wrapping C macros in parentheses may cause
+ unintended problems here, such as accidentally implying an
+ indirect addressing mode. While the definition of a macro requires
+ parentheses around its argument list, when invoked they should not be
+ included.
@@ -4278,18 +4489,42 @@ Macros with parameters may also be useful:
DEBUG "Assembling include file #3"
-Note that, while formal parameters have to be placed in braces, this is
-not true for the actual parameters. Beware: Since the assembler cannot
-detect the end of one parameter, only the first token is used. If you
-don't like that, use classic macros instead:
+Note that, while formal parameters have to be placed in parentheses,
+the actual argument used when invoking the macro should not be.
+The invoked arguments are separated by commas only; if parentheses are
+used by accident, they will become part of the replaced token.
+
+If you wish to have an expression follow the macro invocation, the
+last parameter can be enclosed in curly braces {} to indicate the end of that
+argument.
+
+Examples:
-.macro DEBUG message
- .out message
-.endmacro
+.define COMBINE(ta,tb,tc) ta+tb*10+tc*100
+
+.word COMBINE 5,6,7 ; 5+6*10+7*100 = 765
+.word COMBINE(5,6,7) ; (5+6*10+7)*100 = 7200 ; incorrect use of parentheses
+.word COMBINE 5,6,7+1 ; 5+6*10+7+1*100 = 172
+.word COMBINE 5,6,{7}+1 ; 5+6*10+7*100+1 = 766 ; {} encloses the argument
+.word COMBINE 5,6-2,7 ; 5+6-2*10+7*100 = 691
+.word COMBINE 5,(6-2),7 ; 5+(6-2)*10+7*100 = 745
+.word COMBINE 5,6,7+COMBINE 0,1,2 ; 5+6*10+7+0+1*10+2*100*100 = 20082
+.word COMBINE 5,6,{7}+COMBINE 0,1,2 ; 5+6*10+7*100+0+1*10+2*100 = 975
-(That is an example where a problem can be solved with both macro types).
+With C macros it is common to enclose the results in parentheses to
+prevent unintended interactions with the text of the arguments, but
+additional care must be taken in this assembly context where parentheses
+may alter the meaning of a statement. In particular, indirect addressing modes
+may be accidentally implied:
+
+
+.define DUO(ta,tb) (ta+(tb*10))
+
+ lda DUO(5,4), Y ; LDA (indirect), Y
+ lda 0+DUO(5,4), Y ; LDA absolute indexed, Y
+Characters in macros
@@ -4359,19 +4594,19 @@ are:
.MACPACK generic
-This macro package defines macroes that are useful in almost any program.
-Currently defined macroes are:
+This macro package defines macros that are useful in almost any program.
+Currently defined macros are:
.macro add Arg ; add without carry
- clc
- adc Arg
- .endmacro
+ clc
+ adc Arg
+ .endmacro
.macro sub Arg ; subtract without borrow
- sec
- sbc Arg
- .endmacro
+ sec
+ sbc Arg
+ .endmacro
.macro bge Arg ; branch on greater-than or equal
bcs Arg
@@ -4411,14 +4646,14 @@ definition for the "
- .macro jeq Target
- .if .def(Target) .and ((*+2)-(Target) <= 127)
- beq Target
- .else
- bne *+5
- jmp Target
- .endif
- .endmacro
+ .macro jeq Target
+ .if .def(Target) .and ((*+2)-(Target) <= 127)
+ beq Target
+ .else
+ bne *+5
+ jmp Target
+ .endif
+ .endmacro
All macros expand to a short branch, if the label is already defined (back
@@ -4429,11 +4664,17 @@ jump to the actual branch target.
The package defines the following macros:
- jeq, jne, jmi, jpl, jcs, jcc, jvs, jvc
+ jeq, jne, jmi, jpl, jcs, jcc, jvs, jvc
+.MACPACK apple2
+
+This macro package defines a macro named .MACPACK atari
This macro package defines a macro named
is defined. These constants may be used to determine the exact type of the
@@ -4472,6 +4715,8 @@ another constant is defined:
CPU_ISET_65816
CPU_ISET_SWEET16
CPU_ISET_HUC6280
+ CPU_ISET_4510
+ CPU_ISET_6502DTV
The value read from the / pseudo variable may
@@ -4516,7 +4761,9 @@ compiler, depending on the target system selected:
+
Structs and unions
Structs and unions Overview
Structs and unions are special forms of . They
-are to some degree comparable to their C counterparts. Both have a list of
-members. Each member allocates storage and may optionally have a name, which,
-in case of a struct, is the offset from the beginning and, in case of a union,
-is always zero.
+are, to some degree, comparable to their C counterparts. Both have a list of
+members. Each member allocates storage, and optionally may have a name whose
+value, in the case of a struct, usually is the storage offset from the
+beginning, and in the case of a union, doesn't change, and usually is zero.
Declaration
Here is an example for a very simple struct with two members and a total size
of 4 bytes:
-
.struct Point
xcoord .word
@@ -4566,10 +4815,9 @@ of 4 bytes:
.endstruct
-A union shares the total space between all its members, its size is the same
+A union shares the total space between all its members; its size is the same
as that of the largest member. The offset of all members relative to the union
is zero.
-
.union Entry
index .word
@@ -4577,13 +4825,12 @@ is zero.
.endunion
-A struct or union must not necessarily have a name. If it is anonymous, no
-local scope is opened, the identifiers used to name the members are placed
+A struct or union may not necessarily have a name. If it is anonymous, no
+local scope is opened; the identifiers used to name the members are placed
into the current scope instead.
-A struct may contain unnamed members and definitions of local structs. The
-storage allocators may contain a multiplier, as in the example below:
-
+A struct may contain unnamed members and definitions of local structs/unions.
+The storage allocators may contain a multiplier, as in the example below:
.struct Circle
.struct Point
@@ -4592,13 +4839,51 @@ storage allocators may contain a multiplier, as in the example below:
Radius .word
.endstruct
+The size of the Circle struct is 6 (three words).
+
+
+The storage allocator keywords
+
+
+
+
+
+
+The
+
+The
+; 6551
+.struct ACIA ; Asynchronous Communications Interface Adapter
+ .org $031C
+DATA .byte
+STATUS .byte
+CMD .byte ; Command register
+CTRL .byte ; Control register
+.endstruct
+
+ lda ACIA::DATA ; Get an RS-232 character
+The
-Using the keyword, it is possible to reserve space
-for an already defined struct or unions within another struct:
-
+By using the keyword, it is possible to reserve
+space for an already defined struct or union within another struct:
.struct Point
xcoord .word
@@ -4611,33 +4896,30 @@ for an already defined struct or unions within another struct:
.endstruct
-Space for a struct or union may be allocated using the directive.
-
- C: .tag Circle
+C: .tag Circle
Currently, members are just offsets from the start of the struct or union. To
-access a field of a struct, the member offset has to be added to the address
-of the struct itself:
-
+access a field of a struct, the member offset must be added to the address of
+the struct variable itself:
lda C+Circle::Radius ; Load circle radius into A
-
-This may change in a future version of the assembler.
+That may change in a future version of the assembler.
Limitations
-Structs and unions are currently implemented as nested symbol tables (in fact,
+Structs and unions currently are implemented as nested symbol tables (in fact,
they were a by-product of the improved scoping rules). Currently, the
-assembler has no idea of types. This means that the keyword will only allocate space. You won't be able to initialize
-variables declared with , and adding an embedded
+assembler has no idea of types. That means that the keyword only will allocate space. You won't be able to initialize
+variables declared with ; and, adding an embedded
structure to another structure with will not make
-this structure accessible by using the '::' operator.
+that added structure accessible by using the '::' operator.
@@ -4851,14 +5133,14 @@ including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
- 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.
- Altered source versions must be plainly marked as such, and must not
- be misrepresented as being the original software.
- This notice may not be removed or altered from any source
- distribution.
+ 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.
+ Altered source versions must be plainly marked as such, and must not
+ be misrepresented as being the original software.
+ This notice may not be removed or altered from any source
+ distribution.
diff --git a/doc/cbm510.sgml b/doc/cbm510.sgml
index c24eba142..86bed7607 100644
--- a/doc/cbm510.sgml
+++ b/doc/cbm510.sgml
@@ -1,13 +1,11 @@
-
Commodore 510 (aka P500) specific information for cc65
,,
-2014-04-25
An overview over the Commodore 510 runtime system as it is implemented for the
@@ -67,7 +65,7 @@ Special locations:
cbm_k_basin
cbm_k_bsout