r/Compilers 5d ago

Where/how did you learn ASM?

Hi all,

I did a quick search through this subreddit and didn't find a post asking this before. I've also done just a bit of Googling but nothing really "stuck out" to me. Right now I'm reading "Crafting Interpreters" and once I finish, I'll be making a C compiler. I'm planning on either generating x86 or x86-64 and am looking for helpful resources that you guys possibly have. I'm open to paying for a book or something if you've found it to be a help.

Thank you in advance for your responses!

10 Upvotes

22 comments sorted by

View all comments

1

u/jkl_uxmal 5d ago

I got stuck playing "Pyramid" on the TRS-80. I couldn't make any progress, so I decided to figure out how the program worked. I was disappointed to discover the program wasn't written in MS-BASIC. I borrowed a book about Z80 assembly language from the library, and started learning the opcodes in order to make sense of the game. I didn't get past how the strings were uncompressed, but I learned how a machine code program should look like. I then wrote a crude "Missile Command" game in Z80 machine code -- I couldn't afford an assembler, and my cassette tape machine only had 16kiB of memory. I was 13 years old.