Hi all,
I need to read in 10 2-digit numbers from the user and then output the numbers along with the average.
I am able to read in the numbers one by one, the problem is I have no idea how to build a list to hold all of the 10 digits in one spot.
I am still very new and I do not understand a lot of things so everytime I read in from the user, the digit is placed into what I called 'buffer' and I defined this in the .bss section as:
buffer resb 1
after that I am trying to build a list with these numbers so I am trying to do:
mov [list+esi], buffer
where I defined list in .bss as
list resb 10
and I keep getting the error: operation size not specified at the line "mov [list+esi], buffer"
I am really lost as to how to build this list and also the sizes that I am supposed to be specifying and indexing by. Any help would be appreciated.
Thanks!
segment .data
msg db 'Enter a digit from 10 to 99: #'
len equ $-msg
segment .bss
buffer: resb 1
list: resb 10
segment .text
global _start
_start:
mov esi, 0
mov ecx, 10
read: mov eax, 4
mov ebx, 1
mov edi, ecx
mov ecx, msg
mov edx, len
int 0x80
mov eax, 3
mov ebx, 0
mov ecx, buffer
int 0x80
mov [list+esi], buffer <-- Error
add edi, 1
mov ecx, edi
loop read
mov eax, 4
mov ecx, 1
mov ecx, list
mov edx, 20
int 0x80
exit: mov eax, 1
int 0x80