- Sections 6.8 and 7.9 of the textbook
- x86-64 Machine-Level Programming by Randy Bryant and David O’Hallaron
- Confusing variations
- Introductory to Assembly lecture notes from CMU
- AT&T vs Intel syntax
- Introduction to x64 Assembly by Intel
- Encoding real x86 Instructions
- Huge collections of documents
There is also an
rip register that holds the instruction pointer
FLAGS register that contains condition codes.
Arithmetic and logical operators
Many C operators can be implemented in a single instruction, such as,
the size of the operands.
There are multiply and divide instrutions,
that require special handling because they store their
results in two registers.
The relational operators can be handled by two-instruction sequence.
The first instruction is a
cmpS and the second instruction is one of
! can also be handled with an
All of the instructions mentioned above have two operands. At most one of the operands can specify a memory location.
|| operations can short circuit, they must
be implemented with conditional jumps.
There is also a
movS for moving data.
doesn’t like the
This is a hard one.
It all means that the x86 architecture can do the following in one
x = o->v[i]
o is a pointer to a structure which contains
an array of integers.