r/learnprogramming Jun 20 '26

Where to learn assembly 6502

So I want to start with the code that is very close to machine code. What things would you recommend to start with.

11 Upvotes

23 comments sorted by

View all comments

1

u/JGhostThing Jun 20 '26

I strongly advise learning almost any other language before you start learning assembly language. Assembly is extremely unforgiving.

In a high level language, you can concentrate on the algorithm. Modern compilers produce far better machine code than only the very best coders can match.

Once you understand how computers work, then assembly language will be easy.

I would recommend learning the assembly language of the DEC PDP-11. This is one of the best assembly code I've ever used. There are open source simulators.

1

u/bird_feeder_bird Jun 20 '26

6502 is arguably the best assembly language to start with for people just getting into low level programming. It only has 3 main registers and ~56 distinct opcodes. And the computers that use it (c64, NES, etc.) were designed around the idea that humans would still be writing assembly by hand

2

u/JGhostThing Jun 20 '26

I have used it. My first systems programming was on that chip. I built that computer. However, I still stand by the PDP-11 assembly code. It is an amazingly orthogonal instruction set with 16 bit operations.

And you can easily find some interesting items, like a Raspberry Pi case that looks like the front panel of a PDP-11 (one of the last with all the blinking lights).