A proper account of the deplorable life and times of the LIST routine in Commodore BASIC.
In our last installment we had a closer look into the tokenizer routine (also known as CRUNCH) in Commodore BASIC. This time, we follow up on this by a closer look into the reverse operation, namely the “LIST” command, which — among other things — has to expand the various BASIC tokens into human readable keywords back again. What could possibly go wrong?
Curious adventures in (Commodore) BASIC tokenizing.
No, this is not about a one-hit-wonder from the charts of 1977, rather, it is about something that could have happened on a Commodore PET around this time. For this installment, it’s all about #BASIC tokenizing, and, as this promises some #6502 fun, we really ought to investigate…
There are times when your 6502 code doesn’t behave, where it steers off of its path into directions, never intended, when it runs away. The new debugging traps for the PET 2001 emulator are meant for exactly those times. And they may be helpful for reverse engineering, as well. Simply put, they are for those “How did we end up here?” moments. And the “Holy electron, Batman, what’s happening?” moments, as well.
WDC and Rockwell related additions to the 6502 instruction set sheet.
Just added Western Design Center (WDC) and Rockwell extensions to the standard instruction set of the 6502 processor to the well-received 6502 Instruction Set page. There’s now an additional view option for the instruction table, as well as new sections providing details on WDC 65C02(S) specifics and Rockwell extensions (linked at the top of the page) for their respective variants of the venerable 6502. Moreover, in order to avoid confusion, the section on “illegal” opcodes is now marked as specific to the original NMOS version.
While WDC’s 65C02 is really the only version of the 6502 still in production, the fact that WDC-datasheets are neither the clearest, nor the most complete, may have contributed to a relative obscurity of the additional instructions and behavioral differences. Maybe, including them in a one-stop documentation will help, just a bit? Or even eight? ;-)
Also, as a minor improvement, the page should be now easier to tab through (lots of tabinidces).
The original line-up of Commodore PET computers at a glance.
While Commodore PETs are quite easily and unmistakably identified by their unique form factor, the basic model evolved quite a bit over the years. Here’s a comprehensive guide to the various models of the original line-up (not including the later series with rounded case and separate keyboard) and their basic features.
1 REM ***** 2024 X-MAS DEMO *****
2 REM HTTPS://WWW.MASSWERK.AT/PET
3 REM ***************************
4 SYS 1140
This year’s seasonal tribute: a PETSCII animation based on a popular cross-stitch pattern. Users are kindly requested to imagine that trademark eerily fluttering 1950s UFO sound effect that I find hard to achieve on the PET’s “CB2” sound*.
Ingredients: MOS 6502 assembler, PETSCII graphics (rendering at quarter blocks), CB2-sound.
Requirements: any 40-columns PET, any ROM version, any RAM (4K or better).
*) In case you were to ask, “What is CB2-sound?” Well, the PET doesn’t feature sound, at all. But you can hook up a speaker to the output of a serial shift-register, creatively named “CB2”, which may be manipulated to output audible frequencies, sampling sound by a single bit at 1 MHz. This is CB2-sound.
The famous wiring diagram for CB2-sound on the Commodore PET from the “Space Invaders” game. Later PETs included a built-in speaker, connected in the same fashion internally.
*****
The already tradional PET recreation of an animated screen of the 1982 Christmas Demo for the C64 has also received an update: it now fits into 4K of RAM and allows for easy updates, as the year is now stored in a dedicated variable at the very top of the BASIC program text.
100 REM PET 2001 - SEASON'S GREETINGS
110 REM NORBERT LANDSTEINER, 2017-2024
120 REM <WWW.MASSWERK.AT>
130 Y=2024:REM YEAR (You may set Y to zero to omit the output of the year entirely.)