Have you looked at the official docs? Back in 386 days that's all we had. https://software.intel.com/en-us/articles/intel-sdm
In 1993, as a broke high-school student pre-cell-phone and pre-search-engine, we didn't even have that (although we did have BBS phone-number/speeds/protocols/login lists). I had to take the nascent VTA Lightrail (when it was even more uncool) to Computer Literacy bookstore (when programming was also less cool) to find decent technical references... and I promptly dropped a few hundred bucks on dead tree carcasses wh…
Ask HN: What's the best resource for learning modern x64 assembly?
41–50 of 112 posts
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#42Earlier quoted context omitted.
> The old floating point stuff is gone. Do you mean x87? I’m not sure it’s true that it’s gone is it? The instructions are still documented? Do they not work?
I guess I stand corrected. I was under the impression that C compilers don't tend to use it anymore when compiling for amd64. (Because you can assume SSE support on amd64, unlike a binary that might run on an old Pentium.) Then I misread that situation as it not working. It does take effort for an OS kernel to save and restore x87 state, so I could imagine somebody dropping support.
FXSAVE saves the x87 state with the SSE state, and XSAVE generalizes that to add several optional components, depending on what your processor support (as of right now, AVX state, MPX state, 3 for AVX-512, PT state, and SGX state, IIRC).
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#43The other useful step has been to write C functions and compile the code with a good compiler (good experiences with Intel, gcc and llvm) first at -O0 and later at -O2 or -O3 to understand how high level concepts can be translated to assembly.
This requires to have at least a basic understanding of registers and basic assembly concepts but at least has helped me apply the concepts to real code.
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#44https://software.intel.com/en-us/articles/intel-sdm
Try to reverse engineer something you don't have the debug symbols for. One of the big pain points was figuring out the calling convention i.e. what registers correspond to which function arguments on different platforms:
https://en.wikipedia.org/wiki/X86_calling_conventions
For reverse engineering in particular, this was a good resource:
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#45There's no magic anywhere and 99.1% of it is documented. IA-32e/AMD64 is basically an extension of IA-32/x86. What you're looking for is to understand the difference between real mode, 386 protected mode, PAE, paging and long mode because the registers, instructions, addressing and sizes of structures differ. You can learn all of this by reading the Intel software manuals and digging into it yourself. Tools you need…
In addition to IDA, I highly recommend looking into ghidra. It's open source, so you can peak under the hood and see how it does things. https://github.com/NationalSecurityAgency/ghidra
It's worth learning the Ghidra Scripting API because you can write ad-hoc scripts with Jython syntax to automate tasks/do custom analysis.
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#46For practice and user-mode stuffs https://godbolt.org/ is a valueless tool to help you view the output of any C program. Simply write any C program on the left, and add "-O1" in flag inputs. Assembly with color representing line-mappings would appear on the right.
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#47It really depends on your starting point. If you know how to write low-level C (i.e. with direct Win32/POSIX API calls), that's a good start. If you don't know what that means, you need to master this first. So much of assembly is built to support higher-level programming, things like segments, indirect references, system calls, etc., so it pays to know the WHY of all of it (e.g. do you know what a frame pointer is?…
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#48It really depends on your starting point. If you know how to write low-level C (i.e. with direct Win32/POSIX API calls), that's a good start. If you don't know what that means, you need to master this first. So much of assembly is built to support higher-level programming, things like segments, indirect references, system calls, etc., so it pays to know the WHY of all of it (e.g. do you know what a frame pointer is?…
How can I get started on learning the low level c stuff with direct system calls and such. I learned about assembly, pipelining, cache, and memory allocation during a systems architecture course, so I'm really interested in the low level of the machine. The problem is I don't really have an idea of a project that I could do to learn the level right above. Of course I learned a bit during the course, but I really want…
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#49For practice and user-mode stuffs https://godbolt.org/ is a valueless tool to help you view the output of any C program. Simply write any C program on the left, and add "-O1" in flag inputs. Assembly with color representing line-mappings would appear on the right.
You mean "invaluable" here (cannot be given a value, as it's too important). "valueless" is the opposite (worthless)! https://en.wiktionary.org/wiki/valueless
Re: Ask HN: What's the best resource for learning modern x64 assembly?
#50It really depends on your starting point. If you know how to write low-level C (i.e. with direct Win32/POSIX API calls), that's a good start. If you don't know what that means, you need to master this first. So much of assembly is built to support higher-level programming, things like segments, indirect references, system calls, etc., so it pays to know the WHY of all of it (e.g. do you know what a frame pointer is?…