[BITS 32]

[section .bss]

array: resd 10

[section .text]

extern _printf
global _main

%define index ebp-4

_main:
	push ebp
	mov ebp,esp
	sub esp,4
	mov [index],dword 0
.L0:
	mov ebx,[index]
	mov eax,4
	mul ebx
	mov ebx,eax
	lea eax,[array]
	add ebx,eax
	mov edx,[index]
	mov [ebx],edx
	inc dword [index]
	mov eax,[index]
	cmp eax,10
	jne .L0
	mov [index],dword 0
.L1:
	mov ebx,[index]
	mov eax,4
	mul ebx
	mov ebx,eax
	lea eax,[array]
	add ebx,eax
	push dword [ebx]
	push dword message 
	mov ecx,_printf
	call ecx
	add esp,8
	inc dword [index]
	mov eax,[index]
	cmp eax,10
	jne .L1
	mov eax,0
	leave
	ret
	

[section .data]

message: db 'a=%d',10,0
