c++ - How come disassemblies for x86 show registers for the x64 platform? -


the code below has undefined behavior. that's reason why trying see assembly (x86) code. surprised presence of registers rbp, rsp, rax, rdi instead of ebp, esp, eax , edi clang , gcc. example, when @ disassembly, while debugging snippet in vs2015, don't see register starting r when i'm compiling x86 platform.

#include <iostream> void f(int i, int j) { std::cout << + j << '\n'; } int main() {     int = 1;     f(i = -1, = -1000);     std::cout << << '\n'; } 

this question has been answered in comments jester:

it disassembled assuming code x64 when in fact code x86 apparently requires -m32 switch disassembler.


Comments