Note: If you experience issues running the assembly code it's likely due to an issue with the latest version of CBM prg Studio. (Thanks to Roy Meredith for his help reporting and testing this issue, check out his youtube channel: ua-cam.com/users/roypmetedith, he does remixes of classic video game music and various other game projects) You can download the older version of CBM prg Studio from my dropbox, link in description.
First off, thanks for a great beginner's tutorial. At 10:40 the only caveat would be that the compiled prg file is 2,083 bytes, whereby most of that space is unused. I found that by omitting the base (org) address reference in code and then specifying $810 as the start address under Tools, Generate Sys() Call, the BASIC header bytes that are inserted toward the top will allow the SYS call to jump over them and continue seamlessly where the rest of ML code starts. The prg file will also compile down to just 51 bytes and the string should print properly. In this way it is not necessary to specify two org addresses and there is no need to think about how much of a gap to provide. Regards.
Hello, thanks. You shouldn't think of it as wasted space, it's just available memory. The way prg files work is that the contents must be continuous memory space, so when you build the sample it will go from $0801 until $10xx. So sure if it was important to make this specific file as small as possible then you are correct, but somewhat pointless in real projects where you use most of the memory including bank switching. It's much more important to plan your memory usage and configure the VIC memory space correctly for where you want your screen, sprites and charsets in memory. Then you can use a prg compressor like Exomizer to make your prg much smaller, for example my conversion of Rally-X (thestuffmade.itch.io/rally-x-64) the prg is around 62 kb, but after compression it can be as small as 22kb, but then again a few kb of saved disk space doesn't mean anything these days. Cheers, Jake
Hello. I see that there are many people of my generation; I really like that. It seems like a meeting between boys, after a long time. Thanks for bringing the C64 back. Hope you upload more videos. Greetings from Argentina, and I thank you.
Thanks for this tutorial, I appreciate your effort to share this! Clear, straight to the point, and you know what you’re talking about. Exactly what I wanted to find.
I would have liked to have programmed C-64 with assembly language in 1989 however there was little in way of text books on subject at my local libraries, bookshops & the technical institute I was studying microprocessor technology. Only info on this topic I had access to was for 8086, & 6809 microprocessors. CBM development environment & C-64 emulator looks excellent for program development & SD2IEC interface ideal for loading files direct to C-64 mainframe. Thanks for info on setting up. I will subscribe & look for your more recent uploads on C-64 assembly code programming.
OMG what timing, I just started refurbing a 64 after 30+ years with the intent to get the RPG I was working on in the early 80's up and running. I had map code done in Assy for speed and was planning to write the game itself in basic. I look forward to watching these videos!
@@TheStuffMade @TheStuffMade First I need to get back up to speed. I did my "Assembly" programming using a HexMon cartridge so I didn't even have an assembler. I recently found my disks (Fortunately several of each) and a hard print (4.5 inches wide with tiny type from my old 1520 printer no less). Do you have any suggestions for an environment that will work well on the machine itself or is a PC based IDE the best option?
@@RavenWolfRetroTech No worries. I'd highly recommend doing the development on PC, it will save you a lot of headaches. Then you can generate a prg file with your work and run it on real hardware, either using one of the SD card solutions (e.g. SD2IEC) or if you have a 1541 and want everything to be authentic you could use something like the ZoomFloppy interface to connected the drive to your PC and copy the files.
@@RavenWolfRetroTech I wouldn't want to start Assembly coding w/ CBM Prg Studio. It's meant for people who already know a lot about the C64's inner workings, sprites, bitmaps, character sets etc. I needed to read a book about Assembly first and practice w/ the 'Turbo Macro Pro' assembler on a C64 (emulator). "Professionals" who want to make cutting edge games use CBM Prg Studio (or C64 Studio , not related).
@@meneerjansen00 I used to know a lot about the inner workings and assembly on the C64 and Amigas. Now, not so much but I am hoping it comes back to me quickly
@@TheStuffMade not everything! You ever try to send a digital camera picture to somebody in 2002 .... LOL well, nobody knew how to open the weird file formats let alone have an internet connection. They use dial up which comes on a free CD! haha 42K Modem etc. Those were the days, having computers chirp instructions to each other using a phone! These days we send terabytes every week without a second thought. Back then it took hours and hours to send a single picture! Computers were in their infancy back then, and we're starting now to see just what miracles we can achieve using the things :)
@@DailyCorvid Yeah, miracles like pet videos and girls shuffle dancing... 😄 ...and being fed up of everybody posting daily garbage which leads us people back to those simpler times where everything was about learning stuff and not abusing stuff. 😉😉
A lot of people, including myself, are stuck at home these days, so I thought it would be fun to try program the good old Commodore 64 again. This video is me sharing my experience to make it easier for others to get started on the C64. Content: 00:00 Intro 00:55 Software - CBM prg Studio 01:42 Software - Vice Emulator 02:00 Configuring CBM prg Studio 02:38 Create a project 03:05 Write a BASIC program 04:24 Write a program in assembly 05:59 Write more complex assembly programs 10:47 Resources 12:37 Ending
It's fun to see you use the same sources I do for opcodes and memory map. This ide is very popular among C64 devs, however I still use notepad++ and 64tass as cross asm
It's so much easier these days with these great online resources, back in the day it was books or experimenting until you got the result your were looking for. I chose to use the CBM prg Studio IDE for this series because it's so easy to use and get up and running, sure there are more powerful solutions once you reach the advanced level, but for beginners, you can't beat that IDE. Cheers, Jake
Not exactly, I had zero clue what was going on from the start, and proceeded to only get more lost from there on out 🤣. It may be everything you need to know to get started if you have some degree of experience with coding but if you have non it's just jibberish. I grasped the hello world bit, then nada
3 роки тому
The C64 was my first computer ever. I was 8 years old and it brings me so many memories back just starring at the blue screen.
Pretty good! much memories, really great.....i was programmer for Ahoy! magazine... at mid 80´s! I wrote some games and bunch utilities for the 64 in those years. Im in nostalgic mode now... hahaha!
There is a new development package for the C64 called VISION BASIC. It compiles on the fly and makes stand alone programs for stock C64's plus a whole bunch of other cool things.
Yeah it seems something is not compatible between the latest CBM studio and VICE emulator. I have a link in the description with previous version of CBM studio, it works fine with VICE 3.5. Cheers, Jake
At 2:30 where he adds the emulator go to emulator parameters and add -autoload before the %pro otherwise vice with automatically run the program instead of just loading it.
I noticed that you have 'rts' on line 5 (after 'jsr write_string'). So I'm guesstimg that 'sys 4096' is also a subroutine call to address $1000 (in the basic assembly)?
I'm having a problem following the tutorial. When I made the .bas file and clicked the generate and launch button, the emulator launched and in a few seconds it automatically ran the file, differently to your video. I just shrugged and thought it was a nice feature. But when it was time to test the .asm file, clicking the generate and launch button did the exact same as when launching the .bas file. Without giving me the chance to give any commands. How do I stop the emulator to simply autorun stuff, like in your video? It looks like the emulator waits for your input instead of autorunning.
Have a look in the video description, many people got problems with the latest CBM prg Studio, there is a link to download the previous version. Cheers, Jake
I see everyone's using cbm to program c64? I dont understand why except you see more code on the screen. I already know how to program on the vice. What is the learning curve?
If you only program in BASIC then it's mostly just a nicer editor plus it's easier to load and save the project you're working on, and if something crashes you don't risk losing your code. However if you program in assembly, then it's a huge advantage you can work with multiple source files in your project plus it's easy to copy and paste code around and you can include resource files, use the debugger etc etc. It's easy to setup and get started, just follow the steps in this video. Cheers, Jake
how to you open these programs through VICE rather than running them through CBM? I hope that question still makes sense. Also it appears that there still may be the bug where assembly wont load through VICE, it shows that its trying after I generate and send the assembly but it won't open. Thanks for the help in advance.
Hi, Check the video description if you have trouble building the project files. Once you have build the code, the CBM prg Studio will generate a .prg file, that's like a c64 executable, you can load this file directly in VICE or any other emulator. Cheers, Jake
@@TheStuffMade gotcha, are there like commands that i can use to open these projects in VICE traditionally? Not sure if that makes sense either, like how you can navigate your drives in DOS to open programs, but for basic?
@@hf4229 Hi, you cannot load the code directly in VICE, it must be compiled into a .prg file first. The easiest way to do it is how I show it in the video. Cheers, Jake
Please someone help me?????? I'm following this tutorial and I can get the BASIC programs going no problem, the issues start when I try and run the assembly. Its not copying the bytes into memory in VICE. I'm clicking 'Generate and Launch' and if I do the SYS call I just get 'READY'. If I do some PEEKS, I can see that the machine code isnt even loaded in the addresses? Where am I going wrong?
1. Do you use the "Generate and Launch" button when you launch the code from prg studio? 2. Does it show you a window with the code when you launch? 3. Can you try record what happens using the Steps Recorder? (this program comes with Windows, just type steps recorder on the start menu) Then either upload the file somewhere or email it to me on the address I have in the about section. Cheers, Jake
I assume you mean the line "*=$1000" it's just a star/asterisk. You can download the project with the sample source code, there is a link in the description. Cheers, Jake
@@Obcubeon That's strange, you must have a different issue than everyone else. Best suggestion is to just open the source files and copy the code to a new project. Cheers, Jake
Hi Roy, if you are on windows, you can try record what's happening with the Steps Recorder (it's built into windows, just type "steps recorder" in the start menu). Then record what happens when you run the assembly code and either upload the file somewhere or send it to the email I have in the about section, then I'd be happy to take a look. Of could make sure to check the captures don't include anything you don't want to share. Cheers, Jake
@@random_precision_software Interestingly, I am faced with the same issue. BASIC program loads fine, but the asm seems to open vice quickly then shuts it..... I wonder if this is a bug (in the emulator). Sadly, I only have the one windows box to check on because quite frankly, windows is the devil.
RTS is return from subrutine. When you do a JSR MySubrutine, (JSR = Jump Subrutine) the CPU will push the return address onto the stack before jumping to MySubrutine and when you add a RTS at the end of MySubrutine, it will pop the return address off the stack and jump to just after your JSR call. Hope it makes sense. Cheers, Jake
@@jasonking1284 I detest the transparent, light-coloured and skeuomorphic Windows Aero UI. IMO Windows 10 has by far the best UI out of everything I've seen. I just like it black, flat and with sharp edges.
Note: If you experience issues running the assembly code it's likely due to an issue with the latest version of CBM prg Studio. (Thanks to Roy Meredith for his help reporting and testing this issue, check out his youtube channel: ua-cam.com/users/roypmetedith, he does remixes of classic video game music and various other game projects) You can download the older version of CBM prg Studio from my dropbox, link in description.
Superb - thanks so much!
First off, thanks for a great beginner's tutorial. At 10:40 the only caveat would be that the compiled prg file is 2,083 bytes, whereby most of that space is unused. I found that by omitting the base (org) address reference in code and then specifying $810 as the start address under Tools, Generate Sys() Call, the BASIC header bytes that are inserted toward the top will allow the SYS call to jump over them and continue seamlessly where the rest of ML code starts. The prg file will also compile down to just 51 bytes and the string should print properly. In this way it is not necessary to specify two org addresses and there is no need to think about how much of a gap to provide. Regards.
Hello, thanks. You shouldn't think of it as wasted space, it's just available memory. The way prg files work is that the contents must be continuous memory space, so when you build the sample it will go from $0801 until $10xx. So sure if it was important to make this specific file as small as possible then you are correct, but somewhat pointless in real projects where you use most of the memory including bank switching. It's much more important to plan your memory usage and configure the VIC memory space correctly for where you want your screen, sprites and charsets in memory. Then you can use a prg compressor like Exomizer to make your prg much smaller, for example my conversion of Rally-X (thestuffmade.itch.io/rally-x-64) the prg is around 62 kb, but after compression it can be as small as 22kb, but then again a few kb of saved disk space doesn't mean anything these days.
Cheers,
Jake
thanks for linking a book for noobs like me I've never ventured into doing things like this but I find C64 very interesting
It's good fun programming these retro 8bit computers with all their limitations.
Cheers,
Jake
Love the Commodore 64, lots of great memories.
Hello. I see that there are many people of my generation; I really like that. It seems like a meeting between boys, after a long time. Thanks for bringing the C64 back. Hope you upload more videos. Greetings from Argentina, and I thank you.
Hello Juan miguel amigo! Hope all is going well in Argentina.
Thanks for this tutorial, I appreciate your effort to share this! Clear, straight to the point, and you know what you’re talking about. Exactly what I wanted to find.
I would have liked to have programmed C-64 with assembly language in 1989 however there was little in way of text books on subject at my local libraries, bookshops & the technical institute I was studying microprocessor technology. Only info on this topic I had access to was for 8086, & 6809 microprocessors. CBM development environment & C-64 emulator looks excellent for program development & SD2IEC interface ideal for loading files direct to C-64 mainframe. Thanks for info on setting up. I will subscribe & look for your more recent uploads on C-64 assembly code programming.
OMG what timing, I just started refurbing a 64 after 30+ years with the intent to get the RPG I was working on in the early 80's up and running. I had map code done in Assy for speed and was planning to write the game itself in basic. I look forward to watching these videos!
Thanks, that is great. Keep us updated on your progress and feel welcome to request anything you'd like included.
@@TheStuffMade @TheStuffMade First I need to get back up to speed. I did my "Assembly" programming using a HexMon cartridge so I didn't even have an assembler. I recently found my disks (Fortunately several of each) and a hard print (4.5 inches wide with tiny type from my old 1520 printer no less). Do you have any suggestions for an environment that will work well on the machine itself or is a PC based IDE the best option?
@@RavenWolfRetroTech No worries. I'd highly recommend doing the development on PC, it will save you a lot of headaches. Then you can generate a prg file with your work and run it on real hardware, either using one of the SD card solutions (e.g. SD2IEC) or if you have a 1541 and want everything to be authentic you could use something like the ZoomFloppy interface to connected the drive to your PC and copy the files.
@@RavenWolfRetroTech I wouldn't want to start Assembly coding w/ CBM Prg Studio. It's meant for people who already know a lot about the C64's inner workings, sprites, bitmaps, character sets etc. I needed to read a book about Assembly first and practice w/ the 'Turbo Macro Pro' assembler on a C64 (emulator). "Professionals" who want to make cutting edge games use CBM Prg Studio (or C64 Studio , not related).
@@meneerjansen00 I used to know a lot about the inner workings and assembly on the C64 and Amigas. Now, not so much but I am hoping it comes back to me quickly
Thanks for the tutorial. This is helpful. Appreciate the compassionate output!
Yay ohh love the old Commodore machines. Just got myself a TheC64 trying to get Simons Basic on there! Greatest Microcomputer ever.
Yeah, it's a lot of good memories from a time when everything was much simpler.
@@TheStuffMade not everything! You ever try to send a digital camera picture to somebody in 2002 .... LOL well, nobody knew how to open the weird file formats let alone have an internet connection.
They use dial up which comes on a free CD! haha 42K Modem etc. Those were the days, having computers chirp instructions to each other using a phone!
These days we send terabytes every week without a second thought. Back then it took hours and hours to send a single picture!
Computers were in their infancy back then, and we're starting now to see just what miracles we can achieve using the things :)
@@DailyCorvid Yeah, miracles like pet videos and girls shuffle dancing... 😄
...and being fed up of everybody posting daily garbage which leads us people back to those simpler times where everything was about learning stuff and not abusing stuff. 😉😉
@@BikeArea Linus watches Pokimane, i watch Pewdiepie, we all have a dirty little UA-cam secret :D
The real miracle is that TV still exists...
A lot of people, including myself, are stuck at home these days, so I thought it would be fun to try program the good old Commodore 64 again. This video is me sharing my experience to make it easier for others to get started on the C64.
Content:
00:00 Intro
00:55 Software - CBM prg Studio
01:42 Software - Vice Emulator
02:00 Configuring CBM prg Studio
02:38 Create a project
03:05 Write a BASIC program
04:24 Write a program in assembly
05:59 Write more complex assembly programs
10:47 Resources
12:37 Ending
Never delved into assembly language. Very informative!
It's fun to see you use the same sources I do for opcodes and memory map. This ide is very popular among C64 devs, however I still use notepad++ and 64tass as cross asm
It's so much easier these days with these great online resources, back in the day it was books or experimenting until you got the result your were looking for. I chose to use the CBM prg Studio IDE for this series because it's so easy to use and get up and running, sure there are more powerful solutions once you reach the advanced level, but for beginners, you can't beat that IDE.
Cheers,
Jake
Wonderful tutorial! Really everything you need to get started. A+! Thank you.
Thanks, much appreciated.
Not exactly, I had zero clue what was going on from the start, and proceeded to only get more lost from there on out 🤣. It may be everything you need to know to get started if you have some degree of experience with coding but if you have non it's just jibberish. I grasped the hello world bit, then nada
The C64 was my first computer ever. I was 8 years old and it brings me so many memories back just starring at the blue screen.
Thank you, very helpful video! Finally got some assembly up and running on C64!
Pretty good! much memories, really great.....i was programmer for Ahoy! magazine... at mid 80´s! I wrote some games and bunch utilities for the 64 in those years. Im in nostalgic mode now... hahaha!
Excellent stuff! It's got me off to a really good start. Thanks.
Thanks, it's a lot of fun programming the old C64 once you get started.
Cheers,
Jake
There is a new development package for the C64 called VISION BASIC. It compiles on the fly and makes stand alone programs for stock C64's plus a whole bunch of other cool things.
first: thank you for this tutorial! second: what type of keyboard did you use here? sound very nice a not to loud.
This is so awesome! Thanks!
Thanks for making this video, a very good introduction!
This is an awesome video best stuff to learn :)
This is awesome!
Superb tutorial, thank you very much. You have showed me the way :) Cheers.
Nice introduction!
Its mad how u get tutorials that just work
Assembler didn't work for me either with the last stable 3.5 release, the nightly build r39851 worked though.
Yeah it seems something is not compatible between the latest CBM studio and VICE emulator. I have a link in the description with previous version of CBM studio, it works fine with VICE 3.5.
Cheers,
Jake
Looking forward to the other video's. Keep up the good work. :-)
At 2:30 where he adds the emulator go to emulator parameters and add -autoload before the %pro otherwise vice with automatically run the program instead of just loading it.
Thank you so much!
not working :/
How do you prevent Vice from autostarting the prg? I'd like to have a chance to list and poke around before running it.
For assembly just remove the sys statement at the beginning of the code.
Cheers,
Jake
I had to add -autoload parameter at 2:30 of his video in front of %prg in Emulator Parameters
I noticed that you have 'rts' on line 5 (after 'jsr write_string'). So I'm guesstimg that 'sys 4096' is also a subroutine call to address $1000 (in the basic assembly)?
sure, it will return to the basic prompt after it's done.
I'm having a problem following the tutorial. When I made the .bas file and clicked the generate and launch button, the emulator launched and in a few seconds it automatically ran the file, differently to your video. I just shrugged and thought it was a nice feature. But when it was time to test the .asm file, clicking the generate and launch button did the exact same as when launching the .bas file. Without giving me the chance to give any commands. How do I stop the emulator to simply autorun stuff, like in your video? It looks like the emulator waits for your input instead of autorunning.
Have a look in the video description, many people got problems with the latest CBM prg Studio, there is a link to download the previous version.
Cheers,
Jake
@@TheStuffMade I am using the older cbm. The problem is with Vice. The emulator is running the .bas without waiting for input.
I had to add -autoload parameter at 2:30 of his video in front of %prg in Emulator Parameters
@@kamara4700 thanks. I'll try that next time...
I see everyone's using cbm to program c64? I dont understand why except you see more code on the screen. I already know how to program on the vice. What is the learning curve?
If you only program in BASIC then it's mostly just a nicer editor plus it's easier to load and save the project you're working on, and if something crashes you don't risk losing your code. However if you program in assembly, then it's a huge advantage you can work with multiple source files in your project plus it's easy to copy and paste code around and you can include resource files, use the debugger etc etc.
It's easy to setup and get started, just follow the steps in this video.
Cheers,
Jake
love it
Cool video! :-)
Thanks
when i program assembly, it doesnt run
Check the description and try the older version of CBM Studio.
Cheers,
Jake
how to you open these programs through VICE rather than running them through CBM? I hope that question still makes sense. Also it appears that there still may be the bug where assembly wont load through VICE, it shows that its trying after I generate and send the assembly but it won't open. Thanks for the help in advance.
Hi, Check the video description if you have trouble building the project files. Once you have build the code, the CBM prg Studio will generate a .prg file, that's like a c64 executable, you can load this file directly in VICE or any other emulator.
Cheers,
Jake
@@TheStuffMade gotcha, are there like commands that i can use to open these projects in VICE traditionally? Not sure if that makes sense either, like how you can navigate your drives in DOS to open programs, but for basic?
@@hf4229 Hi, you cannot load the code directly in VICE, it must be compiled into a .prg file first. The easiest way to do it is how I show it in the video.
Cheers,
Jake
nicee
Please someone help me?????? I'm following this tutorial and I can get the BASIC programs going no problem, the issues start when I try and run the assembly. Its not copying the bytes into memory in VICE. I'm clicking 'Generate and Launch' and if I do the SYS call I just get 'READY'. If I do some PEEKS, I can see that the machine code isnt even loaded in the addresses?
Where am I going wrong?
1. Do you use the "Generate and Launch" button when you launch the code from prg studio?
2. Does it show you a window with the code when you launch?
3. Can you try record what happens using the Steps Recorder? (this program comes with Windows, just type steps recorder on the start menu) Then either upload the file somewhere or email it to me on the address I have in the about section.
Cheers,
Jake
when i generate and run the program, the assembly dump launches, and when i exit it, the emulator doesn't open
Make sure you set the path to the Vice emulator 2:20 and that you use the Generate and Launch button to run your code.
Cheers,
Jake
@@TheStuffMade i was using the newest version, i then downloaded the previous version on your dropbox and it worked
When I try to run the assembly code, Vice runs the basic code and sys4096 does nothing. What am I doing wrong?
Check the video description and download the older version of CBM prg Studio.
Cheers,
Jake
@@TheStuffMade Thanks. I figured it out. Cheers,
Daniel
What is that character at the beggining of the assembly program?
I assume you mean the line "*=$1000" it's just a star/asterisk. You can download the project with the sample source code, there is a link in the description.
Cheers,
Jake
@@TheStuffMade i see. Thanks!
generating and launching does not work for me. is there a way to fix it?
Check the video description.
Cheers,
Jake
@@Obcubeon Did you install the specific version linked in the video description?
Yes.
@@Obcubeon That's strange, you must have a different issue than everyone else. Best suggestion is to just open the source files and copy the code to a new project.
Cheers,
Jake
Any reason why the assembly program don't work?.. The basic one works fine so it's not the emulator.
Hi Roy, if you are on windows, you can try record what's happening with the Steps Recorder (it's built into windows, just type "steps recorder" in the start menu). Then record what happens when you run the assembly code and either upload the file somewhere or send it to the email I have in the about section, then I'd be happy to take a look. Of could make sure to check the captures don't include anything you don't want to share.
Cheers,
Jake
@@TheStuffMade OK thanks Ill have another go on my PC
@@random_precision_software Interestingly, I am faced with the same issue. BASIC program loads fine, but the asm seems to open vice quickly then shuts it..... I wonder if this is a bug (in the emulator). Sadly, I only have the one windows box to check on because quite frankly, windows is the devil.
@@Veksta download version 13 it'll work
@@random_precision_software copy. Will give it a crack and report back. Thanks for the tip!
what does the rts command do?
RTS is return from subrutine. When you do a JSR MySubrutine, (JSR = Jump Subrutine) the CPU will push the return address onto the stack before jumping to MySubrutine and when you add a RTS at the end of MySubrutine, it will pop the return address off the stack and jump to just after your JSR call.
Hope it makes sense.
Cheers,
Jake
@@TheStuffMade so that rts in the main label ends the program after ending the loop?
Wow.. you are still using Windows 7......
Sure, why not? I've got machines running anything from XP SP3 up to Win 11.
@@TheStuffMade IMO Windows Aero was the best UI Microsoft ever made, followed by WIndows XP UI. Windows 10 looks like a Lego 5yr old stuff...
@@jasonking1284 I detest the transparent, light-coloured and skeuomorphic Windows Aero UI. IMO Windows 10 has by far the best UI out of everything I've seen. I just like it black, flat and with sharp edges.