assembly language help

not sure if this is the right place for assembly language but if anyone could help at all it would be greatly appreciated.
my assignment is : val1 = 35 val2 = 17 val3 = 86 val4 = 52
(a+b)*2-(c-d)*3 + 5^2.
so far this is what I have but it doesn't seem right
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
TITLE MASM Template						(main.asm)

; Description:
; 
; Revision date:

INCLUDE Irvine32.inc
.data
myMessage BYTE "MASM program example",0dh,0ah,0
    val1    dword	 35
    val2    dword	 17
    val3    dword	 86
    val4	  dword	 52
    ans	  dword	 ?

.code
main PROC
	call Clrscr 

	mov	  eax,val1			 ;	Start with 35
	mov	  ecx,val3			 ;	86
	add	  eax,val2			 ;	35+17 stored in eax
	add	  eax,eax			 ;	multiply sum by two
	sub	  ecx,val4			 ;	86-52 stored in ecx
	mov	  edx,ecx                        
	add	  ecx,ecx
	add	  ecx,edx

	call	  DumpRegs

	mov	 edx,offset myMessage
	call WriteString

	exit
main ENDP

END main
Topic archived. No new replies allowed.