From 625f01166af76b8900fd4d692e075ba45cca6741 Mon Sep 17 00:00:00 2001 From: Michal Isalski Date: Tue, 1 Sep 2026 13:52:26 +0200 Subject: [PATCH] Made find_index conform to new doc guidelines --- array.asm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/array.asm b/array.asm index 0ba4e6b..582ca7b 100644 --- a/array.asm +++ b/array.asm @@ -1,9 +1,14 @@ ; Returns the index of the first element matching the provided predicate function (or -1 if not found) +; Arguments: ; r1 - The array pointer ; r2 - The array length (number of items) ; r3 - The stride (size of one item) - either 1, 2 or 4 (bytes) ; r4 - The predicate ; r5 - Predicate context +; Result: +; r1 - The index of the first element matching the provided predicate function (or -1 if not found) +; Clobbers: r2, r3, r4, r5, r6, + what the predicate clobbers +; Info: ; The predicate function should follow the stdlib calling convention ; The predicate receives two arguments (the value and the predicate context) and should return either a zero when the value is not the one we search for ; , or any other result if it is the searched-for item.