Commodore 64 KERNAL, modified to run on the Atari 8-bit line of computers

:slight_smile:

This is the Commodre 64 KERNAL, modified to run on the Atari 8-bit line of computers. They’re practically the same machine; why didn’t someone try this 30 years ago?

Via a Hacker News Post

2 Likes

Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should… :sweat_smile:

3 Likes

Well, the Atari 8-bits had a CPU speed that was 80% faster than the PET (albeit the video chip stole a lot of cycles so the speed advantage was modest). It would be funny for the fastest PET computer to be an Atari 800.

3 Likes

Wow!

Just wow!

I’m amazed this is possible even with modern tools.

I assume it is running a version of c64 basic? If so is someone out there willing to run my bench suite against it?

1 Like

Here’s a video from “8-Bit Show And Tell” showing the system in action and also running some basic (pun somewhat intended) comparisons with the real C64.

@MauryMarkowitz Yes, this is Commodore BASIC 2 and the C64 Kernal and the character ROM ported to Atari 8-bits with some tweaks applied to make keyboard and screen IO working on the Atari.

@IsaacKuo Yes, it’s slightly faster, see the video.
The real comparison would be against a PET with BASIC 2.0, since Atari64 doesn’t implement color RAM due to significant differences in hardware, which is stealing some cycles on the C64.

3 Likes

So I ran the “10-PRINT Benchmark™” on my PET 2001 emulation with following results:

            ATARI64   C64   PET 2001*
NO SCROLL    10.1    11.88   13.31
SCROLLING    10.43   12.53   13.65

*) Emulation, V-blank is implemented as a mere estimate by a timer (not necessarily cycle correct, esp. with Spectre-mitigations in modern JS runtimes), which may affect print timing. Exact timing may vary between runs due to Spectre-mitigations adding some random to any timers (don’t look too closely at the 1/100 secs).

Here’s a direct link to the program: [Commodore PET 2001]

If this coincides with real hardware, it may be interesting to see where the PET loses out in comparison to the C64. However, there’s significantly less penalty for scrolling, more similar to Atari64.
(There’s no difference between ROM 1.0 and ROM 2.0 on the PET 2001. – Append “&rom=1” to the above URL to run the program with the early ROM set.)
Edit: The PET is probably losing time while waiting for V-blank for printing (compare the infamous “Killer Poke”). I suppose, the C64 doesn’t do this.

2 Likes

Commodore Basic 2 is actually relatively easy to make work - but I say that as someone who did it a while back when all the sources to MS Basic (6502) were published. I made Commodore Basic 2 work on my Ruby 6502 SBC.

What didn’t work was “KERNAL”. So what I didn’t get was all the screen editing stuff that (I think) is the majority of what it provides - without it, it just relied on my RubyOS character in/out and line editing features. (and of-course the video hardware, sound, etc.)

So adapting KERNAL to work on different hardware was, as far as I see it, the hard part, but what I’m wondering is why it took so long :wink:

-Gordon

2 Likes

This is a nice article!

BTW, is it officially “MSBASIC level 2”? (Isn’t “level” in this context a rather British term?) – I actually do have no idea.