Reputation:
I have a quad word in EDX:EAX, and another on the stack. How do I add them together?
Upvotes: 3
Views: 1751
Reputation: 993413
Suppose one is in EDX:EAX and the other is in ECX:EBX (pop it off the stack or read it from an EBP offset or whatever you like). Then the addition would be something like:
add eax,ebx
adc edx,ecx
The adc
instruction adds the high part of the operands, using the carry from the low part. The result is in EDX:EAX.
Upvotes: 6