dedmon 0 Newbie Poster

my code tester prcedure is given me problems,,,, it compute the entry values that are least and equal to but when I try to validate it I get errors.... Can someone help me. with the code in the red?

integer_count = 20
.data
prompt1 byte "How many integer will be added: ", 0
prompt2 byte "Enter a signed integer: ", 0
prompt3 byte "The sum of the integers is: ", 0
error1   byte "Please enter a integer less than or equal to 20: ", 0
error2   byte "done",0
array dword integer_count dup(20)
 .code
 main proc
 call clrscr
		mov		esi, offset array
		mov		ecx, integer_count
		call	tester	
		call	promptforintegers
		call	arraysum
		call	displaysum		
		exit
main endp

tester proc	uses edx							
		mov edx, offset prompt1
		call writestring
		call readint
		call crlf
.repeat
		.if eax > ecx
		mov edx, offset error1
		call writestring
		call readint
		call crlf		
		call dumpregs
		
		mov ecx,3
		dec ecx
		.if ecx == 0
		
		mov edx, offset error2
		
		exit
		.endif
		.endif

.until eax<=ecx
					
		mov ecx, eax		;count controller			
		ret				
			
	
tester endp


promptforintegers proc uses ecx edx esi


			mov edx, offset prompt2		; "Enter a signed integer"
		L1: call	writestring				; display string
			call readint					; read integer into eax
			call crlf					; go to next output line
			mov [esi] ,eax				; store in array
			add esi, type dword			; next integer
		Loop L1
		ret
promptforintegers endp

arraysum proc uses esi ecx

			mov eax, 0				; set the sum to zero
		L1:	add eax, [esi]			; add each integer to sum
			add esi, type dword		; point to next integer
			call dumpregs
		Loop L1	; repeat for array size
		ret			; sum is in eax
	arraysum endp

;------------------------------------------------------------------
displaysum proc uses edx



			mov	edx, offset prompt3		; "The sum of the ..."
			call	writestring
			call	writeint			; display eax
			call	crlf
		ret
displaysum endp
end main
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.