Where to learn Assembly?
1 hour ago, EvilCat70 said:Hey. I'm wanting to learn Assembly but I can't find anywhere on where to do it. I've been searching for hours on tutorials but none of the code they wrote actually works. I use Visual Studio 2019 and MASM to write in Assembly and nothing is working at all. I just want to write a Hello World program, but I can't even seem to do that. Where can I find a source of tutorials that actually work. It's frustrating to learn something if none of the sources of information are actually correct.
The first thing you need is the programming manual for the ISA the CPU uses. I'm going to assume you're using x86, so here's the programming manual for that: https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-instruction-set-reference-manual-325383.pdf. There may be some implementation differences between Intel and AMD processors, but you'll largely never encounter this for casual programming.
As for programming in assembly itself, this may help https://www.tutorialspoint.com/assembly_programming/. And they're using x86 so it should be useful for your specific case.
Also writing "Hello world" in assembly isn't going to be as easy as most other languages, mostly due to the fact that the input/output is not as abstracted and is dependent on the OS. For example, this is how to do it in Linux (and BSD and BeOS): http://asm.sourceforge.net/intro/hello.html
I highly recommend learning assembly outside of an OS environment, i.e., on bare metal. When you're talking in the hardware's language, it helps if you can directly manipulate it without constraint. Modern OSes will do everything they can to prevent you from doing this (at least, if you're running your app with userland privileges).
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now