Live data from Hacker News

Ask HN: What's the best resource for learning modern x64 assembly?

news.ycombinator.com

81–90 of 112 posts

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#81

There'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…

> IA-32e I’ve never seen this name before. Where does it come from? AMD call it AMD64. Intel call it Intel 64. Why do we need even more names for the same thing beyond these two?! x86_64, x86-64, x64, AMD64, amd64, Intel 64, EM64T, all mean the same thing!

It's an older reference but it checks out.

When Intel was developing Itanium they named the new architecture IA-64 and retroactively named their 32-bit x86 line IA-32.

After AMD released "AMD64" Intel started copying the AMD 64-bit extensions. IA-32e was a short lived name and Intel started using "Intel 64" to refer to the 64-bit extension of x86 and continued using IA-64 for the Itanium VLIW CPU line.

https://en.wikipedia.org/wiki/X86-64#History_2

After several years of denying its existence, Intel announced at the February 2004 IDF that the project was indeed underway. Intel's chairman at the time, Craig Barrett, admitted that this was one of their worst-kept secrets.

Intel's name for this instruction set has changed several times. The name used at the IDF was CT (presumably[original research?] for Clackamas Technology, another codename from an Oregon river); within weeks they began referring to it as IA-32e (for IA-32 extensions) and in March 2004 unveiled the "official" name EM64T (Extended Memory 64 Technology). In late 2006 Intel began instead using the name Intel 64 for its implementation, paralleling AMD's use of the name AMD64.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#82

Earlier quoted context omitted.

> IA-32e I’ve never seen this name before. Where does it come from? AMD call it AMD64. Intel call it Intel 64. Why do we need even more names for the same thing beyond these two?! x86_64, x86-64, x64, AMD64, amd64, Intel 64, EM64T, all mean the same thing!

It's an older reference but it checks out. When Intel was developing Itanium they named the new architecture IA-64 and retroactively named their 32-bit x86 line IA-32. After AMD released "AMD64" Intel started copying the AMD 64-bit extensions. IA-32e was a short lived name and Intel started using "Intel 64" to refer to the 64-bit extension of x86 and continued using IA-64 for the Itanium VLIW CPU line. https://en.wik…

I wonder where the x86-64, x86_64, and (the most strange of all) x64 names came from.

I think we should call it AMD64, since that's what the people who actually designed it wanted it to be called.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#84

Here is a book on computer architecture that has a good section on x86-64 assembly language. Please note that I have edited this comment to reflect a change suggested by a cold comment. This book (the third edition) introduces x86-64 assembly very well. https://csapp.cs.cmu.edu/

Excellent recommendation, but why the 2nd edition? The home page[0] defaults to the latest one which is based on x64 from the get go. [0] https://csapp.cs.cmu.edu/

Came here to recommend the same. You can find the 15-213 course videos online. I have done the course and can’t recommend it enough. Do the labs, sincerely. You’ll learn a lot!

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#85
"Assembly Language Step-by-Step Third Edition" 3rd Edition by Jeff Duntemann is a great book.

It starts with the very foundation and builds up, up to interfacing with C and implementing data structures, still in assembly.

Sadly, this book still references 32-bit ISA. My guess is that the author got old enough not to bother updating the book anymore (the first editions of the book were about assembly programming in DOS, then DOS and Linux, then Linux only).

Still a very valid book, as x86-64 is backwards-compatible with 32-bit x86. Also, as somebody else has written, once you understand the basics, you can mostly swap things like register names and/or look to the reference pages of your cpu/linker/assembler.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#86
There are some books suited for beginners and these are:

1. https://www.amazon.com/Low-Level-Programming-Assembly-Execut...

2. http://www.egr.unlv.edu/~ed/assembly64.pdf

3. https://www.amazon.com/Introduction-Bit-Assembly-Programming...

The first one is somewhat written in "weird English" (Russian English?), but it is still readable. It really helped me with x64 assembly as a C programmer. I have used 2 and 3 as reference most of the time and the first was basically my "main x64 assembly book". I would also recommend getting more proficient in C programming either by studying books such as "Expert C" and the "The C Programming Language" or reading "advanced" stuff somewhere on the Internet, e.g.: http://www.pvv.org/~oma/DeepC_slides_oct2011.pdf

The main takeaway in all this for me was learning about the call stack and the different calling conventions which gives you a clue on how recursion works under the hood.

Also when you are done learning about "practical computer architecture", i.e. assembly language programming, learn stuff about operating systems as well:

http://pages.cs.wisc.edu/~remzi/OSTEP/

Fun fact: this is not really related to assembly programming, but functions such as setjmp() and longjmp() are used for implementing exception handling.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#87
post #61

I know this isn't quite what you're asking, but I really recommend "Assembly Language Step By Step, Third Edition" by Jeff Duntemann One of the best 32bit x86 assembly books out there.

> One of the best 32bit x86 assembly books out there.

I think it is one of the best books about fundamental computer programming overall. Even if you don't program in assembly afterwards, you will take away a much better understanding of how computers operate. Sure, it is still a beginner book and it doesn't go into much detail, but the parts it explains, it explains very well.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#89
post #25

If you basically don't know how to code in assembly, learn 16-bit x86 with whichever method you find, it won't be wasted. You can extend most of the knowledge from 16 to 32 bit substituting register names ax,bx,cx,dx,si,di,bp,sp y eax,ebx,ecx,edx,esi,edi,ebp,esp. You can extend that to 64 bit with rax,rbx,rcx,rdx,rsi,rdi,rbp,rsp. Learning 16-bit x86 will have you learn about segment registers, but it isn't wasted eit…

>Learn whatever assembly language first On this front, I can highly recommend these two resources, preferably in this order for someone totally new to assembly: NAND to Tetris, a course that will have you build an emulated general-purpose CPU from first principles even with no prior knowledge. You'll learn exactly about registers and memory by making them. I even recommend this to non-hardware people because the way…

I also recommend Xeno Kovah's OpenSecurityTraining courses on YouTube, some of which are specifically dedicated to assembly. The audio quality can sometimes be pretty bad, but the information is good. Though they try to obfuscate things a little bit, these are clearly workshops given to researchers at Mitre, the CVE project maintainer.

Re: Ask HN: What's the best resource for learning modern x64 assembly?

#90

Earlier quoted context omitted.

It's an older reference but it checks out. When Intel was developing Itanium they named the new architecture IA-64 and retroactively named their 32-bit x86 line IA-32. After AMD released "AMD64" Intel started copying the AMD 64-bit extensions. IA-32e was a short lived name and Intel started using "Intel 64" to refer to the 64-bit extension of x86 and continued using IA-64 for the Itanium VLIW CPU line. https://en.wik…

I wonder where the x86-64, x86_64, and (the most strange of all) x64 names came from. I think we should call it AMD64, since that's what the people who actually designed it wanted it to be called.

> I wonder where the x86-64, x86_64, and (the most strange of all) x64 names came from.

The "x86-64" name is the original one, and came from AMD themselves: https://web.archive.org/web/20000817071303/http://www.amd.co... (and "x86_64" is obviously an alias for where a hyphen is not an allowed character, like identifiers on many programming languages).

The "x64" name came from Microsoft, probably due to file name length limitations (this was before Windows XP unified the Windows 9x and Windows NT lines).

IIRC, the "AMD64" name came later, probably to distinguish it better from Intel's IA-64 (Itanium).

Post reply on HN