Registers Reference
- Register is a temporary storage built into the CPU itself. So it can contains 64-bit data, (can be a value or a memory address).
General-purpose registers
Callee-saved
(%rbx, %rbp, %r12-%r15): when procedure P calls procedure Q, Q must preserve the values of these registers, ensuring that they have the same values when Q returns to P as they did when Q was called.Caller-saved
(all other except %rsp): they can be modified by any function
Special registers
-
Flag register (rFlags): used for status and CPU control information. The rFlag register is updated by the CPU after each instruction and not directly accessible by programs. This register stores status information about the instruction that was just executed. Of the 64-bits in the rFlag register, many are reserved for future use.
Name Symbol Bit Use Carry CF 0 Used to indicate if the previous operation results in a carry Parity PF 2 Used to indicate if the last byte has an even number of 1’s (even parity) Adjust AF 4 Used to support Binary Coded Decimal Zero ZF 6 Used to indicate if the previous operation resulted in a zero result Sign SF 7 Used to indicate if the previous operation resulted in a 1 in the MSB Direction DF 10 Used to specify the direction (increment or decrement) for some string operations Overflow OF 11 Used to indicate if the previous operation resulted in an overflow -
Instruction Pointer Register (%rip): used by the CPU to point to the next instruction to be executed.