Back to BASIC
Recently, I went to BASICs and I found it fascinating. It is much more interesting programming paradigm then compiled languages development as C like languages since you can program in BASIC interpreter and in assembly at once and get feedback instantly. Also, 6502 CPU is quite easy to understand and memory mapping of the 6502 is also straightforward and interesting to play with.
The only issue is that I find it tedious to type the code in the Commodore 64 emulator directly. But there is a solution, it is possible to import files in D64, RPG and other formats that the emulator supports. It means that you can write BASIC or assembly code in your favorite editor and then import it.
How can you do it?
To be able to do this it there is a need to convert the text file to a format that is supported by Commodore 64. If you search you’ll be able to find a number of tools that people wrote to do just that. Since I have a PC with Windows 11 so I am using a Windows based tool. This tool is called C64List and it comes in handy to be able to convert BASIC files into text files and vice versa.
Prerequisites
Operating System: Windows
Download and extract C64List tool
(Optional) Review supporting documentation file with a very detailed and helpful
A text file with BASIC code
Let’s do it
- Download and extract the C64List tool.
- Extract the zip file where you want it and review the contents of the folder
Inside you’ll find the tool itself and if you need to know how to use it in more detail there is a user guide.
Now let’s create a text file with the BASIC code and then convert it using C64List tool.
Now let’s convert it to PRG format that Commodore emulator can import.
- Open Windows Command Prompt (aka cmd).
- Run the command below to convert the text file to prg format.
C64List basic.txt -prg
If it worked correctly you should see similar output
If you review the folder you’ll find a new basic.prg file created
If you open that file as hex dump you’ll see something like below
Now let’s go to the Commodore 64 online emulator website and import our file.
And then drug and drop that basic.prg file into the drop field on the website as shown in the screenshot below
What you’ll see that the emulator window above will show that it started to load a file
As you can see the file was imported correctly and the lower case lines 30 and 40 in the original text file were converted to upper case in PRG file.
Below comes the video of the process above.
Take care.