There are several problems in your code.
.data
array dword 3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4
lower dword 4
upper dword 8
ArraySize = ($ - Array) / TYPE lower
Since you are using '$' - Array / 4 (dword size) this would give the wrong result because Lower and Upper variables (memory space) have been added to the calculations. The correct way would be like
.data
lower dword 4
upper dword 8
array dword 3,1,4,1,5,9,2,6,5,3,5,8,9,7,9,3,2,3,8,4,6,2,6,4
ArraySize = ($ - Array) / TYPE lower
Another problem is you are calling WriteString without pointing String Array to EDX. This is causing an Access Violation Exception because EDX is pointing to some garbage memory location. Secondly, DWORD PTR is wrong because the actual datatype is BYTE.
L4:
mov sum, eax
call WriteString
mov edx, DWORD PTR disSum
call WriteString
To fix, you need to do this
mov sum, eax
mov edx, OFFSET disSum
call WriteString
Finally, you have not written code to display the result.
mov eax, sum
call WriteInt
To summarize, there are much easier ways to calculate the sum of elements present in the array. For example
.code
main proc
mov edi,OFFSET Array
mov ecx,LENGTHOF Array
mov eax,0
L1:
add eax,[edi]
add edi,TYPE array
loop L1