3

What does the code below exactly mean?

lea rdx,qword ptr ss:[rbp+50]

I have difficulty in rbp+50. Is rbp the base pointer in the 64 bit CPU architecture? What is the base pointer refering to? how can I find out the value at rbp+50? what does ss mean? what does qword mean? I totally confused with these terms.

1

1 Answer 1

10

The code means rdx = rbp + 50.

For the explanation, we'll go bottom up...

qword is 8-bytes (64 bits). It stands for quad-word, same as dword stands for double-word. It is the size of every rXX register. The qword ptr means that we are accessing a qword sized memory block (as oppised to a byte, word or dword).

ss stands for stack-segment. However, in non 16-bit systems all segments are usually mapped to 0. It is probably shown in the code as an artifact of the dis-assembly as the rbp register is used to point into the stack.

The lea commands mean load-effective-address. It does not take the value at the given address, but rather the address itself. So in pseudo code we can rewrite the entire thing as rdx = rbp + 50.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.