What is RAX Assembly?

rax is the 64-bit, “long” size register. It was added in 2003 during the transition to 64-bit processors. eax is the 32-bit, “int” size register. It was added in 1985 during the transition to 32-bit processors with the 80386 CPU.

What is RSP register?

The first lines of the function main refers to rbp and rsp ; these are special purpose registers. rbp is the base pointer, which points to the base of the current stack frame, and rsp is the stack pointer, which points to the top of the current stack frame.

What does MOVQ do in assembly?

The movq instruction moves the 1st argument (passed in %rdi) to its place on the stack. The argument occupies the first stack position (stack entries are 8 bytes) after the base pointer (%rbp). 0(%rbp) stores the previous frame’s base pointer.

What is the RSP register used for?

The %rsp register is used as the “stack pointer”; push and pop are used to add/remove values from the stack. The push instruction takes one operand: an immediate, a register, or a memory location. Push decrements %rsp and copies the operand to be tompost on the stack.

What is RSP used for?

The rsp and the rbp are used to keep track of the stack frame. With rbp referring to the base pointer (the previous top of the stack) and rsp pointing (ideally) always to the current top of the stack. mov rbp rsp // This puts the base pointer at the current head of the stack pointing at the, just pushed, old rbp.

Is Al part of EAX?

RAX, which hold a 64-bit value, and where EAX is mapped to the lower 32 bits. Writing AL, AH, or AX leaves other bytes unmodified in the full AX/EAX/RAX, for historical reasons. i.e. it has to merge a new AL into the full RAX, for example.

What means EAX?

It stands for a general purpose register. The 16 bit AX register can be addressed as AH (high byte) and AL (low byte). The EAX register is the 32 bit version of the AX register. The E stands for extended.

What does MOVQ mean?

movq (assuming you’re talking about x86) is a move of a quadword (64-bit value). This particular instruction: movq (%rsp), %rsp. looks very much like code that will walk up through stack frames.