Writing 6502 Assembly on a Commodore 64 using the Macro Assembler Development System. Part 1.

  Рет қаралды 13,703

My Developer Thoughts

My Developer Thoughts

11 ай бұрын

Writing Assembly Language on a Commodore 64 using the Macro Assembler Development System.
* Basic Overview of the tools on the disk.
* Creating, Assembling, Loading and Saving a simple assembler language program that sets the border, screen and cursor color.

Пікірлер: 76
@CBMSTUFF
@CBMSTUFF 10 ай бұрын
From 1983 to late 1984 I used this 12+ hours a day to create commercial software for the C64. This assembler uses SEQ files for storing the code to be assembled. There were no fast loaders that worked with SEQ files until the 1541 flash was released (before JiffyDOS). When you have a program that is 30+ blocks long, it takes FOREVER to do the assemble, and then object conversion to a program. I wasted so much of my life waiting on the disk drive. The moments I discovered 'Develop64' I immediately switched - it is a 100% memory resident assembler with no disk loading for anything once it is running... and it had a integrated debugger too. I could a week's worth of CBM assembler based work in an afternoon! Your video shows a setup with a fast loading system that would have made this a LOT more tolerable.. but I am glad I switched. Today I use the CBM prg Studio for everything.
@Boxing_Gamer
@Boxing_Gamer 10 ай бұрын
I used zeus assembler..I had one program that pretty much took up all available ram, still it compiled in 2-3 seconds.
@BillAnt
@BillAnt 10 ай бұрын
I used Merlin back in the 80's (originally an Apple-II assembler ported to the C64). Nowadays I'm using Turbo Macro Pro (TMP) with integrated assembler and monitor. Best of all, it can be loaded into the REU memory expansion so the C64's entire memory is fully available for testing and running assembled programs on the fly. I start each program by redirecting the NMI vector from the RESTORE key to the TMP's start address, which allows me to interrupt the program at any time and drop back into TMP without having to reload anything. :)
@aikidoshi007
@aikidoshi007 10 ай бұрын
I started a 45 year programming career doing assembler on a Commodore Pet, a brilliant machine at the time because it has a CPM OS inside it. I am retiring in September this year (2023) at age 70. Still programming even now.
@TheanHooYew
@TheanHooYew 10 ай бұрын
I started 30+ years ago with BASIC on a TI 99/4A (cassette tapes and RF modulator connected to a TV). I soon learned 6502 assembly on an Apple ][ clone, and Turbo Pascal on on CP/M. Got paid during the 90s writing RPG/II and RPG/III on S/36 and AS/400. I'm mostly using C/C++ now. My son is following my footsteps. He's always trying to make me use modern languages like Go and Rust, but I always countered with the story about old dogs and new tricks. What's your language of choice?
@aikidoshi007
@aikidoshi007 10 ай бұрын
@@TheanHooYew I've been doing mainly react and microsoft MVC the last 5 years, with a lot of C#. I really look forward to retiring now though. Had enough of the constant change.
@edgeeffect
@edgeeffect 10 ай бұрын
The Pet... 6502.... CP/M... 8080 ???????
@BillAnt
@BillAnt 10 ай бұрын
Keep on tinkering, it keeps your mind young. ;)
@JustWasted3HoursHere
@JustWasted3HoursHere 10 ай бұрын
Do you miss hitting the hardware directly (and having full control of everything) without having to go through all those layers in modern OSes?
@oleklintebk
@oleklintebk 10 ай бұрын
I wrote my own assembler/editor back then. It was no pain - it was fun. With that tool I could write my software to DNA analysis. Yes DNA sequencing was manual work then and a few hundred bases per run. C64 and Apple IIe (also 65xx) later for reading the gels. Pionering times it was. Miss it a lot. And then maybe not.
@gabor222
@gabor222 6 ай бұрын
What almost everyone forgets to tell in these tutorials is how to save the program with the 10 SYS 49152 line included so one could start it with RUN.
@LibertyWarrior68
@LibertyWarrior68 10 ай бұрын
How refreshing that your computer doesn't run crap in the background.
@whomigazone
@whomigazone 10 ай бұрын
I wrote my first assembly language program with the macro assembler. First Machine language program I wrote with a machine language monitor (Which I seem to recall having made a new version which was moved in memory so it could coincide with other memory locations). I remember spending one weekend in which I converted the ML monitor code (Which was a Basic extender) to the assembler code.
@JustWasted3HoursHere
@JustWasted3HoursHere 10 ай бұрын
Man, tools for programming the C64 have greatly improved since then, such as CBM Studio and many others. I can't imagine trying to create a complex game using this set of tools back in the day! And systems like the Atari 2600 had it even worse. Luckily that system (and many other retro systems) also has numerous new and powerful programming tools to aide the programmer.
@BillAnt
@BillAnt 10 ай бұрын
One of the best assembler/monitor nowadays for the C64 is Turbo Macro Pro (TMP). With an REU memory expansion unit it can stay resident while writing and testing code.
@JustWasted3HoursHere
@JustWasted3HoursHere 10 ай бұрын
@@BillAnt TMP hasn't been updated in a while but it does seem to be the assembler of choice nowadays (Robin from "8 Bit Show & Tell" uses it extensively on his channel - which I highly recommend if you're into this sort of thing).
@BillAnt
@BillAnt 10 ай бұрын
@@JustWasted3HoursHere - Indeed, I got sick and tired of having to reload an assembler every time I test my code. A resident assembler/monitor makes code testing so much quicker and fun. :)
@JustWasted3HoursHere
@JustWasted3HoursHere 10 ай бұрын
@@BillAnt Without any sort of fast load feature I can imagine that this process would be nerve-wracking, especially if the bug is just a single line of code.
@BillAnt
@BillAnt 10 ай бұрын
@@JustWasted3HoursHere - Yup!
@RonHelton
@RonHelton 10 ай бұрын
👍👍👍👍👍👍 This brings back a lot of memories of doing assembly language in college.
@MK-ge2mh
@MK-ge2mh 10 ай бұрын
This video contains excellent content and is very well presented. Thank you very much!
@dougjohnson4266
@dougjohnson4266 10 ай бұрын
I remember doing this in 1985 with a BW TV. It was hell.
@BoomRoomFive
@BoomRoomFive 10 ай бұрын
I would have killed for this software when I was 13!
@CallousCoder
@CallousCoder 10 ай бұрын
Yeah I too didn’t know that assembler existed until 1990 i preprogrammed everything on a monitor cartridge for C64 and debug for XT 😂. When we learned C I saw that the intermediary step was assembly and it called tasm. As of that moment I solely used assemblers and I wrote one for the Z80 that were had to code in machine language in college. After one day do going through the mnemonics table to get the opcodes and operants I knew it was time to quickly hack a Z80 assembler in C 😂
@OlivierSimpleLife
@OlivierSimpleLife 10 ай бұрын
seriously, it's fantastic ! the true retro experience !
@RickDolishny
@RickDolishny 8 ай бұрын
This brings me back over 40 years. I followed it all! I don't remember the name of my PET and C64 assembler but it was amazing. Power?
@RR-xg1cm
@RR-xg1cm 10 ай бұрын
I used to write assembly on the Atari 8 bits 6502. Was really cool to see how similar. Of course the memory maps are different, but assembly is assembly.
@roygalaasen
@roygalaasen 10 ай бұрын
680x0 here. Way back in the early 90’s.
@ChrisM541
@ChrisM541 10 ай бұрын
@@roygalaasen Amiga and ST. I remember them well, especially the Amiga.
@roygalaasen
@roygalaasen 10 ай бұрын
@@ChrisM541 especially the Amiga 😄 I was expecting someone to mention the Atari. Regarding the processor itself, I have seen it used in everything from elevators to massive Xerox colour laser printers.
@lupedarksnout
@lupedarksnout 10 ай бұрын
I found the PAL assembler at a thrift store around 1995, and still use it today. The source files are BASIC files too, no special editor needed. I can assemble to memory, test, tweak, reassemble and so on, until I botch something that requires a reboot.
@pssthpok
@pssthpok 10 ай бұрын
I remember buying Brad Templeton's PAL assembler back in the 80's for a good pile of money, but it was pretty sweet. I was part way through writing my own version of 'spacewar' when a friend showed me a full featured version he downloaded from a BBS. The wind went out of my sails, and I never finished it. LOL
@lupedarksnout
@lupedarksnout 10 ай бұрын
@@pssthpok PAL was the best $15 I ever spent. Still clinging to that childhood yearning to "make a game", but with adult eyes. No matter what, someone out there can do it better. It is quite easy to get discouraged and sidetracked. My sympathies for your younger self.
@PetersonChevy
@PetersonChevy 10 ай бұрын
I love this old school stuff! Would be great if you would share the rest your social media links
@edgeeffect
@edgeeffect 10 ай бұрын
In those days my friends at school wrote assembler with a pencil and assembled it with a mostek or Z80 reference card and another pencil.
@albanana683
@albanana683 10 ай бұрын
A pencil? Luxury.
@CallousCoder
@CallousCoder 10 ай бұрын
Damn he has more views on a single introductory video on C64 assembly than I have in total of my 10 lesson 😂
@jackrushing8160
@jackrushing8160 10 ай бұрын
I may be recalling incorrectly, I seem to recall the Vic20 having the 6502 and the 64 having the 6510 processor. Incidentally, I did a deal of assembly programming for the 64 using a basic program
@Lion_McLionhead
@Lion_McLionhead 8 ай бұрын
That's a lot of work. Guess the Yves Han assembler was pretty good by the standards of the time.
@albanana683
@albanana683 10 ай бұрын
An assembler? You were lucky. My first 6502 experience was at school on a Commodore PET in the 1970s. My "assembler" was sheets of graph paper transforming machine code into hex bytes to be dumped into memory. And, Jesus weren't cassette tapes slow and unreliable for storing data.
@Controllerhead
@Controllerhead 10 ай бұрын
This is absolutely horrific. I'm happy to have fancy shmancy things like Notepad and .BAT scrips 😅 Thanks for sharing!
@robertusa1234
@robertusa1234 10 ай бұрын
It truly was the dark ages of coding
@MrTommys4
@MrTommys4 9 ай бұрын
Wow super
@pwnmeisterage
@pwnmeisterage 10 ай бұрын
6502-era keyboards were the best.
@MicrophonicFool
@MicrophonicFool 10 ай бұрын
Too much time has past for my memory to be complete, but I do recall a lot of anomolies with opening/closing 1541 disk channels related to SEQ or REL files never closing the command channels afterward seemingly because those file types allowed some kind of real-time append, but not overwrite. Some of the C-64 Database programs of the time would leave the channel open to allow DB updates to SEQ without additional delays in drive operation. I don't claim to know whether that has anything to do with this scenario, but when I was messing with BBS Databases, I OFTEN got not ready or flashing error when I was switching file types, or trying to commit incompatible changes to the different files involved.
@BillAnt
@BillAnt 10 ай бұрын
The 1541 drive was a whole computer in itself with many undocumented commands. Nowadays it has been reversed and well documented, and even emulated with cycle accuracy on the Pi1541, including GCR read write using the ZoomFloppy adapter for the PC.
@MicrophonicFool
@MicrophonicFool 10 ай бұрын
@@BillAnt If the new method doesn't go out of alignment, then it isn't 100%
@BillAnt
@BillAnt 10 ай бұрын
@@MicrophonicFool - LOL
@dr.ignacioglez.9677
@dr.ignacioglez.9677 8 ай бұрын
I LOVE C64 ❤❤❤❤❤❤❤❤❤
@rickthatch3556
@rickthatch3556 3 ай бұрын
Disk i/o would be interesting and not really too involved to show... Maybe build on that to allow for a disk paging system...
@cameroncarter6789
@cameroncarter6789 10 ай бұрын
Cool
@bozimmerman
@bozimmerman 10 ай бұрын
I've been using the LADS assembler since I was a kid. I thought the way it worked was strange, using the BASIC editor to write source. Now I realize it was actually just following its predecessor! P.S. I wonder if PUT "@0:HELLO.ASM" would have removed the need to scratch first?
@MyDeveloperThoughts
@MyDeveloperThoughts 10 ай бұрын
I tried that command, and it does work (which is awesome). As a kid though (And this was a longggggg time ago and this maybe incorrect), I remember avoiding that command with the SAVE from BASIC because of rumors of a bug with it where it could potentially corrupt the file. Not sure if that was a real bug or just 'urban nerd myth'.
@temp911Luke
@temp911Luke 10 ай бұрын
Hi, your keyboard, is it red switches ? Thx for the video !
@MyDeveloperThoughts
@MyDeveloperThoughts 10 ай бұрын
They are indeed Cherry MX Red Switches.
@mykalimba
@mykalimba 10 ай бұрын
I did a ton of C64 6502 programming using almost exactly the same processes. I used the Merlin 64 assembler, though. I can't for the life of me recall if I had to do the "scratch the existing file before saving out the new version", but the notion of having to do that totally frightens me now (specifically, the situation I would be in if I'd scratched the source file and the C64 lost power before the new version was written to disk). Is there a "rename file" disk command? Because it seems like it would be much safer to rename the current version of HELLO.ASM to something else (HELLO-OLD.ASM?), then write the new HELLO.ASM, than it would be to have that period of time where you've deleted the only copy of your source code and have yet to write out a new version from the computer's memory.
@MyDeveloperThoughts
@MyDeveloperThoughts 10 ай бұрын
Thanks for taking the time to reply, much appreciated. Yes, there is a rename command in the Dos Wedge. It's @R:newname=oldname. For safety, that would definitely be one really good way to go. I've been playing around with this assembler the last few days and I found myself saving files with names like 1.asm, 2.asm 3.asm.... and then removing the older versions every so often. I can't imagine how tedious it must have been to write code for an actual serious program with this package back in the day. The write code/assemble/load/test loop just takes so long. I may have to check out Merlin 64. I've not heard of that package before. I just took a brief look at the PDF manual via Google and it is very interesting to me. It seems to have been released in 1984 and needs just a C64 and a Disk Drive.
@randyab9go188
@randyab9go188 10 ай бұрын
If anyone knows where you can change the screen defaults in the rom please post it here.
@randyab9go188
@randyab9go188 10 ай бұрын
The one thing I would love to know is who is the engineer that picked the blue on blue color scheme for the boot up screen. Must have been a sadist. Why not something like high contrast black and white blue and white black and blue something better than blue on blue.
@G.B...
@G.B... 8 ай бұрын
Interesting for historical reasons but seriously, Turbo Macro Pro was (and still is) the best native way to develop assembly programs in C64. it's just way easier than this in all aspects.
@rickthatch3556
@rickthatch3556 3 ай бұрын
Lets do something more substantial... Everyone does that border change and hello, world...maybe show how to convert 16 bit integer into pet sci for display...?
@mrysSOFTWARE
@mrysSOFTWARE 10 ай бұрын
Overriding by @:
@Lardzor
@Lardzor 10 ай бұрын
Many years ago I thought assembly was the wa y to gol It's not.l
@SquallSf
@SquallSf 10 ай бұрын
I don't understand, why would somebody go trough all the pain, to write asm in a such way? Cross-compilation "wheel" have been discovered long ago even before c64 was actually used in that painful way.
@bozimmerman
@bozimmerman 10 ай бұрын
I wish I understood this question, but I'm pretty sure I can guess the answer from context; When you only have one computer, you do everything on that one computer.
@SquallSf
@SquallSf 10 ай бұрын
@@bozimmerman While such scenario is highly possible in 80s, now everybody uses multiple computers - starting with a smartphone and finishing with some PC. On the video is obvious that you don't even use an actual c64 rather an emulator, so don't play dumb pretending that real c64 is the only thing that you use.
@martyflickinger
@martyflickinger 10 ай бұрын
Agreed. At the company I worked, we cross-assembled for C64 and C128 development on a PC using Avocet tools. It’s been so long ago now I can’t recall the process I used to get the binary onto the Commodore for testing. But it was far less painful than what I just watched 😮
@ChrisM541
@ChrisM541 10 ай бұрын
He's showing you one method of how it was done...then, not now. Using an emulator doesn't detract from showing us the coding process used then. Yes, back in the day many studios programmed on one machine and sent the code to another. No one compiled for the 6502/10 (or Z80, 680xx etc) when programming in assembly programming back then - the binary generation process then, and now, is called assembling (using an assembler). Games(!!) programmers then would never use a compiled language to generate machine code (for these 8 and 16-bit systems), they hand-wrote every line in assembly because they were pretty much all experts in the processor's instruction set. That, and the fact max speed and smallest program size were crucial. It's vastly different today where compilers have gotten pretty good. They're still not perfect, and again, it's not uncommon for studios to include hand-written assembly, particularly where maximum speed is important. Unfortunately, expertise in assembly is rapidly being lost, and programming, in general, is being abstracted away.
@SquallSf
@SquallSf 10 ай бұрын
@@ChrisM541 I understand that. But the way it is done in the video is very slow and inefficient- thus thus the metaphor of pain! It is much easier and faster to write and compile on PC using contemporary editors and assemblers for 6502. Not to mention that using emus like VICE allows you to even debug. Even if you write on c64, there are much better tools. That Macro Assembler Development System seems quite primitive.
Programming Like It's 1979: 6502 Assembly language on the Apple ][
19:53
Маленькая и средняя фанта
00:56
Multi DO Smile Russian
Рет қаралды 4,6 МЛН
Don’t take steroids ! 🙏🙏
00:16
Tibo InShape
Рет қаралды 60 МЛН
Complete beginners guide to creating sprites on the Commodore 64 / C64 in BASIC
25:47
GEOS 2.0 C64 - Part 2 - The need for speed
32:44
My Developer Thoughts
Рет қаралды 10 М.
Compiling a SIMON's BASIC program on the C64
8:24
Retro Old Guy
Рет қаралды 1,3 М.
Write C64 GEOS applications with geoProgrammer in 6502 assembly language.
45:34
Let's learn COBOL on the Commodore 128
35:24
My Developer Thoughts
Рет қаралды 4,2 М.
Advanced 6502 Assembly Programming for the Apple II
33:44
Stephen Edwards
Рет қаралды 25 М.