sfl-examples/slide-examples/assembly/ex32.asm

27 lines
554 B
NASM
Raw Normal View History

2023-12-14 14:12:51 +01:00
; 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"