Blog

Flashing Border Colors on the Commodore 128 in Machine Language

Posted by on 7:44 pm in Knowledge Base | Comments Off on Flashing Border Colors on the Commodore 128 in Machine Language

In this screencast I’ll show you how to create the iconic flashing borders on Commodore machines. Back in the day, when the system was loading, this was a nice way to indicate that the computer is busy doing something rather than being dead. I’ll show you the principle both in BASIC and in Machine Language on the C128. The VIC-II chip is the same on the C64 though, so this will also work on the Commodore 64. The same approach can be used on the Plus/4, however the addresses for the border and background colours are different (decimal 65305,...

read more

Programmatic Loops in Commodore BASIC

Posted by on 7:42 pm in Knowledge Base | Comments Off on Programmatic Loops in Commodore BASIC

In this screencast I’ll demonstrate how to use programmatic loops in Commodore BASIC. I’ll show you how to use the FOR/NEXT loop (available in all versions of Commodore BASIC), as well as the DO/WHILE loops (available on the Plus/4 and C128)....

read more

Flow Control in Commodore BASIC

Posted by on 7:29 pm in Knowledge Base | Comments Off on Flow Control in Commodore BASIC

In this screencast I’ll explain the concept of Flow Control in Commodore BASIC. It’s kind of a video update of a post I did a while ago. In essence, it means that we can tell the programme to take a different route in the code depending on a condition that’s met. We’ll explore the IF/THEN and ON… GOTO/GOSUB statements (available on all versions of Commodore BASIC), as well as the expanded IF/THEN/ELSE version (available on the C128 and Plus/4 only). In addition, I’ll also show you how to use the BEGIN and BEND clauses that were introduced...

read more

How to run Commodore BASIC as a Scripting Language on macOS

Posted by on 7:26 pm in Knowledge Base | Comments Off on How to run Commodore BASIC as a Scripting Language on macOS

Did you know you can run Commodore BASIC v2 on your Mac and Linux systems as a scripting language? It’s true – thanks to the marvellous efforts of Michael Steil and James Abbatiello. They’ve adapted the original BASIC v2 as featured on the VIC-20 and C64 with additional routines so that it works natively on modern machines. It’s ingenious! You can get the full source code on GitHub – it works a treat! For those who don’t quite know what to do with it, here are some instructions that’ll help you get CBM BASIC up and running on macOS. Download...

read more

Writing HELLO WORLD in Machine Language on the Commodore 128

Posted by on 11:22 pm in Knowledge Base | Comments Off on Writing HELLO WORLD in Machine Language on the Commodore 128

The Commodore 128 has a built-in machine language monitor which makes it ideal for ML development. However, most (or pretty much all) documentation on this subject is geared towards the Commodore 64, making it slightly difficult to get a head start in writing ML code for the 128. Before I forget how to do it, here are a few pointers – courtesy of Jim Butterfield’s book “Machine Language – Expanded Edition”. Getting Started Let’s begin by typing MONITOR in C128 mode. It’ll take us to the machine language monitor. We’ll start our programme at...

read more

Thoughts on Windows 10 Upgrade Error 0xc190020e

Posted by on 3:55 pm in Knowledge Base | Comments Off on Thoughts on Windows 10 Upgrade Error 0xc190020e

My first generation Surface Pro only has 64GB of space, roughly 20 of which I’m allowed to use (the rest of it is kind of forever “lost in cyberspace” – or so it seems). It’s been running all Windows 10 updates fine until a few months ago, when Windows kept bugging me that the latest security patches needed to be installed. I was happily running Version 1703 up to that point and never had an issue with space limitations or deferring updates. Until early 2018, when Microsoft started  aggressively forcing the Fall Creator’s Update down my...

read more

Thoughts about the C64 Mini by Retro Games Ltd

Posted by on 7:12 pm in Knowledge Base | Comments Off on Thoughts about the C64 Mini by Retro Games Ltd

In Europe, the brand new C64 Mini has just been released. Although I don’t have one myself, I’ve been following the Indiegogo campaign and have watched several “unboxing reviews” on YouTube. I must admit it’s a neat little machine, and I like the idea of somebody making the Commodore days available to a new generation of users. However, I can’t stop thinking “what’s the point of this exercise?” Don’t get me wrong, it’s not that I dislike the idea of Commodore BASIC making a re-appearence, or of new Commodore “herdware” being developed. Quite...

read more

How to print Numbers as Columns in Commodore BASIC

Posted by on 4:10 am in Knowledge Base | Comments Off on How to print Numbers as Columns in Commodore BASIC

In this video I’m demonstrating how to print numbers in evenly spaced columns in Commodore BASIC. On the C128 and the Plus/4 we can use a nifty little function called PRINT USING for this, with which we can format the output of any printed text or variable. On the C64 and VIC-20 that function doesn’t exist, so we’ll have to convert a numeric value into a string (using the STR$ function), and then determine how long our string is. Following that we’ll have to manually pad our string value with as many spaces as are required. BASIC 3.5 / BASIC...

read more

Sorting an Array on the Commodore 64

Posted by on 2:17 pm in Knowledge Base | Comments Off on Sorting an Array on the Commodore 64

In this video I’ll demonstrate how to sort a numeric array on the Commodore 64. The same principle works for string arrays, and of course on all other Commodore BASIC computers. The technique I’m using here is called Bubble Sort: in effect we’re comparing the first two items in the array, and if the left one is larger than the right one, the values are swapped around. This loop continues until all items in the array have been compared and sorted (hence the smallest items “bubble” to the front of the array, much like the smallest bubbles in a...

read more

How to generate Lottery Numbers on the Commodore 64

Posted by on 4:39 pm in Knowledge Base | Comments Off on How to generate Lottery Numbers on the Commodore 64

In this video I’ll demonstrate how to draw random lottery numbers on a Commodore 64. The secret sauce here is not only the RND function to generate random numbers, but also two loops inside each other that prevent the same number from coming up more than once. Here’s the lottery generator code: 10 x=rnd(-ti) 20 for i=1 to 6 30 rn=int(rnd(1)*49)+1 40 for j=1 to i 50 if n(j)=rn then 30 60 next j 70 n(i)=rn 80 next i 100 print 110 for i=1 to 6 120 print n(i); 130 next 140 print 199 end To adapt this listing to match your local lottery, change...

read more