Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.cpp
- #include <iostream>
- using namespace std;
- extern "C" int GetValueFromASM(unsigned long long num);
- int main()
- {
- unsigned long long x = 18446744073709551615; //max for an unsigned long long number (64bit)
- cout << GetValueFromASM(x) << endl; // prints out -1, why?
- cout << x << endl; // prints out 18446744073709551615 as expected
- cin.get();
- return 0;
- }
- // GetValueFromASM.asm
- .code
- GetValueFromASM proc
- mov rax, 0
- mov rax, rcx
- ret
- GetValueFromASM endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement