Edit: Answered my own question. See below. -_-
I have a variable defined in the .data segment as follows:
retVal DW 0100h ;stores hex fraction of the intermediate value. Starts at 1.00
This is the value that I add or subtract to to get my return value.
The first time it shows up in the code segment is at the following point:
sub [retVal], ax ;
I have used the debugger, and can confirm that at the time of this operation, the ax register is: 0000h.
Yet, if I add the following line of code immediately before it:
mov dx, 0100h;
mov [retVal], 0100h;
I get a completely different value (also wrong). I'm quite baffled. Am I fundamentally misusing variables here? I don't see why loading the same value the variable was originally initialized to (and hasn't yet been modified from) would alter the results.
Any ideas? Failing that, could someone remind me how to track the value of a variable via CodeView? (The DOSBox debugger I'm using)