<!doctype linuxdoc system>

<article>
<title>Picocomputer 6502 - specific information for cc65
<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">

<abstract>
An overview over the Picocomputer 6502 and its interfaces to the cc65 C
compiler.
</abstract>

<!-- Table of contents -->
<toc>

<!-- Begin the document -->

<sect>Overview<p>

The Picocomputer 6502 is a modern W65C02S computer with a custom operating
system designed to be POSIX-like. The reference design includes a W65C02S,
W65C22S, RP6502-RIA, and optionally a RP6502-VGA. Peripheral devices like
keyboards, mice, and flash storage are connected by USB to the RP6502-RIA.
Audio is generated by the RP6502-RIA. Video is generated by the RP6502-VGA.



<sect>Binary format<p>

The standard binary output format generated by the linker for the RP6502 target
is a plain machine language program without any prefix or postfix.

The RP6502 Integrated Development Environment, based on Visual Studio Code,
will convert the cc65 binary output into RP6502 ROM files that can be loaded
directly from the RP6502 monitor or installed on the RIA to be loaded at boot.



<sect>Memory layout<p>

<descrip>
  <tag/Stack/
  The C run-time stack is located at &dollar;FEFF, and grows downward.

  <tag/Heap/
  The C heap is located at the end of the program, and grows toward the C
  run-time stack.

  <tag/RAM/
  RAM is located at &dollar;0000 - &dollar;FEFF. Default binaries load and
  start at &dollar;0200.

  <tag/ROM/
  The RP6502 is designed with no ROM in the 6502 address space.

  <tag/VIA/
  A Versatile Interface Adapter (6522) is 16 registers located
  at &dollar;FFD0.

  <tag/RIA/
  The RP6502 Interface Adapter is 32 registers located at &dollar;FFE0.

  <tag/User/
  User I/O expansion is from &dollar;FF00 to &dollar;FFCF.

</descrip><p>



<sect>Platform-specific header files<p>

Programs containing RP6502-specific code may use the <tt/rp6502.h/ or
<tt/rp6502.inc/ include files.



<sect>License<p>

This software is provided "as-is", without any expressed or implied
warranty.  In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
<enum>
<item>  The origin of this software must not be misrepresented; you must not
        claim that you wrote the original software. If you use this software
        in a product, an acknowledgment in the product documentation would be
        appreciated, but is not required.
<item>  Altered source versions must be plainly marked as such, and must not
        be misrepresented as being the original software.
<item>  This notice may not be removed or altered from any source
        distribution.
</enum>

</article>
