user1175409
user1175409

Reputation:

How do you add two Quad words in assembly using NASM?

I have a quad word in EDX:EAX, and another on the stack. How do I add them together?

Upvotes: 3

Views: 1751

Answers (1)

Greg Hewgill
Greg Hewgill

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

Related Questions