X86-64 a central processing unit (CPU) 16 contains a set of 64-bit values stored in general-purpose registers . These registers; and pointers for storing integer data.
1 and 2 for the generation of byte instruction byte number of holding remaining byte unchanged ; generating a 4-byte number of the instruction will high-order 4 bytes set to zero .
3.4.1 Number of operational indicators
Most instructions have one or more numbers (the operand) operation , source data value indicating a performed operation to be used, and placing the results object position. The possibility of various operands are divided into three types . The first is immediate (immediate) ; a second register (Register) ; a third memory references .
There are many different addressing modes .
3.4.2 Data transfer instructions
Is the most frequently used instructions to copy data from one location to another location command.
The most simple data transfer instruction - MOV class .
Example MOV instruction:
moving packed instruction following:
extension:
tips
: Assembler always quadword register memory references.
movb $0xF, (%eax)
Behind the operand of an instruction is wrong.
3.4.3 Data transfer Example
Good practice:
answer (reverse):
3.4.4 push and pop the stack data
A quadword value pushed onto the stack, the stack pointer is decremented first of all to 8, the value is then written to the new stack address. E.g:
pushq %rbp
Equivalent to
Decrement stack pointer
subq $8, %rsp
Store %rbp on stack
movq %rbp, (%rsp)
Specific process is as follows: