I have recently started delving deeper into Assembly, and I could not determine what is going on when I analyze the following code segment. Essentially, 0xFFFFFFFF is moved into
EAX and then 0x10 is added to it. When viewing
EAX within GDB, the value after execution is 0xF rather than 0x9. When I add 0x11, rather than 0x10, the proper result (0x10) is displayed. Any help would be much appreciated.
I have attached debug output below.
The first value after command execution is
EAX, which is displayed using
(gdb) ni $11 = 0xffffffff Dump of assembler code from 0x8048096 to 0x80480a0: => 0x08048096 <_start+22>: add eax,0x10 0x08048099 <_start+25>: mov eax,0x0 0x0804809e <_start+30>: add BYTE PTR ds:0x804910c,0x22 End of assembler dump. 0x08048096 in _start () (gdb) ni $13 = 0xf Dump of assembler code from 0x8048099 to 0x80480a3: => 0x08048099 <_start+25>: mov eax,0x0 0x0804809e <_start+30>: add BYTE PTR ds:0x804910c,0x22 End of assembler dump. 0x08048099 in _start ()