; because I still can't rememeber ; x /10dw &Array ; ; s will step to the next line, will step into function ; n will step to the next line in this function MAX_SIZE equ 10 START_VALUE equ 999 segment .data arraySize dd 0 segment .bss Array resd MAX_SIZE segment .text global _start ; rdi holds the array base ; rsi holds the size of the array ; ; for(i =0; i < rsi; ++i) { ; Array[i] = START_VALUE ; } ; ; R12 the number of sides ; R13 is the LDV ; R14 is the base address ; R15 is the offset InitArray: push rbp mov rbp, rsp push r12 push r13 push r14 push r15 mov r14, rdi mov r12, rsi mov r15, 0 mov r13, 0 top: cmp r13, r12 je done mov dword [r14+r15] ,START_VALUE add r15,4 inc r13 jmp top done: pop r15 pop r14 pop r13 pop r12 pop rbp ret _start: mov rsi, 7 mov rdi, Array call InitArray ; exit mov eax, 60 mov edx, 0 syscall