graphic: 0.963 mistranslation: 0.952 performance: 0.929 device: 0.914 debug: 0.913 ppc: 0.909 architecture: 0.820 x86: 0.788 vnc: 0.782 hypervisor: 0.779 semantic: 0.777 assembly: 0.774 boot: 0.755 i386: 0.742 KVM: 0.741 kernel: 0.711 risc-v: 0.694 VMM: 0.678 TCG: 0.664 PID: 0.661 user-level: 0.624 network: 0.578 socket: 0.537 arm: 0.533 peripherals: 0.506 permissions: 0.503 files: 0.439 virtual: 0.389 register: 0.335 unexpect rax value Description of problem: - When I execute "mov -0x8(%rbp), %rax" and "movq 0xb8000, (%rax)", the value of rax should be 0x7fedf but it is 0x7fefe. It is 1 less. Steps to reproduce: - 1. Code currently executed
(gdb) x/2i $pc => 0x2202- 2. Value of memory address -0x8(%rbp): mov -0x8(%rbp),%rax 0x2206 : movq $0xb8000,(%rax)
(gdb) x /xg $rbp-0x8 0x7fec8: 0x000000000007fedf- 3. Value of rax before execution
(gdb) p /x $rax $1 = 0xfffffffd- 4. Value of rax after execution
(gdb) p /x $rax $1 = 0x7fedfIt's all right so far. - 5. View the current execution code again
(gdb) x/i $pc => 0x2207the code address changed from 0x2206 to 0x2207 and the code changed from "movq xx, xx" to "movl xx, xx".: movl $0xb8000,(%rax)