Here I'm with another newbie question. Ok I actually want to do is using arrays in for loops to manipulate or copy/move when it's needed. As a start I wanted to read a hard coded array with for loop. Here's my code
section .data
array1: dd 15, 13, 10, 5, 6, 3, 3, 7, 12, 9
array1Len : equ $-array1
range : equ 16
section .bss
array2 resb 16
array3 resb 10
section .text
global _start
_start:
mov eax, 0
jmp for1
;jmp for2
;jmp for3
;jmp for4
for1:
cmp eax, array1Len ;for loop control word
je finished ; if equal jump to finished
push array1 ; pushing array to stack
push eax ; pushing eax to stack for later use
mov eax, 4 ; system call for write
mov ebx, 1
add esp, 1 ; with this I meant to point arrays first element at stack
pop ecx ; first element to ecx
int 80h
dec esp ; pointing pushed loop controller again
pop eax ; move index to eax
add eax, 1 ; add index 1 for each loop
jmp for1
finished:
mov eax, 1
mov ebx, 0
int 80h
Yet when I run this, which gives no error, it seems that there's an infinite loop situation appears. Program neither stop nor give any result for some reason. Any help or suggestions would be appreciated