Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As a topic newbie I ask: what CPUs is this assembly targeted for? Why would I learn an assembly for a old CPU and use I with an emulator when I could learn assembly for modern CPUs and let it run on the metal?


Your question is addressed in the fourth paragraph at the link:

> "Then why 6502? Why not a useful assembly language, like x86? Well, I don’t think learning x86 is useful. I don’t think you’ll ever have to write assembly language in your day job - this is purely an academic exercise, something to expand your mind and your thinking. 6502 was originally written in a different age, a time when the majority of developers were writing assembly directly, rather than in these new-fangled high-level programming languages. So, it was designed to be written by humans. More modern assembly languages are meant to written by compilers, so let’s leave it to them. Plus, 6502 is fun. Nobody ever called x86 fun."


Odd... The dead reply under here looks like an excellent reply. I wonder what I'm missing...

Anyway, 6502 is a super easy processor to program on. Back in the old days (and maybe even still) universities often used non-existent processors for teaching assembly language programming and associated concepts. I learned 6502 as a child on my Apple II and even when I went to university, I always thought it was a much better first starting place simply because it lacks anything complicated at all.

To be honest, even though I have fond memories of 6502, if it were me, I might have chosen 6809 since it gives you a few more facilities and makes a couple of things a bit easier. But it's not crucial...

You can certainly learn using a more modern processor, but there is a lot more stuff to keep track of. The idea of starting with a super simple processor and then graduating to a more modern and complex processor makes sense to me.


As a kid I had a Vic 20 and then an Acorn Electron, so like you I learned 6502, but I agree that the 6809 was a much nicer CPU to learn. Refurbished ICs seem to be available, but as far as I know it is no longer manufactured.


The 6502 is actually still in production. However...

Modern assembly x86, or even modern ARM assembly, is significantly more complicated than 6502 assembly.

Starting with the 6502 will let you write working code more quickly and introduce you to the core concepts of assembly language programming.

More than this, even if you never write assembly, being aware of what a CPU instruction set looks like helps you grasp core concepts in C/C++.

If you're only ever going to write high level code (e.g. JavaScript) this probably isn't helpful. But as an aid to understanding how computers work, and what they are capable of, it can be really useful.


I doubt that. With 6502 you have so much byte fiddling to do; x86 (or 6809) is much easier once you need more than 8 bit pointers.

(I probably still have a turing-complete set of Z80 opcodes in my head.)


"On the metal" is kind of a hazy concept on modern systems. If you write x64 assembler and run it on Windows/Linux, is that really "on the metal"? If you don't consider it to be, then you have a lot of work to do in getting it to boot with the screen turned on and a usable keyboard.

Whereas in emulating a complete old system like a BBC micro it is far easier to get to the metal while still being able to use the display and peripherals.

"Assembler" is really quite a portable skill once you've learnt at least two dialects, just as learning German and Latin will open most European languages to you.


A few years ago, I learned it to reverse engineer the compression, graphics, and level data formats for an NES game whose levels I wanted to dump.

https://tcrf.net/Proto:M.C._Kids

https://gitlab.com/mcmapper/mcmapper/blob/master/main.c


I'd have thought AVR assembler was a better choice these days - a nice orthogonal 8-bit RISC architecture, and you can use gcc, gas etc. (as well as being able to run your code on an Arduino).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: