Hey everyone. I just finished my first program so I thought I would post it for you all. I'm really happy with it, even if it is unoptimized. All I could do when I started was...
mov ex, 1
...now I'm coding like a mad man! Heh, well, not quite yet, but I am definately better. Let me know what you guys think. It works almost exactly like the DirectX Utility Timer. There are also a couple of marcos I made with your help that go along with it. Here you go, enjoy...
mov ex, 1
...now I'm coding like a mad man! Heh, well, not quite yet, but I am definately better. Let me know what you guys think. It works almost exactly like the DirectX Utility Timer. There are also a couple of marcos I made with your help that go along with it. Here you go, enjoy...
AlexEiffel,
I havent tested it yet, but your macro
isnt correct in my eyes. You should first add the low dwords and the add the high dwords with ADC.
I havent tested it yet, but your macro
Add64 MACRO var1, var2, result
;// Save the registers
push eax
push edx
;// Move the high DWORDs into the registers
mov eax, dword ptr var1[4]
mov edx, dword ptr var2[4]
;// Add the high DWORDs
add eax, edx
;// Move the result into the high DWORD of result
mov dword ptr result[4], eax
;// Move the low DWORDs into the registers
mov eax, dword ptr var1
mov edx, dword ptr var2
;// Add the low DWORDs together and include the carry in case the
;// previous addition carried over
adc eax, edx
;// Store the result in the low DWORD of result
mov dword ptr result, eax
;// Restore the registers
pop edx
pop eax
endm
isnt correct in my eyes. You should first add the low dwords and the add the high dwords with ADC.
Hey japheth, thanks a lot for catching that. Strange, The timer seemed to work properly. I agree with you though, I think it is backwards.
It will only effect the timer when there is really a carry in the lower part, or the upper part overflows.