Where to learn Assembly?
Posted by Physical_Storage2875@reddit | learnprogramming | View on Reddit | 17 comments
Hi, I'm a junior dev and I wanna know what happens "under the hood". In my bachelor I learned it a bit but also I "skipped" it a bit xD My goal is not to get a solid assembly programmer but someone who knows the basics
Top_Acanthaceae_6777@reddit
fr assembly is underrated
EliSka93@reddit
Assembly is super cool, but also tedious to write.
The benefit to downside evaluation rarely goes in its favour when it comes to actually writing code.
OutdoorsDad@reddit
CS50 from Harvard has a decent section on it. Otherwise Ben Eater's YouTube channel if you want to understand how CPUs actually work at the circuit level.
Ironraptor3@reddit
Aside from what other comments are saying- there is a fun "game" (if one could call it that) called TIS-100 on Steam, which is essentially various computational problems using toy assembly. I found it to be pretty educational and I point people to it who are interested.
If you can do C things, you may consider the gcc flag
-Swhen compiling, which will emit the intermediate assembly. That way you can see how your C program was compiled into assembly and begin thinking of mappings.Additionally, for compiled languages, you may consider compiling with debug symbols and stepping through the assembly itself using
si(step instruction) rather thans(step).Hope these were helpful supplemental suggestions ^-^
bird_feeder_bird@reddit
I started with 6502 and its been easy to transfer the skills to more modern assembly languages. Also nand2tetris if you want an even deeper understanding of whats going on.
pepiks@reddit
Library, second hand old books. But first define platform and target. The easiest is get older hardware and programme for it. It will be more fun than print "hello world" for... printing "hello world". At 90s I used combination C++ and asm command to create from scratch simple graphic library. I use for it old book from probably 8086 (I can remember details). Try find something like "Macro Assembler Operating Instructions" for target platform like this:
https://mark-ogden.uk/files/intel/publications/469165-003p1%20ASM386%20Macro%20Assembler%20Operating%20Instructions-Nov95.pdf
peterlinddk@reddit
Well, you can go anywhere you'd find other programming courses, e.g. YouTube if you like videos.
I recommend starting with picking a platform first though. Do you want to run assembly programs on your own machine, or do you perhaps want to try on a Raspberry Pi, or some retro-machine? I'd suggest not going for your own 64-bit machine that runs other programs, especially not waste too much time trying to run assembly programs under Windows or MacOs.
I am a big fan of retro-machines, and feel that they are easier to learn, as the assembly is only 8 bits, and you can actually build something that runs. But it might only make sense if you are already familiar with those machines, and it won't enable you to fully understand modern CPUs, but it might be quicker to decide if it is fun or not.
Anyways, I kind of liked this series on ARM assembly: https://www.youtube.com/watch?v=kKtWsuuJEDs&list=PLn_It163He32Ujm-l_czgEBhbJjOUgFhg - both because ARM has a nice instruction architecture that is easy to comprehend, and because the course uses an emulator, so you can "see the code running", but as with everything else it is probably very much up to your individual taste.
Only-Percentage4627@reddit
Jumping to this comment Can you give some examples of the retro thingy and what you can do? I don’t know anything about that but it sounds fun
peterlinddk@reddit
I'm not sure I entirely understand you, but I was thinking of old machines from the 1980s, like Apple ][, Commodore 64, ZX Spectrum or maybe even an IBM PC with an 8088 running DOS. There are plenty of tools and emulators for all of these old machines, and they are so small and simple that you can write a few short lines of assembly and immediately get results, like this short program for the Commodore 64 that prints every character to the screen:
Doesn't require a lot of libraries and other programs to run, just works immediately - but of course, also a lot harder to do more complicated stuff, like multiplying numbers and the like :)
Only-Percentage4627@reddit
Ah okay, I think I misunderstood you. I was thinking of retro consoles or doing stuff with them for some reason. But this also sounds fun to mess around with. Thank you for answering
peterlinddk@reddit
Maybe I should have said vintage rather than retro :) But I guess that doing something on a NES or SNES could also be fun - but personally I'm 'scared' of anything newer than the PS1 :D
delicioustreeblood@reddit
nice one
Buntygurl@reddit
Proficiency in Assembly Language all has to do with the specific CPU architecture of the machine you're working with.
Read as much code as you can and experiment with your own.
HashDefTrueFalse@reddit
MIPS is fairly simple to get started. If you know roughly what's happening already you can start here and then do further research: https://learnxinyminutes.com/mips/
ARM(v8-A) is pretty common and some design decisions make it far easier than AMD64/x86_64 to work with (IMO, I suppose). Just google for it. Anywhere will do. I originally learned a few ISAs by messing around with OS development, piecing things together from the ISA manuals and all sorts of blog articles and old university web pages.
NAND2Tetris and CS50 are good for "under the hood" curiosity too.
Full_Advertising_438@reddit
Do the Curse Nand to Tetris or read the book: the elements of computing systems There you build a 16bit CPU. You can skip the Hardware part and start with the Assembly build. 🤙 The book or the online PDF is well written.
https://www.nand2tetris.org/
fredlllll@reddit
http://x86asm.net/index.html can be a good start. or https://flatassembler.net/
Frolo_NA@reddit
this will get you started. https://cs.lmu.edu/~ray/notes/nasmtutorial/
there are also some youtube channels that focus entirely on low level stuff and ASM