
x86 Assembly Guide (2018) - pcr910303
http://www.cs.virginia.edu/~evans/cs216/guides/x86.html
======
CalChris
x86_64 please.

[https://software.intel.com/sites/default/files/m/d/4/1/d/8/I...](https://software.intel.com/sites/default/files/m/d/4/1/d/8/Introduction_to_x64_Assembly.pdf)

[https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatshee...](https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf)

[https://web.stanford.edu/class/archive/cs/cs107/cs107.1194/g...](https://web.stanford.edu/class/archive/cs/cs107/cs107.1194/guide/x86-64.html)

~~~
npo_
These links are amazing. I would have never found these. I've been looking for
good introductory resources for the past few days now. So glad to see this pop
up in my news reader.

Thank you!

~~~
vips7L
Xeno Kovah's courses [0] are excellent for learning assembly.

[0] [http://opensecuritytraining.info/](http://opensecuritytraining.info/)

------
dzdt
This is (2006):

 _Credits: This guide was originally created by Adam Ferrari many years ago,
and since updated by Alan Batson, Mike Lack, and Anita Jones. It was revised
for 216 Spring 2006 by David Evans._

------
xelxebar
In a similar vein, on the quest of understanding yet another abstraction layer
deeper, I've been trying to get to grips with how linking/loading works by
writing some ELFs by hand.

Dynamic linking is giving me some problems though---I can't seem to get ld.so
to do relocs for me. This is almost certainly due to some fundamental
misunderstanding of mine, but I don't have the debugging tools to easily
correct this.

So far I've just been using readelf and LD_DEBUG to perform basic sanity
checking, but now my only idea is to walk through ld.so using gdb.

I'd be much obliged for any suggestions. Cheers!

~~~
urbanslug
Hello, sorry I don't have your solution but I'm in your situation with not
quite understanding linking. I have a lot of issues with linking/calling C++
and C libraries from each other or other low level languages. My background is
in web stuff.

Could you please point me to the resources you used to get to your present
level? Thanks :)

~~~
xelxebar
Unfortunately, I don't really have a satisfying answer for you.

I've picked up most of what I know by haphazzardly putting together
information in man files, Intel manuals, and probably bits acquired over time.

That said, here's what comes to mind; first the man pages:

\- ld.so(8), ldconfig(8): details about interacting with the loader

\- syscall(2): gives some ABI details

\- elf(5): pretty much the ELF specification

Links to books and documentation I've found helpful:

\- Linkers and Loaders, by John R. Levine:
[https://linker.iecc.com/](https://linker.iecc.com/),

\- The glibc wiki:
[https://sourceware.org/glibc/wiki/DynamicLoader](https://sourceware.org/glibc/wiki/DynamicLoader)

\- The Intel x86 manuals: [https://software.intel.com/en-us/articles/intel-
sdm](https://software.intel.com/en-us/articles/intel-sdm)

\- The OS Dev Wiki, in general, is a good resource on low-level details:
[https://wiki.osdev.org/Dynamic_Linker](https://wiki.osdev.org/Dynamic_Linker),
and

\- x86 Opcode and Instruction reference:
[http://www.ref.x86asm.net/](http://www.ref.x86asm.net/)

The last reference above isn't directly about linking, but to make sense of
things like symbol relocations, you need some familiarity with instruction
encoding.

Finally, Brain Raiter has a neat series of blog on his attempt at writing the
smallest ELF files possible. This is what inspired me to write my own ELFs in
the first place. The focus is on ELF, but there is by necessity a discussion
about how linking and loading works in that context:

[http://www.muppetlabs.com/~breadbox/software/tiny/](http://www.muppetlabs.com/~breadbox/software/tiny/)

Happy hacking!

------
andreygrehov
Deep dive - [https://yurichev.com/writings/UAL-
EN.pdf](https://yurichev.com/writings/UAL-EN.pdf)

------
stevekemp
Nice to see those mathematical instructions in a simple list. I spent a while
recently writing a "math compiler", and it started out using integer
multiplication, division, etc.

Now I do it properly with floating-point instructions:

[http://github.com/skx/math-compiler/](http://github.com/skx/math-compiler/)

------
ke2g
Does anyone have something like this for ARM?

