27 lines
554 B
NASM
27 lines
554 B
NASM
|
; strlen
|
||
|
bits 64
|
||
|
|
||
|
SECTION .data
|
||
|
myarr: times 2000 dd 0
|
||
|
|
||
|
SECTION .text
|
||
|
|
||
|
global _start
|
||
|
_start:
|
||
|
;%include "header.asm.inc"
|
||
|
|
||
|
mov rcx, 100000000 ; loop counter
|
||
|
mov rbx, 3 ; alignment offset
|
||
|
xor r8, r8 ; i'th element in array
|
||
|
|
||
|
lp: lea rax, [myarr+r8*4+rbx]
|
||
|
mov rdx, [rax] ; memory access
|
||
|
add r8, 1
|
||
|
cmp r8, 1999 ; 2000-1, as we have offset
|
||
|
jb pl ; r8 still small enough, skip reset
|
||
|
xor r8, r8 ; reset array index to 0
|
||
|
pl: loop lp
|
||
|
|
||
|
%include "sysexit.asm.inc"
|
||
|
|