Value assignment to esp assigns a different one?
Posted: Fri Mar 21, 2014 7:31 pm
Ok. I am using qemu, linked with GDB (plus some debugging symbols). In my _start function, here is my code (disassembled by gdb for the sake of comparing the stack_top address with the funky value I get later):
Now, as I step through the code with gdb, immediately after I execute the 0x001001c0 instruction (which sets up the stack obviously), here is what I get for esp when I run "info registers" in gdb:
esp 0x458d8da0 0x458d8da0
---------------------------------------------------------
For comparison, here is the value of esp BEFORE the instruction:
esp 0x7ff00 0x7ff00
How on earth am I getting this wild value immediately after setting the stack to 0x10900d?
Any help would be appreciated.
Code: Select all
0x001001c0 <+0>: mov 0x10900d,%esp
0x001001c6 <+6>: call 0x1001a8 <Alo_Main>
0x001001cb <+11>: cli
0x001001cc <+12>: hlt
0x001001cd <+13>: jmp 0x1001cd <_start+13>
esp 0x458d8da0 0x458d8da0
---------------------------------------------------------
For comparison, here is the value of esp BEFORE the instruction:
esp 0x7ff00 0x7ff00
How on earth am I getting this wild value immediately after setting the stack to 0x10900d?
Any help would be appreciated.