TITLE Extended Addition (extadd.asm) .686 .MODEL flat, stdcall .STACK 4096 INCLUDE Irvine32.inc .data var1 DWORD 0FFFFFFFFh, 0FFFFFFFFh, 0FFFFFFFFh, 1 var2 DWORD 1, 0, 0, 0 .code main PROC mov EDI, OFFSET var1 mov ESI, OFFSET var2 mov ECX, LENGTHOF var1 call extadd exit main ENDP ; Adds two 64-bit numbers ; Receives: EBX:EAX = first 64-bit number ; EDX:ECX = second 64-bit number ; Returns: result is in EBX:EAX ; arithmetic flags are set add64 PROC add EAX, ECX adc EBX, EDX ret add64 ENDP ; Extended multiword addition of arrays of double words ; First array element is the least significant double word ; Last array element is the most significant doubleword ; Addition should proceed from the first to the last array element ; Receives: EDI = address of destination operand ; ESI = address of source operand ; ECX = count of DWORD in extended integer ; Returns: Result is stored in destination array extadd PROC ; Complete the writing of this procedure extadd ENDP END main