Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
A question about using brackets in assembly language?
Sorry for the very unspecific title. I don't know what it is called when you do this. I know that in Intel syntax, putting brackets around a memory address means "the value at that address". So, if we wrote:
mov eax, [ebx]
It would take the value at the address stored in ebx and put it into eax. But what if we do something like this:
mov eax, [ebx-24]
Would this take the value at address ebx-24 and store it into eax (like you would think), or would it simply take the value of ebx-24 and store it into eax?
Also, what would this do?
lea eax, [ebx-24]
How is this different from
mov eax, [ebx-24]
1 Answer
- tLv 57 years agoFavorite Answer
Yes, `mov eax, [ebx-24]` takes the value at address `ebx - 24`. The `lea` instruction computes an address the same way as `mov`, but instead of loading the value stored at that address it loads the address itself. So `lea eax, [ebx-24]` does the same thing as (pseudocode) `eax := ebx - 24`.