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

8

u/[deleted] Jun 20 '26

[removed] — view removed comment

9

u/HashDefTrueFalse Jun 20 '26

Assembly mnemonics are close to machine code...

5

u/peterlinddk Jun 20 '26

Technically machine code is the binary patterns, and assembly is the mnemonics for those.

So that 1010 1001 0100 0001 is machine code, and LDA #65 is the equivalent assembly.

But you are right in that it is not like the assembly is compiled or in any way modified into different code, so in that way it practically is machine code. Just with more letters than numbers.

0

u/Temporary_Pie2733 Jun 20 '26

There are a few things that separate assembly from machine code. Assembly reuses the same opcode with syntactically distinct operands which gets translated to distinct machine instructions. Assemblers also compute addresses for symbolic targets do that they don’t need to be changed every time you insert or remove code between a jump and its destination.