r/code • u/I_Like_Cats__ • Jan 02 '20
Halp pls! Best way to learn assembly?
I want to learn assembly code pure out of interest but cannot find any courses about it,
I dont mind to pay for a course.
Any advice?
1
Jan 02 '20
Best way to learn assembly imo is to learn about compilers and linkers since they convert code to assembly. Just my option, but writing a compiler/linker is a fun programming exercise and will make you feel like a programming god
1
Jan 02 '20
Also, look up computer architecture. That will give your courses revolved around "fake" assembly languages. Otherwise find a chipset you want to work with and learn that. Assembly is not just one things, theres multiple "languages" under the assembly umbrella
1
u/yoloranger31 Jan 03 '20
Get a cheat sheet and start writing in an emulator such as mars for a RISC architecture(recommended) or visual studio for CISC. Pretend you are a compiler and write higher level code but in assembly. Since the instructions are simple especially in a RISC architecture learning and using the building blocks are very easy but tedious. Mips32 is a good ISA and x86 is a bit more complex.
5
u/[deleted] Jan 02 '20 edited Jan 02 '20
Take this answer with a grain of salt, it has been awhile since I've done any work in assembly.
The best way in my experience is to pick up a board that runs assembly and tinker with it. Set yourself a challenge and make it game like. For assembly languages you can go with the generic assembly but if you are looking for further studies into assembly you could research the assembly instructions for microcontrollers such as Legv8 for ARM microcontrollers, PIC instructions for PIC microcontrollers and so on as they are all a little different from each other.
For software-wise: I used Keil Microvision to flash the board and setup most of the assembly projects.
For free without a board: you can make stand alone projects without buying a board and mess around with registers, but it doesn't have that long term payoff like a board does. Because while you get that feeling of satisfaction of finishing a project, you don't get any visual feedback (except the data moving from register to register) for making a stand alone project like you do when you have a board to tinker with.