Im currently following this youtibe tutorial for assembly x64 (https://www.youtube.com/watch?v=VNDNvm0UY8E&list=RDCMUCq7dxy_qYNEBcHqQVCbc20w&index=3). I know links arent preferred, but in this case there really arent other options.
So I'm using visual studio, and I have this c++ code, just for calling assembly function:
#include <iostream>
using namespace std;
extern "C" int SomeFunction();
int main() {
SomeFunction();
return 0;
}
And this masm assembly code:
.code
SomeFunction proc
mov ax, -1
ret
Somefunction endp
end
Now, I add a breakpoint in the "mov ax, -1" line. When the breakpoint hits, I rightclick ax and add a watch. In the video, the watch on ax has a value of 54864, and when the debugger goes to the next line, it is 65535. When i create the watch, it just has 1 as value, no matter what i do and where the breakpoint is. Why is this?