This is a sort of tutorial on programming in assembly using the
x86-64
or amd64
instruction set valid for the AMD64 and EM64T processors.
It is advisable you have a copy of the instruction manuals at your disposal. It is assumed that you are familiar with the x86-64 instruction set. Familiarity takes time and it comes with practice, and of course reading the instruction manuals. But you have to start somewhere. This tutorial is for application programming.
-
The x86-64 processor has the following sixteen 64-bit general purpose registers:
RAX, RBX, RCX, RDX, RDI, RSI, RBP, RSP, R8, R9 , R10, R11, R12, R13, R14, R15
. - The eight 80-bit floating point registers are from
ST(0)-ST(7)
. - These floating point registers overlap with the eight 64 bit media registers
MMX0-MMX7
. - There are sixteen 128-bit media registers
XMM0-XMM15
as well. - There also exist two other 64-bit registers, the instruction pointer
RIP
and the conditional flags registerRFLAGS
.
From the ABI the general purpose registers are used to pass arguments to the functions.
As of this writing, in 2006, the code has been tested with the YASM assembler on a GNU/Linux operating system called Slamd64 which is a 64-bit Slackware clone, with the Linux kernel version 2.6
.
2020 Update: We have updated the code and compile instructions to run on Debian-based systems from 2020. Slamd64 is now a dead project.