Wanted to point out for anybody following along... I'm on Linux Mint and installed cc65 through the default apt repo on the system. The compiler wouldn't recognize '.LITERAL' as a control command. After manually compiling and creating symbolic links (using the Getting Started tutorial on the cc65 web page), it worked great! Thanks for the tutorial! Excited to continue my assembly journey!
Thanks for this! I was completely stuck trying to do this on OSX but this fixed it. For any other OSX folks, I had to run `sudo make avail` (instead of `sudo make install`) once I'd compiled everything. This symlinks the binaries from the compilation directory into /usr/local/bin instead of copying them.
This was very, very well made and easy to follow! What a great resource! You should consider creating a 6502 assembly tutorial if you aren't planning that already.
I don't know if I have what it takes for a full 6502 tutorial series. Anyways, there's already a great one here: th-cam.com/play/PLPSrOWYluVLIJ1n-TsVb-BESL1tkSTRI_.html
This is exactly the kind of video I needed. I've got a fair bit of experience in many programming languages, but Assembly is something that always seem a little too hard to wrap my head around and daunting from the outside looking in. Thank you for this video and helping me realize it's not as bad as it looks
If you're getting an error about .LITERAL , make sure you have an updated cc65. I had version 2.18 and got the error. After I installed version 2.19, it worked.
Nice! I would encourage anyone who wants to do this to do this first: Step 1) Put together a Linux machine to act as your dedicated development environment. Step 2) See step 1. It's just easier and more straight forward to use Linux for this. When you get a Commander X16 or whatnot, just put it next to your development system. I also have threatened to do some kind of "tutorial series" (Not out loud, of course.) Despite having loads of game dev experience, I would have been lost without Matt Heffernan's tutorial series on the 65c02. (The very one Jestin points out.) When I started out with programming, all I had was a TRS-80 model 1 at the most basic level (Level 1 basic, 4K RAM.) It wasn't even capable of doing assembly programming. I tried... even bought the cassette version of the "TRS-80 Editor Assembler" program, which apparently included a free bug that prevented you from properly saving anything to the cassette. But now? In the 21st Century? You can buy a cheap laptop at Walmart, or just get used stuff and install Linux on it. With that you can do anything you need... compiling to any system, create and edit art and sound, anything. All it takes is to have the patience to start slow and take tiny steps. As Sun Tzu says: "A journey of a thousand Li starts with the first step."
My preferences are similar to yours, but honestly, for someone who has never done assembly programming OR linux, would you seriously recommend getting a linux machine to do it on? That's surely going to be more to learn, not less.
@@chromosundrift Linux is by no means required, but I've seen people have a lot less trouble getting started on the X16 when they cross develop from Linux as opposed to Window or OSX. It's just more developer-friendly. Linux isn't hard to use at all, nor do I understand where this idea came from. People only have problems when they try to run software intended for other systems, and frankly, nobody should expect that. I think the above is solid advice. Just remember you don't have to take it. You just need a text editor, make, and CC65.
Any way you could share your vim config? The default formatting/lsp settings I have with asm_lsp and others brings in wayyy too much non 6502 completions and the formatting is strange - it always jumps to the 2nd tab stop regardless of what the previous line was. Great video!
Oh! Forgot to make the comment I was actually going to make... and it's about the Makefile! I like the way your makefile is super simple... people stsrting with make REALLY need to see just bog simple makefiles instead of the excuses for complexity a lot of people use. (People that do that? STOP! Get help.) anyway, you should mention that TABS must be used instead of spaces to start a subsequent line in a makefile, a lot of editors default to using spaces instead and it's easy to stand there scratching your head at the error message saying "It LOOKS exactly like what I was supposed to type!" Also, and this is a nit... make doesn't execute the all: one by default, it executes the first one by default, which, by convention is named all. Cl65 runs the assembler first to build the .asm file... creating a .o file, then runs the linker to convert that into the .PRG file. You could have done the whole thing with just one rule that does 3 things: all: rm hello.o cl65 -t cx16 -o HELLO.PRG main.asm x16emu -prg HELLO.PRG -run -scale 2 There's no reason the clean: the .PRG, but adding a clean to delete the .o left over from the compile step would be cool. I like to burn the .o files on the outset just to force a full rebuild every time... it's not like even the biggest assembly program with a big pile of .o files is going to take more than a few milliseconds to compile and link on a modern machine. Yeah, as you can imagine, I'm a lot of fun at parties.
The complexity in a Makefile is required if you want have that Makefile usable on different system. The Makefile in the video is only usable on Linux and similar operating systems, but not on Windows. On windows you need del to delete files, not rm. And if you take that into account, the complexity of your makefile automatically increases. And later you probably want have many asm files, not just one. And with these collection of asm files you want to build one program. You could use the star operator of course, but if you don't want to build every object file from scratch again, you need a more smart solution than a star operator.
In the documentation of the x16 I did read about more programing language options, for example C. C would be a more modern and usable mode to work with the X16 as the Assembly, which is really hard work for nowadays programmers. C is more elegant, easy to use language, and back in the early 90-s many great programs was written with it not on the 8bit platforms but on pc an Amiga. Can You make a video about this option and possibilities for C programmer, because I'm afraid I don't see any common future for me and assembly on this platform. (In the 90-s that was fun, now it's only fuzz for me.)
I'd argue that C on 6502 is _not_ as elegant as you probably think. It still has the limitations of the platform, but presents an illusion that it doesn't. You should instead look into the prog8 language being developed, as it is both higher level (like C) but cognizant of the limitations.
@@digitaljestin Well, i've noticed, that the compiler generates way too "huge" file sizes for the x16's memory. I presume C is not the language this machine could "tolerate"... But talking about the Prog8 and it's development state ... can someone join in into the dev. or give proposals for the developer because I took a look at it and there are some solutions i don't like much. Is there a mailing list or something?
I see one issue with your Makefile. It's not platform independent. Someone who wants to use it under windows will get an error message, when sth. like "make clean" is run. The "rm" command doesn't exist on Windows, Windows requires "del".
Well. This is passing strange... I had noted in the video that you are using the .literal control command. I had never even heard of that one, but assumed it would just bypass the -t cx16 configuration switch and treat the data as a .byte sized array of chars, literally interpreted. (I.E. from ASCII.) as opposed to interpreting it from PETSCII. According to the docs, that's exactly what it does! So I tried it myself! I certainly hate PETCSII and would prefer not to go near it... but no! The assembler barfed it out as non existent. Is it version locked? The version in the repo the apt command uses is v2.18 Are you using a more recent one? It works fine if you use the .byte control command and just use lower case characters (Which will translate to upper case as PETSCII normal mode doesn't have shifted chars, so the unshifted ones get translated to shifted by -t cx16.) Normally, I prefer to bypass the bios hooks and send characters directly to VERA, but of course, for that, PETSCII wants to see the normal characters (Upper case when in BASIC mode.) start at $01 for an "A" and go up from there. (Cue a meme picture of Professor Hulk in Avengers:End Game when he says "Time Travel!" but saying "PETSCII!" instead.) Heh. An entire video needs to be devoted to dealing with PETSCII. I don't think it's even possible to actually bypass PETSCII completely in the x16, it's just baked into the system too deeply.
Thanks for the instruction. No offense, but would recommend moving the mic away from your keyboard because the volume is about the same as your voice. Either that or invest in a quiet one with scissor keys, or record the video without audio and narrate over it while editing.
I record the screen capture with the mic pointed at the keyboard (an Unicomp with buckling springs) specifically to capture it. The voice overs are done in a completely separate take. In other words, I mixed it all together to make sure the keyboard sounds exactly as it does :)
@@TheUtuber999 to be honest, I'm not really trying to grow a channel. I like making videos about X16 topics that I feel need more instruction (like my own tools), but I keep telling myself each video is the last. I'll do a second part to this one, but then probably no more until I find another topic that needs attention.
Wanted to point out for anybody following along... I'm on Linux Mint and installed cc65 through the default apt repo on the system. The compiler wouldn't recognize '.LITERAL' as a control command. After manually compiling and creating symbolic links (using the Getting Started tutorial on the cc65 web page), it worked great!
Thanks for the tutorial! Excited to continue my assembly journey!
Thanks for this! I was completely stuck trying to do this on OSX but this fixed it. For any other OSX folks, I had to run `sudo make avail` (instead of `sudo make install`) once I'd compiled everything. This symlinks the binaries from the compilation directory into /usr/local/bin instead of copying them.
This was very, very well made and easy to follow! What a great resource! You should consider creating a 6502 assembly tutorial if you aren't planning that already.
I don't know if I have what it takes for a full 6502 tutorial series. Anyways, there's already a great one here: th-cam.com/play/PLPSrOWYluVLIJ1n-TsVb-BESL1tkSTRI_.html
This is exactly the kind of video I needed. I've got a fair bit of experience in many programming languages, but Assembly is something that always seem a little too hard to wrap my head around and daunting from the outside looking in. Thank you for this video and helping me realize it's not as bad as it looks
If you're getting an error about .LITERAL , make sure you have an updated cc65. I had version 2.18 and got the error. After I installed version 2.19, it worked.
Extremely well explained lesson on Makefiles. Great job.
I like that you use a tiling window manager, and use gaps!
Great content! Great explanation! Waiting for the next one!
Thanks for this, can't wait to see the next Episode! :)
Nice! I would encourage anyone who wants to do this to do this first:
Step 1) Put together a Linux machine to act as your dedicated development environment.
Step 2) See step 1.
It's just easier and more straight forward to use Linux for this. When you get a Commander X16 or whatnot, just put it next to your development system.
I also have threatened to do some kind of "tutorial series" (Not out loud, of course.) Despite having loads of game dev experience, I would have been lost without Matt Heffernan's tutorial series on the 65c02. (The very one Jestin points out.)
When I started out with programming, all I had was a TRS-80 model 1 at the most basic level (Level 1 basic, 4K RAM.) It wasn't even capable of doing assembly programming. I tried... even bought the cassette version of the "TRS-80 Editor Assembler" program, which apparently included a free bug that prevented you from properly saving anything to the cassette. But now? In the 21st Century? You can buy a cheap laptop at Walmart, or just get used stuff and install Linux on it. With that you can do anything you need... compiling to any system, create and edit art and sound, anything. All it takes is to have the patience to start slow and take tiny steps. As Sun Tzu says: "A journey of a thousand Li starts with the first step."
My preferences are similar to yours, but honestly, for someone who has never done assembly programming OR linux, would you seriously recommend getting a linux machine to do it on? That's surely going to be more to learn, not less.
@@chromosundrift Linux is by no means required, but I've seen people have a lot less trouble getting started on the X16 when they cross develop from Linux as opposed to Window or OSX. It's just more developer-friendly.
Linux isn't hard to use at all, nor do I understand where this idea came from. People only have problems when they try to run software intended for other systems, and frankly, nobody should expect that.
I think the above is solid advice. Just remember you don't have to take it. You just need a text editor, make, and CC65.
Any way you could share your vim config? The default formatting/lsp settings I have with asm_lsp and others brings in wayyy too much non 6502 completions and the formatting is strange - it always jumps to the 2nd tab stop regardless of what the previous line was.
Great video!
Hi there, great videos. I'm curious is that the Awesome window manager? What distro are you using?
The distro is just Ubuntu, but I'm using i3gaps for a window manager.
I LOVE IT
very useful thx
Oh! Forgot to make the comment I was actually going to make... and it's about the Makefile!
I like the way your makefile is super simple... people stsrting with make REALLY need to see just bog simple makefiles instead of the excuses for complexity a lot of people use. (People that do that? STOP! Get help.) anyway, you should mention that TABS must be used instead of spaces to start a subsequent line in a makefile, a lot of editors default to using spaces instead and it's easy to stand there scratching your head at the error message saying "It LOOKS exactly like what I was supposed to type!"
Also, and this is a nit... make doesn't execute the all: one by default, it executes the first one by default, which, by convention is named all. Cl65 runs the assembler first to build the .asm file... creating a .o file, then runs the linker to convert that into the .PRG file. You could have done the whole thing with just one rule that does 3 things:
all:
rm hello.o
cl65 -t cx16 -o HELLO.PRG main.asm
x16emu -prg HELLO.PRG -run -scale 2
There's no reason the clean: the .PRG, but adding a clean to delete the .o left over from the compile step would be cool. I like to burn the .o files on the outset just to force a full rebuild every time... it's not like even the biggest assembly program with a big pile of .o files is going to take more than a few milliseconds to compile and link on a modern machine.
Yeah, as you can imagine, I'm a lot of fun at parties.
The complexity in a Makefile is required if you want have that Makefile usable on different system. The Makefile in the video is only usable on Linux and similar operating systems, but not on Windows. On windows you need del to delete files, not rm. And if you take that into account, the complexity of your makefile automatically increases.
And later you probably want have many asm files, not just one. And with these collection of asm files you want to build one program. You could use the star operator of course, but if you don't want to build every object file from scratch again, you need a more smart solution than a star operator.
In the documentation of the x16 I did read about more programing language options, for example C. C would be a more modern and usable mode to work with the X16 as the Assembly, which is really hard work for nowadays programmers. C is more elegant, easy to use language, and back in the early 90-s many great programs was written with it not on the 8bit platforms but on pc an Amiga. Can You make a video about this option and possibilities for C programmer, because I'm afraid I don't see any common future for me and assembly on this platform. (In the 90-s that was fun, now it's only fuzz for me.)
I'd argue that C on 6502 is _not_ as elegant as you probably think. It still has the limitations of the platform, but presents an illusion that it doesn't. You should instead look into the prog8 language being developed, as it is both higher level (like C) but cognizant of the limitations.
@@digitaljestin Well, i've noticed, that the compiler generates way too "huge" file sizes for the x16's memory. I presume C is not the language this machine could "tolerate"... But talking about the Prog8 and it's development state ... can someone join in into the dev. or give proposals for the developer because I took a look at it and there are some solutions i don't like much. Is there a mailing list or something?
@@belalehner3937 not sure about a mailing list, but the dev hangs out on the X16 discord server
@@digitaljestin thanks
Out of curiosity, what are you using for line numbering in vim, and... are you using an autoindent?
It's relative line numbering.
I see one issue with your Makefile. It's not platform independent. Someone who wants to use it under windows will get an error message, when sth. like "make clean" is run. The "rm" command doesn't exist on Windows, Windows requires "del".
Well. This is passing strange... I had noted in the video that you are using the .literal control command. I had never even heard of that one, but assumed it would just bypass the -t cx16 configuration switch and treat the data as a .byte sized array of chars, literally interpreted. (I.E. from ASCII.) as opposed to interpreting it from PETSCII.
According to the docs, that's exactly what it does! So I tried it myself! I certainly hate PETCSII and would prefer not to go near it... but no! The assembler barfed it out as non existent. Is it version locked? The version in the repo the apt command uses is v2.18 Are you using a more recent one? It works fine if you use the .byte control command and just use lower case characters (Which will translate to upper case as PETSCII normal mode doesn't have shifted chars, so the unshifted ones get translated to shifted by -t cx16.)
Normally, I prefer to bypass the bios hooks and send characters directly to VERA, but of course, for that, PETSCII wants to see the normal characters (Upper case when in BASIC mode.) start at $01 for an "A" and go up from there. (Cue a meme picture of Professor Hulk in Avengers:End Game when he says "Time Travel!" but saying "PETSCII!" instead.)
Heh. An entire video needs to be devoted to dealing with PETSCII. I don't think it's even possible to actually bypass PETSCII completely in the x16, it's just baked into the system too deeply.
I was having the same issue. get v2.19
Thanks for the instruction. No offense, but would recommend moving the mic away from your keyboard because the volume is about the same as your voice. Either that or invest in a quiet one with scissor keys, or record the video without audio and narrate over it while editing.
I record the screen capture with the mic pointed at the keyboard (an Unicomp with buckling springs) specifically to capture it. The voice overs are done in a completely separate take. In other words, I mixed it all together to make sure the keyboard sounds exactly as it does :)
@@digitaljestin Nice way to grow a channel. Bravo.
@@TheUtuber999 to be honest, I'm not really trying to grow a channel. I like making videos about X16 topics that I feel need more instruction (like my own tools), but I keep telling myself each video is the last. I'll do a second part to this one, but then probably no more until I find another topic that needs attention.
@@digitaljestin I personally like the keyboard typing sound in the background.
@@OpenGL4ever You probably also like nails on a chalkboard. Don't encourage him.