Live data from Hacker News

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

news.ycombinator.com

1–10 of 112 posts

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

#2
As far as I know, x86_64 added instructions, modes and memory address changes but the assembly is the same?

https://software.intel.com/en-us/articles/introduction-to-x6...

I mean, you have different modes, and in 64-bit mode EAX becomes RAX for example.

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

#3
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/

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

#4

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/

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

#5
post #2

As far as I know, x86_64 added instructions, modes and memory address changes but the assembly is the same? https://software.intel.com/en-us/articles/introduction-to-x6... I mean, you have different modes, and in 64-bit mode EAX becomes RAX for example.

I agree with this, if you are competent at 32-bit those skills are going to translate. It is mostly the same.

Some exceptions that come to mind:

* The old floating point stuff is gone. EDIT: guess I am wrong on that, was thinking of what compilers typically generate for the architecture.

* The C abi now tends to focus on pass-by-register for the first few arguments.

* If you are working in kernel mode, some stuff is going to necessarily look different.

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

#8

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/

First result in DDG for the book title ;-) But the third edition is the one I like. Thank you.

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

#9
Honestly? Learn old-style 8086 assembly, then 386 code. The new stuff may be architecturally simpler in many ways, but it sits as an edge case on top of a very thick historical stack that seems completely insane if you look at it a priori.

But the early CPUs were actually quite simple! At the time "CISC" was a good thing because it provided straightforward mechanisms for expressing things (e.g. "push", "call", load a struct field with an offset...) that real world programmers needed to do all the time.

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

#10
post #5
post #2

As far as I know, x86_64 added instructions, modes and memory address changes but the assembly is the same? https://software.intel.com/en-us/articles/introduction-to-x6... I mean, you have different modes, and in 64-bit mode EAX becomes RAX for example.

I agree with this, if you are competent at 32-bit those skills are going to translate. It is mostly the same. Some exceptions that come to mind: * The old floating point stuff is gone. EDIT: guess I am wrong on that, was thinking of what compilers typically generate for the architecture. * The C abi now tends to focus on pass-by-register for the first few arguments. * If you are working in kernel mode, some stuff is…

> * The old floating point stuff is gone.

It actually can be used, if you write by hand, at least in Windows.

Post reply on HN