後で配列から印刷するために文字列を配列に追加しようとしていますが、これが私が持っているものです。私は何が欠けていますか?
INCLUDE Irvine32.inc
.data
array dword 20 dup (0)
str1 byte 20 dup (0)
temp dword ?
n dword ?
count dword 0
mes1 db "press 1 to add an element, 2 to print, 3 to quit ", 0
.code
main PROC
start:
lea edx, mes1
call writestring
call readdec
cmp eax, 1
je add1
cmp eax, 2
je print2
cmp eax, 3
je stop
add1:
call readin
jmp done
print2:
call print
jmp done
done:
jmp start
stop:
exit
main ENDP
readin proc
lea edx, str1
mov ecx, sizeof str1
call readstring
mov ebx, count
mov eax, [array]
mov temp, eax
add temp, ebx
lea esi, temp
mov ebx, [str1]
mov [esi], ebx
readin endp
print proc
mov esi, 0
mov ecx, n
@@do:
mov eax, Array[esi]
call writedec
call crlf
add esi, 4
@@while: loop @@do
ret
print endp
END main