Re: C64 Runtime for UNIX?

Re: C64 Runtime for UNIX?

From: Michael Steil <>
Date: Thu, 2 Apr 2009 07:03:45 -0700
Message-Id: <>
On 2 Apr 2009, at 06:33, Spiro Trikaliotis wrote:
> I think you both are missing one aspect: The CBM BASIC 2.0 which can  
> be
> compiled with Michael's sources is *not* the C64 BASIC 2.0.

"cbmbasic for UNIX" is "COMMODORE 64 BASIC V2". It was created from  
the code and data taken from $A000-$E4B6 in the C64 ROM.

> The C64
> BASIC 2.0 (which is almost exactly the same as the VIC20 BASIC 2.0)
> seems to be a BASIC 4.0, where commands were removed again.

Correct. Commodore took the bugfixed version V4 from the PET, removed  
all keywords that were introduced between V2 and V4, and used it on  
the VIC-20 as "V2". WIth Commodore BASIC, "V" doesn't strictly stand  
for "version", but is an indicator of the feature set. The Plus/4/C16/ 
C116 had BASIC 3.5, which was another V4-derivative.

> So, you
> might get some behaviourial differences to the C64 BASIC.

There might be some behavioral differences between PET BASIC V2 (PET  
2001 from 1979) and "cbmbasic for UNIX", yes, but there should be none  
between "cbmbasic for UNIX" and "COMMODORE 64 BASIC V2".

> Furthermore, note that I would say that the speed penalties of VICE  
> (or
> other emulators) are mainly because of the emulation of VIC, SID, CIA,
> and the floppy. I don't think the CPU itself is the biggest culprit.  
> So,
> your advantages might be limited.


> Having said that:
> VICE already has the "virtual device traps". With them, it emulates  
> some
> IEC routines in the emulator core instead of directly by emulating the
> 6502 instructions. It should not be that much work to use the same
> approach to "connect" a BASIC 2.0 emulator to VICE.

Connecting VICE's high-level 1541 emulation to cbmbasic would be a  
quite useful first step. cbmbasic can do LOAD and SAVE (without caring  
about 1541 semantics) and can do a LOAD"$" (emulating the 1541  
layout), but it doesn't support the 1541 command channel etc. - well,  
it doesn't even do standard (non-1541) character I/O.

> Of course, one question remains: Is it worth it? How many  
> (interesting)
> programs consist only of BASIC, and would benefit from this?
> Furthermore, switching off all features not needed in your preferred
> emulator should speed up your program by a considerable factor.

On a 1 GHz machine, cbmbasic reaches a 1000x speedup compared to a  
stock C64. This is way beyond what any 6502 interpreter offers (VICE:  
~20x-100x). And no C64 emulator hooks into stdin/stout or supports  


       Message was sent through the cbm-hackers mailing list
Received on 2009-04-02 16:27:39

Archive generated by hypermail 2.2.0.