Re: [cc65] cc65 + tcp/ip howto and/or example

From: Gábor Lénárt <>
Date: 2011-01-03 14:17:18
Hei Karri!

On Mon, Jan 03, 2011 at 02:25:28PM +0200, Karri Kaksonen wrote:
> On 01/03/2011 12:53 PM, Gábor Lénárt wrote:
> >It would be so nice if cc65 has some kind of library for some TCP/IP...
> TCP/IP just eats up all the memory.

For sure, that's why I've written that the "standard POSIX API" would be
somewhat overkill for a platform like Commodore 64. However still, it would
be cool to have some kind of "standard" CC65 library (standard= standard
when you're using cc65 at least, hehe) to devolope tcp/ip applications, even
if API is totally different like POSIX/UNIX like API.

> Sending out strings in wml and reading responses would be doable on
> a small machine with 64k of RAM. Besides, you could use the
> tgi-library and the serial-library as a basis for a wap-browser.
> Connected to the serial port you could then have some serial to
> Ethernet dongle taking care of the TCP/IP stack. Or you could even
> implement the connection using the socat-command on Linux.
> A small Linux-board at goes for around 60€ and it
> has all the hardware required for connectivity over wire, wifi or
> 3G. (And it also has the serial port for connecting to cc65.)
> As no cc65 comes with Ethernet ports anyway I see no reason to build
> in a TCP/IP stack in the cc65. It makes much more sense to use the
> memory for the browser or the multi-user game.

"No cc65 comes with Ethernet ports"? Do you mean C64 here? Well, there is
TFE for example, so there is at least one existing real Ethernet hardware
for C64.  And as far as I know, only Contiki is the software (well, OS)
which uses it (and it's compiled with CC65 for C64 at least - AFAIK - it
uses uIP).  I've checked IP65 out, and it seems to be quite cool, that you
can produce quite short (in size) applications doing some TCP/IP.  What I
mean here is not to write a full web browser (well, only text parts), but I
would need something like a "downloader" which generates a HTTP request and
saves the result onto disk, and that's all.  As far as I can remember IP65
has an example which does it (well, not so much saving the result onto disk
but printing on the screen at least), and it really works, also it's not a
too huge application either.

Of course - as I've mentioned above - I was not serious to have a POSIX-like
API for TCP/IP because it really needs more resources to implement, but as
uIP shows (and eg.  Contiki if we're talking about an OS), it's possible to
do TCP/IP even webservers (with steaming audio, btw!), and other
applications on a stock C64 with only the TFE hardware (so no "cheating"
that you use a custom board, or a Linux box with serial port: the cool thing
when really the C64 can do even the ARP requests and programming the
Ethernet I/O stuffs on the cartridge).  I have no real TFE at the momement,
but indeed these seem to work with VICE (it has TFE/RR-Net emulation), I
could even ping the emulated C64 on a real ethernet network.

The only reason I don't use uIP as contiki does, that it seems to be a bit
complex for me, but it's my fault, for sure. IP65 seems to be a smaller and
easier-to-learn (but not fully finished, as far as I can tell/understand)
solution, but some kind of "CC65 binding" (so you can use it from C too)
would be cool.

Currently, I have no plans to write advanced applications like "wap browser"
or anything, just a simple "downloader" application and similar things,
without too advanced user interaction. There, the HTTP request itself can
fit into one packet, only receiving the answer needs some work, I guess.
Currently, I am working on a very simple own test (trying to do as much
things as possible by myself, and not depending too much on IP65) which can
send a basic HTTP request and waits for a short answer which can fit into
one packet, so only the basic TCP/IP handshaking is needed for this work.

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Jan 3 14:17:25 2011

This archive was generated by hypermail 2.1.8 : 2011-01-03 14:17:27 CET