Below you will find pages that utilize the taxonomy term “VIC-20”
Adding very large integers in 8 Bit BASIC
As we’ve discussed, large integer math is a pretty interesting problem, even for modern computers.
What if we wanted to add very, very, very large integers without using scientific notation, but this time let’s do it extra slowly. Extra slow… this seems like a job for BASIC!!
Strings
We’re going to need to use strings. On the Commodore BASICs of the 80s, strings have a max length of 255, so the largest sum we’ll be able to represent is:
VIC’s Revenge, the drop-in replacement for the VIC-20 VIC chip Part 1: Introduction, design goals, and FAQs
I’m doing a year-long project to reverse engineer the output and functionality of a VIC-20’s video chip, and create a drop-in replacement. At the start of this project (a few days ago), I only actually know how to do a percentage of the things I’ll need to complete this project. Writing a long series on how things work as I learn will help the project along. Plus, maybe having all of this information in one place would be nice, right?
Vicky-20 S Video Mod Results
I’m very pleased with my PAL VIC-20 replica, the Vicky-20. It’s almost a year old and the VIC-20 that sits on my desk all the time.





I’ve wanted the absolute best video out of this thing I could muster. This board is fortunately VERY easy to modify.

Connections
Sure, you need an S-Video Cable for this. You can use a 5 Pin DIN to RCA jack from the Amazonies for a few bucks. This works without modification with my RetroTink 2X Pro
Yet another version of the 100 door problem; this time, let's extend Commodore BASIC to add PRINT @, shall we?
I stumbled across a ZX Spectrum version of the 100 Door problem that got me thinking. Wouldn’t it be nice to have PRINT AT
in Commodore BASIC?
We do this in Assembly all the time.
We already know from several previous articles that moving the cursor is pretty straightforward using a Kernal routine:
Load the row number in X, the column number to Y, clear carry, and jump to $fff0
. Simple.
The terrible random number generation in the Commodore 64 (and 128)
Quite a while ago, I started playing with random numbers on 8 Bit machines. I don’t think anyone is doing “serious” work on these machines, but playing with Ciphers and Crypto got me at least curious about how a Commodore 64 generates random numbers.
There are many ways to determine randomness. Humans are pretty good at picking out patterns in visual representations. Luckily our beloved machines have easy screen memory access. Let’s poke some random stuff to the screen and see what we see.
Permutations of 1 to 9 in Python, BASIC, and 6502 Assembly
Someone asked me this week if I would help him with a graph theory problem on 8-Bit machines. The first task was to get all permutations of 1 to 9. Since the total permutations is 9! (362,880) I knew this would take a while.
Learning without learning, the standard library problem
There are no shortcuts to pretty much anything worth doing. If you fail to learn the basics, then when you get to more advanced things, the basics will feel like black magic, and the thing you’re working on will only make sense on the surface.
Can you do Advent of Code on 8-Bit Machines?
There’s a wonderful yearly online event called Advent Of Code (#adventofcode). Each day there are two code challenges that follow a holiday narrative. Some of them are easy, and some of them are quite difficult.
This year I’ve attempted to do as much of it as I can on 8-Bit Machines. Mostly Commodore 64 because it’s what I know the best, and also what I like most to actually code on.
Calculating Pi via the Gregory-Leibniz series in BASIC on the Tandy Color Computer 2
Back in March, we did a simple set of programs to brute force calculate Pi using a simple and well-known series. It works, even if it’s inefficient.
Speaking of inefficient, it’s September and that means it’s time for #Septandy! I have a Tandy Color Computer 2 - 16k of RAM version. There are versions of this machine with more RAM and an enhanced version of BASIC called “Extended BASIC”, but I’ve had this machine since the 80s and it is the most entry-level version Tandy made.
Just for fun, the 100 door problem on several different systems
What’s the 100 door problem?
It’s a just for fun problem in “beginning” math and computer courses. The idea is simple:
There are 100 closed doors in a row.
You walk past the doors 100 times (100 passes)
The first time, visit every door. If the door is closed, open it. If it is open, close it. In programming, you’d probably call this toggling the door so let’s call it that.
Running Commodore 64 BASIC Programs on a PET
The Commodore 64 and PET are fairly similar systems. Other than a few memory location differences, many BASIC programs written for the Commodore 64 that don’t use graphics can run on a PET.
There is one caveat. The PET doesn’t relocate a saved BASIC program to the beginning of BASIC, like all of the Commodore lines after it. So if you find yourself trying to load a program on your PET written on one of its younger siblings, you may wonder why it loads, but you can’t find it.
Making and breaking Ciphers on the Commodore 64, er VIC-20 - Lagged Fibonacci Sequence and a little Monte Carlo while embracing contraints
We’re on ANOTHER random number generation technique today. Let’s work on the Lagged Fibonacci Sequence, a fun way to use the Fibonacci Sequence on itself to generate pseudo-random numbers.
One of our long term goals is to add a bunch of tools to our toolbox. Making reusable components makes doing more complicated things easier. You can rifle through your toolbox in hopes of an “Oh, I already have something we can use for this part!”.
Quick Post: Modulus in BASIC 2 without a cartridge
I posted this on Twitter a few weeks ago, but a young lady has been exploring programming in Python and also with Commodore BASIC which is pretty neato. She’s 11 and asked if there was a way to do modulo functions on Commodore BASIC because she’s using her Dad’s VIC-20 and Simon’s BASIC is obviously not available for the VIC-20.
The answer is pretty simple and will actually work in most programming languages.
If we wanted to do A mod B
(or A%B
in a lot of newer programming languages) we can do it in one line. We’re really just looking for the remainder of a division that we’ll call R