Problem with PETCAT for CBM-II Basic
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
It seems PETCAT (v3.10) can't differ BASIC v4.0 for the PET and BASIC v4.0 for the CBM-II. It knows only the first option. It would be great to add support for the second.
C64-Wiki calls this version 4+ - https://www.c64-wiki.com/wiki/BASIC#Overview_of_BASIC_Version_4+_Commands
Thank you.
good catch, there are some comment in the code that indicate the two are the same - but obviously they are not :)
(if you could point at a complete token list, with their absolute values, that would help a lot)
Hi
I wrote a small program 'gentokens.c' that generates a Basic program that uses the all possible token numbers from 128 to 255. Then I loaded the generated program 'tokens.prg' into the VICE emulator using 'xpet tokens.prg'. Then I type
OPEN8,8,8,"TOKENS40,S,W"
CMD8
LIST-218
LIST220-236
LIST238-
PRINT#8
CLOSE8
This made the TOKEN40 file on the virtual FS I used. Then I slightly processed the file and got the result list of tokens in 'tokens40x.txt'.
I did the same procedure using 'xcbm2 tokens.prg'. However sometimes it didn't work. It seems there is a tricky error in this emu. The list of tokens I got with
LIST-232
and saved it after the similar processing in 'tokens40+x.txt'. However it seems 'xcbm2' has another bug, I couldn't use the virtual FS. :( So I had to attach a disk image file. I had troubles with a D80-image but I could persuade the emu to work with a D64-image. Sorry I am not going to open a ticket for these bugs. But I hope that my report will be noted.
I also hope this can help to improve PETCAT v3.11.
Regards,
Last edit: Vladimir Lidovski 2026-06-22
Thanks!
I also found this: https://github.com/mist64/cbmsrc/blob/master/BASIC_CBM2_1984-01-04/tokens
Sould be possible to produce a proper list with this
In the 'RESERVED WORD LIST', there are the same keywords as in 'tokens40+x.txt' and they are in the same order. However it seems there are some problems. For instance, the 'tokens' document claims that there is token $AB for the plus sign but type
10 ?1+2
in 'xcbm2' and check the expression in VICE monitor. It shows token $AA for the plus... It seems they also missed the token for the pi sign.
I came up with this so far, does that make sense? :)
It seems that the extra keywords for the CBM II start from the position 219 (DCLEAR, $db). I am also unsure about ancient Basic v1.0... It is about the common CBM Basic keywords.
and here is a patch, completely untested :)
Have you checked my previous post?
I'll check against xpet now... the existing comments seem to be slightly inaccurate then :)
can you test the patch?
How? I can only repeat that
"dclear", "bank", "bload", "bsave"
are not part of the xpet Basic v4.0.
Yes you are right, i just wanted to confirm it for myself :)
And now... i'd like to see this supposed "Basic v4" for the C64 too, so i really do the right thing ....
check r46151 please
It seems to work, but I haven't carried out thorough testing.
Thank you.
Let me add one more suggestion. In my opinion, it would be better to use '{pi}' rather than the tilde sign in the output for the -k option.