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.