Home
Categories
EXPLORE
True Crime
Comedy
Society & Culture
Business
Sports
TV & Film
Technology
About Us
Contact Us
Copyright
© 2024 PodJoint
00:00 / 00:00
Sign in

or

Don't have an account?
Sign up
Forgot password
https://is1-ssl.mzstatic.com/image/thumb/Podcasts115/v4/d2/01/2f/d2012f8d-2bba-b9b1-e0e7-14a686e6e019/mza_12162428384170880572.jpg/600x600bb.jpg
Jay's Commodore Podcast
Jay Versluis
16 episodes
9 months ago
Join Jay Versluis for tips and tricks on programming in BASIC and Assembly on vintage Commodore systems.
Show more...
Technology
RSS
All content for Jay's Commodore Podcast is the property of Jay Versluis and is served directly from their servers with no modification, redirects, or rehosting. The podcast is not affiliated with or endorsed by Podjoint in any way.
Join Jay Versluis for tips and tricks on programming in BASIC and Assembly on vintage Commodore systems.
Show more...
Technology
https://wpguru.co.uk/wp-content/uploads/2018/08/Commodore-Podcast-Icon.jpg
How to run Commodore BASIC as a Scripting Language on macOS
Jay's Commodore Podcast
18 minutes 51 seconds
7 years ago
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
GitHub provides a convenient way to either clone a repository on your local machine if you have GitHub for Desktop installed, or you can download a ZIP file and unZIP it somewhere on your system. Once done, you should see a directory structure that looks exactly like the repo on GitHub.
Compile
You need a few utilities installed your your Mac to be able to compile files. Downloading Xcode will ptovide you with an excellent (and free) IDE as well as the command line tools needed to do that (gcc, make and several other goodies). You might be able to bring those components in using the Homebrew package manager.
Using your Terminal app, navigate to your unZIPped folder. It includes a MAKEFILE so there’s no need to mess with any parameters. Enter “make” at the command prompt, and after a few moments you should have a file called “cbmbasic” without an extension in the same directory. That’s the binary for your Mac.
To make it executable, we’ll have to tweak the file permissions – otherwise our operating system won’t be able to run it. We’ll do it using the chmod command:
chmod +x ./cbmbasic
You can test if it works by calling the binary without any parameters like this:
./cbmbasic
If all goes well you should see something like this:

For easy access, copy the binary over to your /usr/bin directory. That’s where common command line utilities are installed on Mac and Linux systems. The added benefit is that the path to that folder is already in your local $PATH variable, and as such you can simply type “cbmbasic” from any location when you’re on the command line.
Here’s how to copy the binary over (this will ask for your administrator password):
sudo cp ./cbmbasic /usr/bin
Using Direct Mode
When you run the binary it will bring up something like the standard BASIC command prompt we’re used to seeing on the Commodore 64. There are however a few important differences between a C64 emulator and this implementation:

* this is NOT an emulator
* cursor keys DO NOT work
* all commands typed in must be CAPITALISED

Other than that, you can start typing like on a real machine. Be careful with certain POKE commands though as those may call system routines that might not be implemented.
LOAD and SAVE commands have been tweaked to reference the command line structure. They work just fine, but will load and save files in Commodore file format (which is not clear text ASCII – more on that later). For example:
LOAD"$"

LIST

0 "/Users/versluis/Desktop/cbmbasic" 00 2A
4    "."                PRG  
2    ".."               PRG  
2    ".git"             PRG  
567  "cbmbasic"         PRG  
7350 "cbmbasic.c"       PRG  
593  "cbmbasic.o"       PRG  
19   "cbmbasic.vcproj"  PRG  
20   "console.c"        PRG  
3    "console.h"        PRG  
8    "console.o"        PRG  
4    "glue.h"           PRG   
Jay's Commodore Podcast
Join Jay Versluis for tips and tricks on programming in BASIC and Assembly on vintage Commodore systems.