I am completely lost with this. I need to program that calculates the following expression, using registers: varA = (varA + varB) − (varC + varD), where varA, varB, etc., are variables. Assign integer values to the EAX, EBX, ECX, and EDX registers for the aforementioned variables. (Meaning, you may hardcode the inputs)
My Code:
; AddTwo.asm - adds two 32-bit integers.
; Chapter 3 example
.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword
.data
varA dword 5
varB dword 3
varC dword 4
varD dword 1
.code
main proc
mov eax,varA
add eax,varB
mov ecx,varC
add ecx,varD
mov ebx,varA
sub edx,varD
invoke ExitProcess,0
main endp
end main