diff --git a/doc/Makefile b/doc/Makefile
index 9f26c13dc..5dba9d86b 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -26,6 +26,7 @@ SGML = apple2.sgml \
c64.sgml \
ca65.sgml \
ca65html.sgml \
+ cbm510.sgml \
cbm610.sgml \
cc65.sgml \
cl65.sgml \
@@ -111,13 +112,13 @@ zap: clean
# ------------------------------------------------------------------------------
# Special target rules
-
+
coding.html: coding.sgml
sgml2html --split=0 $<
# funcref.sgml's third section is huge.
# So, funcref.html is split into sub-section files.
-#
+#
funcref.html: funcref.sgml
sgml2html --split=2 $(BUTTONS) $<
diff --git a/doc/cbm510.sgml b/doc/cbm510.sgml
new file mode 100644
index 000000000..97d37a1df
--- /dev/null
+++ b/doc/cbm510.sgml
@@ -0,0 +1,298 @@
+
+
+
+
+Commodore 510 (aka P500) specific information for cc65
+Ullrich von Bassewitz,
+Stefan A. Haubenthal,
+2006-05-22
+
+
+An overview over the Commodore 510 runtime system as it is implemented for the
+cc65 C compiler.
+
+
+
+
+
+
+
+Overview
+
+This file contains an overview of the CBM 510 runtime system as it comes with
+the cc65 C compiler. It describes the memory layout, CBM 510 specific header
+files, available drivers, and any pitfalls specific to that platform.
+
+Please note that CBM 510 specific functions are just mentioned here, they are
+described in detail in the separate . Even functions marked as "platform dependent" may be available on
+more than one platform. Please see the function reference for more
+information.
+
+In addition to the Commodore 510 (named P128 in the U.S.), no other
+machines are supported by this cc65 target.
+
+
+
+Binary format
+
+The standard binary output format generated by the linker for the CBM510
+target is a machine language program with a short BASIC stub. This means that
+a program can be loaded as BASIC program and started with RUN. It is of course
+possible to change this behaviour by using a modified startup file and linker
+config.
+
+
+Memory layout
+
+cc65 generated programs for the Commodore 510 run in bank 0, the memory bank
+reserved for BASIC programs. Since there are no ROMs in this memory bank, the
+program has almost full 64K for its own. A disadvantage is that kernal
+subroutines cannot be called (at least not in a fast and effective manner), so
+the runtime has replace kernal functionality.
+
+The default memory configuration for the CBM 510 allocates all memory between
+$0002 and $FFF0 in bank 0 for the compiled program. Some space
+in low memory is lost, because a separate hardware stack is set up in page 1,
+and the kernal replacement functions need some more memory locations. A few
+more pages are lost in high memory, because the runtime sets up a copy of the
+character ROM, a text screen and a CBM compatible jump table at $FF81.
+The main startup code is located at $0400, so about 54K of the complete
+bank are actually usable for applications.
+
+Special locations:
+
+
+
+
+
+
+Platform specific header files
+
+Programs containing CBM 510 specific code may use the CBM 510 specific functions
+
+The functions listed below are special for the CBM 510. See the for declaration and usage.
+
+
+peekbsys
+peekwsys
+pokebsys
+pokewsys
+
+
+
+CBM specific functions
+
+Some functions are available for all (or at least most) of the Commodore
+machines. See the for
+declaration and usage.
+
+
+
+cbm_close
+cbm_closedir
+cbm_k_setlfs
+cbm_k_setnam
+cbm_k_load
+cbm_k_save
+cbm_k_open
+cbm_k_close
+cbm_k_readst
+cbm_k_chkin
+cbm_k_ckout
+cbm_k_basin
+cbm_k_bsout
+cbm_k_clrch
+cbm_load
+cbm_open
+cbm_opendir
+cbm_read
+cbm_readdir
+cbm_save
+cbm_write
+get_tv
+
+
+
+
+Hardware access
+
+The following pseudo variables declared in the Note: All I/O chips are located in the system bank (bank 15) and can
+therefore not be accessed like on other platforms. Please use one of the
+not work!
+
+
+
+
+ The
+ The
+ Access to the ACIA (the RS232 chip) is available via the
+ Access to the CIA chip is available via the
+ The two 6525 triport chips may be accessed by using this variable. See the
+
+
+
+
+Loadable drivers
+
+
+Graphics drivers
+
+No graphics drivers are currently available for the Commodore 510.
+
+
+Extended memory drivers
+
+
+
+ A driver for the RAM in bank 1. Supports up to 255 pages with 256 bytes
+ each.
+
+
+
+Joystick drivers
+
+
+
+
+ Supports up to two standard joysticks connected to the joysticks port of
+ the Commodore 510.
+
+
+
+
+Mouse drivers
+
+No mouse drivers are currently available for the Commodore 510.
+
+
+RS232 device drivers
+
+
+
+
+ Driver for the 6551 ACIA chip built into the Commodore 510. 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
+ interrupt driven, and the transceiver blocks if the receiver asserts flow
+ control because of a full buffer.
+
+
+
+
+Limitations
diff --git a/doc/index.sgml b/doc/index.sgml
index f6ef30bee..dbfed2f56 100644
--- a/doc/index.sgml
+++ b/doc/index.sgml
@@ -120,6 +120,9 @@ Main documentation page, contains links to other available stuff.
Topics specific to the Commodore 64.
+
+ Topics specific to the Commodore 510.
+
Topics specific to the Commodore 610.