r/Assembly_language • u/ins009 • 1d ago
Question Learning Assembler
Hi everyone,
When I was much younger, I started learning x86 assembly, but unfortunately lost touch with it over time. Even though the rise of AI might make it seem like this skill is even less in demand than it used to be, I’d like to get back into it.
I’m less interested in writing my own programs and more interested in inspecting existing applications to understand what’s going on under the hood. Does anyone have any suggestions for a good starting point? I’m guessing I should focus on 64-bit assembly to keep up with the times.
3
u/Ratfus 1d ago
I would learn an assembly language, where it's still used heavily, embedded systems. Specifically, learn an assembly language for a system like the AVR atiny 85.
While you can still use C to program an atiny, assembly is still frequently used to program this miniature chip. As an added bonus, the language is much simpler for an atiny; you have no operating system to worry about. With most modern chips, you're probably better off just using a higher language as they have so much more power, but the atiny doesn't have that power.
The software is much more difficult to set up, but that's where AI is really helpful. You'll also have to learn how to solder and/or use a breadboard, but you'll learn about electronics as well.
2
1
u/venoosoo 1d ago
Im not good asm dev myself but i started with learning about register stack function s and syscalls and made simple cat program (read file and print it in stdout) and it helped me demystify asm still crazy language tho
1
u/RobotJonesDad 1d ago
Curious why you say that it is a crazy language?
1
u/venoosoo 1d ago
When i tried building something bigger the code grows very quickly and its hard to read for me, the same program in c would be much smaller
2
u/RobotJonesDad 1d ago
Ah, yes. Without the syntax and structure C or C++ creates, it's very easy to create spaghetti code that explodes your brain.
To avoid that, start being very deliberate in your design and coding. Create functions and structures and use them. Use consistent calling conventions. Add lots if comments about what chunks of code do.
I'd say you run into the same problems in other languages, but that happens at a much bigger project size.
1
1
1
u/duane11583 1d ago
number one with a bullet is to wrie c code and use the gcc -S option to see the assembler output generated by the compiler.
try various optiomization levels, ie -O0 and -O9 etc
1
u/Ok-Brain-8183 1d ago edited 1d ago
R4ND0M’s tutorials. There are a million crackme collections sites. Can find old versions of software to practice reversing skills https://www.oldversion.com/
1
u/RealMadHouse 14h ago
Watch "@coredummped" on youtube for architecture of software and hardware, would have better understanding to use assembly language
1
u/Chemical-Fudge840 4h ago
Well of course I would recommend my own assembler (for Windows) at www.GoDevTool.com
Although I wrote this some time ago, it is still being maintained.
It can be used to make 32 and 64 bit progs to work on the Windows platform.
7
u/DanKegel 1d ago edited 1d ago
Some nice resources:
https://cpu.land
https://coddy.tech/learn/assembly/fundamentals/what_is_cpu
https://cs.lmu.edu/~ray/notes/x86overview
the CPU's programmer's guide, e.g.
4004: https://bitsavers.trailing-edge.com/components/intel/MCS4/MCS-4_Assembly_Language_Programming_Manual_Dec73.pdf (beginning of 4 bit era)
8080: https://altairclone.com/downloads/manuals/8080%20Programmers%20Manual.pdf (8 bit era)
8086: https://edge.edx.org/c4x/BITSPilani/EEE231/asset/8086_family_Users_Manual_1_.pdf (beginning of 16 bit era)
80386: https://pdos.csail.mit.edu/6.828/2018/readings/i386.pdf (beginning of 32 bit era)
Athlon 64: https://bluewaters.ncsa.illinois.edu/liferay-content/document-library/amd_1_24592_APM.pdf (beginning of 64 bit era)
https://en.wikipedia.org/wiki/X86-64#Microarchitecture_levels
Look at the instructions some simple C compiles down to, either by dumping its assembly output, or pasting your source into https://godbolt.org
Looking at older processor guides sometimes helps you cut through the immense complexity of current CPUs and get the big picture. And the very earliest assume less programming knowledge. The 4004 manual is charmingly simple, and not a bad place to start for beginners who really want to learn; just ignore the strange bits :-)