Live data from Hacker News

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

news.ycombinator.com

71–80 of 112 posts

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

#72
As others points out NAND to Tetris is a really good entry point to learn assembly. It begins with you designing the hardware from NAND gates. You will make all hardware components like memory, instruction decoder, ALU, and CPU, and put them together into a computer. The next step is to build a virtual machine and then a compiler for a high-level language called Jack. The keystone project is to build a game in Jack and have it run on the computer that you build :)

https://www.nand2tetris.org/

I have since then ventured into Motorola 68000 assembly coding, by reading an old Amiga course in machine code from the late 80'ties. It's fascinating to learn from an old platform like the Amiga 500.

To keep myself motivated, I have written a lot of posts that chronicles my progress through the course.

https://www.markwrobel.dk/project/amigamachinecode/

EDIT: I can also recommend this game, that is inspired by NAND to Tetris. Where you build the hardware in your browser :) http://www.nandgame.com/

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

#75
post #37

Earlier quoted context omitted.

I think segmented memory really hampered my ability to learn 8086 assembly well. It really made a mess of just about everything.

It... kinda didn't though. I mean, yes, it seems complicated when you look back and ask "why can't it just have been a flat space", etc... But the same point persists: you have to look at what came before. Take a look at the complexities of 8080/Z80 or 6502 addressing modes, or the kind of tricks "big" 16 bit architectures like the PDP/11-70 were playing to stretch addressible memory. The 8086 was a breath of fresh a…

Never thought in this way in those years. But work is like this. Great perspective.

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

#76
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…

Little warning, Microcorruption may be no longer monitored at this time. Account registration is not automated.

A hacker I closely follow tried to play Microcorruption during a Twitch broadcast, and, to my great disappointment, he was unable to due to lack of response.

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

#78
I'm learning Z80 for programming the rc2014 kit (it's really nice kit if your also into electronics). There is a surprising lack of information online about the techniques of programming. For me that's the biggest struggle. You can know the instructions but juggling registers in an optimal way is hard. I'm currently learning I can use the stack inside a routine to have more values in the air at the same time, but then I read some example code and learn a particular instruction can be used in a clever way to avoid all my stack juggling. I am finding it can take hours to write a simple routine. I really get it now when people write it's a non-trivial problem to map C to assembly (especially Z80). Hell, it's fun though! Screw all these high level languages, let's do everything in assembly and damn the horses!!

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

#79
post #45

Earlier quoted context omitted.

It's way better than IDA Pro. I have used the Pro version with the Hex-Rays decompiler. Ghidra is legitimately better. I wouldn't recommend IDA to anyone at this point because I don't see it having much of a future (sorry not sorry). It's worth learning the Ghidra Scripting API because you can write ad-hoc scripts with Jython syntax to automate tasks/do custom analysis.

I was using ghidra for one of my uhh research projects earlier and I actually found the decompiler from hex rays still does better in some cases. In ghidra sometimes it times out and fails to decompile. Maybe I'm not using it correctly? I haven't begun exploring what kind of plug-ins and stuff it has, maybe that helps?

For me ghidra is better with c++ disassembling than hex ray, but hex ray is better with c style assemblies

Thanks to the better RTTI Analyzer

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

#80

https://beginners.re/

this is hands-down among best that are out there (and it's free). It is known under 2 names[1] which might be a bit confusing but it _IS_ about assembly.

see this HN thread (450+ points) discussing the book at the time: https://news.ycombinator.com/item?id=21640669 It is also constantly updated.

This books is to ASSEMBLY what Richard W. Stevens is to TCP/IP and UNIX programming. Also it IS a beginners books because he makes no assumptions about the readers previous experience. It is very thorough so it's probably the only book you'll ever need on Assembly :)

___

[1] explanation from the author:

> What is with two titles? The book was named “Reverse Engineering for Beginners” in 2014-2018, but I always suspected this makes readership too narrow. Infosec people know about “reverse engineering”, but I’ve rarely hear the “assembler” word from them. Likewise, the “reverse engineering” term is somewhat cryptic to a general audience of programmers, but they know about “assembler”. In July 2018, as an experiment, I’ve changed the title to “Assembly Language for Beginners” and posted the link to Hacker News website, and the book was received generally well. So let it be, the book now has two titles. However, I’ve changed the second title to “Understanding Assembly Language”, because someone had already written “Assembly Language for Beginners” book. Also, people say “for Beginners” sounds a bit sarcastic for a book of ~1000 pages.The two books differ only by title, filename (UAL-XX.pdf versus RE4B-XX.pdf), URL and a couple of the first pages

Post reply on HN