Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

The next video in the 6502 series is here!

In this video, I use an assembler (vasm) to write programs in assembly language rather than  manually writing out the hex opcodes for each instruction. I also cover some of the other benefits of using assembly language and demonstrate writing a program.

I plan to release this video in a day or so. As always I really appreciate any feedback or catching any errors that I can incorporate before the final release. And as always, thanks for supporting these videos!

-Ben

Files

Previews only

Assembly language vs. machine code - 6502 part 3

Schematics, datasheets, kits, and more at https://eater.net/6502 More on vasm: http://sun.hasenbraten.de/vasm Support these videos on Patreon: https://www.patreon.com/beneater or https://eater.net/support for other ways to support. ------------------ Social media: Website: https://www.eater.net Twitter: https://twitter.com/ben_eater Patreon: https://patreon.com/beneater Reddit: https://www.reddit.com/r/beneater Special thanks to these supporters for making this video possible: Adam Lininger Adrien Friggeri Alex Catchpole Andrew R.

Comments

Peter Stevens

Assuming there is gcc toolchain support for 6502, it would be easy enough to create a linker script, setup the stack, and jump into C. It's definitely the route for getting libc and friends up and running. Dare I say, maybe even a modified version of some rtos or Linux?!?! lol .. the sky is the limit now.

Chris G

Ben, perhaps I did not pay attention but it was for me not too clear that the ROM was located at $8000. So when at the end the .org $8000 came by at the top I was a bit puzzled for 5 minutes.

Anonymous

This was presented in part 2 around the 3min mark. And then again around the 26min mark when the IO was wired up into the lower half of memory.

Anonymous

That is what I had thought, but I could not find 6502 support for gcc (quite unexpected) there does not seem to be any real c compilers for 6502...that I could find

Anonymous

I think I have a problem... I'm addicted to Eatering :-/ ...these vids can't come out often enough for me :-) The only improvement that occurs to me is to perhaps generalize the idea of symbolic constants (EQUates) from just labels. Keep up the great work, Ben!

Silviu T

It's in the previous video (part 2); the EPROM is at address 0x8000 and up so that the lower addresses remain available for RAM, peripherals etc.

Anonymous

If you're doing any sort of 6502 work, check out Retro Assembler. Really simple Visual Studio Code integration. I've been using it for Apple 2 programming, but it's all setup for easy S/NES, C64, etc. (https://enginedesigns.net/retroassembler/)

beneater

As others have mentioned, I covered this in the last video. But it's a good point that people may not have watched, or may not remember, the last video. I think I'll add a quick review to the video. Thanks for the feedback!

Tony Bell

Ben, superb, couldnt wait to see this one..... hacking a retro assembler into my VS Code workspace now... It was good to see the final rotating LED's, any chance you can wet our appetite for whats next in this project at the end fo the Video? (Unless of course you havent got that far yet, in which case, ignore me :-))

Chris G

Hello all, yes I did get that in hindsight when browsing back to the other version. In part 2 is was explained very well indeed. I'm then happy that I figured it out myself.. and I was correct. Not a big thing at all and very well explained indeed. Btw I've build some Z80 kits, this was my thing back when I was in my late teens. Last year bought the Oshonsoft Z80 simulator which is quite helpful. I do not believe there is a 6502 variant of that though.

beneater

Well either way, I just swapped the video with a new version that briefly mentions this point. The nature of YouTube is that people will land on random videos, so I'd like each one to make sense on its own. And regardless, it's an important connection between the hardware and the code worth mentioning.

Anonymous

Awesome video as always!

Steve

The .org $8000 part made sense to me but I didn't quite understand why it didn't then fill the file with null bytes until 0x8000. My best guess is that this is because it's the first .org instruction, and the next one will then leave null bytes (which is what happened). I'm a programmer but I rarely work with languages like C so to go even lower level than that is really cool. Thanks for the videos Ben!

Anonymous

This would be amazing as an extra video, building on this video to allow us to write the programs in C. It'd link in well with Ben's previous videos on C and machine code.

Anonymous

Great work Ben, ASM was common when I grew up in the 80s, but nobody near me could show me around how it worked. All your videos combined make clear how this magic works.

Mike Thorpe

I was just about to go down the route of getting Sublime support but this looks much better.

Anonymous

Great videos Ben, I've just stumbled across them. I'm using VS Code & ca65 to teach retro game coding at patreon.com/rgd, but you're now getting me hooked on building the hardware :) I'll definitely have to get one of your kits soon!