Ultimately, what I am trying to do is make requestInput repeat 25 times and store the input it receives from each iteration into the following index in theSINTArray, but I'm not sure how to put something into an array. The looping I will take care of later, but how would I make it so that the first iteration of requestInput puts the received input into index 0, the second iteration puts the received input into index 1 and so on?
.data
theSINTArray BYTE 25 dup(?)
prompt BYTE "Please enter a value: ",0
.CODE
main PROC
push TYPE theSINTArray
push LENGTHOF theSINTArray
push OFFSET theSINTArray
call requestInput
exit
main ENDP
requestInput PROC
push edx
mov edx,OFFSET prompt
mov edi,OFFSET theSINTArray
call WriteString
call ReadInt
pop edx
ret
requestInput ENDP
END main
My second attempt based on the answer by @SepRoland:
.data
theSINTArray BYTE 25 dup(?)
prompt BYTE "Please enter a value: ",0
.CODE
main PROC
push TYPE theSINTArray
push LENGTHOF theSINTArray
push OFFSET theSINTArray
call requestInput
exit
main ENDP
requestInput PROC
Next:
push edx
mov edx,OFFSET prompt
call WriteString
call ReadInt
mov edx, offset theSINTArray
mov [edx], al
inc edx
cmp edx, offset theSINTArray + 25
jb Next
pop edx
ret
requestInput ENDP
END main