I am trying to run a simple program in x86 linux assembly, but it keeps mysteriously segfaulting, and I can't figure out why. The line of code that is causing the problem is:
movl %esi, 0x8(%esi)
In fact I ran a separate program consisting of just this one line of code (embedded in c) and it segfaults. I replaced %esi with $0x0 and it segfaults again. If I replace the entire expression with something like "movl %esi %eax" then it doesn't segfault. So clearly the problem must be with the 0x8(%esi) part. Does this mean I cannot write to the memory location 0x8($esi)?? Any suggestions on how to get around this problem?
Bob
movl %esi, 0x8(%esi)
In fact I ran a separate program consisting of just this one line of code (embedded in c) and it segfaults. I replaced %esi with $0x0 and it segfaults again. If I replace the entire expression with something like "movl %esi %eax" then it doesn't segfault. So clearly the problem must be with the 0x8(%esi) part. Does this mean I cannot write to the memory location 0x8($esi)?? Any suggestions on how to get around this problem?
Bob