Writing fast Commodore 64 Basic code

Introduction

Commodore 64 Basic was written by Microsoft. They managed to squeeze in a full programming language in a quite small ROM. They also managed to write full support for floating point arithmetic, as opposed to integer arithmetic which was the standard in Basic for microcomputers back then. However, in order to make room for the more complex floating point arithmetic, they had to throw out integer arithmetic completely. This, of course, is one of the reasons why C64 Basic ended up being rather slow. Also, it's an interpreted language, and those are usually quite a bit slower than compiled languages.

However, even when programming in C64 Basic, there are always choices you can make which will affect the speed of execution. I will try to summarize what I have found out.

Parts


Fredrik Ramsberg, 2019. microheaven.com