Silent Q

Azog's little slice of the world. Whee.

Commodore PET web browser?

Posted By on October 1, 2012

In a previous post, I talked a bit about the Commodore Flyer.

There are a number of Ethernet devices available for Commodores, such as the 64NIC or the RR-Net, but these are all memory I/O based. The Flyer instead uses Commodore device channels to communicate with the network.

For me, this seems to open up a whole lot of possibilities that may not be practical with the 64NIC/RR-Net stuff, because each and every individual program needs to be “net aware”, while with the Flyer, you use standard Commodore device commands (OPEN, GET, etc).

The network device appears as #7, and you can open, read and write to this just like any other Commodore device. There is even a command channel, sub-address 15, where you can issue net specific commands.

On the Retroswitch web page are a couple of demos of network-aware programs: irc and telnet. But since web traffic is just another protocol, would it be possible to have a Commodore PET web browser?

Of course, I am using the Hack-a-Day retro challenge as my example…

Fundamentally this is pretty easy: open a channel to a URL, read the incoming text, and process it. I wrote a short BASIC program which is probably the crudest HTML processor you’ve ever come across…

You’ll excuse the spaghetti code. It’s unavoidable in a language whose only conditional is a simple IF, and whose basic control flow consists of GOTOs and GOSUBs. Niceties like “do while” didn’t exist yet…

Some comments on the actual code:

Line #1 sets the lower case. This is in conjunction with line 61, which converts from ASCII ATOZ to PETSCII ATOZ. I needed to do this to ake sure the “if” statements in 600+ would process correctly.

Line 35 sends the string to the open network socket; line 40 is for the network processor (secondary device 15).

From there, it simply grabs characters between < and > (HTML delimiters) and does some very simple processing in lines 600 and up.

Given the limitation of the hardware, I did not go all-out. There is only 1k of video memory, and 32k of RAM, so you probably would not be able to implement buffering to allow scrolling. There’s not many text formatting, so things like bold and italic, well, use your imagination.

It’s also VERY SLOW. You probably could re-write it in machine language for speed, and add a few more parsers.

Check out the Flyer documentation for some more interesting possibilities.

Edit: I made the Hack-a-day front page!, and just for that occassion, I made a short video of this:


Comments

3 Responses to “Commodore PET web browser?”

  1. [...] the subject of finding a proper web browser, [azog] loaded up the retro site with a Commodore PET. There aren’t any web browsers for a PET, you say? Well, [azog] had to make [...]

  2. MSD says:

    You should add a newline if possible.

  3. azog says:

    I did add a CRLF, but it still behaves the same way. I think that due to one of the HTML tags I’m not parsing, either table tags, or header tags.

Leave a Reply

Please note: Comment moderation is currently enabled so there will be a delay between when you post your comment and when it shows up. Patience is a virtue; there is no need to re-submit your comment.