Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to learn x64 assembly from? [closed]

Okay so I know C++, C#, Java and some other languages and I decided to learn assembly next but I feel like I've hit a solid brick wall right from the start. I just need someone to point me in the right direction.

Here are the questions:

  1. I've been told that it's better to learn assembly from the internet than from books because assembly depends on your hardware and books are mostly outdated. Is that true?

  2. I've got a 64 bit CPU and I'm using (or at least trying to use) FASM. Where do I find the necessary documentation?

  3. I'm totaly confused because most of the tutorials I've seen don't even work for me. Is that because of the hardware differences? How do I find the right tutorials?

  4. Can I run x86 and x32 assembly on my 64 bit computer?

  5. Could you please be so kind and write me a simple program in assembly (that works on my PC) with a breakdown in the comments? I'm running 64 bit Windows 10 on my intel core i5 CPU. Please.

like image 931
AlanKalane Avatar asked Aug 26 '15 22:08

AlanKalane


People also ask

Is there x64 assembly?

For years, PC programmers used x86 assembly to write performance-critical code. However, 32- bit PCs are being replaced with 64-bit ones, and the underlying assembly code has changed. This Gem is an introduction to x64 assembly.

Is it possible to learn assembly language?

Yes - the primary reason to learn assembly for C and C++ developers is it helps understanding what's going on under the hood of C and C++ code.

Is assembly code hard to learn?

Assembly is hard to read and understand. Of course, it's very easy to write impossible-to-read assembly language programs. It's also quite easy to write impossible-to-read C, Prolog, and APL programs. With experience, you will find assembly as easy to read as other languages.


1 Answers

I think this is a valid question. It can be a bit hard to find up to date information on assembler.

  1. Yes. A lot of resources printed and online describe i386 (x86) assembler and not the new amd64 (x86_64). Many things have changed, e.g. function arguments used to be passed on the stack but now they are passed in registers. This applies both to Unix and Windows.

    Basically, ensure you are reading about 64-bit assembly.

  2. Why not try the online manual. Note that assemblers are not that different when it comes to simple stuff.

  3. I don't have Windows but if you are having trouble with any specific program, you could ask about it here. You will need to post the actual failing program.

  4. Yes but you have to link it against 32-bit libraries and use the 32-bit version of the Win32 API. But if you're starting out, why program in the 1980's when you can work with the modern instruction set?

  5. Try this.

Also, if you are going to be programming in assembly, I strongly recommend you get a debugger. I use GDB which works well and is free, on Windows you get to use the Visual Studio debugger which is superb.

like image 144
jforberg Avatar answered Oct 01 '22 20:10

jforberg