i need help with, what i believe is complicated but probably isnt, on this following problem. i need to write a sequence of instructions that will do:
variable5= -((variable1 + variable2) - variable3) + (variable2 - variable 4).
thank you in advance.

.data
				
  V1		dd		24
  V2		dd		37
  V3		dd		123
  V4		dd		18
  
  V5		dd		-1
  
	-(( 24 + 37 ) - 123) + ( 37 - 18 )
           ( 61 - 123) + 19
          -(-62) + 19
             62  + 19 = 81

		.code
  Start: 			mov	eax, V2                    ; EAX = 37
  			push	eax                        ; Save temporarily
  			sub	eax, V4                    ; 37 - 18 = 19
  			mov	ecx, eax			; ECX = 19
  			
  			pop	eax                        ; EAX = 37 again
  			add	eax, V1			; EAX = 61
  			sub	eax, V3			; EAX = -62
  			neg	eax			; EAX = 62
  			add	eax, ecx			; Resolve parethesis
  			
  			mov	V5, eax			; V5 = 81
  			
 				ret
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.