Indeed it isn't valid, esp
can not be used as an index
register. The solution is simple though, because it is allowed as a base
: just swap the operands and use leal (%esp, %eax), %eax
. Alternatively, add %esp, %eax
.
PS: movb %bl,(%eax)
is a memory write, not a read, and you said you were trying to "fetch" a byte.
PS #2: of course you don't even need to calculate the address, you can do that in the mov instruction: movb (%esp, %eax), %bl