Commit 6bd7b55
committed
Implement argmax function
Completed the implementation of the `argmax` function. It scans
an integer array to find the maximum value and returns the
0-based index of its first occurrence.
Changes include:
- Implemented the main loop to iterate through the array.
- Updated maximum value (`t0`) and index (`t1`) when a larger
element is found.
- Ensured the function terminates gracefully using the `end`
label, with the result stored in `a0`.1 parent 3a0d410 commit 6bd7b55
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
| |||
0 commit comments