I\'m corrently working on changing examples from complex indirect addresssing mode into simple indirect addressing mode pieces. However, I\'ve come across an example from the B
Example 1:
This:
addl $28, %esp
movl (%eax), %esp
doesn't do the same thing as move %eax, 28(%esp)
. What you're looking for is something like:
addl $28, %esp
movl %eax, (%esp)
But note that your version modifies the value of esp
, while the original instruction does not.
Example 2:
Again, this:
addl $28, %esp
cmpl $4, %esp
doesn't do the same thing as cmpl $4, 28(%esp)
. The original instruction compares the 32-bit value in memory at address esp+28
with the value 4. Your version compares the value esp+28
with the value 4 (i.e. there's no memory access).