
Ask HN: What's the best resource for learning modern x64 assembly? - ssklash
I&#x27;ve found lots of resources for x86, but considerably less for x64. Pentester Academy has a promising course on it, along with shellcoding, but I&#x27;m not sure what else is out there.
======
jng
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 either, protected mode
consists of quite a lot of complications on segment registers, virtual memory
addresses (which you can mostly ignore as an applications programmer as
compared to a kernel or driver programmer), and interruptions.

I wrote a book to learn x86 programming and it was published in 1994 back
before "real digital age", oriented to be the best didactical text possible (I
had to learn the hard way, I wrote what I would have had to read 10 years
earlier). Over 20 reprints, recommended in all Spanish-speaking universities
(yeah, I know, if I had known then what I know now I'd have done it in
English). It was discontinued 10 years ago or so, they asked me to revise it
for the modern world, and it didn't really make sense: rewriting it for what
assembly language is and is used for in today's world would be a ton of work
because it's a qualitative difference, and if I added an extra chapter
explaining 32-bit and 64-bit changes and letting the publisher stamp a "2010
edition" logo on the cover would just be scamming people, which I don't want
to do. Here is the link to a scanned copy of the original:
[https://www.dropbox.com/s/sz6rinfhyc8sai6/Lenguaje%20Ensambl...](https://www.dropbox.com/s/sz6rinfhyc8sai6/Lenguaje%20Ensamblador%20de%20los%2080x06%20-%20Jon%20Beltr%C3%A1n%20de%20Heredia.pdf?dl=0)
. Could prove useful if you can speak Spanish.

Honestly: I learned Z80 assembly first, in the 80s, and then switched to x86
very easily. Learn whatever assembly language first, what's hard is learning
about registers, flags, memory... and if you learn it will, then you can
switch to another architecture quite easily.

~~~
indigochill
>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 they divide each layer of complexity is great
practice even in software. [https://www.coursera.org/learn/build-a-
computer](https://www.coursera.org/learn/build-a-computer)

Microcorruption, a series of incrementally difficult MSP430 (an easy-to-
understand 16-bit instruction set) exploitation exercises in the browser:
[https://microcorruption.com](https://microcorruption.com)

These are both geared towards being a gentle introduction to assembly and CPU
architecture principles. They don't touch certain facts of X86/64 processors
like pipelining or variable-length instructions, but IMO those are best left
until you're comfortable with the basics.

~~~
barbecue_sauce
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.

~~~
vips7L
[http://opensecuritytraining.info/](http://opensecuritytraining.info/)

For those interested.

------
anonsivalley652
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 (for non-Windows):

\- gdb/lldb

\- assemblers: yasm, nasm, binutils (contains "as")

Optional tools:

\- IDA Pro

\- Virtualization/emulation such as VMware Fusion/Workstation (because it
supports being a gdbserver), VirtualBox or QEMU

\- Intel's CPUID app

You also need good references like:

\- the Intel manual set (a giant PDF or a collection of several)
[https://software.intel.com/en-us/articles/intel-
sdm](https://software.intel.com/en-us/articles/intel-sdm)

\- [https://sandpile.org](https://sandpile.org) (fairly current)

\- [https://ref.x86asm.net](https://ref.x86asm.net) (outdated by useful)

Another helpful exercise is writing a toy operating system in Rust or only
assembly. [https://osdev.org](https://osdev.org) has many resources and
guides.

~~~
Godel_unicode
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](https://github.com/NationalSecurityAgency/ghidra)

~~~
anonsivalley652
Yep. It's a FOSS-quality disassembler; good if you don't have IDA (I wish),
supports maybe 10% of what IDA does in total but has some other niceities that
it doesn't (think: disassembler-equivalent of LLVM). (Ideally, you'd have
both.) For those who don't know, IDA disassembles basically every
unclassified, commercially-available architecture and
executable/library/object container format (think: disassembler-equivalent of
GCC if it were an IBM or Green Hills product -:P). It also has a built-in
scripting API in Python(?), IIRC.

An interesting semi-abandonware static disassembler that was really good is
Sourcer 8.01 from V-Communications. I think it supports Pentium II/Pro/III at
most, which would include real, protected mode and long mode DOS/DOS
extended/Win16/Win32 EXEs and COMs IIRC. It did a lot of memory typing and
clever analysis long before IDA existed, and still interesting for retro
computing.

[https://www.vetusware.com/download/Sourcer%208.01%208.01/?id...](https://www.vetusware.com/download/Sourcer%208.01%208.01/?id=8677)

~~~
Godel_unicode
You might be interested in this talk from the creator of IDA, Ilfak Guilfanov,
explaining how he used Sourcer and it's shortcomings lead directly to him
creating IDA.

[https://m.youtube.com/watch?v=hLBlck1lTUs](https://m.youtube.com/watch?v=hLBlck1lTUs)

------
rramadass
Assuming you are interested in learning not just Assembly but how to use it in
conjunction with a high-level language (almost always C/C++);

Background:

\--- Matt Pietrek's "Just Enough Assembly Language to Get By" \-
[http://bytepointer.com/resources/pietrek_asm_pt1.htm](http://bytepointer.com/resources/pietrek_asm_pt1.htm)

\--- Hongjiu Lu "ELF: From The Programmer's Perspective" \-
[http://beefchunk.com/documentation/sys-
programming/binary_fo...](http://beefchunk.com/documentation/sys-
programming/binary_formats/elf/elf_from_the_programmers_perspective/elf.html)

Books:

\--- Computer Systems: A Programmer's Perspective (3rd Edition) by Bryant &
O'Hallaron - [https://www.amazon.com/Computer-Systems-Programmers-
Perspect...](https://www.amazon.com/Computer-Systems-Programmers-
Perspective-3rd/dp/013409266X/ref=sr_1_1?crid=26HEH06VOP2XL&keywords=computer+systems+a+programmer%27s+perspective+3rd+edition&qid=1581230329&s=books&sprefix=computer+ssytems%2Cstripbooks-
intl-ship%2C515&sr=1-1)

\--- Modern X86 Assembly Language Programming by Daniel Kusswurm -
[https://www.amazon.com/Modern-X86-Assembly-Language-
Programm...](https://www.amazon.com/Modern-X86-Assembly-Language-
Programming/dp/1484240626/ref=sr_1_1?keywords=modern+x86&qid=1581228086&s=books&sr=1-1)

\--- Low-Level Programming by Igor Zhirkov - [https://www.amazon.com/Low-
Level-Programming-Assembly-Execut...](https://www.amazon.com/Low-Level-
Programming-Assembly-Execution-
Architecture/dp/1484224027/ref=sr_1_1?crid=Y2MOWSFXW7TL&keywords=low-
level+programming&qid=1581229802&s=books&sprefix=Low-level+progr%2Cstripbooks-
intl-ship%2C512&sr=1-1)

------
blendergeek
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/](https://csapp.cs.cmu.edu/)

~~~
abnercoimbre
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/](https://csapp.cs.cmu.edu/)

~~~
wadkar
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!

------
ajross
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.

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

~~~
ajross
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 air! Your code
could be separate from your stack and from your heap, and all three could be a
full 64k without any crazy bank switching or copying! And all you had to do
was set up 4 segment selectors and then ignore them. And everything you were
used to running did so in a clean, unconstrained environment.

Really, read that 8086 datasheet again (it's like 8 pages), it was great stuff
at the time.

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

------
eldavido
It 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? why it's
useful and can sometimes be omitted)? Learn this stuff first.

Once you have a good handle on C, you need to start learning how operating
systems and memory management work, at least the "client side" of them
accessible from userspace.

Then you might want to dip your toe into how CPUs are built, with pipelines,
registers, caches, all of that.

If you've mastered those things, gcc -S will provide everything else you need
(another comment suggested this).

I learned this stuff in a traditional university computer engineering program.
It helped a lot. But for context, this question feels a little like, "can
someone explain quantum physics"? It's a huge topic but only like 5% is the
actual thing you're asking about, the other 95% is the conceptual machinery
(calculus, probability, mechanics) it's built on. Mastering all the other
stuff is actually the hard part. For all intents and purposes, assembly is
just a notational convenience for expressing program structure in the only way
a CPU can understand it. At least 90% of the difficulty is understanding how
CPUs work, and how to think at sufficiently low level that you can express
human-useful work at such a low level of abstraction.

It would also be nice to know why you want to know this. Writing a device
driver is going to be different from writing an operating system, which will
be different from writing tight numerical loops in assembly. And in any case,
dollars to donuts you won't be able to beat a modern optimizing compiler
performance-wise.

Hope this helps.

~~~
Nightshaxx
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 to get a solid grasp.

~~~
eldavido
I'd recommend writing something you might have used or be familiar with, in
bare-metal C. Maybe try writing a simple web server, which is something most
people will be familiar with. Try doing it a couple different ways: single-
threaded, prefork (processes), event-based with select/kqueue/epoll. Write
your own data structures: hash tables, linked lists, etc.

This sounds simple but will give you a good tour of a lot of different areas:
BSD sockets, named pipes/unix domain sockets for cross-thread communication,
signals, memory management, threading, basic scheduling, and parallel
programming (locks/concurrency), to name a few.

------
htfy96
For practice and user-mode stuffs [https://godbolt.org/](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.

~~~
mkl
> valueless

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](https://en.wiktionary.org/wiki/valueless)

~~~
copperx
Thanks. I had to read the original sentence multiple times; for a moment I
thought I was having a stroke.

------
earenndil
[https://beginners.re/](https://beginners.re/)

~~~
DyslexicAtheist
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](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_

~~~
earenndil
> Also it IS a beginners books because he makes no assumptions about the
> readers previous experience

I've just started going through it, and it's definitely made some assumptions
about prior knowledge; I doubt I would have been able to get through it if I
didn't already have some assembly knowledge.

------
moggi
Especially if you need x64 assembly for performance optimization or during
profiling a combination of godbolt
([https://godbolt.org/](https://godbolt.org/)) and Agner Fog's incredible PDFs
at [https://agner.org/optimize/](https://agner.org/optimize/) (especially
parts 2, 3 and 4) are helpful.

The 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.

------
tony_codes
I wrote a guide a while back that may help. It includes a docker container
setup to enable debugging via VS code:
[https://tonycodes.com/assembly](https://tonycodes.com/assembly)

------
vnorilo
Your sources indicate an interest in reverse engineering, but another
motivator for low level machine programming is performance.

For me, a great way of learning the latter is to pick a task with some instant
gratification (audio dsp, software texmapping or shaders?) and start writing
some of that in inline assembly.

I suggest looking at your C compiler output, learning about SIMD instructions
and using a pipeline simulator to see why and how it performs like it does. I
used VTune and AMD Codeanalyst back in the day, don't know what's the current
SoA.

------
oneplane
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...](https://software.intel.com/en-us/articles/introduction-
to-x64-assembly)

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

~~~
asveikau
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.

~~~
chrisseaton
> 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?

~~~
asveikau
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.

~~~
jcranmer
> 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).

------
zelly
It looks intimidating, but there's not actually much to learn. You need to
memorize a couple dozen common opcodes. Keep the Intel manual open and flip to
the page of the opcode. Also the first few sections go into detail about
paging, data types, CPUs, etc. if you don't already know about it.

[https://software.intel.com/en-us/articles/intel-
sdm](https://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](https://en.wikipedia.org/wiki/X86_calling_conventions)

For reverse engineering in particular, this was a good resource:

[https://beginners.re/](https://beginners.re/)

------
_d03
There are some books suited for beginners and these are:

1\. [https://www.amazon.com/Low-Level-Programming-Assembly-
Execut...](https://www.amazon.com/Low-Level-Programming-Assembly-Execution-
Architecture/dp/1484224027/)

2\.
[http://www.egr.unlv.edu/~ed/assembly64.pdf](http://www.egr.unlv.edu/~ed/assembly64.pdf)

3\. [https://www.amazon.com/Introduction-Bit-Assembly-
Programming...](https://www.amazon.com/Introduction-Bit-Assembly-Programming-
Linux/dp/1484921909/)

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](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/](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.

------
znpy
"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.

------
billfruit
I would recommend 'Computer Systems: A Programmers Perspective' by Randal E
Bryant and David O' Hallaron as an introduction before proceeding on to the
official manuals and documentations.

3rd edition has much info on modern x86.

------
2ton_jeff
I wrote a Linux general purpose library for x64 assembler:
[https://2ton.com.au/HeavyThing/](https://2ton.com.au/HeavyThing/) and in
recent months I decided to start doing video tutorials about the "how and why"
of same. Learning I think is made easiest in Linux by learning how to navigate
the syscall interface and how "man 2 write" becomes an important skill. Edit:
Videos link as well:
[https://2ton.com.au/videos/](https://2ton.com.au/videos/)

------
PopeDotNinja
For a soft intro to assembler, you can play video games Human Resource
Machine.

~~~
ssoroka
Or TIS-100

------
markwrobel
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/](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/](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/](http://www.nandgame.com/)

------
basementcat
I found compiler output to be a good resource.

$ gcc foo.c -S

~~~
self_awareness
A little bit more convenient, at least for me:

[https://godbolt.org/](https://godbolt.org/)

------
pjmlp
Others already have given plenty of useful information, I just have a basic
one.

Stay with Intel syntax, nevermind about AT&T syntax, beyond learning on how to
read it.

PC world is all about Intel syntax, AT&T is lower level on how instructions
get expressed and Assemblers macro capabilities just suck compared with what
TASM and MASM were already capable of on the MS-DOS days.

------
kristov
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!!

------
Grimm1
I learned x86 from Xeno Kovah's course and I imagine his x64 will be just as
comprehensive.

It looks like his x64 is just slides instead of videos which may be better,
sitting through 16hrs of video when I was learning x86 was ... an experience,
but a very useful one.

Anyway, whenever someone asks this question I don't hesitate to bring up his
work and trainings I think they're really useful. I know this is for reverse
engineering but if you can reverse engineer x64 you can certainly write it.

[http://opensecuritytraining.info/IntroX86-64.html](http://opensecuritytraining.info/IntroX86-64.html)

------
Talinx
This book is a good starting point for x86-64 Assembly with Linux:
[http://www.egr.unlv.edu/%7Eed/x86.html](http://www.egr.unlv.edu/%7Eed/x86.html)

------
JTechno
x86-64 Assembly Language Programming with Ubuntu By Ed Jorgensen

[http://www.egr.unlv.edu/~ed/x86.html](http://www.egr.unlv.edu/~ed/x86.html)

------
fouc
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.

~~~
vaylian
> 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.

------
TACIXAT
I plan on making some videos on this once I get through web vulns. I've
written x64 on Windows and Linux. On Windows you need to get ml64.exe, it gets
installed with visual studio. You can invoke it from the command line. On
Linux I usually use NASM I think, cause it supports Intel syntax.

The only really annoying thing is the stack alignment for calls. I usually
just make a macro to check rsp and align if needed. Other than that I think it
is similar enough to x86 just with different registers.

------
rboes2
I thought this book was pretty good when I took computer architecture course.
[https://www.google.com/url?sa=t&source=web&rct=j&url=https:/...](https://www.google.com/url?sa=t&source=web&rct=j&url=https://www.amazon.com/Assembly-
Language-x86-Processors-7th/dp/0133769402&ved=2ahUKEwiVsdHOy8PnAhVROH0KHbLeBlkQFjAIegQIBBAB&usg=AOvVaw3Gwhnbo6SX5LuOprpzZzFo)

------
justin66
Kip Irvine's textbook on the subject is good. It's oriented towards Visual
Studio (good, easy debugging) and windows but a fellow student had no problem
using Linux tools to follow along and complete the course, which is not a bad
way learn.

It's useful to at least look at such a textbook to make sure you don't skip
any of the easy, sort-of prerequisite material.

------
simonebrunozzi
I wish there were an equivalent of "core war" [0]. I "played" with it ~30
years ago and I still remember a good chunk of the language.

[0]:
[https://en.wikipedia.org/wiki/Core_War](https://en.wikipedia.org/wiki/Core_War)

------
blackmail
book link ->
[http://vkh8ilkvln.pdfcloud.org/dl2.php?id=174628357&h=7a0f16...](http://vkh8ilkvln.pdfcloud.org/dl2.php?id=174628357&h=7a0f1670c910af068e4a1eb90a0662c4&u=cache&ext=pdf&n=Assembly%20language%20for%20x86%20processors%207th%20editionpdf)

video link ->
[https://www.youtube.com/watch?v=vtWKlgEi9js&list=PLXYpRL4SQp...](https://www.youtube.com/watch?v=vtWKlgEi9js&list=PLXYpRL4SQpMnHL0c6PwSKAHCId3F6uVwi)

linker -> [http://www.masm32.com/](http://www.masm32.com/)

some way to understand assembly lang

------
akullpp
I recommend [Paul Carter's PC
Assembly]([http://pacman128.github.io/pcasm/](http://pacman128.github.io/pcasm/))
which helped me getting started back in my pentesting days.

------
karpos
[https://en.m.wikipedia.org/wiki/Code:_The_Hidden_Language_of...](https://en.m.wikipedia.org/wiki/Code:_The_Hidden_Language_of_Computer_Hardware_and_Software)

------
screed
Start with this one: "Reverse Engineering for Beginners"
[https://torus.company/writings/RE4B-EN.pdf](https://torus.company/writings/RE4B-EN.pdf)

------
vips7L
Not x86_64 but Xeno Kovah's courses were really great to teach me x86:

[http://opensecuritytraining.info/IntroX86.html](http://opensecuritytraining.info/IntroX86.html)

------
TheUndead96
I used this book in university, and it was very informative:
[http://rayseyfarth.com/asm/](http://rayseyfarth.com/asm/)

------
vkaku
We also got plenty of general purpose registers in x64, apart from the rax
stuff.

Plus, you now have the ymm and possibly zmm stuff going on :)

------
vasili111
Maybe not modern but a goood introduction "Assembly Language Step-by-Step".
Good for self study.

------
rawoke083600
Stupid question... can you use assembly for GPU coding ? I mean like in a
semi-practical way ?

------
ifoundthetao
I enjoyed the Pentester Academy course, and have recommended it several times.

------
open86
So when do the patents expire on x86? And can we do a clean room version?

------
snarfy
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](https://software.intel.com/en-us/articles/intel-sdm)

~~~
anonsivalley652
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 when I was making
minimum wage. Haha. X)

\- Programmer's PC Sourcebook

\- PC Intern

\- Undocumented PC

\- Undocumented DOS

\- Programmer's Guide to EGA, VGA ...

\- Michael Abrash books on assembly including self-modifying code and graphics
programming

\- Turbo Assembler Quick Reference Guide

\- Code Complete

Later, the MindShare series were really good.

~~~
snarfy
I remember those books. They were all helpful in teaching assembly, bios, and
general pc programming like serial ports, etc.

None of them really helped with 386 protected mode programming. GDT, LDT,
selectors and descriptors, paging, etc. For that you really needed the
official docs. I printed the 300+ page programmer's guide in the school lab
which they were not too happy about.

------
Digg_mov
i have no thinkint

